diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2023-01-27 19:06:30 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-27 19:06:30 +0100 |
| commit | 41272dc5f1b62f4a5a0562cc29eb3e83367d0f14 (patch) | |
| tree | 6691a9e37d870d1d2879d14faa41d4c0ee041b37 /Source/Core/DiscIO/RiivolutionPatcher.cpp | |
| parent | f056cec8594ca63049ae3b481a5f2f8a752ef03d (diff) | |
| parent | be2d394b8ca128e012ef4ba972559140276a1428 (diff) | |
Merge pull request #11429 from AdmiralCurtiss/globals-ppc
Reduce usage of ppcState global.
Diffstat (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp')
| -rw-r--r-- | Source/Core/DiscIO/RiivolutionPatcher.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index eb0ca53137..6469607cc1 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -497,10 +497,11 @@ static void ApplyMemoryPatch(u32 offset, const std::vector<u8>& value, if (!original.empty() && !MemoryMatchesAt(offset, original)) return; + auto& system = Core::System::GetInstance(); const u32 size = static_cast<u32>(value.size()); for (u32 i = 0; i < size; ++i) PowerPC::HostTryWriteU8(value[i], offset + i); - const u32 overlapping_hook_count = HLE::UnpatchRange(offset, offset + size); + const u32 overlapping_hook_count = HLE::UnpatchRange(system, offset, offset + size); if (overlapping_hook_count != 0) { WARN_LOG_FMT(OSHLE, "Riivolution memory patch overlaps {} HLE hook(s) at {:08x} (size: {})", @@ -551,6 +552,7 @@ static void ApplyOcarinaMemoryPatch(const Patch& patch, const Memory& memory_pat if (value.empty()) return; + auto& system = Core::System::GetInstance(); for (u32 i = 0; i < length; i += 4) { // first find the pattern @@ -568,7 +570,8 @@ static void ApplyOcarinaMemoryPatch(const Patch& patch, const Memory& memory_pat const u32 target = memory_patch.m_offset | 0x80000000; const u32 jmp = ((target - blr_address) & 0x03fffffc) | 0x48000000; PowerPC::HostTryWriteU32(jmp, blr_address); - const u32 overlapping_hook_count = HLE::UnpatchRange(blr_address, blr_address + 4); + const u32 overlapping_hook_count = + HLE::UnpatchRange(system, blr_address, blr_address + 4); if (overlapping_hook_count != 0) { WARN_LOG_FMT(OSHLE, "Riivolution ocarina patch overlaps HLE hook at {}", blr_address); |
