RSP: Create RSP system class and move all interpter ops in to RSPOp class

This commit is contained in:
zilmar 2024-08-02 09:00:38 +09:30
parent dab432e7bd
commit 2904d3641d
13 changed files with 1283 additions and 1206 deletions

View File

@ -50,6 +50,7 @@
<ClCompile Include="cpu\RSPRegister.cpp" />
<ClCompile Include="cpu\RSPRegisterHandler.cpp" />
<ClCompile Include="cpu\RSPRegisterHandlerPlugin.cpp" />
<ClCompile Include="cpu\RspSystem.cpp" />
<ClCompile Include="cpu\RspTypes.cpp" />
<ClCompile Include="Hle\alist.cpp" />
<ClCompile Include="Hle\alist_audio.cpp" />
@ -86,6 +87,7 @@
<ClInclude Include="cpu\RSPRegisterHandler.h" />
<ClInclude Include="cpu\RSPRegisterHandlerPlugin.h" />
<ClInclude Include="cpu\RSPRegisters.h" />
<ClInclude Include="cpu\RspSystem.h" />
<ClInclude Include="cpu\RspTypes.h" />
<ClInclude Include="Hle\alist.h" />
<ClInclude Include="Hle\arithmetics.h" />

View File

@ -138,6 +138,9 @@
<ClCompile Include="Hle\jpeg.cpp">
<Filter>Source Files\hle</Filter>
</ClCompile>
<ClCompile Include="cpu\RspSystem.cpp">
<Filter>Source Files\cpu</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="cpu\RSPInstruction.h">
@ -218,5 +221,8 @@
<ClInclude Include="Hle\ucodes.h">
<Filter>Header Files\hle</Filter>
</ClInclude>
<ClInclude Include="cpu\RspSystem.h">
<Filter>Header Files\cpu</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -33,365 +33,365 @@ uint8_t *pLastSecondary = NULL, *pLastPrimary = NULL;
void BuildRecompilerCPU(void)
{
RSP_Opcode[0] = Compile_SPECIAL;
RSP_Opcode[1] = Compile_REGIMM;
RSP_Opcode[2] = Compile_J;
RSP_Opcode[3] = Compile_JAL;
RSP_Opcode[4] = Compile_BEQ;
RSP_Opcode[5] = Compile_BNE;
RSP_Opcode[6] = Compile_BLEZ;
RSP_Opcode[7] = Compile_BGTZ;
RSP_Opcode[8] = Compile_ADDI;
RSP_Opcode[9] = Compile_ADDIU;
RSP_Opcode[10] = Compile_SLTI;
RSP_Opcode[11] = Compile_SLTIU;
RSP_Opcode[12] = Compile_ANDI;
RSP_Opcode[13] = Compile_ORI;
RSP_Opcode[14] = Compile_XORI;
RSP_Opcode[15] = Compile_LUI;
RSP_Opcode[16] = Compile_COP0;
RSP_Opcode[17] = Compile_UnknownOpcode;
RSP_Opcode[18] = Compile_COP2;
RSP_Opcode[19] = Compile_UnknownOpcode;
RSP_Opcode[20] = Compile_UnknownOpcode;
RSP_Opcode[21] = Compile_UnknownOpcode;
RSP_Opcode[22] = Compile_UnknownOpcode;
RSP_Opcode[23] = Compile_UnknownOpcode;
RSP_Opcode[24] = Compile_UnknownOpcode;
RSP_Opcode[25] = Compile_UnknownOpcode;
RSP_Opcode[26] = Compile_UnknownOpcode;
RSP_Opcode[27] = Compile_UnknownOpcode;
RSP_Opcode[28] = Compile_UnknownOpcode;
RSP_Opcode[29] = Compile_UnknownOpcode;
RSP_Opcode[30] = Compile_UnknownOpcode;
RSP_Opcode[31] = Compile_UnknownOpcode;
RSP_Opcode[32] = Compile_LB;
RSP_Opcode[33] = Compile_LH;
RSP_Opcode[34] = Compile_UnknownOpcode;
RSP_Opcode[35] = Compile_LW;
RSP_Opcode[36] = Compile_LBU;
RSP_Opcode[37] = Compile_LHU;
RSP_Opcode[38] = Compile_UnknownOpcode;
RSP_Opcode[39] = Compile_LWU;
RSP_Opcode[40] = Compile_SB;
RSP_Opcode[41] = Compile_SH;
RSP_Opcode[42] = Compile_UnknownOpcode;
RSP_Opcode[43] = Compile_SW;
RSP_Opcode[44] = Compile_UnknownOpcode;
RSP_Opcode[45] = Compile_UnknownOpcode;
RSP_Opcode[46] = Compile_UnknownOpcode;
RSP_Opcode[47] = Compile_UnknownOpcode;
RSP_Opcode[48] = Compile_UnknownOpcode;
RSP_Opcode[49] = Compile_UnknownOpcode;
RSP_Opcode[50] = Compile_LC2;
RSP_Opcode[51] = Compile_UnknownOpcode;
RSP_Opcode[52] = Compile_UnknownOpcode;
RSP_Opcode[53] = Compile_UnknownOpcode;
RSP_Opcode[54] = Compile_UnknownOpcode;
RSP_Opcode[55] = Compile_UnknownOpcode;
RSP_Opcode[56] = Compile_UnknownOpcode;
RSP_Opcode[57] = Compile_UnknownOpcode;
RSP_Opcode[58] = Compile_SC2;
RSP_Opcode[59] = Compile_UnknownOpcode;
RSP_Opcode[60] = Compile_UnknownOpcode;
RSP_Opcode[61] = Compile_UnknownOpcode;
RSP_Opcode[62] = Compile_UnknownOpcode;
RSP_Opcode[63] = Compile_UnknownOpcode;
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_Special[0] = Compile_Special_SLL;
RSP_Special[1] = Compile_UnknownOpcode;
RSP_Special[2] = Compile_Special_SRL;
RSP_Special[3] = Compile_Special_SRA;
RSP_Special[4] = Compile_Special_SLLV;
RSP_Special[5] = Compile_UnknownOpcode;
RSP_Special[6] = Compile_Special_SRLV;
RSP_Special[7] = Compile_Special_SRAV;
RSP_Special[8] = Compile_Special_JR;
RSP_Special[9] = Compile_Special_JALR;
RSP_Special[10] = Compile_UnknownOpcode;
RSP_Special[11] = Compile_UnknownOpcode;
RSP_Special[12] = Compile_UnknownOpcode;
RSP_Special[13] = Compile_Special_BREAK;
RSP_Special[14] = Compile_UnknownOpcode;
RSP_Special[15] = Compile_UnknownOpcode;
RSP_Special[16] = Compile_UnknownOpcode;
RSP_Special[17] = Compile_UnknownOpcode;
RSP_Special[18] = Compile_UnknownOpcode;
RSP_Special[19] = Compile_UnknownOpcode;
RSP_Special[20] = Compile_UnknownOpcode;
RSP_Special[21] = Compile_UnknownOpcode;
RSP_Special[22] = Compile_UnknownOpcode;
RSP_Special[23] = Compile_UnknownOpcode;
RSP_Special[24] = Compile_UnknownOpcode;
RSP_Special[25] = Compile_UnknownOpcode;
RSP_Special[26] = Compile_UnknownOpcode;
RSP_Special[27] = Compile_UnknownOpcode;
RSP_Special[28] = Compile_UnknownOpcode;
RSP_Special[29] = Compile_UnknownOpcode;
RSP_Special[30] = Compile_UnknownOpcode;
RSP_Special[31] = Compile_UnknownOpcode;
RSP_Special[32] = Compile_Special_ADD;
RSP_Special[33] = Compile_Special_ADDU;
RSP_Special[34] = Compile_Special_SUB;
RSP_Special[35] = Compile_Special_SUBU;
RSP_Special[36] = Compile_Special_AND;
RSP_Special[37] = Compile_Special_OR;
RSP_Special[38] = Compile_Special_XOR;
RSP_Special[39] = Compile_Special_NOR;
RSP_Special[40] = Compile_UnknownOpcode;
RSP_Special[41] = Compile_UnknownOpcode;
RSP_Special[42] = Compile_Special_SLT;
RSP_Special[43] = Compile_Special_SLTU;
RSP_Special[44] = Compile_UnknownOpcode;
RSP_Special[45] = Compile_UnknownOpcode;
RSP_Special[46] = Compile_UnknownOpcode;
RSP_Special[47] = Compile_UnknownOpcode;
RSP_Special[48] = Compile_UnknownOpcode;
RSP_Special[49] = Compile_UnknownOpcode;
RSP_Special[50] = Compile_UnknownOpcode;
RSP_Special[51] = Compile_UnknownOpcode;
RSP_Special[52] = Compile_UnknownOpcode;
RSP_Special[53] = Compile_UnknownOpcode;
RSP_Special[54] = Compile_UnknownOpcode;
RSP_Special[55] = Compile_UnknownOpcode;
RSP_Special[56] = Compile_UnknownOpcode;
RSP_Special[57] = Compile_UnknownOpcode;
RSP_Special[58] = Compile_UnknownOpcode;
RSP_Special[59] = Compile_UnknownOpcode;
RSP_Special[60] = Compile_UnknownOpcode;
RSP_Special[61] = Compile_UnknownOpcode;
RSP_Special[62] = Compile_UnknownOpcode;
RSP_Special[63] = Compile_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_RegImm[0] = Compile_RegImm_BLTZ;
RSP_RegImm[1] = Compile_RegImm_BGEZ;
RSP_RegImm[2] = Compile_UnknownOpcode;
RSP_RegImm[3] = Compile_UnknownOpcode;
RSP_RegImm[4] = Compile_UnknownOpcode;
RSP_RegImm[5] = Compile_UnknownOpcode;
RSP_RegImm[6] = Compile_UnknownOpcode;
RSP_RegImm[7] = Compile_UnknownOpcode;
RSP_RegImm[8] = Compile_UnknownOpcode;
RSP_RegImm[9] = Compile_UnknownOpcode;
RSP_RegImm[10] = Compile_UnknownOpcode;
RSP_RegImm[11] = Compile_UnknownOpcode;
RSP_RegImm[12] = Compile_UnknownOpcode;
RSP_RegImm[13] = Compile_UnknownOpcode;
RSP_RegImm[14] = Compile_UnknownOpcode;
RSP_RegImm[15] = Compile_UnknownOpcode;
RSP_RegImm[16] = Compile_RegImm_BLTZAL;
RSP_RegImm[17] = Compile_RegImm_BGEZAL;
RSP_RegImm[18] = Compile_UnknownOpcode;
RSP_RegImm[19] = Compile_UnknownOpcode;
RSP_RegImm[20] = Compile_UnknownOpcode;
RSP_RegImm[21] = Compile_UnknownOpcode;
RSP_RegImm[22] = Compile_UnknownOpcode;
RSP_RegImm[23] = Compile_UnknownOpcode;
RSP_RegImm[24] = Compile_UnknownOpcode;
RSP_RegImm[25] = Compile_UnknownOpcode;
RSP_RegImm[26] = Compile_UnknownOpcode;
RSP_RegImm[27] = Compile_UnknownOpcode;
RSP_RegImm[28] = Compile_UnknownOpcode;
RSP_RegImm[29] = Compile_UnknownOpcode;
RSP_RegImm[30] = Compile_UnknownOpcode;
RSP_RegImm[31] = Compile_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_Cop0[0] = Compile_Cop0_MF;
RSP_Cop0[1] = Compile_UnknownOpcode;
RSP_Cop0[2] = Compile_UnknownOpcode;
RSP_Cop0[3] = Compile_UnknownOpcode;
RSP_Cop0[4] = Compile_Cop0_MT;
RSP_Cop0[5] = Compile_UnknownOpcode;
RSP_Cop0[6] = Compile_UnknownOpcode;
RSP_Cop0[7] = Compile_UnknownOpcode;
RSP_Cop0[8] = Compile_UnknownOpcode;
RSP_Cop0[9] = Compile_UnknownOpcode;
RSP_Cop0[10] = Compile_UnknownOpcode;
RSP_Cop0[11] = Compile_UnknownOpcode;
RSP_Cop0[12] = Compile_UnknownOpcode;
RSP_Cop0[13] = Compile_UnknownOpcode;
RSP_Cop0[14] = Compile_UnknownOpcode;
RSP_Cop0[15] = Compile_UnknownOpcode;
RSP_Cop0[16] = Compile_UnknownOpcode;
RSP_Cop0[17] = Compile_UnknownOpcode;
RSP_Cop0[18] = Compile_UnknownOpcode;
RSP_Cop0[19] = Compile_UnknownOpcode;
RSP_Cop0[20] = Compile_UnknownOpcode;
RSP_Cop0[21] = Compile_UnknownOpcode;
RSP_Cop0[22] = Compile_UnknownOpcode;
RSP_Cop0[23] = Compile_UnknownOpcode;
RSP_Cop0[24] = Compile_UnknownOpcode;
RSP_Cop0[25] = Compile_UnknownOpcode;
RSP_Cop0[26] = Compile_UnknownOpcode;
RSP_Cop0[27] = Compile_UnknownOpcode;
RSP_Cop0[28] = Compile_UnknownOpcode;
RSP_Cop0[29] = Compile_UnknownOpcode;
RSP_Cop0[30] = Compile_UnknownOpcode;
RSP_Cop0[31] = Compile_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_Cop2[0] = Compile_Cop2_MF;
RSP_Cop2[1] = Compile_UnknownOpcode;
RSP_Cop2[2] = Compile_Cop2_CF;
RSP_Cop2[3] = Compile_UnknownOpcode;
RSP_Cop2[4] = Compile_Cop2_MT;
RSP_Cop2[5] = Compile_UnknownOpcode;
RSP_Cop2[6] = Compile_Cop2_CT;
RSP_Cop2[7] = Compile_UnknownOpcode;
RSP_Cop2[8] = Compile_UnknownOpcode;
RSP_Cop2[9] = Compile_UnknownOpcode;
RSP_Cop2[10] = Compile_UnknownOpcode;
RSP_Cop2[11] = Compile_UnknownOpcode;
RSP_Cop2[12] = Compile_UnknownOpcode;
RSP_Cop2[13] = Compile_UnknownOpcode;
RSP_Cop2[14] = Compile_UnknownOpcode;
RSP_Cop2[15] = Compile_UnknownOpcode;
RSP_Cop2[16] = Compile_COP2_VECTOR;
RSP_Cop2[17] = Compile_COP2_VECTOR;
RSP_Cop2[18] = Compile_COP2_VECTOR;
RSP_Cop2[19] = Compile_COP2_VECTOR;
RSP_Cop2[20] = Compile_COP2_VECTOR;
RSP_Cop2[21] = Compile_COP2_VECTOR;
RSP_Cop2[22] = Compile_COP2_VECTOR;
RSP_Cop2[23] = Compile_COP2_VECTOR;
RSP_Cop2[24] = Compile_COP2_VECTOR;
RSP_Cop2[25] = Compile_COP2_VECTOR;
RSP_Cop2[26] = Compile_COP2_VECTOR;
RSP_Cop2[27] = Compile_COP2_VECTOR;
RSP_Cop2[28] = Compile_COP2_VECTOR;
RSP_Cop2[29] = Compile_COP2_VECTOR;
RSP_Cop2[30] = Compile_COP2_VECTOR;
RSP_Cop2[31] = Compile_COP2_VECTOR;
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_Vector[0] = Compile_Vector_VMULF;
RSP_Vector[1] = Compile_Vector_VMULU;
RSP_Vector[2] = Compile_Vector_VRNDP;
RSP_Vector[3] = Compile_Vector_VMULQ;
RSP_Vector[4] = Compile_Vector_VMUDL;
RSP_Vector[5] = Compile_Vector_VMUDM;
RSP_Vector[6] = Compile_Vector_VMUDN;
RSP_Vector[7] = Compile_Vector_VMUDH;
RSP_Vector[8] = Compile_Vector_VMACF;
RSP_Vector[9] = Compile_Vector_VMACU;
RSP_Vector[10] = Compile_Vector_VRNDN;
RSP_Vector[11] = Compile_Vector_VMACQ;
RSP_Vector[12] = Compile_Vector_VMADL;
RSP_Vector[13] = Compile_Vector_VMADM;
RSP_Vector[14] = Compile_Vector_VMADN;
RSP_Vector[15] = Compile_Vector_VMADH;
RSP_Vector[16] = Compile_Vector_VADD;
RSP_Vector[17] = Compile_Vector_VSUB;
RSP_Vector[18] = Compile_Vector_Reserved;
RSP_Vector[19] = Compile_Vector_VABS;
RSP_Vector[20] = Compile_Vector_VADDC;
RSP_Vector[21] = Compile_Vector_VSUBC;
RSP_Vector[22] = Compile_Vector_Reserved;
RSP_Vector[23] = Compile_Vector_Reserved;
RSP_Vector[24] = Compile_Vector_Reserved;
RSP_Vector[25] = Compile_Vector_Reserved;
RSP_Vector[26] = Compile_Vector_Reserved;
RSP_Vector[27] = Compile_Vector_Reserved;
RSP_Vector[28] = Compile_Vector_Reserved;
RSP_Vector[29] = Compile_Vector_VSAW;
RSP_Vector[30] = Compile_Vector_Reserved;
RSP_Vector[31] = Compile_Vector_Reserved;
RSP_Vector[32] = Compile_Vector_VLT;
RSP_Vector[33] = Compile_Vector_VEQ;
RSP_Vector[34] = Compile_Vector_VNE;
RSP_Vector[35] = Compile_Vector_VGE;
RSP_Vector[36] = Compile_Vector_VCL;
RSP_Vector[37] = Compile_Vector_VCH;
RSP_Vector[38] = Compile_Vector_VCR;
RSP_Vector[39] = Compile_Vector_VMRG;
RSP_Vector[40] = Compile_Vector_VAND;
RSP_Vector[41] = Compile_Vector_VNAND;
RSP_Vector[42] = Compile_Vector_VOR;
RSP_Vector[43] = Compile_Vector_VNOR;
RSP_Vector[44] = Compile_Vector_VXOR;
RSP_Vector[45] = Compile_Vector_VNXOR;
RSP_Vector[46] = Compile_Vector_Reserved;
RSP_Vector[47] = Compile_Vector_Reserved;
RSP_Vector[48] = Compile_Vector_VRCP;
RSP_Vector[49] = Compile_Vector_VRCPL;
RSP_Vector[50] = Compile_Vector_VRCPH;
RSP_Vector[51] = Compile_Vector_VMOV;
RSP_Vector[52] = Compile_Vector_VRSQ;
RSP_Vector[53] = Compile_Vector_VRSQL;
RSP_Vector[54] = Compile_Vector_VRSQH;
RSP_Vector[55] = Compile_Vector_VNOOP;
RSP_Vector[56] = Compile_Vector_Reserved;
RSP_Vector[57] = Compile_Vector_Reserved;
RSP_Vector[58] = Compile_Vector_Reserved;
RSP_Vector[59] = Compile_Vector_Reserved;
RSP_Vector[60] = Compile_Vector_Reserved;
RSP_Vector[61] = Compile_Vector_Reserved;
RSP_Vector[62] = Compile_Vector_Reserved;
RSP_Vector[63] = Compile_Vector_VNOOP;
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_Lc2[0] = Compile_Opcode_LBV;
RSP_Lc2[1] = Compile_Opcode_LSV;
RSP_Lc2[2] = Compile_Opcode_LLV;
RSP_Lc2[3] = Compile_Opcode_LDV;
RSP_Lc2[4] = Compile_Opcode_LQV;
RSP_Lc2[5] = Compile_Opcode_LRV;
RSP_Lc2[6] = Compile_Opcode_LPV;
RSP_Lc2[7] = Compile_Opcode_LUV;
RSP_Lc2[8] = Compile_Opcode_LHV;
RSP_Lc2[9] = Compile_Opcode_LFV;
RSP_Lc2[10] = Compile_Opcode_LWV;
RSP_Lc2[11] = Compile_Opcode_LTV;
RSP_Lc2[12] = Compile_UnknownOpcode;
RSP_Lc2[13] = Compile_UnknownOpcode;
RSP_Lc2[14] = Compile_UnknownOpcode;
RSP_Lc2[15] = Compile_UnknownOpcode;
RSP_Lc2[16] = Compile_UnknownOpcode;
RSP_Lc2[17] = Compile_UnknownOpcode;
RSP_Lc2[18] = Compile_UnknownOpcode;
RSP_Lc2[19] = Compile_UnknownOpcode;
RSP_Lc2[20] = Compile_UnknownOpcode;
RSP_Lc2[21] = Compile_UnknownOpcode;
RSP_Lc2[22] = Compile_UnknownOpcode;
RSP_Lc2[23] = Compile_UnknownOpcode;
RSP_Lc2[24] = Compile_UnknownOpcode;
RSP_Lc2[25] = Compile_UnknownOpcode;
RSP_Lc2[26] = Compile_UnknownOpcode;
RSP_Lc2[27] = Compile_UnknownOpcode;
RSP_Lc2[28] = Compile_UnknownOpcode;
RSP_Lc2[29] = Compile_UnknownOpcode;
RSP_Lc2[30] = Compile_UnknownOpcode;
RSP_Lc2[31] = Compile_UnknownOpcode;
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_Sc2[0] = Compile_Opcode_SBV;
RSP_Sc2[1] = Compile_Opcode_SSV;
RSP_Sc2[2] = Compile_Opcode_SLV;
RSP_Sc2[3] = Compile_Opcode_SDV;
RSP_Sc2[4] = Compile_Opcode_SQV;
RSP_Sc2[5] = Compile_Opcode_SRV;
RSP_Sc2[6] = Compile_Opcode_SPV;
RSP_Sc2[7] = Compile_Opcode_SUV;
RSP_Sc2[8] = Compile_Opcode_SHV;
RSP_Sc2[9] = Compile_Opcode_SFV;
RSP_Sc2[10] = Compile_Opcode_SWV;
RSP_Sc2[11] = Compile_Opcode_STV;
RSP_Sc2[12] = Compile_UnknownOpcode;
RSP_Sc2[13] = Compile_UnknownOpcode;
RSP_Sc2[14] = Compile_UnknownOpcode;
RSP_Sc2[15] = Compile_UnknownOpcode;
RSP_Sc2[16] = Compile_UnknownOpcode;
RSP_Sc2[17] = Compile_UnknownOpcode;
RSP_Sc2[18] = Compile_UnknownOpcode;
RSP_Sc2[19] = Compile_UnknownOpcode;
RSP_Sc2[20] = Compile_UnknownOpcode;
RSP_Sc2[21] = Compile_UnknownOpcode;
RSP_Sc2[22] = Compile_UnknownOpcode;
RSP_Sc2[23] = Compile_UnknownOpcode;
RSP_Sc2[24] = Compile_UnknownOpcode;
RSP_Sc2[25] = Compile_UnknownOpcode;
RSP_Sc2[26] = Compile_UnknownOpcode;
RSP_Sc2[27] = Compile_UnknownOpcode;
RSP_Sc2[28] = Compile_UnknownOpcode;
RSP_Sc2[29] = Compile_UnknownOpcode;
RSP_Sc2[30] = Compile_UnknownOpcode;
RSP_Sc2[31] = Compile_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;
BlockID = 0;
ChangedPC = false;
@ -874,7 +874,7 @@ void CompilerRSPBlock(void)
}
else
{
RSP_Opcode[RSPOpC.op]();
RSP_Recomp_Opcode[RSPOpC.op]();
}
switch (NextInstruction)

