commit 6e094ca

Devine Lu Linvega  ·  2024-06-29 19:27:19 +0000 UTC
parent f4f05d0
Removed indirections in file device
6 files changed,  +13, -13
+2, -2
1@@ -31,6 +31,6 @@ clean:
2 bin/uxnasm: src/uxnasm.c
3 	@ cc ${RELEASE_flags} ${CFLAGS} src/uxnasm.c -o bin/uxnasm
4 bin/uxncli: ${CLI_src} src/uxncli.c
5-	@ cc ${RELEASE_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli
6+	@ cc ${DEBUG_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli
7 bin/uxn11: ${EMU_src} src/uxn11.c
8-	@ cc ${RELEASE_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11
9+	@ cc ${DEBUG_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11
+5, -5
 1@@ -245,7 +245,7 @@ file_delete(UxnFile *c)
 2 /* IO */
 3 
 4 void
 5-file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
 6+file_deo(Uint8 id, Uint8 *d, Uint8 port)
 7 {
 8 	UxnFile *c = &uxn_file[id];
 9 	Uint16 addr, len, res;
10@@ -255,7 +255,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
11 		len = PEEK2(d + 0xa);
12 		if(len > 0x10000 - addr)
13 			len = 0x10000 - addr;
14-		res = file_stat(c, &ram[addr], len);
15+		res = file_stat(c, &uxn.ram[addr], len);
16 		POKE2(d + 0x2, res);
17 		break;
18 	case 0x6:
19@@ -264,7 +264,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
20 		break;
21 	case 0x9:
22 		addr = PEEK2(d + 0x8);
23-		res = file_init(c, (char *)&ram[addr], 0x10000 - addr, 0);
24+		res = file_init(c, (char *)&uxn.ram[addr], 0x10000 - addr, 0);
25 		POKE2(d + 0x2, res);
26 		break;
27 	case 0xd:
28@@ -272,7 +272,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
29 		len = PEEK2(d + 0xa);
30 		if(len > 0x10000 - addr)
31 			len = 0x10000 - addr;
32-		res = file_read(c, &ram[addr], len);
33+		res = file_read(c, &uxn.ram[addr], len);
34 		POKE2(d + 0x2, res);
35 		break;
36 	case 0xf:
37@@ -280,7 +280,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port)
38 		len = PEEK2(d + 0xa);
39 		if(len > 0x10000 - addr)
40 			len = 0x10000 - addr;
41-		res = file_write(c, &ram[addr], len, d[0x7]);
42+		res = file_write(c, &uxn.ram[addr], len, d[0x7]);
43 		POKE2(d + 0x2, res);
44 		break;
45 	}
+1, -1
1@@ -14,4 +14,4 @@ WITH REGARD TO THIS SOFTWARE.
2 #define POLYFILEY 2
3 #define DEV_FILE0 0xa
4 
5-void file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port);
6+void file_deo(Uint8 id, Uint8 *d, Uint8 port);
+1, -1
1@@ -13,7 +13,7 @@ WITH REGARD TO THIS SOFTWARE.
2 #define RAM_PAGES 0x10
3 
4 void system_reboot(char *rom, int soft);
5-void system_inspect();
6+void system_inspect(void);
7 int system_error(char *msg, const char *err);
8 int system_boot(Uint8 *ram, char *rom);
9 
+2, -2
 1@@ -69,8 +69,8 @@ emu_deo(Uint8 addr, Uint8 value)
 2 		break;
 3 	case 0x10: console_deo(&uxn.dev[d], p); break;
 4 	case 0x20: screen_deo(&uxn.dev[d], p); break;
 5-	case 0xa0: file_deo(0, uxn.ram, &uxn.dev[d], p); break;
 6-	case 0xb0: file_deo(1, uxn.ram, &uxn.dev[d], p); break;
 7+	case 0xa0: file_deo(0, &uxn.dev[d], p); break;
 8+	case 0xb0: file_deo(1, &uxn.dev[d], p); break;
 9 	}
10 }
11 
+2, -2
 1@@ -39,8 +39,8 @@ emu_deo(Uint8 addr, Uint8 value)
 2 	switch(d) {
 3 	case 0x00: system_deo(&uxn.dev[d], p); break;
 4 	case 0x10: console_deo(&uxn.dev[d], p); break;
 5-	case 0xa0: file_deo(0, uxn.ram, &uxn.dev[d], p); break;
 6-	case 0xb0: file_deo(1, uxn.ram, &uxn.dev[d], p); break;
 7+	case 0xa0: file_deo(0, &uxn.dev[d], p); break;
 8+	case 0xb0: file_deo(1, &uxn.dev[d], p); break;
 9 	}
10 }
11