commit e4b4c2f

Devine Lu Linvega  ·  2024-08-17 03:25:50 +0000 UTC
parent a277ae1
(uxn.c) POK makes use of GET/PUT microcode
1 files changed,  +7, -7
+7, -7
 1@@ -37,13 +37,13 @@ WITH REGARD TO THIS SOFTWARE.
 2 #define PFx(y) if(_2) { PF2(y) } else PF1(y)
 3 #define PF2(y) tt = (y); PF1(tt >> 8) PF1(tt)
 4 #define PF1(y) if(_r) INC(wst) = y; else INC(rst) = y;
 5-#define DEI(p, o) if(_2) { o = (emu_dei(p) << 8) | emu_dei(p + 1); } else o = emu_dei(p);
 6-#define DEO(p, y) if(_2) { emu_deo(p, y >> 8), emu_deo(p + 1, y); } else emu_deo(p, y);
 7-#define PEK(o, x, r) if(_2) { r = (x); o = uxn.ram[r++] << 8 | uxn.ram[r]; } else o = uxn.ram[(x)];
 8-#define POK(x, y, r) if(_2) { r = (x); uxn.ram[r++] = y >> 8, uxn.ram[r] = y; } else uxn.ram[(x)] = (y);
 9 
10 #define GET(x,y) if(_2) PO1(y) PO1(x)
11 #define PUT(x,y) PU1(x) if(_2) PU1(y)
12+#define DEI(p, o) if(_2) { o = (emu_dei(p) << 8) | emu_dei(p + 1); } else o = emu_dei(p);
13+#define DEO(p, y) if(_2) { emu_deo(p, y >> 8), emu_deo(p + 1, y); } else emu_deo(p, y);
14+#define PEK(o, x, r) if(_2) { r = (x); o = uxn.ram[r++] << 8 | uxn.ram[r]; } else o = uxn.ram[(x)];
15+#define POK(x, y, z, r) if(_2) { r = (x); uxn.ram[r++] = y, uxn.ram[r] = z; } else uxn.ram[(x)] = (y);
16 
17 int
18 uxn_eval(Uint16 pc)
19@@ -78,11 +78,11 @@ uxn_eval(Uint16 pc)
20 		/* JSR */ OPC(0x0e, POx(a),PF2(pc) JMP(a))
21 		/* STH */ OPC(0x0f, POx(a),PFx(a))
22 		/* LDZ */ OPC(0x10, PO1(a),PEK(b, a, t) PUx(b))
23-		/* STZ */ OPC(0x11, PO1(a) POx(b),POK(a, b, t))
24+		/* STZ */ OPC(0x11, PO1(a) GET(b,c),POK(a, b, c, t))
25 		/* LDR */ OPC(0x12, PO1(a),PEK(b, pc + (Sint8)a, tt) PUx(b))
26-		/* STR */ OPC(0x13, PO1(a) POx(b),POK(pc + (Sint8)a, b, tt))
27+		/* STR */ OPC(0x13, PO1(a) GET(b,c),POK(pc + (Sint8)a, b, c, tt))
28 		/* LDA */ OPC(0x14, PO2(a),PEK(b, a, tt) PUx(b))
29-		/* STA */ OPC(0x15, PO2(a) POx(b),POK(a, b, tt))
30+		/* STA */ OPC(0x15, PO2(a) GET(b,c),POK(a, b, c, tt))
31 		/* DEI */ OPC(0x16, PO1(a),DEI(a, b) PUx(b))
32 		/* DEO */ OPC(0x17, PO1(a) POx(b),DEO(a, b))
33 		/* ADD */ OPC(0x18, POx(a) POx(b),PUx(b + a))