From: Toni Wilen Date: Mon, 10 Mar 2025 17:30:20 +0000 (+0200) Subject: Keep CPU in reset when pressing reset keys X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=42d7664c7d080875aa028080d73aaac12940f0af;p=francis%2Fwinuae.git Keep CPU in reset when pressing reset keys --- diff --git a/inputdevice.cpp b/inputdevice.cpp index 10d3a1a3..447bafbf 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -4681,6 +4681,7 @@ void inputdevice_do_kb_reset(void) uae_reset(0, 1); } else { keyboard_reset_seq_mode = 4; + cpu_inreset(); } } else { uae_reset(0, 1); diff --git a/newcpu.cpp b/newcpu.cpp index a4cfb941..515d9fa0 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -4636,6 +4636,15 @@ static int do_specialties (int cycles) if (spcflags & SPCFLAG_MODE_CHANGE) return 1; + while (spcflags & SPCFLAG_CPUINRESET) { + regs.halted = 0; + x_do_cycles(4 * CYCLE_UNIT); + spcflags = regs.spcflags; + if (!(spcflags & SPCFLAG_CPUINRESET) || (spcflags & SPCFLAG_BRK) || (spcflags & SPCFLAG_MODE_CHANGE)) { + break; + } + } + if (spcflags & SPCFLAG_CHECK) { if (regs.halted) { if (regs.halted == CPU_HALT_ACCELERATOR_CPU_FALLBACK) { @@ -4700,14 +4709,6 @@ static int do_specialties (int cycles) } #endif - while (spcflags & SPCFLAG_CPUINRESET) { - x_do_cycles(4 * CYCLE_UNIT); - spcflags = regs.spcflags; - if (!(spcflags & SPCFLAG_CPUINRESET) || (spcflags & SPCFLAG_BRK) || (spcflags & SPCFLAG_MODE_CHANGE)) { - break; - } - } - while ((spcflags & SPCFLAG_BLTNASTY) && dmaen (DMA_BLITTER) && cycles > 0 && ((currprefs.waiting_blits && currprefs.cpu_model >= 68020) || !currprefs.blitter_cycle_exact)) { int c = blitnasty(); if (c < 0) {