From 6f18f0c844ee673d5158859495d7559b02034c11 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 26 Feb 2010 19:21:43 +0200 Subject: [PATCH] JIT slowdown fix --- custom.cpp | 10 ++++++++++ include/custom.h | 2 +- include/events_jit.h | 2 +- include/newcpu.h | 9 +++++---- newcpu.cpp | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/custom.cpp b/custom.cpp index 8501d19f..a9384a65 100644 --- a/custom.cpp +++ b/custom.cpp @@ -3411,6 +3411,16 @@ static void INTENA (uae_u16 v) #endif } +void INTREQ_f (uae_u16 v) +{ + if (use_eventmode (v)) { + send_intreq_do (v); + } else { + intreq |= v; + intreq_internal |= v; + } +} + void INTREQ_0 (uae_u16 v) { uae_u16 old = intreq; diff --git a/include/custom.h b/include/custom.h index 1c0aae6a..f351c284 100644 --- a/include/custom.h +++ b/include/custom.h @@ -76,7 +76,7 @@ extern int joy0button, joy1button; extern void INTREQ (uae_u16); extern void INTREQ_0 (uae_u16); -extern void INTREQ_f (uae_u32); +extern void INTREQ_f (uae_u16); extern void send_interrupt (int num, int delay); extern uae_u16 INTREQR (void); diff --git a/include/events_jit.h b/include/events_jit.h index 123765d7..e01530dc 100644 --- a/include/events_jit.h +++ b/include/events_jit.h @@ -27,7 +27,7 @@ extern signed long pissoff; STATIC_INLINE void cycles_do_special (void) { - if (pissoff > 0) + if (pissoff >= 0) pissoff = -1; } diff --git a/include/newcpu.h b/include/newcpu.h index f59cac77..6be54dfb 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -163,8 +163,6 @@ struct regstruct uae_u32 prefetch020data; uae_u32 prefetch020addr; int ce020memcycles; - evt lastfetch; - }; extern struct regstruct regs; @@ -177,11 +175,14 @@ STATIC_INLINE uae_u32 munge24 (uae_u32 x) extern int mmu_enabled, mmu_triggered; extern int cpu_cycles; extern int cpucycleunit; - +#ifdef JIT +extern uae_u8* compiled_code; +#endif STATIC_INLINE void set_special (uae_u32 x) { regs.spcflags |= x; - cycles_do_special (); + if (compiled_code) + cycles_do_special (); } STATIC_INLINE void unset_special (uae_u32 x) diff --git a/newcpu.cpp b/newcpu.cpp index 95e3a6d3..9b2c6d62 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2987,7 +2987,7 @@ static void m68k_run_jit (void) ((compiled_handler*)(pushall_call_handler))(); /* Whenever we return from that, we should check spcflags */ if (uae_int_requested) { - intreq |= 0x0008; + INTREQ_f (0x8008); set_special (SPCFLAG_INT); } if (regs.spcflags) { -- 2.47.3