From 586066d891669e9534e2eab7418a4b66276ee8bb Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 2 Sep 2021 15:24:17 +0200 Subject: [PATCH] Made NMI's always auto-clear, will revert if it makes things worse. --- src/cpu/386.c | 4 ++++ src/cpu/386_dynarec.c | 4 ++++ src/cpu/808x.c | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/cpu/386.c b/src/cpu/386.c index 743989e47..86327e5de 100644 --- a/src/cpu/386.c +++ b/src/cpu/386.c @@ -195,10 +195,14 @@ exec386(int cycs) cpu_state.oldpc = cpu_state.pc; x86_int(2); nmi_enable = 0; +#ifdef OLD_NMI_BEHAVIOR if (nmi_auto_clear) { nmi_auto_clear = 0; nmi = 0; } +#else + nmi = 0; +#endif } else if ((cpu_state.flags & I_FLAG) && pic.int_pending && !cpu_end_block_after_ins) { vector = picinterrupt(); if (vector != -1) { diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index a15e7a291..d396d122a 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -797,10 +797,14 @@ exec386_dynarec(int cycs) cpu_state.oldpc = cpu_state.pc; x86_int(2); nmi_enable = 0; +#ifdef OLD_NMI_BEHAVIOR if (nmi_auto_clear) { nmi_auto_clear = 0; nmi = 0; } +#else + nmi = 0; +#endif } else if ((cpu_state.flags & I_FLAG) && pic.int_pending) { vector = picinterrupt(); if (vector != -1) { diff --git a/src/cpu/808x.c b/src/cpu/808x.c index 329ebe25f..3fbcfb0ed 100644 --- a/src/cpu/808x.c +++ b/src/cpu/808x.c @@ -968,6 +968,9 @@ check_interrupts(void) if (nmi && nmi_enable && nmi_mask) { nmi_enable = 0; interrupt(2); +#ifndef OLD_NMI_BEHAVIOR + nmi = 0; +#endif return; } if ((cpu_state.flags & I_FLAG) && pic.int_pending && !noint) {