From 555eb1162fea863e7944545938fb001d977e8530 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 6 Mar 2015 20:45:48 +0100 Subject: [PATCH] Memmap: Fix a CopyToEmu bug ValidCopyRange incorrectly returned false and stopped a CopyToEmu when pressing B+X+Start in some GameCube games (for instance Metroid Prime) after the DVD thread was implemented --- Source/Core/Core/HW/Memmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/Memmap.cpp b/Source/Core/Core/HW/Memmap.cpp index 9354fe94e0..467410d75b 100644 --- a/Source/Core/Core/HW/Memmap.cpp +++ b/Source/Core/Core/HW/Memmap.cpp @@ -247,8 +247,8 @@ bool AreMemoryBreakpointsActivated() static inline bool ValidCopyRange(u32 address, size_t size) { return (GetPointer(address) != nullptr && - GetPointer(address + u32(size)) != nullptr && - size < EXRAM_SIZE); // Make sure we don't have a range spanning seperate 2 banks + GetPointer(address + u32(size) - 1) != nullptr && + size < EXRAM_SIZE); // Make sure we don't have a range spanning 2 separate banks } void CopyFromEmu(void* data, u32 address, size_t size)