From 6bc89c65d270eb26053c34450e7fdc2952cb20b4 Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Tue, 15 Feb 2011 17:21:27 +0000 Subject: [PATCH] 2.7.0.8 Added: New command PWD to display the current debugger directory. --- AppleWin/docs/Debugger_Changelog.txt | 9 ++++-- AppleWin/source/Debugger/Debug.cpp | 30 ++++++++++++++----- .../source/Debugger/Debugger_Commands.cpp | 2 ++ AppleWin/source/Debugger/Debugger_Types.h | 4 +++ 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/AppleWin/docs/Debugger_Changelog.txt b/AppleWin/docs/Debugger_Changelog.txt index 44a90382..00c88338 100644 --- a/AppleWin/docs/Debugger_Changelog.txt +++ b/AppleWin/docs/Debugger_Changelog.txt @@ -1,11 +1,14 @@ /* - + .8 Added: New command PWD to display the current debugger directory. + This is the directory used for scripts, loading/saving memory, and trace files. + Currently the debugger uses the same directory that the last disk image was loaded from. + It will have its own directory in a future version. .7 Fixed: Cleaned up display of soft-switches to show address. - .6 Removed: Removed unused aliases. + .6 Removed: Unused aliases. Reason: When a symbol table is specified with no args, the total # of symbols will be shown. SYMBOLS1, SYMBOLS2, SYM0, SYM1, SYM2, SYM3, SYM4, SYM5, SYM6 .5 Fixed: Increased console output height so that you can view all the SYMBASIC * output. - .4 Added: Two alises for Dos 3.3 and Prodos symbol tables + .4 Added: Two aliases for Dos 3.3 and Prodos symbol tables SYMDOS SYMPRO .3 Added: Two new symbol tables added Dos 3.3 and Prodos. diff --git a/AppleWin/source/Debugger/Debug.cpp b/AppleWin/source/Debugger/Debug.cpp index 31f8d4e0..93f84cf5 100644 --- a/AppleWin/source/Debugger/Debug.cpp +++ b/AppleWin/source/Debugger/Debug.cpp @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define ALLOW_INPUT_LOWERCASE 1 // See /docs/Debugger_Changelog.txt for full details - const int DEBUGGER_VERSION = MAKE_VERSION(2,7,0,7); + const int DEBUGGER_VERSION = MAKE_VERSION(2,7,0,8); // Public _________________________________________________________________________________________ @@ -1940,7 +1940,7 @@ Update_t CmdTraceFile (int nArgs) char sFilePath[ MAX_PATH ]; - strcpy(sFilePath, g_sCurrentDir); // g_sProgramDir + strcpy(sFilePath, g_sCurrentDir); // TODO: g_sDebugDir strcat(sFilePath, sFileName ); g_hTraceFile = fopen( sFilePath, "wt" ); @@ -2304,7 +2304,7 @@ void ConfigSave_PrepareHeader ( const Parameters_e eCategory, const Commands_e e Update_t CmdConfigSave (int nArgs) { TCHAR sFilename[ MAX_PATH ]; - _tcscpy( sFilename, g_sProgramDir ); // g_sCurrentDir + _tcscpy( sFilename, g_sProgramDir ); // TODO: g_sDebugDir _tcscat( sFilename, g_sFileNameConfig ); /* @@ -3977,6 +3977,22 @@ Update_t CmdMemoryFill (int nArgs) static TCHAR g_sMemoryLoadSaveFileName[ MAX_PATH ] = TEXT(""); +//=========================================================================== +Update_t CmdConfigGetDebugDir (int nArgs) +{ + TCHAR sPath[ MAX_PATH + 8 ] = "Path: "; + _tcscat( sPath, g_sCurrentDir ); // TODO: debugger dir has no ` CONSOLE_COLOR_ESCAPE_CHAR ?!?! + ConsoleBufferPush( sPath ); + + return ConsoleUpdate(); +} + +//=========================================================================== +Update_t CmdConfigSetDebugDir (int nArgs) +{ + return ConsoleUpdate(); +} + //=========================================================================== Update_t CmdMemoryLoad (int nArgs) { @@ -4020,7 +4036,7 @@ Update_t CmdMemoryLoad (int nArgs) return Help_Arg_1( CMD_MEMORY_SAVE ); TCHAR sLoadSaveFilePath[ MAX_PATH ]; - _tcscpy( sLoadSaveFilePath, g_sCurrentDir ); // g_sProgramDir + _tcscpy( sLoadSaveFilePath, g_sCurrentDir ); // TODO: g_sDebugDir WORD nAddressStart; WORD nAddress2 = 0; @@ -4084,9 +4100,9 @@ Update_t CmdMemoryLoad (int nArgs) else { ConsoleBufferPush( TEXT( "ERROR: Bad filename" ) ); - TCHAR sPath[ MAX_PATH + 8 ] = "Path: "; - _tcscat( sPath, g_sCurrentDir ); - ConsoleBufferPush( sPath ); + + CmdConfigGetDebugDir( 0 ); + TCHAR sFile[ MAX_PATH + 8 ] = "File: "; _tcscat( sFile, g_sMemoryLoadSaveFileName ); ConsoleBufferPush( sFile ); diff --git a/AppleWin/source/Debugger/Debugger_Commands.cpp b/AppleWin/source/Debugger/Debugger_Commands.cpp index d7e7ddaf..986c7a57 100644 --- a/AppleWin/source/Debugger/Debugger_Commands.cpp +++ b/AppleWin/source/Debugger/Debugger_Commands.cpp @@ -99,6 +99,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA {TEXT("LOAD") , CmdConfigLoad , CMD_CONFIG_LOAD , "Load debugger configuration" }, {TEXT("MONO") , CmdConfigColorMono , CMD_CONFIG_MONOCHROME , "Sets/Shows RGB for monochrome scheme" }, {TEXT("SAVE") , CmdConfigSave , CMD_CONFIG_SAVE , "Save debugger configuration" }, + {TEXT("PWD") , CmdConfigGetDebugDir , CMD_CONFIG_GET_DEBUG_DIR , "Displays the current debugger directory. Used for scripts & mem load/save." }, + {TEXT("CD") , CmdConfigSetDebugDir , CMD_CONFIG_SET_DEBUG_DIR , "Updates the current debugger directory." }, // Cursor {TEXT("RET") , CmdCursorJumpRetAddr , CMD_CURSOR_JUMP_RET_ADDR , "Sets the cursor to the sub-routine caller" }, {TEXT( "^") , NULL , CMD_CURSOR_LINE_UP }, // \x2191 = Up Arrow (Unicode) diff --git a/AppleWin/source/Debugger/Debugger_Types.h b/AppleWin/source/Debugger/Debugger_Types.h index 6b1434ac..1aad5c4e 100644 --- a/AppleWin/source/Debugger/Debugger_Types.h +++ b/AppleWin/source/Debugger/Debugger_Types.h @@ -352,6 +352,8 @@ , CMD_CONFIG_LOAD , CMD_CONFIG_MONOCHROME // MONO # rr gg bb , CMD_CONFIG_SAVE + , CMD_CONFIG_GET_DEBUG_DIR + , CMD_CONFIG_SET_DEBUG_DIR // Cursor , CMD_CURSOR_JUMP_RET_ADDR , CMD_CURSOR_LINE_UP // Smart Line Up @@ -632,6 +634,8 @@ Update_t CmdConfigSave (int nArgs); Update_t CmdConfigSetFont (int nArgs); Update_t CmdConfigGetFont (int nArgs); + Update_t CmdConfigGetDebugDir (int nArgs); + Update_t CmdConfigSetDebugDir (int nArgs); // Cursor Update_t CmdCursorFollowTarget(int nArgs); Update_t CmdCursorLineDown (int nArgs);