From f99f0794cfead83330c88b2085bd5dd38439c911 Mon Sep 17 00:00:00 2001 From: kub Date: Wed, 19 May 2021 19:18:36 +0200 Subject: [PATCH] sh2 interpreter, minor improvement for irq handling --- cpu/sh2/mame/sh2pico.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cpu/sh2/mame/sh2pico.c b/cpu/sh2/mame/sh2pico.c index b8a1a367..f4ae85cb 100644 --- a/cpu/sh2/mame/sh2pico.c +++ b/cpu/sh2/mame/sh2pico.c @@ -167,14 +167,16 @@ int sh2_execute_interpreter(SH2 *sh2, int cycles) sh2->icount--; - if (sh2->test_irq && !sh2->delay && sh2->pending_level > ((sh2->sr >> 4) & 0x0f)) + if (sh2->test_irq && !sh2->delay) { int level = sh2->pending_level; - int vector = sh2->irq_callback(sh2, level); - sh2_do_irq(sh2, level, vector); + if (level > ((sh2->sr >> 4) & 0x0f)) + { + int vector = sh2->irq_callback(sh2, level); + sh2_do_irq(sh2, level, vector); + } sh2->test_irq = 0; } - } while (sh2->icount > 0 || sh2->delay); /* can't interrupt before delay */ -- 2.39.5