From 88095a607aff5bd7565283678db3a35534305508 Mon Sep 17 00:00:00 2001 From: Fiora Date: Thu, 28 Aug 2014 12:54:23 -0700 Subject: [PATCH] JIT: fix RAM check in load-from-constant-address A bug that seems to have been uncovered by allowing immediate-address loads. Super Monkey Ball 2 crashes without this change -- it's possible, however, that the game actually requires the MMU hack, since it crashed due to accessing an address in the 0x20000000-0x3fffffff range. --- Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp b/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp index 7c9bfbe485..58340b072e 100644 --- a/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/Jit_Util.cpp @@ -297,7 +297,7 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg & opAddress, // MMIO handler and generate the code to load using the handler. // 3. Otherwise, just generate a call to Memory::Read_* with the // address hardcoded. - if ((address & mem_mask) == 0) + if (Memory::IsRAMAddress(address)) { UnsafeLoadToReg(reg_value, opAddress, accessSize, offset, signExtend); }