From: Toni Wilen Date: Wed, 29 Jul 2020 14:38:06 +0000 (+0300) Subject: Emulate T1/T0/M normally if JIT mode. X-Git-Tag: 4900~331 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b8991e9ebca155686021c40b145027dd7762e93b;p=francis%2Fwinuae.git Emulate T1/T0/M normally if JIT mode. --- diff --git a/newcpu.cpp b/newcpu.cpp index 32adbe34..14cedb37 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2385,6 +2385,13 @@ static void MakeFromSR_x(int t0trace) if (currprefs.mmu_model) mmu_set_super (regs.s != 0); +#ifdef JIT + // if JIT enabled and T1, T0 or M changes: end compile. + if (currprefs.cachesize && (oldt0 != regs.t0 || oldt1 != regs.t1 || oldm != regs.m)) { + set_special(SPCFLAG_END_COMPILE); + } +#endif + doint_imm(); if (regs.t1 || regs.t0) { set_special (SPCFLAG_TRACE); @@ -5333,8 +5340,26 @@ static void m68k_run_jit(void) return; } } + // If T0, T1 or M got set: run normal emulation loop + if (regs.t0 || regs.t1 || regs.m) { + flush_icache(3); + struct regstruct *r = ®s; + bool exit = false; + check_debugger(); + while (!exit && (regs.t0 || regs.t1 || regs.m)) { + r->instruction_pc = m68k_getpc(); + r->opcode = x_get_iword(0); + (*cpufunctbl[r->opcode])(r->opcode); + count_instr(r->opcode); + do_cycles(4 * CYCLE_UNIT); + if (r->spcflags) { + if (do_specialties(cpu_cycles)) + exit = true; + } + } + unset_special(SPCFLAG_END_COMPILE); + } } - #ifdef USE_STRUCTURED_EXCEPTION_HANDLING } __except (EvalException(GetExceptionInformation())) { // Something very bad happened, generate fake bus error exception