| ... | ... |
@@ -150,7 +150,7 @@ file_deo(Device *d, Uint8 port) |
| 150 | 150 |
case 0x5: |
| 151 | 151 |
DEVPEEK16(a, 0x4); |
| 152 | 152 |
DEVPEEK16(b, 0xa); |
| 153 |
- res = file_stat(&bank0[a], b); |
|
| 153 |
+ res = file_stat(&d->u->ram[a], b); |
|
| 154 | 154 |
DEVPOKE16(0x2, res); |
| 155 | 155 |
break; |
| 156 | 156 |
case 0x6: |
| ... | ... |
@@ -159,19 +159,19 @@ file_deo(Device *d, Uint8 port) |
| 159 | 159 |
break; |
| 160 | 160 |
case 0x9: |
| 161 | 161 |
DEVPEEK16(a, 0x8); |
| 162 |
- res = file_init(&bank0[a]); |
|
| 162 |
+ res = file_init(&d->u->ram[a]); |
|
| 163 | 163 |
DEVPOKE16(0x2, res); |
| 164 | 164 |
break; |
| 165 | 165 |
case 0xd: |
| 166 | 166 |
DEVPEEK16(a, 0xc); |
| 167 | 167 |
DEVPEEK16(b, 0xa); |
| 168 |
- res = file_read(&bank0[a], b); |
|
| 168 |
+ res = file_read(&d->u->ram[a], b); |
|
| 169 | 169 |
DEVPOKE16(0x2, res); |
| 170 | 170 |
break; |
| 171 | 171 |
case 0xf: |
| 172 | 172 |
DEVPEEK16(a, 0xe); |
| 173 | 173 |
DEVPEEK16(b, 0xa); |
| 174 |
- res = file_write(&bank0[a], b, d->dat[0x7]); |
|
| 174 |
+ res = file_write(&d->u->ram[a], b, d->dat[0x7]); |
|
| 175 | 175 |
DEVPOKE16(0x2, res); |
| 176 | 176 |
break; |
| 177 | 177 |
} |
| ... | ... |
@@ -2,9 +2,6 @@ |
| 2 | 2 |
#include <stdlib.h> |
| 3 | 3 |
|
| 4 | 4 |
#include "uxn.h" |
| 5 |
- |
|
| 6 |
-Uint8 *bank0; |
|
| 7 |
- |
|
| 8 | 5 |
#include "devices/system.h" |
| 9 | 6 |
#include "devices/file.h" |
| 10 | 7 |
#include "devices/datetime.h" |
| ... | ... |
@@ -118,8 +115,7 @@ load(Uxn *u, char *filepath) |
| 118 | 115 |
static int |
| 119 | 116 |
start(Uxn *u) |
| 120 | 117 |
{
|
| 121 |
- bank0 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); |
|
| 122 |
- if(!uxn_boot(u, bank0)) |
|
| 118 |
+ if(!uxn_boot(u, (Uint8 *)calloc(0x10000, sizeof(Uint8)))) |
|
| 123 | 119 |
return error("Boot", "Failed");
|
| 124 | 120 |
/* system */ uxn_port(u, 0x0, system_dei, system_deo); |
| 125 | 121 |
/* console */ uxn_port(u, 0x1, nil_dei, console_deo); |
| ... | ... |
@@ -3,8 +3,6 @@ |
| 3 | 3 |
|
| 4 | 4 |
#include "uxn.h" |
| 5 | 5 |
|
| 6 |
-Uint8 *bank0; |
|
| 7 |
- |
|
| 8 | 6 |
#pragma GCC diagnostic push |
| 9 | 7 |
#pragma clang diagnostic push |
| 10 | 8 |
#pragma GCC diagnostic ignored "-Wpedantic" |
| ... | ... |
@@ -262,9 +260,7 @@ load(Uxn *u, char *rom) |
| 262 | 260 |
static int |
| 263 | 261 |
start(Uxn *u, char *rom) |
| 264 | 262 |
{
|
| 265 |
- bank0 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); |
|
| 266 |
- |
|
| 267 |
- if(!uxn_boot(u, bank0)) |
|
| 263 |
+ if(!uxn_boot(u, (Uint8 *)calloc(0x10000, sizeof(Uint8)))) |
|
| 268 | 264 |
return error("Boot", "Failed to start uxn.");
|
| 269 | 265 |
if(!load(u, rom)) |
| 270 | 266 |
return error("Boot", "Failed to load rom.");
|