diff --git a/src/GPU.cpp b/src/GPU.cpp index acbc9f17..53069784 100644 --- a/src/GPU.cpp +++ b/src/GPU.cpp @@ -880,9 +880,9 @@ void GPU::StartHBlank(u32 line) noexcept DispStat[0] |= (1<<1); DispStat[1] |= (1<<1); - // not the correct timing, but... close enough i guess? + // TODO: not quite the correct update time, but... close enough i guess? int scanline = (VCount == 262 ? 0 : (line+1)); - GPU3D.ScanlineSync(scanline); + if (!(scanline & 1)) GPU3D.ScanlineSync(scanline); if (GPU3D.UnderflowFlagVCount == scanline) GPU3D.DispCnt |= (1<<12); if (VCount < 192) diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index eca3fa5b..fc2f0c13 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -2158,18 +2158,21 @@ void SoftRenderer::RenderThreadFunc(GPU& gpu) } void SoftRenderer::ScanlineSync(int line) { + // only used in accurate mode (timings must be emulated) if (Accuracy && RenderThreadRunning.load(std::memory_order_relaxed)) { if (line < 192) - // We need a scanline, so let's wait for the render thread to finish it. - // (both threads process scanlines from top-to-bottom, - // so we don't need to wait for a specific row) + { + // wait for two scanlines here, since scanlines render in pairs. Platform::Semaphore_Wait(Sema_ScanlineCount); + Platform::Semaphore_Wait(Sema_ScanlineCount); + } } } u32* SoftRenderer::GetLine(int line) { + // only wait in in-accurate mode (we've already waited for scanlines in accurate mode) if (!Accuracy && RenderThreadRunning.load(std::memory_order_relaxed)) { if (line < 192)