commit d551067
Devine Lu Linvega
·
2026-01-21 18:25:45 +0000 UTC
parent 73eb4ab
Merged redundant macros
1 files changed,
+12,
-16
+12,
-16
1@@ -1051,14 +1051,10 @@ emu_deo(const Uint8 port, const Uint8 value)
2 #define PEK(i,r,m) r[0] = ram[i]; if(_2) r[1] = ram[(i + 1) & m];
3
4 #define OPC(opc, A, B) {\
5- case 0x00|opc: {const int _2=0;A B} goto step;\
6- case 0x20|opc: {const int _2=1;A B} goto step;\
7- case 0x40|opc: {const int _2=0;A B} goto step;\
8- case 0x60|opc: {const int _2=1;A B} goto step;\
9- case 0x80|opc: {const int _2=0;int k=*p; A *p=k;B} goto step;\
10- case 0xa0|opc: {const int _2=1;int k=*p; A *p=k;B} goto step;\
11- case 0xc0|opc: {const int _2=0;int k=*p; A *p=k;B} goto step;\
12- case 0xe0|opc: {const int _2=1;int k=*p; A *p=k;B} goto step;}
13+case 0x00|opc: case 0x40|opc: {const int _2=0;A B} goto step;\
14+case 0x20|opc: case 0x60|opc: {const int _2=1;A B} goto step;\
15+case 0x80|opc: case 0xc0|opc: {const int _2=0;int k=*p; A *p=k;B} goto step;\
16+case 0xa0|opc: case 0xe0|opc: {const int _2=1;int k=*p; A *p=k;B} goto step;}
17
18 static unsigned
19 uxn_eval(Uint16 pc)
20@@ -1067,14 +1063,14 @@ uxn_eval(Uint16 pc)
21 step: {
22 Uint8 op = ram[pc++], r = (op >> 6) & 1, *s = stk[r], *p = &ptr[r];
23 switch(op) {
24- /* BRK */ case 0x00: return 1;
25- /* JCI */ case 0x20: if(stk[0][--ptr[0]]) JMP(c) else pc += 2; goto step;
26- /* JMI */ case 0x40: JMP(c) goto step;
27- /* JSI */ case 0x60: { JMP(0) PU2(pc) pc += c; } goto step;
28- /* LI2 */ case 0xa0: INC = ram[pc++]; /* fall through */
29- /* LIT */ case 0x80: INC = ram[pc++]; goto step;
30- /* L2r */ case 0xe0: INC = ram[pc++]; /* fall through */
31- /* LIr */ case 0xc0: INC = ram[pc++]; goto step;
32+ /* BRK */ case 0x00:return 1;
33+ /* JCI */ case 0x20:if(DEC) JMP(c) else pc += 2; goto step;
34+ /* JMI */ case 0x40:JMP(c) goto step;
35+ /* JSI */ case 0x60:JMP(0) PU2(pc) pc += c; goto step;
36+ /* LI2 */ case 0xa0:INC = ram[pc++]; // fall through
37+ /* LIT */ case 0x80:INC = ram[pc++]; goto step;
38+ /* L2r */ case 0xe0:INC = ram[pc++]; // fall through
39+ /* LIr */ case 0xc0:INC = ram[pc++]; goto step;
40 /* INC */ OPC(0x01,POx(a),PUx(a + 1))
41 /* POP */ OPC(0x02,REM,(void)s;)
42 /* NIP */ OPC(0x03,POt(x) REM,PUt(x))