commit 13b3496

neauoire  ·  2023-10-31 18:13:27 +0000 UTC
parent 4d3974f
New stack printing in cli
4 files changed,  +17, -14
+0, -1
1@@ -66,7 +66,6 @@ JMP2r
2 	.cat/timer LDZ INC [ DUP ] .cat/timer STZ
3 		#04 SFT draw-tail
4 	draw-cursor
5-	.Mouse/state DEI #00 EQU ?{ #ff #00 .Mouse/state DEO }
6 
7 BRK
8 
+9, -7
 1@@ -96,18 +96,20 @@ screen_debugger(Uxn *u)
 2 	int i;
 3 	for(i = 0; i < 0x08; i++) {
 4 		Uint8 pos = u->wst.ptr - 4 + i;
 5-		draw_byte(u->wst.dat[pos], i * 0x18 + 0x8, uxn_screen.height - 0x18, i > 4 ? 0x01 : !pos ? 0xc :
 6-				i == 4                                                                           ? 0x8 :
 7-                                                                                                   0x2);
 8+		Uint8 color = i > 4 ? 0x01 : !pos ? 0xc :
 9+			i == 4                        ? 0x8 :
10+                                            0x2;
11+		draw_byte(u->wst.dat[pos], i * 0x18 + 0x8, uxn_screen.height - 0x18, color);
12 	}
13 	for(i = 0; i < 0x08; i++) {
14 		Uint8 pos = u->rst.ptr - 4 + i;
15-		draw_byte(u->rst.dat[pos], i * 0x18 + 0x8, uxn_screen.height - 0x10, i > 4 ? 0x01 : !pos ? 0xc :
16-				i == 4                                                                           ? 0x8 :
17-                                                                                                   0x2);
18+		Uint8 color = i > 4 ? 0x01 : !pos ? 0xc :
19+			i == 4                        ? 0x8 :
20+                                            0x2;
21+		draw_byte(u->rst.dat[pos], i * 0x18 + 0x8, uxn_screen.height - 0x10, color);
22 	}
23 	screen_blit(uxn_screen.fg, arrow, 0, 0x68, uxn_screen.height - 0x20, 3, 0, 0, 0);
24-	for(i = 0; i < 0x40; i++)
25+	for(i = 0; i < 0x20; i++)
26 		draw_byte(u->ram[i], (i & 0x7) * 0x18 + 0x8, ((i >> 3) << 3) + 0x8, 1 + !!u->ram[i]);
27 }
28 
+7, -5
 1@@ -36,11 +36,13 @@ static void
 2 system_print(Stack *s, char *name)
 3 {
 4 	Uint8 i;
 5-	fprintf(stderr, "<%s>", name);
 6-	for(i = 0; i < s->ptr; i++)
 7-		fprintf(stderr, " %02x", s->dat[i]);
 8-	if(!i)
 9-		fprintf(stderr, " empty");
10+	fprintf(stderr, "%s ", name);
11+	for(i = 0; i < 9; i++) {
12+		Uint8 pos = s->ptr - 4 + i;
13+		fprintf(stderr, !pos ? "[%02x]" : i == 4 ? "<%02x>" :
14+                                                   " %02x ",
15+			s->dat[pos]);
16+	}
17 	fprintf(stderr, "\n");
18 }
19 
+1, -1
1@@ -70,7 +70,7 @@ main(int argc, char **argv)
2 		return system_error("usage", "uxncli [-v] file.rom [args..]");
3 	/* Read flags */
4 	if(argv[i][0] == '-' && argv[i][1] == 'v')
5-		return system_version("Uxncli - Console Varvara Emulator", "30 Oct 2023");
6+		return system_version("Uxncli - Console Varvara Emulator", "31 Oct 2023");
7 	if(!system_init(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++]))
8 		return system_error("Init", "Failed to initialize uxn.");
9 	/* Game Loop */