From ef7d135492cbfc76117b288db9214f2e5182b7b1 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 29 Jan 2021 02:46:15 +1000 Subject: [PATCH] GPU: Fix missing sync when hblank is pending --- src/core/gpu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 7ba93f923..c862ab922 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -222,7 +222,7 @@ bool GPU::DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool upda if (sw.IsReading()) { // Still need a temporary here. - HeapArray temp; + HeapArray temp; sw.DoBytes(temp.data(), VRAM_WIDTH * VRAM_HEIGHT * sizeof(u16)); UpdateVRAM(0, 0, VRAM_WIDTH, VRAM_HEIGHT, temp.data(), false, false); } @@ -772,7 +772,8 @@ void GPU::UpdateCRTCTickEvent() bool GPU::IsCRTCScanlinePending() const { - return (GetPendingCRTCTicks() + m_crtc_state.current_tick_in_scanline) >= m_crtc_state.horizontal_total; + const TickCount ticks = (GetPendingCRTCTicks() + m_crtc_state.current_tick_in_scanline); + return (ticks >= (m_crtc_state.in_hblank ? m_crtc_state.horizontal_total : m_crtc_state.horizontal_sync_start)); } bool GPU::IsCommandCompletionPending() const