F2 should display the stacks even if empty

This commit is contained in:
Devine Lu Linvega 2022-06-13 12:20:20 -07:00
parent 707efa223a
commit 2a1a506524
1 changed files with 3 additions and 6 deletions

View File

@ -23,7 +23,6 @@ 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]);
@ -35,10 +34,8 @@ 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"); system_print(u->rst, "rst");
if(u->rst->ptr)
system_print(u->rst, "rst");
} }
int int
@ -66,6 +63,6 @@ system_deo(Uxn *u, Uint8 *d, Uint8 port)
switch(port) { switch(port) {
case 0x2: u->wst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10000)); break; case 0x2: u->wst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10000)); break;
case 0x3: u->rst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10100)); break; case 0x3: u->rst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10100)); break;
case 0xe: system_inspect(u); break; case 0xe: if(u->wst->ptr || u->rst->ptr) system_inspect(u); break;
} }
} }