diff --git a/Core/MIPS/MIPSDisVFPU.cpp b/Core/MIPS/MIPSDisVFPU.cpp index 1247794718..187d61d082 100644 --- a/Core/MIPS/MIPSDisVFPU.cpp +++ b/Core/MIPS/MIPSDisVFPU.cpp @@ -287,7 +287,7 @@ namespace MIPSDis void Dis_Vflush(u32 op, char *out) { - sprintf(out,"vflush\tand friends"); + sprintf(out,"vflush"); } void Dis_Vcrs(u32 op, char *out) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 02f6225a74..72b3eb0e59 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -1110,26 +1110,28 @@ namespace MIPSInt int rt = _RT; switch ((op >> 21) & 0x1f) { - case 3: //mfv + case 3: //mfv / mfvc if (imm < 128) { R(rt) = VI(imm); - } else if (imm < 128 + VFPU_CTRL_MAX) { + } else if (imm < 128 + VFPU_CTRL_MAX) { //mtvc R(rt) = currentMIPS->vfpuCtrl[imm - 128]; } else { //ERROR _dbg_assert_msg_(CPU,0,"mfv - invalid register"); } break; + case 7: //mtv if (imm < 128) { VI(imm) = R(rt); - } else if (imm < 128 + VFPU_CTRL_MAX) { + } else if (imm < 128 + VFPU_CTRL_MAX) { //mtvc currentMIPS->vfpuCtrl[imm - 128] = R(rt); } else { //ERROR _dbg_assert_msg_(CPU,0,"mtv - invalid register"); } break; + default: _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); break; @@ -1137,6 +1139,24 @@ namespace MIPSInt PC += 4; } + void Int_Vmfvc(u32 op) { + int vs = _VS; + int imm = op & 0xFF; + if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) { + VI(vs) = currentMIPS->vfpuCtrl[imm - 128]; + } + PC += 4; + } + + void Int_Vmtvc(u32 op) { + int vs = _VS; + int imm = op & 0xFF; + if (imm >= 128 && imm < 128 + VFPU_CTRL_MAX) { + currentMIPS->vfpuCtrl[imm - 128] = VI(vs); + } + PC += 4; + } + #undef max void Int_Vcst(u32 op) diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 35ca528956..ed54a09df7 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -709,8 +709,8 @@ MIPSInstruction tableVFPU9[32] = //110100 00010 xxxxx {-2}, //16 - {-2}, //INSTR("vmfvc", &Jit::Comp_Generic, Dis_Generic, Int_Vmfvc, IS_VFPU), MUST BE WRONG, covered by mfv - {-2}, //INSTR("vmtvc", &Jit::Comp_Generic, Dis_Generic, Int_Vmtvc, IS_VFPU), + INSTR("vmfvc", &Jit::Comp_Generic, Dis_Generic, Int_Vmfvc, IS_VFPU), + INSTR("vmtvc", &Jit::Comp_Generic, Dis_Generic, Int_Vmtvc, IS_VFPU), {-2}, {-2},