]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
68030 MMU fix: do not assume DOB is not modified by exception handler when DF is...
authorToni Wilen <twilen@winuae.net>
Thu, 29 Nov 2018 17:15:34 +0000 (19:15 +0200)
committerToni Wilen <twilen@winuae.net>
Thu, 29 Nov 2018 17:15:34 +0000 (19:15 +0200)
cpummu30.cpp
newcpu.cpp

index 45729d0895ddff4b697b1cc3f147ee0548fc05e3..88375bf655b0897b119d864c10458873edac091f 100644 (file)
@@ -2712,7 +2712,7 @@ void m68k_do_rte_mmu030 (uaecptr a7)
 
        // Internal register, our opcode storage area
        uae_u32 oc = get_long_mmu030(a7 + 0x14);
-       // Movem write data
+       // Data output buffer
        uae_u32 mmu030_data_buffer_out_v = get_long_mmu030(a7 + 0x18);
        // get_disp_ea_020
        uae_u32 mmu030_disp_store_0 = get_long_mmu030(a7 + 0x1c);
@@ -2831,8 +2831,9 @@ void m68k_do_rte_mmu030 (uaecptr a7)
 #endif
 
 #if 0
-                       write_log(_T("%08x %08x %08x %08x %08x %d %d %d "), mmu030_state[1], mmu030_state[2], mmu030_disp_store[0], mmu030_disp_store[1], addr, read, size, fc);
-                       dump_opcode(mmu030_opcode);
+                       write_log(_T("%08x %08x %08x %08x %08x %d %d %d %08x %08x\n"),
+                               mmu030_state[1], mmu030_state[2], mmu030_disp_store[0], mmu030_disp_store[1],
+                               addr, read, size, fc, mmu030_data_buffer_out, mmu030_ad[idxsize].val);
 #endif
 
                        if (read) {
@@ -2859,6 +2860,8 @@ void m68k_do_rte_mmu030 (uaecptr a7)
                                        mmu030_ad[idxsize].done = true;
                                }
                        } else {
+                               // NeXTstep 1.0a modifies DOB and it must be ignored.
+                               mmu030_data_buffer_out = mmu030_ad[mmu030_idx].val;
                                if (mmu030_state[1] & MMU030_STATEFLAG1_SUBACCESS0) {
                                        mmu030_unaligned_write_continue(addr, fc, mmu030_put_generic);
                                } else {
@@ -3099,7 +3102,7 @@ void m68k_do_rte_mmu030c (uaecptr a7)
 
        // Internal register, our opcode storage area
        uae_u32 oc = get_long_mmu030c(a7 + 0x14);
-       // Movem write data
+       // Data output buffer
        uae_u32 mmu030_data_buffer_out_v = get_long_mmu030c(a7 + 0x18);
        // get_disp_ea_020
        uae_u32 mmu030_disp_store_0 = get_long_mmu030c(a7 + 0x1c);
index 8070bb873d04e6062c9fa5972bd2d55f837d4139..eaf53d85e07f28e632838569b8ee3970fbf5b950 100644 (file)
@@ -3203,6 +3203,10 @@ static void Exception_build_stack_frame (uae_u32 oldpc, uae_u32 currpc, uae_u32
                                write_log(_T("mmu030_idx out of bounds! %d >= %d\n"), mmu030_idx, MAX_MMU030_ACCESS);
                        }
 #endif
+                       if (!(ssw & MMU030_SSW_RW)) {
+                               // NeXTstep 1.0a modifies DOB so store value in storage too.
+                               mmu030_ad[mmu030_idx].val = mmu030_data_buffer_out;
+                       }
                        for (i = 0; i < mmu030_idx + 1; i++) {
                                m68k_areg (regs, 7) -= 4;
                                x_put_long (m68k_areg (regs, 7), mmu030_ad[i].val);