From a3f7b2a41524f5c6d3fc145912dcf35568867002 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Tue, 18 Dec 2018 21:04:07 +0700 Subject: mips1: missed this (nw) Make sure the exception target address isn't incremented. --- src/devices/cpu/mips/mips1.cpp | 6 +++++- src/devices/cpu/mips/mips1.h | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/devices/cpu/mips/mips1.cpp b/src/devices/cpu/mips/mips1.cpp index a2a4f94ef06..8483d1d8b2c 100644 --- a/src/devices/cpu/mips/mips1.cpp +++ b/src/devices/cpu/mips/mips1.cpp @@ -284,7 +284,7 @@ void mips1core_device_base::generate_exception(int exception) m_cpr[0][COP0_EPC] -= 4; CAUSE |= 0x80000000; } - m_branch_state = NONE; + m_branch_state = EXCEPTION; // shift the exception bits SR = (SR & 0xffffffc0) | ((SR << 2) & 0x3c); @@ -789,6 +789,10 @@ void mips1core_device_base::execute_run() m_branch_state = DELAY; m_pc += 4; break; + + case EXCEPTION: + m_branch_state = NONE; + break; } }); m_icount--; diff --git a/src/devices/cpu/mips/mips1.h b/src/devices/cpu/mips/mips1.h index 123a8ec2ae1..08c8d1fd95b 100644 --- a/src/devices/cpu/mips/mips1.h +++ b/src/devices/cpu/mips/mips1.h @@ -225,9 +225,10 @@ protected: int m_icount; enum branch_state_t : unsigned { - NONE = 0, - DELAY = 1, // delay slot instruction active - BRANCH = 2, // branch instruction active + NONE = 0, + DELAY = 1, // delay slot instruction active + BRANCH = 2, // branch instruction active + EXCEPTION = 3, // exception triggered } m_branch_state; u32 m_branch_target; -- cgit v1.2.3