Reorganized info panel
Increased Breakpoints to 15
Increased Watches to 6
Increased Zeropage pointers to 6
Memory dump display SY6522 & AY8910 fixes: MA1 SY0
Fixed _6502_GetTargets() Indirect (Zeropage) Indexed, Y
DISASM POINTER [0|1]
This commit is contained in:
mpohoreski 2006-06-27 22:04:03 +00:00
parent 45ef181d02
commit 5a18e03213
8 changed files with 1034 additions and 428 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,11 @@ using namespace std;
// Benchmarking // Benchmarking
extern DWORD extbench; extern DWORD extbench;
// Bookmarks
extern int g_nBookmarks;
extern Bookmark_t g_aBookmarks[ MAX_BOOKMARKS ];
// extern vector<int> g_aBookmarks;
// Breakpoints // Breakpoints
extern int g_nBreakpoints; extern int g_nBreakpoints;
extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ]; extern Breakpoint_t g_aBreakpoints[ MAX_BREAKPOINTS ];
@ -50,13 +55,15 @@ using namespace std;
extern const int WINDOW_DATA_BYTES_PER_LINE; extern const int WINDOW_DATA_BYTES_PER_LINE;
// Disassembly // Config - Disassembly
extern bool g_bConfigDisasmAddressColon ; extern bool g_bConfigDisasmAddressColon ;
extern bool g_bConfigDisasmOpcodesView ; extern bool g_bConfigDisasmOpcodesView ;
extern bool g_bConfigDisasmOpcodeSpaces ; extern bool g_bConfigDisasmOpcodeSpaces ;
extern int g_iConfigDisasmTargets ; extern int g_iConfigDisasmTargets ;
extern int g_iConfigDisasmBranchType ; extern int g_iConfigDisasmBranchType ;
extern int g_bConfigDisasmImmediateChar; extern int g_bConfigDisasmImmediateChar;
// Config - Info
extern bool g_bConfigInfoTargetPointer ;
// Display // Display
extern bool g_bDebuggerViewingAppleOutput; extern bool g_bDebuggerViewingAppleOutput;

View File

