From 8694ee5ce52e05f1d25ddc0164adeb38996fb9b3 Mon Sep 17 00:00:00 2001 From: Samuel Walker Date: Fri, 23 May 2025 06:34:06 -0600 Subject: [PATCH] Fixed timing of scx lo fetch --- lib/ppu_sm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ppu_sm.c b/lib/ppu_sm.c index a7f4e8d..a4ed309 100644 --- a/lib/ppu_sm.c +++ b/lib/ppu_sm.c @@ -94,7 +94,6 @@ void ppu_mode_oam() { } if(ppu_get_context()->line_ticks == 1) { - ppu_get_context()->pfc.lo_scroll_x = lcd_get_context()->scroll_x & 0b111; //read oam on the first tick only... ppu_get_context()->line_sprites = 0; ppu_get_context()->line_sprite_count = 0; @@ -105,6 +104,9 @@ void ppu_mode_oam() { void ppu_mode_xfer() { pipeline_process(); + if(ppu_get_context()->line_ticks == 81) { + ppu_get_context()->pfc.lo_scroll_x = lcd_get_context()->scroll_x & 0b111; + } if(ppu_get_context()->pfc.pushed_x >= XRES) { pipeline_fifo_reset();