File diff suppressed because it is too large Load Diff

View File

@ -151,3 +151,14 @@ void Compile_Opcode_STV(void);
// Other functions
void Compile_UnknownOpcode(void);
typedef void (*p_Recompfunc)(void);
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];

View File

@ -5,6 +5,7 @@
#include <Project64-rsp-core/RSPInfo.h>
#include <Project64-rsp-core/Settings/RspSettings.h>
#include <Project64-rsp-core/cpu/RSPRegisters.h>
#include <Project64-rsp-core/cpu/RspSystem.h>
#include <memory>
class RSPRegisterHandler;
@ -13,16 +14,6 @@ UDWORD EleSpec[16], Indx[16];
RSPOpcode RSPOpC;
uint32_t *PrgCount, NextInstruction, RSP_Running;
p_func RSP_Opcode[64];
p_func RSP_RegImm[32];
p_func RSP_Special[64];
p_func RSP_Cop0[32];
p_func RSP_Cop2[32];
p_func RSP_Vector[64];
p_func RSP_Lc2[32];
p_func RSP_Sc2[32];
void BuildInterpreterCPU(void);
void BuildRecompilerCPU(void);
CriticalSection g_CPUCriticalSection;
@ -40,7 +31,6 @@ void SetCPU(RSPCpuType core)
BuildRecompilerCPU();
break;
case InterpreterCPU:
BuildInterpreterCPU();
break;
}
}
@ -196,7 +186,7 @@ uint32_t DoRspCycles(uint32_t Cycles)
RunRecompilerCPU(Cycles);
break;
case InterpreterCPU:
RunInterpreterCPU(Cycles);
RSPSystem.RunInterpreterCPU(Cycles);
break;
}
if (g_RSPDebugger != nullptr)

