From c0fbb0f4c6a902af8afcf2c9d125718d16cf3b35 Mon Sep 17 00:00:00 2001 From: beeanyew Date: Sun, 25 Jul 2021 12:56:43 +0200 Subject: [PATCH] Fix/break IRQ behavior again --- emulator.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emulator.c b/emulator.c index 0282a00..ee43022 100644 --- a/emulator.c +++ b/emulator.c @@ -126,6 +126,7 @@ void *ipl_task(void *args) { pthread_mutex_lock(&lock); while (1) { + blip:; value = *(gpio + 13); if (!(value & (1 << PIN_IPL_ZERO)) || ipl_enabled[amiga_emulated_ipl()]) { @@ -133,8 +134,10 @@ void *ipl_task(void *args) { M68K_END_TIMESLICE; irq = 1; pthread_cond_wait(&cond1, &lock); - irq = 0; + goto blip; } + } else if (irq) { + irq = 0; } if(do_reset==0) { @@ -206,8 +209,7 @@ cpu_loop: } pthread_cond_signal(&cond1); m68k_execute(state, 5); - } - if (!irq && last_last_irq != 0) { + } else if (!irq && last_last_irq != 0) { M68K_SET_IRQ(0); last_last_irq = 0; }