aboutsummaryrefslogtreecommitdiffstats
path: root/src/uxn/devices/ppu.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-05-18 18:18:18 +0200
committerBad Diode <bd@badd10de.dev>2021-05-18 18:18:18 +0200
commitec5b9644db2ff26cc6f0cc3d84854b714a25eff9 (patch)
treee6806bbe0bc84a20d11f620c0425ab58aba12b42 /src/uxn/devices/ppu.c
parent0c7265cf0de9d4ec95d28c5e103c00a63f4a1697 (diff)
downloaduxngba-ec5b9644db2ff26cc6f0cc3d84854b714a25eff9.tar.gz
uxngba-ec5b9644db2ff26cc6f0cc3d84854b714a25eff9.zip
Draw directly to the FRAMEBUFFER
Diffstat (limited to 'src/uxn/devices/ppu.c')
-rw-r--r--src/uxn/devices/ppu.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/uxn/devices/ppu.c b/src/uxn/devices/ppu.c
index b977f97..06d84bf 100644
--- a/src/uxn/devices/ppu.c
+++ b/src/uxn/devices/ppu.c
@@ -121,26 +121,7 @@ void
121drawpixel(Ppu *p, Uint16 x, Uint16 y, Uint8 color) 121drawpixel(Ppu *p, Uint16 x, Uint16 y, Uint8 color)
122{ 122{
123 if(x >= p->pad && x <= p->width - p->pad - 1 && y >= p->pad && y <= p->height - p->pad - 1) 123 if(x >= p->pad && x <= p->width - p->pad - 1 && y >= p->pad && y <= p->height - p->pad - 1)
124 p->output[y * p->width + x] = p->colors[color]; 124 FRAMEBUFFER[y][x] = p->colors[color];
125}
126
127void
128drawdebugger(Ppu *p, Uint8 *stack, Uint8 ptr)
129{
130 Uint8 i, x, y, b;
131 for(i = 0; i < 0x20; ++i) { /* memory */
132 x = ((i % 8) * 3 + 1) * 8, y = (i / 8 + 1) * 8, b = stack[i];
133 puticn(p, p->bg, x, y, font[(b >> 4) & 0xf], 1 + (ptr == i) * 0x7, 0, 0);
134 puticn(p, p->bg, x + 8, y, font[b & 0xf], 1 + (ptr == i) * 0x7, 0, 0);
135 }
136 for(x = 0; x < 0x20; ++x) {
137 drawpixel(p, x, p->height / 2, 2);
138 drawpixel(p, p->width - x, p->height / 2, 2);
139 drawpixel(p, p->width / 2, p->height - x, 2);
140 drawpixel(p, p->width / 2, x, 2);
141 drawpixel(p, p->width / 2 - 16 + x, p->height / 2, 2);
142 drawpixel(p, p->width / 2, p->height / 2 - 16 + x, 2);
143 }
144} 125}
145 126
146void 127void