From 8b09cc47af32ad37170e7dd2369fc7242b6b403e Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Sat, 13 Apr 2019 10:21:48 -0700 Subject: [PATCH 1/7] Add misc. debugger stuff --- docs/Debugger_Wishlist.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/Debugger_Wishlist.txt b/docs/Debugger_Wishlist.txt index 1ba3d967..cc18bbba 100644 --- a/docs/Debugger_Wishlist.txt +++ b/docs/Debugger_Wishlist.txt @@ -1,6 +1,24 @@ Requests (Wishlist): ==================== +* [ ] HELP BPM on read/write + Nail down syntax: + BPM A7 = R + BPM A7 = W + BPM R A7 + BPM W A7 + Add support 65D02 to break on read/write memory location + +* [ ] HELP BPM + Add help document and examples + +* [ ] Fix BUG: (partial) symbols starting with E not parsed propery + sym ErasePlayer1 = 65D3 + sym ErasePlayer + Address not found: $000E + +* [ ] Color code error messages in red foreground + - HELP CD: Document examples Helps needs to list: SEE: HELP PWD From a12f4283e909fbfdf6ab6c41e90ff48fc5c07c93 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Sat, 13 Apr 2019 10:22:39 -0700 Subject: [PATCH 2/7] TODO: colorize output of CALC --- source/Debugger/Debug.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/Debugger/Debug.cpp b/source/Debugger/Debug.cpp index c57f55ae..fbe00c60 100644 --- a/source/Debugger/Debug.cpp +++ b/source/Debugger/Debug.cpp @@ -6150,6 +6150,12 @@ Update_t CmdOutputCalc (int nArgs) nBit |= (1 << (iBit * 4)); // 4 bits per hex digit } + // TODO: Colorize output + // CHC_NUM_HEX + // CHC_NUM_BIN -- doesn't exist, use CHC_INFO + // CHC_NUM_DEC + // CHC_ARG_ + // CHC_STRING wsprintf( sText, TEXT("$%04X 0z%08X %5d '%c' "), nAddress, nBit, nAddress, c ); @@ -6169,6 +6175,10 @@ Update_t CmdOutputCalc (int nArgs) _tcscat( sText, TEXT(")") ); ConsoleBufferPush( sText ); + +// If we colorize then w must also guard against character ouput $60 +// ConsolePrint( sText ); + return ConsoleUpdate(); } From 32b42b2aeb084bca75306ffc7a5f8b3845943310 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Fri, 23 Aug 2019 08:46:43 -0700 Subject: [PATCH 3/7] Add Ctrl-0, Ctrl-1, Ctrl-3 for #678 --- source/Frame.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index d37291be..38af114d 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -1392,7 +1392,28 @@ LRESULT CALLBACK FrameWndProc ( if (!IsJoyKey && (g_nAppMode != MODE_LOGO)) // !MODE_LOGO - not emulating so don't pass to the VM's keyboard { - KeybQueueKeypress(wparam, NOT_ASCII); + // GH#678 Alternate key(s) to toggle max speed + // Ctrl-0 Speed fastest + // Ctrl-1 Speed 100% + // Ctrl-3 Toggle speed fastest / 100% + if( KeybGetCtrlStatus() && wparam >= '0' && wparam <= '9' ) + { + switch (wparam) + { + case '0': g_dwSpeed = SPEED_MAX ; break; // Don't use g_bScrollLock_FullSpeed but g_dwSpeed + case '1': g_dwSpeed = SPEED_NORMAL; break; + case '3': g_dwSpeed = (g_dwSpeed != SPEED_MAX) + ? SPEED_MAX + : SPEED_NORMAL + ; + break; + default: + KeybQueueKeypress(wparam, NOT_ASCII); + break; + } + } + else + KeybQueueKeypress(wparam, NOT_ASCII); if (!autorep) KeybAnyKeyDown(WM_KEYDOWN, wparam, extended); @@ -1407,6 +1428,7 @@ LRESULT CALLBACK FrameWndProc ( case WM_CHAR: if ((g_nAppMode == MODE_RUNNING) || (g_nAppMode == MODE_STEPPING) || (g_nAppMode == MODE_LOGO)) { + // Ctrl-1 is NOT handled here but in WM_KEYDOWN if (!g_bDebuggerEatKey) { #if DEBUG_KEY_MESSAGES From 5e9b8fe2ae199ecec6adbe97e4e168173bf86f24 Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Fri, 23 Aug 2019 19:33:56 -0700 Subject: [PATCH 4/7] Set Ctrl-0 Toggle Fastest/100%, Ctrl-3 Always fastest --- source/Frame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index 38af114d..5dabd43d 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -1393,20 +1393,20 @@ LRESULT CALLBACK FrameWndProc ( (g_nAppMode != MODE_LOGO)) // !MODE_LOGO - not emulating so don't pass to the VM's keyboard { // GH#678 Alternate key(s) to toggle max speed - // Ctrl-0 Speed fastest + // Ctrl-0 Toggle speed fastest / 100% // Ctrl-1 Speed 100% - // Ctrl-3 Toggle speed fastest / 100% + // Ctrl-3 Speed fastest if( KeybGetCtrlStatus() && wparam >= '0' && wparam <= '9' ) { switch (wparam) { - case '0': g_dwSpeed = SPEED_MAX ; break; // Don't use g_bScrollLock_FullSpeed but g_dwSpeed - case '1': g_dwSpeed = SPEED_NORMAL; break; - case '3': g_dwSpeed = (g_dwSpeed != SPEED_MAX) + case '0': g_dwSpeed = (g_dwSpeed != SPEED_MAX) ? SPEED_MAX : SPEED_NORMAL ; break; + case '1': g_dwSpeed = SPEED_NORMAL; break; + case '3': g_dwSpeed = SPEED_MAX ; break; // Don't use g_bScrollLock_FullSpeed but g_dwSpeed default: KeybQueueKeypress(wparam, NOT_ASCII); break; From b488961fca8775a3836acf94095da64ae900ef07 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 24 Aug 2019 12:11:09 +0100 Subject: [PATCH 5/7] Removed comment --- source/Frame.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index 5dabd43d..d1d093fd 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -1428,7 +1428,6 @@ LRESULT CALLBACK FrameWndProc ( case WM_CHAR: if ((g_nAppMode == MODE_RUNNING) || (g_nAppMode == MODE_STEPPING) || (g_nAppMode == MODE_LOGO)) { - // Ctrl-1 is NOT handled here but in WM_KEYDOWN if (!g_bDebuggerEatKey) { #if DEBUG_KEY_MESSAGES From 1ee2261c602c761590084db73bd19cdd18f0ff44 Mon Sep 17 00:00:00 2001 From: tomcw Date: Sat, 24 Aug 2019 12:35:59 +0100 Subject: [PATCH 6/7] Improved comments --- source/Frame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index d1d093fd..b6d1a366 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -1393,9 +1393,9 @@ LRESULT CALLBACK FrameWndProc ( (g_nAppMode != MODE_LOGO)) // !MODE_LOGO - not emulating so don't pass to the VM's keyboard { // GH#678 Alternate key(s) to toggle max speed - // Ctrl-0 Toggle speed fastest / 100% - // Ctrl-1 Speed 100% - // Ctrl-3 Speed fastest + // Ctrl-0 Toggle speed 1 MHz / Full-Speed + // Ctrl-1 Speed 1 MHz + // Ctrl-3 Speed Full-Speed if( KeybGetCtrlStatus() && wparam >= '0' && wparam <= '9' ) { switch (wparam) From af8257eefcc5ce92ccf9273d2c650153ceb4aa4a Mon Sep 17 00:00:00 2001 From: tomcw Date: Mon, 26 Aug 2019 20:52:40 +0100 Subject: [PATCH 7/7] Updated implementation to reflect my comment in #678. --- source/Frame.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index b6d1a366..73f8feb4 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -1393,26 +1393,36 @@ LRESULT CALLBACK FrameWndProc ( (g_nAppMode != MODE_LOGO)) // !MODE_LOGO - not emulating so don't pass to the VM's keyboard { // GH#678 Alternate key(s) to toggle max speed - // Ctrl-0 Toggle speed 1 MHz / Full-Speed - // Ctrl-1 Speed 1 MHz - // Ctrl-3 Speed Full-Speed + // . Ctrl-0: Toggle speed: custom speed / Full-Speed + // . Ctrl-1: Speed = 1 MHz + // . Ctrl-3: Speed = Full-Speed + bool keyHandled = false; if( KeybGetCtrlStatus() && wparam >= '0' && wparam <= '9' ) { switch (wparam) { - case '0': g_dwSpeed = (g_dwSpeed != SPEED_MAX) - ? SPEED_MAX - : SPEED_NORMAL - ; - break; - case '1': g_dwSpeed = SPEED_NORMAL; break; - case '3': g_dwSpeed = SPEED_MAX ; break; // Don't use g_bScrollLock_FullSpeed but g_dwSpeed + case '0': // Toggle speed: custom speed / Full-Speed + if (g_dwSpeed == SPEED_MAX) + REGLOAD(TEXT(REGVALUE_EMULATION_SPEED), &g_dwSpeed); + else + g_dwSpeed = SPEED_MAX; + keyHandled = true; break; + case '1': // Speed = 1 MHz + g_dwSpeed = SPEED_NORMAL; + REGSAVE(TEXT(REGVALUE_EMULATION_SPEED), g_dwSpeed); + keyHandled = true; break; + case '3': // Speed = Full-Speed + g_dwSpeed = SPEED_MAX; + keyHandled = true; break; default: - KeybQueueKeypress(wparam, NOT_ASCII); break; } + + if (keyHandled) + SetCurrentCLK6502(); } - else + + if (!keyHandled) KeybQueueKeypress(wparam, NOT_ASCII); if (!autorep)