mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 17:59:08 +02:00
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:
1 parent
f489694515
commit
d09be5a4bc
2 files changed
+5
No files matched your search
@@ -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))) {
|
||||
|
||||
@@ -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(¤tMIPS->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)) {
|
||||
|
||||
Reference in new issue
Block a user