@ -520,7 +520,7 @@ bool _6502_GetTargets ( WORD nAddress, int *pTargetPartial_, int *pTargetPointer
case AM_NZY: // Indirect (Zeropage) Indexed, Y case AM_NZY: // Indirect (Zeropage) Indexed, Y
*pTargetPartial_ = nTarget8; *pTargetPartial_ = nTarget8;
*pTargetPointer_ = (*(LPWORD)(mem + nTarget8)) + regs.y; *pTargetPointer_ = ((*(LPWORD)(mem + nTarget8)) + regs.y) & _6502_MEM_END; // Bugfix:
if (pTargetBytes_) if (pTargetBytes_)
*pTargetBytes_ = 1; *pTargetBytes_ = 1;
break; break;

View File

@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// Display // Display
TCHAR g_aConsolePrompt[] = TEXT(">!"); // input, assembler // NUM_PROMPTS TCHAR g_aConsolePrompt[] = TEXT(">!"); // input, assembler // NUM_PROMPTS
TCHAR g_sConsolePrompt[] = TEXT(">"); // No, NOT Integer Basic! The nostalgic '*' "Monitor" doesn't look as good, IMHO. :-( TCHAR g_sConsolePrompt[] = TEXT(">"); // No, NOT Integer Basic! The nostalgic '*' "Monitor" doesn't look as good, IMHO. :-(
bool g_bConsoleFullWidth = false; bool g_bConsoleFullWidth = true; // false
int g_iConsoleDisplayStart = 0; // to allow scrolling int g_iConsoleDisplayStart = 0; // to allow scrolling
int g_nConsoleDisplayTotal = 0; // number of lines added to console int g_nConsoleDisplayTotal = 0; // number of lines added to console

View File

@ -35,6 +35,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// NEW UI debugging // NEW UI debugging
// #define DEBUG_FORCE_DISPLAY 1 // #define DEBUG_FORCE_DISPLAY 1
#define DISPLAY_MEMORY_TITLE 1
// #define DISPLAY_BREAKPOINT_TITLE 1
// #define DISPLAY_WATCH_TITLE 1
// Public _________________________________________________________________________________________ // Public _________________________________________________________________________________________
@ -69,7 +72,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
const int DISPLAY_WIDTH = 560; const int DISPLAY_WIDTH = 560;
#define SCREENSPLIT1 356 // Horizontal Column (pixels?) of Stack & Regs #define SCREENSPLIT1 356 // Horizontal Column (pixels?) of Stack & Regs
// #define SCREENSPLIT2 456 // Horizontal Column (pixels?) of BPs, Watches & Mem // #define SCREENSPLIT2 456 // Horizontal Column (pixels?) of BPs, Watches & Mem
const int SCREENSPLIT2 = 456-7; // moved left one "char" to show PC in breakpoint: // const int SCREENSPLIT2 = 456-7; // moved left one "char" to show PC in breakpoint:
const int SCREENSPLIT2 = SCREENSPLIT1 + (12 * 7); // moved left 3 chars to show B. prefix in breakpoint #, W. prefix in watch #
const int DISPLAY_BP_COLUMN = SCREENSPLIT2; const int DISPLAY_BP_COLUMN = SCREENSPLIT2;
const int DISPLAY_MINI_CONSOLE = SCREENSPLIT1 - 6; // - 1 chars const int DISPLAY_MINI_CONSOLE = SCREENSPLIT1 - 6; // - 1 chars
@ -82,7 +86,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
const int DISPLAY_WATCHES_COLUMN = SCREENSPLIT2; const int DISPLAY_WATCHES_COLUMN = SCREENSPLIT2;
const int DISPLAY_ZEROPAGE_COLUMN= SCREENSPLIT1; const int DISPLAY_ZEROPAGE_COLUMN= SCREENSPLIT1;
const int MAX_DISPLAY_STACK_LINES = 8; int MAX_DISPLAY_REGS_LINES = 6;
int MAX_DISPLAY_STACK_LINES = 8;
int MAX_DISPLAY_BREAKPOINTS_LINES = 6; // 5
int MAX_DISPLAY_WATCHES_LINES = 6; // 5
int MAX_DISPLAY_MEMORY_LINES_1 = 4;
int MAX_DISPLAY_MEMORY_LINES_2 = 2;
int MAX_DISPLAY_ZEROPAGE_LINES = 5;
int g_nDisplayMemoryLines;
// Height // Height
// const int DISPLAY_LINES = 24; // FIXME: Should be pixels // const int DISPLAY_LINES = 24; // FIXME: Should be pixels
@ -556,11 +567,15 @@ void DrawBreakpoints (HDC dc, int line)
const int MAX_BP_LEN = 16; const int MAX_BP_LEN = 16;
TCHAR sText[16] = TEXT("Breakpoints"); // TODO: Move to BP1 TCHAR sText[16] = TEXT("Breakpoints"); // TODO: Move to BP1
#if DISPLAY_BREAKPOINT_TITLE
SetBkColor(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA SetBkColor(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA
SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC
DebugDrawText( sText, rect ); DebugDrawText( sText, rect );
rect.top += g_nFontHeight; rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight; rect.bottom += g_nFontHeight;
#endif
int nBreakpointsDisplayed = 0;
int iBreakpoint; int iBreakpoint;
for (iBreakpoint = 0; iBreakpoint < MAX_BREAKPOINTS; iBreakpoint++ ) for (iBreakpoint = 0; iBreakpoint < MAX_BREAKPOINTS; iBreakpoint++ )
@ -578,12 +593,25 @@ void DrawBreakpoints (HDC dc, int line)
WORD nAddress1 = pBP->nAddress; WORD nAddress1 = pBP->nAddress;
WORD nAddress2 = nAddress1 + nLength - 1; WORD nAddress2 = nAddress1 + nLength - 1;
#if DEBUG_FORCE_DISPLAY
if (iBreakpoint < MAX_DISPLAY_BREAKPOINTS_LINES)
bSet = true;
#endif
if (! bSet) if (! bSet)
continue; continue;
nBreakpointsDisplayed++;
if (nBreakpointsDisplayed > MAX_DISPLAY_BREAKPOINTS_LINES)
break;
RECT rect2; RECT rect2;
rect2 = rect; rect2 = rect;
SetBkColor( dc, DebuggerGetColor( BG_INFO ));
SetTextColor( dc, DebuggerGetColor( FG_INFO_TITLE ) );
wsprintf( sText, TEXT("B.") );
DebugDrawTextFixed( sText, rect2 );
SetBkColor( dc, DebuggerGetColor( BG_INFO )); SetBkColor( dc, DebuggerGetColor( BG_INFO ));
SetTextColor( dc, DebuggerGetColor( FG_INFO_BULLET ) ); SetTextColor( dc, DebuggerGetColor( FG_INFO_BULLET ) );
wsprintf( sText, TEXT("%d"), iBreakpoint+1 ); wsprintf( sText, TEXT("%d"), iBreakpoint+1 );
@ -688,14 +716,14 @@ void DrawBreakpoints (HDC dc, int line)
DebugDrawTextFixed( sText, rect2 ); DebugDrawTextFixed( sText, rect2 );
} }
// Bugfix: Rest of line is still breakpoint background color // Windows HACK: Bugfix: Rest of line is still breakpoint background color
SetBkColor(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA SetBkColor(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA
SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC
DebugDrawTextHorz( TEXT(" "), rect2 ); DebugDrawTextHorz( TEXT(" "), rect2 );
rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight;
} }
rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight;
} }
} }
@ -1292,6 +1320,8 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
rect.right = DISPLAY_WIDTH; rect.right = DISPLAY_WIDTH;
rect.bottom = rect.top + g_nFontHeight; rect.bottom = rect.top + g_nFontHeight;
RECT rect2;
rect2 = rect;
const int MAX_MEM_VIEW_TXT = 16; const int MAX_MEM_VIEW_TXT = 16;
TCHAR sText[ MAX_MEM_VIEW_TXT * 2 ]; TCHAR sText[ MAX_MEM_VIEW_TXT * 2 ];
@ -1303,6 +1333,7 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
int iForeground = FG_INFO_OPCODE; int iForeground = FG_INFO_OPCODE;
int iBackground = BG_INFO; int iBackground = BG_INFO;
#if DISPLAY_MEMORY_TITLE
if (eDevice == DEV_SY6522) if (eDevice == DEV_SY6522)
{ {
// wsprintf(sData,TEXT("Mem at SY#%d"), nAddr); // wsprintf(sData,TEXT("Mem at SY#%d"), nAddr);
@ -1326,8 +1357,6 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
wsprintf( sType, TEXT("TEXT") ); wsprintf( sType, TEXT("TEXT") );
} }
RECT rect2;
rect2 = rect; rect2 = rect;
SetTextColor( hDC, DebuggerGetColor( FG_INFO_TITLE )); SetTextColor( hDC, DebuggerGetColor( FG_INFO_TITLE ));
SetBkColor( hDC, DebuggerGetColor( BG_INFO )); SetBkColor( hDC, DebuggerGetColor( BG_INFO ));
@ -1338,6 +1367,7 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
SetTextColor( hDC, DebuggerGetColor( FG_INFO_ADDRESS )); SetTextColor( hDC, DebuggerGetColor( FG_INFO_ADDRESS ));
DebugDrawTextLine( sAddress, rect2 ); DebugDrawTextLine( sAddress, rect2 );
#endif
rect.top = rect2.top; rect.top = rect2.top;
rect.bottom = rect2.bottom; rect.bottom = rect2.bottom;
@ -1346,25 +1376,26 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
WORD iAddress = nAddr; WORD iAddress = nAddr;
if( (eDevice == DEV_SY6522) || (eDevice == DEV_AY8910) ) int nLines = g_nDisplayMemoryLines;
{
iAddress = 0;
}
int nLines = 4;
int nCols = 4; int nCols = 4;
if (iView != MEM_VIEW_HEX) if (iView != MEM_VIEW_HEX)
{ {
nCols = MAX_MEM_VIEW_TXT; nCols = MAX_MEM_VIEW_TXT;
} }
rect.right = DISPLAY_WIDTH;
if( (eDevice == DEV_SY6522) || (eDevice == DEV_AY8910) )
{
iAddress = 0;
nCols = 6;
}
rect.right = DISPLAY_WIDTH - 1;
SetTextColor( hDC, DebuggerGetColor( FG_INFO_OPCODE )); SetTextColor( hDC, DebuggerGetColor( FG_INFO_OPCODE ));
for (int iLine = 0; iLine < nLines; iLine++ ) for (int iLine = 0; iLine < nLines; iLine++ )
{ {
RECT rect2;
rect2 = rect; rect2 = rect;
if (iView == MEM_VIEW_HEX) if (iView == MEM_VIEW_HEX)
@ -1393,12 +1424,20 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
// else // else
if (eDevice == DEV_SY6522) if (eDevice == DEV_SY6522)
{ {
wsprintf( sText, TEXT("%02X "), (unsigned) ((BYTE*)&SS_MB.Unit[nAddr & 1].RegsSY6522)[iAddress] ); wsprintf( sText, TEXT("%02X"), (unsigned) ((BYTE*)&SS_MB.Unit[nAddr & 1].RegsSY6522)[iAddress] );
if (iCol & 1)
SetTextColor( hDC, DebuggerGetColor( iForeground ));
else
SetTextColor( hDC, DebuggerGetColor( FG_INFO_ADDRESS ));
} }
else else
if (eDevice == DEV_AY8910) if (eDevice == DEV_AY8910)
{ {
wsprintf( sText, TEXT("%02X "), (unsigned)SS_MB.Unit[nAddr & 1].RegsAY8910[iAddress] ); wsprintf( sText, TEXT("%02X"), (unsigned)SS_MB.Unit[nAddr & 1].RegsAY8910[iAddress] );
if (iCol & 1)
SetTextColor( hDC, DebuggerGetColor( iForeground ));
else
SetTextColor( hDC, DebuggerGetColor( FG_INFO_ADDRESS ));
} }
else else
{ {
@ -1425,11 +1464,15 @@ void DrawMemory (HDC hDC, int line, int iMemDump )
} }
} }
int nChars = DebugDrawTextFixed( sText, rect2 ); // DebugDrawTextFixed() int nChars = DebugDrawTextFixed( sText, rect2 ); // DebugDrawTextFixed()
iAddress++; iAddress++;
} }
rect.top += g_nFontHeight; // TODO/FIXME: g_nFontHeight; // Windows HACK: Bugfix: Rest of line is still background color
rect.bottom += g_nFontHeight; // TODO/FIXME: g_nFontHeight; // SetBkColor( hDC, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA
// SetTextColor(hDC, DebuggerGetColor( FG_INFO_TITLE )); //COLOR_STATIC
// DebugDrawTextHorz( TEXT(" "), rect2 );
rect.top += g_nFontHeight;
rect.bottom += g_nFontHeight;
sData[0] = 0; sData[0] = 0;
} }
} }
@ -1557,7 +1600,9 @@ void DrawStack (HDC dc, int line)
nAddress = 0x100; nAddress = 0x100;
#endif #endif
int iStack = 0; int nFontWidth = g_aFontConfig[ FONT_INFO ]._nFontWidthAvg;
int iStack = 0;
while (iStack < MAX_DISPLAY_STACK_LINES) while (iStack < MAX_DISPLAY_STACK_LINES)
{ {
nAddress++; nAddress++;
@ -1565,30 +1610,33 @@ void DrawStack (HDC dc, int line)
RECT rect; RECT rect;
rect.left = DISPLAY_STACK_COLUMN; rect.left = DISPLAY_STACK_COLUMN;
rect.top = (iStack+line) * g_nFontHeight; rect.top = (iStack+line) * g_nFontHeight;
rect.right = DISPLAY_STACK_COLUMN + 40; // TODO/FIXME/HACK MAGIC #: g_nFontWidthAvg * // rect.right = DISPLAY_STACK_COLUMN + 40;
// rect.right = SCREENSPLIT2;
rect.right = rect.left + (10 * nFontWidth) + 1;
rect.bottom = rect.top + g_nFontHeight; rect.bottom = rect.top + g_nFontHeight;
SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); // [COLOR_STATIC SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); // [COLOR_STATIC
SetBkColor(dc, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA // BG_SOURCE_2 = grey
SetBkColor(dc, DebuggerGetColor( BG_DATA_1 )); // BG_INFO
TCHAR sText[8] = TEXT(""); TCHAR sText[8] = TEXT("");
if (nAddress <= _6502_STACK_END) if (nAddress <= _6502_STACK_END)
{ {
wsprintf(sText,TEXT("%04X"),nAddress); wsprintf(sText,TEXT("%04X: "),nAddress);
} }
DebugDrawText( sText, rect ); DebugDrawTextFixed( sText, rect );
rect.left = DISPLAY_STACK_COLUMN + 40; // TODO/FIXME/HACK MAGIC #: g_nFontWidthAvg * // rect.left = DISPLAY_STACK_COLUMN + 40; // TODO/FIXME/HACK MAGIC #: g_nFontWidthAvg *
rect.right = SCREENSPLIT2; // rect.right = SCREENSPLIT2;
SetTextColor(dc, DebuggerGetColor( FG_INFO_OPCODE )); // COLOR_FG_DATA_TEXT SetTextColor(dc, DebuggerGetColor( FG_INFO_OPCODE )); // COLOR_FG_DATA_TEXT
if (nAddress <= _6502_STACK_END) if (nAddress <= _6502_STACK_END)
{ {
wsprintf(sText,TEXT("%02X"),(unsigned)*(LPBYTE)(mem+nAddress)); wsprintf(sText,TEXT(" %02X"),(unsigned)*(LPBYTE)(mem+nAddress));
} }
DebugDrawText( sText, rect ); DebugDrawTextFixed( sText, rect );
iStack++; iStack++;
} }
} }
@ -1603,6 +1651,7 @@ void DrawTargets (HDC dc, int line)
_6502_GetTargets( regs.pc, &aTarget[0],&aTarget[1], NULL ); _6502_GetTargets( regs.pc, &aTarget[0],&aTarget[1], NULL );
RECT rect; RECT rect;
int nFontWidth = g_aFontConfig[ FONT_INFO ]._nFontWidthAvg;
int iAddress = 2; int iAddress = 2;
while (iAddress--) while (iAddress--)
@ -1611,7 +1660,7 @@ void DrawTargets (HDC dc, int line)
// if ((aTarget[iAddress] >= _6502_IO_BEGIN) && (aTarget[iAddress] <= _6502_IO_END)) // if ((aTarget[iAddress] >= _6502_IO_BEGIN) && (aTarget[iAddress] <= _6502_IO_END))
// aTarget[iAddress] = NO_6502_TARGET; // aTarget[iAddress] = NO_6502_TARGET;
TCHAR sAddress[8] = TEXT(""); TCHAR sAddress[8] = TEXT("-none-");
TCHAR sData[8] = TEXT(""); TCHAR sData[8] = TEXT("");
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
@ -1629,7 +1678,8 @@ void DrawTargets (HDC dc, int line)
rect.left = DISPLAY_TARGETS_COLUMN; rect.left = DISPLAY_TARGETS_COLUMN;
rect.top = (line+iAddress) * g_nFontHeight; rect.top = (line+iAddress) * g_nFontHeight;
int nColumn = DISPLAY_TARGETS_COLUMN + 40; // TODO/FIXME/HACK MAGIC #: g_nFontWidthAvg * // int nColumn = DISPLAY_TARGETS_COLUMN + 40; // TODO/FIXME/HACK MAGIC #: g_nFontWidthAvg *
int nColumn = rect.left + (7 * nFontWidth);
rect.right = nColumn; rect.right = nColumn;
rect.bottom = rect.top + g_nFontHeight; rect.bottom = rect.top + g_nFontHeight;
@ -1641,7 +1691,7 @@ void DrawTargets (HDC dc, int line)
SetBkColor(dc, DebuggerGetColor( BG_INFO )); SetBkColor(dc, DebuggerGetColor( BG_INFO ));
DebugDrawText( sAddress, rect ); DebugDrawText( sAddress, rect );
rect.left = nColumn; // SCREENSPLIT1+40; // + 40 rect.left = nColumn;
rect.right = SCREENSPLIT2; rect.right = SCREENSPLIT2;
if (iAddress == 0) if (iAddress == 0)
@ -1666,9 +1716,13 @@ void DrawWatches (HDC dc, int line)
rect.bottom = rect.top + g_nFontHeight; rect.bottom = rect.top + g_nFontHeight;
TCHAR sText[16] = TEXT("Watches"); TCHAR sText[16] = TEXT("Watches");
SetBkColor(dc, DebuggerGetColor( BG_DATA_1 )); // BG_INFO
#if DISPLAY_WATCH_TITLE
SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE )); SetTextColor(dc, DebuggerGetColor( FG_INFO_TITLE ));
SetBkColor(dc, DebuggerGetColor( BG_INFO ));
DebugDrawTextLine( sText, rect ); DebugDrawTextLine( sText, rect );
#endif
int iWatch; int iWatch;
for (iWatch = 0; iWatch < MAX_WATCHES; iWatch++ ) for (iWatch = 0; iWatch < MAX_WATCHES; iWatch++ )
@ -1681,7 +1735,12 @@ void DrawWatches (HDC dc, int line)
{ {
RECT rect2 = rect; RECT rect2 = rect;
wsprintf( sText,TEXT("%d"),iWatch+1 ); // SetBkColor( dc, DebuggerGetColor( BG_INFO ));
SetTextColor( dc, DebuggerGetColor( FG_INFO_TITLE ) );
wsprintf( sText, TEXT("W.") );
DebugDrawTextFixed( sText, rect2 );
wsprintf( sText,TEXT("%d"),iWatch+1 );
SetTextColor( dc, DebuggerGetColor( FG_INFO_BULLET )); SetTextColor( dc, DebuggerGetColor( FG_INFO_BULLET ));
DebugDrawTextFixed( sText, rect2 ); DebugDrawTextFixed( sText, rect2 );
@ -1689,13 +1748,19 @@ void DrawWatches (HDC dc, int line)
SetTextColor( dc, DebuggerGetColor( FG_INFO_OPERATOR )); SetTextColor( dc, DebuggerGetColor( FG_INFO_OPERATOR ));
DebugDrawTextFixed( sText, rect2 ); DebugDrawTextFixed( sText, rect2 );
wsprintf( sText,TEXT(" %04X"), g_aWatches[iWatch].nAddress ); wsprintf( sText,TEXT("%04X"), g_aWatches[iWatch].nAddress );
SetTextColor( dc, DebuggerGetColor( FG_INFO_ADDRESS )); SetTextColor( dc, DebuggerGetColor( FG_DISASM_ADDRESS ));
DebugDrawTextFixed( sText, rect2 ); DebugDrawTextFixed( sText, rect2 );
wsprintf(sText,TEXT(" %02X"),(unsigned)*(LPBYTE)(mem+g_aWatches[iWatch].nAddress)); BYTE nTarget8 = (unsigned)*(LPBYTE)(mem+g_aWatches[iWatch].nAddress);
wsprintf(sText,TEXT(" %02X"), nTarget8 );
SetTextColor(dc, DebuggerGetColor( FG_INFO_OPCODE )); SetTextColor(dc, DebuggerGetColor( FG_INFO_OPCODE ));
DebugDrawTextFixed( sText, rect2 ); DebugDrawTextFixed( sText, rect2 );
WORD nTarget16 = (unsigned)*(LPWORD)(mem+g_aWatches[iWatch].nAddress);
wsprintf( sText,TEXT(" %04X"), nTarget16 );
SetTextColor( dc, DebuggerGetColor( FG_INFO_ADDRESS ));
DebugDrawTextFixed( sText, rect2 );
} }
rect.top += g_nFontHeight; // HACK: rect.top += g_nFontHeight; // HACK:
@ -1944,15 +2009,26 @@ void DrawSubWindow_Info( int iWindow )
const TCHAR **sReg = g_aBreakpointSource; const TCHAR **sReg = g_aBreakpointSource;
DrawStack(g_hDC,0); int yRegs = 0; // 12
DrawTargets(g_hDC,9); int yStack = yRegs + MAX_DISPLAY_REGS_LINES + 0; // 0
DrawRegister(g_hDC,12, sReg[ BP_SRC_REG_A ] , 1, regs.a , PARAM_REG_A ); int yTarget = yStack + MAX_DISPLAY_STACK_LINES - 2; // 9
DrawRegister(g_hDC,13, sReg[ BP_SRC_REG_X ] , 1, regs.x , PARAM_REG_X ); int yZeroPage = yStack + MAX_DISPLAY_STACK_LINES + 0; // 19
DrawRegister(g_hDC,14, sReg[ BP_SRC_REG_Y ] , 1, regs.y , PARAM_REG_Y );
DrawRegister(g_hDC,15, sReg[ BP_SRC_REG_PC] , 2, regs.pc, PARAM_REG_PC ); DrawRegister( g_hDC,yRegs++, sReg[ BP_SRC_REG_A ] , 1, regs.a , PARAM_REG_A );
DrawRegister(g_hDC,16, sReg[ BP_SRC_REG_S ] , 2, regs.sp, PARAM_REG_SP ); DrawRegister( g_hDC,yRegs++, sReg[ BP_SRC_REG_X ] , 1, regs.x , PARAM_REG_X );
DrawFlags(g_hDC,17,regs.ps,NULL); DrawRegister( g_hDC,yRegs++, sReg[ BP_SRC_REG_Y ] , 1, regs.y , PARAM_REG_Y );
DrawZeroPagePointers(g_hDC,19); DrawRegister( g_hDC,yRegs++, sReg[ BP_SRC_REG_PC] , 2, regs.pc, PARAM_REG_PC );
DrawRegister( g_hDC,yRegs++, sReg[ BP_SRC_REG_S ] , 2, regs.sp, PARAM_REG_SP );
DrawFlags ( g_hDC,yRegs++, regs.ps, NULL);
DrawStack(g_hDC, yStack);
if (g_bConfigInfoTargetPointer)
{
DrawTargets(g_hDC,yTarget);
}
DrawZeroPagePointers( g_hDC, yZeroPage );
#if defined(SUPPORT_Z80_EMU) && defined(OUTPUT_Z80_REGS) #if defined(SUPPORT_Z80_EMU) && defined(OUTPUT_Z80_REGS)
DrawRegister(g_hDC,19,TEXT("AF"),2,*(WORD*)(membank+REG_AF)); DrawRegister(g_hDC,19,TEXT("AF"),2,*(WORD*)(membank+REG_AF));
@ -1962,33 +2038,46 @@ void DrawSubWindow_Info( int iWindow )
DrawRegister(g_hDC,23,TEXT("IX"),2,*(WORD*)(membank+REG_IX)); DrawRegister(g_hDC,23,TEXT("IX"),2,*(WORD*)(membank+REG_IX));
#endif #endif
// Right Side
int yBreakpoints = 0;
int yWatches = yBreakpoints + MAX_DISPLAY_BREAKPOINTS_LINES; // 7
int yMemory = yWatches + MAX_DISPLAY_WATCHES_LINES ; // 14
if ((MAX_DISPLAY_BREAKPOINTS_LINES + MAX_DISPLAY_WATCHES_LINES) < 12)
yWatches++;
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
if (true) if (true)
#else #else
if (g_nBreakpoints) if (g_nBreakpoints)
#endif #endif
DrawBreakpoints(g_hDC,0); DrawBreakpoints( g_hDC, yBreakpoints );
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
if (true) if (true)
#else #else
if (g_nWatches) if (g_nWatches)
#endif #endif
DrawWatches(g_hDC,7); DrawWatches(g_hDC, yWatches );
g_nDisplayMemoryLines = MAX_DISPLAY_MEMORY_LINES_1;
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
if (true) if (true)
#else #else
if (g_aMemDump[0].bActive) if (g_aMemDump[0].bActive)
#endif #endif
DrawMemory(g_hDC, 14, 0 ); // g_aMemDump[0].nAddress, g_aMemDump[0].eDevice); DrawMemory(g_hDC, yMemory, 0 ); // g_aMemDump[0].nAddress, g_aMemDump[0].eDevice);
yMemory += (g_nDisplayMemoryLines + 1);
g_nDisplayMemoryLines = MAX_DISPLAY_MEMORY_LINES_2;
#if DEBUG_FORCE_DISPLAY #if DEBUG_FORCE_DISPLAY
if (true) if (true)
#else #else
if (g_aMemDump[1].bActive) if (g_aMemDump[1].bActive)
#endif #endif
DrawMemory(g_hDC, 19, 1 ); // g_aMemDump[1].nAddress, g_aMemDump[1].eDevice); DrawMemory(g_hDC, yMemory, 1 ); // g_aMemDump[1].nAddress, g_aMemDump[1].eDevice);
} }
@ -2182,7 +2271,7 @@ void DrawWindowBackground_Info( int g_iWindowThis )
RECT viewportrect; RECT viewportrect;
viewportrect.top = 0; viewportrect.top = 0;
viewportrect.left = SCREENSPLIT1 - 6; // 14 // HACK: MAGIC #: 14 -> (g_nFontWidthAvg-1) viewportrect.left = SCREENSPLIT1 - 6; // 14 // HACK: MAGIC #: 14 -> (g_nFontWidthAvg-1)
viewportrect.right = 560; viewportrect.right = DISPLAY_WIDTH;
viewportrect.bottom = DISPLAY_HEIGHT; //g_nFontHeight * MAX_DISPLAY_INFO_LINES; // 384 viewportrect.bottom = DISPLAY_HEIGHT; //g_nFontHeight * MAX_DISPLAY_INFO_LINES; // 384
SetBkColor(g_hDC, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA SetBkColor(g_hDC, DebuggerGetColor( BG_INFO )); // COLOR_BG_DATA

View File

@ -161,11 +161,11 @@ Update_t CmdHelpSpecific (int nArgs)
{ {
// ConsoleBufferPush( TEXT(" [] = optional, {} = mandatory. Categories are: ") ); // ConsoleBufferPush( TEXT(" [] = optional, {} = mandatory. Categories are: ") );
_tcscpy( sText, TEXT("Usage: [{ ") ); _tcscpy( sText, TEXT("Usage: [< ") );
for (int iCategory = _PARAM_HELPCATEGORIES_BEGIN ; iCategory < _PARAM_HELPCATEGORIES_END; iCategory++) for (int iCategory = _PARAM_HELPCATEGORIES_BEGIN ; iCategory < _PARAM_HELPCATEGORIES_END; iCategory++)
{ {
TCHAR *pName = g_aParameters[ iCategory ].m_sName; TCHAR *pName = g_aParameters[ iCategory ].m_sName;
if (! TestStringCat( sText, pName, g_nConsoleDisplayWidth - 3 )) // CONSOLE_WIDTH if (! TestStringCat( sText, pName, CONSOLE_WIDTH - 2 )) // CONSOLE_WIDTH // g_nConsoleDisplayWidth - 3
{ {
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
_tcscpy( sText, TEXT(" ") ); _tcscpy( sText, TEXT(" ") );
@ -177,10 +177,10 @@ Update_t CmdHelpSpecific (int nArgs)
StringCat( sText, TEXT(" | "), CONSOLE_WIDTH ); StringCat( sText, TEXT(" | "), CONSOLE_WIDTH );
} }
} }
StringCat( sText, TEXT(" }]"), CONSOLE_WIDTH ); StringCat( sText, TEXT(" >]"), CONSOLE_WIDTH );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT("Note: [] = optional, {} = mandatory"), CONSOLE_WIDTH ); wsprintf( sText, TEXT("Note: [] = optional, <> = mandatory"), CONSOLE_WIDTH );
ConsoleBufferPush( sText ); ConsoleBufferPush( sText );
} }
@ -188,7 +188,8 @@ Update_t CmdHelpSpecific (int nArgs)
bool bAllCommands = false; bool bAllCommands = false;
bool bCategory = false; bool bCategory = false;
if (! _tcscmp( g_aArgs[1].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName)) 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)) )
{ {
bAllCommands = true; bAllCommands = true;
nArgs = NUM_COMMANDS; nArgs = NUM_COMMANDS;
@ -202,26 +203,30 @@ Update_t CmdHelpSpecific (int nArgs)
int nNewArgs = 0; int nNewArgs = 0;
int iCmdBegin = 0; int iCmdBegin = 0;
int iCmdEnd = 0; int iCmdEnd = 0;
for (iArg = 1; iArg <= nArgs; iArg++ )
if (! bAllCommands)
{ {
// int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END ); for (iArg = 1; iArg <= nArgs; iArg++ )
int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_FUZZY, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
switch( iParam )
{ {
case PARAM_CAT_BREAKPOINTS: iCmdBegin = CMD_BREAKPOINT ; iCmdEnd = CMD_BREAKPOINT_SAVE + 1; break; // int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_EXACT, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
case PARAM_CAT_CONFIG : iCmdBegin = CMD_CONFIG_COLOR ; iCmdEnd = CMD_CONFIG_SAVE + 1; break; int nFoundCategory = FindParam( g_aArgs[ iArg ].sArg, MATCH_FUZZY, iParam, _PARAM_HELPCATEGORIES_BEGIN, _PARAM_HELPCATEGORIES_END );
case PARAM_CAT_CPU : iCmdBegin = CMD_ASSEMBLE ; iCmdEnd = CMD_TRACE_LINE + 1; break; switch( iParam )
case PARAM_CAT_FLAGS : iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N + 1; break; {
case PARAM_CAT_MEMORY : iCmdBegin = CMD_MEMORY_COMPARE ; iCmdEnd = CMD_MEMORY_FILL + 1; break; case PARAM_CAT_BREAKPOINTS: iCmdBegin = CMD_BREAKPOINT ; iCmdEnd = CMD_BREAKPOINT_SAVE + 1; break;
case PARAM_CAT_SYMBOLS : iCmdBegin = CMD_SYMBOLS_LOOKUP ; iCmdEnd = CMD_SYMBOLS_LIST + 1; break; case PARAM_CAT_CONFIG : iCmdBegin = CMD_CONFIG_COLOR ; iCmdEnd = CMD_CONFIG_SAVE + 1; break;
case PARAM_CAT_WATCHES : iCmdBegin = CMD_WATCH_ADD ; iCmdEnd = CMD_WATCH_LIST + 1; break; case PARAM_CAT_CPU : iCmdBegin = CMD_ASSEMBLE ; iCmdEnd = CMD_TRACE_LINE + 1; break;
case PARAM_CAT_WINDOW : iCmdBegin = CMD_WINDOW ; iCmdEnd = CMD_WINDOW_OUTPUT + 1; break; case PARAM_CAT_FLAGS : iCmdBegin = CMD_FLAG_CLEAR ; iCmdEnd = CMD_FLAG_SET_N + 1; break;
case PARAM_CAT_ZEROPAGE : iCmdBegin = CMD_ZEROPAGE_POINTER; iCmdEnd = CMD_ZEROPAGE_POINTER_SAVE+1;break; case PARAM_CAT_MEMORY : iCmdBegin = CMD_MEMORY_COMPARE ; iCmdEnd = CMD_MEMORY_FILL + 1; break;
default: break; case PARAM_CAT_SYMBOLS : iCmdBegin = CMD_SYMBOLS_LOOKUP ; iCmdEnd = CMD_SYMBOLS_LIST + 1; break;
case PARAM_CAT_WATCHES : iCmdBegin = CMD_WATCH_ADD ; iCmdEnd = CMD_WATCH_LIST + 1; break;
case PARAM_CAT_WINDOW : iCmdBegin = CMD_WINDOW ; iCmdEnd = CMD_WINDOW_OUTPUT + 1; break;
case PARAM_CAT_ZEROPAGE : iCmdBegin = CMD_ZEROPAGE_POINTER; iCmdEnd = CMD_ZEROPAGE_POINTER_SAVE+1;break;
default: break;
}
nNewArgs = (iCmdEnd - iCmdBegin);
if (nNewArgs > 0)
break;
} }
nNewArgs = (iCmdEnd - iCmdBegin);
if (nNewArgs > 0)
break;
} }
if (nNewArgs > 0) if (nNewArgs > 0)
@ -254,14 +259,15 @@ Update_t CmdHelpSpecific (int nArgs)
nFound = 1; nFound = 1;
} }
else else
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
if (bAllCommands) if (bAllCommands)
{ {
iCommand = iArg; iCommand = iArg;
if (iCommand == NUM_COMMANDS) // skip: Internal Consistency Check __COMMANDS_VERIFY_TXT__ if (iCommand == NUM_COMMANDS) // skip: Internal Consistency Check __COMMANDS_VERIFY_TXT__
continue; continue;
nFound = 1;
} }
else
nFound = FindCommand( g_aArgs[iArg].sArg, pFunction, & iCommand );
if (nFound > 1) if (nFound > 1)
{ {
@ -380,13 +386,6 @@ Update_t CmdHelpSpecific (int nArgs)
ConsoleBufferPush( TEXT(" Usage: {address | symbol}") ); ConsoleBufferPush( TEXT(" Usage: {address | symbol}") );
ConsoleBufferPush( TEXT(" Disassembles memory.") ); ConsoleBufferPush( TEXT(" Disassembles memory.") );
break; break;
case CMD_CALC:
ConsoleBufferPush( TEXT(" Usage: {address | symbol | + | - }" ) );
ConsoleBufferPush( TEXT(" Output order is: Hex Bin Dec Char" ) );
ConsoleBufferPush( TEXT(" Note: symbols take piority." ) );
ConsoleBufferPush( TEXT("i.e. #A (if you don't want accum. val)" ) );
ConsoleBufferPush( TEXT("i.e. #F (if you don't want flags val)" ) );
break;
case CMD_GO: case CMD_GO:
ConsoleBufferPush( TEXT(" Usage: address | symbol [Skip,Length]]") ); ConsoleBufferPush( TEXT(" Usage: address | symbol [Skip,Length]]") );
ConsoleBufferPush( TEXT(" addres | symbol [Start:End]") ); ConsoleBufferPush( TEXT(" addres | symbol [Start:End]") );
@ -399,13 +398,17 @@ Update_t CmdHelpSpecific (int nArgs)
ConsoleBufferPush( TEXT(" G C600 FA00,600" ) ); ConsoleBufferPush( TEXT(" G C600 FA00,600" ) );
ConsoleBufferPush( TEXT(" G C600 F000:FFFF" ) ); ConsoleBufferPush( TEXT(" G C600 F000:FFFF" ) );
break; break;
case CMD_NOP:
ConsoleBufferPush( TEXT(" Puts a NOP opcode at current instruction") );
break;
case CMD_JSR: case CMD_JSR:
ConsoleBufferPush( TEXT(" Usage: {symbol | address}") ); ConsoleBufferPush( TEXT(" Usage: {symbol | address}") );
ConsoleBufferPush( TEXT(" Pushes PC on stack; calls the named subroutine.") ); ConsoleBufferPush( TEXT(" Pushes PC on stack; calls the named subroutine.") );
break; break;
case CMD_NOP:
ConsoleBufferPush( TEXT(" Puts a NOP opcode at current instruction") );
break;
case CMD_OUT:
ConsoleBufferPush( TEXT(" Usage: {address8 | address16 | symbol} ## [##]") );
ConsoleBufferPush( TEXT(" Ouput a byte or word to the IO address $C0xx" ) );
break;
case CMD_PROFILE: case CMD_PROFILE:
wsprintf( sText, TEXT(" Usage: [%s | %s | %s]") wsprintf( sText, TEXT(" Usage: [%s | %s | %s]")
, g_aParameters[ PARAM_RESET ].m_sName , g_aParameters[ PARAM_RESET ].m_sName
@ -513,10 +516,6 @@ Update_t CmdHelpSpecific (int nArgs)
ConsoleBufferPush( TEXT(" 1 param : dumps R G B for scheme 'monochrome'") ); ConsoleBufferPush( TEXT(" 1 param : dumps R G B for scheme 'monochrome'") );
ConsoleBufferPush( TEXT(" 4 params: sets R G B for scheme 'monochrome'" ) ); ConsoleBufferPush( TEXT(" 4 params: sets R G B for scheme 'monochrome'" ) );
break; break;
case CMD_OUTPUT:
ConsoleBufferPush( TEXT(" Usage: {address8 | address16 | symbol} ## [##]") );
ConsoleBufferPush( TEXT(" Ouput a byte or word to the IO address $C0xx" ) );
break;
// Config - Diasm // Config - Diasm
case CMD_CONFIG_DISASM: case CMD_CONFIG_DISASM:
{ {
@ -628,24 +627,55 @@ Update_t CmdHelpSpecific (int nArgs)
case CMD_MEMORY_LOAD: case CMD_MEMORY_LOAD:
// BLOAD "Filename" addr[,len] // BLOAD "Filename" addr[,len]
ConsoleBufferPush( TEXT(" Usage: [\"Filename\"],address[,length]" ) );
ConsoleBufferPush( TEXT(" If no filename specified, defaults to the last filename (if possible)" ) );
ConsoleBufferPush( TEXT(" Examples:" ) );
ConsoleBufferPush( TEXT(" BSAVE \"test\",FF00,100" ) );
ConsoleBufferPush( TEXT(" BLOAD \"test\",2000" ) );
break;
case CMD_MEMORY_SAVE: case CMD_MEMORY_SAVE:
// BSAVE ["Filename"] addr,len // BSAVE ["Filename"] addr,len
ConsoleBufferPush( TEXT(" Usage: [\"Filename\"],address[,length]" ) );
ConsoleBufferPush( TEXT(" If no filename specified, defaults to:" ) ); if (iCommand == CMD_MEMORY_LOAD)
ConsoleBufferPush( TEXT(" '####.####.bin' with the form" ) ); {
ConsoleBufferPush( TEXT(" {address}.{length}.bin" ) ); ConsoleBufferPush( TEXT(" Usage: [\"Filename\"],address[,length]" ) );
ConsoleBufferPush( TEXT(" If no filename specified, defaults to the last filename (if possible)" ) );
}
if (iCommand == CMD_MEMORY_SAVE)
{
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" ) );
}
ConsoleBufferPush( TEXT(" Examples:" ) ); ConsoleBufferPush( TEXT(" Examples:" ) );
ConsoleBufferPush( TEXT(" BSAVE \"test\",FF00,100" ) ); ConsoleBufferPush( TEXT(" BSAVE \"test\",FF00,100" ) );
ConsoleBufferPush( TEXT(" BLOAD \"test\",2000" ) ); ConsoleBufferPush( TEXT(" BLOAD \"test\",2000" ) );
break; break;
// Output
case CMD_OUTPUT_CALC:
ConsoleBufferPush( TEXT(" Usage: <address | symbol | expression >" ) );
ConsoleBufferPush( TEXT(" Expression is one of: + - * / % ^ ~" ) );
ConsoleBufferPush( TEXT(" Output order is: Hex Bin Dec Char" ) );
ConsoleBufferPush( TEXT(" Note: symbols take piority." ) );
ConsoleBufferPush( TEXT("i.e. #A (if you don't want accum. val)" ) );
ConsoleBufferPush( TEXT("i.e. #F (if you don't want flags val)" ) );
break;
case CMD_OUTPUT_ECHO:
ConsoleBufferPush( TEXT(" Usage: string" ) );
ConsoleBufferPush( TEXT(" Examples:" ) );
wsprintf( sText, TEXT(" %s Checkpoint"), pCommand->m_sName ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" %s PC" ), pCommand->m_sName ); ConsoleBufferPush( sText );
// ConsoleBufferPush( TEXT(" Echo the string to the console" ) );
break;
case CMD_OUTPUT_PRINT:
ConsoleBufferPush( TEXT(" Usage: <string | expression> [, string | expression" ) );
ConsoleBufferPush( TEXT(" Examples:") );
wsprintf( sText, TEXT(" %s \"A:\",A,\" X:\",X"), pCommand->m_sName ); ConsoleBufferPush( sText );
wsprintf( sText, TEXT(" %s PC" ), pCommand->m_sName ); ConsoleBufferPush( sText );
break;
case CMD_OUTPUT_PRINTF:
ConsoleBufferPush( TEXT(" Usage: \"<Text>\" | expression [,]" ) );
ConsoleBufferPush( TEXT(" Text may contain formatting flags: %d %x %z" ) );
ConsoleBufferPush( TEXT(" %d DEC, %x HEX, %z BIN" ) );
ConsoleBufferPush( TEXT(" Examples:") );
ConsoleBufferPush( TEXT(" PRINTF \"A Dec: %d\",A,\" Hex: %x\",A,\" Bin: %z\",A" ) );
break;
// Symbols // Symbols
case CMD_SYMBOLS_MAIN: case CMD_SYMBOLS_MAIN:
case CMD_SYMBOLS_USER: case CMD_SYMBOLS_USER:
@ -784,9 +814,11 @@ Update_t CmdVersion (int nArgs)
if (nArgs) if (nArgs)
{ {
for (int iArg = 1; iArg <= nArgs; iArg++ ) for (int iArg = 1; iArg <= g_nArgRaw; iArg++ )
{ {
if (_tcscmp( g_aArgs[ iArg ].sArg, g_aParameters[ PARAM_WILDSTAR ].m_sName ) == 0) // * 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 )) )
{ {
wsprintf( sText, " Arg: %d bytes * %d = %d bytes", wsprintf( sText, " Arg: %d bytes * %d = %d bytes",
sizeof(Arg_t), MAX_ARGS, sizeof(g_aArgs) ); sizeof(Arg_t), MAX_ARGS, sizeof(g_aArgs) );

View File

@ -72,8 +72,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
{ TOKEN_QUOTE_DOUBLE, TYPE_QUOTED_2, TEXT('"') }, // for strings { TOKEN_QUOTE_DOUBLE, TYPE_QUOTED_2, TEXT('"') }, // for strings
{ TOKEN_RIGHT_PAREN , TYPE_OPERATOR, TEXT(')') }, { TOKEN_RIGHT_PAREN , TYPE_OPERATOR, TEXT(')') },
{ TOKEN_SEMI , TYPE_STRING , TEXT(';') }, { TOKEN_SEMI , TYPE_STRING , TEXT(';') },
{ TOKEN_SPACE , TYPE_STRING , TEXT(' ') } // space is also a delimiter between tokens/args { TOKEN_SPACE , TYPE_STRING , TEXT(' ') }, // space is also a delimiter between tokens/args
// { TOKEN_STAR , TYPE_OPERATOR, TEXT('*') }, // Not a token 1) wildcard needs to stay together with other chars { TOKEN_STAR , TYPE_OPERATOR, TEXT('*') } // Not a token 1) wildcard needs to stay together with other chars
// { TOKEN_TAB , TYPE_STRING , TEXT('\t') } // { TOKEN_TAB , TYPE_STRING , TEXT('\t') }
// { TOKEN_TILDE , TYPE_OPERATOR, TEXT('~') }, // C/C++: Not. Used for console. // { TOKEN_TILDE , TYPE_OPERATOR, TEXT('~') }, // C/C++: Not. Used for console.
}; };
@ -496,6 +496,10 @@ int ArgsCook ( const int nArgs, const int bProcessMask )
pPrev = pArg - 1; pPrev = pArg - 1;
// Pass wildstar '*' to commands if only arg
if ((pArg->eToken == TOKEN_STAR) && (nArg == 1))
;
else
if (nArgsLeft > 0) // These ops take at least 1 argument if (nArgsLeft > 0) // These ops take at least 1 argument
{ {
pNext = pArg + 1; pNext = pArg + 1;
@ -604,6 +608,18 @@ int ArgsCook ( const int nArgs, const int bProcessMask )
nParamLen = 2; nParamLen = 2;
} }
if (bProcessMask & (1 << TOKEN_STAR))
if (pArg->eToken == TOKEN_STAR) // STAR * delta
{
if (! ArgsGetImmediateValue( pNext, & nAddressRHS ))
{
ArgsGetRegisterValue( pNext, & nAddressRHS );
}
pPrev->nValue *= nAddressRHS;
pPrev->bType |= TYPE_VALUE; // signal already up to date
nParamLen = 2;
}
if (bProcessMask & (1 << TOKEN_FSLASH)) if (bProcessMask & (1 << TOKEN_FSLASH))
if (pArg->eToken == TOKEN_FSLASH) // FORWARD SLASH / delta if (pArg->eToken == TOKEN_FSLASH) // FORWARD SLASH / delta
{ {

View File

@ -141,14 +141,10 @@
MAX_BOOKMARKS = 10 MAX_BOOKMARKS = 10
}; };
extern vector<int> g_aBookmarks;
// Breakpoints ____________________________________________________________________________________ // Breakpoints ____________________________________________________________________________________
enum enum
{ {
// NUMBREAKPOINTS = 15
MAX_BREAKPOINTS = 15 MAX_BREAKPOINTS = 15
}; };
@ -203,9 +199,9 @@
BP_OP_NOT_EQUAL , // ! REG BP_OP_NOT_EQUAL , // ! REG
BP_OP_GREATER_THAN , // > REG BP_OP_GREATER_THAN , // > REG
BP_OP_GREATER_EQUAL, // >= REG BP_OP_GREATER_EQUAL, // >= REG
BP_OP_READ , // ? MEM BP_OP_READ , // @ MEM @ ? *
BP_OP_WRITE , // @ MEM BP_OP_WRITE , // * MEM @ ? *
BP_OP_READ_WRITE , // * MEM BP_OP_READ_WRITE , // ? MEM @ ? *
NUM_BREAKPOINT_OPERATORS NUM_BREAKPOINT_OPERATORS
}; };
@ -219,6 +215,7 @@
bool bEnabled; bool bEnabled;
}; };
typedef Breakpoint_t Bookmark_t;
typedef Breakpoint_t Watches_t; typedef Breakpoint_t Watches_t;
typedef Breakpoint_t ZeroPagePointers_t; typedef Breakpoint_t ZeroPagePointers_t;
@ -399,22 +396,30 @@
enum Commands_e enum Commands_e
{ {
// Main / CPU // Main / CPU
CMD_ASSEMBLE CMD_CURSOR_JUMP_PC // Shift
, CMD_UNASSEMBLE , CMD_CURSOR_SET_PC // Ctrl
, CMD_ASSEMBLE
, CMD_BREAK_INVALID , CMD_BREAK_INVALID
, CMD_BREAK_OPCODE , CMD_BREAK_OPCODE
, CMD_CALC
, CMD_GO , CMD_GO
, CMD_INPUT , CMD_IN
, CMD_INPUT_KEY , CMD_INPUT_KEY
, CMD_JSR , CMD_JSR
, CMD_OUTPUT
, CMD_NOP , CMD_NOP
, CMD_OUT
, CMD_STEP_OVER , CMD_STEP_OVER
, CMD_STEP_OUT , CMD_STEP_OUT
, CMD_TRACE , CMD_TRACE
, CMD_TRACE_FILE , CMD_TRACE_FILE
, CMD_TRACE_LINE , CMD_TRACE_LINE
, CMD_UNASSEMBLE
// Bookmarks
, CMD_BOOKMARK_MENU
, CMD_BOOKMARK_ADD
, CMD_BOOKMARK_CLEAR
, CMD_BOOKMARK_LIST
, CMD_BOOKMARK_LOAD
, CMD_BOOKMARK_SAVE
// Breakpoints // Breakpoints
, CMD_BREAKPOINT , CMD_BREAKPOINT
, CMD_BREAKPOINT_ADD_SMART // smart breakpoint , CMD_BREAKPOINT_ADD_SMART // smart breakpoint
@ -424,6 +429,7 @@
// , CMD_BREAKPOINT_EXEC = CMD_BREAKPOINT_ADD_ADDR // alias // , CMD_BREAKPOINT_EXEC = CMD_BREAKPOINT_ADD_ADDR // alias
, CMD_BREAKPOINT_ADD_IO // break on: [$C000-$C7FF] Load/Store , CMD_BREAKPOINT_ADD_IO // break on: [$C000-$C7FF] Load/Store
, CMD_BREAKPOINT_ADD_MEM // break on: [$0000-$FFFF], excluding IO , CMD_BREAKPOINT_ADD_MEM // break on: [$0000-$FFFF], excluding IO
, CMD_BREAKPOINT_CLEAR , CMD_BREAKPOINT_CLEAR
// , CMD_BREAKPOINT_REMOVE = CMD_BREAKPOINT_CLEAR // alias // , CMD_BREAKPOINT_REMOVE = CMD_BREAKPOINT_CLEAR // alias
, CMD_BREAKPOINT_DISABLE , CMD_BREAKPOINT_DISABLE
@ -450,17 +456,13 @@
// , CMD_CONFIG_DISASM_OPCODE // , CMD_CONFIG_DISASM_OPCODE
// , CMD_CONFIG_DISASM_SPACES // , CMD_CONFIG_DISASM_SPACES
, CMD_CONFIG_ECHO
, CMD_CONFIG_FONT , CMD_CONFIG_FONT
// , CMD_CONFIG_FONT2 // PARAM_FONT_DISASM PARAM_FONT_INFO PARAM_FONT_SOURCE // , CMD_CONFIG_FONT2 // PARAM_FONT_DISASM PARAM_FONT_INFO PARAM_FONT_SOURCE
, CMD_CONFIG_HCOLOR // TODO Video :: SETFRAMECOLOR(#,R,G,B) , CMD_CONFIG_HCOLOR // TODO Video :: SETFRAMECOLOR(#,R,G,B)
, CMD_CONFIG_LOAD , CMD_CONFIG_LOAD
, CMD_CONFIG_MONOCHROME // MONO # rr gg bb , CMD_CONFIG_MONOCHROME // MONO # rr gg bb
, CMD_CONFIG_RUN
, CMD_CONFIG_SAVE , CMD_CONFIG_SAVE
// Cursor // Cursor
, CMD_CURSOR_JUMP_PC // Shift
, CMD_CURSOR_SET_PC // Ctrl
, CMD_CURSOR_JUMP_RET_ADDR , CMD_CURSOR_JUMP_RET_ADDR
, CMD_CURSOR_LINE_UP // Smart Line Up , CMD_CURSOR_LINE_UP // Smart Line Up
, CMD_CURSOR_LINE_UP_1 // Shift , CMD_CURSOR_LINE_UP_1 // Shift
@ -510,7 +512,7 @@
, CMD_MEM_MINI_DUMP_HEX_1 , CMD_MEM_MINI_DUMP_HEX_1
, CMD_MEM_MINI_DUMP_HEX_2 , CMD_MEM_MINI_DUMP_HEX_2
, _CMD_MEM_MINI_DUMP_HEX_1_3 // alias M1 , _CMD_MEM_MINI_DUMP_HEX_1_3 // alias M1
, _CMD_MEM_MINI_DUMP_HEX_2_1 // alias M2 , _CMD_MEM_MINI_DUMP_HEX_2_1 // alias M2
, CMD_MEM_MINI_DUMP_ASCII_1 // ASCII , CMD_MEM_MINI_DUMP_ASCII_1 // ASCII
, CMD_MEM_MINI_DUMP_ASCII_2 , CMD_MEM_MINI_DUMP_ASCII_2
@ -533,6 +535,12 @@
, CMD_MEMORY_SEARCH_APPLE // Flashing Chars, Hi-Bit Set , CMD_MEMORY_SEARCH_APPLE // Flashing Chars, Hi-Bit Set
, CMD_MEMORY_SEARCH_HEX , CMD_MEMORY_SEARCH_HEX
, CMD_MEMORY_FILL , CMD_MEMORY_FILL
// Output
, CMD_OUTPUT_CALC
, CMD_OUTPUT_ECHO
, CMD_OUTPUT_PRINT
, CMD_OUTPUT_PRINTF
, CMD_OUTPUT_RUN
// Registers - CPU // Registers - CPU
, CMD_REGISTER_SET , CMD_REGISTER_SET
// Source Level Debugging // Source Level Debugging
@ -615,23 +623,30 @@
// CPU // CPU
Update_t CmdCursorJumpPC(int nArgs);
Update_t CmdCursorSetPC (int nArgs);
Update_t CmdAssemble (int nArgs); Update_t CmdAssemble (int nArgs);
Update_t CmdUnassemble (int nArgs); // code dump, aka, Unassemble
Update_t CmdBreakInvalid(int nArgs); // Breakpoint IFF Full-speed! Update_t CmdBreakInvalid(int nArgs); // Breakpoint IFF Full-speed!
Update_t CmdBreakOpcode (int nArgs); // Breakpoint IFF Full-speed! Update_t CmdBreakOpcode (int nArgs); // Breakpoint IFF Full-speed!
Update_t CmdCalculator (int nArgs);
Update_t CmdGo (int nArgs); Update_t CmdGo (int nArgs);
Update_t CmdInput (int nArgs); Update_t CmdIn (int nArgs);
Update_t CmdKey (int nArgs);
Update_t CmdJSR (int nArgs); Update_t CmdJSR (int nArgs);
Update_t CmdNOP (int nArgs); Update_t CmdNOP (int nArgs);
Update_t CmdOutput (int nArgs); Update_t CmdOut (int nArgs);
Update_t CmdFeedKey (int nArgs);
Update_t CmdStepOut (int nArgs);
Update_t CmdStepOver (int nArgs); Update_t CmdStepOver (int nArgs);
Update_t CmdStepOut (int nArgs);
Update_t CmdTrace (int nArgs); // alias for CmdStepIn Update_t CmdTrace (int nArgs); // alias for CmdStepIn
Update_t CmdTraceFile (int nArgs); Update_t CmdTraceFile (int nArgs);
Update_t CmdTraceLine (int nArgs); Update_t CmdTraceLine (int nArgs);
Update_t CmdUnassemble (int nArgs); // code dump, aka, Unassemble
// Bookmarks
Update_t CmdBookmarkMenu (int nArgs);
Update_t CmdBookmarkAdd (int nArgs);
Update_t CmdBookmarkClear (int nArgs);
Update_t CmdBookmarkList (int nArgs);
Update_t CmdBookmarkLoad (int nArgs);
Update_t CmdBookmarkSave (int nArgs);
// Breakpoints // Breakpoints
Update_t CmdBreakpointMenu (int nArgs); Update_t CmdBreakpointMenu (int nArgs);
Update_t CmdBreakpointAddSmart(int nArgs); Update_t CmdBreakpointAddSmart(int nArgs);
@ -660,11 +675,9 @@
Update_t CmdConfigBaseDec (int nArgs); Update_t CmdConfigBaseDec (int nArgs);
Update_t CmdConfigColorMono (int nArgs); Update_t CmdConfigColorMono (int nArgs);
Update_t CmdConfigDisasm (int nArgs); Update_t CmdConfigDisasm (int nArgs);
Update_t CmdConfigEcho (int nArgs);
Update_t CmdConfigFont (int nArgs); Update_t CmdConfigFont (int nArgs);
Update_t CmdConfigHColor (int nArgs); Update_t CmdConfigHColor (int nArgs);
Update_t CmdConfigLoad (int nArgs); Update_t CmdConfigLoad (int nArgs);
Update_t CmdConfigRun (int nArgs);
Update_t CmdConfigSave (int nArgs); Update_t CmdConfigSave (int nArgs);
Update_t CmdConfigSetFont (int nArgs); Update_t CmdConfigSetFont (int nArgs);
Update_t CmdConfigGetFont (int nArgs); Update_t CmdConfigGetFont (int nArgs);
@ -672,10 +685,8 @@
Update_t CmdCursorFollowTarget(int nArgs); Update_t CmdCursorFollowTarget(int nArgs);
Update_t CmdCursorLineDown (int nArgs); Update_t CmdCursorLineDown (int nArgs);
Update_t CmdCursorLineUp (int nArgs); Update_t CmdCursorLineUp (int nArgs);
Update_t CmdCursorJumpPC (int nArgs);
Update_t CmdCursorJumpRetAddr (int nArgs); Update_t CmdCursorJumpRetAddr (int nArgs);
Update_t CmdCursorRunUntil (int nArgs); Update_t CmdCursorRunUntil (int nArgs);
Update_t CmdCursorSetPC (int nArgs);
Update_t CmdCursorPageDown (int nArgs); Update_t CmdCursorPageDown (int nArgs);
Update_t CmdCursorPageDown256 (int nArgs); Update_t CmdCursorPageDown256 (int nArgs);
Update_t CmdCursorPageDown4K (int nArgs); Update_t CmdCursorPageDown4K (int nArgs);
@ -689,7 +700,6 @@
Update_t CmdHelpSpecific (int Argss); Update_t CmdHelpSpecific (int Argss);
Update_t CmdVersion (int nArgs); Update_t CmdVersion (int nArgs);
Update_t CmdMOTD (int nArgs); Update_t CmdMOTD (int nArgs);
// Flags // Flags
Update_t CmdFlag (int nArgs); Update_t CmdFlag (int nArgs);
Update_t CmdFlagClear (int nArgs); Update_t CmdFlagClear (int nArgs);
@ -715,6 +725,12 @@
Update_t CmdMemorySearchAscii (int nArgs); Update_t CmdMemorySearchAscii (int nArgs);
Update_t CmdMemorySearchApple (int nArgs); Update_t CmdMemorySearchApple (int nArgs);
Update_t CmdMemorySearchHex (int nArgs); Update_t CmdMemorySearchHex (int nArgs);
// Output/Scripts
Update_t CmdOutputCalc (int nArgs);
Update_t CmdOutputEcho (int nArgs);
Update_t CmdOutputPrint (int nArgs);
Update_t CmdOutputPrintf (int nArgs);
Update_t CmdOutputRun (int nArgs);
// Registers // Registers
Update_t CmdRegisterSet (int nArgs); Update_t CmdRegisterSet (int nArgs);
// Source Level Debugging // Source Level Debugging
@ -1087,6 +1103,7 @@
, TOKEN_RIGHT_PAREN // ) , TOKEN_RIGHT_PAREN // )
, TOKEN_SEMI // ; Command Seperator , TOKEN_SEMI // ; Command Seperator
, TOKEN_SPACE // Token Delimiter , TOKEN_SPACE // Token Delimiter
, TOKEN_STAR // *
// , TOKEN_TAB // '\t' // , TOKEN_TAB // '\t'
, NUM_TOKENS // signal none, or bad , NUM_TOKENS // signal none, or bad
@ -1179,10 +1196,11 @@
// Disasm // Disasm
, _PARAM_CONFIG_BEGIN = _PARAM_REGS_END // Daisy Chain , _PARAM_CONFIG_BEGIN = _PARAM_REGS_END // Daisy Chain
, PARAM_CONFIG_BRANCH = _PARAM_CONFIG_BEGIN // g_iConfigDisasmBranchType [0|1|2] , PARAM_CONFIG_BRANCH = _PARAM_CONFIG_BEGIN // g_iConfigDisasmBranchType [0|1|2]
, PARAM_CONFIG_COLON // g_bConfigDisasmAddressColon [0|1] , PARAM_CONFIG_COLON // g_bConfigDisasmAddressColon [0|1]
, PARAM_CONFIG_OPCODE // g_bConfigDisasmOpcodesView [0|1] , PARAM_CONFIG_OPCODE // g_bConfigDisasmOpcodesView [0|1]
, PARAM_CONFIG_SPACES // g_bConfigDisasmOpcodeSpaces [0|1] , PARAM_CONFIG_POINTER // g_bConfigInfoTargetPointer [0|1]
, PARAM_CONFIG_TARGET // g_iConfigDisasmTargets [0 | 1 | 2] , PARAM_CONFIG_SPACES // g_bConfigDisasmOpcodeSpaces [0|1]
, PARAM_CONFIG_TARGET // g_iConfigDisasmTargets [0|1|2]
, _PARAM_CONFIG_END , _PARAM_CONFIG_END
, PARAM_CONFIG_NUM = _PARAM_CONFIG_END - _PARAM_CONFIG_BEGIN , PARAM_CONFIG_NUM = _PARAM_CONFIG_END - _PARAM_CONFIG_BEGIN
@ -1216,12 +1234,16 @@
, _PARAM_HELPCATEGORIES_BEGIN = _PARAM_GENERAL_END // Daisy Chain , _PARAM_HELPCATEGORIES_BEGIN = _PARAM_GENERAL_END // Daisy Chain
, PARAM_WILDSTAR = _PARAM_HELPCATEGORIES_BEGIN , PARAM_WILDSTAR = _PARAM_HELPCATEGORIES_BEGIN
, PARAM_CAT_BOOKMARKS
, PARAM_CAT_BREAKPOINTS , PARAM_CAT_BREAKPOINTS
, PARAM_CAT_CONFIG , PARAM_CAT_CONFIG
, PARAM_CAT_CPU , PARAM_CAT_CPU
, PARAM_CAT_FLAGS , PARAM_CAT_FLAGS
, PARAM_CAT_HELP
, PARAM_CAT_MEMORY , PARAM_CAT_MEMORY
,_PARAM_CAT_MEM // alias MEM = MEMORY ,_PARAM_CAT_MEM // alias MEM = MEMORY
, PARAM_CAT_OUTPUT
, PARAM_CAT_REGISTERS
, PARAM_CAT_SYMBOLS , PARAM_CAT_SYMBOLS
, PARAM_CAT_WATCHES , PARAM_CAT_WATCHES
, PARAM_CAT_WINDOW , PARAM_CAT_WINDOW
@ -1323,7 +1345,7 @@
enum enum
{ {
MAX_WATCHES = 5 MAX_WATCHES = 6
}; };
@ -1356,6 +1378,6 @@
enum enum
{ {
MAX_ZEROPAGE_POINTERS = 5 MAX_ZEROPAGE_POINTERS = 6
}; };