From a98ba20d2063aa82a1b46a93c09fcb9ddbff0cbb Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 17 Aug 2024 11:03:11 -0700 Subject: [PATCH] (uxn.c) Added micro opcode without assignment --- src/uxn.c | 5 +++-- src/uxn11.c | 2 +- src/uxncli.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uxn.c b/src/uxn.c index 753e8ea..3ca57c3 100644 --- a/src/uxn.c +++ b/src/uxn.c @@ -24,6 +24,7 @@ WITH REGARD TO THIS SOFTWARE. /* Microcode */ +#define REM if(_r) uxn.rst.ptr -= 1 + _2; else uxn.wst.ptr -= 1 + _2; #define JMI pc += uxn.ram[pc++] << 8 | uxn.ram[pc++]; #define JMP(j) if(_2) pc = (j); else pc += (Sint8)(j); #define INC(s) uxn.s.dat[uxn.s.ptr++] @@ -60,8 +61,8 @@ uxn_eval(Uint16 pc) /* L2r */ case 0xe0: INC(rst) = uxn.ram[pc++]; /* LIr */ case 0xc0: INC(rst) = uxn.ram[pc++]; break; /* INC */ OPC(0x01, POx(a),PUx(a + 1)) - /* POP */ OPC(0x02, GET(a,b),0) - /* NIP */ OPC(0x03, GET(a,b) GET(c,d),PUT(a,b)) + /* POP */ OPC(0x02, REM,0) + /* NIP */ OPC(0x03, GET(a,b) REM,PUT(a,b)) /* SWP */ OPC(0x04, GET(a,b) GET(c,d),PUT(a,b) PUT(c,d)) /* ROT */ OPC(0x05, GET(a,b) GET(c,d) GET(e,f),PUT(c,d) PUT(a,b) PUT(e,f)) /* DUP */ OPC(0x06, GET(a,b),PUT(a,b) PUT(a,b)) diff --git a/src/uxn11.c b/src/uxn11.c index d6ce9e8..1fa6123 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -267,7 +267,7 @@ main(int argc, char **argv) int i = 1; char *rom; if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') { - fprintf(stdout, "Uxn11 - Varvara Emulator, 12 Aug 2024.\n"); + fprintf(stdout, "Uxn11 - Varvara Emulator, 17 Aug 2024.\n"); i++; } rom = i == argc ? "boot.rom" : argv[i++]; diff --git a/src/uxncli.c b/src/uxncli.c index 8b943c6..3ef61b4 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -68,7 +68,7 @@ main(int argc, char **argv) int i = 1; char *rom; if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') { - fprintf(stdout, "Uxncli - Console Varvara Emulator, 12 Aug 2024.\n"); + fprintf(stdout, "Uxncli - Console Varvara Emulator, 17 Aug 2024.\n"); i++; } rom = i == argc ? "boot.rom" : argv[i++];