diff --git a/pcsx2/R3000AInterpreter.cpp b/pcsx2/R3000AInterpreter.cpp index 1722932123..69bc479fcd 100644 --- a/pcsx2/R3000AInterpreter.cpp +++ b/pcsx2/R3000AInterpreter.cpp @@ -39,9 +39,9 @@ void psxBGEZ() // Branch if Rs >= 0 void psxBGEZAL() // Branch if Rs >= 0 and link { + _SetLink(31); if (_i32(_rRs_) >= 0) { - _SetLink(31); doBranch(_BranchTarget_); } } @@ -62,9 +62,9 @@ void psxBLTZ() // Branch if Rs < 0 void psxBLTZAL() // Branch if Rs < 0 and link { + _SetLink(31); if (_i32(_rRs_) < 0) { - _SetLink(31); doBranch(_BranchTarget_); } } diff --git a/pcsx2/x86/iR3000Atables.cpp b/pcsx2/x86/iR3000Atables.cpp index a3bed6dd2f..b6123253a6 100644 --- a/pcsx2/x86/iR3000Atables.cpp +++ b/pcsx2/x86/iR3000Atables.cpp @@ -1163,13 +1163,12 @@ void rpsxBLTZAL() _psxDeleteReg(31, 0); _psxFlushAllUnused(); + PSX_SET_CONST(31); + g_psxConstRegs[31] = psxpc + 4; + if( PSX_IS_CONST1(_Rs_) ) { if( (int)g_psxConstRegs[_Rs_] >= 0 ) branchTo = psxpc+4; - else { - PSX_SET_CONST(_Rt_); - g_psxConstRegs[31] = psxpc+4; - } psxRecompileNextInstruction(1); psxSetBranchImm( branchTo ); @@ -1181,7 +1180,6 @@ void rpsxBLTZAL() psxSaveBranchState(); - MOV32ItoM((uptr)&psxRegs.GPR.r[31], psxpc+4); psxRecompileNextInstruction(1); psxSetBranchImm(psxpc); @@ -1205,11 +1203,12 @@ void rpsxBGEZAL() _psxDeleteReg(31, 0); _psxFlushAllUnused(); + PSX_SET_CONST(31); + g_psxConstRegs[31] = psxpc + 4; + if( PSX_IS_CONST1(_Rs_) ) { if( (int)g_psxConstRegs[_Rs_] < 0 ) branchTo = psxpc+4; - else - MOV32ItoM((uptr)&psxRegs.GPR.r[31], psxpc+4); psxRecompileNextInstruction(1); psxSetBranchImm( branchTo ); @@ -1219,8 +1218,6 @@ void rpsxBGEZAL() CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0); u32* pjmp = JGE32(0); - MOV32ItoM((uptr)&psxRegs.GPR.r[31], psxpc+4); - psxSaveBranchState(); psxRecompileNextInstruction(1);