From 4bdba8ae6f5d1b295cd25c8bb93dea3dac7c1ed6 Mon Sep 17 00:00:00 2001 From: kotcrab <4594081+kotcrab@users.noreply.github.com> Date: Sat, 25 Sep 2021 16:30:13 +0200 Subject: [PATCH] Fix disassembly of vmfvc and vmtvc --- Core/MIPS/MIPSDisVFPU.cpp | 14 +++++++++++--- Core/MIPS/MIPSDisVFPU.h | 3 ++- Core/MIPS/MIPSTables.cpp | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Core/MIPS/MIPSDisVFPU.cpp b/Core/MIPS/MIPSDisVFPU.cpp index 6c21fb2988..fcbbca124e 100644 --- a/Core/MIPS/MIPSDisVFPU.cpp +++ b/Core/MIPS/MIPSDisVFPU.cpp @@ -138,12 +138,20 @@ namespace MIPSDis sprintf(out, "%s%s\t%s, %s",name,vr>127?"c":"", RN(rt), VN(vr, V_Single)); } - void Dis_Vmftvc(MIPSOpcode op, char *out) + void Dis_Vmfvc(MIPSOpcode op, char *out) { - int vr = op & 0xFF; + int vd = _VD; + int vr = (op >> 8) & 0x7F; + const char* name = MIPSGetName(op); + sprintf(out, "%s\t%s, %s", name, VN(vd, V_Single), VN(vr + 128, V_Single)); + } + + void Dis_Vmtvc(MIPSOpcode op, char *out) + { + int vr = op & 0x7F; int vs = _VS; const char *name = MIPSGetName(op); - sprintf(out, "%s\t%s, %s", name, VN(vs, V_Single), VN(vr, V_Single)); + sprintf(out, "%s\t%s, %s", name, VN(vs, V_Single), VN(vr + 128, V_Single)); } void Dis_VPFXST(MIPSOpcode op, char *out) diff --git a/Core/MIPS/MIPSDisVFPU.h b/Core/MIPS/MIPSDisVFPU.h index 3ccabeea8c..8890ed29b1 100644 --- a/Core/MIPS/MIPSDisVFPU.h +++ b/Core/MIPS/MIPSDisVFPU.h @@ -24,7 +24,8 @@ extern u32 disPC; namespace MIPSDis { void Dis_Mftv(MIPSOpcode op, char *out); - void Dis_Vmftvc(MIPSOpcode op, char *out); + void Dis_Vmfvc(MIPSOpcode op, char *out); + void Dis_Vmtvc(MIPSOpcode op, char *out); void Dis_SV(MIPSOpcode op, char *out); void Dis_SVQ(MIPSOpcode op, char *out); diff --git a/Core/MIPS/MIPSTables.cpp b/Core/MIPS/MIPSTables.cpp index 166f0cc969..db8885573e 100644 --- a/Core/MIPS/MIPSTables.cpp +++ b/Core/MIPS/MIPSTables.cpp @@ -746,8 +746,8 @@ const MIPSInstruction tableVFPU9[32] = // 110100 00010 xxxxx . ....... . ....... INVALID, //16 - INSTR("vmfvc", JITFUNC(Comp_Vmfvc), Dis_Vmftvc, Int_Vmfvc, IN_OTHER|IN_VFPU_CC|OUT_OTHER|IS_VFPU), - INSTR("vmtvc", JITFUNC(Comp_Vmtvc), Dis_Vmftvc, Int_Vmtvc, IN_OTHER|OUT_VFPU_CC|OUT_OTHER|IS_VFPU), + INSTR("vmfvc", JITFUNC(Comp_Vmfvc), Dis_Vmfvc, Int_Vmfvc, IN_OTHER|IN_VFPU_CC|OUT_OTHER|IS_VFPU), + INSTR("vmtvc", JITFUNC(Comp_Vmtvc), Dis_Vmtvc, Int_Vmtvc, IN_OTHER|OUT_VFPU_CC|OUT_OTHER|IS_VFPU), INVALID, INVALID,