From ccb8f8d77e5fef95b2cde188b1f303d40ac466af Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 9 May 2016 00:36:38 -0700 Subject: [PATCH] jit-ir: Fix replacement hooks. --- Core/MIPS/IR/IRInterpreter.cpp | 2 +- Core/MIPS/IR/IRJit.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index 9b0c9eb1eb..03b06c77e1 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -384,7 +384,7 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, const u32 *constPool, int c const ReplacementTableEntry *f = GetReplacementFunc(funcIndex); int cycles = f->replaceFunc(); mips->downcount -= cycles; - return mips->r[MIPS_REG_RA]; + break; } case IROp::Break: diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index 76b58161d3..e5bddd6c89 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -340,6 +340,8 @@ void IRJit::Comp_ReplacementFunc(MIPSOpcode op) { MIPSCompileOp(Memory::Read_Instruction(GetCompilerPC(), true), this); } else { ApplyRoundingMode(); + ir.Write(IROp::Downcount, 0, js.downcountAmount & 0xFF, js.downcountAmount >> 8); + ir.Write(IROp::ExitToReg, MIPS_REG_RA, 0, 0); js.compiling = false; } } else {