Skip to content

Commit

Permalink
PCSX2: Remove Unused And Unneeded Argument. (#1799)
Browse files Browse the repository at this point in the history
EE interpeter: remove unused argument

rdd is neither used, nor needed. It appears it was there to pass the _Rd_ word to write to, but the writing was moved to PHMSBH() to have one "if (_Rd_)".

Add a note on undefined behavior
  • Loading branch information
Huud authored and gregory38 committed Feb 1, 2017
1 parent af38b8b commit c56ac2c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pcsx2/MMI.cpp
Expand Up @@ -1301,28 +1301,28 @@ void PMSUBH() { // JayteeMaster: changed a bit to avoid screw up
} }


// JayteeMaster: changed a bit to avoid screw up // JayteeMaster: changed a bit to avoid screw up
static __fi void _PHMSBH_LO(int dd, int n, int rdd) static __fi void _PHMSBH_LO(int dd, int n)
{ {
s32 firsttemp = (s32)cpuRegs.GPR.r[_Rs_].SS[n+1] * (s32)cpuRegs.GPR.r[_Rt_].SS[n+1]; s32 firsttemp = (s32)cpuRegs.GPR.r[_Rs_].SS[n+1] * (s32)cpuRegs.GPR.r[_Rt_].SS[n+1];
s32 temp = firsttemp - (s32)cpuRegs.GPR.r[_Rs_].SS[n] * (s32)cpuRegs.GPR.r[_Rt_].SS[n]; s32 temp = firsttemp - (s32)cpuRegs.GPR.r[_Rs_].SS[n] * (s32)cpuRegs.GPR.r[_Rt_].SS[n];


cpuRegs.LO.UL[dd] = temp; cpuRegs.LO.UL[dd] = temp;
cpuRegs.LO.UL[dd+1] = ~firsttemp; cpuRegs.LO.UL[dd+1] = ~firsttemp; // undocumented behaviour
} }
static __fi void _PHMSBH_HI(int dd, int n, int rdd) static __fi void _PHMSBH_HI(int dd, int n)
{ {
s32 firsttemp = (s32)cpuRegs.GPR.r[_Rs_].SS[n+1] * (s32)cpuRegs.GPR.r[_Rt_].SS[n+1]; s32 firsttemp = (s32)cpuRegs.GPR.r[_Rs_].SS[n+1] * (s32)cpuRegs.GPR.r[_Rt_].SS[n+1];
s32 temp = firsttemp - (s32)cpuRegs.GPR.r[_Rs_].SS[n] * (s32)cpuRegs.GPR.r[_Rt_].SS[n]; s32 temp = firsttemp - (s32)cpuRegs.GPR.r[_Rs_].SS[n] * (s32)cpuRegs.GPR.r[_Rt_].SS[n];


cpuRegs.HI.UL[dd] = temp; cpuRegs.HI.UL[dd] = temp;
cpuRegs.HI.UL[dd+1] = ~firsttemp; cpuRegs.HI.UL[dd+1] = ~firsttemp; // undocumented behaviour
} }


void PHMSBH() { // JayteeMaster: changed a bit to avoid screw up void PHMSBH() { // JayteeMaster: changed a bit to avoid screw up
_PHMSBH_LO(0, 0, 0); _PHMSBH_LO(0, 0);
_PHMSBH_HI(0, 2, 1); _PHMSBH_HI(0, 2);
_PHMSBH_LO(2, 4, 2); _PHMSBH_LO(2, 4);
_PHMSBH_HI(2, 6, 3); _PHMSBH_HI(2, 6);
if (_Rd_) { if (_Rd_) {
cpuRegs.GPR.r[_Rd_].UL[0] = cpuRegs.LO.UL[0]; cpuRegs.GPR.r[_Rd_].UL[0] = cpuRegs.LO.UL[0];
cpuRegs.GPR.r[_Rd_].UL[1] = cpuRegs.HI.UL[0]; cpuRegs.GPR.r[_Rd_].UL[1] = cpuRegs.HI.UL[0];
Expand Down

0 comments on commit c56ac2c

Please sign in to comment.