From 19240302660e79092cca91ab1b8ab53f051180a8 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 2 Aug 2024 22:00:01 +0930 Subject: [PATCH] RSP: Move compile functions into CRSPRecompilerOps --- .../Recompiler/RspRecompilerCPU.cpp | 719 +++++++++--------- .../Recompiler/RspRecompilerCPU.h | 2 +- .../Recompiler/RspRecompilerOps.cpp | 293 +++---- .../Recompiler/RspRecompilerOps.h | 294 +++---- 4 files changed, 663 insertions(+), 645 deletions(-) diff --git a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp index feb9fc98c..0b2d946eb 100644 --- a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp +++ b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -31,367 +32,376 @@ RSP_COMPILER Compiler; uint8_t *pLastSecondary = NULL, *pLastPrimary = NULL; +p_Recompfunc RSP_Recomp_Opcode[64]; +p_Recompfunc RSP_Recomp_RegImm[32]; +p_Recompfunc RSP_Recomp_Special[64]; +p_Recompfunc RSP_Recomp_Cop0[32]; +p_Recompfunc RSP_Recomp_Cop2[32]; +p_Recompfunc RSP_Recomp_Vector[64]; +p_Recompfunc RSP_Recomp_Lc2[32]; +p_Recompfunc RSP_Recomp_Sc2[32]; + void BuildRecompilerCPU(void) { - RSP_Recomp_Opcode[0] = Compile_SPECIAL; - RSP_Recomp_Opcode[1] = Compile_REGIMM; - RSP_Recomp_Opcode[2] = Compile_J; - RSP_Recomp_Opcode[3] = Compile_JAL; - RSP_Recomp_Opcode[4] = Compile_BEQ; - RSP_Recomp_Opcode[5] = Compile_BNE; - RSP_Recomp_Opcode[6] = Compile_BLEZ; - RSP_Recomp_Opcode[7] = Compile_BGTZ; - RSP_Recomp_Opcode[8] = Compile_ADDI; - RSP_Recomp_Opcode[9] = Compile_ADDIU; - RSP_Recomp_Opcode[10] = Compile_SLTI; - RSP_Recomp_Opcode[11] = Compile_SLTIU; - RSP_Recomp_Opcode[12] = Compile_ANDI; - RSP_Recomp_Opcode[13] = Compile_ORI; - RSP_Recomp_Opcode[14] = Compile_XORI; - RSP_Recomp_Opcode[15] = Compile_LUI; - RSP_Recomp_Opcode[16] = Compile_COP0; - RSP_Recomp_Opcode[17] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[18] = Compile_COP2; - RSP_Recomp_Opcode[19] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[20] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[21] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[22] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[23] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[24] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[25] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[26] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[27] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[28] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[29] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[30] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[31] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[32] = Compile_LB; - RSP_Recomp_Opcode[33] = Compile_LH; - RSP_Recomp_Opcode[34] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[35] = Compile_LW; - RSP_Recomp_Opcode[36] = Compile_LBU; - RSP_Recomp_Opcode[37] = Compile_LHU; - RSP_Recomp_Opcode[38] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[39] = Compile_LWU; - RSP_Recomp_Opcode[40] = Compile_SB; - RSP_Recomp_Opcode[41] = Compile_SH; - RSP_Recomp_Opcode[42] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[43] = Compile_SW; - RSP_Recomp_Opcode[44] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[45] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[46] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[47] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[48] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[49] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[50] = Compile_LC2; - RSP_Recomp_Opcode[51] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[52] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[53] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[54] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[55] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[56] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[57] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[58] = Compile_SC2; - RSP_Recomp_Opcode[59] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[60] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[61] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[62] = Compile_UnknownOpcode; - RSP_Recomp_Opcode[63] = Compile_UnknownOpcode; + RSP_Recomp_Opcode[0] = &CRSPRecompilerOps::SPECIAL; + RSP_Recomp_Opcode[1] = &CRSPRecompilerOps::REGIMM; + RSP_Recomp_Opcode[2] = &CRSPRecompilerOps::J; + RSP_Recomp_Opcode[3] = &CRSPRecompilerOps::JAL; + RSP_Recomp_Opcode[4] = &CRSPRecompilerOps::BEQ; + RSP_Recomp_Opcode[5] = &CRSPRecompilerOps::BNE; + RSP_Recomp_Opcode[6] = &CRSPRecompilerOps::BLEZ; + RSP_Recomp_Opcode[7] = &CRSPRecompilerOps::BGTZ; + RSP_Recomp_Opcode[8] = &CRSPRecompilerOps::ADDI; + RSP_Recomp_Opcode[9] = &CRSPRecompilerOps::ADDIU; + RSP_Recomp_Opcode[10] = &CRSPRecompilerOps::SLTI; + RSP_Recomp_Opcode[11] = &CRSPRecompilerOps::SLTIU; + RSP_Recomp_Opcode[12] = &CRSPRecompilerOps::ANDI; + RSP_Recomp_Opcode[13] = &CRSPRecompilerOps::ORI; + RSP_Recomp_Opcode[14] = &CRSPRecompilerOps::XORI; + RSP_Recomp_Opcode[15] = &CRSPRecompilerOps::LUI; + RSP_Recomp_Opcode[16] = &CRSPRecompilerOps::COP0; + RSP_Recomp_Opcode[17] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[18] = &CRSPRecompilerOps::COP2; + RSP_Recomp_Opcode[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[31] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[32] = &CRSPRecompilerOps::LB; + RSP_Recomp_Opcode[33] = &CRSPRecompilerOps::LH; + RSP_Recomp_Opcode[34] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[35] = &CRSPRecompilerOps::LW; + RSP_Recomp_Opcode[36] = &CRSPRecompilerOps::LBU; + RSP_Recomp_Opcode[37] = &CRSPRecompilerOps::LHU; + RSP_Recomp_Opcode[38] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[39] = &CRSPRecompilerOps::LWU; + RSP_Recomp_Opcode[40] = &CRSPRecompilerOps::SB; + RSP_Recomp_Opcode[41] = &CRSPRecompilerOps::SH; + RSP_Recomp_Opcode[42] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[43] = &CRSPRecompilerOps::SW; + RSP_Recomp_Opcode[44] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[45] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[46] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[47] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[48] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[49] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[50] = &CRSPRecompilerOps::LC2; + RSP_Recomp_Opcode[51] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[52] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[53] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[54] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[55] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[56] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[57] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[58] = &CRSPRecompilerOps::SC2; + RSP_Recomp_Opcode[59] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[60] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[61] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[62] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Opcode[63] = &CRSPRecompilerOps::UnknownOpcode; - RSP_Recomp_Special[0] = Compile_Special_SLL; - RSP_Recomp_Special[1] = Compile_UnknownOpcode; - RSP_Recomp_Special[2] = Compile_Special_SRL; - RSP_Recomp_Special[3] = Compile_Special_SRA; - RSP_Recomp_Special[4] = Compile_Special_SLLV; - RSP_Recomp_Special[5] = Compile_UnknownOpcode; - RSP_Recomp_Special[6] = Compile_Special_SRLV; - RSP_Recomp_Special[7] = Compile_Special_SRAV; - RSP_Recomp_Special[8] = Compile_Special_JR; - RSP_Recomp_Special[9] = Compile_Special_JALR; - RSP_Recomp_Special[10] = Compile_UnknownOpcode; - RSP_Recomp_Special[11] = Compile_UnknownOpcode; - RSP_Recomp_Special[12] = Compile_UnknownOpcode; - RSP_Recomp_Special[13] = Compile_Special_BREAK; - RSP_Recomp_Special[14] = Compile_UnknownOpcode; - RSP_Recomp_Special[15] = Compile_UnknownOpcode; - RSP_Recomp_Special[16] = Compile_UnknownOpcode; - RSP_Recomp_Special[17] = Compile_UnknownOpcode; - RSP_Recomp_Special[18] = Compile_UnknownOpcode; - RSP_Recomp_Special[19] = Compile_UnknownOpcode; - RSP_Recomp_Special[20] = Compile_UnknownOpcode; - RSP_Recomp_Special[21] = Compile_UnknownOpcode; - RSP_Recomp_Special[22] = Compile_UnknownOpcode; - RSP_Recomp_Special[23] = Compile_UnknownOpcode; - RSP_Recomp_Special[24] = Compile_UnknownOpcode; - RSP_Recomp_Special[25] = Compile_UnknownOpcode; - RSP_Recomp_Special[26] = Compile_UnknownOpcode; - RSP_Recomp_Special[27] = Compile_UnknownOpcode; - RSP_Recomp_Special[28] = Compile_UnknownOpcode; - RSP_Recomp_Special[29] = Compile_UnknownOpcode; - RSP_Recomp_Special[30] = Compile_UnknownOpcode; - RSP_Recomp_Special[31] = Compile_UnknownOpcode; - RSP_Recomp_Special[32] = Compile_Special_ADD; - RSP_Recomp_Special[33] = Compile_Special_ADDU; - RSP_Recomp_Special[34] = Compile_Special_SUB; - RSP_Recomp_Special[35] = Compile_Special_SUBU; - RSP_Recomp_Special[36] = Compile_Special_AND; - RSP_Recomp_Special[37] = Compile_Special_OR; - RSP_Recomp_Special[38] = Compile_Special_XOR; - RSP_Recomp_Special[39] = Compile_Special_NOR; - RSP_Recomp_Special[40] = Compile_UnknownOpcode; - RSP_Recomp_Special[41] = Compile_UnknownOpcode; - RSP_Recomp_Special[42] = Compile_Special_SLT; - RSP_Recomp_Special[43] = Compile_Special_SLTU; - RSP_Recomp_Special[44] = Compile_UnknownOpcode; - RSP_Recomp_Special[45] = Compile_UnknownOpcode; - RSP_Recomp_Special[46] = Compile_UnknownOpcode; - RSP_Recomp_Special[47] = Compile_UnknownOpcode; - RSP_Recomp_Special[48] = Compile_UnknownOpcode; - RSP_Recomp_Special[49] = Compile_UnknownOpcode; - RSP_Recomp_Special[50] = Compile_UnknownOpcode; - RSP_Recomp_Special[51] = Compile_UnknownOpcode; - RSP_Recomp_Special[52] = Compile_UnknownOpcode; - RSP_Recomp_Special[53] = Compile_UnknownOpcode; - RSP_Recomp_Special[54] = Compile_UnknownOpcode; - RSP_Recomp_Special[55] = Compile_UnknownOpcode; - RSP_Recomp_Special[56] = Compile_UnknownOpcode; - RSP_Recomp_Special[57] = Compile_UnknownOpcode; - RSP_Recomp_Special[58] = Compile_UnknownOpcode; - RSP_Recomp_Special[59] = Compile_UnknownOpcode; - RSP_Recomp_Special[60] = Compile_UnknownOpcode; - RSP_Recomp_Special[61] = Compile_UnknownOpcode; - RSP_Recomp_Special[62] = Compile_UnknownOpcode; - RSP_Recomp_Special[63] = Compile_UnknownOpcode; + RSP_Recomp_Special[0] = &CRSPRecompilerOps::Special_SLL; + RSP_Recomp_Special[1] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[2] = &CRSPRecompilerOps::Special_SRL; + RSP_Recomp_Special[3] = &CRSPRecompilerOps::Special_SRA; + RSP_Recomp_Special[4] = &CRSPRecompilerOps::Special_SLLV; + RSP_Recomp_Special[5] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[6] = &CRSPRecompilerOps::Special_SRLV; + RSP_Recomp_Special[7] = &CRSPRecompilerOps::Special_SRAV; + RSP_Recomp_Special[8] = &CRSPRecompilerOps::Special_JR; + RSP_Recomp_Special[9] = &CRSPRecompilerOps::Special_JALR; + RSP_Recomp_Special[10] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[11] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[13] = &CRSPRecompilerOps::Special_BREAK; + RSP_Recomp_Special[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[16] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[17] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[18] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[31] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[32] = &CRSPRecompilerOps::Special_ADD; + RSP_Recomp_Special[33] = &CRSPRecompilerOps::Special_ADDU; + RSP_Recomp_Special[34] = &CRSPRecompilerOps::Special_SUB; + RSP_Recomp_Special[35] = &CRSPRecompilerOps::Special_SUBU; + RSP_Recomp_Special[36] = &CRSPRecompilerOps::Special_AND; + RSP_Recomp_Special[37] = &CRSPRecompilerOps::Special_OR; + RSP_Recomp_Special[38] = &CRSPRecompilerOps::Special_XOR; + RSP_Recomp_Special[39] = &CRSPRecompilerOps::Special_NOR; + RSP_Recomp_Special[40] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[41] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[42] = &CRSPRecompilerOps::Special_SLT; + RSP_Recomp_Special[43] = &CRSPRecompilerOps::Special_SLTU; + RSP_Recomp_Special[44] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[45] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[46] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[47] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[48] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[49] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[50] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[51] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[52] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[53] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[54] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[55] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[56] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[57] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[58] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[59] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[60] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[61] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[62] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Special[63] = &CRSPRecompilerOps::UnknownOpcode; - RSP_Recomp_RegImm[0] = Compile_RegImm_BLTZ; - RSP_Recomp_RegImm[1] = Compile_RegImm_BGEZ; - RSP_Recomp_RegImm[2] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[3] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[4] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[5] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[6] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[7] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[8] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[9] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[10] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[11] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[12] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[13] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[14] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[15] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[16] = Compile_RegImm_BLTZAL; - RSP_Recomp_RegImm[17] = Compile_RegImm_BGEZAL; - RSP_Recomp_RegImm[18] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[19] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[20] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[21] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[22] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[23] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[24] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[25] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[26] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[27] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[28] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[29] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[30] = Compile_UnknownOpcode; - RSP_Recomp_RegImm[31] = Compile_UnknownOpcode; + RSP_Recomp_RegImm[0] = &CRSPRecompilerOps::RegImm_BLTZ; + RSP_Recomp_RegImm[1] = &CRSPRecompilerOps::RegImm_BGEZ; + RSP_Recomp_RegImm[2] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[3] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[4] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[5] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[6] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[7] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[8] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[9] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[10] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[11] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[13] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[16] = &CRSPRecompilerOps::RegImm_BLTZAL; + RSP_Recomp_RegImm[17] = &CRSPRecompilerOps::RegImm_BGEZAL; + RSP_Recomp_RegImm[18] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_RegImm[31] = &CRSPRecompilerOps::UnknownOpcode; - RSP_Recomp_Cop0[0] = Compile_Cop0_MF; - RSP_Recomp_Cop0[1] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[2] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[3] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[4] = Compile_Cop0_MT; - RSP_Recomp_Cop0[5] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[6] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[7] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[8] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[9] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[10] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[11] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[12] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[13] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[14] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[15] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[16] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[17] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[18] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[19] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[20] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[21] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[22] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[23] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[24] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[25] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[26] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[27] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[28] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[29] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[30] = Compile_UnknownOpcode; - RSP_Recomp_Cop0[31] = Compile_UnknownOpcode; + RSP_Recomp_Cop0[0] = &CRSPRecompilerOps::Cop0_MF; + RSP_Recomp_Cop0[1] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[2] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[3] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[4] = &CRSPRecompilerOps::Cop0_MT; + RSP_Recomp_Cop0[5] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[6] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[7] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[8] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[9] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[10] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[11] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[13] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[16] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[17] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[18] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop0[31] = &CRSPRecompilerOps::UnknownOpcode; - RSP_Recomp_Cop2[0] = Compile_Cop2_MF; - RSP_Recomp_Cop2[1] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[2] = Compile_Cop2_CF; - RSP_Recomp_Cop2[3] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[4] = Compile_Cop2_MT; - RSP_Recomp_Cop2[5] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[6] = Compile_Cop2_CT; - RSP_Recomp_Cop2[7] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[8] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[9] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[10] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[11] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[12] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[13] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[14] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[15] = Compile_UnknownOpcode; - RSP_Recomp_Cop2[16] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[17] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[18] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[19] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[20] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[21] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[22] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[23] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[24] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[25] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[26] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[27] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[28] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[29] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[30] = Compile_COP2_VECTOR; - RSP_Recomp_Cop2[31] = Compile_COP2_VECTOR; + RSP_Recomp_Cop2[0] = &CRSPRecompilerOps::Cop2_MF; + RSP_Recomp_Cop2[1] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[2] = &CRSPRecompilerOps::Cop2_CF; + RSP_Recomp_Cop2[3] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[4] = &CRSPRecompilerOps::Cop2_MT; + RSP_Recomp_Cop2[5] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[6] = &CRSPRecompilerOps::Cop2_CT; + RSP_Recomp_Cop2[7] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[8] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[9] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[10] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[11] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[13] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Cop2[16] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[17] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[18] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[19] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[20] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[21] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[22] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[23] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[24] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[25] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[26] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[27] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[28] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[29] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[30] = &CRSPRecompilerOps::COP2_VECTOR; + RSP_Recomp_Cop2[31] = &CRSPRecompilerOps::COP2_VECTOR; - RSP_Recomp_Vector[0] = Compile_Vector_VMULF; - RSP_Recomp_Vector[1] = Compile_Vector_VMULU; - RSP_Recomp_Vector[2] = Compile_Vector_VRNDP; - RSP_Recomp_Vector[3] = Compile_Vector_VMULQ; - RSP_Recomp_Vector[4] = Compile_Vector_VMUDL; - RSP_Recomp_Vector[5] = Compile_Vector_VMUDM; - RSP_Recomp_Vector[6] = Compile_Vector_VMUDN; - RSP_Recomp_Vector[7] = Compile_Vector_VMUDH; - RSP_Recomp_Vector[8] = Compile_Vector_VMACF; - RSP_Recomp_Vector[9] = Compile_Vector_VMACU; - RSP_Recomp_Vector[10] = Compile_Vector_VRNDN; - RSP_Recomp_Vector[11] = Compile_Vector_VMACQ; - RSP_Recomp_Vector[12] = Compile_Vector_VMADL; - RSP_Recomp_Vector[13] = Compile_Vector_VMADM; - RSP_Recomp_Vector[14] = Compile_Vector_VMADN; - RSP_Recomp_Vector[15] = Compile_Vector_VMADH; - RSP_Recomp_Vector[16] = Compile_Vector_VADD; - RSP_Recomp_Vector[17] = Compile_Vector_VSUB; - RSP_Recomp_Vector[18] = Compile_Vector_Reserved; - RSP_Recomp_Vector[19] = Compile_Vector_VABS; - RSP_Recomp_Vector[20] = Compile_Vector_VADDC; - RSP_Recomp_Vector[21] = Compile_Vector_VSUBC; - RSP_Recomp_Vector[22] = Compile_Vector_Reserved; - RSP_Recomp_Vector[23] = Compile_Vector_Reserved; - RSP_Recomp_Vector[24] = Compile_Vector_Reserved; - RSP_Recomp_Vector[25] = Compile_Vector_Reserved; - RSP_Recomp_Vector[26] = Compile_Vector_Reserved; - RSP_Recomp_Vector[27] = Compile_Vector_Reserved; - RSP_Recomp_Vector[28] = Compile_Vector_Reserved; - RSP_Recomp_Vector[29] = Compile_Vector_VSAW; - RSP_Recomp_Vector[30] = Compile_Vector_Reserved; - RSP_Recomp_Vector[31] = Compile_Vector_Reserved; - RSP_Recomp_Vector[32] = Compile_Vector_VLT; - RSP_Recomp_Vector[33] = Compile_Vector_VEQ; - RSP_Recomp_Vector[34] = Compile_Vector_VNE; - RSP_Recomp_Vector[35] = Compile_Vector_VGE; - RSP_Recomp_Vector[36] = Compile_Vector_VCL; - RSP_Recomp_Vector[37] = Compile_Vector_VCH; - RSP_Recomp_Vector[38] = Compile_Vector_VCR; - RSP_Recomp_Vector[39] = Compile_Vector_VMRG; - RSP_Recomp_Vector[40] = Compile_Vector_VAND; - RSP_Recomp_Vector[41] = Compile_Vector_VNAND; - RSP_Recomp_Vector[42] = Compile_Vector_VOR; - RSP_Recomp_Vector[43] = Compile_Vector_VNOR; - RSP_Recomp_Vector[44] = Compile_Vector_VXOR; - RSP_Recomp_Vector[45] = Compile_Vector_VNXOR; - RSP_Recomp_Vector[46] = Compile_Vector_Reserved; - RSP_Recomp_Vector[47] = Compile_Vector_Reserved; - RSP_Recomp_Vector[48] = Compile_Vector_VRCP; - RSP_Recomp_Vector[49] = Compile_Vector_VRCPL; - RSP_Recomp_Vector[50] = Compile_Vector_VRCPH; - RSP_Recomp_Vector[51] = Compile_Vector_VMOV; - RSP_Recomp_Vector[52] = Compile_Vector_VRSQ; - RSP_Recomp_Vector[53] = Compile_Vector_VRSQL; - RSP_Recomp_Vector[54] = Compile_Vector_VRSQH; - RSP_Recomp_Vector[55] = Compile_Vector_VNOOP; - RSP_Recomp_Vector[56] = Compile_Vector_Reserved; - RSP_Recomp_Vector[57] = Compile_Vector_Reserved; - RSP_Recomp_Vector[58] = Compile_Vector_Reserved; - RSP_Recomp_Vector[59] = Compile_Vector_Reserved; - RSP_Recomp_Vector[60] = Compile_Vector_Reserved; - RSP_Recomp_Vector[61] = Compile_Vector_Reserved; - RSP_Recomp_Vector[62] = Compile_Vector_Reserved; - RSP_Recomp_Vector[63] = Compile_Vector_VNOOP; + RSP_Recomp_Vector[0] = &CRSPRecompilerOps::Vector_VMULF; + RSP_Recomp_Vector[1] = &CRSPRecompilerOps::Vector_VMULU; + RSP_Recomp_Vector[2] = &CRSPRecompilerOps::Vector_VRNDP; + RSP_Recomp_Vector[3] = &CRSPRecompilerOps::Vector_VMULQ; + RSP_Recomp_Vector[4] = &CRSPRecompilerOps::Vector_VMUDL; + RSP_Recomp_Vector[5] = &CRSPRecompilerOps::Vector_VMUDM; + RSP_Recomp_Vector[6] = &CRSPRecompilerOps::Vector_VMUDN; + RSP_Recomp_Vector[7] = &CRSPRecompilerOps::Vector_VMUDH; + RSP_Recomp_Vector[8] = &CRSPRecompilerOps::Vector_VMACF; + RSP_Recomp_Vector[9] = &CRSPRecompilerOps::Vector_VMACU; + RSP_Recomp_Vector[10] = &CRSPRecompilerOps::Vector_VRNDN; + RSP_Recomp_Vector[11] = &CRSPRecompilerOps::Vector_VMACQ; + RSP_Recomp_Vector[12] = &CRSPRecompilerOps::Vector_VMADL; + RSP_Recomp_Vector[13] = &CRSPRecompilerOps::Vector_VMADM; + RSP_Recomp_Vector[14] = &CRSPRecompilerOps::Vector_VMADN; + RSP_Recomp_Vector[15] = &CRSPRecompilerOps::Vector_VMADH; + RSP_Recomp_Vector[16] = &CRSPRecompilerOps::Vector_VADD; + RSP_Recomp_Vector[17] = &CRSPRecompilerOps::Vector_VSUB; + RSP_Recomp_Vector[18] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[19] = &CRSPRecompilerOps::Vector_VABS; + RSP_Recomp_Vector[20] = &CRSPRecompilerOps::Vector_VADDC; + RSP_Recomp_Vector[21] = &CRSPRecompilerOps::Vector_VSUBC; + RSP_Recomp_Vector[22] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[23] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[24] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[25] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[26] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[27] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[28] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[29] = &CRSPRecompilerOps::Vector_VSAW; + RSP_Recomp_Vector[30] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[31] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[32] = &CRSPRecompilerOps::Vector_VLT; + RSP_Recomp_Vector[33] = &CRSPRecompilerOps::Vector_VEQ; + RSP_Recomp_Vector[34] = &CRSPRecompilerOps::Vector_VNE; + RSP_Recomp_Vector[35] = &CRSPRecompilerOps::Vector_VGE; + RSP_Recomp_Vector[36] = &CRSPRecompilerOps::Vector_VCL; + RSP_Recomp_Vector[37] = &CRSPRecompilerOps::Vector_VCH; + RSP_Recomp_Vector[38] = &CRSPRecompilerOps::Vector_VCR; + RSP_Recomp_Vector[39] = &CRSPRecompilerOps::Vector_VMRG; + RSP_Recomp_Vector[40] = &CRSPRecompilerOps::Vector_VAND; + RSP_Recomp_Vector[41] = &CRSPRecompilerOps::Vector_VNAND; + RSP_Recomp_Vector[42] = &CRSPRecompilerOps::Vector_VOR; + RSP_Recomp_Vector[43] = &CRSPRecompilerOps::Vector_VNOR; + RSP_Recomp_Vector[44] = &CRSPRecompilerOps::Vector_VXOR; + RSP_Recomp_Vector[45] = &CRSPRecompilerOps::Vector_VNXOR; + RSP_Recomp_Vector[46] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[47] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[48] = &CRSPRecompilerOps::Vector_VRCP; + RSP_Recomp_Vector[49] = &CRSPRecompilerOps::Vector_VRCPL; + RSP_Recomp_Vector[50] = &CRSPRecompilerOps::Vector_VRCPH; + RSP_Recomp_Vector[51] = &CRSPRecompilerOps::Vector_VMOV; + RSP_Recomp_Vector[52] = &CRSPRecompilerOps::Vector_VRSQ; + RSP_Recomp_Vector[53] = &CRSPRecompilerOps::Vector_VRSQL; + RSP_Recomp_Vector[54] = &CRSPRecompilerOps::Vector_VRSQH; + RSP_Recomp_Vector[55] = &CRSPRecompilerOps::Vector_VNOOP; + RSP_Recomp_Vector[56] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[57] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[58] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[59] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[60] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[61] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[62] = &CRSPRecompilerOps::Vector_Reserved; + RSP_Recomp_Vector[63] = &CRSPRecompilerOps::Vector_VNOOP; - RSP_Recomp_Lc2[0] = Compile_Opcode_LBV; - RSP_Recomp_Lc2[1] = Compile_Opcode_LSV; - RSP_Recomp_Lc2[2] = Compile_Opcode_LLV; - RSP_Recomp_Lc2[3] = Compile_Opcode_LDV; - RSP_Recomp_Lc2[4] = Compile_Opcode_LQV; - RSP_Recomp_Lc2[5] = Compile_Opcode_LRV; - RSP_Recomp_Lc2[6] = Compile_Opcode_LPV; - RSP_Recomp_Lc2[7] = Compile_Opcode_LUV; - RSP_Recomp_Lc2[8] = Compile_Opcode_LHV; - RSP_Recomp_Lc2[9] = Compile_Opcode_LFV; - RSP_Recomp_Lc2[10] = Compile_Opcode_LWV; - RSP_Recomp_Lc2[11] = Compile_Opcode_LTV; - RSP_Recomp_Lc2[12] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[13] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[14] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[15] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[16] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[17] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[18] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[19] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[20] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[21] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[22] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[23] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[24] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[25] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[26] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[27] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[28] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[29] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[30] = Compile_UnknownOpcode; - RSP_Recomp_Lc2[31] = Compile_UnknownOpcode; + RSP_Recomp_Lc2[0] = &CRSPRecompilerOps::Opcode_LBV; + RSP_Recomp_Lc2[1] = &CRSPRecompilerOps::Opcode_LSV; + RSP_Recomp_Lc2[2] = &CRSPRecompilerOps::Opcode_LLV; + RSP_Recomp_Lc2[3] = &CRSPRecompilerOps::Opcode_LDV; + RSP_Recomp_Lc2[4] = &CRSPRecompilerOps::Opcode_LQV; + RSP_Recomp_Lc2[5] = &CRSPRecompilerOps::Opcode_LRV; + RSP_Recomp_Lc2[6] = &CRSPRecompilerOps::Opcode_LPV; + RSP_Recomp_Lc2[7] = &CRSPRecompilerOps::Opcode_LUV; + RSP_Recomp_Lc2[8] = &CRSPRecompilerOps::Opcode_LHV; + RSP_Recomp_Lc2[9] = &CRSPRecompilerOps::Opcode_LFV; + RSP_Recomp_Lc2[10] = &CRSPRecompilerOps::Opcode_LWV; + RSP_Recomp_Lc2[11] = &CRSPRecompilerOps::Opcode_LTV; + RSP_Recomp_Lc2[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[13] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[16] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[17] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[18] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Lc2[31] = &CRSPRecompilerOps::UnknownOpcode; - RSP_Recomp_Sc2[0] = Compile_Opcode_SBV; - RSP_Recomp_Sc2[1] = Compile_Opcode_SSV; - RSP_Recomp_Sc2[2] = Compile_Opcode_SLV; - RSP_Recomp_Sc2[3] = Compile_Opcode_SDV; - RSP_Recomp_Sc2[4] = Compile_Opcode_SQV; - RSP_Recomp_Sc2[5] = Compile_Opcode_SRV; - RSP_Recomp_Sc2[6] = Compile_Opcode_SPV; - RSP_Recomp_Sc2[7] = Compile_Opcode_SUV; - RSP_Recomp_Sc2[8] = Compile_Opcode_SHV; - RSP_Recomp_Sc2[9] = Compile_Opcode_SFV; - RSP_Recomp_Sc2[10] = Compile_Opcode_SWV; - RSP_Recomp_Sc2[11] = Compile_Opcode_STV; - RSP_Recomp_Sc2[12] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[13] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[14] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[15] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[16] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[17] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[18] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[19] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[20] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[21] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[22] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[23] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[24] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[25] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[26] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[27] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[28] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[29] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[30] = Compile_UnknownOpcode; - RSP_Recomp_Sc2[31] = Compile_UnknownOpcode; + RSP_Recomp_Sc2[0] = &CRSPRecompilerOps::Opcode_SBV; + RSP_Recomp_Sc2[1] = &CRSPRecompilerOps::Opcode_SSV; + RSP_Recomp_Sc2[2] = &CRSPRecompilerOps::Opcode_SLV; + RSP_Recomp_Sc2[3] = &CRSPRecompilerOps::Opcode_SDV; + RSP_Recomp_Sc2[4] = &CRSPRecompilerOps::Opcode_SQV; + RSP_Recomp_Sc2[5] = &CRSPRecompilerOps::Opcode_SRV; + RSP_Recomp_Sc2[6] = &CRSPRecompilerOps::Opcode_SPV; + RSP_Recomp_Sc2[7] = &CRSPRecompilerOps::Opcode_SUV; + RSP_Recomp_Sc2[8] = &CRSPRecompilerOps::Opcode_SHV; + RSP_Recomp_Sc2[9] = &CRSPRecompilerOps::Opcode_SFV; + RSP_Recomp_Sc2[10] = &CRSPRecompilerOps::Opcode_SWV; + RSP_Recomp_Sc2[11] = &CRSPRecompilerOps::Opcode_STV; + RSP_Recomp_Sc2[12] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[13] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[14] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[15] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[16] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[17] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[18] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[19] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[20] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[21] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[22] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[23] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[24] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[25] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[26] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[27] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[28] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[29] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[30] = &CRSPRecompilerOps::UnknownOpcode; + RSP_Recomp_Sc2[31] = &CRSPRecompilerOps::UnknownOpcode; BlockID = 0; ChangedPC = false; @@ -778,9 +788,10 @@ void CompilerLinkBlocks(void) void CompilerRSPBlock(void) { + CRSPRecompilerOps RecompilerOps(RSPSystem); + uint8_t * IMEM_SAVE = (uint8_t *)malloc(0x1000); const size_t X86BaseAddress = (size_t)RecompPos; - NextInstruction = RSPPIPELINE_NORMAL; CompilePC = *PrgCount; @@ -874,7 +885,7 @@ void CompilerRSPBlock(void) } else { - RSP_Recomp_Opcode[RSPOpC.op](); + (RecompilerOps.*RSP_Recomp_Opcode[RSPOpC.op])(); } switch (NextInstruction) diff --git a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.h b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.h index a99546e9c..5d8b40548 100644 --- a/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.h +++ b/Source/Project64-rsp-core/Recompiler/RspRecompilerCPU.h @@ -88,4 +88,4 @@ extern RSP_COMPILER Compiler; #define IsMmxEnabled (Compiler.mmx) #define IsMmx2Enabled (Compiler.mmx2) -#define IsSseEnabled (Compiler.sse) +#define IsSseEnabled (Compiler.sse) \ No newline at end of file diff --git a/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.cpp b/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.cpp index 040e9ad5a..1499dc3aa 100644 --- a/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.cpp +++ b/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.cpp @@ -89,14 +89,14 @@ uint32_t BranchCompare = 0; #define CompileSlv #endif -p_Recompfunc RSP_Recomp_Opcode[64]; -p_Recompfunc RSP_Recomp_RegImm[32]; -p_Recompfunc RSP_Recomp_Special[64]; -p_Recompfunc RSP_Recomp_Cop0[32]; -p_Recompfunc RSP_Recomp_Cop2[32]; -p_Recompfunc RSP_Recomp_Vector[64]; -p_Recompfunc RSP_Recomp_Lc2[32]; -p_Recompfunc RSP_Recomp_Sc2[32]; +extern p_Recompfunc RSP_Recomp_Opcode[64]; +extern p_Recompfunc RSP_Recomp_RegImm[32]; +extern p_Recompfunc RSP_Recomp_Special[64]; +extern p_Recompfunc RSP_Recomp_Cop0[32]; +extern p_Recompfunc RSP_Recomp_Cop2[32]; +extern p_Recompfunc RSP_Recomp_Vector[64]; +extern p_Recompfunc RSP_Recomp_Lc2[32]; +extern p_Recompfunc RSP_Recomp_Sc2[32]; void Branch_AddRef(uint32_t Target, uint32_t * X86Loc) { @@ -183,19 +183,24 @@ void CompileBranchExit(uint32_t TargetPC, uint32_t ContinuePC) Ret(); } +CRSPRecompilerOps::CRSPRecompilerOps(CRSPSystem & System) : + m_System(System) +{ +} + // Opcode functions -void Compile_SPECIAL(void) +void CRSPRecompilerOps::SPECIAL(void) { - RSP_Recomp_Special[RSPOpC.funct](); + (this->*RSP_Recomp_Special[RSPOpC.funct])(); } -void Compile_REGIMM(void) +void CRSPRecompilerOps::REGIMM(void) { - RSP_Recomp_RegImm[RSPOpC.rt](); + (this->*RSP_Recomp_RegImm[RSPOpC.rt])(); } -void Compile_J(void) +void CRSPRecompilerOps::J(void) { if (NextInstruction == RSPPIPELINE_NORMAL) { @@ -221,7 +226,7 @@ void Compile_J(void) } } -void Compile_JAL(void) +void CRSPRecompilerOps::JAL(void) { if (NextInstruction == RSPPIPELINE_NORMAL) { @@ -259,7 +264,7 @@ void Compile_JAL(void) } } -void Compile_BEQ(void) +void CRSPRecompilerOps::BEQ(void) { static bool bDelayAffect; @@ -343,7 +348,7 @@ void Compile_BEQ(void) } } -void Compile_BNE(void) +void CRSPRecompilerOps::BNE(void) { static bool bDelayAffect; @@ -427,7 +432,7 @@ void Compile_BNE(void) } } -void Compile_BLEZ(void) +void CRSPRecompilerOps::BLEZ(void) { static bool bDelayAffect; @@ -487,7 +492,7 @@ void Compile_BLEZ(void) } } -void Compile_BGTZ(void) +void CRSPRecompilerOps::BGTZ(void) { static bool bDelayAffect; @@ -544,7 +549,7 @@ void Compile_BGTZ(void) } } -void Compile_ADDI(void) +void CRSPRecompilerOps::ADDI(void) { if (RSPOpC.rt == 0) { @@ -584,7 +589,7 @@ void Compile_ADDI(void) #endif } -void Compile_ADDIU(void) +void CRSPRecompilerOps::ADDIU(void) { if (RSPOpC.rt == 0) { @@ -621,7 +626,7 @@ void Compile_ADDIU(void) #endif } -void Compile_SLTI(void) +void CRSPRecompilerOps::SLTI(void) { if (RSPOpC.rt == 0) { @@ -649,7 +654,7 @@ void Compile_SLTI(void) #endif } -void Compile_SLTIU(void) +void CRSPRecompilerOps::SLTIU(void) { if (RSPOpC.rt == 0) { @@ -671,7 +676,7 @@ void Compile_SLTIU(void) #endif } -void Compile_ANDI(void) +void CRSPRecompilerOps::ANDI(void) { if (RSPOpC.rt == 0) { @@ -706,7 +711,7 @@ void Compile_ANDI(void) #endif } -void Compile_ORI(void) +void CRSPRecompilerOps::ORI(void) { if (RSPOpC.rt == 0) { @@ -739,7 +744,7 @@ void Compile_ORI(void) #endif } -void Compile_XORI(void) +void CRSPRecompilerOps::XORI(void) { if (RSPOpC.rt == 0) { @@ -772,7 +777,7 @@ void Compile_XORI(void) #endif } -void Compile_LUI(void) +void CRSPRecompilerOps::LUI(void) { if (RSPOpC.rt == 0) { @@ -789,17 +794,17 @@ void Compile_LUI(void) #endif } -void Compile_COP0(void) +void CRSPRecompilerOps::COP0(void) { - RSP_Recomp_Cop0[RSPOpC.rs](); + (this->*RSP_Recomp_Cop0[RSPOpC.rs])(); } -void Compile_COP2(void) +void CRSPRecompilerOps::COP2(void) { - RSP_Recomp_Cop2[RSPOpC.rs](); + (this->*RSP_Recomp_Cop2[RSPOpC.rs])(); } -void Compile_LB(void) +void CRSPRecompilerOps::LB(void) { if (RSPOpC.rt == 0) { @@ -834,7 +839,7 @@ void Compile_LB(void) #endif } -void Compile_LH(void) +void CRSPRecompilerOps::LH(void) { if (RSPOpC.rt == 0) { @@ -909,7 +914,7 @@ void Compile_LH(void) #endif } -void Compile_LW(void) +void CRSPRecompilerOps::LW(void) { if (RSPOpC.rt == 0) { @@ -999,7 +1004,7 @@ void Compile_LW(void) #endif } -void Compile_LBU(void) +void CRSPRecompilerOps::LBU(void) { if (RSPOpC.rt == 0) { @@ -1037,7 +1042,7 @@ void Compile_LBU(void) #endif } -void Compile_LHU(void) +void CRSPRecompilerOps::LHU(void) { if (RSPOpC.rt == 0) { @@ -1113,7 +1118,7 @@ void Compile_LHU(void) #endif } -void Compile_LWU(void) +void CRSPRecompilerOps::LWU(void) { if (RSPOpC.rt == 0) { @@ -1123,7 +1128,7 @@ void Compile_LWU(void) Cheat_r4300iOpcode(&RSPOp::LWU, "RSPOp::LWU"); } -void Compile_SB(void) +void CRSPRecompilerOps::SB(void) { #ifndef Compile_GPRStores Cheat_r4300iOpcode(&RSPOp::SB, "RSPOp::SB"); @@ -1175,7 +1180,7 @@ void Compile_SB(void) #endif } -void Compile_SH(void) +void CRSPRecompilerOps::SH(void) { #ifndef Compile_GPRStores Cheat_r4300iOpcode(&RSPOp::SH, "&RSPOp::SH"); @@ -1248,7 +1253,7 @@ void Compile_SH(void) #endif } -void Compile_SW(void) +void CRSPRecompilerOps::SW(void) { #ifndef Compile_GPRStores Cheat_r4300iOpcode(&RSPOp::SW, "&RSPOp::SW"); @@ -1362,19 +1367,19 @@ void Compile_SW(void) #endif } -void Compile_LC2(void) +void CRSPRecompilerOps::LC2(void) { - RSP_Recomp_Lc2[RSPOpC.rd](); + (this->*RSP_Recomp_Lc2[RSPOpC.rd])(); } -void Compile_SC2(void) +void CRSPRecompilerOps::SC2(void) { - RSP_Recomp_Sc2[RSPOpC.rd](); + (this->*RSP_Recomp_Sc2[RSPOpC.rd])(); } // R4300i Opcodes: Special -void Compile_Special_SLL(void) +void CRSPRecompilerOps::Special_SLL(void) { if (RSPOpC.rd == 0) { @@ -1399,7 +1404,7 @@ void Compile_Special_SLL(void) #endif } -void Compile_Special_SRL(void) +void CRSPRecompilerOps::Special_SRL(void) { if (RSPOpC.rd == 0) { @@ -1424,7 +1429,7 @@ void Compile_Special_SRL(void) #endif } -void Compile_Special_SRA(void) +void CRSPRecompilerOps::Special_SRA(void) { if (RSPOpC.rd == 0) { @@ -1449,7 +1454,7 @@ void Compile_Special_SRA(void) #endif } -void Compile_Special_SLLV(void) +void CRSPRecompilerOps::Special_SLLV(void) { if (RSPOpC.rd == 0) { @@ -1459,7 +1464,7 @@ void Compile_Special_SLLV(void) Cheat_r4300iOpcode(&RSPOp::Special_SLLV, "RSPOp::Special_SLLV"); } -void Compile_Special_SRLV(void) +void CRSPRecompilerOps::Special_SRLV(void) { if (RSPOpC.rd == 0) { @@ -1479,7 +1484,7 @@ void Compile_Special_SRLV(void) #endif } -void Compile_Special_SRAV(void) +void CRSPRecompilerOps::Special_SRAV(void) { if (RSPOpC.rd == 0) { @@ -1496,7 +1501,7 @@ void UpdateAudioTimer() StartTimer(Label);*/ } -void Compile_Special_JR(void) +void CRSPRecompilerOps::Special_JR(void) { uint8_t * Jump; @@ -1554,7 +1559,7 @@ void Compile_Special_JR(void) } } -void Compile_Special_JALR(void) +void CRSPRecompilerOps::Special_JALR(void) { uint8_t * Jump; uint32_t Const = (CompilePC + 8) & 0xFFC; @@ -1596,7 +1601,7 @@ void Compile_Special_JALR(void) } } -void Compile_Special_BREAK(void) +void CRSPRecompilerOps::Special_BREAK(void) { Cheat_r4300iOpcode(&RSPOp::Special_BREAK, "RSPOp::Special_BREAK"); if (NextInstruction == RSPPIPELINE_NORMAL) @@ -1616,7 +1621,7 @@ void Compile_Special_BREAK(void) } } -void Compile_Special_ADD(void) +void CRSPRecompilerOps::Special_ADD(void) { if (RSPOpC.rd == 0) { @@ -1663,7 +1668,7 @@ void Compile_Special_ADD(void) #endif } -void Compile_Special_ADDU(void) +void CRSPRecompilerOps::Special_ADDU(void) { if (RSPOpC.rd == 0) { @@ -1710,7 +1715,7 @@ void Compile_Special_ADDU(void) #endif } -void Compile_Special_SUB(void) +void CRSPRecompilerOps::Special_SUB(void) { if (RSPOpC.rd == 0) { @@ -1741,7 +1746,7 @@ void Compile_Special_SUB(void) #endif } -void Compile_Special_SUBU(void) +void CRSPRecompilerOps::Special_SUBU(void) { if (RSPOpC.rd == 0) { @@ -1772,7 +1777,7 @@ void Compile_Special_SUBU(void) #endif } -void Compile_Special_AND(void) +void CRSPRecompilerOps::Special_AND(void) { if (RSPOpC.rd == 0) { @@ -1809,7 +1814,7 @@ void Compile_Special_AND(void) #endif } -void Compile_Special_OR(void) +void CRSPRecompilerOps::Special_OR(void) { if (RSPOpC.rd == 0) { @@ -1851,7 +1856,7 @@ void Compile_Special_OR(void) #endif } -void Compile_Special_XOR(void) +void CRSPRecompilerOps::Special_XOR(void) { if (RSPOpC.rd == 0) { @@ -1887,7 +1892,7 @@ void Compile_Special_XOR(void) #endif } -void Compile_Special_NOR(void) +void CRSPRecompilerOps::Special_NOR(void) { if (RSPOpC.rd == 0) { @@ -1897,7 +1902,7 @@ void Compile_Special_NOR(void) Cheat_r4300iOpcode(&RSPOp::Special_NOR, "RSPOp::Special_NOR"); } -void Compile_Special_SLT(void) +void CRSPRecompilerOps::Special_SLT(void) { if (RSPOpC.rd == 0) { @@ -1939,7 +1944,7 @@ void Compile_Special_SLT(void) #endif } -void Compile_Special_SLTU(void) +void CRSPRecompilerOps::Special_SLTU(void) { if (RSPOpC.rd == 0) { @@ -1950,7 +1955,7 @@ void Compile_Special_SLTU(void) } // R4300i Opcodes: RegImm -void Compile_RegImm_BLTZ(void) +void CRSPRecompilerOps::RegImm_BLTZ(void) { static bool bDelayAffect; @@ -2007,7 +2012,7 @@ void Compile_RegImm_BLTZ(void) } } -void Compile_RegImm_BGEZ(void) +void CRSPRecompilerOps::RegImm_BGEZ(void) { static bool bDelayAffect; @@ -2066,7 +2071,7 @@ void Compile_RegImm_BGEZ(void) } } -void Compile_RegImm_BLTZAL(void) +void CRSPRecompilerOps::RegImm_BLTZAL(void) { if (NextInstruction == RSPPIPELINE_NORMAL) { @@ -2110,7 +2115,7 @@ void Compile_RegImm_BLTZAL(void) } } -void Compile_RegImm_BGEZAL(void) +void CRSPRecompilerOps::RegImm_BGEZAL(void) { static bool bDelayAffect; @@ -2174,7 +2179,7 @@ void Compile_RegImm_BGEZAL(void) // COP0 functions -void Compile_Cop0_MF(void) +void CRSPRecompilerOps::Cop0_MF(void) { CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); if (LogRDP) @@ -2305,7 +2310,7 @@ void Compile_Cop0_MF(void) #endif } -void Compile_Cop0_MT(void) +void CRSPRecompilerOps::Cop0_MT(void) { CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); @@ -2461,7 +2466,7 @@ void Compile_Cop0_MT(void) // COP2 functions -void Compile_Cop2_MF(void) +void CRSPRecompilerOps::Cop2_MF(void) { if (RSPOpC.rt == 0) { @@ -2507,7 +2512,7 @@ void Compile_Cop2_MF(void) #endif } -void Compile_Cop2_CF(void) +void CRSPRecompilerOps::Cop2_CF(void) { #ifndef Compile_Cop2 Cheat_r4300iOpcode(RSP_Cop2_CF, "RSP_Cop2_CF"); @@ -2533,7 +2538,7 @@ void Compile_Cop2_CF(void) #endif } -void Compile_Cop2_MT(void) +void CRSPRecompilerOps::Cop2_MT(void) { #ifndef Compile_Cop2 Cheat_r4300iOpcode(RSP_Cop2_MT, "RSP_Cop2_MT"); @@ -2562,7 +2567,7 @@ void Compile_Cop2_MT(void) #endif } -void Compile_Cop2_CT(void) +void CRSPRecompilerOps::Cop2_CT(void) { #ifndef Compile_Cop2 Cheat_r4300iOpcode(RSP_Cop2_CT, "RSP_Cop2_CT"); @@ -2607,9 +2612,9 @@ void Compile_Cop2_CT(void) #endif } -void Compile_COP2_VECTOR(void) +void CRSPRecompilerOps::COP2_VECTOR(void) { - RSP_Recomp_Vector[RSPOpC.funct](); + (this->*RSP_Recomp_Vector[RSPOpC.funct])(); } // Vector functions @@ -2801,7 +2806,7 @@ bool Compile_Vector_VMULF_MMX(void) return true; } -void Compile_Vector_VMULF(void) +void CRSPRecompilerOps::Vector_VMULF(void) { #ifndef CompileVmulf Cheat_r4300iOpcode(&RSPOp::Vector_VMULF, "&RSPOp::Vector_VMULF"); @@ -2889,22 +2894,22 @@ void Compile_Vector_VMULF(void) #endif } -void Compile_Vector_VMULU(void) +void CRSPRecompilerOps::Vector_VMULU(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VMULU, "RSPOp::Vector_VMULU"); } -void Compile_Vector_VRNDN(void) +void CRSPRecompilerOps::Vector_VRNDN(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VRNDN, "RSPOp::Vector_VRNDN"); } -void Compile_Vector_VRNDP(void) +void CRSPRecompilerOps::Vector_VRNDP(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VRNDP, "RSPOp::Vector_VRNDP"); } -void Compile_Vector_VMULQ(void) +void CRSPRecompilerOps::Vector_VMULQ(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VMULQ, "&RSPOp::Vector_VMULQ"); } @@ -2966,7 +2971,7 @@ bool Compile_Vector_VMUDL_MMX(void) return true; } -void Compile_Vector_VMUDL(void) +void CRSPRecompilerOps::Vector_VMUDL(void) { #ifndef CompileVmudl Cheat_r4300iOpcode(&RSPOp::Vector_VMUDL, "&RSPOp::Vector_VMUDL"); @@ -3119,7 +3124,7 @@ bool Compile_Vector_VMUDM_MMX(void) return true; } -void Compile_Vector_VMUDM(void) +void CRSPRecompilerOps::Vector_VMUDM(void) { #ifndef CompileVmudm Cheat_r4300iOpcode(&RSPOp::Vector_VMUDM, "&RSPOp::Vector_VMUDM"); @@ -3265,7 +3270,7 @@ bool Compile_Vector_VMUDN_MMX(void) return true; } -void Compile_Vector_VMUDN(void) +void CRSPRecompilerOps::Vector_VMUDN(void) { #ifndef CompileVmudn Cheat_r4300iOpcode(&RSPOp::Vector_VMUDN, "RSPOp::Vector_VMUDN"); @@ -3419,7 +3424,7 @@ bool Compile_Vector_VMUDH_MMX(void) return true; } -void Compile_Vector_VMUDH(void) +void CRSPRecompilerOps::Vector_VMUDH(void) { #ifndef CompileVmudh Cheat_r4300iOpcode(&RSPOp::Vector_VMUDH, "RSPOp::Vector_VMUDH"); @@ -3559,7 +3564,7 @@ void Compile_Vector_VMUDH(void) #endif } -void Compile_Vector_VMACF(void) +void CRSPRecompilerOps::Vector_VMACF(void) { #ifndef CompileVmacf Cheat_r4300iOpcode(&RSPOp::Vector_VMACF, "&RSPOp::Vector_VMACF"); @@ -3628,17 +3633,17 @@ void Compile_Vector_VMACF(void) #endif } -void Compile_Vector_VMACU(void) +void CRSPRecompilerOps::Vector_VMACU(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VMACU, "&RSPOp::Vector_VMACU"); } -void Compile_Vector_VMACQ(void) +void CRSPRecompilerOps::Vector_VMACQ(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VMACQ, "RSPOp::Vector_VMACQ"); } -void Compile_Vector_VMADL(void) +void CRSPRecompilerOps::Vector_VMADL(void) { #ifndef CompileVmadl Cheat_r4300iOpcode(&RSPOp::Vector_VMADL, "&RSPOp::Vector_VMADL"); @@ -3714,7 +3719,7 @@ void Compile_Vector_VMADL(void) #endif } -void Compile_Vector_VMADM(void) +void CRSPRecompilerOps::Vector_VMADM(void) { #ifndef CompileVmadm Cheat_r4300iOpcode(&RSPOp::Vector_VMADM, "&RSPOp::Vector_VMADM"); @@ -3809,7 +3814,7 @@ void Compile_Vector_VMADM(void) #endif } -void Compile_Vector_VMADN(void) +void CRSPRecompilerOps::Vector_VMADN(void) { #ifndef CompileVmadn Cheat_r4300iOpcode(&RSPOp::Vector_VMADN, "RSPOp::Vector_VMADN"); @@ -3889,7 +3894,7 @@ void Compile_Vector_VMADN(void) #endif } -void Compile_Vector_VMADH(void) +void CRSPRecompilerOps::Vector_VMADH(void) { #ifndef CompileVmadh Cheat_r4300iOpcode(&RSPOp::Vector_VMADH, "RSPOp::Vector_VMADH"); @@ -4087,7 +4092,7 @@ bool Compile_Vector_VADD_MMX(void) return true; } -void Compile_Vector_VADD(void) +void CRSPRecompilerOps::Vector_VADD(void) { #ifndef CompileVadd Cheat_r4300iOpcode(&RSPOp::Vector_VADD, "RSPOp::Vector_VADD"); @@ -4225,7 +4230,7 @@ bool Compile_Vector_VSUB_MMX(void) return true; } -void Compile_Vector_VSUB(void) +void CRSPRecompilerOps::Vector_VSUB(void) { #ifndef CompileVsub Cheat_r4300iOpcode(&RSPOp::Vector_VSUB, "&RSPOp::Vector_VSUB"); @@ -4399,7 +4404,7 @@ bool Compile_Vector_VABS_MMX(void) return true; } -void Compile_Vector_VABS(void) +void CRSPRecompilerOps::Vector_VABS(void) { #ifndef CompileVabs Cheat_r4300iOpcode(&RSPOp::Vector_VABS, "RSPOp::Vector_VABS"); @@ -4499,7 +4504,7 @@ void Compile_Vector_VABS(void) #endif } -void Compile_Vector_VADDC(void) +void CRSPRecompilerOps::Vector_VADDC(void) { #ifndef CompileVaddc Cheat_r4300iOpcode(&RSPOp::Vector_VADDC, "&RSPOp::Vector_VADDC"); @@ -4571,7 +4576,7 @@ void Compile_Vector_VADDC(void) #endif } -void Compile_Vector_VSUBC(void) +void CRSPRecompilerOps::Vector_VSUBC(void) { #ifndef CompileVsubc Cheat_r4300iOpcode(&RSPOp::Vector_VSUBC, "&RSPOp::Vector_VSUBC"); @@ -4639,7 +4644,7 @@ void Compile_Vector_VSUBC(void) #endif } -void Compile_Vector_VSAW(void) +void CRSPRecompilerOps::Vector_VSAW(void) { #ifndef CompileVsaw Cheat_r4300iOpcode(&RSPOp::Vector_VSAW, "RSPOp::Vector_VSAW"); @@ -4694,7 +4699,7 @@ void Compile_Vector_VSAW(void) #endif } -void Compile_Vector_VLT(void) +void CRSPRecompilerOps::Vector_VLT(void) { #ifndef CompileVlt Cheat_r4300iOpcode(&RSPOp::Vector_VLT, "&RSPOp::Vector_VLT"); @@ -4795,7 +4800,7 @@ void Compile_Vector_VLT(void) #endif } -void Compile_Vector_VEQ(void) +void CRSPRecompilerOps::Vector_VEQ(void) { #ifndef CompileVeq Cheat_r4300iOpcode(&RSPOp::Vector_VEQ, "&RSPOp::Vector_VEQ"); @@ -4871,7 +4876,7 @@ void Compile_Vector_VEQ(void) #endif } -void Compile_Vector_VNE(void) +void CRSPRecompilerOps::Vector_VNE(void) { #ifndef CompileVne Cheat_r4300iOpcode(&RSPOp::Vector_VNE, "&RSPOp::Vector_VNE"); @@ -4987,7 +4992,7 @@ bool Compile_Vector_VGE_MMX(void) return true; } -void Compile_Vector_VGE(void) +void CRSPRecompilerOps::Vector_VGE(void) { #ifndef CompileVge Cheat_r4300iOpcode(&RSPOp::Vector_VGE, "&RSPOp::Vector_VGE"); @@ -5101,22 +5106,22 @@ void Compile_Vector_VGE(void) #endif } -void Compile_Vector_VCL(void) +void CRSPRecompilerOps::Vector_VCL(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VCL, "RSPOp::Vector_VCL"); } -void Compile_Vector_VCH(void) +void CRSPRecompilerOps::Vector_VCH(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VCH, "RSPOp::Vector_VCH"); } -void Compile_Vector_VCR(void) +void CRSPRecompilerOps::Vector_VCR(void) { Cheat_r4300iOpcode(&RSPOp::Vector_VCR, "RSPOp::Vector_VCR"); } -void Compile_Vector_VMRG(void) +void CRSPRecompilerOps::Vector_VMRG(void) { #ifndef CompileVmrg Cheat_r4300iOpcode(&RSPOp::Vector_VMRG, "&RSPOp::Vector_VMRG"); @@ -5200,7 +5205,7 @@ bool Compile_Vector_VAND_MMX(void) return true; } -void Compile_Vector_VAND(void) +void CRSPRecompilerOps::Vector_VAND(void) { #ifndef CompileVand Cheat_r4300iOpcode(&RSPOp::Vector_VAND, "RSPOp::Vector_VAND"); @@ -5310,7 +5315,7 @@ bool Compile_Vector_VNAND_MMX(void) return true; } -void Compile_Vector_VNAND(void) +void CRSPRecompilerOps::Vector_VNAND(void) { #ifndef CompileVnand Cheat_r4300iOpcode(&RSPOp::Vector_VNAND, "&RSPOp::Vector_VNAND"); @@ -5422,7 +5427,7 @@ bool Compile_Vector_VOR_MMX(void) return true; } -void Compile_Vector_VOR(void) +void CRSPRecompilerOps::Vector_VOR(void) { #ifndef CompileVor Cheat_r4300iOpcode(&RSPOp::Vector_VOR, "RSPOp::Vector_VOR"); @@ -5527,7 +5532,7 @@ bool Compile_Vector_VNOR_MMX(void) return true; } -void Compile_Vector_VNOR(void) +void CRSPRecompilerOps::Vector_VNOR(void) { #ifndef CompileVnor Cheat_r4300iOpcode(&RSPOp::Vector_VNOR, "&RSPOp::Vector_VNOR"); @@ -5648,7 +5653,7 @@ bool Compile_Vector_VXOR_MMX(void) return true; } -void Compile_Vector_VXOR(void) +void CRSPRecompilerOps::Vector_VXOR(void) { #ifdef CompileVxor char Reg[256]; @@ -5744,7 +5749,7 @@ bool Compile_Vector_VNXOR_MMX(void) return true; } -void Compile_Vector_VNXOR(void) +void CRSPRecompilerOps::Vector_VNXOR(void) { #ifdef CompileVnxor char Reg[256]; @@ -5774,7 +5779,7 @@ void Compile_Vector_VNXOR(void) Cheat_r4300iOpcode(&RSPOp::Vector_VNXOR, "RSPOp::Vector_VNXOR"); } -void Compile_Vector_VRCP(void) +void CRSPRecompilerOps::Vector_VRCP(void) { #ifndef CompileVrcp Cheat_r4300iOpcode(&RSPOp::Vector_VRCP, "&RSPOp::Vector_VRCP"); @@ -5843,7 +5848,7 @@ void Compile_Vector_VRCP(void) #endif } -void Compile_Vector_VRCPL(void) +void CRSPRecompilerOps::Vector_VRCPL(void) { #ifndef CompileVrcpl Cheat_r4300iOpcode(&RSPOp::Vector_VRCPL, "RSPOp::Vector_VRCPL"); @@ -5919,7 +5924,7 @@ void Compile_Vector_VRCPL(void) #endif } -void Compile_Vector_VRCPH(void) +void CRSPRecompilerOps::Vector_VRCPH(void) { #ifndef CompileVrcph Cheat_r4300iOpcode(&RSPOp::Vector_VRCPH, "&RSPOp::Vector_VRCPH"); @@ -5962,7 +5967,7 @@ void Compile_Vector_VRCPH(void) #endif } -void Compile_Vector_VMOV(void) +void CRSPRecompilerOps::Vector_VMOV(void) { #ifndef CompileVmov Cheat_r4300iOpcode(&RSPOp::Vector_VMOV, "&RSPOp::Vector_VMOV"); @@ -5996,19 +6001,19 @@ void Compile_Vector_VMOV(void) #endif } -void Compile_Vector_VRSQ(void) +void CRSPRecompilerOps::Vector_VRSQ(void) { CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); Cheat_r4300iOpcodeNoMessage(&RSPOp::Vector_VRSQ, "RSPOp::Vector_VRSQ"); } -void Compile_Vector_VRSQL(void) +void CRSPRecompilerOps::Vector_VRSQL(void) { CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); Cheat_r4300iOpcodeNoMessage(&RSPOp::Vector_VRSQL, "RSPOp::Vector_VRSQL"); } -void Compile_Vector_VRSQH(void) +void CRSPRecompilerOps::Vector_VRSQH(void) { #ifndef CompileVrsqh Cheat_r4300iOpcode(&RSPOp::Vector_VRSQH, "RSPOp::Vector_VRSQH"); @@ -6051,18 +6056,18 @@ void Compile_Vector_VRSQH(void) #endif } -void Compile_Vector_VNOOP(void) +void CRSPRecompilerOps::Vector_VNOOP(void) { } -void Compile_Vector_Reserved(void) +void CRSPRecompilerOps::Vector_Reserved(void) { Cheat_r4300iOpcode(&RSPOp::Vector_Reserved, "&RSPOp::Vector_Reserved"); } // LC2 functions -void Compile_Opcode_LBV(void) +void CRSPRecompilerOps::Opcode_LBV(void) { #ifndef CompileLbv Cheat_r4300iOpcode(&RSPOp::LBV, "RSPOp::LBV"); @@ -6084,7 +6089,7 @@ void Compile_Opcode_LBV(void) #endif } -void Compile_Opcode_LSV(void) +void CRSPRecompilerOps::Opcode_LSV(void) { #ifndef CompileLsv Cheat_r4300iOpcode(&RSPOp::LSV, "RSPOp::LSV"); @@ -6157,7 +6162,7 @@ void Compile_Opcode_LSV(void) #endif } -void Compile_Opcode_LLV(void) +void CRSPRecompilerOps::Opcode_LLV(void) { #ifndef CompileLlv Cheat_r4300iOpcode(&RSPOp::LLV, "RSPOp::LLV"); @@ -6224,7 +6229,7 @@ void Compile_Opcode_LLV(void) #endif } -void Compile_Opcode_LDV(void) +void CRSPRecompilerOps::Opcode_LDV(void) { #ifndef CompileLdv Cheat_r4300iOpcode(&RSPOp::LDV, "RSPOp::LDV"); @@ -6305,7 +6310,7 @@ void Compile_Opcode_LDV(void) #endif } -void Compile_Opcode_LQV(void) +void CRSPRecompilerOps::Opcode_LQV(void) { #ifndef CompileLqv Cheat_r4300iOpcode(&RSPOp::LQV, "RSPOp::LQV"); @@ -6413,7 +6418,7 @@ void Compile_Opcode_LQV(void) #endif } -void Compile_Opcode_LRV(void) +void CRSPRecompilerOps::Opcode_LRV(void) { #ifndef CompileLrv Cheat_r4300iOpcode(&RSPOp::LRV, "RSPOp::LRV"); @@ -6492,7 +6497,7 @@ void Compile_Opcode_LRV(void) #endif } -void Compile_Opcode_LPV(void) +void CRSPRecompilerOps::Opcode_LPV(void) { #ifndef CompileLpv Cheat_r4300iOpcode(&RSPOp::LPV, "RSPOp::LPV"); @@ -6600,7 +6605,7 @@ void Compile_Opcode_LPV(void) #endif } -void Compile_Opcode_LUV(void) +void CRSPRecompilerOps::Opcode_LUV(void) { #ifndef CompileLuv Cheat_r4300iOpcode(&RSPOp::LUV, "RSPOp::LUV"); @@ -6708,7 +6713,7 @@ void Compile_Opcode_LUV(void) #endif } -void Compile_Opcode_LHV(void) +void CRSPRecompilerOps::Opcode_LHV(void) { #ifndef CompileLhv Cheat_r4300iOpcode(&RSPOp::LHV, "RSPOp::LHV"); @@ -6816,29 +6821,29 @@ void Compile_Opcode_LHV(void) #endif } -void Compile_Opcode_LFV(void) +void CRSPRecompilerOps::Opcode_LFV(void) { Cheat_r4300iOpcode(&RSPOp::LFV, "RSPOp::LFV"); } -void Compile_Opcode_LWV(void) +void CRSPRecompilerOps::Opcode_LWV(void) { Cheat_r4300iOpcode(&RSPOp::LWV, "RSPOp::LWV"); } -void Compile_Opcode_LTV(void) +void CRSPRecompilerOps::Opcode_LTV(void) { Cheat_r4300iOpcode(&RSPOp::LTV, "RSPOp::LTV"); } // SC2 functions -void Compile_Opcode_SBV(void) +void CRSPRecompilerOps::Opcode_SBV(void) { Cheat_r4300iOpcode(&RSPOp::SBV, "RSPOp::SBV"); } -void Compile_Opcode_SSV(void) +void CRSPRecompilerOps::Opcode_SSV(void) { #ifndef CompileSsv Cheat_r4300iOpcode(&RSPOp::SSV, "RSPOp::SSV"); @@ -6908,7 +6913,7 @@ void Compile_Opcode_SSV(void) #endif } -void Compile_Opcode_SLV(void) +void CRSPRecompilerOps::Opcode_SLV(void) { #ifndef CompileSlv Cheat_r4300iOpcode(&RSPOp::SLV, "RSPOp::SLV"); @@ -6973,7 +6978,7 @@ void Compile_Opcode_SLV(void) #endif } -void Compile_Opcode_SDV(void) +void CRSPRecompilerOps::Opcode_SDV(void) { #ifndef CompileSdv Cheat_r4300iOpcode(&RSPOp::SDV, "RSPOp::SDV"); @@ -7063,7 +7068,7 @@ void Compile_Opcode_SDV(void) #endif } -void Compile_Opcode_SQV(void) +void CRSPRecompilerOps::Opcode_SQV(void) { #ifndef CompileSqv Cheat_r4300iOpcode(&RSPOp::SQV, "RSPOp::SQV"); @@ -7212,44 +7217,44 @@ void Compile_Opcode_SQV(void) #endif } -void Compile_Opcode_SRV(void) +void CRSPRecompilerOps::Opcode_SRV(void) { Cheat_r4300iOpcode(&RSPOp::SRV, "RSPOp::SRV"); } -void Compile_Opcode_SPV(void) +void CRSPRecompilerOps::Opcode_SPV(void) { Cheat_r4300iOpcode(&RSPOp::SPV, "RSPOp::SPV"); } -void Compile_Opcode_SUV(void) +void CRSPRecompilerOps::Opcode_SUV(void) { Cheat_r4300iOpcode(&RSPOp::SUV, "RSPOp::SUV"); } -void Compile_Opcode_SHV(void) +void CRSPRecompilerOps::Opcode_SHV(void) { Cheat_r4300iOpcode(&RSPOp::SHV, "RSPOp::SHV"); } -void Compile_Opcode_SFV(void) +void CRSPRecompilerOps::Opcode_SFV(void) { Cheat_r4300iOpcode(&RSPOp::SFV, "RSPOp::SFV"); } -void Compile_Opcode_STV(void) +void CRSPRecompilerOps::Opcode_STV(void) { Cheat_r4300iOpcode(&RSPOp::STV, "RSPOp::STV"); } -void Compile_Opcode_SWV(void) +void CRSPRecompilerOps::Opcode_SWV(void) { Cheat_r4300iOpcode(&RSPOp::SWV, "&RSPOp::SWV"); } // Other functions -void Compile_UnknownOpcode(void) +void CRSPRecompilerOps::UnknownOpcode(void) { CPU_Message(" %X Unhandled Opcode: %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); NextInstruction = RSPPIPELINE_FINISH_BLOCK; diff --git a/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.h b/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.h index 3de95718e..7628c320d 100644 --- a/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.h +++ b/Source/Project64-rsp-core/Recompiler/RspRecompilerOps.h @@ -1,164 +1,166 @@ // Opcode functions -void Compile_SPECIAL(void); -void Compile_REGIMM(void); -void Compile_J(void); -void Compile_JAL(void); -void Compile_BEQ(void); -void Compile_BNE(void); -void Compile_BLEZ(void); -void Compile_BGTZ(void); -void Compile_ADDI(void); -void Compile_ADDIU(void); -void Compile_SLTI(void); -void Compile_SLTIU(void); -void Compile_ANDI(void); -void Compile_ORI(void); -void Compile_XORI(void); -void Compile_LUI(void); -void Compile_COP0(void); -void Compile_COP2(void); -void Compile_LB(void); -void Compile_LH(void); -void Compile_LW(void); -void Compile_LBU(void); -void Compile_LHU(void); -void Compile_LWU(void); -void Compile_SB(void); -void Compile_SH(void); -void Compile_SW(void); -void Compile_LC2(void); -void Compile_SC2(void); +class CRSPSystem; -// R4300i Opcodes: Special +class CRSPRecompilerOps +{ +public: + CRSPRecompilerOps(CRSPSystem & System); -void Compile_Special_SLL(void); -void Compile_Special_SRL(void); -void Compile_Special_SRA(void); -void Compile_Special_SLLV(void); -void Compile_Special_SRLV(void); -void Compile_Special_SRAV(void); -void Compile_Special_JR(void); -void Compile_Special_JALR(void); -void Compile_Special_BREAK(void); -void Compile_Special_ADD(void); -void Compile_Special_ADDU(void); -void Compile_Special_SUB(void); -void Compile_Special_SUBU(void); -void Compile_Special_AND(void); -void Compile_Special_OR(void); -void Compile_Special_XOR(void); -void Compile_Special_NOR(void); -void Compile_Special_SLT(void); -void Compile_Special_SLTU(void); + void SPECIAL(void); + void REGIMM(void); + void J(void); + void JAL(void); + void BEQ(void); + void BNE(void); + void BLEZ(void); + void BGTZ(void); + void ADDI(void); + void ADDIU(void); + void SLTI(void); + void SLTIU(void); + void ANDI(void); + void ORI(void); + void XORI(void); + void LUI(void); + void COP0(void); + void COP2(void); + void LB(void); + void LH(void); + void LW(void); + void LBU(void); + void LHU(void); + void LWU(void); + void SB(void); + void SH(void); + void SW(void); + void LC2(void); + void SC2(void); -// R4300i Opcodes: RegImm + // R4300i Opcodes: Special -void Compile_RegImm_BLTZ(void); -void Compile_RegImm_BGEZ(void); -void Compile_RegImm_BLTZAL(void); -void Compile_RegImm_BGEZAL(void); + void Special_SLL(void); + void Special_SRL(void); + void Special_SRA(void); + void Special_SLLV(void); + void Special_SRLV(void); + void Special_SRAV(void); + void Special_JR(void); + void Special_JALR(void); + void Special_BREAK(void); + void Special_ADD(void); + void Special_ADDU(void); + void Special_SUB(void); + void Special_SUBU(void); + void Special_AND(void); + void Special_OR(void); + void Special_XOR(void); + void Special_NOR(void); + void Special_SLT(void); + void Special_SLTU(void); -// COP0 functions + // R4300i Opcodes: RegImm -void Compile_Cop0_MF(void); -void Compile_Cop0_MT(void); + void RegImm_BLTZ(void); + void RegImm_BGEZ(void); + void RegImm_BLTZAL(void); + void RegImm_BGEZAL(void); -// COP2 functions + // COP0 functions -void Compile_Cop2_MF(void); -void Compile_Cop2_CF(void); -void Compile_Cop2_MT(void); -void Compile_Cop2_CT(void); -void Compile_COP2_VECTOR(void); + void Cop0_MF(void); + void Cop0_MT(void); -// Vector functions + // COP2 functions -void Compile_Vector_VMULF(void); -void Compile_Vector_VMULU(void); -void Compile_Vector_VRNDN(void); -void Compile_Vector_VRNDP(void); -void Compile_Vector_VMULQ(void); -void Compile_Vector_VMUDL(void); -void Compile_Vector_VMUDM(void); -void Compile_Vector_VMUDN(void); -void Compile_Vector_VMUDH(void); -void Compile_Vector_VMACF(void); -void Compile_Vector_VMACU(void); -void Compile_Vector_VMACQ(void); -void Compile_Vector_VMADL(void); -void Compile_Vector_VMADM(void); -void Compile_Vector_VMADN(void); -void Compile_Vector_VMADH(void); -void Compile_Vector_VADD(void); -void Compile_Vector_VSUB(void); -void Compile_Vector_VABS(void); -void Compile_Vector_VADDC(void); -void Compile_Vector_VSUBC(void); -void Compile_Vector_VSAW(void); -void Compile_Vector_VLT(void); -void Compile_Vector_VEQ(void); -void Compile_Vector_VNE(void); -void Compile_Vector_VGE(void); -void Compile_Vector_VCL(void); -void Compile_Vector_VCH(void); -void Compile_Vector_VCR(void); -void Compile_Vector_VMRG(void); -void Compile_Vector_VAND(void); -void Compile_Vector_VNAND(void); -void Compile_Vector_VOR(void); -void Compile_Vector_VNOR(void); -void Compile_Vector_VXOR(void); -void Compile_Vector_VNXOR(void); -void Compile_Vector_VRCP(void); -void Compile_Vector_VRCPL(void); -void Compile_Vector_VRCPH(void); -void Compile_Vector_VMOV(void); -void Compile_Vector_VRSQ(void); -void Compile_Vector_VRSQL(void); -void Compile_Vector_VRSQH(void); -void Compile_Vector_VNOOP(void); -void Compile_Vector_Reserved(void); + void Cop2_MF(void); + void Cop2_CF(void); + void Cop2_MT(void); + void Cop2_CT(void); + void COP2_VECTOR(void); -// LC2 functions -void Compile_Opcode_LBV(void); -void Compile_Opcode_LSV(void); -void Compile_Opcode_LLV(void); -void Compile_Opcode_LDV(void); -void Compile_Opcode_LQV(void); -void Compile_Opcode_LRV(void); -void Compile_Opcode_LPV(void); -void Compile_Opcode_LUV(void); -void Compile_Opcode_LHV(void); -void Compile_Opcode_LFV(void); -void Compile_Opcode_LWV(void); -void Compile_Opcode_LTV(void); + // Vector functions -// SC2 functions -void Compile_Opcode_SBV(void); -void Compile_Opcode_SSV(void); -void Compile_Opcode_SLV(void); -void Compile_Opcode_SDV(void); -void Compile_Opcode_SQV(void); -void Compile_Opcode_SRV(void); -void Compile_Opcode_SPV(void); -void Compile_Opcode_SUV(void); -void Compile_Opcode_SHV(void); -void Compile_Opcode_SFV(void); -void Compile_Opcode_SWV(void); -void Compile_Opcode_STV(void); + void Vector_VMULF(void); + void Vector_VMULU(void); + void Vector_VRNDN(void); + void Vector_VRNDP(void); + void Vector_VMULQ(void); + void Vector_VMUDL(void); + void Vector_VMUDM(void); + void Vector_VMUDN(void); + void Vector_VMUDH(void); + void Vector_VMACF(void); + void Vector_VMACU(void); + void Vector_VMACQ(void); + void Vector_VMADL(void); + void Vector_VMADM(void); + void Vector_VMADN(void); + void Vector_VMADH(void); + void Vector_VADD(void); + void Vector_VSUB(void); + void Vector_VABS(void); + void Vector_VADDC(void); + void Vector_VSUBC(void); + void Vector_VSAW(void); + void Vector_VLT(void); + void Vector_VEQ(void); + void Vector_VNE(void); + void Vector_VGE(void); + void Vector_VCL(void); + void Vector_VCH(void); + void Vector_VCR(void); + void Vector_VMRG(void); + void Vector_VAND(void); + void Vector_VNAND(void); + void Vector_VOR(void); + void Vector_VNOR(void); + void Vector_VXOR(void); + void Vector_VNXOR(void); + void Vector_VRCP(void); + void Vector_VRCPL(void); + void Vector_VRCPH(void); + void Vector_VMOV(void); + void Vector_VRSQ(void); + void Vector_VRSQL(void); + void Vector_VRSQH(void); + void Vector_VNOOP(void); + void Vector_Reserved(void); -// Other functions + // LC2 functions + void Opcode_LBV(void); + void Opcode_LSV(void); + void Opcode_LLV(void); + void Opcode_LDV(void); + void Opcode_LQV(void); + void Opcode_LRV(void); + void Opcode_LPV(void); + void Opcode_LUV(void); + void Opcode_LHV(void); + void Opcode_LFV(void); + void Opcode_LWV(void); + void Opcode_LTV(void); -void Compile_UnknownOpcode(void); + // SC2 functions + void Opcode_SBV(void); + void Opcode_SSV(void); + void Opcode_SLV(void); + void Opcode_SDV(void); + void Opcode_SQV(void); + void Opcode_SRV(void); + void Opcode_SPV(void); + void Opcode_SUV(void); + void Opcode_SHV(void); + void Opcode_SFV(void); + void Opcode_SWV(void); + void Opcode_STV(void); -typedef void (*p_Recompfunc)(void); + // Other functions -extern p_Recompfunc RSP_Recomp_Opcode[64]; -extern p_Recompfunc RSP_Recomp_RegImm[32]; -extern p_Recompfunc RSP_Recomp_Special[64]; -extern p_Recompfunc RSP_Recomp_Cop0[32]; -extern p_Recompfunc RSP_Recomp_Cop2[32]; -extern p_Recompfunc RSP_Recomp_Vector[64]; -extern p_Recompfunc RSP_Recomp_Lc2[32]; -extern p_Recompfunc RSP_Recomp_Sc2[32]; + void UnknownOpcode(void); + +private: + CRSPSystem & m_System; +}; + +typedef void (CRSPRecompilerOps::*p_Recompfunc)(void); \ No newline at end of file