Do not pass memory to system_deo

This commit is contained in:
Devine Lu Linvega 2024-06-30 20:50:14 -08:00
parent 576d9b6b89
commit f8ec872f63
4 changed files with 7 additions and 8 deletions

View File

@ -101,12 +101,12 @@ system_dei(Uint8 addr)
} }
void void
system_deo(Uint8 *d, Uint8 port) system_deo(Uint8 port)
{ {
Uint16 addr; Uint16 addr;
switch(port) { switch(port) {
case 0x3: case 0x3:
addr = PEEK2(d + 2); addr = PEEK2(uxn.dev + 2);
if(uxn.ram[addr] == 0x0) { if(uxn.ram[addr] == 0x0) {
Uint8 value = uxn.ram[addr + 7]; Uint8 value = uxn.ram[addr + 7];
Uint16 i, length = PEEK2(uxn.ram + addr + 1); 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]); fprintf(stderr, "Unknown Expansion Command 0x%02x\n", uxn.ram[addr]);
break; break;
case 0x4: case 0x4:
uxn.wst.ptr = d[4]; uxn.wst.ptr = uxn.dev[4];
break; break;
case 0x5: case 0x5:
uxn.rst.ptr = d[5]; uxn.rst.ptr = uxn.dev[5];
break; break;
case 0xe: case 0xe:
system_inspect(); system_inspect();

View File

@ -9,7 +9,6 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE. WITH REGARD TO THIS SOFTWARE.
*/ */
#define SYSTEM_VERSION 2
#define RAM_PAGES 0x10 #define RAM_PAGES 0x10
void system_reboot(char *rom, int soft); 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); int system_boot(Uint8 *ram, char *rom);
Uint8 system_dei(Uint8 addr); Uint8 system_dei(Uint8 addr);
void system_deo(Uint8 *d, Uint8 port); void system_deo(Uint8 port);
extern char *boot_rom; extern char *boot_rom;

View File

@ -63,7 +63,7 @@ emu_deo(Uint8 addr, Uint8 value)
uxn.dev[addr] = value; uxn.dev[addr] = value;
switch(d) { switch(d) {
case 0x00: case 0x00:
system_deo(&uxn.dev[d], p); system_deo(p);
if(p > 0x7 && p < 0xe) if(p > 0x7 && p < 0xe)
screen_palette(&uxn.dev[0x8]); screen_palette(&uxn.dev[0x8]);
break; break;

View File

@ -37,7 +37,7 @@ emu_deo(Uint8 addr, Uint8 value)
Uint8 p = addr & 0x0f, d = addr & 0xf0; Uint8 p = addr & 0x0f, d = addr & 0xf0;
uxn.dev[addr] = value; uxn.dev[addr] = value;
switch(d) { 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 0x10: console_deo(&uxn.dev[d], p); break;
case 0xa0: file_deo(0, &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; case 0xb0: file_deo(1, &uxn.dev[d], p); break;