]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Memory cycle exact limited CPU speed adjustment.
authorToni Wilen <twilen@winuae.net>
Mon, 11 Dec 2017 19:48:00 +0000 (21:48 +0200)
committerToni Wilen <twilen@winuae.net>
Mon, 11 Dec 2017 19:48:00 +0000 (21:48 +0200)
newcpu.cpp

index 96dc74fc076f24252207db19d17e99fa376a3ed9..c0892dedf320c577fa1087d8f479c44303d3355b 100644 (file)
@@ -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);