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.
This commit is contained in:
prafullpcsx2 2020-06-10 02:20:06 +05:30 committed by GitHub
parent f9f55029d1
commit 4e4a097240
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -121,10 +121,9 @@ __fi void COP0_UpdatePCCR()
{ {
//if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return; //if( cpuRegs.CP0.n.Status.b.ERL || !cpuRegs.PERF.n.pccr.b.CTE ) return;
// TODO : Implement memory mode checks here (kernel/super/user) // Implemented memory mode check (kernel/super/user)
// For now we just assume kernel mode.
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 // 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 // Update Performance Counter 1