]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Add extra cycles to prevent hang if all code and data in a loop is cached.
authorToni Wilen <twilen@winuae.net>
Sat, 6 Jan 2018 18:34:05 +0000 (20:34 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 6 Jan 2018 18:34:05 +0000 (20:34 +0200)
newcpu.cpp

index 474df49a312bb686494e0c3885c525b5f3ba8c5f..b2c86d6f58778793a675279083a05d5d98cf6844 100644 (file)
@@ -5750,6 +5750,7 @@ static void m68k_run_3ce (void)
 {
        struct regstruct *r = &regs;
        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();