From 94c90f66542e4da5560595cad478f972e3f1498e Mon Sep 17 00:00:00 2001 From: michaelangel007 Date: Mon, 25 Aug 2014 09:20:32 -0700 Subject: [PATCH] Fix #221 Reinstate F6's original behaviour of toggling window/fullscreen modes Fix #198 broken with F6 and Ctrl-F6 revert to original behavior --- bin/History.txt | 16 +++++++++++----- source/Frame.cpp | 50 ++++++++++++++++++++++++++++++------------------ 2 files changed, 42 insertions(+), 24 deletions(-) diff --git a/bin/History.txt b/bin/History.txt index ff4056e9..19e9c9c5 100644 --- a/bin/History.txt +++ b/bin/History.txt @@ -13,9 +13,12 @@ In Development: 1.25.0 --------------- Changes: . Changed the AppleWin project host from BerliOS to GitHub. -. Ctrl-PrintScreen will copy the text screen (auto detect 40/80) to the clipboard. +. [Bug #221] Restored F6 original behavior that was changed in v1.22.0. + F6 Toggle full-screen / windowed mode. + Ctrl-F6 Toggle windowed 1x/2x zoom. +. Ctrl-PrintScreen will copy the text screen (auto detect 40/80 columns) to the clipboard. . [Feature #198] Alt-Return toggles full screen. -. [Feature #199] Added the option to skip the reboot confirmation in the configuration. +. [Feature #199] Added a configuration option "Confirm reboot" to skip the F2 reboot confirmation. . [Feature #201] Added display of current Track/Sector for the floppy drives. - In 2x window mode the status is displayed below the drive LEDs. - In full screen mode the status is displayed above the drive LEDS. The track/sector @@ -42,16 +45,19 @@ Changes: NOTE: -memclear 6 can cause a few programs to NOT function correctly due to hidden bugs of programmers not correctly initializing memory or using uninitialized memory. RNDL/RHND and $620B are initialized to - allow Pooyan, and the Beautiful Boot game launcher to run. -. Debugger + allow Pooyan, and the Beautiful Boot game launcher to run, along with + BFFD..BFFE to allow Copy ][ v5 to boot correctly. +. Debugger (v2.7.0.23): - Added: TSAVE "filename" to save the text screen to a file. + It will auto-detect the current video mode: 40/80 columns. Default filename for 40 columns is: AppleWin_Text40.txt Default filename for 80 columns is: AppleWin_Text80.txt + Fixes: . [Bug #206] Pooyan would freeze due to RNDL/RNDH not initialized to non-zero values on a cold boot. . [Bug #177] Full-screen under Windows8/8.1 would show a corrupt, pastelle color palette. -. Debugger (v2.7.0.23): +. Debugger: - Hang with Memory Fill when memory ends at FFFF, i.e. F D000:FFFF 0 - Hang with Memory Move when memory ends at FFFF, i.e. 2000= VK_F1) && (wparam <= VK_F8) && (buttondown == -1)) { SetUsingCursor(0); @@ -1252,7 +1253,8 @@ LRESULT CALLBACK FrameWndProc ( } break; - case WM_KEYUP: + case WM_KEYUP: + // Process is done in WM_KEYUP: VK_F1 VK_F2 VK_F3 VK_F4 VK_F5 VK_F6 VK_F7 VK_F8 if ((wparam >= VK_F1) && (wparam <= VK_F8) && (buttondown == (int)wparam-VK_F1)) { buttondown = -1; @@ -1575,19 +1577,29 @@ LRESULT CALLBACK FrameWndProc ( } break; - case WM_SYSKEYDOWN: + case WM_SYSKEYDOWN: KeybUpdateCtrlShiftStatus(); - if (g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN - ScreenWindowResize(true); - else - PostMessage(window,WM_KEYDOWN,wparam,lparam); - if ((wparam == VK_F10) || (wparam == VK_MENU)) // VK_MENU == ALT Key - return 0; - break; - case WM_SYSKEYUP: - PostMessage(window,WM_KEYUP,wparam,lparam); - break; + // http://msdn.microsoft.com/en-us/library/windows/desktop/gg153546(v=vs.85).aspx + // v1.25.0: Alt-Return Alt-Enter toggle fullscreen + if (g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU + return 0; // NOP -- eat key + else + PostMessage(window,WM_KEYDOWN,wparam,lparam); + + if ((wparam == VK_F10) || (wparam == VK_MENU)) // VK_MENU == ALT Key + return 0; + break; + + case WM_SYSKEYUP: + KeybUpdateCtrlShiftStatus(); + + // v1.25.0: Alt-Return Alt-Enter toggle fullscreen + if (g_bAltKey && (wparam == VK_RETURN)) // NB. VK_RETURN = 0x0D; Normally WM_CHAR will be 0x0A but ALT key triggers as WM_SYSKEYDOWN and VK_MENU + ScreenWindowResize(false); + else + PostMessage(window,WM_KEYUP,wparam,lparam); + break; case WM_USER_BENCHMARK: { UpdateWindow(window); @@ -1669,7 +1681,7 @@ LRESULT CALLBACK FrameWndProc ( SetForegroundWindow(window); Sleep(500); // Wait for SetForegroundWindow() to take affect (400ms seems OK, so use 500ms to be sure) SoundCore_TweakVolumes(); - ProcessButtonClick(BTN_RUN); + ProcessButtonClick(BTN_RUN); break; } @@ -1688,7 +1700,7 @@ LRESULT CALLBACK FrameWndProc ( //=========================================================================== - +// Process: VK_F6 static void ScreenWindowResize(const bool bCtrlKey) { if (g_bIsFullScreen) // if full screen: then switch back to normal (regardless of CTRL) @@ -1697,17 +1709,17 @@ static void ScreenWindowResize(const bool bCtrlKey) FrameResizeWindow(g_nOldViewportScale); } else if (bCtrlKey) // if normal screen && CTRL: then switch to full screen + { + FrameResizeWindow( (g_nViewportScale == 1) ? 2 : 1 ); // Toggle between 1x and 2x + REGSAVE(TEXT(REGVALUE_WINDOW_SCALE), g_nViewportScale); + } + else { g_nOldViewportScale = g_nViewportScale; FrameResizeWindow(1); // reset to 1x SetFullScreenMode(); //VideoRedrawScreen(1); // [TC-10/06/2014] Remove this once checked it's not needed by Win8 } - else - { - FrameResizeWindow( (g_nViewportScale == 1) ? 2 : 1 ); // Toggle between 1x and 2x - REGSAVE(TEXT(REGVALUE_WINDOW_SCALE), g_nViewportScale); - } } static bool ConfirmReboot(bool bFromButtonUI)