From 57bd6890f5f058711ba3d3cd5a32db91b784fd95 Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Tue, 20 Aug 2002 09:51:06 +0000 Subject: [PATCH] changes for debugger Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@195 --- include/debug.h | 1 + include/dosbox.h | 1 + src/cpu/core_16/main.h | 7 +++++++ src/cpu/slow_16.cpp | 4 ++++ src/dosbox.cpp | 9 ++++++--- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/debug.h b/include/debug.h index 20deed7f..300fa119 100644 --- a/include/debug.h +++ b/include/debug.h @@ -18,6 +18,7 @@ void DEBUG_DrawScreen(void); bool DEBUG_BreakPoint(void); +bool DEBUG_IntBreakpoint(Bit8u intNum); void DEBUG_Enable(void); extern Bitu cycle_count; diff --git a/include/dosbox.h b/include/dosbox.h index 23ed13b6..c9ddd480 100644 --- a/include/dosbox.h +++ b/include/dosbox.h @@ -50,6 +50,7 @@ typedef Bitu (LoopHandler)(void); void DOSBOX_RunMachine(); void DOSBOX_SetLoop(LoopHandler * handler); +void DOSBOX_SetNormalLoop(); void DOSBOX_Init(int argc, char* argv[]); void DOSBOX_StartUp(void); diff --git a/src/cpu/core_16/main.h b/src/cpu/core_16/main.h index 075e5655..b1cfee22 100644 --- a/src/cpu/core_16/main.h +++ b/src/cpu/core_16/main.h @@ -887,10 +887,17 @@ restart: break; case 0xcc: /* INT3 */ INTERRUPT(3); +#if C_DEBUG + return 0; +#endif break; case 0xcd: /* INT Ib */ { Bit8u num=Fetchb(); +#if C_DEBUG + SAVEIP; + if (DEBUG_IntBreakpoint(num)) return 0; +#endif INTERRUPT(num); } break; diff --git a/src/cpu/slow_16.cpp b/src/cpu/slow_16.cpp index 30df16c0..a7e41995 100644 --- a/src/cpu/slow_16.cpp +++ b/src/cpu/slow_16.cpp @@ -24,6 +24,10 @@ #include "pic.h" #include "fpu.h" +#if C_DEBUG +#include "debug.h" +#endif + typedef PhysPt EAPoint; #define SegBase(c) SegPhys(c) #define LoadMb(off) mem_readb(off) diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 538d192f..e5ea0c71 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -105,7 +105,7 @@ void DOS_Init(); void RENDER_Init(void); void CPU_Init(); -void FPU_Init(); +//void FPU_Init(); void IO_Init(void); void DMA_Init(void); void MIXER_Init(void); @@ -189,6 +189,9 @@ void DOSBOX_SetLoop(LoopHandler * handler) { loop=handler; } +void DOSBOX_SetNormalLoop() { + loop=Normal_Loop; +} void DOSBOX_RunMachine(void){ Bitu ret; @@ -208,11 +211,11 @@ static void InitSystems(void) { HARDWARE_Init(); TIMER_Init(); CPU_Init(); -#ifdef C_FPU +#if C_FPU FPU_Init(); #endif MIXER_Init(); -#ifdef C_DEBUG +#if C_DEBUG DEBUG_Init(); #endif //Start up individual hardware