2006-02-26 06:26:56 +00:00
|
|
|
/*
|
|
|
|
AppleWin : An Apple //e emulator for Windows
|
|
|
|
|
|
|
|
Copyright (C) 1994-1996, Michael O'Brien
|
|
|
|
Copyright (C) 1999-2001, Oliver Schmidt
|
|
|
|
Copyright (C) 2002-2005, Tom Charlesworth
|
2008-08-25 05:25:27 +00:00
|
|
|
Copyright (C) 2006-2008, Tom Charlesworth, Michael Pohoreski
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
AppleWin is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
AppleWin is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with AppleWin; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Description: Debugger
|
|
|
|
*
|
2008-08-25 05:25:27 +00:00
|
|
|
* Author: Copyright (C) 2006-2008 Michael Pohoreski
|
2006-02-26 06:26:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "StdAfx.h"
|
2010-02-14 21:11:26 +00:00
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
#define DEBUG_COLOR_CONSOLE 0
|
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
// Utility ________________________________________________________________________________________
|
|
|
|
|
|
|
|
/*
|
|
|
|
String types:
|
|
|
|
|
|
|
|
http://www.codeproject.com/cpp/unicode.asp
|
|
|
|
|
|
|
|
TEXT() _tcsrev
|
|
|
|
_UNICODE Unicode _wcsrev
|
|
|
|
_MBCS Multi-byte _mbsrev
|
|
|
|
n/a ASCII strrev
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
// tests if pSrc fits into pDst
|
|
|
|
// returns true if pSrc safely fits into pDst, else false (pSrc would of overflowed pDst)
|
|
|
|
//===========================================================================
|
|
|
|
bool TestStringCat ( TCHAR * pDst, LPCSTR pSrc, const int nDstSize )
|
|
|
|
{
|
|
|
|
int nLenDst = _tcslen( pDst );
|
|
|
|
int nLenSrc = _tcslen( pSrc );
|
|
|
|
int nSpcDst = nDstSize - nLenDst;
|
|
|
|
int nChars = MIN( nLenSrc, nSpcDst );
|
|
|
|
|
2006-07-01 06:45:50 +00:00
|
|
|
bool bOverflow = (nSpcDst <= nLenSrc); // 2.5.6.25 BUGFIX
|
2006-02-26 06:26:56 +00:00
|
|
|
if (bOverflow)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// tests if pSrc fits into pDst
|
|
|
|
// returns true if pSrc safely fits into pDst, else false (pSrc would of overflowed pDst)
|
|
|
|
//===========================================================================
|
|
|
|
bool TryStringCat ( TCHAR * pDst, LPCSTR pSrc, const int nDstSize )
|
|
|
|
{
|
|
|
|
int nLenDst = _tcslen( pDst );
|
|
|
|
int nLenSrc = _tcslen( pSrc );
|
|
|
|
int nSpcDst = nDstSize - nLenDst;
|
|
|
|
int nChars = MIN( nLenSrc, nSpcDst );
|
|
|
|
|
|
|
|
bool bOverflow = (nSpcDst < nLenSrc);
|
|
|
|
if (bOverflow)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
_tcsncat( pDst, pSrc, nChars );
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// cats string as much as possible
|
|
|
|
// returns true if pSrc safely fits into pDst, else false (pSrc would of overflowed pDst)
|
|
|
|
//===========================================================================
|
2006-07-05 21:23:13 +00:00
|
|
|
int StringCat ( TCHAR * pDst, LPCSTR pSrc, const int nDstSize )
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
|
|
|
int nLenDst = _tcslen( pDst );
|
|
|
|
int nLenSrc = _tcslen( pSrc );
|
|
|
|
int nSpcDst = nDstSize - nLenDst;
|
|
|
|
int nChars = MIN( nLenSrc, nSpcDst );
|
|
|
|
|
|
|
|
_tcsncat( pDst, pSrc, nChars );
|
|
|
|
|
|
|
|
bool bOverflow = (nSpcDst < nLenSrc);
|
|
|
|
if (bOverflow)
|
2006-07-05 21:23:13 +00:00
|
|
|
return 0;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
2006-07-05 21:23:13 +00:00
|
|
|
return nChars;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Help ___________________________________________________________________________________________
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
Update_t HelpLastCommand()
|
|
|
|
{
|
|
|
|
return Help_Arg_1( g_iCommand );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Loads the arguments with the command to get help on and call display help.
|
|
|
|
//===========================================================================
|
|
|
|
Update_t Help_Arg_1( int iCommandHelp )
|
|
|
|
{
|
|
|
|
_Arg_1( iCommandHelp );
|
|
|
|
|
|
|
|
wsprintf( g_aArgs[ 1 ].sArg, g_aCommands[ iCommandHelp ].m_sName ); // .3 Fixed: Help_Arg_1() now copies command name into arg.name
|
|
|
|
|
|
|
|
return CmdHelpSpecific( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-07-05 21:23:13 +00:00
|
|
|
//===========================================================================
|
|
|
|
void Help_Categories()
|
|
|
|
{
|
|
|
|
const int nBuf = CONSOLE_WIDTH * 2;
|
|
|
|
|
|
|
|
char sText[ nBuf ] = "";
|
|
|
|
int nLen = 0;
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
// TODO/FIXME: Colorize( sText, ... )
|
2008-08-31 08:49:11 +00:00
|
|
|
// Colorize("Usage:")
|
2006-07-09 04:53:08 +00:00
|
|
|
nLen += StringCat( sText, CHC_USAGE , nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
nLen += StringCat( sText, "Usage", nBuf );
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
nLen += StringCat( sText, CHC_DEFAULT, nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
nLen += StringCat( sText, ": " , nBuf );
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
nLen += StringCat( sText, CHC_ARG_OPT, nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
nLen += StringCat( sText, "[ ", nBuf );
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
nLen += StringCat( sText, CHC_ARG_MAND, nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
nLen += StringCat( sText, "< ", nBuf );
|
|
|
|
|
|
|
|
|
|
|
|
for (int iCategory = _PARAM_HELPCATEGORIES_BEGIN ; iCategory < _PARAM_HELPCATEGORIES_END; iCategory++)
|
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
char *pName = g_aParameters[ iCategory ].m_sName;
|
2006-07-05 21:23:13 +00:00
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
if (nLen + strlen( pName ) >= (CONSOLE_WIDTH - 1))
|
2006-07-05 21:23:13 +00:00
|
|
|
{
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sText[ 0 ] = 0;
|
2008-08-31 08:49:11 +00:00
|
|
|
nLen = StringCat( sText, " ", nBuf ); // indent
|
2006-07-05 21:23:13 +00:00
|
|
|
}
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
StringCat( sText, CHC_COMMAND, nBuf );
|
|
|
|
nLen += StringCat( sText, pName , nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
|
|
|
|
if (iCategory < (_PARAM_HELPCATEGORIES_END - 1))
|
|
|
|
{
|
2008-08-31 08:49:11 +00:00
|
|
|
char sSep[] = " | ";
|
|
|
|
|
|
|
|
if (nLen + strlen( sSep ) >= (CONSOLE_WIDTH - 1))
|
|
|
|
{
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sText[ 0 ] = 0;
|
|
|
|
nLen = StringCat( sText, " ", nBuf ); // indent
|
|
|
|
}
|
2006-07-09 04:53:08 +00:00
|
|
|
StringCat( sText, CHC_ARG_SEP, nBuf );
|
2008-08-31 08:49:11 +00:00
|
|
|
nLen += StringCat( sText, sSep, nBuf );
|
2006-07-05 21:23:13 +00:00
|
|
|
}
|
|
|
|
}
|
2006-07-09 04:53:08 +00:00
|
|
|
StringCat( sText, CHC_ARG_MAND, nBuf );
|
|
|
|
StringCat( sText, " >", nBuf);
|
2006-07-05 21:23:13 +00:00
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
StringCat( sText, CHC_ARG_OPT, nBuf );
|
|
|
|
StringCat( sText, " ]", nBuf);
|
2006-07-05 21:23:13 +00:00
|
|
|
|
|
|
|
// ConsoleBufferPush( sText );
|
|
|
|
ConsolePrint( sText ); // Transcode colored text to native console color text
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, "%sNotes%s: %s<>%s = mandatory, %s[]%s = optional, %s|%s argument option"
|
|
|
|
, CHC_USAGE
|
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_ARG_MAND
|
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_ARG_OPT
|
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_ARG_SEP
|
|
|
|
, CHC_DEFAULT
|
2006-07-05 21:23:13 +00:00
|
|
|
);
|
|
|
|
ConsolePrint( sText ); // Transcode colored text to native console color text
|
|
|
|
// ConsoleBufferPush( sText );
|
|
|
|
}
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
void Help_Examples()
|
|
|
|
{
|
|
|
|
char sText[ CONSOLE_WIDTH ];
|
|
|
|
sprintf( sText, " %sExamples%s:"
|
|
|
|
, CHC_USAGE
|
|
|
|
, CHC_DEFAULT
|
|
|
|
);
|
|
|
|
ConsolePrint( sText );
|
|
|
|
}
|
|
|
|
|
2006-07-01 06:45:50 +00:00
|
|
|
//===========================================================================
|
|
|
|
void Help_Range()
|
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Where <range> is of the form:" );
|
|
|
|
ConsoleBufferPush( " address , length [address,address+length)" );
|
|
|
|
ConsoleBufferPush( " address : end [address,end]" );
|
2006-07-01 06:45:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
void Help_Operators()
|
|
|
|
{
|
2006-07-05 21:23:13 +00:00
|
|
|
char sText[ CONSOLE_WIDTH ];
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
// sprintf( sText," %sOperators%s:" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
// sprintf( sText," Operators: (Math)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sMath%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s+%s Addition" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s-%s Subtraction" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s*%s Multiplication" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s/%s Division" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s%%%s Modulas or Remainder" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
//ConsoleBufferPush( " Operators: (Bit Wise)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sBit Wise%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s&%s Bit-wise and (AND)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s|%s Bit-wise or (OR )" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s^%s Bit-wise exclusive-or (EOR/XOR)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s!%s Bit-wise negation (NOT)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
//ConsoleBufferPush( " Operators: (Input)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sInput%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s@%s next number refers to search results", CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s\"%s Designate string in ASCII format" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s\'%s Desginate string in High-Bit apple format", CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s$%s Designate number/symbol" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s#%s Designate number in hex" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
//ConsoleBufferPush( " Operators: (Range)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sRange%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s,%s range seperator (2nd address is relative)", CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s:%s range seperator (2nd address is absolute)", CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
// sprintf( sText," Operators: (Misc)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sMisc%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText," %s//%s comment until end of line" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-05 21:23:13 +00:00
|
|
|
//ConsoleBufferPush( " Operators: (Breakpoint)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText," Operators: (%sBreakpoint%s)" , CHC_USAGE, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
|
|
|
|
_tcscpy( sText, " " );
|
2006-07-09 04:53:08 +00:00
|
|
|
_tcscat( sText, CHC_USAGE );
|
2006-07-01 06:45:50 +00:00
|
|
|
int iBreakOp = 0;
|
|
|
|
for( iBreakOp = 0; iBreakOp < NUM_BREAKPOINT_OPERATORS; iBreakOp++ )
|
|
|
|
{
|
|
|
|
if ((iBreakOp >= PARAM_BP_LESS_EQUAL) &&
|
|
|
|
(iBreakOp <= PARAM_BP_GREATER_EQUAL))
|
|
|
|
{
|
|
|
|
_tcscat( sText, g_aBreakpointSymbols[ iBreakOp ] );
|
|
|
|
_tcscat( sText, " " );
|
|
|
|
}
|
|
|
|
}
|
2006-07-09 04:53:08 +00:00
|
|
|
_tcscat( sText, CHC_DEFAULT );
|
2006-07-07 19:30:39 +00:00
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
}
|
2006-02-26 06:26:56 +00:00
|
|
|
|
2006-07-02 09:57:26 +00:00
|
|
|
void Help_KeyboardShortcuts()
|
|
|
|
{
|
|
|
|
ConsoleBufferPush(" Scrolling:" );
|
|
|
|
ConsoleBufferPush(" Up Arrow" );
|
|
|
|
ConsoleBufferPush(" Down Arrow" );
|
|
|
|
ConsoleBufferPush(" Shift + Up Arrow" );
|
|
|
|
ConsoleBufferPush(" Shift + Down Arrow" );
|
|
|
|
ConsoleBufferPush(" Page Up" );
|
|
|
|
ConsoleBufferPush(" Page Down" );
|
|
|
|
ConsoleBufferPush(" Shift + Page Up" );
|
|
|
|
ConsoleBufferPush(" Shift + Page Down" );
|
|
|
|
|
|
|
|
ConsoleBufferPush(" Bookmarks:" );
|
|
|
|
ConsoleBufferPush(" Ctrl-Shift-#" );
|
|
|
|
ConsoleBufferPush(" Ctrl-# " );
|
|
|
|
}
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
|
|
|
|
void _ColorizeHeader(
|
|
|
|
char * & pDst,const char * & pSrc,
|
|
|
|
const char * pHeader, const int nHeaderLen )
|
|
|
|
{
|
|
|
|
int nLen;
|
|
|
|
|
|
|
|
nLen = strlen( CHC_USAGE );
|
|
|
|
strcpy( pDst, CHC_USAGE );
|
|
|
|
pDst += nLen;
|
|
|
|
|
|
|
|
nLen = nHeaderLen - 1;
|
|
|
|
strncpy( pDst, pHeader, nLen );
|
|
|
|
pDst += nLen;
|
|
|
|
|
|
|
|
pSrc += nHeaderLen;
|
|
|
|
|
|
|
|
nLen = strlen( CHC_ARG_SEP );
|
|
|
|
strcpy( pDst, CHC_ARG_SEP );
|
|
|
|
pDst += nLen;
|
|
|
|
|
|
|
|
*pDst = ':';
|
|
|
|
pDst++;
|
|
|
|
|
|
|
|
nLen = strlen( CHC_DEFAULT );
|
|
|
|
strcpy( pDst, CHC_DEFAULT );
|
|
|
|
pDst += nLen;
|
|
|
|
}
|
|
|
|
|
|
|
|
void _ColorizeOperator(
|
|
|
|
char * & pDst, const char * & pSrc,
|
|
|
|
char * pOperator )
|
|
|
|
{
|
|
|
|
int nLen;
|
|
|
|
|
|
|
|
nLen = strlen( pOperator );
|
|
|
|
strcpy( pDst, pOperator );
|
|
|
|
pDst += nLen;
|
|
|
|
|
|
|
|
*pDst = *pSrc;
|
|
|
|
pDst++;
|
|
|
|
|
|
|
|
nLen = strlen( CHC_DEFAULT );
|
|
|
|
strcpy( pDst, CHC_DEFAULT );
|
|
|
|
pDst += nLen;
|
|
|
|
|
|
|
|
pSrc++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Colorize( char * pDst, const char * pSrc )
|
|
|
|
{
|
|
|
|
if (! pSrc)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if (! pDst)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
const char sNote [] = "Note:";
|
|
|
|
const int nNote = sizeof( sNote ) - 1;
|
|
|
|
|
|
|
|
const char sSeeAlso[] = "See also:";
|
|
|
|
const char nSeeAlso = sizeof( sSeeAlso ) - 1;
|
|
|
|
|
|
|
|
const char sUsage[] = "Usage:";
|
|
|
|
const int nUsage = sizeof( sUsage ) - 1;
|
|
|
|
|
2008-08-31 08:49:11 +00:00
|
|
|
const char sTotal[] = "Total:";
|
|
|
|
const int nTotal = sizeof( sTotal ) - 1;
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
int nLen = 0;
|
|
|
|
while (*pSrc)
|
|
|
|
{
|
|
|
|
if (strncmp( sUsage, pSrc, nUsage) == 0)
|
|
|
|
{
|
|
|
|
_ColorizeHeader( pDst, pSrc, sUsage, nUsage );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (strncmp( sSeeAlso, pSrc, nSeeAlso) == 0)
|
|
|
|
{
|
|
|
|
_ColorizeHeader( pDst, pSrc, sSeeAlso, nSeeAlso );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (strncmp( sNote, pSrc, nNote) == 0)
|
|
|
|
{
|
|
|
|
_ColorizeHeader( pDst, pSrc, sNote, nNote );
|
|
|
|
}
|
|
|
|
else
|
2008-08-31 08:49:11 +00:00
|
|
|
if (strncmp( sTotal, pSrc, nNote) == 0)
|
|
|
|
{
|
|
|
|
_ColorizeHeader( pDst, pSrc, sTotal, nTotal );
|
|
|
|
}
|
|
|
|
else
|
2006-07-09 04:53:08 +00:00
|
|
|
if (*pSrc == '[')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_OPT );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (*pSrc == ']')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_OPT );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (*pSrc == '<')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_MAND );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (*pSrc == '>')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_MAND );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (*pSrc == '|')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_SEP );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
if (*pSrc == '\'')
|
|
|
|
{
|
|
|
|
_ColorizeOperator( pDst, pSrc, CHC_ARG_SEP );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*pDst = *pSrc;
|
|
|
|
pDst++;
|
|
|
|
pSrc++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*pDst = 0;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
//===========================================================================
|
|
|
|
Update_t CmdMOTD( int nArgs )
|
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
char sText[ CONSOLE_WIDTH*2 ];
|
|
|
|
char sTemp[ CONSOLE_WIDTH*2 ];
|
|
|
|
|
|
|
|
#if DEBUG_COLOR_CONSOLE
|
|
|
|
ConsolePrint( "`" );
|
|
|
|
ConsolePrint( "`A" );
|
|
|
|
ConsolePrint( "`2`A" );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
sprintf( sText, "`9`A`7 Apple `9][ ][+ //e `7Emulator for Windows (TM) `9`@" );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
CmdVersion(0);
|
|
|
|
CmdSymbols(0);
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " '%sCtrl ~'%s console, '%s%s'%s (specific), '%s%s'%s (all)"
|
|
|
|
, CHC_KEY
|
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_COMMAND
|
|
|
|
, g_aCommands[ CMD_HELP_SPECIFIC ].m_sName
|
|
|
|
, CHC_DEFAULT
|
|
|
|
// , g_aCommands[ CMD_HELP_SPECIFIC ].pHelpSummary
|
|
|
|
, CHC_COMMAND
|
|
|
|
, g_aCommands[ CMD_HELP_LIST ].m_sName
|
|
|
|
, CHC_DEFAULT
|
|
|
|
// , g_aCommands[ CMD_HELP_LIST ].pHelpSummary
|
2006-02-26 06:26:56 +00:00
|
|
|
);
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, sTemp );
|
2006-07-07 19:30:39 +00:00
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
ConsoleUpdate();
|
|
|
|
|
|
|
|
return UPDATE_ALL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Help on specific command
|
|
|
|
//===========================================================================
|
|
|
|
Update_t CmdHelpSpecific (int nArgs)
|
|
|
|
{
|
|
|
|
int iArg;
|
2006-07-09 04:53:08 +00:00
|
|
|
char sText[ CONSOLE_WIDTH * 2 ];
|
|
|
|
char sTemp[ CONSOLE_WIDTH * 2 ];
|
|
|
|
ZeroMemory( sText, CONSOLE_WIDTH*2 );
|
|
|
|
ZeroMemory( sTemp, CONSOLE_WIDTH*2 );
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
if (! nArgs)
|
|
|
|
{
|
2006-07-05 21:23:13 +00:00
|
|
|
Help_Categories();
|
|
|
|
return ConsoleUpdate();
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
2006-07-01 06:45:50 +00:00
|
|
|
CmdFuncPtr_t pFunction = NULL;
|
2006-02-26 06:26:56 +00:00
|
|
|
bool bAllCommands = false;
|
|
|
|
bool bCategory = false;
|
2006-07-01 06:45:50 +00:00
|
|
|
bool bDisplayCategory = true;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
2006-06-27 22:04:03 +00:00
|
|
|
if ((! _tcscmp( g_aArgs[1].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) ||
|
|
|
|
(! _tcscmp( g_aArgs[1].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName)) )
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
|
|
|
bAllCommands = true;
|
|
|
|
nArgs = NUM_COMMANDS;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If Help on category, push command name as arg
|
2006-06-25 03:43:49 +00:00
|
|
|
// Mame has categories:
|
|
|
|
// General, Memory, Execution, Breakpoints, Watchpoints, Expressions, Comments
|
|
|
|
int iParam = 0;
|
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
int nNewArgs = 0;
|
|
|
|
int iCmdBegin = 0;
|
|
|
|
int iCmdEnd = 0;
|
2006-07-01 06:45:50 +00:00
|
|
|
int nFound = 0;
|
|
|
|
int iCommand = 0;
|
2006-06-27 22:04:03 +00:00
|
|
|
|
|
|
|
if (! bAllCommands)
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
2006-06-27 22:04:03 +00:00
|
|
|
for (iArg = 1; iArg <= nArgs; iArg++ )
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
2006-06-27 22:04:03 +00:00
|
|
|
// int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
|
|
|
|
int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_FUZZY, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
|
2006-07-01 06:45:50 +00:00
|
|
|
bCategory = true;
|
2006-06-27 22:04:03 +00:00
|
|
|
switch( iParam )
|
|
|
|
{
|
2006-07-01 06:45:50 +00:00
|
|
|
case PARAM_CAT_BOOKMARKS : iCmdBegin = CMD_BOOKMARK ; iCmdEnd = CMD_BOOKMARK_SAVE ; break;
|
2006-06-29 05:38:43 +00:00
|
|
|
case PARAM_CAT_BREAKPOINTS: iCmdBegin = CMD_BREAKPOINT ; iCmdEnd = CMD_BREAKPOINT_SAVE ; break;
|
2006-07-01 06:45:50 +00:00
|
|
|
case PARAM_CAT_CONFIG : iCmdBegin = CMD_BENCHMARK ; iCmdEnd = CMD_CONFIG_SAVE ; break;
|
2006-06-29 05:38:43 +00:00
|
|
|
case PARAM_CAT_CPU : iCmdBegin = CMD_ASSEMBLE ; iCmdEnd = CMD_UNASSEMBLE ; break;
|
2009-07-13 18:45:27 +00:00
|
|
|
case PARAM_CAT_FLAGS :
|
|
|
|
// iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N ; break;
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if (nFound && (iCommand != CMD_MEMORY_FILL))
|
|
|
|
{
|
|
|
|
iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N;
|
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
2006-06-29 05:38:43 +00:00
|
|
|
case PARAM_CAT_HELP : iCmdBegin = CMD_HELP_LIST ; iCmdEnd = CMD_MOTD ; break;
|
2006-07-02 09:57:26 +00:00
|
|
|
case PARAM_CAT_KEYBOARD :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if ((!nFound) || (iCommand != CMD_INPUT_KEY))
|
|
|
|
{
|
|
|
|
nArgs = 0;
|
|
|
|
Help_KeyboardShortcuts();
|
|
|
|
}
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
2009-07-13 18:45:27 +00:00
|
|
|
case PARAM_CAT_MEMORY :
|
|
|
|
// iCmdBegin = CMD_MEMORY_COMPARE ; iCmdEnd = CMD_MEMORY_FILL ; break;
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if (nFound && (iCommand != CMD_MEMORY_MOVE))
|
|
|
|
{
|
|
|
|
iCmdBegin = CMD_MEMORY_COMPARE ; iCmdEnd = CMD_MEMORY_FILL ;
|
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
case PARAM_CAT_OUTPUT :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if (nFound && (iCommand != CMD_OUT))
|
|
|
|
{
|
2008-08-25 05:25:27 +00:00
|
|
|
iCmdBegin = CMD_OUTPUT_CALC ; iCmdEnd = CMD_OUTPUT_RUN ;
|
2006-07-09 04:53:08 +00:00
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
|
|
|
|
2006-07-01 06:45:50 +00:00
|
|
|
case PARAM_CAT_SYMBOLS :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if (nFound && (iCommand != CMD_SYMBOLS_LOOKUP) && (iCommand != CMD_MEMORY_SEARCH))
|
|
|
|
{
|
2008-08-25 05:25:27 +00:00
|
|
|
iCmdBegin = CMD_SYMBOLS_LOOKUP ; iCmdEnd = CMD_SYMBOLS_LIST ;
|
2006-07-01 06:45:50 +00:00
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
2008-08-25 05:25:27 +00:00
|
|
|
|
|
|
|
case PARAM_CAT_VIEW :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
// nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
// if (nFound && (iCommand != CMD_VIEW_TEXT4X))
|
|
|
|
{
|
|
|
|
iCmdBegin = CMD_VIEW_TEXT4X ; iCmdEnd = CMD_VIEW_DHGR2 ;
|
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
// else
|
|
|
|
// bCategory = false;
|
|
|
|
break;
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
case PARAM_CAT_WATCHES :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if (nFound && (iCommand != CMD_WATCH_ADD))
|
|
|
|
{
|
2008-08-25 05:25:27 +00:00
|
|
|
iCmdBegin = CMD_WATCH_ADD ; iCmdEnd = CMD_WATCH_LIST ;
|
2006-07-09 04:53:08 +00:00
|
|
|
bCategory = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
|
|
|
|
2006-06-29 05:38:43 +00:00
|
|
|
case PARAM_CAT_WINDOW : iCmdBegin = CMD_WINDOW ; iCmdEnd = CMD_WINDOW_OUTPUT ; break;
|
|
|
|
case PARAM_CAT_ZEROPAGE : iCmdBegin = CMD_ZEROPAGE_POINTER; iCmdEnd = CMD_ZEROPAGE_POINTER_SAVE;break;
|
2006-07-01 06:45:50 +00:00
|
|
|
|
|
|
|
// case PARAM_CAT_EXPRESSION : // fall-through
|
|
|
|
case PARAM_CAT_OPERATORS : nArgs = 0; Help_Operators(); break;
|
|
|
|
|
|
|
|
case PARAM_CAT_RANGE :
|
|
|
|
// HACK: check if we have an exact command match first
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
|
|
|
if ((!nFound) || (iCommand != CMD_REGISTER_SET))
|
|
|
|
{
|
|
|
|
nArgs = 0;
|
|
|
|
Help_Range();
|
|
|
|
}
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
bCategory = false;
|
|
|
|
break;
|
2006-06-27 22:04:03 +00:00
|
|
|
}
|
2006-06-29 05:38:43 +00:00
|
|
|
if (iCmdEnd)
|
|
|
|
iCmdEnd++;
|
2006-06-27 22:04:03 +00:00
|
|
|
nNewArgs = (iCmdEnd - iCmdBegin);
|
|
|
|
if (nNewArgs > 0)
|
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (nNewArgs > 0)
|
|
|
|
{
|
|
|
|
nArgs = nNewArgs;
|
|
|
|
for (iArg = 1; iArg <= nArgs; iArg++ )
|
|
|
|
{
|
2006-06-27 02:32:57 +00:00
|
|
|
#if DEBUG_VAL_2
|
2006-02-26 06:26:56 +00:00
|
|
|
g_aArgs[ iArg ].nVal2 = iCmdBegin + iArg - 1;
|
2006-06-27 02:32:57 +00:00
|
|
|
#endif
|
2006-06-27 05:37:11 +00:00
|
|
|
g_aArgs[ iArg ].nValue = iCmdBegin + iArg - 1;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (iArg = 1; iArg <= nArgs; iArg++ )
|
|
|
|
{
|
2006-07-01 06:45:50 +00:00
|
|
|
iCommand = 0;
|
|
|
|
nFound = 0;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
if (bCategory)
|
|
|
|
{
|
2006-06-27 02:32:57 +00:00
|
|
|
#if DEBUG_VAL_2
|
2006-02-26 06:26:56 +00:00
|
|
|
iCommand = g_aArgs[iArg].nVal2;
|
2006-06-27 02:32:57 +00:00
|
|
|
#endif
|
2006-06-27 05:37:11 +00:00
|
|
|
iCommand = g_aArgs[ iArg ].nValue;
|
2006-06-11 20:11:32 +00:00
|
|
|
nFound = 1;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
2006-06-27 05:37:11 +00:00
|
|
|
else
|
2006-02-26 06:26:56 +00:00
|
|
|
if (bAllCommands)
|
|
|
|
{
|
|
|
|
iCommand = iArg;
|
|
|
|
if (iCommand == NUM_COMMANDS) // skip: Internal Consistency Check __COMMANDS_VERIFY_TXT__
|
|
|
|
continue;
|
2006-06-27 22:04:03 +00:00
|
|
|
nFound = 1;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
2006-06-27 22:04:03 +00:00
|
|
|
else
|
|
|
|
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
if (nFound > 1)
|
|
|
|
{
|
|
|
|
DisplayAmbigiousCommands( nFound );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (iCommand > NUM_COMMANDS)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if ((nArgs == 1) && (! nFound))
|
2006-06-27 02:32:57 +00:00
|
|
|
iCommand = g_aArgs[iArg].nValue;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
Command_t *pCommand = & g_aCommands[ iCommand ];
|
|
|
|
|
|
|
|
if (! nFound)
|
|
|
|
{
|
|
|
|
iCommand = NUM_COMMANDS;
|
|
|
|
pCommand = NULL;
|
|
|
|
}
|
|
|
|
|
2006-07-01 06:45:50 +00:00
|
|
|
// if (nFound && (! bAllCommands) && (! bCategory))
|
|
|
|
if (nFound && (! bAllCommands) && bDisplayCategory)
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
char sCategory[ CONSOLE_WIDTH ];
|
2006-02-26 06:26:56 +00:00
|
|
|
int iCmd = g_aCommands[ iCommand ].iCommand; // Unaliased command
|
|
|
|
|
|
|
|
// HACK: Major kludge to display category!!!
|
2006-06-29 05:38:43 +00:00
|
|
|
if (iCmd <= CMD_UNASSEMBLE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_CPU ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
2006-06-29 05:38:43 +00:00
|
|
|
if (iCmd <= CMD_BOOKMARK_SAVE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_BOOKMARKS ].m_sName );
|
2006-06-29 05:38:43 +00:00
|
|
|
else
|
2006-02-26 06:26:56 +00:00
|
|
|
if (iCmd <= CMD_BREAKPOINT_SAVE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_BREAKPOINTS ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_CONFIG_SAVE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_CONFIG ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_CURSOR_PAGE_DOWN_4K)
|
|
|
|
wsprintf( sCategory, "Scrolling" );
|
|
|
|
else
|
|
|
|
if (iCmd <= CMD_FLAG_SET_N)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_FLAGS ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_MOTD)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_HELP ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_MEMORY_FILL)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_MEMORY ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
2006-06-29 05:38:43 +00:00
|
|
|
if (iCmd <= CMD_OUTPUT_RUN)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_OUTPUT ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_SYNC)
|
|
|
|
wsprintf( sCategory, "Source" );
|
|
|
|
else
|
|
|
|
if (iCmd <= CMD_SYMBOLS_LIST)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_SYMBOLS ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
2008-08-25 05:25:27 +00:00
|
|
|
if (iCmd <= CMD_VIEW_DHGR2)
|
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_VIEW ].m_sName );
|
|
|
|
else
|
2006-02-26 06:26:56 +00:00
|
|
|
if (iCmd <= CMD_WATCH_SAVE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_WATCHES ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_WINDOW_OUTPUT)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_WINDOW ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
if (iCmd <= CMD_ZEROPAGE_POINTER_SAVE)
|
2006-07-01 06:45:50 +00:00
|
|
|
wsprintf( sCategory, g_aParameters[ PARAM_CAT_ZEROPAGE ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
else
|
|
|
|
wsprintf( sCategory, "Unknown!" );
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, "%sCategory%s: %s%s"
|
|
|
|
, CHC_USAGE
|
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_CATEGORY
|
|
|
|
, sCategory );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
|
|
|
|
if (bCategory)
|
|
|
|
if (bDisplayCategory)
|
|
|
|
bDisplayCategory = false;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (pCommand)
|
|
|
|
{
|
|
|
|
char *pHelp = pCommand->pHelpSummary;
|
|
|
|
if (pHelp)
|
|
|
|
{
|
2006-07-01 06:45:50 +00:00
|
|
|
if (bCategory)
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, "%s%8s%s, "
|
|
|
|
, CHC_COMMAND
|
|
|
|
, pCommand->m_sName
|
|
|
|
, CHC_ARG_SEP
|
|
|
|
);
|
2006-07-01 06:45:50 +00:00
|
|
|
else
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, "%s%s%s, "
|
|
|
|
, CHC_COMMAND
|
|
|
|
, pCommand->m_sName
|
|
|
|
, CHC_ARG_SEP
|
|
|
|
);
|
|
|
|
|
|
|
|
// if (! TryStringCat( sText, pHelp, g_nConsoleDisplayWidth ))
|
|
|
|
// {
|
|
|
|
// if (! TryStringCat( sText, pHelp, CONSOLE_WIDTH-1 ))
|
|
|
|
// {
|
|
|
|
strncat( sText, CHC_DEFAULT, CONSOLE_WIDTH );
|
|
|
|
strncat( sText, pHelp , CONSOLE_WIDTH );
|
|
|
|
// ConsoleBufferPush( sText );
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-07-01 06:45:50 +00:00
|
|
|
#if _DEBUG
|
|
|
|
wsprintf( sText, "%s <-- Missing", pCommand->m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
#if DEBUG_COMMAND_HELP
|
|
|
|
if (! bAllCommands) // Release version doesn't display message
|
|
|
|
{
|
|
|
|
wsprintf( sText, "Missing Summary Help: %s", g_aCommands[ iCommand ].aName );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
}
|
|
|
|
#endif
|
2006-07-01 06:45:50 +00:00
|
|
|
#endif
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
2006-07-01 06:45:50 +00:00
|
|
|
|
|
|
|
if (bCategory)
|
|
|
|
continue;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MASTER HELP
|
|
|
|
switch (iCommand)
|
|
|
|
{
|
|
|
|
// CPU / General
|
|
|
|
case CMD_ASSEMBLE:
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Built-in assember isn't functional yet." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_UNASSEMBLE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [address | symbol]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Disassembles memory." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_GO:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: address | symbol [Skip,Length]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Colorize( sText, " Usage: address | symbol [Start:End]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Skip : Start address to skip stepping" );
|
|
|
|
ConsoleBufferPush( " Length: Range of bytes past start address to skip stepping" );
|
|
|
|
ConsoleBufferPush( " End : Inclusive end address to skip stepping" );
|
|
|
|
ConsoleBufferPush( " If the Program Counter is outside the skip range, resumes single-stepping." );
|
|
|
|
ConsoleBufferPush( " Can be used to skip ROM/OS/user code." );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s G C600 FA00,600" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s G C600 F000:FFFF", CHC_EXAMPLE ); ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_JSR:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " %sUsage%s: %s[symbol | address]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Pushes PC on stack; calls the named subroutine." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-06-27 22:04:03 +00:00
|
|
|
case CMD_NOP:
|
|
|
|
ConsoleBufferPush( TEXT(" Puts a NOP opcode at current instruction") );
|
|
|
|
break;
|
|
|
|
case CMD_OUT:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [address8 | address16 | symbol] ## [##]" );
|
|
|
|
ConsolePrint( sText );
|
2006-06-27 22:04:03 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Ouput a byte or word to the IO address $C0xx" ) );
|
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
case CMD_PROFILE:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: [%s | %s | %s]"
|
2006-02-26 06:26:56 +00:00
|
|
|
, g_aParameters[ PARAM_RESET ].m_sName
|
|
|
|
, g_aParameters[ PARAM_SAVE ].m_sName
|
|
|
|
, g_aParameters[ PARAM_LIST ].m_sName
|
|
|
|
);
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " No arguments resets the profile." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
// Registers
|
|
|
|
case CMD_REGISTER_SET:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <reg> <value | expression | symbol>" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Where <reg> is one of: A X Y PC SP " );
|
|
|
|
sprintf( sTemp, " See also: %s%s"
|
|
|
|
, CHC_CATEGORY
|
|
|
|
, g_aParameters[ PARAM_CAT_OPERATORS ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s R PC RESET + 1", CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s R PC $FC58" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s R A A1" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s R A $A1" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s R A #A1" , CHC_EXAMPLE ); ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
case CMD_SOURCE:
|
2006-07-01 06:45:50 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Reads assembler source file." ) );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: [ %s | %s ] \"filename\"" , g_aParameters[ PARAM_SRC_MEMORY ].m_sName, g_aParameters[ PARAM_SRC_SYMBOLS ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sprintf( sText, " %s: read source bytes into memory." , g_aParameters[ PARAM_SRC_MEMORY ].m_sName ); ConsoleBufferPush( sText );
|
|
|
|
sprintf( sText, " %s: read symbols into Source symbol table.", g_aParameters[ PARAM_SRC_SYMBOLS ].m_sName ); ConsoleBufferPush( sText );
|
|
|
|
sprintf( sText, " Supports: %s." , g_aParameters[ PARAM_SRC_MERLIN ].m_sName ); ConsoleBufferPush( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_STEP_OUT:
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Steps out of current subroutine" );
|
|
|
|
ConsoleBufferPush( " Hotkey: Ctrl-Space" ); // TODO: FIXME
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_STEP_OVER: // Bad name? FIXME/TODO: do we need to rename?
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [#]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Steps, # times, thru current instruction" );
|
|
|
|
ConsoleBufferPush( " JSR will be stepped into AND out of." );
|
|
|
|
ConsoleBufferPush( " Hotkey: Ctrl-Space" ); // TODO: FIXME
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_TRACE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [#]" ); ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Traces, # times, current instruction(s)" );
|
|
|
|
ConsoleBufferPush( " JSR will be stepped into" );
|
|
|
|
ConsoleBufferPush( " Hotkey: Shift-Space" );
|
2006-02-26 06:26:56 +00:00
|
|
|
case CMD_TRACE_FILE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: \"[filename]\"" );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_TRACE_LINE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [#]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Traces into current instruction" );
|
|
|
|
ConsoleBufferPush( " with cycle counting." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-06-29 05:38:43 +00:00
|
|
|
// Bookmarks
|
2006-07-01 06:45:50 +00:00
|
|
|
case CMD_BOOKMARK:
|
2006-06-29 05:38:43 +00:00
|
|
|
case CMD_BOOKMARK_ADD:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [address | symbol]" ); ConsolePrint( sText );
|
|
|
|
Colorize( sText, " Usage: # <address | symbol>" ); ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
ConsoleBufferPush(" If no address or symbol is specified, lists the current bookmarks." );
|
|
|
|
ConsoleBufferPush(" Updates the specified bookmark (#)" );
|
2006-07-09 04:53:08 +00:00
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s RESET ", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 1 HOME", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-29 05:38:43 +00:00
|
|
|
break;
|
|
|
|
case CMD_BOOKMARK_CLEAR:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [# | *]" ); ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Clears specified bookmark, or all." );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 1", CHC_EXAMPLE, pCommand->m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-29 05:38:43 +00:00
|
|
|
break;
|
|
|
|
case CMD_BOOKMARK_LIST:
|
2006-07-01 06:45:50 +00:00
|
|
|
// case CMD_BOOKMARK_LOAD:
|
2006-06-29 05:38:43 +00:00
|
|
|
case CMD_BOOKMARK_SAVE:
|
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
// Breakpoints
|
|
|
|
case CMD_BREAKPOINT:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, TEXT(" Usage: [%s%s | %s%s | %s%s]")
|
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_LOAD ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-27 05:37:11 +00:00
|
|
|
, g_aParameters[ PARAM_SAVE ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_RESET ].m_sName );
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-08-16 18:58:56 +00:00
|
|
|
sprintf( sText, " Maximum breakpoints: %s%d", CHC_NUM_DEC, MAX_BREAKPOINTS );
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Set breakpoint at PC if no args." );
|
|
|
|
ConsoleBufferPush( " Loading/Saving not yet implemented." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_ADD_REG:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [A|X|Y|PC|S] [op] <range | value>" );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
ConsoleBufferPush( " Set breakpoint when reg is [op] value" );
|
|
|
|
ConsoleBufferPush( " Default operator is '='" );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " See also: %s%s"
|
|
|
|
, CHC_CATEGORY
|
|
|
|
, g_aParameters[ PARAM_CAT_OPERATORS ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
// ConsoleBufferPush( " Examples:" );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s PC < D000" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s PC = F000:FFFF PC < D000,1000", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s A <= D5" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s A != 01:FF" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s X = A5" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_ADD_SMART:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [address | register]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " If address, sets two breakpoints" );
|
|
|
|
ConsoleBufferPush( " 1. one memory access at address" );
|
|
|
|
ConsoleBufferPush( " 2. if PC reaches address" );
|
|
|
|
// "Sets a breakpoint at the current PC or specified address." );
|
|
|
|
ConsoleBufferPush( " If an IO address, sets breakpoint on IO access." );
|
|
|
|
ConsoleBufferPush( " If register, sets a breakpoint on memory access at address of register." );
|
2006-06-25 03:43:49 +00:00
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
case CMD_BREAKPOINT_ADD_PC:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [address]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Sets a breakpoint at the current PC or at the specified address." );
|
2006-06-25 03:43:49 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_CLEAR:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [# | *]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Clears specified breakpoint, or all." );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 1", CHC_EXAMPLE, pCommand->m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-25 03:43:49 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_DISABLE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [# [,#] | *]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Disable breakpoint previously set, or all." );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 1", CHC_EXAMPLE, pCommand->m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_ENABLE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [# [,#] | *]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Re-enables breakpoint previously set, or all." );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 1", CHC_EXAMPLE, pCommand->m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-25 03:43:49 +00:00
|
|
|
break;
|
|
|
|
case CMD_BREAKPOINT_LIST:
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
// Config - Load / Save
|
|
|
|
case CMD_CONFIG_LOAD:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [\"filename\"]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sprintf( sText, " Load debugger configuration from '%s', or the specificed file.", g_sFileNameConfig ); ConsoleBufferPush( sText );
|
2006-06-11 23:24:39 +00:00
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
case CMD_CONFIG_SAVE:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [\"filename\"]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sprintf( sText, " Save debugger configuration to '%s', or the specificed file.", g_sFileNameConfig ); ConsoleBufferPush( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
|
|
|
// Config - Color
|
2006-02-26 06:26:56 +00:00
|
|
|
case CMD_CONFIG_COLOR:
|
2006-06-28 01:42:51 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Usage: [<#> | <# RR GG BB>]" ) );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" 0 params: switch to 'color' scheme" ) );
|
|
|
|
ConsoleBufferPush( TEXT(" 1 param : dumps R G B for scheme 'color'") );
|
|
|
|
ConsoleBufferPush( TEXT(" 4 params: sets R G B for scheme 'color'" ) );
|
|
|
|
break;
|
|
|
|
case CMD_CONFIG_MONOCHROME:
|
2006-06-28 01:42:51 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Usage: [<#> | <# RR GG BB>]" ) );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" 0 params: switch to 'monochrome' scheme" ) );
|
|
|
|
ConsoleBufferPush( TEXT(" 1 param : dumps R G B for scheme 'monochrome'") );
|
|
|
|
ConsoleBufferPush( TEXT(" 4 params: sets R G B for scheme 'monochrome'" ) );
|
|
|
|
break;
|
2006-06-11 23:24:39 +00:00
|
|
|
// Config - Diasm
|
|
|
|
case CMD_CONFIG_DISASM:
|
2006-06-25 03:43:49 +00:00
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Note: All arguments effect the disassembly view" );
|
|
|
|
ConsolePrint( sText );
|
2006-06-25 03:43:49 +00:00
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: [%s%s | %s%s | %s%s | %s%s | %s%s]"
|
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_CONFIG_BRANCH ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-29 05:38:43 +00:00
|
|
|
, g_aParameters[ PARAM_CONFIG_COLON ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_CONFIG_OPCODE ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_CONFIG_SPACES ].m_sName
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_COMMAND
|
2006-06-25 03:43:49 +00:00
|
|
|
, g_aParameters[ PARAM_CONFIG_TARGET ].m_sName );
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Display current settings if no args." );
|
2006-06-11 23:24:39 +00:00
|
|
|
|
2006-06-25 03:43:49 +00:00
|
|
|
iParam = PARAM_CONFIG_BRANCH;
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: %s [#]", g_aParameters[ iParam ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Set the type of branch character:" );
|
|
|
|
sprintf( sText, " %d off, %d plain, %d fancy",
|
2006-06-13 01:21:45 +00:00
|
|
|
DISASM_BRANCH_OFF, DISASM_BRANCH_PLAIN, DISASM_BRANCH_FANCY );
|
|
|
|
ConsoleBufferPush( sText );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, " i.e. %s%s %s 1", CHC_EXAMPLE, pCommand->m_sName, g_aParameters[ iParam ].m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-11 23:24:39 +00:00
|
|
|
|
2006-06-25 03:43:49 +00:00
|
|
|
iParam = PARAM_CONFIG_COLON;
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: %s [0|1]", g_aParameters[ iParam ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Display a colon after the address" );
|
|
|
|
sprintf( sText, " i.e. %s%s %s 0", CHC_EXAMPLE, pCommand->m_sName, g_aParameters[ iParam ].m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-11 23:24:39 +00:00
|
|
|
|
2006-06-25 03:43:49 +00:00
|
|
|
iParam = PARAM_CONFIG_OPCODE;
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: %s [0|1]", g_aParameters[ iParam ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Display opcode(s) after colon" );
|
|
|
|
sprintf( sText, " i.e. %s%s %s 1", CHC_EXAMPLE, pCommand->m_sName, g_aParameters[ iParam ].m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-11 23:24:39 +00:00
|
|
|
|
2006-06-25 03:43:49 +00:00
|
|
|
iParam = PARAM_CONFIG_SPACES;
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: %s [0|1]", g_aParameters[ iParam ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Display spaces between opcodes" );
|
|
|
|
sprintf( sText, " i.e. %s%s %s 0", CHC_EXAMPLE, pCommand->m_sName, g_aParameters[ iParam ].m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-06-13 01:21:45 +00:00
|
|
|
|
2006-06-25 03:43:49 +00:00
|
|
|
iParam = PARAM_CONFIG_TARGET;
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: %s [#]", g_aParameters[ iParam ].m_sName );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Set the type of target address/value displayed:" );
|
|
|
|
sprintf( sText, " %d off, %d value only, %d address only, %d both",
|
2006-06-13 01:21:45 +00:00
|
|
|
DISASM_TARGET_OFF, DISASM_TARGET_VAL, DISASM_TARGET_ADDR, DISASM_TARGET_BOTH );
|
|
|
|
ConsoleBufferPush( sText );
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, " i.e. %s%s %s %d", CHC_EXAMPLE, pCommand->m_sName, g_aParameters[ iParam ].m_sName, DISASM_TARGET_VAL );
|
|
|
|
ConsolePrint( sText );
|
2006-06-11 23:24:39 +00:00
|
|
|
break;
|
2006-06-25 03:43:49 +00:00
|
|
|
}
|
2006-02-26 06:26:56 +00:00
|
|
|
// Config - Font
|
|
|
|
case CMD_CONFIG_FONT:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, " No longer applicable with new debugger font" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
/*
|
|
|
|
sprintf( sText, TEXT(" Usage: [%s | %s] \"FontName\" [Height]" ),
|
2006-02-26 06:26:56 +00:00
|
|
|
g_aParameters[ PARAM_FONT_MODE ].m_sName, g_aParameters[ PARAM_DISASM ].m_sName );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
ConsoleBufferPush( TEXT(" i.e. FONT \"Courier\" 12" ) );
|
|
|
|
ConsoleBufferPush( TEXT(" i.e. FONT \"Lucida Console\" 12" ) );
|
|
|
|
wsprintf( sText, TEXT(" %s Controls line spacing."), g_aParameters[ PARAM_FONT_MODE ].m_sName );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
wsprintf( sText, TEXT(" Valid values are: %d, %d, %d." ),
|
|
|
|
FONT_SPACING_CLASSIC, FONT_SPACING_CLEAN, FONT_SPACING_COMPRESSED );
|
|
|
|
ConsoleBufferPush( sText );
|
2006-07-09 04:53:08 +00:00
|
|
|
*/
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-06-25 03:43:49 +00:00
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
// Memory
|
|
|
|
case CMD_MEMORY_ENTER_BYTE:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: <address | symbol> ## [## ... ##]" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Sets memory to the specified 8-Bit Values (bytes)" ) );
|
2009-07-13 18:45:27 +00:00
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 00 4C FF69", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s 00:4C FF69", CHC_EXAMPLE ); ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
case CMD_MEMORY_ENTER_WORD:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: <address | symbol> #### [#### ... ####]" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Sets memory to the specified 16-Bit Values (words)" ) );
|
|
|
|
break;
|
|
|
|
case CMD_MEMORY_FILL:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: <address | symbol> <address | symbol> ##" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Fills the memory range with the specified byte" ) );
|
2009-07-13 19:01:15 +00:00
|
|
|
sprintf( sTemp, " Note: Can't fill IO addresses %s$%sC0xx", CHC_ARG_SEP, CHC_ADDRESS );
|
2009-07-13 18:45:27 +00:00
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Help_Examples();
|
2009-07-13 19:01:15 +00:00
|
|
|
sprintf( sText, "%s %s 2000:3FFF 00 // Clear HGR page 1", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 4000,2000 00 // Clear HGR page 2", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 2000 3FFF 00 // Clear HGR page 1", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2009-07-13 18:45:27 +00:00
|
|
|
break;
|
|
|
|
case CMD_MEMORY_MOVE:
|
|
|
|
sprintf( sTemp, " Usage: destination range" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( TEXT(" Copies bytes specified by the range to the destination starting address." ) );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s 4000 2000:3FFF // move HGR page 1 to page 2", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 2001 2000:3FFF // clear $2000-$3FFF with the byte at $2000", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s 2001<2000:3FFFM", CHC_EXAMPLE ); ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
// case CMD_MEM_MINI_DUMP_ASC_1:
|
|
|
|
// case CMD_MEM_MINI_DUMP_ASC_2:
|
|
|
|
case CMD_MEM_MINI_DUMP_ASCII_1:
|
|
|
|
case CMD_MEM_MINI_DUMP_ASCII_2:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: <address | symbol>" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( TEXT(" Displays ASCII text in the Mini-Memory area") );
|
|
|
|
ConsoleBufferPush( TEXT(" ASCII control chars are hilighted") );
|
|
|
|
ConsoleBufferPush( TEXT(" ASCII hi-bit chars are normal") );
|
|
|
|
// break;
|
|
|
|
// case CMD_MEM_MINI_DUMP_TXT_LO_1:
|
|
|
|
// case CMD_MEM_MINI_DUMP_TXT_LO_2:
|
|
|
|
case CMD_MEM_MINI_DUMP_APPLE_1:
|
|
|
|
case CMD_MEM_MINI_DUMP_APPLE_2:
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: <address | symbol>" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Displays APPLE text in the Mini-Memory area" );
|
|
|
|
ConsoleBufferPush( " APPLE control chars are inverse" );
|
|
|
|
ConsoleBufferPush( " APPLE hi-bit chars are normal" );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
// case CMD_MEM_MINI_DUMP_TXT_HI_1:
|
|
|
|
// case CMD_MEM_MINI_DUMP_TXT_HI_2:
|
2006-06-28 01:42:51 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Usage: <address | symbol>") );
|
2006-02-26 06:26:56 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Displays text in the Memory Mini-Dump area") );
|
|
|
|
// ConsoleBufferPush( TEXT(" ASCII chars with the hi-bit set, is inverse") );
|
|
|
|
break;
|
2006-06-25 03:43:49 +00:00
|
|
|
|
|
|
|
case CMD_MEMORY_LOAD:
|
|
|
|
case CMD_MEMORY_SAVE:
|
2006-06-27 22:04:03 +00:00
|
|
|
if (iCommand == CMD_MEMORY_LOAD)
|
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: [\"Filename\"],address[,length]" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sprintf( sTemp, " Usage: [\"Filename\"],range" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
Help_Range();
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Notes: If no filename specified, defaults to the last filename (if possible)" );
|
2006-06-27 22:04:03 +00:00
|
|
|
}
|
|
|
|
if (iCommand == CMD_MEMORY_SAVE)
|
|
|
|
{
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sTemp, " Usage: [\"Filename\"],address,length" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
sprintf( sTemp, " Usage: [\"Filename\"],range" );
|
|
|
|
Colorize( sText, sTemp );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
Help_Range();
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Notes: If no filename specified, defaults to: '####.####.bin'" );
|
|
|
|
ConsoleBufferPush( " Where the form is <address>.<length>.bin" );
|
2006-06-27 22:04:03 +00:00
|
|
|
}
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Examples:" ) );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s BSAVE \"test\",FF00,100" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s BLOAD \"test\",2000:2010" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s BSAVE \"test\",F000:FFFF" , CHC_EXAMPLE ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s BLOAD \"test\",4000" , CHC_EXAMPLE ); ConsolePrint( sText );
|
2006-06-25 03:43:49 +00:00
|
|
|
break;
|
2006-06-29 05:38:43 +00:00
|
|
|
case CMD_MEMORY_SEARCH:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: range <\"ASCII text\" | 'apple text' | hex>" );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
Help_Range();
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Where text is of the form:" );
|
|
|
|
ConsoleBufferPush( " \"...\" designate ASCII text" );
|
|
|
|
ConsoleBufferPush( " '...' designate Apple High-Bit text" );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s F000,1000 'Apple' // search High-Bit", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s MT1 @2" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s D000:FFFF \"FLAS\" // search ASCII ", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s MA1 @1" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s D000,4000 \"EN\" 'D' // Mixed text" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s MT1 @1" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s D000,4000 'Apple' ? ']'" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-29 05:38:43 +00:00
|
|
|
break;
|
|
|
|
case CMD_MEMORY_SEARCH_HEX:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: range [text | byte1 [byte2 ...]]" );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
Help_Range();
|
2006-07-09 04:53:08 +00:00
|
|
|
ConsoleBufferPush( " Where <byte> is of the form:" );
|
|
|
|
ConsoleBufferPush( " ## match specific byte" );
|
|
|
|
ConsoleBufferPush( " #### match specific 16-bit value" );
|
|
|
|
ConsoleBufferPush( " ? match any byte" );
|
|
|
|
ConsoleBufferPush( " ?# match any high nibble, match low nibble to specific number" );
|
|
|
|
ConsoleBufferPush( " #? match specific high nibble, match any low nibble" );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s F000,1000 AD ? C0", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s U @1" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s F000,1000 ?1 C0" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s F000,1000 5? C0" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s F000,1000 10 C?" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s U @2 - 1" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s F000:FFFF C030" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s U @1 - 1" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-29 05:38:43 +00:00
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
// case CMD_MEMORY_SEARCH_APPLE:
|
|
|
|
// wsprintf( sText, TEXT("Deprecated. Use: %s" ), g_aCommands[ CMD_MEMORY_SEARCH ].m_sName ); ConsoleBufferPush( sText );
|
|
|
|
// break;
|
|
|
|
// case CMD_MEMORY_SEARCH_ASCII:
|
|
|
|
// wsprintf( sText, TEXT("Deprecated. Use: %s" ), g_aCommands[ CMD_MEMORY_SEARCH ].m_sName ); ConsoleBufferPush( sText );
|
|
|
|
// break;
|
2006-06-27 22:04:03 +00:00
|
|
|
// Output
|
|
|
|
case CMD_OUTPUT_CALC:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <address | symbol | expression >" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Expression is one of: + - * / % ^ ~" );
|
|
|
|
ConsoleBufferPush( " Output order is: Hex Bin Dec Char" );
|
|
|
|
ConsoleBufferPush( " Note: symbols take piority." );
|
|
|
|
Help_Examples();
|
2009-07-13 18:45:27 +00:00
|
|
|
ConsoleBufferPush( "Note: #A (if you don't want the accumulator value)" );
|
|
|
|
ConsoleBufferPush( "Note: #F (if you don't want the flags value)" );
|
2006-06-27 22:04:03 +00:00
|
|
|
break;
|
|
|
|
case CMD_OUTPUT_ECHO:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: string" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
// ConsoleBufferPush( TEXT(" Examples:" ) );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s Checkpoint", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s PC" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-27 22:04:03 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Echo the string to the console" ) );
|
|
|
|
break;
|
|
|
|
case CMD_OUTPUT_PRINT:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <string | expression> [, string | expression]*" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Colorize( sText, " Note: To print Register values, they must be in upper case" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s \"A:\",A,\" X:\",X", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s A,\" \",X,\" \",Y" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s PC" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-27 22:04:03 +00:00
|
|
|
break;
|
|
|
|
case CMD_OUTPUT_PRINTF:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <string> [, expression, ...]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " The string may contain c-style printf formatting flags: %d %x %z %c" );
|
|
|
|
ConsoleBufferPush( " Where: %d decimal, %x hex, %z binary, %c char, %% percent" );
|
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s \"Dec: %%d Hex: %%x Bin: %%z Char: %c\",A,A,A,A", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s \"%%x %%x %%x\",A,X,Y" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-06-28 01:42:51 +00:00
|
|
|
|
2006-06-27 22:04:03 +00:00
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
// Symbols
|
2006-07-01 06:45:50 +00:00
|
|
|
case CMD_SYMBOLS_LOOKUP:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: symbol [= <address>]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Help_Examples();
|
|
|
|
wsprintf( sText, "%s %s HOME" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
wsprintf( sText, "%s %s LIFE = 2000", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
wsprintf( sText, "%s %s LIFE" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
2009-07-12 21:27:07 +00:00
|
|
|
case CMD_SYMBOLS_ROM:
|
|
|
|
case CMD_SYMBOLS_APPLESOFT:
|
|
|
|
case CMD_SYMBOLS_ASSEMBLY:
|
|
|
|
case CMD_SYMBOLS_USER_1:
|
|
|
|
case CMD_SYMBOLS_USER_2:
|
|
|
|
case CMD_SYMBOLS_SRC_1:
|
|
|
|
case CMD_SYMBOLS_SRC_2:
|
2006-02-26 06:26:56 +00:00
|
|
|
// ConsoleBufferPush( TEXT(" Usage: [ ON | OFF | symbol | address ]" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" Usage: [ LOAD [\"filename\"] | SAVE \"filename\"]" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" ON : Turns symbols on in the disasm window" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" OFF : Turns symbols off in the disasm window" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" LOAD: Loads symbols from last/default filename" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" SAVE: Saves symbol table to file" ) );
|
|
|
|
// ConsoleBufferPush( TEXT(" CLEAR: Clears the symbol table" ) );
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [ <cmd> | symbol | address ]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Where <cmd> is one of:" );
|
2009-07-12 21:27:07 +00:00
|
|
|
sprintf( sText, "%s%-5s%s: Turns symbols on in the disasm window" , CHC_STRING, g_aParameters[ PARAM_ON ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s%-5s%s: Turns symbols off in the disasm window" , CHC_STRING, g_aParameters[ PARAM_OFF ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s%-5s%s: Loads symbols from last/default \"filename\"", CHC_STRING, g_aParameters[ PARAM_SAVE ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s%-5s%s: Saves symbol table to \"filename\"" , CHC_STRING, g_aParameters[ PARAM_LOAD ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s%-5s%s: Clears the symbol table" , CHC_STRING, g_aParameters[ PARAM_CLEAR ].m_sName, CHC_DEFAULT ); ConsolePrint( sText );
|
2010-01-17 18:43:06 +00:00
|
|
|
sprintf( sText, "%s%-5s%s: Remove symbol" , CHC_STRING, g_aTokens[ TOKEN_EXCLAMATION ].sToken, CHC_DEFAULT ); ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
case CMD_SYMBOLS_LIST :
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: symbol" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Looks up symbol in all 3 symbol tables: main, user, source" );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
2008-08-25 05:25:27 +00:00
|
|
|
// View
|
|
|
|
case CMD_VIEW_TEXT4X:
|
|
|
|
case CMD_VIEW_TEXT41:
|
|
|
|
case CMD_VIEW_TEXT42:
|
|
|
|
case CMD_VIEW_TEXT8X:
|
|
|
|
case CMD_VIEW_TEXT81:
|
|
|
|
case CMD_VIEW_TEXT82:
|
|
|
|
case CMD_VIEW_GRX :
|
|
|
|
case CMD_VIEW_GR1 :
|
|
|
|
case CMD_VIEW_GR2 :
|
|
|
|
case CMD_VIEW_DGRX :
|
|
|
|
case CMD_VIEW_DGR1 :
|
|
|
|
case CMD_VIEW_DGR2 :
|
|
|
|
case CMD_VIEW_HGRX :
|
|
|
|
case CMD_VIEW_HGR1 :
|
|
|
|
case CMD_VIEW_HGR2 :
|
|
|
|
case CMD_VIEW_DHGRX :
|
|
|
|
case CMD_VIEW_DHGR1 :
|
|
|
|
case CMD_VIEW_DHGR2 :
|
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
// Watches
|
|
|
|
case CMD_WATCH_ADD:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <address | symbol>" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " Adds the specified memory location to the watch window." );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
// Window
|
|
|
|
case CMD_WINDOW_CODE : // summary is good enough
|
|
|
|
case CMD_WINDOW_CODE_2 : // summary is good enough
|
|
|
|
case CMD_WINDOW_SOURCE_2: // summary is good enough
|
|
|
|
break;
|
2006-07-01 06:45:50 +00:00
|
|
|
// Zero Page pointers
|
|
|
|
case CMD_ZEROPAGE_POINTER:
|
|
|
|
case CMD_ZEROPAGE_POINTER_ADD:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: <address | symbol>" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
Colorize( sText, " Usage: # <address | symbol> [address...]" );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
ConsoleBufferPush(" Adds the specified memory location to the zero page pointer window." );
|
|
|
|
ConsoleBufferPush(" Update the specified zero page pointer (#) with the address." );
|
|
|
|
ConsoleBufferPush(" Note: Displayed as symbol name (if possible) and the 16-bit target pointer" );
|
2006-07-09 04:53:08 +00:00
|
|
|
Help_Examples();
|
|
|
|
sprintf( sText, "%s %s CH" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 0 CV" , CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
|
|
|
sprintf( sText, "%s %s 0 CV CH", CHC_EXAMPLE, pCommand->m_sName ); ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
|
|
|
case CMD_ZEROPAGE_POINTER_CLEAR:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [# | *]" );
|
|
|
|
ConsoleBufferPush( " Clears specified zero page pointer, or all." );
|
|
|
|
sprintf( sText, " i.e. %s%s 1", CHC_EXAMPLE, pCommand->m_sName );
|
|
|
|
ConsolePrint( sText );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
|
|
|
case CMD_ZEROPAGE_POINTER_0:
|
|
|
|
case CMD_ZEROPAGE_POINTER_1:
|
|
|
|
case CMD_ZEROPAGE_POINTER_2:
|
|
|
|
case CMD_ZEROPAGE_POINTER_3:
|
|
|
|
case CMD_ZEROPAGE_POINTER_4:
|
|
|
|
case CMD_ZEROPAGE_POINTER_5:
|
|
|
|
case CMD_ZEROPAGE_POINTER_6:
|
|
|
|
case CMD_ZEROPAGE_POINTER_7:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [<address | symbol>]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " If no address specified, will remove watching the zero page pointer." );
|
2006-07-01 06:45:50 +00:00
|
|
|
break;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
// Misc
|
|
|
|
case CMD_VERSION:
|
2006-07-09 04:53:08 +00:00
|
|
|
Colorize( sText, " Usage: [*]" );
|
|
|
|
ConsolePrint( sText );
|
|
|
|
ConsoleBufferPush( " * Display extra internal stats" );
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
2008-08-25 05:25:27 +00:00
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
default:
|
|
|
|
if (bAllCommands)
|
|
|
|
break;
|
2006-06-25 03:43:49 +00:00
|
|
|
|
|
|
|
if ((! nFound) || (! pCommand))
|
|
|
|
{
|
|
|
|
wsprintf( sText, " Invalid command." );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-06-11 20:11:32 +00:00
|
|
|
//#if DEBUG_COMMAND_HELP
|
|
|
|
#if _DEBUG
|
2008-08-25 05:25:27 +00:00
|
|
|
wsprintf( sText, "Command help not done yet!: %s", g_aCommands[ iCommand ].m_sName );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
#endif
|
|
|
|
}
|
2006-06-25 03:43:49 +00:00
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ConsoleUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
Update_t CmdHelpList (int nArgs)
|
|
|
|
{
|
2008-08-31 08:49:11 +00:00
|
|
|
const int nBuf = CONSOLE_WIDTH * 2;
|
|
|
|
|
|
|
|
char sText[ nBuf ] = "";
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
int nLenLine = strlen( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
int y = 0;
|
|
|
|
int nLinesScrolled = 0;
|
|
|
|
|
|
|
|
int nMaxWidth = g_nConsoleDisplayWidth - 1;
|
|
|
|
int iCommand;
|
|
|
|
|
2008-08-31 08:49:11 +00:00
|
|
|
extern vector<Command_t> g_vSortedCommands;
|
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
if (! g_vSortedCommands.size())
|
|
|
|
{
|
|
|
|
for (iCommand = 0; iCommand < NUM_COMMANDS_WITH_ALIASES; iCommand++ )
|
|
|
|
{
|
|
|
|
g_vSortedCommands.push_back( g_aCommands[ iCommand ] );
|
|
|
|
}
|
|
|
|
std::sort( g_vSortedCommands.begin(), g_vSortedCommands.end(), commands_functor_compare() );
|
|
|
|
}
|
|
|
|
int nCommands = g_vSortedCommands.size();
|
2008-08-31 08:49:11 +00:00
|
|
|
|
|
|
|
int nLen = 0;
|
|
|
|
// Colorize( sText, "Commands: " );
|
|
|
|
StringCat( sText, CHC_USAGE , nBuf );
|
|
|
|
nLen += StringCat( sText, "Commands", nBuf );
|
|
|
|
|
|
|
|
StringCat( sText, CHC_DEFAULT, nBuf );
|
|
|
|
nLen += StringCat( sText, ": " , nBuf );
|
|
|
|
|
2006-02-26 06:26:56 +00:00
|
|
|
for( iCommand = 0; iCommand < NUM_COMMANDS_WITH_ALIASES; iCommand++ ) // aliases are not printed
|
|
|
|
{
|
2008-08-31 08:49:11 +00:00
|
|
|
Command_t *pCommand = & g_vSortedCommands.at( iCommand );
|
|
|
|
// Command_t *pCommand = & g_aCommands[ iCommand ];
|
2006-07-09 04:53:08 +00:00
|
|
|
char *pName = pCommand->m_sName;
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
if (! pCommand->pFunction)
|
|
|
|
continue; // not implemented function
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
int nLenCmd = strlen( pName );
|
2008-08-31 08:49:11 +00:00
|
|
|
if ((nLen + nLenCmd) < (nMaxWidth))
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
2008-08-31 08:49:11 +00:00
|
|
|
StringCat( sText, CHC_COMMAND, nBuf );
|
|
|
|
nLen += StringCat( sText, pName , nBuf );
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-08-31 08:49:11 +00:00
|
|
|
ConsolePrint( sText );
|
|
|
|
nLen = 1;
|
2006-07-09 04:53:08 +00:00
|
|
|
strcpy( sText, " " );
|
2008-08-31 08:49:11 +00:00
|
|
|
StringCat( sText, CHC_COMMAND, nBuf );
|
|
|
|
nLen += StringCat( sText, pName, nBuf );
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
strcat( sText, " " );
|
2008-08-31 08:49:11 +00:00
|
|
|
nLen++;
|
2006-02-26 06:26:56 +00:00
|
|
|
}
|
|
|
|
|
2008-08-31 08:49:11 +00:00
|
|
|
//ConsoleBufferPush( sText );
|
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
ConsoleUpdate();
|
|
|
|
|
|
|
|
return UPDATE_CONSOLE_DISPLAY;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
Update_t CmdVersion (int nArgs)
|
|
|
|
{
|
|
|
|
TCHAR sText[ CONSOLE_WIDTH ];
|
|
|
|
|
|
|
|
unsigned int nVersion = DEBUGGER_VERSION;
|
|
|
|
int nMajor;
|
|
|
|
int nMinor;
|
|
|
|
int nFixMajor;
|
|
|
|
int nFixMinor;
|
|
|
|
UnpackVersion( nVersion, nMajor, nMinor, nFixMajor, nFixMinor );
|
|
|
|
|
2006-07-09 04:53:08 +00:00
|
|
|
sprintf( sText, " Emulator: %s%s%s Debugger: %s%d.%d.%d.%d%s"
|
|
|
|
, CHC_SYMBOL
|
2006-02-26 06:26:56 +00:00
|
|
|
, VERSIONSTRING
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_DEFAULT
|
|
|
|
, CHC_SYMBOL
|
2006-07-03 15:27:49 +00:00
|
|
|
, nMajor, nMinor, nFixMajor, nFixMinor
|
2006-07-09 04:53:08 +00:00
|
|
|
, CHC_DEFAULT
|
2006-07-03 15:27:49 +00:00
|
|
|
);
|
2006-07-07 19:30:39 +00:00
|
|
|
ConsolePrint( sText );
|
2006-02-26 06:26:56 +00:00
|
|
|
|
|
|
|
if (nArgs)
|
|
|
|
{
|
2006-06-27 22:04:03 +00:00
|
|
|
for (int iArg = 1; iArg <= g_nArgRaw; iArg++ )
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
2006-06-27 22:04:03 +00:00
|
|
|
// * PARAM_WILDSTAR -> ? PARAM_MEM_SEARCH_WILD
|
|
|
|
if ((! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName )) ||
|
|
|
|
(! _tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_MEM_SEARCH_WILD ].m_sName )) )
|
2006-02-26 06:26:56 +00:00
|
|
|
{
|
|
|
|
wsprintf( sText, " Arg: %d bytes * %d = %d bytes",
|
|
|
|
sizeof(Arg_t), MAX_ARGS, sizeof(g_aArgs) );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
|
|
|
|
wsprintf( sText, " Console: %d bytes * %d height = %d bytes",
|
|
|
|
sizeof( g_aConsoleDisplay[0] ), CONSOLE_HEIGHT, sizeof(g_aConsoleDisplay) );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
|
|
|
|
wsprintf( sText, " Commands: %d (Aliased: %d) Params: %d",
|
|
|
|
NUM_COMMANDS, NUM_COMMANDS_WITH_ALIASES, NUM_PARAMS );
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
|
|
|
|
wsprintf( sText, " Cursor(%d) T: %04X C: %04X B: %04X %c D: %02X", // Top, Cur, Bot, Delta
|
|
|
|
g_nDisasmCurLine, g_nDisasmTopAddress, g_nDisasmCurAddress, g_nDisasmBotAddress,
|
|
|
|
g_bDisasmCurBad ? TEXT('*') : TEXT(' ')
|
|
|
|
, g_nDisasmBotAddress - g_nDisasmTopAddress
|
|
|
|
);
|
|
|
|
ConsoleBufferPush( sText );
|
|
|
|
|
|
|
|
CmdConfigGetFont( 0 );
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return Help_Arg_1( CMD_VERSION );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ConsoleUpdate();
|
|
|
|
}
|
|
|
|
|