From 46e74782a7facde2703c70fd3ce15a28c6e6cdd8 Mon Sep 17 00:00:00 2001 From: FenrisulfrX Date: Sun, 21 Dec 2014 16:45:50 -0200 Subject: [PATCH 1/2] AR: Fix Memory Copy Without Pointer Support Fix a bug when using AR codes with "Memory Copy Without Pointer Support" code type which would write more data than it should. --- Source/Core/Core/ActionReplay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/ActionReplay.cpp b/Source/Core/Core/ActionReplay.cpp index 98e7da31fd..f5f5ef78c5 100644 --- a/Source/Core/Core/ActionReplay.cpp +++ b/Source/Core/Core/ActionReplay.cpp @@ -597,8 +597,8 @@ static bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u3 LogInfo("--------"); for (int i=0; i < num_bytes; ++i) { - Memory::Write_U32(Memory::Read_U32(addr_src + i), addr_dest + i); - LogInfo("Wrote %08x to address %08x", Memory::Read_U32(addr_src + i), addr_dest + i); + Memory::Write_U8(Memory::Read_U8(addr_src + i), addr_dest + i); + LogInfo("Wrote %08x to address %08x", Memory::Read_U8(addr_src + i), addr_dest + i); } LogInfo("--------"); return true; From e70baf43d47718ee11dadc40bab368b9e2e41040 Mon Sep 17 00:00:00 2001 From: FenrisulfrX Date: Mon, 22 Dec 2014 06:22:01 -0200 Subject: [PATCH 2/2] AR: BugFix to Memory Copy Without Pointer Using ReadUncheked to avoid changing the state of the emulation --- Source/Core/Core/ActionReplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/ActionReplay.cpp b/Source/Core/Core/ActionReplay.cpp index f5f5ef78c5..af3cf146dc 100644 --- a/Source/Core/Core/ActionReplay.cpp +++ b/Source/Core/Core/ActionReplay.cpp @@ -598,7 +598,7 @@ static bool ZeroCode_MemoryCopy(const u32 val_last, const ARAddr& addr, const u3 for (int i=0; i < num_bytes; ++i) { Memory::Write_U8(Memory::Read_U8(addr_src + i), addr_dest + i); - LogInfo("Wrote %08x to address %08x", Memory::Read_U8(addr_src + i), addr_dest + i); + LogInfo("Wrote %08x to address %08x", Memory::ReadUnchecked_U8(addr_src + i), addr_dest + i); } LogInfo("--------"); return true;