pcsx2: interpreter: increment pc before reading pc content

memRead32 could throw a TLB miss exception, however TLB handler expects pc counter to be incremented

Goemon is now really "playable" with the interpreter (disable automatic gamefix)
This commit is contained in:
Gregory Hainaut 2014-11-14 22:49:16 +01:00
parent a30bd86311
commit 8a899c4c7b
1 changed files with 6 additions and 2 deletions

View File

@ -133,8 +133,13 @@ static void execI()
intCheckMemcheck();
u32 pc = cpuRegs.pc;
// We need to increase the pc before executing the memRead32. An exception could appears
// and it expects the PC counter to be pre-incremented
cpuRegs.pc += 4;
// interprete instruction
cpuRegs.code = memRead32( cpuRegs.pc );
cpuRegs.code = memRead32( pc );
if( IsDebugBuild )
debugI();
@ -159,7 +164,6 @@ static void execI()
cpuBlockCycles += opcode.cycles;
cpuRegs.pc += 4;
opcode.interpret();
}