mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
ActionReplay/PatchEngine: Replace HostWrite with ApplyMemoryPatch
Compared to the former, the latter invalidates the icache, which is something that is likely desired for patches (especially if they are applied while the game is running).
This commit is contained in:
@@ -219,19 +219,19 @@ static void ApplyPatches(const Core::CPUThreadGuard& guard, const std::vector<Pa
|
||||
if (!entry.conditional ||
|
||||
PowerPC::MMU::HostRead_U8(guard, addr) == static_cast<u8>(comparand))
|
||||
{
|
||||
PowerPC::MMU::HostWrite_U8(guard, static_cast<u8>(value), addr);
|
||||
ApplyMemoryPatch<u8>(guard, static_cast<u8>(value), addr);
|
||||
}
|
||||
break;
|
||||
case PatchType::Patch16Bit:
|
||||
if (!entry.conditional ||
|
||||
PowerPC::MMU::HostRead_U16(guard, addr) == static_cast<u16>(comparand))
|
||||
{
|
||||
PowerPC::MMU::HostWrite_U16(guard, static_cast<u16>(value), addr);
|
||||
ApplyMemoryPatch<u16>(guard, static_cast<u16>(value), addr);
|
||||
}
|
||||
break;
|
||||
case PatchType::Patch32Bit:
|
||||
if (!entry.conditional || PowerPC::MMU::HostRead_U32(guard, addr) == comparand)
|
||||
PowerPC::MMU::HostWrite_U32(guard, value, addr);
|
||||
ApplyMemoryPatch<u32>(guard, value, addr);
|
||||
break;
|
||||
default:
|
||||
// unknown patchtype
|
||||
|
||||
Reference in New Issue
Block a user