diff --git a/Core/MIPS/MIPSAnalyst.cpp b/Core/MIPS/MIPSAnalyst.cpp index 83a12ae1c3..d9c2324b3a 100644 --- a/Core/MIPS/MIPSAnalyst.cpp +++ b/Core/MIPS/MIPSAnalyst.cpp @@ -404,7 +404,7 @@ namespace MIPSAnalyst { //j , jal, ... if (opInfo & IS_JUMP) { info.isBranch = true; - if (opInfo & OUT_RA) { // link + if ((opInfo & OUT_RA) || (opInfo & OUT_RD)) { // link info.isLinkedBranch = true; } @@ -446,15 +446,23 @@ namespace MIPSAnalyst { u32 rs = cpu->GetRegValue(0, (int)MIPS_GET_RS(op)); switch (opInfo & CONDTYPE_MASK) { case CONDTYPE_EQ: - info.conditionMet = (rt == rs); - if (MIPS_GET_RT(op) == MIPS_GET_RS(op)) { // always true - info.isConditional = false; + if (opInfo & IN_FPUFLAG) { // fpu branch + info.conditionMet = currentMIPS->fpcond == 0; + } else { + info.conditionMet = (rt == rs); + if (MIPS_GET_RT(op) == MIPS_GET_RS(op)) { // always true + info.isConditional = false; + } } break; case CONDTYPE_NE: - info.conditionMet = (rt != rs); - if (MIPS_GET_RT(op) == MIPS_GET_RS(op)) { // always true - info.isConditional = false; + if (opInfo & IN_FPUFLAG) { // fpu branch + info.conditionMet = currentMIPS->fpcond != 0; + } else { + info.conditionMet = (rt != rs); + if (MIPS_GET_RT(op) == MIPS_GET_RS(op)) { // always true + info.isConditional = false; + } } break; case CONDTYPE_LEZ: diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index bba0152204..c733d2f640 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -437,10 +437,10 @@ const MIPSInstruction tableCop1[32] = // 010001 xxxxx ..... ..... ........... const MIPSInstruction tableCop1BC[32] = // 010001 01000 xxxxx ................ { - INSTR("bc1f", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT), - INSTR("bc1t", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT), - INSTR("bc1fl", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|LIKELY), - INSTR("bc1tl", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|LIKELY), + INSTR("bc1f", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|CONDTYPE_FPUFALSE), + INSTR("bc1t", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|CONDTYPE_FPUTRUE), + INSTR("bc1fl", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|LIKELY|CONDTYPE_FPUFALSE), + INSTR("bc1tl", &Jit::Comp_FPUBranch, Dis_FPUBranch, Int_FPUBranch, IS_CONDBRANCH|IN_IMM16|IN_FPUFLAG|DELAYSLOT|LIKELY|CONDTYPE_FPUTRUE), INVALID, INVALID, INVALID, INVALID, //8 INVALID_X_8, diff --git a/Core/MIPS/MIPSTables.h b/Core/MIPS/MIPSTables.h index 859418e742..36b51e4a7e 100644 --- a/Core/MIPS/MIPSTables.h +++ b/Core/MIPS/MIPSTables.h @@ -43,6 +43,9 @@ struct MIPSInfo { #define CONDTYPE_LTZ 0x00000005 #define CONDTYPE_GEZ 0x00000006 +#define CONDTYPE_FPUFALSE CONDTYPE_EQ +#define CONDTYPE_FPUTRUE CONDTYPE_NE + // as long as the other flags are checked, // there is no way to misinterprete these // as CONDTYPE_X