From 5848fbe50b9bbed18d2b70301c32826da286128a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigrid=20Solveig=20Hafl=C3=ADnud=C3=B3ttir?= Date: Sat, 25 Dec 2021 16:26:01 +0100 Subject: [PATCH] ppu_blit: mostly cosmetic - explain blending's 4th row, gain few more cycles --- src/devices/ppu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/devices/ppu.c b/src/devices/ppu.c index e6358ef..ffc23f6 100644 --- a/src/devices/ppu.c +++ b/src/devices/ppu.c @@ -103,13 +103,14 @@ ppu_write(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 color) void ppu_blit(Ppu *p, Layer *layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Uint8 flipx, Uint8 flipy, Uint8 twobpp) { + Uint8 opaque = blending[4][color]; Uint16 v, h; for(v = 0; v < 8; ++v) for(h = 0; h < 8; ++h) { Uint8 ch = (sprite[v + 0] >> (7 - h)) & 0x1; if(twobpp) ch |= ((sprite[v + 8] >> (7 - h)) & 0x1) << 1; - if(ch || blending[4][color]) + if(opaque || ch) ppu_write(p, layer, x + (flipx ? 7 - h : h),