From 511c3133f1a1263ace98e6709e1691956101b1d6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 5 Jul 2020 02:25:55 +1000 Subject: [PATCH] GPU: Let GPU catch up before handling GP1 reset commands Fixes trashed VRAM writes in some homebrew. --- src/core/gpu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index db64df683..fe593d2a6 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -891,6 +891,7 @@ void GPU::WriteGP1(u32 value) case 0x00: // Reset GPU { Log_DebugPrintf("GP1 reset GPU"); + m_command_tick_event->InvokeEarly(); SynchronizeCRTC(); SoftReset(); } @@ -899,6 +900,7 @@ void GPU::WriteGP1(u32 value) case 0x01: // Clear FIFO { Log_DebugPrintf("GP1 clear FIFO"); + m_command_tick_event->InvokeEarly(); SynchronizeCRTC(); m_blitter_state = BlitterState::Idle; m_command_total_words = 0; @@ -1007,6 +1009,7 @@ void GPU::WriteGP1(u32 value) { // Have to be careful when setting this because Synchronize() can modify GPUSTAT. static constexpr u32 SET_MASK = UINT32_C(0b00000000011111110100000000000000); + m_command_tick_event->InvokeEarly(); SynchronizeCRTC(); m_GPUSTAT.bits = (m_GPUSTAT.bits & ~SET_MASK) | (new_GPUSTAT.bits & SET_MASK); UpdateCRTCConfig();