From 70b583445d9dc40a98c9c7b17b0463ae3d3b78c2 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 12 Feb 2024 21:01:59 +0200 Subject: [PATCH] Fix 68040 MMU MOVES special case --- cpummu.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cpummu.cpp b/cpummu.cpp index 15e512a1..b5ca9a3e 100644 --- a/cpummu.cpp +++ b/cpummu.cpp @@ -400,15 +400,15 @@ void mmu_bus_error(uaecptr addr, uae_u32 val, int fc, bool write, int size,uae_u if (ismoves) { // MOVES special behavior - int fc2 = write ? regs.dfc : regs.sfc; - if (fc2 == 0 || fc2 == 3 || fc2 == 4 || fc2 == 7) + int old_fc = fc = write ? regs.dfc : regs.sfc; + if ((fc & 3) == 0 || (fc & 3) == 3) { ssw |= MMU_SSW_TT1; - if ((fc2 & 3) != 3) - fc2 &= ~2; + } else if (fc & 2) { + fc = (fc & 4) | 1; + } #if MMUDEBUGMISC > 0 - write_log (_T("040 MMU MOVES fc=%d -> %d\n"), fc, fc2); + write_log (_T("040 MMU MOVES fc=%d -> %d\n"), old_fc, fc); #endif - fc = fc2; } ssw |= fc & MMU_SSW_TM; /* TM = FC */ @@ -518,6 +518,7 @@ void mmu_bus_error(uaecptr addr, uae_u32 val, int fc, bool write, int size,uae_u } + ismoves = false; rmw_cycle = false; locked_rmw_cycle = false; regs.mmu_fault_addr = addr; @@ -656,7 +657,7 @@ static uae_u32 mmu_fill_atc(uaecptr addr, bool super, uae_u32 tag, bool write, s int i; int old_s; - // Always use supervisor mode to access descriptors + // Use supervisor mode to access descriptors (really is fc = 7) old_s = regs.s; regs.s = 1; -- 2.47.3