From 38324ac31caf417e5168d686730e4e143d8758d5 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 23 Sep 2022 20:12:58 -0400 Subject: h8, sh2: Add exception hook calls --- src/devices/cpu/h8/h8.lst | 4 ++++ src/devices/cpu/sh/sh2.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/devices/cpu/h8/h8.lst b/src/devices/cpu/h8/h8.lst index b7a7dae3ecf..6c0cd069c11 100644 --- a/src/devices/cpu/h8/h8.lst +++ b/src/devices/cpu/h8/h8.lst @@ -120,6 +120,7 @@ macro jsr32 %opc %spreg TMP1 = r16_r(7) - 2; r16_w(7, TMP1); write16(TMP1, (CCR << 8) | ((PC >> 16) & 0xff)); + debugger_exception_hook(taken_irq_vector); PC = read16i(2*taken_irq_vector); internal(1); irq_setup(); @@ -140,6 +141,7 @@ macro jsr32 %opc %spreg r32_w(7, TMP1); write16(TMP1, EXR << 8); } + debugger_exception_hook(taken_irq_vector); if(mode_advanced) { IR[0] = read16i(4*taken_irq_vector); IR[1] = read16i(4*taken_irq_vector+2); @@ -165,6 +167,7 @@ macro jsr32 %opc %spreg r32_w(7, TMP1); write16(TMP1, EXR << 8); taken_irq_vector = trace_setup(); + debugger_exception_hook(taken_irq_vector); if(mode_advanced) { IR[0] = read16i(4*taken_irq_vector); IR[1] = read16i(4*taken_irq_vector+2); @@ -1588,6 +1591,7 @@ macro jsr32 %opc %spreg write16(TMP1, EXR << 8); } taken_irq_vector = trapa_setup() + ((IR[0] >> 4) & 3); + debugger_exception_hook(taken_irq_vector); if(mode_advanced) { IR[0] = read16i(4*taken_irq_vector); IR[1] = read16i(4*taken_irq_vector+2); diff --git a/src/devices/cpu/sh/sh2.cpp b/src/devices/cpu/sh/sh2.cpp index 63a981b754b..c117afadbe0 100644 --- a/src/devices/cpu/sh/sh2.cpp +++ b/src/devices/cpu/sh/sh2.cpp @@ -394,6 +394,7 @@ inline void sh2_device::RTE() inline void sh2_device::TRAPA(uint32_t i) { uint32_t imm = i & 0xff; + debugger_exception_hook(imm); m_sh2_state->ea = m_sh2_state->vbr + imm * 4; @@ -411,6 +412,8 @@ inline void sh2_device::TRAPA(uint32_t i) inline void sh2_device::ILLEGAL() { //logerror("Illegal opcode at %08x\n", m_sh2_state->pc - 2); + debugger_exception_hook(4); + m_sh2_state->r[15] -= 4; WL( m_sh2_state->r[15], m_sh2_state->sr ); /* push SR onto stack */ m_sh2_state->r[15] -= 4; @@ -814,6 +817,7 @@ void sh2_device::sh2_exception(const char *message, int irqline) vector = 11; LOG("SH-2 nmi exception (autovector: $%x) after [%s]\n", vector, message); } + debugger_exception_hook(vector); if (m_isdrc) { -- cgit v1.2.3