diff --git a/Source/Project64-rsp/Interpreter CPU.cpp b/Source/Project64-rsp/Interpreter CPU.cpp index bb2b49f51..0e5e3c26d 100644 --- a/Source/Project64-rsp/Interpreter CPU.cpp +++ b/Source/Project64-rsp/Interpreter CPU.cpp @@ -55,7 +55,7 @@ void BuildInterpreterCPU(void) RSP_Opcode[36] = RSP_Opcode_LBU; RSP_Opcode[37] = RSP_Opcode_LHU; RSP_Opcode[38] = rsp_UnknownOpcode; - RSP_Opcode[39] = 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; diff --git a/Source/Project64-rsp/Interpreter Ops.cpp b/Source/Project64-rsp/Interpreter Ops.cpp index 49de9a0cb..24d379970 100644 --- a/Source/Project64-rsp/Interpreter Ops.cpp +++ b/Source/Project64-rsp/Interpreter Ops.cpp @@ -169,6 +169,12 @@ void RSP_Opcode_LHU(void) 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) { uint32_t Address = (uint32_t)(RSP_GPR[RSPOpC.base].W + (short)RSPOpC.offset) & 0xFFF; diff --git a/Source/Project64-rsp/Interpreter Ops.h b/Source/Project64-rsp/Interpreter Ops.h index 7ed05ab83..882f11ea3 100644 --- a/Source/Project64-rsp/Interpreter Ops.h +++ b/Source/Project64-rsp/Interpreter Ops.h @@ -23,6 +23,7 @@ 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); diff --git a/Source/Project64-rsp/cpu/RSPOpcode.h b/Source/Project64-rsp/cpu/RSPOpcode.h index f35c70029..1a3fc9d03 100644 --- a/Source/Project64-rsp/cpu/RSPOpcode.h +++ b/Source/Project64-rsp/cpu/RSPOpcode.h @@ -94,6 +94,7 @@ enum RSPOpCodes RSP_LW = 35, RSP_LBU = 36, RSP_LHU = 37, + RSP_LWU = 39, RSP_SB = 40, RSP_SH = 41, RSP_SW = 43, diff --git a/Source/Project64-rsp/cpu/RSPiInstruction.cpp b/Source/Project64-rsp/cpu/RSPiInstruction.cpp index a55f8a7f7..93cc239e2 100644 --- a/Source/Project64-rsp/cpu/RSPiInstruction.cpp +++ b/Source/Project64-rsp/cpu/RSPiInstruction.cpp @@ -146,6 +146,10 @@ void RSPInstruction::DecodeName(void) strcpy(m_Name, "LHU"); sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base)); 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: strcpy(m_Name, "SB"); sprintf(m_Param, "%s, 0x%04X (%s)", GPR_Name(m_Instruction.rt), m_Instruction.offset, GPR_Name(m_Instruction.base));