GBA: Fixed window rendering glitch when X position was changed during hblank

Super Mario Advance 4 (SMB3) window animation when entering a stage had a glitchy scanline when the window's end position was moved from x=255 to x=239 during hblank, because ProcessWindow was not getting called when the window X position register was changed
This commit is contained in:
Sour 2025-03-14 23:55:16 +09:00
parent f359b80eb5
commit 51f5afb7a3

View file

@ -1188,8 +1188,8 @@ void GbaPpu::SetLayerEnabled(int layer, bool enabled)
void GbaPpu::WriteRegister(uint32_t addr, uint8_t value)
{
if(_lastRenderCycle != _state.Cycle && (_state.Scanline < 160 || _state.Scanline == 227)) {
if(_state.Cycle < 1006 || addr <= 0x01 || addr == 0x4D) {
//Only run renderer during active rendering (< 1006), or if the write could affect sprites
if(_state.Cycle < 1006 || addr <= 0x01 || addr == 0x4D || addr >= 0x40 && addr <= 0x43) {
//Only run renderer during active rendering (< 1006), or if the write could affect sprites/window processing
RenderScanline(true);
}
}