commit 486e79c48db26f02bedeb0469a53e9f81fbabc80
parent 7f345428d656771f76a7a0695aaf6aa90b2f82ef
Author: neauoire <aliceffekt@gmail.com>
Date: Fri, 30 Jul 2021 16:31:10 -0700
screen_talk should not peek at addr when drawing a single pixel
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -294,15 +294,17 @@ screen_talk(Device *d, Uint8 b0, Uint8 w)
if(w && b0 == 0xe) {
Uint16 x = mempeek16(d->dat, 0x8);
Uint16 y = mempeek16(d->dat, 0xa);
- Uint8 *addr = &d->mem[mempeek16(d->dat, 0xc)];
Layer *layer = d->dat[0xe] >> 4 & 0x1 ? &ppu.fg : &ppu.bg;
Uint8 mode = d->dat[0xe] >> 5;
if(!mode)
putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3);
- else if(mode-- & 0x1)
- puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
- else
- putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
+ else {
+ Uint8 *addr = &d->mem[mempeek16(d->dat, 0xc)];
+ if(mode-- & 0x1)
+ puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
+ else
+ putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
+ }
reqdraw = 1;
}
}