commit f900f01

Devine Lu Linvega  ·  2026-05-20 15:39:13 +0000 UTC
parent b464f35
Improved DEI opcode
2 files changed,  +4, -4
+1, -1
1@@ -23,7 +23,7 @@
2 @|test )
3 
4 @system/test-wst ( --  pass )
5-	#12 .System/wst DEI #01 EQU NIP JMP2r
6+	#12 .System/wst DEI #02 EQU NIP JMP2r
7 
8 @system/test-rst ( --  pass )
9 	LITr 12 .System/rst DEI #03 EQU POPr JMP2r
+3, -3
 1@@ -1003,7 +1003,7 @@ emu_deo(const Uint8 port, const Uint8 value)
 2 #define Pux(s,v)    if(d) Pu1(s,(v)>>8) Pu1(s,v)
 3 #define Lda(s,o)    Pu1(r,ram[o]) if(d) Pu1(r,ram[(s)(o+1)])
 4 #define Sta(s,o,u)  if(d) ram[o]=u>>8, ram[(s)(o+1)]=u; else ram[o]=u;
 5-#define Dei         Uint16 tt; Uint16 t=emu_dei(x); Pu1(r,t) if(d) tt=emu_dei(x+1), Pu1(r,tt)
 6+#define Dei         Pu1(r,emu_dei(x)) if(d) Pu1(r,emu_dei(x+1))
 7 #define Deo         if(d) emu_deo(x,y>>8), emu_deo(x+1,y); else emu_deo(x,y);
 8 
 9 #define MUTE (void)x;(void)y;(void)z;(void)r;(void)d;
10@@ -1027,7 +1027,7 @@ uxn_eval(Uint16 start_pc)
11 	/* BRK */ case 0x00: return 1;
12 	/* JCI */ case 0x20: { Uint16 a=ram[pc]<<8|ram[pc+1]; pc+=2; if(stk[0][--ptr[0]]) pc+=a; } break;
13 	/* JMI */ case 0x40: { Uint16 a=ram[pc]<<8|ram[pc+1]; pc+=2+a; } break;
14-	/* JSI */ case 0x60: { const Uint8 d=1; Uint16 a=ram[pc]<<8|ram[pc+1]; pc+=2; Pux(1,pc); pc+=a; } break;
15+	/* JSI */ case 0x60: { Uint16 a=ram[pc]<<8|ram[pc+1]; const Uint8 d=1; pc+=2; Pux(1,pc); pc+=a; } break;
16 	/* LIT */ case 0x80: { const Uint8 r=0,d=0; Lda(Uint16,pc); pc+=1; } break;
17 	/* LI2 */ case 0xa0: { const Uint8 r=0,d=1; Lda(Uint16,pc); pc+=2; } break;
18 	/* LIr */ case 0xc0: { const Uint8 r=1,d=0; Lda(Uint16,pc); pc+=1; } break;
19@@ -1284,7 +1284,7 @@ main(int argc, char **argv)
20 {
21 	int i = 1;
22 	if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
23-		return !fprintf(stdout, "%s - Varvara Emulator, 19 May 2026.\n", argv[0]);
24+		return !fprintf(stdout, "%s - Varvara Emulator, 20 May 2026.\n", argv[0]);
25 	else if(argc == 1)
26 		return !fprintf(stdout, "usage: %s [-v] file.rom [args..]\n", argv[0]);
27 	else if(!system_boot(argv[i++], argc > 2))