From e8c70d954a055672770490efae5530763ec3f0f4 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Thu, 29 Apr 2021 23:05:38 +0100 Subject: [PATCH] Fixed orientation of chr sprites --- src/emulator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index 2b5c39c..6c1f849 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -227,10 +227,11 @@ screen_talk(Device *d, Uint8 b0, Uint8 w) Uint8 mode = d->dat[0xe] >> 5; if(!mode) putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3); - else if(mode % 2) - puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, d->dat[0xe] >> 6 & 0x1, d->dat[0xe] >> 7 & 0x1); + 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, d->dat[0xe] >> 6 & 0x1, d->dat[0xe] >> 7 & 0x1); + putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4); + reqdraw = 1; } }