From 7353ed02d9d4ddb68f2ba7a0e64c6fe96bd51d17 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 14 Jul 2018 21:48:58 +0300 Subject: [PATCH] STOP tracing update. --- newcpu.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/newcpu.cpp b/newcpu.cpp index 018ad399..6176bf73 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -4690,6 +4690,8 @@ void doint (void) static int do_specialties (int cycles) { + bool stopped_debug = false; + if (regs.spcflags & SPCFLAG_MODE_CHANGE) return 1; @@ -4888,13 +4890,23 @@ static int do_specialties (int cycles) set_special (SPCFLAG_INT); } - if (regs.spcflags & SPCFLAG_BRK) { + if ((regs.spcflags & SPCFLAG_BRK) || stopped_debug) { unset_special(SPCFLAG_BRK); #ifdef DEBUGGER + if (stopped_debug && !regs.stopped) { + debugger_active = 1; + stopped_debug = false; + } if (debugging) { - debug(); - if (regs.stopped) + if (!stopped_debug) + debug(); + if (regs.stopped) { + stopped_debug = true; + if (debugging) { + debugger_active = 0; + } goto isstopped; + } } #endif } -- 2.47.3