From f8ec872f63400d5b92000605977595cc1353b3a7 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 30 Jun 2024 20:50:14 -0800 Subject: [PATCH] Do not pass memory to system_deo --- src/devices/system.c | 8 ++++---- src/devices/system.h | 3 +-- src/uxn11.c | 2 +- src/uxncli.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/devices/system.c b/src/devices/system.c index 3850ea9..acb2086 100644 --- a/src/devices/system.c +++ b/src/devices/system.c @@ -101,12 +101,12 @@ system_dei(Uint8 addr) } void -system_deo(Uint8 *d, Uint8 port) +system_deo(Uint8 port) { Uint16 addr; switch(port) { case 0x3: - addr = PEEK2(d + 2); + addr = PEEK2(uxn.dev + 2); if(uxn.ram[addr] == 0x0) { Uint8 value = uxn.ram[addr + 7]; Uint16 i, length = PEEK2(uxn.ram + addr + 1); @@ -132,10 +132,10 @@ system_deo(Uint8 *d, Uint8 port) fprintf(stderr, "Unknown Expansion Command 0x%02x\n", uxn.ram[addr]); break; case 0x4: - uxn.wst.ptr = d[4]; + uxn.wst.ptr = uxn.dev[4]; break; case 0x5: - uxn.rst.ptr = d[5]; + uxn.rst.ptr = uxn.dev[5]; break; case 0xe: system_inspect(); diff --git a/src/devices/system.h b/src/devices/system.h index da129c3..60440fb 100644 --- a/src/devices/system.h +++ b/src/devices/system.h @@ -9,7 +9,6 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -#define SYSTEM_VERSION 2 #define RAM_PAGES 0x10 void system_reboot(char *rom, int soft); @@ -18,6 +17,6 @@ int system_error(char *msg, const char *err); int system_boot(Uint8 *ram, char *rom); Uint8 system_dei(Uint8 addr); -void system_deo(Uint8 *d, Uint8 port); +void system_deo(Uint8 port); extern char *boot_rom; \ No newline at end of file diff --git a/src/uxn11.c b/src/uxn11.c index aecf100..15323b0 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -63,7 +63,7 @@ emu_deo(Uint8 addr, Uint8 value) uxn.dev[addr] = value; switch(d) { case 0x00: - system_deo(&uxn.dev[d], p); + system_deo(p); if(p > 0x7 && p < 0xe) screen_palette(&uxn.dev[0x8]); break; diff --git a/src/uxncli.c b/src/uxncli.c index 85cc05c..526e823 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -37,7 +37,7 @@ emu_deo(Uint8 addr, Uint8 value) Uint8 p = addr & 0x0f, d = addr & 0xf0; uxn.dev[addr] = value; switch(d) { - case 0x00: system_deo(&uxn.dev[d], p); break; + case 0x00: system_deo(p); break; case 0x10: console_deo(&uxn.dev[d], p); break; case 0xa0: file_deo(0, &uxn.dev[d], p); break; case 0xb0: file_deo(1, &uxn.dev[d], p); break;