diff options
author | Bad Diode <bd@badd10de.dev> | 2021-05-18 18:18:18 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-05-18 18:18:18 +0200 |
commit | ec5b9644db2ff26cc6f0cc3d84854b714a25eff9 (patch) | |
tree | e6806bbe0bc84a20d11f620c0425ab58aba12b42 /src/uxn/devices/ppu.c | |
parent | 0c7265cf0de9d4ec95d28c5e103c00a63f4a1697 (diff) | |
download | uxngba-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.c | 21 |
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 | |||
121 | drawpixel(Ppu *p, Uint16 x, Uint16 y, Uint8 color) | 121 | drawpixel(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 | |||
127 | void | ||
128 | drawdebugger(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 | ||
146 | void | 127 | void |