diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-01-10 04:53:50 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2023-01-27 15:22:45 +0100 |
| commit | bfc951311fef7fee25a5473a484bbeffc8cf3ed6 (patch) | |
| tree | 5f70125f2133b0eeea716e837c102cc4e61fdc1d /Source | |
| parent | bbdfb4bc14d2586c838dd6bd40684ca7b490910e (diff) | |
CheatSearch: Avoid ppcState global.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/CheatSearch.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/Core/Core/CheatSearch.cpp b/Source/Core/Core/CheatSearch.cpp index 3ad1a5c674..e03fa8d0b3 100644 --- a/Source/Core/Core/CheatSearch.cpp +++ b/Source/Core/Core/CheatSearch.cpp @@ -20,6 +20,7 @@ #include "Core/HW/Memmap.h" #include "Core/PowerPC/MMU.h" #include "Core/PowerPC/PowerPC.h" +#include "Core/System.h" Cheats::DataType Cheats::GetDataType(const Cheats::SearchValue& value) { @@ -204,7 +205,9 @@ Cheats::NewSearch(const std::vector<Cheats::MemoryRange>& memory_ranges, return; } - if (address_space == PowerPC::RequestedAddressSpace::Virtual && !PowerPC::ppcState.msr.DR) + auto& system = Core::System::GetInstance(); + auto& ppc_state = system.GetPPCState(); + if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR) { error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible; return; @@ -263,7 +266,9 @@ Cheats::NextSearch(const std::vector<Cheats::SearchResult<T>>& previous_results, return; } - if (address_space == PowerPC::RequestedAddressSpace::Virtual && !PowerPC::ppcState.msr.DR) + auto& system = Core::System::GetInstance(); + auto& ppc_state = system.GetPPCState(); + if (address_space == PowerPC::RequestedAddressSpace::Virtual && !ppc_state.msr.DR) { error_code = Cheats::SearchErrorCode::VirtualAddressesCurrentlyNotAccessible; return; |
