From bf961dc5594bb0c498934d23443ce44e4ef26a95 Mon Sep 17 00:00:00 2001 From: Marcus Rowe Date: Tue, 26 Oct 2021 19:52:09 +1000 Subject: [PATCH] Fix invisible sprite when Y + Height >= 256 and Y < _vblankStartScanline --- Core/PpuTypes.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/PpuTypes.h b/Core/PpuTypes.h index 9c85bb1..e5c5400 100644 --- a/Core/PpuTypes.h +++ b/Core/PpuTypes.h @@ -42,8 +42,9 @@ struct SpriteInfo return false; } - uint8_t endY = (Y + (interlace ? (Height >> 1) : Height)) & 0xFF; - return (scanline >= Y && scanline < endY) || (endY < Y && scanline < endY); + uint16_t endY = (Y + (interlace ? (Height >> 1) : Height)); + uint8_t endY_8 = endY & 0xFF; + return (scanline >= Y && scanline < endY) || (endY_8 < Y && scanline < endY_8); } };