From 88936463d781dd018d1f2c8eb6d67c776ea8591b Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 30 Jan 2020 16:18:31 +1000 Subject: [PATCH] GPU: Toggle vblank timer gate for full frame Regression from event system. Fixes Ridge Racer. --- src/core/gpu.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 3878efbf5..c3f7d12b1 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -446,6 +446,7 @@ void GPU::Execute(TickCount ticks) if (prev_scanline < m_crtc_state.vertical_display_start && m_crtc_state.current_scanline >= m_crtc_state.vertical_display_end) { + m_timers->SetGate(HBLANK_TIMER_INDEX, false); m_crtc_state.in_vblank = false; } @@ -453,13 +454,9 @@ void GPU::Execute(TickCount ticks) m_crtc_state.current_scanline >= m_crtc_state.vertical_display_end; if (m_crtc_state.in_vblank != new_vblank) { - m_crtc_state.in_vblank = new_vblank; - if (new_vblank) { - static u32 x = 0; - Log_DebugPrintf("Now in v-blank %u ticks %u hblanks", m_system->GetGlobalTickCounter() - x); - x = m_system->GetGlobalTickCounter(); + Log_DebugPrintf("Now in v-blank"); m_interrupt_controller->InterruptRequest(InterruptController::IRQ::VBLANK); // flush any pending draws and "scan out" the image @@ -469,6 +466,7 @@ void GPU::Execute(TickCount ticks) } m_timers->SetGate(HBLANK_TIMER_INDEX, new_vblank); + m_crtc_state.in_vblank = new_vblank; } // past the end of vblank?