diff options
author | DavidHaywood <28625134+DavidHaywood@users.noreply.github.com> | 2018-08-03 00:23:32 +0100 |
---|---|---|
committer | Vas Crabb <cuavas@users.noreply.github.com> | 2018-08-03 09:38:59 +1000 |
commit | c1b84b9e30a773eefaf50a82983e89fc0ba7cebf (patch) | |
tree | bfae47d00cc8fc37c37d530b563a94441f9e2cef | |
parent | ae110ad5e6496797f2fb4a47369705209bc046e3 (diff) |
fix silly PSW trashing on interrupts, allow Register Bank to be shown in debugger
code now gets to the 'main loop' (starts at C3E0, jumps back there once it hits C6A3) and continues to execute that loop once it arrives there.
-rw-r--r-- | src/devices/cpu/tlcs870/tlcs870.cpp | 11 | ||||
-rw-r--r-- | src/devices/cpu/tlcs870/tlcs870.h | 3 | ||||
-rw-r--r-- | src/devices/cpu/tlcs870/tlcs870_ops.cpp | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/devices/cpu/tlcs870/tlcs870.cpp b/src/devices/cpu/tlcs870/tlcs870.cpp index 42b320e33cb..39518fd1f50 100644 --- a/src/devices/cpu/tlcs870/tlcs870.cpp +++ b/src/devices/cpu/tlcs870/tlcs870.cpp @@ -955,7 +955,7 @@ void tlcs870_device::take_interrupt(int priority) uint16_t vector = RM16(0xffe0 + ((15-priority)*2)); - WM16(m_sp.d - 1, get_PSW()); + WM8(m_sp.d, get_PSW()); WM16(m_sp.d - 2, m_addr); m_sp.d -= 3; @@ -1107,6 +1107,10 @@ void tlcs870_device::state_import(const device_state_entry &entry) case DEBUGGER_REG_HL: set_reg16(REG_HL, m_debugger_temp); break; + + case DEBUGGER_REG_RB: + m_RBS = m_debugger_temp; + break; } } @@ -1163,6 +1167,10 @@ void tlcs870_device::state_export(const device_state_entry &entry) m_debugger_temp = get_reg16(REG_HL); break; + case DEBUGGER_REG_RB: + m_debugger_temp = m_RBS; + break; + } } @@ -1190,6 +1198,7 @@ void tlcs870_device::device_start() state_add(DEBUGGER_REG_DE, "DE", m_debugger_temp).callimport().callexport().formatstr("%04X"); state_add(DEBUGGER_REG_HL, "HL", m_debugger_temp).callimport().callexport().formatstr("%04X"); + state_add(DEBUGGER_REG_RB, "RB", m_debugger_temp).callimport().callexport().formatstr("%01X"); state_add(STATE_GENPC, "GENPC", m_pc.w.l).formatstr("%04X"); state_add(STATE_GENPCBASE, "CURPC", m_prvpc.w.l).formatstr("%04X").noshow(); diff --git a/src/devices/cpu/tlcs870/tlcs870.h b/src/devices/cpu/tlcs870/tlcs870.h index 46a63bbe96e..aeeac11f0eb 100644 --- a/src/devices/cpu/tlcs870/tlcs870.h +++ b/src/devices/cpu/tlcs870/tlcs870.h @@ -126,7 +126,8 @@ private: DEBUGGER_REG_WA, DEBUGGER_REG_BC, DEBUGGER_REG_DE, - DEBUGGER_REG_HL + DEBUGGER_REG_HL, + DEBUGGER_REG_RB }; enum _conditions diff --git a/src/devices/cpu/tlcs870/tlcs870_ops.cpp b/src/devices/cpu/tlcs870/tlcs870_ops.cpp index af29550cdf5..3a14f319ae2 100644 --- a/src/devices/cpu/tlcs870/tlcs870_ops.cpp +++ b/src/devices/cpu/tlcs870/tlcs870_ops.cpp @@ -208,7 +208,7 @@ void tlcs870_device::do_RETI(const uint8_t opbyte0) m_sp.d += 3; m_addr = RM16(m_sp.d - 2); - set_PSW(RM8(m_sp.d - 1)); + set_PSW(RM8(m_sp.d)); // Interrupts always get reenabled after a RETI. The RETN behavior is different m_EIR |= 1; |