From 4e4a097240a5e2462073927545a3fa9546035c8b Mon Sep 17 00:00:00 2001 From: prafullpcsx2 Date: Wed, 10 Jun 2020 02:20:06 +0530 Subject: [PATCH] Implemented memory mode check in cop0.cpp (#3324) This makes Next Generation Tennis 2003 (Roland Garros French Open 2003) and Spongebob Battle for Bikini Bottom (PAL) work. --- pcsx2/COP0.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pcsx2/COP0.cpp b/pcsx2/COP0.cpp index 2fce7afa6b..356bb2ece3 100644 --- a/pcsx2/COP0.cpp +++ b/pcsx2/COP0.cpp @@ -121,10 +121,9 @@ __fi void COP0_UpdatePCCR() { //if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return; - // TODO : Implement memory mode checks here (kernel/super/user) - // For now we just assume kernel mode. + // Implemented memory mode check (kernel/super/user) - if( cpuRegs.PERF.n.pccr.val & 0xf ) + if( cpuRegs.PERF.n.pccr.val & ((1 << (cpuRegs.CP0.n.Status.b.KSU + 2)) | (cpuRegs.CP0.n.Status.b.EXL << 1))) { // ---------------------------------- // Update Performance Counter 0 @@ -175,7 +174,7 @@ __fi void COP0_UpdatePCCR() } } - if( cpuRegs.PERF.n.pccr.b.U1 ) + if( cpuRegs.PERF.n.pccr.val & ((1 << (cpuRegs.CP0.n.Status.b.KSU + 12)) | (cpuRegs.CP0.n.Status.b.EXL << 11))) { // ---------------------------------- // Update Performance Counter 1