From: Toni Wilen Date: Wed, 21 Jan 2015 16:07:32 +0000 (+0200) Subject: Update also 040/060 MMU indirect functions to prevent crash if CPU type is changed... X-Git-Tag: 3100~113 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=cecc6bd62a7851bc78b9188161bf70df22546da2;p=francis%2Fwinuae.git Update also 040/060 MMU indirect functions to prevent crash if CPU type is changed on the fly. --- diff --git a/cpummu.cpp b/cpummu.cpp index eec7c75a..a19fcd82 100644 --- a/cpummu.cpp +++ b/cpummu.cpp @@ -1242,10 +1242,10 @@ void REGPARAM2 mmu_flush_atc_all(bool global) } } -void REGPARAM2 mmu_reset(void) +void REGPARAM2 mmu_set_funcs(void) { - mmu_flush_atc_all(true); - + if (currprefs.mmu_model != 68040 && currprefs.mmu_model != 68060) + return; if (currprefs.cpu_cycle_exact || currprefs.cpu_compatible) { x_phys_get_iword = get_word_icache040; x_phys_get_ilong = get_long_icache040; @@ -1267,6 +1267,11 @@ void REGPARAM2 mmu_reset(void) } } +void REGPARAM2 mmu_reset(void) +{ + mmu_flush_atc_all(true); + mmu_set_funcs(); +} void REGPARAM2 mmu_set_tc(uae_u16 tc) { diff --git a/include/cpummu.h b/include/cpummu.h index 54264396..c7c2de91 100644 --- a/include/cpummu.h +++ b/include/cpummu.h @@ -384,6 +384,7 @@ extern void REGPARAM3 mmu_flush_atc_all(bool global) REGPARAM; extern void REGPARAM3 mmu_op_real(uae_u32 opcode, uae_u16 extra) REGPARAM; extern void REGPARAM3 mmu_reset(void) REGPARAM; +extern void REGPARAM3 mmu_set_funcs(void) REGPARAM; extern void REGPARAM3 mmu_set_tc(uae_u16 tc) REGPARAM; extern void REGPARAM3 mmu_set_super(bool super) REGPARAM; diff --git a/newcpu.cpp b/newcpu.cpp index 346a956d..b7f3646f 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1016,6 +1016,7 @@ static void set_x_funcs (void) } set_x_cp_funcs(); + mmu_set_funcs(); mmu030_set_funcs(); }