View File

@ -13,16 +13,6 @@ enum RSPCpuType
extern UDWORD EleSpec[16], Indx[16];
typedef void (*p_func)(void);
extern p_func RSP_Opcode[64];
extern p_func RSP_RegImm[32];
extern p_func RSP_Special[64];
extern p_func RSP_Cop0[32];
extern p_func RSP_Cop2[32];
extern p_func RSP_Vector[64];
extern p_func RSP_Lc2[32];
extern p_func RSP_Sc2[32];
extern uint32_t *PrgCount, RSP_Running;
extern RSPOpcode RSPOpC;

View File

@ -2,422 +2,14 @@
#include "RSPCpu.h"
#include "RSPInterpreterOps.h"
#include "RSPRegisters.h"
#include <Project64-rsp-core\RSPDebugger.h>
#include <Project64-rsp-core\RSPInfo.h>
#include <Project64-rsp-core/RSPDebugger.h>
#include <Project64-rsp-core/RSPInfo.h>
#include <Project64-rsp-core/cpu/RspSystem.h>
#include <Settings/Settings.h>
RSPPIPELINE_STAGE RSP_NextInstruction;
uint32_t RSP_JumpTo;
void BuildInterpreterCPU(void)
{
RSP_Opcode[0] = RSP_Opcode_SPECIAL;
RSP_Opcode[1] = RSP_Opcode_REGIMM;
RSP_Opcode[2] = RSP_Opcode_J;
RSP_Opcode[3] = RSP_Opcode_JAL;
RSP_Opcode[4] = RSP_Opcode_BEQ;
RSP_Opcode[5] = RSP_Opcode_BNE;
RSP_Opcode[6] = RSP_Opcode_BLEZ;
RSP_Opcode[7] = RSP_Opcode_BGTZ;
RSP_Opcode[8] = RSP_Opcode_ADDI;
RSP_Opcode[9] = RSP_Opcode_ADDIU;
RSP_Opcode[10] = RSP_Opcode_SLTI;
RSP_Opcode[11] = RSP_Opcode_SLTIU;
RSP_Opcode[12] = RSP_Opcode_ANDI;
RSP_Opcode[13] = RSP_Opcode_ORI;
RSP_Opcode[14] = RSP_Opcode_XORI;
RSP_Opcode[15] = RSP_Opcode_LUI;
RSP_Opcode[16] = RSP_Opcode_COP0;
RSP_Opcode[17] = rsp_UnknownOpcode;
RSP_Opcode[18] = RSP_Opcode_COP2;
RSP_Opcode[19] = rsp_UnknownOpcode;
RSP_Opcode[20] = rsp_UnknownOpcode;
RSP_Opcode[21] = rsp_UnknownOpcode;
RSP_Opcode[22] = rsp_UnknownOpcode;
RSP_Opcode[23] = rsp_UnknownOpcode;
RSP_Opcode[24] = rsp_UnknownOpcode;
RSP_Opcode[25] = rsp_UnknownOpcode;
RSP_Opcode[26] = rsp_UnknownOpcode;
RSP_Opcode[27] = rsp_UnknownOpcode;
RSP_Opcode[28] = rsp_UnknownOpcode;
RSP_Opcode[29] = rsp_UnknownOpcode;
RSP_Opcode[30] = rsp_UnknownOpcode;
RSP_Opcode[31] = rsp_UnknownOpcode;
RSP_Opcode[32] = RSP_Opcode_LB;
RSP_Opcode[33] = RSP_Opcode_LH;
RSP_Opcode[34] = rsp_UnknownOpcode;
RSP_Opcode[35] = RSP_Opcode_LW;
RSP_Opcode[36] = RSP_Opcode_LBU;
RSP_Opcode[37] = RSP_Opcode_LHU;
RSP_Opcode[38] = rsp_UnknownOpcode;
RSP_Opcode[39] = RSP_Opcode_LWU;
RSP_Opcode[40] = RSP_Opcode_SB;
RSP_Opcode[41] = RSP_Opcode_SH;
RSP_Opcode[42] = rsp_UnknownOpcode;
RSP_Opcode[43] = RSP_Opcode_SW;
RSP_Opcode[44] = rsp_UnknownOpcode;
RSP_Opcode[45] = rsp_UnknownOpcode;
RSP_Opcode[46] = rsp_UnknownOpcode;
RSP_Opcode[47] = rsp_UnknownOpcode;
RSP_Opcode[48] = rsp_UnknownOpcode;
RSP_Opcode[49] = rsp_UnknownOpcode;
RSP_Opcode[50] = RSP_Opcode_LC2;
RSP_Opcode[51] = rsp_UnknownOpcode;
RSP_Opcode[52] = rsp_UnknownOpcode;
RSP_Opcode[53] = rsp_UnknownOpcode;
RSP_Opcode[54] = rsp_UnknownOpcode;
RSP_Opcode[55] = rsp_UnknownOpcode;
RSP_Opcode[56] = rsp_UnknownOpcode;
RSP_Opcode[57] = rsp_UnknownOpcode;
RSP_Opcode[58] = RSP_Opcode_SC2;
RSP_Opcode[59] = rsp_UnknownOpcode;
RSP_Opcode[60] = rsp_UnknownOpcode;
RSP_Opcode[61] = rsp_UnknownOpcode;
RSP_Opcode[62] = rsp_UnknownOpcode;
RSP_Opcode[63] = rsp_UnknownOpcode;
RSP_Special[0] = RSP_Special_SLL;
RSP_Special[1] = rsp_UnknownOpcode;
RSP_Special[2] = RSP_Special_SRL;
RSP_Special[3] = RSP_Special_SRA;
RSP_Special[4] = RSP_Special_SLLV;
RSP_Special[5] = rsp_UnknownOpcode;
RSP_Special[6] = RSP_Special_SRLV;
RSP_Special[7] = RSP_Special_SRAV;
RSP_Special[8] = RSP_Special_JR;
RSP_Special[9] = RSP_Special_JALR;
RSP_Special[10] = rsp_UnknownOpcode;
RSP_Special[11] = rsp_UnknownOpcode;
RSP_Special[12] = rsp_UnknownOpcode;
RSP_Special[13] = RSP_Special_BREAK;
RSP_Special[14] = rsp_UnknownOpcode;
RSP_Special[15] = rsp_UnknownOpcode;
RSP_Special[16] = rsp_UnknownOpcode;
RSP_Special[17] = rsp_UnknownOpcode;
RSP_Special[18] = rsp_UnknownOpcode;
RSP_Special[19] = rsp_UnknownOpcode;
RSP_Special[20] = rsp_UnknownOpcode;
RSP_Special[21] = rsp_UnknownOpcode;
RSP_Special[22] = rsp_UnknownOpcode;
RSP_Special[23] = rsp_UnknownOpcode;
RSP_Special[24] = rsp_UnknownOpcode;
RSP_Special[25] = rsp_UnknownOpcode;
RSP_Special[26] = rsp_UnknownOpcode;
RSP_Special[27] = rsp_UnknownOpcode;
RSP_Special[28] = rsp_UnknownOpcode;
RSP_Special[29] = rsp_UnknownOpcode;
RSP_Special[30] = rsp_UnknownOpcode;
RSP_Special[31] = rsp_UnknownOpcode;
RSP_Special[32] = RSP_Special_ADD;
RSP_Special[33] = RSP_Special_ADDU;
RSP_Special[34] = RSP_Special_SUB;
RSP_Special[35] = RSP_Special_SUBU;
RSP_Special[36] = RSP_Special_AND;
RSP_Special[37] = RSP_Special_OR;
RSP_Special[38] = RSP_Special_XOR;
RSP_Special[39] = RSP_Special_NOR;
RSP_Special[40] = rsp_UnknownOpcode;
RSP_Special[41] = rsp_UnknownOpcode;
RSP_Special[42] = RSP_Special_SLT;
RSP_Special[43] = RSP_Special_SLTU;
RSP_Special[44] = rsp_UnknownOpcode;
RSP_Special[45] = rsp_UnknownOpcode;
RSP_Special[46] = rsp_UnknownOpcode;
RSP_Special[47] = rsp_UnknownOpcode;
RSP_Special[48] = rsp_UnknownOpcode;
RSP_Special[49] = rsp_UnknownOpcode;
RSP_Special[50] = rsp_UnknownOpcode;
RSP_Special[51] = rsp_UnknownOpcode;
RSP_Special[52] = rsp_UnknownOpcode;
RSP_Special[53] = rsp_UnknownOpcode;
RSP_Special[54] = rsp_UnknownOpcode;
RSP_Special[55] = rsp_UnknownOpcode;
RSP_Special[56] = rsp_UnknownOpcode;
RSP_Special[57] = rsp_UnknownOpcode;
RSP_Special[58] = rsp_UnknownOpcode;
RSP_Special[59] = rsp_UnknownOpcode;
RSP_Special[60] = rsp_UnknownOpcode;
RSP_Special[61] = rsp_UnknownOpcode;
RSP_Special[62] = rsp_UnknownOpcode;
RSP_Special[63] = rsp_UnknownOpcode;
RSP_RegImm[0] = RSP_Opcode_BLTZ;
RSP_RegImm[1] = RSP_Opcode_BGEZ;
RSP_RegImm[2] = rsp_UnknownOpcode;
RSP_RegImm[3] = rsp_UnknownOpcode;
RSP_RegImm[4] = rsp_UnknownOpcode;
RSP_RegImm[5] = rsp_UnknownOpcode;
RSP_RegImm[6] = rsp_UnknownOpcode;
RSP_RegImm[7] = rsp_UnknownOpcode;
RSP_RegImm[8] = rsp_UnknownOpcode;
RSP_RegImm[9] = rsp_UnknownOpcode;
RSP_RegImm[10] = rsp_UnknownOpcode;
RSP_RegImm[11] = rsp_UnknownOpcode;
RSP_RegImm[12] = rsp_UnknownOpcode;
RSP_RegImm[13] = rsp_UnknownOpcode;
RSP_RegImm[14] = rsp_UnknownOpcode;
RSP_RegImm[15] = rsp_UnknownOpcode;
RSP_RegImm[16] = RSP_Opcode_BLTZAL;
RSP_RegImm[17] = RSP_Opcode_BGEZAL;
RSP_RegImm[18] = rsp_UnknownOpcode;
RSP_RegImm[19] = rsp_UnknownOpcode;
RSP_RegImm[20] = rsp_UnknownOpcode;
RSP_RegImm[21] = rsp_UnknownOpcode;
RSP_RegImm[22] = rsp_UnknownOpcode;
RSP_RegImm[23] = rsp_UnknownOpcode;
RSP_RegImm[24] = rsp_UnknownOpcode;
RSP_RegImm[25] = rsp_UnknownOpcode;
RSP_RegImm[26] = rsp_UnknownOpcode;
RSP_RegImm[27] = rsp_UnknownOpcode;
RSP_RegImm[28] = rsp_UnknownOpcode;
RSP_RegImm[29] = rsp_UnknownOpcode;
RSP_RegImm[30] = rsp_UnknownOpcode;
RSP_RegImm[31] = rsp_UnknownOpcode;
RSP_Cop0[0] = RSP_Cop0_MF;
RSP_Cop0[1] = rsp_UnknownOpcode;
RSP_Cop0[2] = rsp_UnknownOpcode;
RSP_Cop0[3] = rsp_UnknownOpcode;
RSP_Cop0[4] = RSP_Cop0_MT;
RSP_Cop0[5] = rsp_UnknownOpcode;
RSP_Cop0[6] = rsp_UnknownOpcode;
RSP_Cop0[7] = rsp_UnknownOpcode;
RSP_Cop0[8] = rsp_UnknownOpcode;
RSP_Cop0[9] = rsp_UnknownOpcode;
RSP_Cop0[10] = rsp_UnknownOpcode;
RSP_Cop0[11] = rsp_UnknownOpcode;
RSP_Cop0[12] = rsp_UnknownOpcode;
RSP_Cop0[13] = rsp_UnknownOpcode;
RSP_Cop0[14] = rsp_UnknownOpcode;
RSP_Cop0[15] = rsp_UnknownOpcode;
RSP_Cop0[16] = rsp_UnknownOpcode;
RSP_Cop0[17] = rsp_UnknownOpcode;
RSP_Cop0[18] = rsp_UnknownOpcode;
RSP_Cop0[19] = rsp_UnknownOpcode;
RSP_Cop0[20] = rsp_UnknownOpcode;
RSP_Cop0[21] = rsp_UnknownOpcode;
RSP_Cop0[22] = rsp_UnknownOpcode;
RSP_Cop0[23] = rsp_UnknownOpcode;
RSP_Cop0[24] = rsp_UnknownOpcode;
RSP_Cop0[25] = rsp_UnknownOpcode;
RSP_Cop0[26] = rsp_UnknownOpcode;
RSP_Cop0[27] = rsp_UnknownOpcode;
RSP_Cop0[28] = rsp_UnknownOpcode;
RSP_Cop0[29] = rsp_UnknownOpcode;
RSP_Cop0[30] = rsp_UnknownOpcode;
RSP_Cop0[31] = rsp_UnknownOpcode;
RSP_Cop2[0] = RSP_Cop2_MF;
RSP_Cop2[1] = rsp_UnknownOpcode;
RSP_Cop2[2] = RSP_Cop2_CF;
RSP_Cop2[3] = rsp_UnknownOpcode;
RSP_Cop2[4] = RSP_Cop2_MT;
RSP_Cop2[5] = rsp_UnknownOpcode;
RSP_Cop2[6] = RSP_Cop2_CT;
RSP_Cop2[7] = rsp_UnknownOpcode;
RSP_Cop2[8] = rsp_UnknownOpcode;
RSP_Cop2[9] = rsp_UnknownOpcode;
RSP_Cop2[10] = rsp_UnknownOpcode;
RSP_Cop2[11] = rsp_UnknownOpcode;
RSP_Cop2[12] = rsp_UnknownOpcode;
RSP_Cop2[13] = rsp_UnknownOpcode;
RSP_Cop2[14] = rsp_UnknownOpcode;
RSP_Cop2[15] = rsp_UnknownOpcode;
RSP_Cop2[16] = RSP_COP2_VECTOR;
RSP_Cop2[17] = RSP_COP2_VECTOR;
RSP_Cop2[18] = RSP_COP2_VECTOR;
RSP_Cop2[19] = RSP_COP2_VECTOR;
RSP_Cop2[20] = RSP_COP2_VECTOR;
RSP_Cop2[21] = RSP_COP2_VECTOR;
RSP_Cop2[22] = RSP_COP2_VECTOR;
RSP_Cop2[23] = RSP_COP2_VECTOR;
RSP_Cop2[24] = RSP_COP2_VECTOR;
RSP_Cop2[25] = RSP_COP2_VECTOR;
RSP_Cop2[26] = RSP_COP2_VECTOR;
RSP_Cop2[27] = RSP_COP2_VECTOR;
RSP_Cop2[28] = RSP_COP2_VECTOR;
RSP_Cop2[29] = RSP_COP2_VECTOR;
RSP_Cop2[30] = RSP_COP2_VECTOR;
RSP_Cop2[31] = RSP_COP2_VECTOR;
RSP_Vector[0] = RSP_Vector_VMULF;
RSP_Vector[1] = RSP_Vector_VMULU;
RSP_Vector[2] = RSP_Vector_VRNDP;
RSP_Vector[3] = RSP_Vector_VMULQ;
RSP_Vector[4] = RSP_Vector_VMUDL;
RSP_Vector[5] = RSP_Vector_VMUDM;
RSP_Vector[6] = RSP_Vector_VMUDN;
RSP_Vector[7] = RSP_Vector_VMUDH;
RSP_Vector[8] = RSP_Vector_VMACF;
RSP_Vector[9] = RSP_Vector_VMACU;
RSP_Vector[10] = RSP_Vector_VRNDN;
RSP_Vector[11] = RSP_Vector_VMACQ;
RSP_Vector[12] = RSP_Vector_VMADL;
RSP_Vector[13] = RSP_Vector_VMADM;
RSP_Vector[14] = RSP_Vector_VMADN;
RSP_Vector[15] = RSP_Vector_VMADH;
RSP_Vector[16] = RSP_Vector_VADD;
RSP_Vector[17] = RSP_Vector_VSUB;
RSP_Vector[18] = RSP_Vector_Reserved;
RSP_Vector[19] = RSP_Vector_VABS;
RSP_Vector[20] = RSP_Vector_VADDC;
RSP_Vector[21] = RSP_Vector_VSUBC;
RSP_Vector[22] = RSP_Vector_Reserved;
RSP_Vector[23] = RSP_Vector_Reserved;
RSP_Vector[24] = RSP_Vector_Reserved;
RSP_Vector[25] = RSP_Vector_Reserved;
RSP_Vector[26] = RSP_Vector_Reserved;
RSP_Vector[27] = RSP_Vector_Reserved;
RSP_Vector[28] = RSP_Vector_Reserved;
RSP_Vector[29] = RSP_Vector_VSAW;
RSP_Vector[30] = RSP_Vector_Reserved;
RSP_Vector[31] = RSP_Vector_Reserved;
RSP_Vector[32] = RSP_Vector_VLT;
RSP_Vector[33] = RSP_Vector_VEQ;
RSP_Vector[34] = RSP_Vector_VNE;
RSP_Vector[35] = RSP_Vector_VGE;
RSP_Vector[36] = RSP_Vector_VCL;
RSP_Vector[37] = RSP_Vector_VCH;
RSP_Vector[38] = RSP_Vector_VCR;
RSP_Vector[39] = RSP_Vector_VMRG;
RSP_Vector[40] = RSP_Vector_VAND;
RSP_Vector[41] = RSP_Vector_VNAND;
RSP_Vector[42] = RSP_Vector_VOR;
RSP_Vector[43] = RSP_Vector_VNOR;
RSP_Vector[44] = RSP_Vector_VXOR;
RSP_Vector[45] = RSP_Vector_VNXOR;
RSP_Vector[46] = RSP_Vector_Reserved;
RSP_Vector[47] = RSP_Vector_Reserved;
RSP_Vector[48] = RSP_Vector_VRCP;
RSP_Vector[49] = RSP_Vector_VRCPL;
RSP_Vector[50] = RSP_Vector_VRCPH;
RSP_Vector[51] = RSP_Vector_VMOV;
RSP_Vector[52] = RSP_Vector_VRSQ;
RSP_Vector[53] = RSP_Vector_VRSQL;
RSP_Vector[54] = RSP_Vector_VRSQH;
RSP_Vector[55] = RSP_Vector_VNOOP;
RSP_Vector[56] = RSP_Vector_Reserved;
RSP_Vector[57] = RSP_Vector_Reserved;
RSP_Vector[58] = RSP_Vector_Reserved;
RSP_Vector[59] = RSP_Vector_Reserved;
RSP_Vector[60] = RSP_Vector_Reserved;
RSP_Vector[61] = RSP_Vector_Reserved;
RSP_Vector[62] = RSP_Vector_Reserved;
RSP_Vector[63] = RSP_Vector_VNOOP;
RSP_Lc2[0] = RSP_Opcode_LBV;
RSP_Lc2[1] = RSP_Opcode_LSV;
RSP_Lc2[2] = RSP_Opcode_LLV;
RSP_Lc2[3] = RSP_Opcode_LDV;
RSP_Lc2[4] = RSP_Opcode_LQV;
RSP_Lc2[5] = RSP_Opcode_LRV;
RSP_Lc2[6] = RSP_Opcode_LPV;
RSP_Lc2[7] = RSP_Opcode_LUV;
RSP_Lc2[8] = RSP_Opcode_LHV;
RSP_Lc2[9] = RSP_Opcode_LFV;
RSP_Lc2[10] = RSP_Opcode_LWV;
RSP_Lc2[11] = RSP_Opcode_LTV;
RSP_Lc2[12] = rsp_UnknownOpcode;
RSP_Lc2[13] = rsp_UnknownOpcode;
RSP_Lc2[14] = rsp_UnknownOpcode;
RSP_Lc2[15] = rsp_UnknownOpcode;
RSP_Lc2[16] = rsp_UnknownOpcode;
RSP_Lc2[17] = rsp_UnknownOpcode;
RSP_Lc2[18] = rsp_UnknownOpcode;
RSP_Lc2[19] = rsp_UnknownOpcode;
RSP_Lc2[20] = rsp_UnknownOpcode;
RSP_Lc2[21] = rsp_UnknownOpcode;
RSP_Lc2[22] = rsp_UnknownOpcode;
RSP_Lc2[23] = rsp_UnknownOpcode;
RSP_Lc2[24] = rsp_UnknownOpcode;
RSP_Lc2[25] = rsp_UnknownOpcode;
RSP_Lc2[26] = rsp_UnknownOpcode;
RSP_Lc2[27] = rsp_UnknownOpcode;
RSP_Lc2[28] = rsp_UnknownOpcode;
RSP_Lc2[29] = rsp_UnknownOpcode;
RSP_Lc2[30] = rsp_UnknownOpcode;
RSP_Lc2[31] = rsp_UnknownOpcode;
RSP_Sc2[0] = RSP_Opcode_SBV;
RSP_Sc2[1] = RSP_Opcode_SSV;
RSP_Sc2[2] = RSP_Opcode_SLV;
RSP_Sc2[3] = RSP_Opcode_SDV;
RSP_Sc2[4] = RSP_Opcode_SQV;
RSP_Sc2[5] = RSP_Opcode_SRV;
RSP_Sc2[6] = RSP_Opcode_SPV;
RSP_Sc2[7] = RSP_Opcode_SUV;
RSP_Sc2[8] = RSP_Opcode_SHV;
RSP_Sc2[9] = RSP_Opcode_SFV;
RSP_Sc2[10] = RSP_Opcode_SWV;
RSP_Sc2[11] = RSP_Opcode_STV;
RSP_Sc2[12] = rsp_UnknownOpcode;
RSP_Sc2[13] = rsp_UnknownOpcode;
RSP_Sc2[14] = rsp_UnknownOpcode;
RSP_Sc2[15] = rsp_UnknownOpcode;
RSP_Sc2[16] = rsp_UnknownOpcode;
RSP_Sc2[17] = rsp_UnknownOpcode;
RSP_Sc2[18] = rsp_UnknownOpcode;
RSP_Sc2[19] = rsp_UnknownOpcode;
RSP_Sc2[20] = rsp_UnknownOpcode;
RSP_Sc2[21] = rsp_UnknownOpcode;
RSP_Sc2[22] = rsp_UnknownOpcode;
RSP_Sc2[23] = rsp_UnknownOpcode;
RSP_Sc2[24] = rsp_UnknownOpcode;
RSP_Sc2[25] = rsp_UnknownOpcode;
RSP_Sc2[26] = rsp_UnknownOpcode;
RSP_Sc2[27] = rsp_UnknownOpcode;
RSP_Sc2[28] = rsp_UnknownOpcode;
RSP_Sc2[29] = rsp_UnknownOpcode;
RSP_Sc2[30] = rsp_UnknownOpcode;
RSP_Sc2[31] = rsp_UnknownOpcode;
}
uint32_t RunInterpreterCPU(uint32_t Cycles)
{
uint32_t CycleCount;
RSP_Running = true;
if (g_RSPDebugger != nullptr)
{
g_RSPDebugger->StartingCPU();
}
CycleCount = 0;
while (RSP_Running)
{
if (g_RSPDebugger != nullptr)
{
g_RSPDebugger->BeforeExecuteOp();
}
RSPOpC.Value = *(uint32_t *)(RSPInfo.IMEM + (*PrgCount & 0xFFC));
RSP_Opcode[RSPOpC.op]();
RSP_GPR[0].W = 0x00000000; // MIPS $zero hard-wired to 0
switch (RSP_NextInstruction)
{
case RSPPIPELINE_NORMAL:
*PrgCount = (*PrgCount + 4) & 0xFFC;
break;
case RSPPIPELINE_DELAY_SLOT:
RSP_NextInstruction = RSPPIPELINE_JUMP;
*PrgCount = (*PrgCount + 4) & 0xFFC;
break;
case RSPPIPELINE_JUMP:
RSP_NextInstruction = RSPPIPELINE_NORMAL;
*PrgCount = RSP_JumpTo;
break;
case RSPPIPELINE_SINGLE_STEP:
*PrgCount = (*PrgCount + 4) & 0xFFC;
RSP_NextInstruction = RSPPIPELINE_SINGLE_STEP_DONE;
break;
case RSPPIPELINE_SINGLE_STEP_DONE:
*PrgCount = (*PrgCount + 4) & 0xFFC;
*RSPInfo.SP_STATUS_REG |= SP_STATUS_HALT;
RSP_Running = false;
break;
}
}
return Cycles;
}
unsigned int RSP_branch_if(int condition)
{
unsigned int new_PC;

View File

@ -23,5 +23,4 @@ extern uint32_t RSP_JumpTo;
unsigned int RSP_branch_if(int condition);
void BuildInterpreterCPU(void);
uint32_t RunInterpreterCPU(uint32_t Cycles);

File diff suppressed because it is too large Load Diff

View File

@ -1,155 +1,178 @@
// Opcode functions
#pragma once
void RSP_Opcode_SPECIAL(void);
void RSP_Opcode_REGIMM(void);
void RSP_Opcode_J(void);
void RSP_Opcode_JAL(void);
void RSP_Opcode_BEQ(void);
void RSP_Opcode_BNE(void);
void RSP_Opcode_BLEZ(void);
void RSP_Opcode_BGTZ(void);
void RSP_Opcode_ADDI(void);
void RSP_Opcode_ADDIU(void);
void RSP_Opcode_SLTI(void);
void RSP_Opcode_SLTIU(void);
void RSP_Opcode_ANDI(void);
void RSP_Opcode_ORI(void);
void RSP_Opcode_XORI(void);
void RSP_Opcode_LUI(void);
void RSP_Opcode_COP0(void);
void RSP_Opcode_COP2(void);
void RSP_Opcode_LB(void);
void RSP_Opcode_LH(void);
void RSP_Opcode_LW(void);
void RSP_Opcode_LBU(void);
void RSP_Opcode_LHU(void);
void RSP_Opcode_LWU(void);
void RSP_Opcode_SB(void);
void RSP_Opcode_SH(void);
void RSP_Opcode_SW(void);
void RSP_Opcode_LC2(void);
void RSP_Opcode_SC2(void);
class CRSPSystem;
// R4300i Opcodes: Special
class RSPOp
{
public:
RSPOp(CRSPSystem & System);
~RSPOp();
void RSP_Special_SLL(void);
void RSP_Special_SRL(void);
void RSP_Special_SRA(void);
void RSP_Special_SLLV(void);
void RSP_Special_SRLV(void);
void RSP_Special_SRAV(void);
void RSP_Special_JR(void);
void RSP_Special_JALR(void);
void RSP_Special_BREAK(void);
void RSP_Special_ADD(void);
void RSP_Special_ADDU(void);
void RSP_Special_SUB(void);
void RSP_Special_SUBU(void);
void RSP_Special_AND(void);
void RSP_Special_OR(void);
void RSP_Special_XOR(void);
void RSP_Special_NOR(void);
void RSP_Special_SLT(void);
void RSP_Special_SLTU(void);
public:
RSPOp();
RSPOp(const RSPOp &);
RSPOp & operator=(const RSPOp &);
// R4300i Opcodes: RegImm
void BuildInterpreter(void);
void RSP_Opcode_BLTZ(void);
void RSP_Opcode_BGEZ(void);
void RSP_Opcode_BLTZAL(void);
void RSP_Opcode_BGEZAL(void);
typedef void (RSPOp::*Func)();
// COP0 functions
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);
void RSP_Cop0_MF(void);
void RSP_Cop0_MT(void);
// R4300i Opcodes: Special
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);
// COP2 functions
// R4300i Opcodes: RegImm
void BLTZ(void);
void BGEZ(void);
void BLTZAL(void);
void BGEZAL(void);
void RSP_Cop2_MF(void);
void RSP_Cop2_CF(void);
void RSP_Cop2_MT(void);
void RSP_Cop2_CT(void);
void RSP_COP2_VECTOR(void);
// COP0 functions
void Cop0_MF(void);
void Cop0_MT(void);
// Vector functions
// COP2 functions
void Cop2_MF(void);
void Cop2_CF(void);
void Cop2_MT(void);
void Cop2_CT(void);
void Cop2_VECTOR(void);
void RSP_Vector_VMULF(void);
void RSP_Vector_VMULU(void);
void RSP_Vector_VRNDP(void);
void RSP_Vector_VMULQ(void);
void RSP_Vector_VMUDL(void);
void RSP_Vector_VMUDM(void);
void RSP_Vector_VMUDN(void);
void RSP_Vector_VMUDH(void);
void RSP_Vector_VMACF(void);
void RSP_Vector_VMACU(void);
void RSP_Vector_VMACQ(void);
void RSP_Vector_VRNDN(void);
void RSP_Vector_VMADL(void);
void RSP_Vector_VMADM(void);
void RSP_Vector_VMADN(void);
void RSP_Vector_VMADH(void);
void RSP_Vector_VADD(void);
void RSP_Vector_VSUB(void);
void RSP_Vector_VABS(void);
void RSP_Vector_VADDC(void);
void RSP_Vector_VSUBC(void);
void RSP_Vector_Reserved(void);
void RSP_Vector_VSAW(void);
void RSP_Vector_VLT(void);
void RSP_Vector_VEQ(void);
void RSP_Vector_VNE(void);
void RSP_Vector_VGE(void);
void RSP_Vector_VCL(void);
void RSP_Vector_VCH(void);
void RSP_Vector_VCR(void);
void RSP_Vector_VMRG(void);
void RSP_Vector_VAND(void);
void RSP_Vector_VNAND(void);
void RSP_Vector_VOR(void);
void RSP_Vector_VNOR(void);
void RSP_Vector_VXOR(void);
void RSP_Vector_VNXOR(void);
void RSP_Vector_VRCP(void);
void RSP_Vector_VRCPL(void);
void RSP_Vector_VRCPH(void);
void RSP_Vector_VMOV(void);
void RSP_Vector_VRSQ(void);
void RSP_Vector_VRSQL(void);
void RSP_Vector_VRSQH(void);
void RSP_Vector_VNOOP(void);
// Vector functions
void Vector_VMULF(void);
void Vector_VMULU(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_VRNDN(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_Reserved(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);
// LC2 functions
// LC2 functions
void LBV(void);
void LSV(void);
void LLV(void);
void LDV(void);
void LQV(void);
void LRV(void);
void LPV(void);
void LUV(void);
void LHV(void);
void LFV(void);
void LWV(void);
void LTV(void);
void RSP_Opcode_LBV(void);
void RSP_Opcode_LSV(void);
void RSP_Opcode_LLV(void);
void RSP_Opcode_LDV(void);
void RSP_Opcode_LQV(void);
void RSP_Opcode_LRV(void);
void RSP_Opcode_LPV(void);
void RSP_Opcode_LUV(void);
void RSP_Opcode_LHV(void);
void RSP_Opcode_LFV(void);
void RSP_Opcode_LWV(void);
void RSP_Opcode_LTV(void);
// LC2 functions
void SBV(void);
void SSV(void);
void SLV(void);
void SDV(void);
void SQV(void);
void SRV(void);
void SPV(void);
void SUV(void);
void SHV(void);
void SFV(void);
void STV(void);
void SWV(void);
// LC2 functions
// Other functions
void UnknownOpcode(void);
void RSP_Opcode_SBV(void);
void RSP_Opcode_SSV(void);
void RSP_Opcode_SLV(void);
void RSP_Opcode_SDV(void);
void RSP_Opcode_SQV(void);
void RSP_Opcode_SRV(void);
void RSP_Opcode_SPV(void);
void RSP_Opcode_SUV(void);
void RSP_Opcode_SHV(void);
void RSP_Opcode_SFV(void);
void RSP_Opcode_STV(void);
void RSP_Opcode_SWV(void);
CRSPSystem & m_System;
// Other functions
typedef void (RSPOp::*Func)();
void rsp_UnknownOpcode(void);
Func Jump_Opcode[64];
Func Jump_RegImm[32];
Func Jump_Special[64];
Func Jump_Cop0[32];
Func Jump_Cop2[32];
Func Jump_Vector[64];
Func Jump_Lc2[32];
Func Jump_Sc2[32];
};

View File

@ -0,0 +1,60 @@
#include <Project64-rsp-core/RSPDebugger.h>
#include <Project64-rsp-core/RSPInfo.h>
#include <Project64-rsp-core/cpu/RSPCpu.h>
#include <Project64-rsp-core/cpu/RSPInterpreterCPU.h>
#include <Project64-rsp-core/cpu/RSPRegisters.h>
#include <Project64-rsp-core/cpu/RspSystem.h>
CRSPSystem RSPSystem;
CRSPSystem::CRSPSystem() :
m_OpCodes(*this)
{
}
uint32_t CRSPSystem::RunInterpreterCPU(uint32_t Cycles)
{
uint32_t CycleCount;
RSP_Running = true;
if (g_RSPDebugger != nullptr)
{
g_RSPDebugger->StartingCPU();
}
CycleCount = 0;
while (RSP_Running)
{
if (g_RSPDebugger != nullptr)
{
g_RSPDebugger->BeforeExecuteOp();
}
RSPOpC.Value = *(uint32_t *)(RSPInfo.IMEM + (*PrgCount & 0xFFC));
(m_OpCodes.*(m_OpCodes.Jump_Opcode[RSPOpC.op]))();
RSP_GPR[0].W = 0x00000000; // MIPS $zero hard-wired to 0
switch (RSP_NextInstruction)
{
case RSPPIPELINE_NORMAL:
*PrgCount = (*PrgCount + 4) & 0xFFC;
break;
case RSPPIPELINE_DELAY_SLOT:
RSP_NextInstruction = RSPPIPELINE_JUMP;
*PrgCount = (*PrgCount + 4) & 0xFFC;
break;
case RSPPIPELINE_JUMP:
RSP_NextInstruction = RSPPIPELINE_NORMAL;
*PrgCount = RSP_JumpTo;
break;
case RSPPIPELINE_SINGLE_STEP:
*PrgCount = (*PrgCount + 4) & 0xFFC;
RSP_NextInstruction = RSPPIPELINE_SINGLE_STEP_DONE;
break;
case RSPPIPELINE_SINGLE_STEP_DONE:
*PrgCount = (*PrgCount + 4) & 0xFFC;
*RSPInfo.SP_STATUS_REG |= SP_STATUS_HALT;
RSP_Running = false;
break;
}
}
return Cycles;
}

View File

@ -0,0 +1,17 @@
#pragma once
#include <Project64-rsp-core/cpu/RSPInterpreterOps.h>
#include <Project64-rsp-core/cpu/RspTypes.h>
#include <stdint.h>
class CRSPSystem
{
public:
CRSPSystem();
uint32_t RunInterpreterCPU(uint32_t Cycles);
private:
RSPOp m_OpCodes;
};
extern CRSPSystem RSPSystem;