From 6bc7cf29cc13a5b5b552e05795f502efcc19bca5 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Thu, 22 Oct 2020 21:41:42 -0700 Subject: [PATCH] GPU: Synchronize CRTC on GP1(05h) command Fixes text flashing briefly after startup PlayStation logo in King's Field (USA). --- src/core/gpu.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index c1f05e737..01ab9c7f8 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -964,10 +964,16 @@ void GPU::WriteGP1(u32 value) case 0x05: // Set display start address { - m_crtc_state.regs.display_address_start = param & CRTCState::Regs::DISPLAY_ADDRESS_START_MASK; - Log_DebugPrintf("Display address start <- 0x%08X", m_crtc_state.regs.display_address_start); + const u32 new_value = param & CRTCState::Regs::DISPLAY_ADDRESS_START_MASK; + Log_DebugPrintf("Display address start <- 0x%08X", new_value); + System::IncrementInternalFrameNumber(); - UpdateCRTCDisplayParameters(); + if (m_crtc_state.regs.display_address_start != new_value) + { + SynchronizeCRTC(); + m_crtc_state.regs.display_address_start = new_value; + UpdateCRTCConfig(); + } } break;