commit f8ec872
Devine Lu Linvega
·
2024-07-01 04:50:14 +0000 UTC
parent 576d9b6
Do not pass memory to system_deo
4 files changed,
+7,
-8
+4,
-4
1@@ -101,12 +101,12 @@ system_dei(Uint8 addr)
2 }
3
4 void
5-system_deo(Uint8 *d, Uint8 port)
6+system_deo(Uint8 port)
7 {
8 Uint16 addr;
9 switch(port) {
10 case 0x3:
11- addr = PEEK2(d + 2);
12+ addr = PEEK2(uxn.dev + 2);
13 if(uxn.ram[addr] == 0x0) {
14 Uint8 value = uxn.ram[addr + 7];
15 Uint16 i, length = PEEK2(uxn.ram + addr + 1);
16@@ -132,10 +132,10 @@ system_deo(Uint8 *d, Uint8 port)
17 fprintf(stderr, "Unknown Expansion Command 0x%02x\n", uxn.ram[addr]);
18 break;
19 case 0x4:
20- uxn.wst.ptr = d[4];
21+ uxn.wst.ptr = uxn.dev[4];
22 break;
23 case 0x5:
24- uxn.rst.ptr = d[5];
25+ uxn.rst.ptr = uxn.dev[5];
26 break;
27 case 0xe:
28 system_inspect();
+1,
-2
1@@ -9,7 +9,6 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
2 WITH REGARD TO THIS SOFTWARE.
3 */
4
5-#define SYSTEM_VERSION 2
6 #define RAM_PAGES 0x10
7
8 void system_reboot(char *rom, int soft);
9@@ -18,6 +17,6 @@ int system_error(char *msg, const char *err);
10 int system_boot(Uint8 *ram, char *rom);
11
12 Uint8 system_dei(Uint8 addr);
13-void system_deo(Uint8 *d, Uint8 port);
14+void system_deo(Uint8 port);
15
16 extern char *boot_rom;
+1,
-1
1@@ -63,7 +63,7 @@ emu_deo(Uint8 addr, Uint8 value)
2 uxn.dev[addr] = value;
3 switch(d) {
4 case 0x00:
5- system_deo(&uxn.dev[d], p);
6+ system_deo(p);
7 if(p > 0x7 && p < 0xe)
8 screen_palette(&uxn.dev[0x8]);
9 break;
+1,
-1
1@@ -37,7 +37,7 @@ emu_deo(Uint8 addr, Uint8 value)
2 Uint8 p = addr & 0x0f, d = addr & 0xf0;
3 uxn.dev[addr] = value;
4 switch(d) {
5- case 0x00: system_deo(&uxn.dev[d], p); break;
6+ case 0x00: system_deo(p); break;
7 case 0x10: console_deo(&uxn.dev[d], p); break;
8 case 0xa0: file_deo(0, &uxn.dev[d], p); break;
9 case 0xb0: file_deo(1, &uxn.dev[d], p); break;