MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / DebuggerProcessKey

Function DebuggerProcessKey

source/Debugger/Debug.cpp:9658–10103  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

9656
9657//===========================================================================
9658void DebuggerProcessKey ( int keycode )
9659{
9660 if (g_nAppMode != MODE_DEBUG)
9661 return;
9662
9663 if (DebugVideoMode::Instance().IsSet())
9664 {
9665 if ((VK_SHIFT == keycode) || (VK_CONTROL == keycode) || (VK_MENU == keycode))
9666 {
9667 return;
9668 }
9669
9670 // Normally any key press takes us out of "Viewing Apple Output" g_nAppMode
9671 // VK_F# are already processed, so we can't use them to cycle next video g_nAppMode
9672// if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
9673
9674 // 2.9.2.7 Added: QoL for Debugger's view output screen.
9675 // When using the debugger to view the ouput screen such as `HGR`, `HGR2`, etc. allow the
9676 // keys 0-5 to display the specificed video # page, or 9 to see the current video mode.
9677 // 0 Pseudo Page 0 ($0000 for graphics, else text page 1)
9678 // 1 Hardware Page 1 ($2000 for graphics, else text $0400)
9679 // 2 Hardware Page 2 ($4000 for graphics, else text $0800)
9680 // 3 Pseudo Page 3 ($6000 for graphics, else text page 1)
9681 // 4 Pseudo Page 4 ($8000 for graphics, else text page 1)
9682 // 5 Pseudo Page 5 ($A000 for graphics, else text page 1)
9683 // 9 Current mode and page
9684 //
9685 // NOTE: Do we want to allow viewing mixed/full mode since 0-5 always sets fullscreen?
9686 // 7 Mixed-screen mode
9687 // 8 Full-screen mode
9688 //
9689 // NOTE: Keep in sync: ViewVideoPage_t, DebuggerProcessKey(), _ViewOutput()
9690 if ((keycode >= '0') && (keycode <= '9'))
9691 {
9692 ViewVideoPage_t eVideoPage = VIEW_PAGE_X;
9693 UINT bVideoFlags = 0;
9694
9695 DebugVideoMode::Instance().Get( &bVideoFlags );
9696 uint32_t bSavedVideoModeFlags = bVideoFlags;
9697
9698 bVideoFlags &= ~(VF_MIXED | VF_PAGE0 | VF_PAGE2 | VF_PAGE3 | VF_PAGE4 | VF_PAGE5 | VF_PAGE6 | VF_PAGE7 | VF_PAGE8);
9699 switch (keycode)
9700 {
9701 case '0': eVideoPage = VIEW_PAGE_0; bVideoFlags |= VF_PAGE0; break;
9702 case '1': eVideoPage = VIEW_PAGE_1; /* */; break;
9703 case '2': eVideoPage = VIEW_PAGE_2; bVideoFlags |= VF_PAGE2; break;
9704 case '3': eVideoPage = VIEW_PAGE_3; bVideoFlags |= VF_PAGE3; break;
9705 case '4': eVideoPage = VIEW_PAGE_4; bVideoFlags |= VF_PAGE4; break;
9706 case '5': eVideoPage = VIEW_PAGE_5; bVideoFlags |= VF_PAGE5; break;
9707 case '6': eVideoPage = VIEW_PAGE_6; bVideoFlags |= VF_PAGE6; break;
9708 case '7': eVideoPage = VIEW_PAGE_7; bVideoFlags |= VF_PAGE7; break;
9709 case '8': eVideoPage = VIEW_PAGE_8; bVideoFlags |= VF_PAGE8; break;
9710 case '9': /* Don't use VIEW_PAGE_X as it is handled below*/; break;
9711 default:
9712 bool bUnknownViewVideoPage = false;
9713 assert( bUnknownViewVideoPage );
9714 break;
9715 }

Callers 1

WndProcMethod · 0.85

Calls 15

_ViewOutputFunction · 0.85
DebugDisplayFunction · 0.85
UpdateDisplayFunction · 0.85
ConsoleBufferTryUnpauseFunction · 0.85
ConsoleDisplayPauseFunction · 0.85
ConsoleInputResetFunction · 0.85
ConsoleInputBackSpaceFunction · 0.85
DebuggerProcessCommandFunction · 0.85
ToggleFullScreenConsoleFunction · 0.85
ConsoleScrollEndFunction · 0.85
KeybGetCtrlStatusFunction · 0.85
DebuggerInputConsoleCharFunction · 0.85

Tested by

no test coverage detected