From 16e325b30a09f996d2d86efdab5205d8c50db932 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 1 Jan 2024 18:47:30 +0200 Subject: [PATCH] Fix 68040/060 bus error RTE + Trace. --- cpummu.cpp | 3 ++- newcpu.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cpummu.cpp b/cpummu.cpp index 292431a1..15e512a1 100644 --- a/cpummu.cpp +++ b/cpummu.cpp @@ -1563,7 +1563,7 @@ void m68k_do_rte_mmu040 (uaecptr a7) write_log (_T("MMU restarted MOVEM EA=%08X\n"), mmu040_movem_ea); #endif } - if (currprefs.mmu_model == 68060 || mmu_restart) { + if (mmu_restart) { set_special(SPCFLAG_MMURESTART); } } @@ -1573,6 +1573,7 @@ void m68k_do_rte_mmu060 (uaecptr a7) #if 0 mmu060_state = 2; #endif + set_special(SPCFLAG_MMURESTART); } void flush_mmu040 (uaecptr addr, int n) diff --git a/newcpu.cpp b/newcpu.cpp index 0017dd55..c1b5685f 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -4728,6 +4728,10 @@ static int do_specialties (int cycles) if (spcflags & SPCFLAG_MMURESTART) { // can't have interrupt when 040/060 CPU reruns faulted instruction unset_special(SPCFLAG_MMURESTART); + + if (spcflags & SPCFLAG_TRACE) { + do_trace(); + } } else { if (spcflags & SPCFLAG_DOTRACE) { @@ -4758,7 +4762,7 @@ static int do_specialties (int cycles) if (spcflags & SPCFLAG_INT) { int intr = intlev(); unset_special (SPCFLAG_INT | SPCFLAG_DOINT); - if (intr > 0 && (intr > regs.intmask || intr == 7)) + if (intr > regs.intmask || intr == 7) do_interrupt(intr); } } -- 2.47.3