From 18d9ec75f14b83cfa7b7da812ccb8c1831260453 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Tue, 10 Jan 2023 06:45:13 +0100 Subject: [PATCH] HW/CPU: Avoid ppcState global. --- Source/Core/Core/HW/CPU.cpp | 4 +++- Source/Core/Core/HW/CPU.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp index 1188a1022a..3650f023f4 100644 --- a/Source/Core/Core/HW/CPU.cpp +++ b/Source/Core/Core/HW/CPU.cpp @@ -88,6 +88,8 @@ static void ExecutePendingJobs(std::unique_lock& state_lock) void Run() { + auto& system = Core::System::GetInstance(); + // Updating the host CPU's rounding mode must be done on the CPU thread. // We can't rely on PowerPC::Init doing it, since it's called from EmuThread. PowerPC::RoundingModeUpdated(); @@ -111,7 +113,7 @@ void Run() // If watchpoints are enabled, any instruction could be a breakpoint. if (PowerPC::GetMode() != PowerPC::CoreMode::Interpreter) { - if (PowerPC::breakpoints.IsAddressBreakPoint(PowerPC::ppcState.pc) || + if (PowerPC::breakpoints.IsAddressBreakPoint(system.GetPPCState().pc) || PowerPC::memchecks.HasAny()) { s_state = State::Stepping; diff --git a/Source/Core/Core/HW/CPU.h b/Source/Core/Core/HW/CPU.h index d69206c64b..95539ec2ef 100644 --- a/Source/Core/Core/HW/CPU.h +++ b/Source/Core/Core/HW/CPU.h @@ -69,7 +69,7 @@ const State* GetStatePtr(); // Locks the CPU Thread (waiting for it to become idle). // While this lock is held, the CPU Thread will not perform any action so it is safe to access -// PowerPC::ppcState, CoreTiming, etc. without racing the CPU Thread. +// PowerPC, CoreTiming, etc. without racing the CPU Thread. // Cannot be used recursively. Must be paired as PauseAndLock(true)/PauseAndLock(false). // Return value for do_lock == true is whether the state was State::Running or not. // Return value for do_lock == false is whether the state was changed *to* State::Running or not.