From bad31ea61c58d6564d3b8df0ac2ea8360d75e184 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Mon, 9 Jul 2018 21:59:50 +0200 Subject: [PATCH] Gross fix (nw) --- src/devices/cpu/m68000/m68kcpu.cpp | 5 +++-- src/devices/cpu/m68000/m68kcpu.h | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index d11eab56958..f7a162ccde0 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -670,7 +670,7 @@ void m68000_base_device::postload() void m68000_base_device::m68k_cause_bus_error() { // Halt the cpu on berr when writing the stack frame. - if (m_run_mode == RUN_MODE_BERR_AERR_RESET) + if (m_run_mode == RUN_MODE_BERR_AERR_RESET_WSF) { m_stopped = STOP_LEVEL_HALT; return; @@ -678,7 +678,7 @@ void m68000_base_device::m68k_cause_bus_error() uint32_t sr = m68ki_init_exception(); - m_run_mode = RUN_MODE_BERR_AERR_RESET; + m_run_mode = RUN_MODE_BERR_AERR_RESET_WSF; if (!CPU_TYPE_IS_010_PLUS()) { @@ -700,6 +700,7 @@ void m68000_base_device::m68k_cause_bus_error() } m68ki_jump_vector(EXCEPTION_BUS_ERROR); + m_run_mode = RUN_MODE_BERR_AERR_RESET; } bool m68000_base_device::memory_translate(int space, int intention, offs_t &address) diff --git a/src/devices/cpu/m68000/m68kcpu.h b/src/devices/cpu/m68000/m68kcpu.h index 42717f8a3a2..d8ad6ef2c2f 100644 --- a/src/devices/cpu/m68000/m68kcpu.h +++ b/src/devices/cpu/m68000/m68kcpu.h @@ -88,8 +88,9 @@ static constexpr int INSTRUCTION_NO = 0x08; static constexpr int MODE_READ = 0x10; static constexpr int MODE_WRITE = 0; -static constexpr int RUN_MODE_NORMAL = 0; -static constexpr int RUN_MODE_BERR_AERR_RESET = 1; +static constexpr int RUN_MODE_NORMAL = 0; +static constexpr int RUN_MODE_BERR_AERR_RESET_WSF = 1; // writing the stack frame +static constexpr int RUN_MODE_BERR_AERR_RESET = 2; // stack frame done @@ -1516,13 +1517,14 @@ inline void m68ki_exception_address_error() * this is a catastrophic failure. * Halt the CPU */ - if(m_run_mode == RUN_MODE_BERR_AERR_RESET) + if(m_run_mode == RUN_MODE_BERR_AERR_RESET_WSF) { m_read8(0x00ffff01); m_stopped = STOP_LEVEL_HALT; return; } - m_run_mode = RUN_MODE_BERR_AERR_RESET; + + m_run_mode = RUN_MODE_BERR_AERR_RESET_WSF; if (!CPU_TYPE_IS_010_PLUS()) { @@ -1545,6 +1547,8 @@ inline void m68ki_exception_address_error() m68ki_jump_vector(EXCEPTION_ADDRESS_ERROR); + m_run_mode = RUN_MODE_BERR_AERR_RESET; + /* Use up some clock cycles and undo the instruction's cycles */ m_remaining_cycles -= m_cyc_exception[EXCEPTION_ADDRESS_ERROR] - m_cyc_instruction[m_ir]; }