From 8719e899225fdb9915a5181ed20807b019be6df2 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 6 Jan 2018 20:34:05 +0200 Subject: [PATCH] Add extra cycles to prevent hang if all code and data in a loop is cached. --- newcpu.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/newcpu.cpp b/newcpu.cpp index 474df49a..b2c86d6f 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -5750,6 +5750,7 @@ static void m68k_run_3ce (void) { struct regstruct *r = ®s; bool exit = false; + int extracycles = 0; while (!exit) { TRY(prb) { @@ -5766,6 +5767,13 @@ static void m68k_run_3ce (void) if (do_specialties (0)) exit = true; } + + // workaround for situation when all accesses are cached + extracycles++; + if (extracycles >= 8) { + extracycles = 0; + x_do_cycles(CYCLE_UNIT); + } } } CATCH(prb) { bus_error(); -- 2.47.3