From: Toni Wilen Date: Mon, 11 Dec 2017 19:48:00 +0000 (+0200) Subject: Memory cycle exact limited CPU speed adjustment. X-Git-Tag: 3600~35 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f65f3a2117680db6466253d0ffdf73a2e9edd081;p=francis%2Fwinuae.git Memory cycle exact limited CPU speed adjustment. --- diff --git a/newcpu.cpp b/newcpu.cpp index 96dc74fc..c0892ded 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -6024,15 +6024,21 @@ static void m68k_run_2p (void) inprec_playdebug_cpu (1); } + if (cpu_cycles > 0) + x_do_cycles(cpu_cycles); + if (currprefs.cpu_memory_cycle_exact) { (*cpufunctbl[r->opcode])(r->opcode); - cpu_cycles = 0; + // 0% = no extra cycles + cpu_cycles = 4 * CYCLE_UNIT * cycles_mult; + cpu_cycles /= CYCLES_DIV; + cpu_cycles -= CYCLE_UNIT; + if (cpu_cycles < 0) + cpu_cycles = 0; } else { - x_do_cycles (cpu_cycles); - cpu_cycles = (*cpufunctbl[r->opcode])(r->opcode); cpu_cycles = adjust_cycles (cpu_cycles);