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:
Martino Fontana
2025-08-01 23:25:06 +02:00
parent aa7b13f353
commit 5d71ac268f
2 changed files with 21 additions and 24 deletions
+3 -3
View File
@@ -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