... | ... |
@@ -99,23 +99,29 @@ putchr(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uin |
99 | 99 |
/* output */ |
100 | 100 |
|
101 | 101 |
void |
102 |
-inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr) |
|
102 |
+inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory) |
|
103 | 103 |
{ |
104 | 104 |
Uint8 i, x, y, b; |
105 |
- for(i = 0; i < 0x20; ++i) { /* memory */ |
|
105 |
+ for(i = 0; i < 0x20; ++i) { /* stack */ |
|
106 | 106 |
x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8, b = stack[i]; |
107 |
- puticn(p, &p->bg, x, y, font[(b >> 4) & 0xf], 1 + (wptr == i) * 0x7, 0, 0); |
|
108 |
- puticn(p, &p->bg, x + 8, y, font[b & 0xf], 1 + (wptr == i) * 0x7, 0, 0); |
|
107 |
+ puticn(p, &p->fg, x, y, font[(b >> 4) & 0xf], 1 + (wptr == i) * 0x7, 0, 0); |
|
108 |
+ puticn(p, &p->fg, x + 8, y, font[b & 0xf], 1 + (wptr == i) * 0x7, 0, 0); |
|
109 | 109 |
} |
110 |
- puticn(p, &p->bg, 0x8, y + 0x10, font[(rptr >> 4) & 0xf], 0x2, 0, 0); |
|
111 |
- puticn(p, &p->bg, 0x10, y + 0x10, font[rptr & 0xf], 0x2, 0, 0); |
|
112 |
- for(x = 0; x < 0x20; ++x) { /* guides */ |
|
113 |
- putpixel(p, &p->bg, x, p->height / 2, 2); |
|
114 |
- putpixel(p, &p->bg, p->width - x, p->height / 2, 2); |
|
115 |
- putpixel(p, &p->bg, p->width / 2, p->height - x, 2); |
|
116 |
- putpixel(p, &p->bg, p->width / 2, x, 2); |
|
117 |
- putpixel(p, &p->bg, p->width / 2 - 16 + x, p->height / 2, 2); |
|
118 |
- putpixel(p, &p->bg, p->width / 2, p->height / 2 - 16 + x, 2); |
|
110 |
+ for(i = 0; i < 0x40; ++i) { /* memory */ |
|
111 |
+ x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8 + p->height - 0x50, b = memory[i]; |
|
112 |
+ puticn(p, &p->fg, x, y, font[(b >> 4) & 0xf], 3, 0, 0); |
|
113 |
+ puticn(p, &p->fg, x + 8, y, font[b & 0xf], 3, 0, 0); |
|
114 |
+ } |
|
115 |
+ /* return pointer */ |
|
116 |
+ puticn(p, &p->fg, 0x8, y + 0x10, font[(rptr >> 4) & 0xf], 0x2, 0, 0); |
|
117 |
+ puticn(p, &p->fg, 0x10, y + 0x10, font[rptr & 0xf], 0x2, 0, 0); |
|
118 |
+ for(x = 0; x < 0x10; ++x) { /* guides */ |
|
119 |
+ putpixel(p, &p->fg, x, p->height / 2, 2); |
|
120 |
+ putpixel(p, &p->fg, p->width - x, p->height / 2, 2); |
|
121 |
+ putpixel(p, &p->fg, p->width / 2, p->height - x, 2); |
|
122 |
+ putpixel(p, &p->fg, p->width / 2, x, 2); |
|
123 |
+ putpixel(p, &p->fg, p->width / 2 - 0x10 / 2 + x, p->height / 2, 2); |
|
124 |
+ putpixel(p, &p->fg, p->width / 2, p->height / 2 - 0x10 / 2 + x, 2); |
|
119 | 125 |
} |
120 | 126 |
} |
121 | 127 |
|
... | ... |
@@ -31,4 +31,4 @@ void putcolors(Ppu *p, Uint8 *addr); |
31 | 31 |
void putpixel(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 color); |
32 | 32 |
void puticn(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); |
33 | 33 |
void putchr(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy); |
34 |
-void inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr); |
|
34 |
+void inspect(Ppu *p, Uint8 *stack, Uint8 wptr, Uint8 rptr, Uint8 *memory); |
... | ... |
@@ -63,7 +63,7 @@ static void |
63 | 63 |
redraw(Uxn *u) |
64 | 64 |
{ |
65 | 65 |
if(debug) |
66 |
- inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr); |
|
66 |
+ inspect(&ppu, u->wst.dat, u->wst.ptr, u->rst.ptr, u->ram.dat); |
|
67 | 67 |
SDL_UpdateTexture(bgTexture, &gRect, ppu.bg.pixels, ppu.width * sizeof(Uint32)); |
68 | 68 |
SDL_UpdateTexture(fgTexture, &gRect, ppu.fg.pixels, ppu.width * sizeof(Uint32)); |
69 | 69 |
SDL_RenderClear(gRenderer); |