]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix 68040 MMU MOVES special case
authorToni Wilen <twilen@winuae.net>
Mon, 12 Feb 2024 19:01:59 +0000 (21:01 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 12 Feb 2024 19:01:59 +0000 (21:01 +0200)
cpummu.cpp

index 15e512a1746caff2ebae7c65d59ab99193820ece..b5ca9a3e982e21143965a73ecb831622200c68ac 100644 (file)
@@ -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;