diff --git a/src/devices/file.c b/src/devices/file.c index 28d7f63..60d03b3 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -150,7 +150,7 @@ file_deo(Device *d, Uint8 port) case 0x5: DEVPEEK16(a, 0x4); DEVPEEK16(b, 0xa); - res = file_stat(&memory[a], b); + res = file_stat(&bank1[a], b); DEVPOKE16(0x2, res); break; case 0x6: @@ -159,19 +159,19 @@ file_deo(Device *d, Uint8 port) break; case 0x9: DEVPEEK16(a, 0x8); - res = file_init(&memory[a]); + res = file_init(&bank1[a]); DEVPOKE16(0x2, res); break; case 0xd: DEVPEEK16(a, 0xc); DEVPEEK16(b, 0xa); - res = file_read(&memory[a], b); + res = file_read(&bank1[a], b); DEVPOKE16(0x2, res); break; case 0xf: DEVPEEK16(a, 0xe); DEVPEEK16(b, 0xa); - res = file_write(&memory[a], b, d->dat[0x7]); + res = file_write(&bank1[a], b, d->dat[0x7]); DEVPOKE16(0x2, res); break; } diff --git a/src/devices/file.h b/src/devices/file.h index 9df401d..0a1d8bc 100644 --- a/src/devices/file.h +++ b/src/devices/file.h @@ -12,4 +12,4 @@ WITH REGARD TO THIS SOFTWARE. void file_deo(Device *d, Uint8 port); -extern Uint8 *memory; \ No newline at end of file +extern Uint8 *bank1; \ No newline at end of file diff --git a/src/uxncli.c b/src/uxncli.c index e879e33..719a83a 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -4,7 +4,7 @@ #include "uxn.h" -Uint8 *supervisor_memory, *memory; +Uint8 *bank0, *bank1; #include "devices/system.h" #include "devices/file.h" @@ -119,9 +119,9 @@ main(int argc, char **argv) Uxn u; int i, loaded = 0; - supervisor_memory = (Uint8 *)calloc(0x10000, sizeof(Uint8)); - memory = (Uint8 *)calloc(0x10000, sizeof(Uint8)); - if(!uxn_boot(&u, memory, supervisor_memory + PAGE_DEV, (Stack *)(supervisor_memory + PAGE_WST), (Stack *)(supervisor_memory + PAGE_RST))) + bank0 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); + bank1 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); + if(!uxn_boot(&u, bank1, bank0 + PAGE_DEV, (Stack *)(bank0 + PAGE_WST), (Stack *)(bank0 + PAGE_RST))) return error("Boot", "Failed"); /* system */ devsystem = uxn_port(&u, 0x0, system_dei, system_deo); diff --git a/src/uxnemu.c b/src/uxnemu.c index 51aa735..f9e9b08 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -4,7 +4,7 @@ #include "uxn.h" -Uint8 *supervisor_memory, *memory; +Uint8 *bank0, *bank1; #pragma GCC diagnostic push #pragma clang diagnostic push @@ -252,10 +252,10 @@ load(Uxn *u, char *rom) static int start(Uxn *u, char *rom) { - memory = (Uint8 *)calloc(0x10000, sizeof(Uint8)); - supervisor_memory = (Uint8 *)calloc(0x10000, sizeof(Uint8)); + bank1 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); + bank0 = (Uint8 *)calloc(0x10000, sizeof(Uint8)); - if(!uxn_boot(u, memory, supervisor_memory + PAGE_DEV, (Stack *)(supervisor_memory + PAGE_WST), (Stack *)(supervisor_memory + PAGE_RST))) + if(!uxn_boot(u, bank1, bank0 + PAGE_DEV, (Stack *)(bank0 + PAGE_WST), (Stack *)(bank0 + PAGE_RST))) return error("Boot", "Failed to start uxn."); if(!load(u, rom)) return error("Boot", "Failed to load rom."); @@ -277,7 +277,7 @@ start(Uxn *u, char *rom) /* unused */ uxn_port(u, 0xf, nil_dei, nil_deo); /* Supervisor */ - if(!uxn_boot(&supervisor, supervisor_memory, supervisor_memory + VISOR_DEV, (Stack *)(supervisor_memory + VISOR_WST), (Stack *)(supervisor_memory + VISOR_RST))) + if(!uxn_boot(&supervisor, bank0, bank0 + VISOR_DEV, (Stack *)(bank0 + VISOR_WST), (Stack *)(bank0 + VISOR_RST))) return error("Boot", "Failed to start uxn."); if(!load(&supervisor, "supervisor.rom")) error("Supervisor", "No debugger found.");