uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit db6f7d9fbf4a490740804cf296309f7c20ee1dd0
parent bc4ec9ea5f1d7b479d1eff085dea69715f299e5a
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Sun, 23 Jul 2023 09:52:20 -0700

(uxn.c) Aligned BRK/JCI/JMI

Diffstat:
Msrc/uxn.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/uxn.c b/src/uxn.c @@ -39,20 +39,20 @@ WITH REGARD TO THIS SOFTWARE. int uxn_eval(Uxn *u, Uint16 pc) { - int t, n, l, k, tmp, opc, ins; - Uint8 *ram = u->ram; + int t, n, l, k, tmp, ins; + Uint8 *ram = u->ram, opc; Stack *s; if(!pc || u->dev[0x0f]) return 0; for(;;) { ins = ram[pc++]; k = ins & 0x80 ? 0xff : 0; s = ins & 0x40 ? &u->rst : &u->wst; - opc = !(ins & 0x1f) ? (0 - (ins >> 5)) & 0xff : ins & 0x3f; + opc = !(ins & 0x1f) ? (0 - (ins >> 5)) : ins & 0x3f; switch(opc) { /* IMM */ - case 0x00: /* BRK */ return 1; - case 0xff: /* JCI */ pc += !!s->dat[--s->ptr] * PEEK2(ram + pc) + 2; break; - case 0xfe: /* JMI */ pc += PEEK2(ram + pc) + 2; break; + case 0x00: /* BRK */ return 1; + case 0xff: /* JCI */ if(!s->dat[--s->ptr]) { pc += 2; break; } + case 0xfe: /* JMI */ pc += PEEK2(ram + pc) + 2; break; case 0xfd: /* JSI */ SET(0, 2) PUT2(0, pc + 2) pc += PEEK2(ram + pc) + 2; break; case 0xfc: /* LIT */ SET(0, 1) PUT(0, ram[pc++]) break; case 0xfb: /* LIT2 */ SET(0, 2) PUT2(0, PEEK2(ram + pc)) pc += 2; break;