From 19f1d329c9216b4fbf055d9cfbec7426fee90f24 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 19 Nov 2025 02:16:58 -0600 Subject: [PATCH 1/2] Core: Remove unused HostMessageID enum members. --- Source/Core/Core/Core.cpp | 1 - Source/Core/Core/Host.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 58da62b4e8..a920d513d7 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -322,7 +322,6 @@ static void CPUSetInitialExecutionState(bool force_paused = false) bool paused = SConfig::GetInstance().bBootToPause || force_paused; SetState(system, paused ? State::Paused : State::Running, true, true); Host_UpdateDisasmDialog(); - Host_Message(HostMessageID::WMUserCreate); }); } diff --git a/Source/Core/Core/Host.h b/Source/Core/Core/Host.h index a05508bae2..2c19e99f4c 100644 --- a/Source/Core/Core/Host.h +++ b/Source/Core/Core/Host.h @@ -43,8 +43,6 @@ enum class HostMessageID { // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on WMUserStop = 10, - WMUserCreate, - WMUserSetCursor, WMUserJobDispatch, }; From 9f0a5c2a371e178711956aec97aa4df447b66d7d Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Wed, 19 Nov 2025 02:45:39 -0600 Subject: [PATCH 2/2] Core: Allow CPUManager::SetStepping to be called from the CPU thread so a call doesn't need to be routed through the host thread on boot. --- Source/Core/Core/Core.cpp | 19 ++++++++----------- Source/Core/Core/Core.h | 3 +-- Source/Core/Core/HW/CPU.cpp | 8 +++++--- Source/Core/Core/HW/CPU.h | 2 +- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index a920d513d7..04ce3c75b8 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -314,15 +314,12 @@ void UndeclareAsGPUThread() } // For the CPU Thread only. -static void CPUSetInitialExecutionState(bool force_paused = false) +static void CPUSetInitialExecutionState(Core::System& system, bool force_paused = false) { // The CPU starts in stepping state, and will wait until a new state is set before executing. - // SetState isn't safe to call from the CPU thread, so we ask the host thread to call it. - QueueHostJob([force_paused](Core::System& system) { - bool paused = SConfig::GetInstance().bBootToPause || force_paused; - SetState(system, paused ? State::Paused : State::Running, true, true); - Host_UpdateDisasmDialog(); - }); + const bool paused = SConfig::GetInstance().bBootToPause || force_paused; + SetState(system, paused ? State::Paused : State::Running, true, true); + Host_UpdateDisasmDialog(); } // Create the CPU thread, which is a CPU + Video thread in Single Core mode. @@ -371,7 +368,7 @@ static void CpuThread(Core::System& system, const std::optional& sa if (!gdb_socket.empty() && !AchievementManager::GetInstance().IsHardcoreModeActive()) { GDBStub::InitLocal(gdb_socket.data()); - CPUSetInitialExecutionState(true); + CPUSetInitialExecutionState(system, true); } else #endif @@ -380,11 +377,11 @@ static void CpuThread(Core::System& system, const std::optional& sa if (gdb_port > 0 && !AchievementManager::GetInstance().IsHardcoreModeActive()) { GDBStub::Init(gdb_port); - CPUSetInitialExecutionState(true); + CPUSetInitialExecutionState(system, true); } else { - CPUSetInitialExecutionState(); + CPUSetInitialExecutionState(system); } } } @@ -430,7 +427,7 @@ static void FifoPlayerThread(Core::System& system, const std::optional