From 5adcc165343cf344cd4bb02da5a0f3839a9fbec3 Mon Sep 17 00:00:00 2001 From: kub Date: Sun, 10 Mar 2024 01:26:06 +0000 Subject: [PATCH] 68k, some fixes for musashi --- cpu/cyclone | 2 +- cpu/musashi/m68kcpu.c | 6 +++--- cpu/musashi/m68kcpu.h | 10 +++++++--- pico/pico_int.h | 3 +++ platform/common/common.mak | 1 + 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cpu/cyclone b/cpu/cyclone index ee45bb2b..3ac7cf1b 160000 --- a/cpu/cyclone +++ b/cpu/cyclone @@ -1 +1 @@ -Subproject commit ee45bb2b10b3abf10a4335ea24fc029e3f61c10a +Subproject commit 3ac7cf1bdeecb60e2414980e8dc72ff092f69769 diff --git a/cpu/musashi/m68kcpu.c b/cpu/musashi/m68kcpu.c index d729f2cf..1415d0d3 100644 --- a/cpu/musashi/m68kcpu.c +++ b/cpu/musashi/m68kcpu.c @@ -787,12 +787,12 @@ void m68k_set_cpu_type(unsigned int cpu_type) /* ASG: removed per-instruction interrupt checks */ int m68k_execute(int num_cycles) { + // notaz + m68ki_check_interrupts(); + /* Make sure we're not stopped */ if(!CPU_STOPPED) { - // notaz - m68ki_check_interrupts(); - /* Set our pool of clock cycles available */ SET_CYCLES(num_cycles); m68ki_initial_cycles = num_cycles; diff --git a/cpu/musashi/m68kcpu.h b/cpu/musashi/m68kcpu.h index 6ab0ba0b..3b40765f 100644 --- a/cpu/musashi/m68kcpu.h +++ b/cpu/musashi/m68kcpu.h @@ -71,8 +71,12 @@ typedef uint8_t UINT8; #define uint32 unsigned int /* AWJ: changed from long to int */ /* signed and unsigned int must be at least 32 bits wide */ -#define sint signed int -#define uint unsigned int +//#define sint signed int +//#define uint unsigned int +#define sint _sint +#define uint _uint +typedef signed int sint; +typedef unsigned int uint; #if M68K_USE_64_BIT @@ -1537,7 +1541,7 @@ INLINE void m68ki_set_sr_noint_nosp(uint value) INLINE void m68ki_set_sr(uint value) { m68ki_set_sr_noint(value); - if (GET_CYCLES() >= 0) // notaz + if (GET_CYCLES() > 0) // notaz m68ki_check_interrupts(); } diff --git a/pico/pico_int.h b/pico/pico_int.h index 80c00fbf..5535e142 100644 --- a/pico/pico_int.h +++ b/pico/pico_int.h @@ -91,6 +91,9 @@ extern M68K_CONTEXT PicoCpuFM68k, PicoCpuFS68k; #ifdef EMU_M68K #include +#undef INLINE +#undef USE_CYCLES +#undef ADD_CYCLES extern m68ki_cpu_core PicoCpuMM68k, PicoCpuMS68k; #ifndef SekCyclesLeft #define SekCyclesLeft PicoCpuMM68k.cyc_remaining_cycles diff --git a/platform/common/common.mak b/platform/common/common.mak index 550de72f..36053129 100644 --- a/platform/common/common.mak +++ b/platform/common/common.mak @@ -207,6 +207,7 @@ $(FR)cpu/cyclone/Cyclone.s: $(FR)cpu/cyclone/*.cpp $(FR)cpu/cyclone/*.h $(FR)cpu/musashi/m68kops.c: @make -C $(R)cpu/musashi +$(FR)cpu/musashi/m68kcpu.c: $(FR)cpu/musashi/m68kops.c deps_set = yes endif # deps_set -- 2.39.2