Removed err4, display only stack when not empty on debug

This commit is contained in:
Devine Lu Linvega 2022-06-13 10:32:59 -07:00
parent 4d252e3109
commit 95a28d6b4d
2 changed files with 7 additions and 5 deletions

View File

@ -17,14 +17,14 @@ WITH REGARD TO THIS SOFTWARE.
static const char *errors[] = { static const char *errors[] = {
"underflow", "underflow",
"overflow", "overflow",
"division by zero", "division by zero"
"Busy"
}; };
static void static void
system_print(Stack *s, char *name) system_print(Stack *s, char *name)
{ {
Uint8 i; Uint8 i;
fprintf(stderr, "<%s>", name); fprintf(stderr, "<%s>", name);
for(i = 0; i < s->ptr; i++) for(i = 0; i < s->ptr; i++)
fprintf(stderr, " %02x", s->dat[i]); fprintf(stderr, " %02x", s->dat[i]);
@ -36,7 +36,9 @@ system_print(Stack *s, char *name)
void void
system_inspect(Uxn *u) system_inspect(Uxn *u)
{ {
if(u->wst->ptr)
system_print(u->wst, "wst"); system_print(u->wst, "wst");
if(u->rst->ptr)
system_print(u->rst, "rst"); system_print(u->rst, "rst");
} }

View File

@ -88,7 +88,7 @@ uxn_eval(Uxn *u, Uint16 pc)
case 0x1f: /* SFT */ POP8(a) POP(b) PUSH(src, b >> (a & 0x0f) << ((a & 0xf0) >> 4)) break; case 0x1f: /* SFT */ POP8(a) POP(b) PUSH(src, b >> (a & 0x0f) << ((a & 0xf0) >> 4)) break;
} }
} }
return (u->wst->ptr || u->rst->ptr) ? uxn_halt(u, instr, 4, pc - 1) : 1; return 1;
err: err:
return uxn_halt(u, instr, errcode, pc - 1); return uxn_halt(u, instr, errcode, pc - 1);
} }