CodeWidget: Add button that prevents automatic updates to the address, such as navigating to the PC on pause.

This commit is contained in:
TryTwo 2025-07-09 23:00:00 -07:00
parent 43aa7e9b96
commit d53e766d65
4 changed files with 25 additions and 3 deletions

View file

@ -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)