diff --git a/src/devices/cpu/sparc/mb86901.cpp b/src/devices/cpu/sparc/mb86901.cpp index fea2908952f..f575af6ebec 100644 --- a/src/devices/cpu/sparc/mb86901.cpp +++ b/src/devices/cpu/sparc/mb86901.cpp @@ -1071,7 +1071,10 @@ void mb86901_device::execute_rdsr(UINT32 op) } } else if (RDPSR) + { + MAKE_PSR; RDREG = PSR; + } else if (RDWIM) RDREG = WIM; else if (RDTBR) @@ -1171,6 +1174,7 @@ void mb86901_device::execute_wrsr(UINT32 op) { PSR = result &~ PSR_ZERO_MASK; } + BREAK_PSR; } else if (WRWIM) { @@ -2602,6 +2606,7 @@ void mb86901_device::select_trap() m_tt = 0x10 | m_interrupt_level; TBR |= m_tt << 4; + m_trap = 0; m_instruction_access_exception = 0; m_illegal_instruction = 0; m_privileged_instruction = 0; @@ -2719,7 +2724,10 @@ void mb86901_device::execute_trap() { ET = 0; PS = S; + S = 1; CWP = ((CWP + NWINDOWS) - 1) % NWINDOWS; + MAKE_PSR; + update_gpr_pointers(); if (m_annul == 0) { @@ -2733,7 +2741,6 @@ void mb86901_device::execute_trap() m_annul = 0; } - S = 1; if (!m_reset_trap) { PC = TBR; @@ -2746,9 +2753,6 @@ void mb86901_device::execute_trap() m_reset_trap = 0; } } - - MAKE_PSR; - update_gpr_pointers(); } @@ -2949,7 +2953,11 @@ void mb86901_device::execute_step() m_interrupt_level = m_bp_irl; } - if (m_trap) execute_trap(); + if (m_trap) + { + execute_trap(); + debugger_instruction_hook(this, PC); + } if (m_execute_mode) { @@ -3114,7 +3122,7 @@ void mb86901_device::execute_run() continue; } - debugger_instruction_hook(this, m_pc); + debugger_instruction_hook(this, PC); if (m_reset_mode) {