From 68eb7ea1e1d0a80e4cb8a80160a512ed44459da1 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 11 Jan 2020 17:38:00 +0000 Subject: [PATCH] Debugger: Added new 'cycles ' command to show cycles as absolute or relative. . removed this functionality from 'videoinfo' --- source/Debugger/Debug.cpp | 29 +++++++++++++++++++++++---- source/Debugger/Debugger_Commands.cpp | 2 ++ source/Debugger/Debugger_Help.cpp | 9 +++++++-- source/Debugger/Debugger_Types.h | 6 ++++++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index 8bb66590..4aaeaef4 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -6873,10 +6873,6 @@ Update_t CmdVideoScannerInfo(int nArgs) g_videoScannerDisplayInfo.isHorzReal = true; else if (strcmp(g_aArgs[1].sArg, "apple") == 0) g_videoScannerDisplayInfo.isHorzReal = false; - else if (strcmp(g_aArgs[1].sArg, "abs") == 0) - g_videoScannerDisplayInfo.isAbsCycle = true; - else if (strcmp(g_aArgs[1].sArg, "rel") == 0) - g_videoScannerDisplayInfo.isAbsCycle = false; else return Help_Arg_1(CMD_VIDEO_SCANNER_INFO); } @@ -6888,6 +6884,31 @@ Update_t CmdVideoScannerInfo(int nArgs) return UPDATE_ALL; } +// Cycles __________________________________________________________________________________________ + +Update_t CmdCyclesInfo(int nArgs) +{ + if (nArgs != 1) + { + return Help_Arg_1(CMD_CYCLES_INFO); + } + else + { + if (strcmp(g_aArgs[1].sArg, "abs") == 0) + g_videoScannerDisplayInfo.isAbsCycle = true; + else if (strcmp(g_aArgs[1].sArg, "rel") == 0) + g_videoScannerDisplayInfo.isAbsCycle = false; + else + return Help_Arg_1(CMD_CYCLES_INFO); + } + + TCHAR sText[CONSOLE_WIDTH]; + ConsoleBufferPushFormat(sText, "Cycles display updated: %s", g_aArgs[1].sArg); + ConsoleBufferToDisplay(); + + return UPDATE_ALL; +} + // View ___________________________________________________________________________________________ // See: CmdWindowViewOutput (int nArgs) diff --git a/source/Debugger/Debugger_Commands.cpp b/source/Debugger/Debugger_Commands.cpp index a55ada30..487350bf 100644 --- a/source/Debugger/Debugger_Commands.cpp +++ b/source/Debugger/Debugger_Commands.cpp @@ -121,6 +121,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA {TEXT("PAGEDN" ) , CmdCursorPageDown , CMD_CURSOR_PAGE_DOWN , "Scroll down one scren" }, {TEXT("PAGEDOWN256") , CmdCursorPageDown256 , CMD_CURSOR_PAGE_DOWN_256 , "Scroll down 256 bytes" }, // Shift {TEXT("PAGEDOWN4K" ) , CmdCursorPageDown4K , CMD_CURSOR_PAGE_DOWN_4K , "Scroll down 4096 bytes" }, // Ctrl + // Cycles info + {TEXT("CYCLES") , CmdCyclesInfo , CMD_CYCLES_INFO, "Cycles display configuration" }, // Disassembler Data {TEXT("Z") , CmdDisasmDataDefByte1 , CMD_DISASM_DATA , "Treat byte [range] as data" }, {TEXT("X") , CmdDisasmDataDefCode , CMD_DISASM_CODE , "Treat byte [range] as code" }, diff --git a/source/Debugger/Debugger_Help.cpp b/source/Debugger/Debugger_Help.cpp index df934f45..b2d4ea9e 100644 --- a/source/Debugger/Debugger_Help.cpp +++ b/source/Debugger/Debugger_Help.cpp @@ -1406,13 +1406,18 @@ Update_t CmdHelpSpecific (int nArgs) ConsoleColorizePrint( sText, " Usage: symbol" ); ConsoleBufferPush( " Looks up symbol in all 3 symbol tables: main, user, source" ); break; +// Cycles + case CMD_CYCLES_INFO: + ConsoleColorizePrint(sText, " Usage: "); + ConsoleBufferPush(" Where:"); + ConsoleBufferPush(" changes cycle output to absolute/relative"); + break; // Video-Scanner case CMD_VIDEO_SCANNER_INFO: - ConsoleColorizePrint(sText, " Usage: "); + ConsoleColorizePrint(sText, " Usage: "); ConsoleBufferPush(" Where:"); ConsoleBufferPush(" changes output to dec/hex"); ConsoleBufferPush(" alters horz value to hbl-l,visible,hbl-r or hbl-r+l,visible"); - ConsoleBufferPush(" changes cycle output to absolute/relative"); { char sText2[CONSOLE_WIDTH]; ConsolePrintFormat(sText2, " %sYellow%s=invisible (hbl or vbl active) / %sGreen%s=visible" diff --git a/source/Debugger/Debugger_Types.h b/source/Debugger/Debugger_Types.h index 7e5a8a34..eb38cf46 100644 --- a/source/Debugger/Debugger_Types.h +++ b/source/Debugger/Debugger_Types.h @@ -375,6 +375,8 @@ , CMD_CURSOR_PAGE_DOWN , CMD_CURSOR_PAGE_DOWN_256 // Down to nearest page boundary , CMD_CURSOR_PAGE_DOWN_4K // Down to nearest 4K boundary +// Cycles info + , CMD_CYCLES_INFO // Disassembler Data , CMD_DISASM_DATA , CMD_DISASM_CODE @@ -662,6 +664,10 @@ Update_t CmdCursorPageUp (int nArgs); Update_t CmdCursorPageUp256 (int nArgs); Update_t CmdCursorPageUp4K (int nArgs); + +// Cycles info + Update_t CmdCyclesInfo (int nArgs); + // Disk Update_t CmdDisk (int nArgs); // Help