Browse code

Fixed orientation of chr sprites

Andrew Alderwick authored on 29/04/2021 22:05:38
Showing 1 changed files
... ...
@@ -227,10 +227,11 @@ screen_talk(Device *d, Uint8 b0, Uint8 w)
227 227
 		Uint8 mode = d->dat[0xe] >> 5;
228 228
 		if(!mode)
229 229
 			putpixel(&ppu, layer, x, y, d->dat[0xe] & 0x3);
230
-		else if(mode % 2)
231
-			puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, d->dat[0xe] >> 6 & 0x1, d->dat[0xe] >> 7 & 0x1);
230
+		else if(mode-- & 0x1)
231
+			puticn(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
232 232
 		else
233
-			putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, d->dat[0xe] >> 6 & 0x1, d->dat[0xe] >> 7 & 0x1);
233
+			putchr(&ppu, layer, x, y, addr, d->dat[0xe] & 0xf, mode & 0x2, mode & 0x4);
234
+
234 235
 		reqdraw = 1;
235 236
 	}
236 237
 }