#pragma once #include "../SaveState_Structs_v1.h" // For SS_CARD_MOCKINGBOARD #include "../Common.h" #include "Debugger_Types.h" #include "Debugger_DisassemblerData.h" #include "Debugger_Disassembler.h" #include "Debugger_Range.h" #include "Debugger_Parser.h" #include "Debugger_Console.h" #include "Debugger_Assembler.h" #include "Debugger_Help.h" #include "Debugger_Display.h" #include "Debugger_Symbols.h" #include "Util_MemoryTextFile.h" // Globals __________________________________________________________________ // All (Global) extern bool g_bDebuggerEatKey; // Benchmarking extern DWORD extbench; // Bookmarks extern int g_nBookmarks; extern Bookmark_t g_aBookmarks[ MAX_BOOKMARKS ]; // Breakpoints enum BreakpointHit_t { BP_HIT_NONE = 0 , BP_HIT_INVALID = (1 << 0) , BP_HIT_OPCODE = (1 << 1) , BP_HIT_REG = (1 << 2) , BP_HIT_MEM = (1 << 3) , BP_HIT_MEMR = (1 << 4) , BP_HIT_MEMW = (1 << 5) , BP_HIT_PC_READ_FLOATING_BUS_OR_IO_MEM = (1 << 6) }; extern int g_nBreakpoints; extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ]; extern const char *g_aBreakpointSource [ NUM_BREAKPOINT_SOURCES ]; extern const TCHAR *g_aBreakpointSymbols[ NUM_BREAKPOINT_OPERATORS ]; extern int g_nDebugBreakOnInvalid ; extern int g_iDebugBreakOnOpcode ; // Commands void VerifyDebuggerCommandTable(); extern const int NUM_COMMANDS_WITH_ALIASES; // = sizeof(g_aCommands) / sizeof (Command_t); // Determined at compile-time ;-) extern int g_iCommand; // last command extern Command_t g_aCommands[]; extern Command_t g_aParameters[]; class commands_functor_compare { public: bool operator() ( const Command_t & rLHS, const Command_t & rRHS ) const { // return true if lhs g_vMemorySearchResults; // Source Level Debugging extern std::string g_aSourceFileName; extern MemoryTextFile_t g_AssemblerSourceBuffer; extern int g_iSourceDisplayStart ; extern int g_nSourceAssembleBytes ; extern int g_nSourceAssemblySymbols; // Version extern const int DEBUGGER_VERSION; // Watches extern int g_nWatches; extern Watches_t g_aWatches[ MAX_WATCHES ]; // Window extern int g_iWindowLast; extern int g_iWindowThis; extern WindowSplit_t g_aWindowConfig[ NUM_WINDOWS ]; // Zero Page extern int g_nZeroPagePointers; extern ZeroPagePointers_t g_aZeroPagePointers[ MAX_ZEROPAGE_POINTERS ]; // TODO: use vector<> ? // Prototypes _______________________________________________________________ // Bookmarks int Bookmark_Find( const WORD nAddress ); // Breakpoints int CheckBreakpointsIO (); int CheckBreakpointsReg (); bool GetBreakpointInfo ( WORD nOffset, bool & bBreakpointActive_, bool & bBreakpointEnable_ ); // Source Level Debugging int FindSourceLine( WORD nAddress ); // Memory size_t Util_GetTextScreen( char* &pText_ ); void Util_CopyTextToClipboard( const size_t nSize, const char *pText ); // Main Update_t DebuggerProcessCommand( const bool bEchoConsoleInput ); // Prototypes _______________________________________________________________ bool DebugGetVideoMode(UINT* pVideoMode); void DebugBegin (); void DebugExitDebugger (); void DebugContinueStepping(const bool bCallerWillUpdateDisplay = false); void DebugStopStepping(void); void DebugDestroy (); void DebugDisplay ( BOOL bInitDisasm = FALSE ); void DebugInitialize (); void DebugReset(void); void DebuggerInputConsoleChar( TCHAR ch ); void DebuggerProcessKey( int keycode ); void DebuggerUpdate(); void DebuggerCursorNext(); void DebuggerMouseClick( int x, int y ); bool IsDebugSteppingAtFullSpeed(void);