Updated help, BPA, BLOAD/BSAVE

This commit is contained in:
mpohoreski 2006-06-25 03:43:49 +00:00
parent a92f5d4fbe
commit f2e47d45df
5 changed files with 173 additions and 93 deletions

View File

@ -33,8 +33,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#pragma hdrstop #pragma hdrstop
// NEW UI debugging
// #define DEBUG_FORCE_DISPLAY 1
// #define DEBUG_COMMAND_HELP 1 // #define DEBUG_COMMAND_HELP 1
// #define DEBUG_ASM_HASH 1 // #define DEBUG_ASM_HASH 1
@ -43,7 +41,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// TODO: COLOR LOAD ["filename"] // TODO: COLOR LOAD ["filename"]
// See Debugger_Changelong.txt for full details // See Debugger_Changelong.txt for full details
const int DEBUGGER_VERSION = MAKE_VERSION(2,5,3,8); const int DEBUGGER_VERSION = MAKE_VERSION(2,5,3,14);
// Public _________________________________________________________________________________________ // Public _________________________________________________________________________________________
@ -144,17 +142,17 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{TEXT("TF") , CmdTraceFile , CMD_TRACE_FILE , "Save trace to filename" }, {TEXT("TF") , CmdTraceFile , CMD_TRACE_FILE , "Save trace to filename" },
{TEXT("TL") , CmdTraceLine , CMD_TRACE_LINE , "Trace (with cycle counting)" }, {TEXT("TL") , CmdTraceLine , CMD_TRACE_LINE , "Trace (with cycle counting)" },
// Breakpoints // Breakpoints
{TEXT("BP") , CmdBreakpointMenu , CMD_BREAKPOINT , "Access breakpoint options" }, {TEXT("BP") , CmdBreakpointMenu , CMD_BREAKPOINT , "Save/Load Breakpoints" },
{TEXT("BPA") , CmdBreakpointAddSmart, CMD_BREAKPOINT_ADD_SMART , "Add (smart) breakpoint" }, {TEXT("BPA") , CmdBreakpointAddSmart, CMD_BREAKPOINT_ADD_SMART , "Add (smart) breakpoint" },
// {TEXT("BPP") , CmdBreakpointAddFlag , CMD_BREAKPOINT_ADD_FLAG , "Add breakpoint on flags" }, // {TEXT("BPP") , CmdBreakpointAddFlag , CMD_BREAKPOINT_ADD_FLAG , "Add breakpoint on flags" },
{TEXT("BPR") , CmdBreakpointAddReg , CMD_BREAKPOINT_ADD_REG , "Add breakpoint on register value" }, // NOTE! Different from SoftICE !!!! {TEXT("BPR") , CmdBreakpointAddReg , CMD_BREAKPOINT_ADD_REG , "Add breakpoint on register value" }, // NOTE! Different from SoftICE !!!!
{TEXT("BPX") , CmdBreakpointAddPC , CMD_BREAKPOINT_ADD_PC , "Add breakpoint at current instruction" }, {TEXT("BPX") , CmdBreakpointAddPC , CMD_BREAKPOINT_ADD_PC , "Add breakpoint at current instruction" },
{TEXT("BPIO") , CmdBreakpointAddIO , CMD_BREAKPOINT_ADD_IO , "Add breakpoint for IO address $C0xx" }, {TEXT("BPIO") , CmdBreakpointAddIO , CMD_BREAKPOINT_ADD_IO , "Add breakpoint for IO address $C0xx" },
{TEXT("BPM") , CmdBreakpointAddMem , CMD_BREAKPOINT_ADD_MEM , "Add breakpoint on memory access" }, // SoftICE {TEXT("BPM") , CmdBreakpointAddMem , CMD_BREAKPOINT_ADD_MEM , "Add breakpoint on memory access" }, // SoftICE
{TEXT("BC") , CmdBreakpointClear , CMD_BREAKPOINT_CLEAR , "Clear breakpoint # or *" }, // SoftICE {TEXT("BC") , CmdBreakpointClear , CMD_BREAKPOINT_CLEAR , "Clear breakpoint" }, // SoftICE
{TEXT("BD") , CmdBreakpointDisable , CMD_BREAKPOINT_DISABLE , "Disable breakpoint # or *" }, // SoftICE {TEXT("BD") , CmdBreakpointDisable , CMD_BREAKPOINT_DISABLE , "Disable breakpoint # or *" }, // SoftICE
{TEXT("BPE") , CmdBreakpointEdit , CMD_BREAKPOINT_EDIT , "Edit breakpoint # or *" }, // SoftICE {TEXT("BPE") , CmdBreakpointEdit , CMD_BREAKPOINT_EDIT , "Edit breakpoint" }, // SoftICE
{TEXT("BE") , CmdBreakpointEnable , CMD_BREAKPOINT_ENABLE , "Enable breakpoint # or *" }, // SoftICE {TEXT("BE") , CmdBreakpointEnable , CMD_BREAKPOINT_ENABLE , "Enable breakpoint" }, // SoftICE
{TEXT("BL") , CmdBreakpointList , CMD_BREAKPOINT_LIST , "List breakpoints" }, // SoftICE {TEXT("BL") , CmdBreakpointList , CMD_BREAKPOINT_LIST , "List breakpoints" }, // SoftICE
{TEXT("BPLOAD") , CmdBreakpointLoad , CMD_BREAKPOINT_LOAD , "Loads breakpoints" }, {TEXT("BPLOAD") , CmdBreakpointLoad , CMD_BREAKPOINT_LOAD , "Loads breakpoints" },
{TEXT("BPSAVE") , CmdBreakpointSave , CMD_BREAKPOINT_SAVE , "Saves breakpoints" }, {TEXT("BPSAVE") , CmdBreakpointSave , CMD_BREAKPOINT_SAVE , "Saves breakpoints" },
@ -165,7 +163,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{TEXT("BW") , CmdConfigColorMono , CMD_CONFIG_BW , "Sets/Shows RGB for Black & White scheme" }, {TEXT("BW") , CmdConfigColorMono , CMD_CONFIG_BW , "Sets/Shows RGB for Black & White scheme" },
{TEXT("COLOR") , CmdConfigColorMono , CMD_CONFIG_COLOR , "Sets/Shows RGB for color scheme" }, {TEXT("COLOR") , CmdConfigColorMono , CMD_CONFIG_COLOR , "Sets/Shows RGB for color scheme" },
{TEXT("CONFIG") , CmdConfigMenu , CMD_CONFIG_MENU , "Access config options" }, {TEXT("CONFIG") , CmdConfigMenu , CMD_CONFIG_MENU , "Access config options" },
{TEXT("DISASM") , CmdConfigDisasm , CMD_CONFIG_DISASM , "Sets disassembly view options." }, {TEXT("DISASM") , CmdConfigDisasm , CMD_CONFIG_DISASM , "Sets/Shows disassembly view options." },
{TEXT("ECHO") , CmdConfigEcho , CMD_CONFIG_ECHO , "Echo string, or toggle command echoing" }, {TEXT("ECHO") , CmdConfigEcho , CMD_CONFIG_ECHO , "Echo string, or toggle command echoing" },
{TEXT("FONT") , CmdConfigFont , CMD_CONFIG_FONT , "Shows current font or sets new one" }, {TEXT("FONT") , CmdConfigFont , CMD_CONFIG_FONT , "Shows current font or sets new one" },
{TEXT("HCOLOR") , CmdConfigHColor , CMD_CONFIG_HCOLOR , "Sets/Shows colors mapped to Apple HGR" }, {TEXT("HCOLOR") , CmdConfigHColor , CMD_CONFIG_HCOLOR , "Sets/Shows colors mapped to Apple HGR" },
@ -243,7 +241,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{TEXT("EW") , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD }, {TEXT("EW") , CmdMemoryEnterWord , CMD_MEMORY_ENTER_WORD },
{TEXT("BLOAD") , CmdMemoryLoad , CMD_MEMORY_LOAD , "Load a region of memory" }, {TEXT("BLOAD") , CmdMemoryLoad , CMD_MEMORY_LOAD , "Load a region of memory" },
{TEXT("M") , CmdMemoryMove , CMD_MEMORY_MOVE }, {TEXT("M") , CmdMemoryMove , CMD_MEMORY_MOVE },
{TEXT("BSAVE") , CmdMemorySave , CMD_MEMORY_SAVE , "Save a region of memory\n" }, {TEXT("BSAVE") , CmdMemorySave , CMD_MEMORY_SAVE , "Save a region of memory" },
{TEXT("S") , CmdMemorySearch , CMD_MEMORY_SEARCH , "Search for text for hex values" }, {TEXT("S") , CmdMemorySearch , CMD_MEMORY_SEARCH , "Search for text for hex values" },
{TEXT("SA") , CmdMemorySearchAscii, CMD_MEMORY_SEARCH_ASCII , "Search ASCII text" }, // Search ASCII {TEXT("SA") , CmdMemorySearchAscii, CMD_MEMORY_SEARCH_ASCII , "Search ASCII text" }, // Search ASCII
{TEXT("ST") , CmdMemorySearchApple , CMD_MEMORY_SEARCH_APPLE , "Search Apple text (hi-bit)" }, // Search Apple Text {TEXT("ST") , CmdMemorySearchApple , CMD_MEMORY_SEARCH_APPLE , "Search Apple text (hi-bit)" }, // Search Apple Text
@ -546,8 +544,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
const unsigned int _6502_STACK_END = 0x01FF; const unsigned int _6502_STACK_END = 0x01FF;
const unsigned int _6502_IO_BEGIN = 0xC000; const unsigned int _6502_IO_BEGIN = 0xC000;
const unsigned int _6502_IO_END = 0xC0FF; const unsigned int _6502_IO_END = 0xC0FF;
const unsigned int _6502_BEG_MEM_ADDRESS = 0x0000; const unsigned int _6502_MEM_BEGIN = 0x0000;
const unsigned int _6502_END_MEM_ADDRESS = 0xFFFF; const unsigned int _6502_MEM_END = 0xFFFF;
MemoryDump_t g_aMemDump[ NUM_MEM_DUMPS ]; MemoryDump_t g_aMemDump[ NUM_MEM_DUMPS ];
@ -806,7 +804,7 @@ static bool ParseAssemblyListing ( bool bBytesToMemory, bool bAddSymbols );
Update_t _CmdWindowViewCommon (int iNewWindow); Update_t _CmdWindowViewCommon (int iNewWindow);
// Utility // Utility
bool _GetStartEnd( WORD & nAddressStart_, WORD & nAddressEnd_ ); bool _GetStartEnd( WORD & nAddressStart_, WORD & nAddressEnd_, const int iArg = 1 );
bool StringCat( TCHAR * pDst, LPCSTR pSrc, const int nDstSize ); bool StringCat( TCHAR * pDst, LPCSTR pSrc, const int nDstSize );
bool TestStringCat ( TCHAR * pDst, LPCSTR pSrc, const int nDstSize ); bool TestStringCat ( TCHAR * pDst, LPCSTR pSrc, const int nDstSize );
@ -1362,7 +1360,7 @@ Update_t CmdJSR (int nArgs)
if (! nArgs) if (! nArgs)
return Help_Arg_1( CMD_JSR ); return Help_Arg_1( CMD_JSR );
WORD nAddress = g_aArgs[1].nVal1 & _6502_END_MEM_ADDRESS; WORD nAddress = g_aArgs[1].nVal1 & _6502_MEM_END;
// Mark Stack Page as dirty // Mark Stack Page as dirty
*(memdirty+(regs.sp >> 8)) = 1; *(memdirty+(regs.sp >> 8)) = 1;
@ -1584,8 +1582,8 @@ Update_t CmdBreakpointAddSmart (int nArgs)
if (! nArgs) if (! nArgs)
{ {
// return Help_Arg_1( CMD_BREAKPOINT_ADD_SMART ); nArgs = 1;
g_aArgs[1].nVal1 = g_nDisasmCurAddress; g_aArgs[ nArgs ].nVal1 = g_nDisasmCurAddress;
} }
if ((nAddress >= _6502_IO_BEGIN) && (nAddress <= _6502_IO_END)) if ((nAddress >= _6502_IO_BEGIN) && (nAddress <= _6502_IO_END))
@ -1730,7 +1728,7 @@ bool _CmdBreakpointAddCommonArg ( int iArg, int nArg, BreakpointSource_t iSrc, B
else else
{ {
// Clamp Length so it stays within the 6502 memory address // Clamp Length so it stays within the 6502 memory address
int nSlack = (_6502_END_MEM_ADDRESS + 1) - nAddress; int nSlack = (_6502_MEM_END + 1) - nAddress;
int nWantedLength = g_aArgs[iArg].nVal2; int nWantedLength = g_aArgs[iArg].nVal2;
nLen = MIN( nSlack, nWantedLength ); nLen = MIN( nSlack, nWantedLength );
} }
@ -2155,7 +2153,7 @@ Update_t CmdConfigRun (int nArgs)
strcpy( sMiniFileName, pFileName ); strcpy( sMiniFileName, pFileName );
// strcat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING // strcat( sMiniFileName, ".aws" ); // HACK: MAGIC STRING
_tcscpy(sFileName, progdir); _tcscpy(sFileName, g_sProgramDir);
_tcscat(sFileName, sMiniFileName); _tcscat(sFileName, sMiniFileName);
if (script.Read( sFileName )) if (script.Read( sFileName ))
@ -2188,7 +2186,7 @@ Update_t CmdConfigRun (int nArgs)
Update_t CmdConfigSave (int nArgs) Update_t CmdConfigSave (int nArgs)
{ {
TCHAR filename[ MAX_PATH ]; TCHAR filename[ MAX_PATH ];
_tcscpy(filename, progdir); _tcscpy(filename, g_sProgramDir);
_tcscat(filename, g_FileNameConfig ); _tcscat(filename, g_FileNameConfig );
HANDLE hFile = CreateFile(filename, HANDLE hFile = CreateFile(filename,
@ -3003,7 +3001,7 @@ void _CursorMoveDownAligned( int nDelta )
if (g_aMemDump[0].eDevice == DEV_MEMORY) if (g_aMemDump[0].eDevice == DEV_MEMORY)
{ {
g_aMemDump[0].nAddress += nDelta; g_aMemDump[0].nAddress += nDelta;
g_aMemDump[0].nAddress &= _6502_END_MEM_ADDRESS; g_aMemDump[0].nAddress &= _6502_MEM_END;
} }
} }
} }
@ -3016,7 +3014,7 @@ void _CursorMoveDownAligned( int nDelta )
else else
nNewAddress += (nDelta - (nNewAddress & (nDelta-1))); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned() nNewAddress += (nDelta - (nNewAddress & (nDelta-1))); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned()
g_nDisasmTopAddress = nNewAddress & _6502_END_MEM_ADDRESS; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00 g_nDisasmTopAddress = nNewAddress & _6502_MEM_END; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00
} }
} }
@ -3031,7 +3029,7 @@ void _CursorMoveUpAligned( int nDelta )
if (g_aMemDump[0].eDevice == DEV_MEMORY) if (g_aMemDump[0].eDevice == DEV_MEMORY)
{ {
g_aMemDump[0].nAddress -= nDelta; g_aMemDump[0].nAddress -= nDelta;
g_aMemDump[0].nAddress &= _6502_END_MEM_ADDRESS; g_aMemDump[0].nAddress &= _6502_MEM_END;
} }
} }
} }
@ -3044,7 +3042,7 @@ void _CursorMoveUpAligned( int nDelta )
else else
nNewAddress -= (nNewAddress & (nDelta-1)); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned() nNewAddress -= (nNewAddress & (nDelta-1)); // .22 Fixed: Shift-PageUp Shift-PageDown Ctrl-PageUp Ctrl-PageDown -> _CursorMoveUpAligned() & _CursorMoveDownAligned()
g_nDisasmTopAddress = nNewAddress & _6502_END_MEM_ADDRESS; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00 g_nDisasmTopAddress = nNewAddress & _6502_MEM_END; // .21 Fixed: _CursorMoveUpAligned() & _CursorMoveDownAligned() not wrapping around past FF00 to 0, and wrapping around past 0 to FF00
} }
} }
@ -3542,7 +3540,7 @@ Update_t CmdMemoryFill (int nArgs)
//=========================================================================== //===========================================================================
Update_t CmdMemoryLoad (int nArgs) Update_t CmdMemoryLoad (int nArgs)
{ {
// BLOAD addr[,len] "Filename" // BLOAD ["Filename"] addr[,len]
if (nArgs != 2) if (nArgs != 2)
return Help_Arg_1( CMD_MEMORY_LOAD ); return Help_Arg_1( CMD_MEMORY_LOAD );
@ -3550,17 +3548,17 @@ Update_t CmdMemoryLoad (int nArgs)
{ {
WORD nAddressStart; WORD nAddressStart;
WORD nAddressEnd; WORD nAddressEnd;
if (_GetStartEnd( nAddressStart, nAddressEnd )) if (_GetStartEnd( nAddressStart, nAddressEnd, 2 ))
{ {
WORD nAddressLen = nAddressEnd - nAddressStart; WORD nAddressLen = nAddressEnd - nAddressStart;
BYTE *pMemory = new BYTE [ _6502_END_MEM_ADDRESS + 1 ]; // default 64K buffer BYTE *pMemory = new BYTE [ _6502_MEM_END + 1 ]; // default 64K buffer
BYTE *pDst = mem + nAddressStart; BYTE *pDst = mem + nAddressStart;
BYTE *pSrc = pMemory; BYTE *pSrc = pMemory;
TCHAR sFilePath[ MAX_PATH ]; TCHAR sFilePath[ MAX_PATH ];
_tcscpy( sFilePath,progdir ); _tcscpy( sFilePath,g_sProgramDir );
_tcscat( sFilePath, g_aArgs[ 2 ].sArg ); _tcscat( sFilePath, g_aArgs[ 1 ].sArg );
FILE *hFile = fopen( sFilePath, "rb" ); FILE *hFile = fopen( sFilePath, "rb" );
if (hFile) if (hFile)
@ -3569,8 +3567,8 @@ Update_t CmdMemoryLoad (int nArgs)
int nFileBytes = ftell( hFile ); int nFileBytes = ftell( hFile );
fseek( hFile, 0, SEEK_SET ); fseek( hFile, 0, SEEK_SET );
if (nFileBytes > _6502_END_MEM_ADDRESS) if (nFileBytes > _6502_MEM_END)
nFileBytes = _6502_END_MEM_ADDRESS + 1; // Bank-switched RAMR/ROM is only 16-bit nFileBytes = _6502_MEM_END + 1; // Bank-switched RAMR/ROM is only 16-bit
// Caller didnt' specify how many bytes to read, default to them all // Caller didnt' specify how many bytes to read, default to them all
if (nAddressLen == 0) if (nAddressLen == 0)
@ -3586,20 +3584,20 @@ Update_t CmdMemoryLoad (int nArgs)
{ {
*pDst++ = *pSrc++; *pDst++ = *pSrc++;
} }
ConsoleBufferPush( TEXT( "Loaded.\n" ) ); ConsoleBufferPush( TEXT( "Loaded." ) );
} }
fclose( hFile ); fclose( hFile );
} }
else else
{ {
ConsoleBufferPush( TEXT( "Error: Bad filename.\n" ) ); ConsoleBufferPush( TEXT( "Error: Bad filename." ) );
} }
delete [] pMemory; delete [] pMemory;
} }
} }
return UPDATE_CONSOLE_DISPLAY; return ConsoleUpdate();
} }
@ -3629,7 +3627,7 @@ Update_t CmdMemorySave (int nArgs)
static TCHAR sFileName[ MAX_PATH ]; static TCHAR sFileName[ MAX_PATH ];
TCHAR sFilePath[ MAX_PATH ]; TCHAR sFilePath[ MAX_PATH ];
_tcscpy( sFilePath, progdir ); _tcscpy( sFilePath, g_sProgramDir );
if (! nArgs) if (! nArgs)
{ {
@ -3641,23 +3639,23 @@ Update_t CmdMemorySave (int nArgs)
} }
else else
{ {
wsprintf( sLast, TEXT( "Last saved: none\n" ) ); wsprintf( sLast, TEXT( "Last saved: none" ) );
} }
ConsoleBufferPush( sLast ); ConsoleBufferPush( sLast );
} }
else else
{ {
if (_GetStartEnd( nAddressStart, nAddressEnd )) if (_GetStartEnd( nAddressStart, nAddressEnd, nArgs ))
{ {
nAddressLen = nAddressEnd - nAddressStart; nAddressLen = nAddressEnd - nAddressStart;
if ((nAddressLen) && (nAddressLen < _6502_END_MEM_ADDRESS)) if ((nAddressLen) && (nAddressLen < _6502_MEM_END))
{ {
// BSAVE addr,len "Filename" // BSAVE ["Filename"] addr,len
if (nArgs == 1) if (nArgs == 1)
{ {
sprintf( g_aArgs[ 2 ].sArg, "%04X.%04X.bin", nAddressStart, nAddressLen ); // nAddressEnd ); sprintf( g_aArgs[ 1 ].sArg, "%04X.%04X.bin", nAddressStart, nAddressLen ); // nAddressEnd );
nArgs++;; nArgs++;
} }
if (nArgs == 2) if (nArgs == 2)
@ -3672,13 +3670,13 @@ Update_t CmdMemorySave (int nArgs)
*pDst++ = *pSrc++; *pDst++ = *pSrc++;
} }
_tcscpy( sFileName, g_aArgs[ 2 ].sArg ); _tcscpy( sFileName, g_aArgs[ 1 ].sArg );
_tcscat( sFilePath, sFileName ); _tcscat( sFilePath, sFileName );
FILE *hFile = fopen( sFilePath, "rb" ); FILE *hFile = fopen( sFilePath, "rb" );
if (hFile) if (hFile)
{ {
ConsoleBufferPush( TEXT( "Warning: File already exists. Overwriting.\n" ) ); ConsoleBufferPush( TEXT( "Warning: File already exists. Overwriting." ) );
fclose( hFile ); fclose( hFile );
} }
@ -3688,11 +3686,11 @@ Update_t CmdMemorySave (int nArgs)
size_t nWrote = fwrite( pMemory, nAddressLen, 1, hFile ); size_t nWrote = fwrite( pMemory, nAddressLen, 1, hFile );
if (nWrote == 1) // (size_t)nAddressLen) if (nWrote == 1) // (size_t)nAddressLen)
{ {
ConsoleBufferPush( TEXT( "Saved.\n" ) ); ConsoleBufferPush( TEXT( "Saved." ) );
} }
else else
{ {
ConsoleBufferPush( TEXT( "Error saving.\n" ) ); ConsoleBufferPush( TEXT( "Error saving." ) );
} }
fclose( hFile ); fclose( hFile );
} }
@ -3703,19 +3701,19 @@ Update_t CmdMemorySave (int nArgs)
} }
} }
return UPDATE_CONSOLE_DISPLAY; return ConsoleUpdate();
} }
//=========================================================================== //===========================================================================
bool _GetStartEnd( WORD & nAddressStart_, WORD & nAddressEnd_ ) bool _GetStartEnd( WORD & nAddressStart_, WORD & nAddressEnd_, const int iArg )
{ {
nAddressStart_ = g_aArgs[1].nVal1; nAddressStart_ = g_aArgs[ iArg ].nVal1;
int nEnd = nAddressStart_ + g_aArgs[1].nVal2; int nEnd = nAddressStart_ + g_aArgs[ iArg ].nVal2;
// .17 Bug Fix: D000,FFFF -> D000,CFFF (nothing searched!) // .17 Bug Fix: D000,FFFF -> D000,CFFF (nothing searched!)
if (nEnd > _6502_END_MEM_ADDRESS) if (nEnd > _6502_MEM_END)
nEnd = _6502_END_MEM_ADDRESS; nEnd = _6502_MEM_END;
nAddressEnd_ = nEnd; nAddressEnd_ = nEnd;
return true; return true;
@ -4199,7 +4197,7 @@ bool ParseAssemblyListing( bool bBytesToMemory, bool bAddSymbols )
g_nSourceAssembleBytes = 0; g_nSourceAssembleBytes = 0;
g_nSourceAssemblySymbols = 0; g_nSourceAssemblySymbols = 0;
const DWORD INVALID_ADDRESS = _6502_END_MEM_ADDRESS + 1; const DWORD INVALID_ADDRESS = _6502_MEM_END + 1;
bool bPrevSymbol = false; bool bPrevSymbol = false;
bool bFourBytes = false; bool bFourBytes = false;
@ -4346,7 +4344,7 @@ Update_t CmdSource (int nArgs)
else else
{ {
TCHAR sFileName[MAX_PATH]; TCHAR sFileName[MAX_PATH];
_tcscpy(sFileName,progdir); _tcscpy(sFileName,g_sProgramDir);
_tcscat(sFileName, pFileName); _tcscat(sFileName, pFileName);
const int MAX_MINI_FILENAME = 20; const int MAX_MINI_FILENAME = 20;
@ -4776,7 +4774,7 @@ int ParseSymbolTable( TCHAR *pFileName, Symbols_e eWhichTableToLoad )
Update_t CmdSymbolsLoad (int nArgs) Update_t CmdSymbolsLoad (int nArgs)
{ {
TCHAR sFileName[MAX_PATH]; TCHAR sFileName[MAX_PATH];
_tcscpy(sFileName,progdir); _tcscpy(sFileName,g_sProgramDir);
int iWhichTable = (g_iCommand - CMD_SYMBOLS_MAIN); int iWhichTable = (g_iCommand - CMD_SYMBOLS_MAIN);
if ((iWhichTable < 0) || (iWhichTable >= NUM_SYMBOL_TABLES)) if ((iWhichTable < 0) || (iWhichTable >= NUM_SYMBOL_TABLES))
@ -4809,7 +4807,7 @@ Update_t CmdSymbolsLoad (int nArgs)
{ {
TCHAR *pFileName = g_aArgs[ iArg ].sArg; TCHAR *pFileName = g_aArgs[ iArg ].sArg;
_tcscpy(sFileName,progdir); _tcscpy(sFileName,g_sProgramDir);
_tcscat(sFileName, pFileName); _tcscat(sFileName, pFileName);
// Remember File ame of symbols loaded // Remember File ame of symbols loaded
@ -5130,7 +5128,7 @@ Update_t CmdGo (int nArgs)
g_nDebugSkipStart = g_aArgs[ iArg ].nVal1; g_nDebugSkipStart = g_aArgs[ iArg ].nVal1;
WORD nAddress = g_aArgs[ iArg ].nVal2; WORD nAddress = g_aArgs[ iArg ].nVal2;
// int nSlack = (_6502_END_MEM_ADDRESS + 1) - nAddress; // int nSlack = (_6502_MEM_END + 1) - nAddress;
// int nWantedLength = g_aArgs[iArg].nVal2; // int nWantedLength = g_aArgs[iArg].nVal2;
// g_nDebugSkipLen = MIN( nSlack, nWantedLength ); // g_nDebugSkipLen = MIN( nSlack, nWantedLength );
int nEnd = nAddress - g_nDebugSkipStart; int nEnd = nAddress - g_nDebugSkipStart;
@ -5139,7 +5137,7 @@ Update_t CmdGo (int nArgs)
else else
g_nDebugSkipLen = nAddress - g_nDebugSkipStart; g_nDebugSkipLen = nAddress - g_nDebugSkipStart;
g_nDebugSkipLen &= _6502_END_MEM_ADDRESS; g_nDebugSkipLen &= _6502_MEM_END;
} }
// WORD nAddressSymbol = 0; // WORD nAddressSymbol = 0;
@ -5220,7 +5218,7 @@ Update_t CmdTraceFile (int nArgs) {
fclose(g_hTraceFile); fclose(g_hTraceFile);
TCHAR filename[MAX_PATH]; TCHAR filename[MAX_PATH];
_tcscpy(filename,progdir); _tcscpy(filename,g_sProgramDir);
_tcscat(filename,(nArgs && g_aArgs[1].sArg[0]) ? g_aArgs[1].sArg : g_FileNameTrace ); _tcscat(filename,(nArgs && g_aArgs[1].sArg[0]) ? g_aArgs[1].sArg : g_FileNameTrace );
g_hTraceFile = fopen(filename,TEXT("wt")); g_hTraceFile = fopen(filename,TEXT("wt"));
@ -6780,7 +6778,7 @@ bool ProfileSave()
bool bStatus = false; bool bStatus = false;
TCHAR filename[MAX_PATH]; TCHAR filename[MAX_PATH];
_tcscpy(filename,progdir); _tcscpy(filename,g_sProgramDir);
_tcscat(filename,g_FileNameProfile ); // TEXT("Profile.txt")); // =PATCH MJP _tcscat(filename,g_FileNameProfile ); // TEXT("Profile.txt")); // =PATCH MJP
FILE *hFile = fopen(filename,TEXT("wt")); FILE *hFile = fopen(filename,TEXT("wt"));
@ -6828,13 +6826,13 @@ void DebugBegin ()
g_nAppMode = MODE_DEBUG; g_nAppMode = MODE_DEBUG;
FrameRefreshStatus(DRAW_TITLE); FrameRefreshStatus(DRAW_TITLE);
if (apple2e) if (g_bApple2e)
g_aOpcodes = & g_aOpcodes65C02[ 0 ]; // Enhanced Apple //e g_aOpcodes = & g_aOpcodes65C02[ 0 ]; // Enhanced Apple //e
else else
g_aOpcodes = & g_aOpcodes6502[ 0 ]; // Original Apple ][ ][+ g_aOpcodes = & g_aOpcodes6502[ 0 ]; // Original Apple ][ ][+
g_aOpmodes[ AM_2 ].m_nBytes = apple2e ? 2 : 1; g_aOpmodes[ AM_2 ].m_nBytes = g_bApple2e ? 2 : 1;
g_aOpmodes[ AM_3 ].m_nBytes = apple2e ? 3 : 1; g_aOpmodes[ AM_3 ].m_nBytes = g_bApple2e ? 3 : 1;
g_nDisasmCurAddress = regs.pc; g_nDisasmCurAddress = regs.pc;
DisasmCalcTopBotAddress(); DisasmCalcTopBotAddress();
@ -7525,11 +7523,11 @@ void DebuggerProcessKey( int keycode )
else else
{ {
// If you really want $000 at the top of the screen... // If you really want $000 at the top of the screen...
// g_nDisasmTopAddress = _6502_BEG_MEM_ADDRESS; // g_nDisasmTopAddress = _6502_MEM_BEGIN;
// DisasmCalcCurFromTopAddress(); // DisasmCalcCurFromTopAddress();
// DisasmCalcBotFromTopAddress(); // DisasmCalcBotFromTopAddress();
g_nDisasmCurAddress = _6502_BEG_MEM_ADDRESS; g_nDisasmCurAddress = _6502_MEM_BEGIN;
DisasmCalcTopBotAddress(); DisasmCalcTopBotAddress();
} }
bUpdateDisplay |= UPDATE_DISASM; bUpdateDisplay |= UPDATE_DISASM;
@ -7555,11 +7553,11 @@ void DebuggerProcessKey( int keycode )
else else
{ {
// If you really want $8000 at the top of the screen... // If you really want $8000 at the top of the screen...
// g_nDisasmTopAddress = (_6502_END_MEM_ADDRESS / 2) + 1; // g_nDisasmTopAddress = (_6502_MEM_END / 2) + 1;
// DisasmCalcCurFromTopAddress(); // DisasmCalcCurFromTopAddress();
// DisasmCalcTopBotAddress(); // DisasmCalcTopBotAddress();
g_nDisasmCurAddress = (_6502_END_MEM_ADDRESS / 2) + 1; g_nDisasmCurAddress = (_6502_MEM_END / 2) + 1;
DisasmCalcTopBotAddress(); DisasmCalcTopBotAddress();
} }
bUpdateDisplay |= UPDATE_DISASM; bUpdateDisplay |= UPDATE_DISASM;

View File

@ -32,6 +32,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include <assert.h> #include <assert.h>
// NEW UI debugging
// #define DEBUG_FORCE_DISPLAY 1
// Public _________________________________________________________________________________________ // Public _________________________________________________________________________________________
@ -632,6 +635,8 @@ void DrawBreakpoints (HDC dc, int line)
SetTextColor( dc, DebuggerGetColor( iForeground ) ); SetTextColor( dc, DebuggerGetColor( iForeground ) );
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
extern COLORREF gaColorPalette[ NUM_PALETTE ];
int iColor = R8 + (iBreakpoint*2); int iColor = R8 + (iBreakpoint*2);
COLORREF nColor = gaColorPalette[ iColor ]; COLORREF nColor = gaColorPalette[ iColor ];
if (iBreakpoint >= 4) if (iBreakpoint >= 4)

View File

@ -195,12 +195,15 @@ Update_t CmdHelpSpecific (int nArgs)
} }
// If Help on category, push command name as arg // If Help on category, push command name as arg
// Mame has categories:
// General, Memory, Execution, Breakpoints, Watchpoints, Expressions, Comments
int iParam = 0;
int nNewArgs = 0; int nNewArgs = 0;
int iCmdBegin = 0; int iCmdBegin = 0;
int iCmdEnd = 0; int iCmdEnd = 0;
for (iArg = 1; iArg <= nArgs; iArg++ ) for (iArg = 1; iArg <= nArgs; iArg++ )
{ {
int iParam;
int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END ); int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
switch( iParam ) switch( iParam )
{ {
@ -270,7 +273,7 @@ Update_t CmdHelpSpecific (int nArgs)
pCommand = NULL; pCommand = NULL;
} }
if (nFound && (! bAllCommands)) if (nFound && (! bAllCommands) && (! bCategory))
{ {
TCHAR sCategory[ CONSOLE_WIDTH ]; TCHAR sCategory[ CONSOLE_WIDTH ];
int iCmd = g_aCommands[ iCommand ].iCommand; // Unaliased command int iCmd = g_aCommands[ iCommand ].iCommand; // Unaliased command
@ -409,13 +412,13 @@ Update_t CmdHelpSpecific (int nArgs)
break; break;
case CMD_STEP_OUT: case CMD_STEP_OUT:
ConsoleBufferPush( TEXT(" Steps out of current subroutine") ); ConsoleBufferPush( TEXT(" Steps out of current subroutine") );
ConsoleBufferPush( TEXT(" Hotkey: Ctrl-Space" ) ); ConsoleBufferPush( TEXT(" Hotkey: Ctrl-Space" ) ); // TODO: FIXME
break; break;
case CMD_STEP_OVER: // Bad name? FIXME/TODO: do we need to rename? case CMD_STEP_OVER: // Bad name? FIXME/TODO: do we need to rename?
ConsoleBufferPush( TEXT(" Usage: [#]") ); ConsoleBufferPush( TEXT(" Usage: [#]") );
ConsoleBufferPush( TEXT(" Steps, # times, thru current instruction") ); ConsoleBufferPush( TEXT(" Steps, # times, thru current instruction") );
ConsoleBufferPush( TEXT(" JSR will be stepped into AND out of.") ); ConsoleBufferPush( TEXT(" JSR will be stepped into AND out of.") );
ConsoleBufferPush( TEXT(" Hotkey: Ctrl-Space" ) ); ConsoleBufferPush( TEXT(" Hotkey: Ctrl-Space" ) ); // TODO: FIXME
break; break;
case CMD_TRACE: case CMD_TRACE:
ConsoleBufferPush( TEXT(" Usage: [#]") ); ConsoleBufferPush( TEXT(" Usage: [#]") );
@ -432,26 +435,56 @@ Update_t CmdHelpSpecific (int nArgs)
break; break;
// Breakpoints // Breakpoints
case CMD_BREAKPOINT: case CMD_BREAKPOINT:
wsprintf( sText, " Maximum breakpoints are: %d", NUM_BREAKPOINTS ); wsprintf( sText, " Maximum breakpoints: %d", NUM_BREAKPOINTS );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" Usage: [%s | %s | %s]")
, g_aParameters[ PARAM_LOAD ].m_sName
, g_aParameters[ PARAM_SAVE ].m_sName
, g_aParameters[ PARAM_RESET ].m_sName );
ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Set breakpoint at PC if no args.") );
ConsoleBufferPush( TEXT(" Loading/Saving not yet implemented.") );
break; break;
case CMD_BREAKPOINT_ADD_REG: case CMD_BREAKPOINT_ADD_REG:
ConsoleBufferPush( TEXT(" Usage: [A|X|Y|PC|S] [<,=,>] value") ); ConsoleBufferPush( TEXT(" Usage: [A|X|Y|PC|S] [<,=,>] value") );
ConsoleBufferPush( TEXT(" Set breakpoint when reg is [op] value") ); ConsoleBufferPush( TEXT(" Set breakpoint when reg is [op] value") );
break; break;
case CMD_BREAKPOINT_ADD_SMART: case CMD_BREAKPOINT_ADD_SMART:
ConsoleBufferPush( TEXT(" Usage: [address | register]") );
ConsoleBufferPush( TEXT(" If address, sets two breakpoints" ) );
ConsoleBufferPush( TEXT(" 1. one memory access at address" ) );
ConsoleBufferPush( TEXT(" 2. if PC reaches address" ) );
// "Sets a breakpoint at the current PC or specified address." ) );
ConsoleBufferPush( TEXT(" If an IO address, sets breakpoint on IO access.") );
ConsoleBufferPush( TEXT(" If register, sets a breakpoint on memory access at address of register.") );
break;
case CMD_BREAKPOINT_ADD_PC: case CMD_BREAKPOINT_ADD_PC:
ConsoleBufferPush( TEXT(" Usage: [address]") ); ConsoleBufferPush( TEXT(" Usage: [address]") );
ConsoleBufferPush( TEXT(" Sets a breakpoint at the current PC") ); ConsoleBufferPush( TEXT(" Sets a breakpoint at the current PC or at the specified address.") );
ConsoleBufferPush( TEXT(" or at the specified address.") ); break;
case CMD_BREAKPOINT_CLEAR:
ConsoleBufferPush( TEXT(" Usage: [# | *]") );
ConsoleBufferPush( TEXT(" Clears specified breakpoint, or all.") );
wsprintf( sText, TEXT(" i.e. %s 1" ), pCommand->m_sName );
ConsoleBufferPush( sText );
break;
case CMD_BREAKPOINT_DISABLE:
ConsoleBufferPush( TEXT(" Usage: [# [,#] | *]") );
ConsoleBufferPush( TEXT(" Disable breakpoint previously set, or all.") );
wsprintf( sText, TEXT(" i.e. %s 1" ), pCommand->m_sName );
ConsoleBufferPush( sText );
break; break;
case CMD_BREAKPOINT_ENABLE: case CMD_BREAKPOINT_ENABLE:
ConsoleBufferPush( TEXT(" Usage: [# [,#] | *]") ); ConsoleBufferPush( TEXT(" Usage: [# [,#] | *]") );
ConsoleBufferPush( TEXT(" Re-enables breakpoint previously set, or all.") ); ConsoleBufferPush( TEXT(" Re-enables breakpoint previously set, or all.") );
wsprintf( sText, TEXT(" i.e. %s 1" ), pCommand->m_sName );
ConsoleBufferPush( sText );
break;
case CMD_BREAKPOINT_LIST:
break; break;
// Config - Color // Config - Color
case CMD_CONFIG_MENU: case CMD_CONFIG_MENU:
ConsoleBufferPush( TEXT(" Load/Save configuration, or change disasm view options.\n" ) ); ConsoleBufferPush( TEXT(" Load/Save configuration, or change disasm view options." ) );
wsprintf( sText, TEXT(" %s" ": Loads config from last/default \"filename\"" ), g_aParameters[ PARAM_SAVE ].m_sName ); ConsoleBufferPush( sText ); wsprintf( sText, TEXT(" %s" ": Loads config from last/default \"filename\"" ), g_aParameters[ PARAM_SAVE ].m_sName ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" %s" ": Saves config to \"filename\"" ), g_aParameters[ PARAM_LOAD ].m_sName ); ConsoleBufferPush( sText ); wsprintf( sText, TEXT(" %s" ": Saves config to \"filename\"" ), g_aParameters[ PARAM_LOAD ].m_sName ); ConsoleBufferPush( sText );
break; break;
@ -474,38 +507,60 @@ Update_t CmdHelpSpecific (int nArgs)
break; break;
// Config - Diasm // Config - Diasm
case CMD_CONFIG_DISASM: case CMD_CONFIG_DISASM:
ConsoleBufferPush( TEXT("Note: All commands effect the disassembly view" ) ); {
ConsoleBufferPush( TEXT(" Note: All arguments effect the disassembly view" ) );
wsprintf( sText, TEXT(" Usage: %s [#]" ), g_aParameters[ PARAM_CONFIG_BRANCH ].m_sName ); wsprintf( sText, TEXT(" Usage: [%s | %s | %s | %s | %s]")
, g_aParameters[ PARAM_CONFIG_BRANCH ].m_sName
, g_aParameters[ PARAM_CONFIG_COLON ].m_sName
, g_aParameters[ PARAM_CONFIG_OPCODE ].m_sName
, g_aParameters[ PARAM_CONFIG_SPACES ].m_sName
, g_aParameters[ PARAM_CONFIG_TARGET ].m_sName );
ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Display current settings if no args." ) );
iParam = PARAM_CONFIG_BRANCH;
wsprintf( sText, TEXT(" Usage: %s [#]" ), g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Set the type of branch character:" ) ); ConsoleBufferPush( TEXT(" Set the type of branch character:" ) );
wsprintf( sText, TEXT(" %d off, %d plain, %d fancy" ), wsprintf( sText, TEXT(" %d off, %d plain, %d fancy" ),
DISASM_BRANCH_OFF, DISASM_BRANCH_PLAIN, DISASM_BRANCH_FANCY ); DISASM_BRANCH_OFF, DISASM_BRANCH_PLAIN, DISASM_BRANCH_FANCY );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" i.e. %s %s 1" ), pCommand->m_sName, g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ PARAM_CONFIG_COLON ].m_sName ); iParam = PARAM_CONFIG_COLON;
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Display a colon after the address" ) ); ConsoleBufferPush( TEXT(" Display a colon after the address" ) );
wsprintf( sText, TEXT(" i.e. %s %s 0" ), pCommand->m_sName, g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ PARAM_CONFIG_OPCODE ].m_sName ); iParam = PARAM_CONFIG_OPCODE;
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Display opcode(s) after colon" ) ); ConsoleBufferPush( TEXT(" Display opcode(s) after colon" ) );
wsprintf( sText, TEXT(" i.e. %s %s 1" ), pCommand->m_sName, g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ PARAM_CONFIG_SPACES ].m_sName ); iParam = PARAM_CONFIG_SPACES;
wsprintf( sText, TEXT(" Usage: %s [0|1]" ), g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Display spaces between opcodes" ) ); ConsoleBufferPush( TEXT(" Display spaces between opcodes" ) );
wsprintf( sText, TEXT(" i.e. %s %s 0" ), pCommand->m_sName, g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" Usage: %s [#]" ), g_aParameters[ PARAM_CONFIG_TARGET ].m_sName ); iParam = PARAM_CONFIG_TARGET;
wsprintf( sText, TEXT(" Usage: %s [#]" ), g_aParameters[ iParam ].m_sName );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
ConsoleBufferPush( TEXT(" Set the type of target address/value displayed:" ) ); ConsoleBufferPush( TEXT(" Set the type of target address/value displayed:" ) );
wsprintf( sText, TEXT(" %d off, %d value only, %d address only, %d both" ), wsprintf( sText, TEXT(" %d off, %d value only, %d address only, %d both" ),
DISASM_TARGET_OFF, DISASM_TARGET_VAL, DISASM_TARGET_ADDR, DISASM_TARGET_BOTH ); DISASM_TARGET_OFF, DISASM_TARGET_VAL, DISASM_TARGET_ADDR, DISASM_TARGET_BOTH );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" i.e. %s %s %d" ), pCommand->m_sName, g_aParameters[ iParam ].m_sName, DISASM_TARGET_VAL );
// ZZZ - CHAR ConsoleBufferPush( sText );
break; break;
}
// Config - Font // Config - Font
case CMD_CONFIG_FONT: case CMD_CONFIG_FONT:
wsprintf( sText, TEXT(" Usage: [%s | %s] \"FontName\" [Height]" ), wsprintf( sText, TEXT(" Usage: [%s | %s] \"FontName\" [Height]" ),
@ -519,6 +574,7 @@ Update_t CmdHelpSpecific (int nArgs)
FONT_SPACING_CLASSIC, FONT_SPACING_CLEAN, FONT_SPACING_COMPRESSED ); FONT_SPACING_CLASSIC, FONT_SPACING_CLEAN, FONT_SPACING_COMPRESSED );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
break; break;
// Memory // Memory
case CMD_MEMORY_ENTER_BYTE: case CMD_MEMORY_ENTER_BYTE:
ConsoleBufferPush( TEXT(" Usage: {address | symbol} ## [## ... ##]") ); ConsoleBufferPush( TEXT(" Usage: {address | symbol} ## [## ... ##]") );
@ -557,6 +613,22 @@ Update_t CmdHelpSpecific (int nArgs)
// ConsoleBufferPush( TEXT(" Displays text in the Memory Mini-Dump area") ); // ConsoleBufferPush( TEXT(" Displays text in the Memory Mini-Dump area") );
// ConsoleBufferPush( TEXT(" ASCII chars with the hi-bit set, is inverse") ); // ConsoleBufferPush( TEXT(" ASCII chars with the hi-bit set, is inverse") );
break; break;
case CMD_MEMORY_LOAD:
// BLOAD "Filename" addr[,len]
ConsoleBufferPush( TEXT(" Usage: [\"Filename\"] address[,length]" ) );
ConsoleBufferPush( TEXT(" If no filename specified, defaults" ) );
ConsoleBufferPush( TEXT(" to the last filename (if possible)" ) );
break;
case CMD_MEMORY_SAVE:
// BSAVE ["Filename"] addr,len
ConsoleBufferPush( TEXT(" Usage: [\"Filename\"] address,length" ) );
ConsoleBufferPush( TEXT(" If no filename specified, defaults to" ) );
ConsoleBufferPush( TEXT(" '####.####.bin' with the form" ) );
ConsoleBufferPush( TEXT(" {address}.{length}.bin" ) );
break;
// Symbols // Symbols
case CMD_SYMBOLS_MAIN: case CMD_SYMBOLS_MAIN:
case CMD_SYMBOLS_USER: case CMD_SYMBOLS_USER:
@ -595,16 +667,21 @@ Update_t CmdHelpSpecific (int nArgs)
default: default:
if (bAllCommands) if (bAllCommands)
break; break;
//#if DEBUG_COMMAND_HELP
#if _DEBUG
wsprintf( sText, "Command help not done yet: %s", g_aCommands[ iCommand ].m_sName );
ConsoleBufferPush( sText );
#endif
if ((! nFound) || (! pCommand)) if ((! nFound) || (! pCommand))
{ {
wsprintf( sText, " Invalid command." ); wsprintf( sText, " Invalid command." );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
} }
else
{
//#if DEBUG_COMMAND_HELP
#if _DEBUG
wsprintf( sText, "Command help not done yet: %s", g_aCommands[ iCommand ].m_sName );
ConsoleBufferPush( sText );
#endif
}
break; break;
} }

