From 7dafad5a8bdf0c600e1baeb95c11f6f009590999 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 24 Jan 2015 12:19:33 +1100 Subject: [PATCH] On DCBZ, mask the memory address to ensure that the address is within physical memory. The AGP disc DCBZ's against an out of bounds physical address. --- Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp index 0c0a23acfc..1425a95211 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp @@ -331,6 +331,10 @@ void Jit64::dcbz(UGeckoInstruction inst) FixupBranch exit = J(true); SwitchToNearCode(); + // Mask out the address so we don't write to MEM1 out of bounds + // FIXME: Work out why the AGP disc writes out of bounds + if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bWii) + AND(32, R(RSCRATCH), Imm32(Memory::RAM_MASK)); PXOR(XMM0, R(XMM0)); MOVAPS(MComplex(RMEM, RSCRATCH, SCALE_1, 0), XMM0); MOVAPS(MComplex(RMEM, RSCRATCH, SCALE_1, 16), XMM0);