mips1: missed this (nw)

Make sure the exception target address isn't incremented.
This commit is contained in:
Patrick Mackinlay 2018-12-18 21:04:07 +07:00
parent a7f0f6e027
commit a3f7b2a415
2 changed files with 9 additions and 4 deletions

View File

@ -284,7 +284,7 @@ void mips1core_device_base::generate_exception(int exception)
m_cpr[0][COP0_EPC] -= 4; m_cpr[0][COP0_EPC] -= 4;
CAUSE |= 0x80000000; CAUSE |= 0x80000000;
} }
m_branch_state = NONE; m_branch_state = EXCEPTION;
// shift the exception bits // shift the exception bits
SR = (SR & 0xffffffc0) | ((SR << 2) & 0x3c); SR = (SR & 0xffffffc0) | ((SR << 2) & 0x3c);
@ -789,6 +789,10 @@ void mips1core_device_base::execute_run()
m_branch_state = DELAY; m_branch_state = DELAY;
m_pc += 4; m_pc += 4;
break; break;
case EXCEPTION:
m_branch_state = NONE;
break;
} }
}); });
m_icount--; m_icount--;

View File

@ -225,9 +225,10 @@ protected:
int m_icount; int m_icount;
enum branch_state_t : unsigned enum branch_state_t : unsigned
{ {
NONE = 0, NONE = 0,
DELAY = 1, // delay slot instruction active DELAY = 1, // delay slot instruction active
BRANCH = 2, // branch instruction active BRANCH = 2, // branch instruction active
EXCEPTION = 3, // exception triggered
} }
m_branch_state; m_branch_state;
u32 m_branch_target; u32 m_branch_target;