From: Toni Wilen Date: Wed, 16 Aug 2017 07:33:33 +0000 (+0300) Subject: 68030 MMU/no-MMU fixes, some modes used data cache path when data cache was disabled... X-Git-Tag: 3600~121 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=64e25f0fd2ffa16b084f45da0538bf08ebfb7f3a;p=francis%2Fwinuae.git 68030 MMU/no-MMU fixes, some modes used data cache path when data cache was disabled and more.. --- diff --git a/cpummu30.cpp b/cpummu30.cpp index b6405de1..d02c18ff 100644 --- a/cpummu30.cpp +++ b/cpummu30.cpp @@ -78,6 +78,7 @@ struct mmufastcache030 { uae_u32 log; uae_u32 phys; + uae_u8 cs; }; static struct mmufastcache030 atc_data_cache_read[MMUFASTCACHE_ENTRIES030]; static struct mmufastcache030 atc_data_cache_write[MMUFASTCACHE_ENTRIES030]; @@ -1748,6 +1749,7 @@ static void mmu030_add_data_read_cache(uaecptr addr, uaecptr phys, uae_u32 fc) if (idx2 < MMUFASTCACHE_ENTRIES030 - 1) { atc_data_cache_read[idx2].log = idx1; atc_data_cache_read[idx2].phys = phys; + atc_data_cache_read[idx2].cs = mmu030_cache_state; } #endif } @@ -1760,6 +1762,7 @@ static void mmu030_add_data_write_cache(uaecptr addr, uaecptr phys, uae_u32 fc) if (idx2 < MMUFASTCACHE_ENTRIES030 - 1) { atc_data_cache_write[idx2].log = idx1; atc_data_cache_write[idx2].phys = phys; + atc_data_cache_write[idx2].cs = mmu030_cache_state; } #endif } @@ -1942,6 +1945,7 @@ void mmu030_put_long(uaecptr addr, uae_u32 val, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_write[idx2].log == idx1) { addr = atc_data_cache_write[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_write[idx2].cs; } else #endif { @@ -1967,6 +1971,7 @@ void mmu030_put_word(uaecptr addr, uae_u16 val, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_write[idx2].log == idx1) { addr = atc_data_cache_write[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_write[idx2].cs; } else #endif { @@ -1992,6 +1997,7 @@ void mmu030_put_byte(uaecptr addr, uae_u8 val, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_write[idx2].log == idx1) { addr = atc_data_cache_write[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_write[idx2].cs; } else #endif { @@ -2018,6 +2024,7 @@ uae_u32 mmu030_get_long(uaecptr addr, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_read[idx2].log == idx1) { addr = atc_data_cache_read[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_read[idx2].cs; } else #endif { @@ -2043,6 +2050,7 @@ uae_u16 mmu030_get_word(uaecptr addr, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_read[idx2].log == idx1) { addr = atc_data_cache_read[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_read[idx2].cs; } else #endif { @@ -2068,6 +2076,7 @@ uae_u8 mmu030_get_byte(uaecptr addr, uae_u32 fc) uae_u32 idx2 = idx1 & (MMUFASTCACHE_ENTRIES030 - 1); if (atc_data_cache_read[idx2].log == idx1) { addr = atc_data_cache_read[idx2].phys | (addr & mmu030.translation.page.mask); + mmu030_cache_state = atc_data_cache_read[idx2].cs; } else #endif { diff --git a/gencpu.cpp b/gencpu.cpp index b6cfc07d..68cc49ee 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -4012,6 +4012,8 @@ static void gen_opcode (unsigned int opcode) printf ("\tuaecptr pc = %s;\n", getpc); if (using_indirect > 0 && !using_ce020 && !using_prefetch_020 && !using_ce) { printf("\tm68k_do_rtsi_jit ();\n"); + } else if (using_mmu) { + printf ("\tm68k_do_rts_mmu%s ();\n", mmu_postfix); } else if (using_ce020 == 1) { add_head_cycs (1); printf ("\tm68k_do_rts_ce020 ();\n"); @@ -4020,8 +4022,6 @@ static void gen_opcode (unsigned int opcode) printf ("\tm68k_do_rts_ce030 ();\n"); } else if (using_ce) { printf ("\tm68k_do_rts_ce ();\n"); - } else if (using_mmu) { - printf ("\tm68k_do_rts_mmu%s ();\n", mmu_postfix); } else if (using_prefetch || using_prefetch_020) { printf ("\tm68k_do_rtsi ();\n"); } else { @@ -4155,14 +4155,14 @@ static void gen_opcode (unsigned int opcode) addcycles000 (2); if (using_indirect > 0 && !using_ce020 && !using_prefetch_020 && !using_ce) { printf("\tm68k_do_bsri_jit (%s + %d, s);\n", getpc, m68k_pc_offset); + } else if (using_mmu) { + printf ("\tm68k_do_bsr_mmu%s (%s + %d, s);\n", mmu_postfix, getpc, m68k_pc_offset); } else if (using_ce020 == 1) { printf ("\tm68k_do_bsr_ce020 (%s + %d, s);\n", getpc, m68k_pc_offset); } else if (using_ce020 == 2) { printf ("\tm68k_do_bsr_ce030 (%s + %d, s);\n", getpc, m68k_pc_offset); } else if (using_ce) { printf ("\tm68k_do_bsr_ce (%s + %d, s);\n", getpc, m68k_pc_offset); - } else if (using_mmu) { - printf ("\tm68k_do_bsr_mmu%s (%s + %d, s);\n", mmu_postfix, getpc, m68k_pc_offset); } else if (using_prefetch || using_prefetch_020) { printf ("\tm68k_do_bsri (%s + %d, s);\n", getpc, m68k_pc_offset); } else { diff --git a/include/cpu_prefetch.h b/include/cpu_prefetch.h index 1cd69b24..f4b0d3da 100644 --- a/include/cpu_prefetch.h +++ b/include/cpu_prefetch.h @@ -241,27 +241,54 @@ extern void continue_ce030_prefetch(void); extern uae_u32 get_word_ce030_prefetch(int); extern uae_u32 get_word_ce030_prefetch_opcode(int); +STATIC_INLINE uae_u32 get_long_ce030 (uaecptr addr) +{ + return mem_access_delay_long_read_ce020 (addr); +} +STATIC_INLINE uae_u32 get_word_ce030 (uaecptr addr) +{ + return mem_access_delay_word_read_ce020 (addr); +} +STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr) +{ + return mem_access_delay_byte_read_ce020 (addr); +} + STATIC_INLINE void put_long_ce030 (uaecptr addr, uae_u32 v) { - write_dcache030_lput(addr, v, (regs.s ? 4 : 0) | 1); + mem_access_delay_long_write_ce020 (addr, v); } STATIC_INLINE void put_word_ce030 (uaecptr addr, uae_u32 v) { - write_dcache030_wput(addr, v, (regs.s ? 4 : 0) | 1); + mem_access_delay_word_write_ce020 (addr, v); } STATIC_INLINE void put_byte_ce030 (uaecptr addr, uae_u32 v) +{ + mem_access_delay_byte_write_ce020 (addr, v); +} + + +STATIC_INLINE void put_long_dc030 (uaecptr addr, uae_u32 v) +{ + write_dcache030_lput(addr, v, (regs.s ? 4 : 0) | 1); +} +STATIC_INLINE void put_word_dc030 (uaecptr addr, uae_u32 v) +{ + write_dcache030_wput(addr, v, (regs.s ? 4 : 0) | 1); +} +STATIC_INLINE void put_byte_dc030 (uaecptr addr, uae_u32 v) { write_dcache030_bput(addr, v, (regs.s ? 4 : 0) | 1); } -STATIC_INLINE uae_u32 get_long_ce030 (uaecptr addr) +STATIC_INLINE uae_u32 get_long_dc030 (uaecptr addr) { return read_dcache030_lget(addr, (regs.s ? 4 : 0) | 1); } -STATIC_INLINE uae_u32 get_word_ce030 (uaecptr addr) +STATIC_INLINE uae_u32 get_word_dc030 (uaecptr addr) { return read_dcache030_wget(addr, (regs.s ? 4 : 0) | 1); } -STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr) +STATIC_INLINE uae_u32 get_byte_dc030 (uaecptr addr) { return read_dcache030_bget(addr, (regs.s ? 4 : 0) | 1); } @@ -290,12 +317,12 @@ STATIC_INLINE uae_u32 next_ilong_030ce (void) STATIC_INLINE void m68k_do_bsr_ce030 (uaecptr oldpc, uae_s32 offset) { m68k_areg (regs, 7) -= 4; - put_long_ce030 (m68k_areg (regs, 7), oldpc); + x_put_long (m68k_areg (regs, 7), oldpc); m68k_incpci (offset); } STATIC_INLINE void m68k_do_rts_ce030 (void) { - m68k_setpc (get_long_ce030 (m68k_areg (regs, 7))); + m68k_setpc (x_get_long (m68k_areg (regs, 7))); m68k_areg (regs, 7) += 4; } diff --git a/include/cpummu030.h b/include/cpummu030.h index f12b4b1d..631e58e2 100644 --- a/include/cpummu030.h +++ b/include/cpummu030.h @@ -242,7 +242,6 @@ uae_u8 uae_mmu030_check_fc(uaecptr addr, bool write, uae_u32 size); // non-cache - static ALWAYS_INLINE uae_u32 sfc030_get_long(uaecptr addr) { uae_u32 fc = regs.sfc; @@ -506,14 +505,39 @@ extern void m68k_do_rte_mmu030 (uaecptr a7); extern void flush_mmu030 (uaecptr, int); extern void m68k_do_bsr_mmu030 (uaecptr oldpc, uae_s32 offset); -// cache +// more compatible + optional cache + +static ALWAYS_INLINE uae_u32 mmu030_get_fc_byte(uaecptr addr, uae_u32 fc) +{ + return mmu030_get_byte(addr, fc); +} +static ALWAYS_INLINE uae_u32 mmu030_get_fc_word(uaecptr addr, uae_u32 fc) +{ + return mmu030_get_word(addr, fc); +} +static ALWAYS_INLINE uae_u32 mmu030_get_fc_long(uaecptr addr, uae_u32 fc) +{ + return mmu030_get_long(addr, fc); +} +static ALWAYS_INLINE void mmu030_put_fc_byte(uaecptr addr, uae_u32 val, uae_u32 fc) +{ + mmu030_put_byte(addr, val, fc); +} +static ALWAYS_INLINE void mmu030_put_fc_word(uaecptr addr, uae_u32 val, uae_u32 fc) +{ + mmu030_put_word(addr, val, fc); +} +static ALWAYS_INLINE void mmu030_put_fc_long(uaecptr addr, uae_u32 val, uae_u32 fc) +{ + mmu030_put_long(addr, val, fc); +} static ALWAYS_INLINE uae_u32 sfc030c_get_long(uaecptr addr) { #if MMUDEBUG > 2 write_log(_T("sfc030_get_long: FC = %i\n"),fc); #endif - return read_dcache030_lget(addr, regs.sfc); + return read_data_030_fc_lget(addr, regs.sfc); } static ALWAYS_INLINE uae_u16 sfc030c_get_word(uaecptr addr) @@ -521,7 +545,7 @@ static ALWAYS_INLINE uae_u16 sfc030c_get_word(uaecptr addr) #if MMUDEBUG > 2 write_log(_T("sfc030_get_word: FC = %i\n"),fc); #endif - return read_dcache030_wget(addr, regs.sfc); + return read_data_030_fc_wget(addr, regs.sfc); } static ALWAYS_INLINE uae_u8 sfc030c_get_byte(uaecptr addr) @@ -529,7 +553,7 @@ static ALWAYS_INLINE uae_u8 sfc030c_get_byte(uaecptr addr) #if MMUDEBUG > 2 write_log(_T("sfc030_get_byte: FC = %i\n"),fc); #endif - return read_dcache030_bget(addr, regs.sfc); + return read_data_030_fc_bget(addr, regs.sfc); } static ALWAYS_INLINE void dfc030c_put_long(uaecptr addr, uae_u32 val) @@ -537,7 +561,7 @@ static ALWAYS_INLINE void dfc030c_put_long(uaecptr addr, uae_u32 val) #if MMUDEBUG > 2 write_log(_T("dfc030_put_long: %08X = %08X FC = %i\n"), addr, val, fc); #endif - write_dcache030_lput(addr, val, regs.dfc); + write_data_030_fc_lput(addr, val, regs.dfc); } static ALWAYS_INLINE void dfc030c_put_word(uaecptr addr, uae_u16 val) @@ -545,7 +569,7 @@ static ALWAYS_INLINE void dfc030c_put_word(uaecptr addr, uae_u16 val) #if MMUDEBUG > 2 write_log(_T("dfc030_put_word: %08X = %04X FC = %i\n"), addr, val, fc); #endif - write_dcache030_wput(addr, val, regs.dfc); + write_data_030_fc_wput(addr, val, regs.dfc); } static ALWAYS_INLINE void dfc030c_put_byte(uaecptr addr, uae_u8 val) @@ -553,7 +577,7 @@ static ALWAYS_INLINE void dfc030c_put_byte(uaecptr addr, uae_u8 val) #if MMUDEBUG > 2 write_log(_T("dfc030_put_byte: %08X = %02X FC = %i\n"), addr, val, fc); #endif - write_dcache030_bput(addr, val, regs.dfc); + write_data_030_fc_bput(addr, val, regs.dfc); } uae_u32 REGPARAM3 get_disp_ea_020_mmu030c (uae_u32 base, int idx) REGPARAM; diff --git a/include/newcpu.h b/include/newcpu.h index 9d541173..443c9b61 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -538,6 +538,13 @@ extern void(*write_data_030_bput)(uaecptr,uae_u32); extern void(*write_data_030_wput)(uaecptr,uae_u32); extern void(*write_data_030_lput)(uaecptr,uae_u32); +extern uae_u32(*read_data_030_fc_bget)(uaecptr, uae_u32); +extern uae_u32(*read_data_030_fc_wget)(uaecptr, uae_u32); +extern uae_u32(*read_data_030_fc_lget)(uaecptr, uae_u32); +extern void(*write_data_030_fc_bput)(uaecptr, uae_u32, uae_u32); +extern void(*write_data_030_fc_wput)(uaecptr, uae_u32, uae_u32); +extern void(*write_data_030_fc_lput)(uaecptr, uae_u32, uae_u32); + extern void write_dcache030_bput(uaecptr, uae_u32, uae_u32); extern void write_dcache030_wput(uaecptr, uae_u32, uae_u32); extern void write_dcache030_lput(uaecptr, uae_u32, uae_u32); diff --git a/newcpu.cpp b/newcpu.cpp index d70a6736..cc27b3ab 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -786,9 +786,17 @@ uae_u32(*read_data_030_wget)(uaecptr); uae_u32(*read_data_030_lget)(uaecptr); void(*write_data_030_bput)(uaecptr,uae_u32); void(*write_data_030_wput)(uaecptr,uae_u32); - void(*write_data_030_lput)(uaecptr,uae_u32); +void(*write_data_030_lput)(uaecptr,uae_u32); -static void set_x_ifetches(void) +uae_u32(*read_data_030_fc_bget)(uaecptr, uae_u32); +uae_u32(*read_data_030_fc_wget)(uaecptr, uae_u32); +uae_u32(*read_data_030_fc_lget)(uaecptr, uae_u32); +void(*write_data_030_fc_bput)(uaecptr, uae_u32, uae_u32); +void(*write_data_030_fc_wput)(uaecptr, uae_u32, uae_u32); +void(*write_data_030_fc_lput)(uaecptr, uae_u32, uae_u32); + + + static void set_x_ifetches(void) { if (m68k_pc_indirect) { if (currprefs.cachesize) { @@ -859,12 +867,6 @@ static void set_x_funcs (void) x_get_ibyte = NULL; x_next_iword = next_iword_mmu030c_state; x_next_ilong = next_ilong_mmu030c_state; - x_put_long = put_long_ce030; - x_put_word = put_word_ce030; - x_put_byte = put_byte_ce030; - x_get_long = get_long_ce030; - x_get_word = get_word_ce030; - x_get_byte = get_byte_ce030; x_do_cycles = do_cycles; x_do_cycles_pre = do_cycles; x_do_cycles_post = do_cycles_post; @@ -875,12 +877,6 @@ static void set_x_funcs (void) x_get_ibyte = NULL; x_next_iword = next_iword_mmu030c_state; x_next_ilong = next_ilong_mmu030c_state; - x_put_long = put_long_ce030; - x_put_word = put_word_ce030; - x_put_byte = put_byte_ce030; - x_get_long = get_long_ce030; - x_get_word = get_word_ce030; - x_get_byte = get_byte_ce030; x_do_cycles = do_cycles; x_do_cycles_pre = do_cycles; x_do_cycles_post = do_cycles_post; @@ -891,12 +887,20 @@ static void set_x_funcs (void) x_get_ibyte = get_ibyte_mmu030; x_next_iword = next_iword_mmu030; x_next_ilong = next_ilong_mmu030; - x_put_long = put_long_mmu030; - x_put_word = put_word_mmu030; - x_put_byte = put_byte_mmu030; - x_get_long = get_long_mmu030; - x_get_word = get_word_mmu030; - x_get_byte = get_byte_mmu030; + } + x_put_long = put_long_mmu030; + x_put_word = put_word_mmu030; + x_put_byte = put_byte_mmu030; + x_get_long = get_long_mmu030; + x_get_word = get_word_mmu030; + x_get_byte = get_byte_mmu030; + if (currprefs.cpu_data_cache) { + x_put_long = put_long_dc030; + x_put_word = put_word_dc030; + x_put_byte = put_byte_dc030; + x_get_long = get_long_dc030; + x_get_word = get_word_dc030; + x_get_byte = get_byte_dc030; } } @@ -1167,12 +1171,21 @@ static void set_x_funcs (void) x_get_ibyte = NULL; x_next_iword = next_iword_030ce; x_next_ilong = next_ilong_030ce; - x_put_long = put_long_ce030; - x_put_word = put_word_ce030; - x_put_byte = put_byte_ce030; - x_get_long = get_long_ce030; - x_get_word = get_word_ce030; - x_get_byte = get_byte_ce030; + if (currprefs.cpu_data_cache) { + x_put_long = put_long_dc030; + x_put_word = put_word_dc030; + x_put_byte = put_byte_dc030; + x_get_long = get_long_dc030; + x_get_word = get_word_dc030; + x_get_byte = get_byte_dc030; + } else { + x_put_long = put_long_ce030; + x_put_word = put_word_ce030; + x_put_byte = put_byte_ce030; + x_get_long = get_long_ce030; + x_get_word = get_word_ce030; + x_get_byte = get_byte_ce030; + } x_do_cycles = do_cycles_ce020; x_do_cycles_pre = do_cycles_ce020; x_do_cycles_post = do_cycles_ce020_post; @@ -1289,6 +1302,13 @@ static void set_x_funcs (void) write_data_030_bput = write_dcache030_mmu_bput; write_data_030_wput = write_dcache030_mmu_wput; write_data_030_lput = write_dcache030_mmu_lput; + + read_data_030_fc_bget = read_dcache030_bget; + read_data_030_fc_wget = read_dcache030_wget; + read_data_030_fc_lget = read_dcache030_lget; + write_data_030_fc_bput = write_dcache030_bput; + write_data_030_fc_wput = write_dcache030_wput; + write_data_030_fc_lput = write_dcache030_lput; } else { read_data_030_bget = dcache_bget; read_data_030_wget = dcache_wget; @@ -1296,26 +1316,27 @@ static void set_x_funcs (void) write_data_030_bput = dcache_bput; write_data_030_wput = dcache_wput; write_data_030_lput = dcache_lput; + + read_data_030_fc_bget = mmu030_get_fc_byte; + read_data_030_fc_wget = mmu030_get_fc_word; + read_data_030_fc_lget = mmu030_get_fc_long; + write_data_030_fc_bput = mmu030_put_fc_byte; + write_data_030_fc_wput = mmu030_put_fc_word; + write_data_030_fc_lput = mmu030_put_fc_long; } + if (currprefs.mmu_model) { if (currprefs.cpu_compatible) { icache_fetch = uae_mmu030_get_ilong_fc; - dcache_lput = uae_mmu030_put_long_fc; - dcache_wput = uae_mmu030_put_word_fc; - dcache_bput = uae_mmu030_put_byte_fc; - dcache_lget = uae_mmu030_get_long_fc; - dcache_wget = uae_mmu030_get_word_fc; - dcache_bget = uae_mmu030_get_byte_fc; - dcache_check = uae_mmu030_check_fc; } else { icache_fetch = uae_mmu030_get_ilong; - dcache_lput = uae_mmu030_put_long; - dcache_wput = uae_mmu030_put_word; - dcache_bput = uae_mmu030_put_byte; - dcache_lget = uae_mmu030_get_long; - dcache_wget = uae_mmu030_get_word; - dcache_bget = uae_mmu030_get_byte; } + dcache_lput = uae_mmu030_put_long; + dcache_wput = uae_mmu030_put_word; + dcache_bput = uae_mmu030_put_byte; + dcache_lget = uae_mmu030_get_long; + dcache_wget = uae_mmu030_get_word; + dcache_bget = uae_mmu030_get_byte; if (currprefs.cpu_data_cache) { read_data_030_bget = read_dcache030_mmu_bget; read_data_030_wget = read_dcache030_mmu_wget; @@ -1323,22 +1344,20 @@ static void set_x_funcs (void) write_data_030_bput = write_dcache030_mmu_bput; write_data_030_wput = write_dcache030_mmu_wput; write_data_030_lput = write_dcache030_mmu_lput; + dcache_lput = uae_mmu030_put_long_fc; + dcache_wput = uae_mmu030_put_word_fc; + dcache_bput = uae_mmu030_put_byte_fc; + dcache_lget = uae_mmu030_get_long_fc; + dcache_wget = uae_mmu030_get_word_fc; + dcache_bget = uae_mmu030_get_byte_fc; + dcache_check = uae_mmu030_check_fc; } else { - if (currprefs.cpu_compatible) { - read_data_030_bget = uae_mmu030_get_byte_fc; - read_data_030_wget = uae_mmu030_get_word_fc; - read_data_030_lget = uae_mmu030_get_long_fc; - write_data_030_bput = uae_mmu030_put_byte_fc; - write_data_030_wput = uae_mmu030_put_word_fc; - write_data_030_lput = uae_mmu030_put_long_fc; - } else { - read_data_030_bget = uae_mmu030_get_byte; - read_data_030_wget = uae_mmu030_get_word; - read_data_030_lget = uae_mmu030_get_long; - write_data_030_bput = uae_mmu030_put_byte; - write_data_030_wput = uae_mmu030_put_word; - write_data_030_lput = uae_mmu030_put_long; - } + read_data_030_bget = uae_mmu030_get_byte; + read_data_030_wget = uae_mmu030_get_word; + read_data_030_lget = uae_mmu030_get_long; + write_data_030_bput = uae_mmu030_put_byte; + write_data_030_wput = uae_mmu030_put_word; + write_data_030_lput = uae_mmu030_put_long; } } else if (currprefs.cpu_memory_cycle_exact) { icache_fetch = mem_access_delay_longi_read_ce020; @@ -9359,22 +9378,39 @@ void write_dcache030_mmu_lput(uaecptr addr, uae_u32 val) uae_u32 read_dcache030_lrmw_mmu(uaecptr addr, uae_u32 size) { - mmu030_cache_state = CACHE_DISABLE_MMU; - if (size == 0) - return read_dcache030_bget(addr, (regs.s ? 4 : 0) | 1); - if (size == 1) - return read_dcache030_wget(addr, (regs.s ? 4 : 0) | 1); - return read_dcache030_lget(addr, (regs.s ? 4 : 0) | 1); + if (currprefs.cpu_data_cache) { + mmu030_cache_state = CACHE_DISABLE_MMU; + if (size == 0) + return read_dcache030_bget(addr, (regs.s ? 4 : 0) | 1); + if (size == 1) + return read_dcache030_wget(addr, (regs.s ? 4 : 0) | 1); + return read_dcache030_lget(addr, (regs.s ? 4 : 0) | 1); + } else { + if (size == 0) + return read_data_030_bget(addr); + if (size == 1) + return read_data_030_wget(addr); + return read_data_030_lget(addr); + } } void write_dcache030_lrmw_mmu(uaecptr addr, uae_u32 val, uae_u32 size) { - mmu030_cache_state = CACHE_DISABLE_MMU; - if (size == 0) - write_dcache030_bput(addr, val, (regs.s ? 4 : 0) | 1); - else if (size == 1) - write_dcache030_wput(addr, val, (regs.s ? 4 : 0) | 1); - else - write_dcache030_lput(addr, val, (regs.s ? 4 : 0) | 1); + if (currprefs.cpu_data_cache) { + mmu030_cache_state = CACHE_DISABLE_MMU; + if (size == 0) + write_dcache030_bput(addr, val, (regs.s ? 4 : 0) | 1); + else if (size == 1) + write_dcache030_wput(addr, val, (regs.s ? 4 : 0) | 1); + else + write_dcache030_lput(addr, val, (regs.s ? 4 : 0) | 1); + } else { + if (size == 0) + write_data_030_bput(addr, val); + else if (size == 1) + write_data_030_wput(addr, val); + else + write_data_030_lput(addr, val); + } } static void do_access_or_bus_error(uaecptr pc, uaecptr pcnow)