uxn

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

commit 291cb3d1a22812ef2cfe99bd7ef9cee34e187622
parent 646d79fff5f653271dbc87f7cd37a31424f71642
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Wed,  5 Jan 2022 14:02:06 +0000

Simplify stack determination logic.

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

diff --git a/src/uxn.c b/src/uxn.c @@ -100,8 +100,8 @@ uxn_eval(Uxn *u, Uint16 pc) err: /* set 1 in errcode if it involved the return stack instead of the working stack */ - /* (stack overflow & ( instruction opcode was STH or JSR )) ^ Return Mode */ - errcode |= ((errcode >> 1 & instr >> 1 & instr >> 2 & instr >> 3 & ~instr >> 4) ^ instr >> 6) & 1; + /* (stack overflow & (opcode was STH / JSR)) ^ Return Mode */ + errcode |= ((errcode >> 1 & (instr & 0x1e) == 0x0e) ^ instr >> 6) & 1; return uxn_halt(u, errcode, pc - 1); }