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
commit 186b2f4e92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

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