CPU: Fix incorrect writing of unaligned words via cheats

This commit is contained in:
Stenzek 2023-10-11 01:10:31 +10:00
parent 1d2cf727e4
commit f9d8a49324
No known key found for this signature in database

View file

@ -2897,7 +2897,7 @@ bool CPU::SafeWriteMemoryWord(VirtualMemoryAddress addr, u32 value)
if ((addr & 3) == 0) if ((addr & 3) == 0)
return DoSafeMemoryAccess<MemoryAccessType::Write, MemoryAccessSize::Word>(addr, value); return DoSafeMemoryAccess<MemoryAccessType::Write, MemoryAccessSize::Word>(addr, value);
return SafeWriteMemoryHalfWord(addr, Truncate16(value >> 16)) && return SafeWriteMemoryHalfWord(addr, Truncate16(value)) &&
SafeWriteMemoryHalfWord(addr + 2, Truncate16(value >> 16)); SafeWriteMemoryHalfWord(addr + 2, Truncate16(value >> 16));
} }