From 8a899c4c7bf6409d9fa8e365096849d80fc3ea1c Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 14 Nov 2014 22:49:16 +0100 Subject: [PATCH] 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) --- pcsx2/Interpreter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pcsx2/Interpreter.cpp b/pcsx2/Interpreter.cpp index 60f2cb435c..2706f3f7b0 100644 --- a/pcsx2/Interpreter.cpp +++ b/pcsx2/Interpreter.cpp @@ -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(); }