From 0436c9f60eb1e815a65f01d5edb6a5a155911553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Vanda=C3=ABle?= Date: Tue, 3 Nov 2026 14:14:04 +0100 Subject: [PATCH] CPU: Fix quickly-stopped games hanging Dolphin --- Source/Core/Core/HW/CPU.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index abd632d66c..5f4890f04e 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -32,7 +32,11 @@ CPUManager::~CPUManager() = default; void CPUManager::Init(PowerPC::CPUCore cpu_core) { m_system.GetPowerPC().Init(cpu_core); - m_state = State::Stepping; + + std::lock_guard state_lock(m_state_change_lock); + // A stop may have been requested while the core was booting, in which case don't overwrite it. + if (Core::GetState(m_system) != Core::State::Stopping) + m_state = State::Stepping; } void CPUManager::Shutdown()