RSP: Add lwu

This commit is contained in:
zilmar 2023-07-18 10:04:54 +09:30
parent bd357c65b0
commit 4265bdfb43
5 changed files with 13 additions and 1 deletions

View File

@ -55,7 +55,7 @@ void BuildInterpreterCPU(void)
RSP_Opcode[36] = RSP_Opcode_LBU; RSP_Opcode[36] = RSP_Opcode_LBU;
RSP_Opcode[37] = RSP_Opcode_LHU; RSP_Opcode[37] = RSP_Opcode_LHU;
RSP_Opcode[38] = rsp_UnknownOpcode; RSP_Opcode[38] = rsp_UnknownOpcode;
RSP_Opcode[39] = rsp_UnknownOpcode; RSP_Opcode[39] = RSP_Opcode_LWU;
RSP_Opcode[40] = RSP_Opcode_SB; RSP_Opcode[40] = RSP_Opcode_SB;
RSP_Opcode[41] = RSP_Opcode_SH; RSP_Opcode[41] = RSP_Opcode_SH;
RSP_Opcode[42] = rsp_UnknownOpcode; RSP_Opcode[42] = rsp_UnknownOpcode;

View File

@ -169,6 +169,12 @@ void RSP_Opcode_LHU(void)
RSP_GPR[RSPOpC.rt].UW = RSP_GPR[RSPOpC.rt].UHW[0]; RSP_GPR[RSPOpC.rt].UW = RSP_GPR[RSPOpC.rt].UHW[0];
} }
void RSP_Opcode_LWU(void)
{
uint32_t Address = (uint32_t)(RSP_GPR[RSPOpC.base].W + (short)RSPOpC.offset) & 0xFFF;
RSP_LW_DMEM(Address, &RSP_GPR[RSPOpC.rt].UW);
}
void RSP_Opcode_SB(void) void RSP_Opcode_SB(void)
{ {
uint32_t Address = (uint32_t)(RSP_GPR[RSPOpC.base].W + (short)RSPOpC.offset) & 0xFFF; uint32_t Address = (uint32_t)(RSP_GPR[RSPOpC.base].W + (short)RSPOpC.offset) & 0xFFF;

View File

@ -23,6 +23,7 @@ void RSP_Opcode_LH(void);
void RSP_Opcode_LW(void); void RSP_Opcode_LW(void);
void RSP_Opcode_LBU(void); void RSP_Opcode_LBU(void);
void RSP_Opcode_LHU(void); void RSP_Opcode_LHU(void);
void RSP_Opcode_LWU(void);
void RSP_Opcode_SB(void); void RSP_Opcode_SB(void);
void RSP_Opcode_SH(void); void RSP_Opcode_SH(void);
void RSP_Opcode_SW(void); void RSP_Opcode_SW(void);

View File

@ -94,6 +94,7 @@ enum RSPOpCodes
RSP_LW = 35, RSP_LW = 35,
RSP_LBU = 36, RSP_LBU = 36,
RSP_LHU = 37, RSP_LHU = 37,
RSP_LWU = 39,
RSP_SB = 40, RSP_SB = 40,
RSP_SH = 41, RSP_SH = 41,
RSP_SW = 43, RSP_SW = 43,

View File

@ -146,6 +146,10 @@ void RSPInstruction::DecodeName(void)
strcpy(m_Name, "LHU"); strcpy(m_Name, "LHU");
sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base)); sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base));
break; break;
case RSP_LWU:
strcpy(m_Name, "LWU");
sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base));
break;
case RSP_SB: case RSP_SB:
strcpy(m_Name, "SB"); strcpy(m_Name, "SB");
sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base)); sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base));