[Project64] Better handling of div / 0

This commit is contained in:
zilmar 2017-08-31 09:43:58 +10:00
parent c51ff3a829
commit 10f662da94
1 changed files with 13 additions and 13 deletions

View File

@ -1760,7 +1760,7 @@ void R4300iOp::SPECIAL_MULTU()
void R4300iOp::SPECIAL_DIV()
{
if (_GPR[m_Opcode.rt].UDW != 0)
if (_GPR[m_Opcode.rt].W[0] != 0)
{
_RegLO->DW = _GPR[m_Opcode.rs].W[0] / _GPR[m_Opcode.rt].W[0];
_RegHI->DW = _GPR[m_Opcode.rs].W[0] % _GPR[m_Opcode.rt].W[0];
@ -2094,18 +2094,18 @@ void R4300iOp::REGIMM_BGEZAL()
m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4;
if ((*_PROGRAM_COUNTER) == m_JumpToLocation)
{
if (g_Settings->LoadBool(Debugger_Enabled))
{
if (g_Reg->m_PROGRAM_COUNTER < 0x80000400)
{
// Break out of possible checksum halt
g_Notify->DisplayMessage(5, "Broke out of permanent loop! Invalid checksum?");
m_JumpToLocation = (*_PROGRAM_COUNTER) + 8;
_GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8);
R4300iOp::m_NextInstruction = DELAY_SLOT;
return;
}
}
if (g_Settings->LoadBool(Debugger_Enabled))
{
if (g_Reg->m_PROGRAM_COUNTER < 0x80000400)
{
// Break out of possible checksum halt
g_Notify->DisplayMessage(5, "Broke out of permanent loop! Invalid checksum?");
m_JumpToLocation = (*_PROGRAM_COUNTER) + 8;
_GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8);
R4300iOp::m_NextInstruction = DELAY_SLOT;
return;
}
}
if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0))
{
CInterpreterCPU::InPermLoop();