From 5812fb3667962b1ad6cdd1eaa576042151ba7b8d Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 1 Mar 2020 18:34:48 -0500 Subject: [PATCH] PPU: Fixed crash when switching overscan mid-screen Caused by yesterday's fix for Chrono Trigger - for now, just assume overscan flag is only processed once at the top of the screen --- Core/Ppu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Ppu.cpp b/Core/Ppu.cpp index d8ef89b..5466201 100644 --- a/Core/Ppu.cpp +++ b/Core/Ppu.cpp @@ -387,6 +387,10 @@ bool Ppu::ProcessEndOfScanline(uint16_t hClock) if(_scanline == 0) { _overscanFrame = _state.OverscanMode; _mosaicScanlineCounter = _state.MosaicEnabled ? _state.MosaicSize + 1 : 0; + + //Update overclock timings once per frame + UpdateNmiScanline(); + if(!_skipRender) { if(!_interlacedFrame) { _currentBuffer = _currentBuffer == _outputBuffers[0] ? _outputBuffers[1] : _outputBuffers[0]; @@ -476,9 +480,6 @@ bool Ppu::ProcessEndOfScanline(uint16_t hClock) _skipRender = true; } - //Update overclock timings once per frame - UpdateNmiScanline(); - //Ensure the SPC is re-enabled for the next frame _spc->SetSpcState(true); } @@ -2097,7 +2098,6 @@ void Ppu::Write(uint32_t addr, uint8_t value) } } ConvertToHiRes(); - UpdateNmiScanline(); break; }