Update PC before going into a replacement func.

This way we can report the PC properly on errors, and the replacement func
can even look at PC.
This commit is contained in:
Unknown W. Brackets committed 2014-05-31 10:03:01 -07:00
1 parent f489694515
commit d09be5a4bc
2 files changed
+5

No files matched your search

+3
View File
@@ -416,6 +416,9 @@ void Jit::Comp_ReplacementFunc(MIPSOpcode op)
}
} else if (entry->replaceFunc) {
FlushAll();
gpr.SetRegImm(SCRATCHREG1, js.compilerPC);
MovToPC(SCRATCHREG1);
// Standard function call, nothing fancy.
// The function returns the number of cycles it took in EAX.
if (BLInRange((const void *)(entry->replaceFunc))) {
+2
View File
@@ -442,6 +442,7 @@ bool Jit::ReplaceJalTo(u32 dest) {
gpr.SetImm(MIPS_REG_RA, js.compilerPC + 8);
CompileDelaySlot(DELAYSLOT_NICE);
FlushAll();
MOV(32, M(&mips_->pc), Imm32(js.compilerPC));
ABI_CallFunction(entry->replaceFunc);
SUB(32, M(&currentMIPS->downcount), R(EAX));
js.downcountAmount = 0; // we just subtracted most of it
@@ -491,6 +492,7 @@ void Jit::Comp_ReplacementFunc(MIPSOpcode op)
// Standard function call, nothing fancy.
// The function returns the number of cycles it took in EAX.
MOV(32, M(&mips_->pc), Imm32(js.compilerPC));
ABI_CallFunction(entry->replaceFunc);
if (entry->flags & (REPFLAG_HOOKENTER | REPFLAG_HOOKEXIT)) {