View File

@ -167,7 +167,7 @@ bool ArgsGetValue ( Arg_t *pArg, WORD * pAddressValue_, const int nBase )
if (pArg && pAddressValue_) if (pArg && pAddressValue_)
{ {
*pAddressValue_ = (WORD)(_tcstoul( pSrc, &pEnd, nBase) & _6502_END_MEM_ADDRESS); *pAddressValue_ = (WORD)(_tcstoul( pSrc, &pEnd, nBase) & _6502_MEM_END);
return true; return true;
} }
return false; return false;
@ -373,7 +373,7 @@ void ArgsRawParse ( void )
{ {
pSrc = & (pArg->sArg[ 0 ]); pSrc = & (pArg->sArg[ 0 ]);
nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd, BASE) & _6502_END_MEM_ADDRESS); nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd, BASE) & _6502_MEM_END);
nAddressValue = nAddressArg; nAddressValue = nAddressArg;
bool bFound = false; bool bFound = false;
@ -675,7 +675,7 @@ int ArgsCook ( const int nArgs, const int bProcessMask )
} }
else // not an operator, try (1) address, (2) symbol lookup else // not an operator, try (1) address, (2) symbol lookup
{ {
nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd2, BASE) & _6502_END_MEM_ADDRESS); nAddressArg = (WORD)(_tcstoul( pSrc, &pEnd2, BASE) & _6502_MEM_END);
if (! (pArg->bType & TYPE_NO_REG)) if (! (pArg->bType & TYPE_NO_REG))
{ {

View File

@ -965,8 +965,8 @@
extern const unsigned int _6502_STACK_END ;//= 0x01FF; extern const unsigned int _6502_STACK_END ;//= 0x01FF;
extern const unsigned int _6502_IO_BEGIN ;//= 0xC000; extern const unsigned int _6502_IO_BEGIN ;//= 0xC000;
extern const unsigned int _6502_IO_END ;//= 0xC0FF; extern const unsigned int _6502_IO_END ;//= 0xC0FF;
extern const unsigned int _6502_BEG_MEM_ADDRESS ;//= 0x0000; extern const unsigned int _6502_MEM_BEGIN ;//= 0x0000;
extern const unsigned int _6502_END_MEM_ADDRESS ;//= 0xFFFF; extern const unsigned int _6502_MEM_END ;//= 0xFFFF;
enum DEVICE_e enum DEVICE_e