From af2358f48743593206b1928bf0db6c3fb3010fb4 Mon Sep 17 00:00:00 2001 From: cellos51 Date: Sat, 9 Aug 2025 17:08:18 -0400 Subject: [PATCH] Minor optimization --- source/affine_background.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/affine_background.c b/source/affine_background.c index 7bdf945..b360f4c 100644 --- a/source/affine_background.c +++ b/source/affine_background.c @@ -24,8 +24,11 @@ void affine_background_hblank() { vu16 vcount = REG_VCOUNT; - // This fixes a visual issue where the top 3 pixels of the scanline are out of sync - if (vcount >= 160) + if ((vcount > 160 && vcount < 225) || vcount > TOP_SCANLINE_OFFSET) // Exit the function if the scanline is outside the valid range + { + return; + } + else if (vcount > TOP_SCANLINE_OFFSET - 3) // This fixes a visual issue where the top 3 pixels of the scanline are out of sync { vcount -= TOP_SCANLINE_OFFSET; }