commit 2a1a506

Devine Lu Linvega  ·  2022-06-13 19:20:20 +0000 UTC
parent 707efa2
F2 should display the stacks even if empty
1 files changed,  +3, -6
+3, -6
 1@@ -23,7 +23,6 @@ static void
 2 system_print(Stack *s, char *name)
 3 {
 4 	Uint8 i;
 5-
 6 	fprintf(stderr, "<%s>", name);
 7 	for(i = 0; i < s->ptr; i++)
 8 		fprintf(stderr, " %02x", s->dat[i]);
 9@@ -35,10 +34,8 @@ system_print(Stack *s, char *name)
10 void
11 system_inspect(Uxn *u)
12 {
13-	if(u->wst->ptr)
14-		system_print(u->wst, "wst");
15-	if(u->rst->ptr)
16-		system_print(u->rst, "rst");
17+	system_print(u->wst, "wst");
18+	system_print(u->rst, "rst");
19 }
20 
21 int
22@@ -66,6 +63,6 @@ system_deo(Uxn *u, Uint8 *d, Uint8 port)
23 	switch(port) {
24 	case 0x2: u->wst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10000)); break;
25 	case 0x3: u->rst = (Stack *)(u->ram + (d[port] ? (d[port] * 0x100) : 0x10100)); break;
26-	case 0xe: system_inspect(u); break;
27+	case 0xe: if(u->wst->ptr || u->rst->ptr) system_inspect(u); break;
28 	}
29 }