commit bc3f46e

Devine Lu Linvega  ·  2025-05-13 00:10:55 +0000 UTC
parent 593f9ad
Inlined deis
2 files changed,  +29, -67
+20, -43
 1@@ -195,16 +195,6 @@ system_reboot(int soft)
 2 	return system_boot(uxn.ram, system_boot_path, 0);
 3 }
 4 
 5-static Uint8
 6-system_dei(Uint8 addr)
 7-{
 8-	switch(addr) {
 9-	case 0x4: return uxn.wst.ptr;
10-	case 0x5: return uxn.rst.ptr;
11-	default: return uxn.dev[addr];
12-	}
13-}
14-
15 static void
16 system_expansion(Uint16 addr)
17 {
18@@ -425,16 +415,6 @@ console_input(int c, int type)
19 	return type != 4;
20 }
21 
22-static Uint8
23-console_dei(Uint8 addr)
24-{
25-	switch(addr) {
26-	case CMD_LIVE:
27-	case CMD_EXIT: check_child(); break;
28-	}
29-	return uxn.dev[addr];
30-}
31-
32 /*
33 @|Screen ------------------------------------------------------------ */
34 
35@@ -630,24 +610,6 @@ screen_draw_sprite(void)
36 	if(rMY) rY += rDY * fy;
37 }
38 
39-static Uint8
40-screen_dei(Uint8 addr)
41-{
42-	switch(addr) {
43-	case 0x22: return uxn_screen.width >> 8;
44-	case 0x23: return uxn_screen.width;
45-	case 0x24: return uxn_screen.height >> 8;
46-	case 0x25: return uxn_screen.height;
47-	case 0x28: return rX >> 8;
48-	case 0x29: return rX;
49-	case 0x2a: return rY >> 8;
50-	case 0x2b: return rY;
51-	case 0x2c: return rA >> 8;
52-	case 0x2d: return rA;
53-	default: return uxn.dev[addr];
54-	}
55-}
56-
57 /*
58 @|Controller -------------------------------------------------------- */
59 
60@@ -989,12 +951,27 @@ datetime_dei(Uint8 addr)
61 Uint8
62 emu_dei(Uint8 addr)
63 {
64-	switch(addr & 0xf0) {
65-	case 0x00: return system_dei(addr);
66-	case 0x10: return console_dei(addr);
67-	case 0x20: return screen_dei(addr);
68-	case 0xc0: return datetime_dei(addr);
69+	switch(addr) {
70+	/* System */
71+	case 0x04: return uxn.wst.ptr;
72+	case 0x05: return uxn.rst.ptr;
73+	/* Console */
74+	case CMD_LIVE:
75+	case CMD_EXIT: check_child(); break;
76+	/* Screen */
77+	case 0x22: return uxn_screen.width >> 8;
78+	case 0x23: return uxn_screen.width;
79+	case 0x24: return uxn_screen.height >> 8;
80+	case 0x25: return uxn_screen.height;
81+	case 0x28: return rX >> 8;
82+	case 0x29: return rX;
83+	case 0x2a: return rY >> 8;
84+	case 0x2b: return rY;
85+	case 0x2c: return rA >> 8;
86+	case 0x2d: return rA;
87 	}
88+	if((addr & 0xf0) == 0xc0)
89+		return datetime_dei(addr);
90 	return uxn.dev[addr];
91 }
92 
+9, -24
 1@@ -170,16 +170,6 @@ system_boot(Uint8 *ram, char *rom_path, int has_args)
 2 	return 0;
 3 }
 4 
 5-static Uint8
 6-system_dei(Uint8 addr)
 7-{
 8-	switch(addr) {
 9-	case 0x4: return uxn.wst.ptr;
10-	case 0x5: return uxn.rst.ptr;
11-	default: return uxn.dev[addr];
12-	}
13-}
14-
15 static void
16 system_expansion(Uint16 addr)
17 {
18@@ -394,16 +384,6 @@ console_input(int c, int type)
19 	return type != 4;
20 }
21 
22-static Uint8
23-console_dei(Uint8 addr)
24-{
25-	switch(addr) {
26-	case CMD_LIVE:
27-	case CMD_EXIT: check_child(); break;
28-	}
29-	return uxn.dev[addr];
30-}
31-
32 /*
33 @|File -------------------------------------------------------------- */
34 
35@@ -674,11 +654,16 @@ datetime_dei(Uint8 addr)
36 Uint8
37 emu_dei(Uint8 addr)
38 {
39-	switch(addr & 0xf0) {
40-	case 0x00: return system_dei(addr);
41-	case 0x10: console_dei(addr); break;
42-	case 0xc0: return datetime_dei(addr);
43+	switch(addr) {
44+	/* System */
45+	case 0x04: return uxn.wst.ptr;
46+	case 0x05: return uxn.rst.ptr;
47+	/* Console */
48+	case CMD_LIVE:
49+	case CMD_EXIT: check_child(); break;
50 	}
51+	if((addr & 0xf0) == 0xc0)
52+		return datetime_dei(addr);
53 	return uxn.dev[addr];
54 }
55