From: Toni Wilen Date: Thu, 10 Dec 2015 15:35:03 +0000 (+0200) Subject: Check interrupt level increase before executing any instructions. X-Git-Tag: 3220~26 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=85d7bba8392f7bcaf703413f68309ef912a5efe5;p=francis%2Fwinuae.git Check interrupt level increase before executing any instructions. --- diff --git a/newcpu.cpp b/newcpu.cpp index 5372facc..6aeae012 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2330,6 +2330,8 @@ kludge_me_do: m68k_setpc (newpc); regs.ir = x_get_word (m68k_getpc ()); // prefetch 1 x_do_cycles (2 * cpucycleunit); + regs.ipl_pin = intlev(); + ipl_fetch(); regs.irc = x_get_word (m68k_getpc () + 2); // prefetch 2 #ifdef JIT set_special (SPCFLAG_END_COMPILE); @@ -2944,9 +2946,19 @@ static void do_interrupt (int nr) unset_special (SPCFLAG_STOP); assert (nr < 8 && nr >= 0); - Exception (nr + 24); + for (;;) { + Exception (nr + 24); + regs.intmask = nr; + if (!currprefs.cpu_compatible) + break; + if (m68k_interrupt_delay) + nr = regs.ipl; + else + nr = intlev(); + if (nr <= 0 || regs.intmask >= nr) + break; + } - regs.intmask = nr; doint (); }