From d53e766d6595d8cdd74f1f8316c82f7fa9e7bb3e Mon Sep 17 00:00:00 2001 From: TryTwo Date: Wed, 9 Jul 2025 23:00:00 -0700 Subject: CodeWidget: Add button that prevents automatic updates to the address, such as navigating to the PC on pause. --- Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp') diff --git a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp index e555054938..a430be15a3 100644 --- a/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/CodeViewWidget.cpp @@ -181,11 +181,13 @@ CodeViewWidget::CodeViewWidget() &CodeViewWidget::OnDebugFontChanged); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] { - m_address = m_system.GetPPCState().pc; + if (!m_lock_address && Core::GetState(m_system) == Core::State::Paused) + m_address = m_system.GetPPCState().pc; Update(); }); connect(Host::GetInstance(), &Host::UpdateDisasmDialog, this, [this] { - m_address = m_system.GetPPCState().pc; + if (!m_lock_address && Core::GetState(m_system) == Core::State::Paused) + m_address = m_system.GetPPCState().pc; Update(); }); connect(Host::GetInstance(), &Host::PPCSymbolsChanged, this, @@ -538,6 +540,11 @@ u32 CodeViewWidget::GetAddress() const return m_address; } +void CodeViewWidget::OnLockAddress(bool lock) +{ + m_lock_address = lock; +} + void CodeViewWidget::SetAddress(u32 address, SetAddressUpdate update) { if (m_address == address) -- cgit v1.2.3