From 02e9a3ad5585b5357bd9c91e0fe4c41ae71bf447 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 17 Nov 2020 20:00:28 +0100 Subject: [PATCH] Reverted a bad change to cpu/386.c, fixes freezes and mysterious behavior on the Interpreter. --- src/cpu/386.c | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/cpu/386.c b/src/cpu/386.c index ade157a32..fe05bb02e 100644 --- a/src/cpu/386.c +++ b/src/cpu/386.c @@ -257,6 +257,30 @@ exec386(int cycs) if (!use32) cpu_state.pc &= 0xffff; #endif + if (cpu_state.abrt) { + flags_rebuild(); + tempi = cpu_state.abrt & ABRT_MASK; + cpu_state.abrt = 0; + x86_doabrt(tempi); + if (cpu_state.abrt) { + cpu_state.abrt = 0; +#ifndef USE_NEW_DYNAREC + CS = oldcs; +#endif + cpu_state.pc = cpu_state.oldpc; + x386_log("Double fault %i\n", ins); + pmodeint(8, 0); + if (cpu_state.abrt) { + cpu_state.abrt = 0; + softresetx86(); + cpu_set_edx(); +#ifdef ENABLE_386_LOG + x386_log("Triple fault - reset\n"); +#endif + } + } + } + ins_cycles -= cycles; tsc += ins_cycles; @@ -308,28 +332,6 @@ exec386(int cycs) loadcs(readmemw(0, addr + 2)); } } - } else if (cpu_state.abrt) { - flags_rebuild(); - tempi = cpu_state.abrt & ABRT_MASK; - cpu_state.abrt = 0; - x86_doabrt(tempi); - if (cpu_state.abrt) { - cpu_state.abrt = 0; -#ifndef USE_NEW_DYNAREC - CS = oldcs; -#endif - cpu_state.pc = cpu_state.oldpc; - x386_log("Double fault %i\n", ins); - pmodeint(8, 0); - if (cpu_state.abrt) { - cpu_state.abrt = 0; - softresetx86(); - cpu_set_edx(); -#ifdef ENABLE_386_LOG - x386_log("Triple fault - reset\n"); -#endif - } - } } cpu_end_block_after_ins = 0;