From f9d8a49324b090cab3715fc294d26355d0bb0750 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 11 Oct 2023 01:10:31 +1000 Subject: [PATCH] CPU: Fix incorrect writing of unaligned words via cheats --- src/core/cpu_core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index 5bd07b052..51ca26ae0 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -2897,7 +2897,7 @@ bool CPU::SafeWriteMemoryWord(VirtualMemoryAddress addr, u32 value) if ((addr & 3) == 0) return DoSafeMemoryAccess(addr, value); - return SafeWriteMemoryHalfWord(addr, Truncate16(value >> 16)) && + return SafeWriteMemoryHalfWord(addr, Truncate16(value)) && SafeWriteMemoryHalfWord(addr + 2, Truncate16(value >> 16)); }