Make sure SPECIAL_DIVU detect div by 0 correctly

This commit is contained in:
zilmar 2015-02-23 17:18:15 +11:00
parent 38d2e2485b
commit 414811af79
1 changed files with 4 additions and 2 deletions

View File

@ -1580,8 +1580,10 @@ void R4300iOp::SPECIAL_DIV (void) {
}
}
void R4300iOp::SPECIAL_DIVU (void) {
if ( _GPR[m_Opcode.rt].UDW != 0 ) {
void R4300iOp::SPECIAL_DIVU (void)
{
if (_GPR[m_Opcode.rt].UW[0] != 0)
{
_RegLO->DW = (int)(_GPR[m_Opcode.rs].UW[0] / _GPR[m_Opcode.rt].UW[0]);
_RegHI->DW = (int)(_GPR[m_Opcode.rs].UW[0] % _GPR[m_Opcode.rt].UW[0]);
} else {