CheatSearch: Get rid of global system accessors

We can retrieve the system via the CPUThreadGuard instances.
This commit is contained in:
Lioncache 2023-12-18 19:24:32 -05:00
parent 251c7a1030
commit dec53848f5
1 changed files with 2 additions and 4 deletions

View File

@ -222,8 +222,7 @@ Cheats::NewSearch(const Core::CPUThreadGuard& guard,
return; return;
} }
auto& system = Core::System::GetInstance(); const auto& ppc_state = guard.GetSystem().GetPPCState();
auto& ppc_state = system.GetPPCState();
if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR) if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR)
{ {
error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible; error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible;
@ -288,8 +287,7 @@ Cheats::NextSearch(const Core::CPUThreadGuard& guard,
return; return;
} }
auto& system = Core::System::GetInstance(); const auto& ppc_state = guard.GetSystem().GetPPCState();
auto& ppc_state = system.GetPPCState();
if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR) if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR)
{ {
error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible; error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible;