Merge pull request #12450 from lioncash/cheats

CheatSearch: Get rid of global system accessors
This commit is contained in:
OatmealDome
2023-12-18 20:10:48 -05:00
committed by GitHub

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;