From 7ca547479b38fda3edcaba931895977a8506a7d2 Mon Sep 17 00:00:00 2001 From: Andrea Date: Sun, 29 Nov 2020 17:30:06 +0000 Subject: [PATCH] Move Windows related functions to Interface.h (PR #882) This is not complete as header files from Windows/.. are still included in: Keyboard.cpp SerialComms.cpp Joystick.cpp But probably these are arch specific and will have to be completely reimplemented elsewhere. --- AppleWinExpress2008.vcproj | 4 ++++ AppleWinExpress2019.vcxproj | 1 + AppleWinExpress2019.vcxproj.filters | 3 +++ source/CmdLine.cpp | 2 +- source/Disk.cpp | 4 +--- source/Frame.h | 3 --- source/Harddisk.cpp | 3 +-- source/Harddisk.h | 3 +++ source/Interface.h | 20 ++++++++++++++++++++ source/Memory.cpp | 2 +- source/MouseInterface.cpp | 2 +- source/NTSC_CharSet.cpp | 2 +- source/Pravets.cpp | 2 +- source/SaveState.cpp | 3 +-- source/SoundCore.cpp | 2 +- source/Speaker.cpp | 3 +-- source/Utilities.cpp | 2 +- source/Video.cpp | 2 +- source/Windows/WinFrame.h | 3 --- 19 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 source/Interface.h diff --git a/AppleWinExpress2008.vcproj b/AppleWinExpress2008.vcproj index 5b84393f..2ecd1aa0 100644 --- a/AppleWinExpress2008.vcproj +++ b/AppleWinExpress2008.vcproj @@ -242,6 +242,10 @@ RelativePath=".\source\Core.h" > + + diff --git a/AppleWinExpress2019.vcxproj b/AppleWinExpress2019.vcxproj index 07271ac3..ccc0525e 100644 --- a/AppleWinExpress2019.vcxproj +++ b/AppleWinExpress2019.vcxproj @@ -72,6 +72,7 @@ + diff --git a/AppleWinExpress2019.vcxproj.filters b/AppleWinExpress2019.vcxproj.filters index 3d7cfd4e..6af9c8c0 100644 --- a/AppleWinExpress2019.vcxproj.filters +++ b/AppleWinExpress2019.vcxproj.filters @@ -525,6 +525,9 @@ Source Files + + Source Files + diff --git a/source/CmdLine.cpp b/source/CmdLine.cpp index f6ffe967..416e8051 100644 --- a/source/CmdLine.cpp +++ b/source/CmdLine.cpp @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "ParallelPrinter.h" #include "CardManager.h" #include "SerialComms.h" -#include "Windows/WinFrame.h" +#include "Interface.h" CmdLine g_cmdLine; std::string g_sConfigFile; // INI file to use instead of Registry diff --git a/source/Disk.cpp b/source/Disk.cpp index 329848d8..cb00bca8 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SaveState_Structs_v1.h" -#include "Windows/AppleWin.h" +#include "Interface.h" #include "Core.h" #include "CPU.h" #include "DiskImage.h" @@ -43,8 +43,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Registry.h" #include "SaveState.h" #include "Video.h" -#include "Windows/WinVideo.h" -#include "Windows/WinFrame.h" #include "YamlHelper.h" #include "../resource/resource.h" diff --git a/source/Frame.h b/source/Frame.h index 7ec2e247..0e37a53b 100644 --- a/source/Frame.h +++ b/source/Frame.h @@ -1,8 +1,5 @@ #pragma once -// 1.19.0.0 Hard Disk Status/Indicator Light -#define HD_LED 1 - UINT GetFrameBufferBorderlessWidth(void); UINT GetFrameBufferBorderlessHeight(void); UINT GetFrameBufferBorderWidth(void); diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index 0631ba01..774afd1b 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -30,12 +30,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Harddisk.h" #include "Core.h" -#include "Windows/AppleWin.h" +#include "Interface.h" #include "CardManager.h" #include "CPU.h" #include "DiskImage.h" // ImageError_e, Disk_Status_e #include "DiskImageHelper.h" -#include "Windows/WinFrame.h" #include "Memory.h" #include "Registry.h" #include "SaveState.h" diff --git a/source/Harddisk.h b/source/Harddisk.h index 1f28bb66..0faa768e 100644 --- a/source/Harddisk.h +++ b/source/Harddisk.h @@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "DiskImage.h" +// 1.19.0.0 Hard Disk Status/Indicator Light +#define HD_LED 1 + enum HardDrive_e { HARDDISK_1 = 0, diff --git a/source/Interface.h b/source/Interface.h new file mode 100644 index 00000000..81bd52e8 --- /dev/null +++ b/source/Interface.h @@ -0,0 +1,20 @@ +#pragma once + +extern HINSTANCE g_hInstance; +extern HWND g_hFrameWindow; +extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE +extern BOOL g_bMultiMon; + +void FrameDrawDiskLEDS(HDC hdc); +void FrameDrawDiskStatus(HDC hdc); +void FrameRefreshStatus(int, bool bUpdateDiskStatus = true); +void FrameUpdateApple2Type(); +void FrameSetCursorPosByMousePos(); + +void VideoRedrawScreen(); +void SetFullScreenShowSubunitStatus(bool bShow); +bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight = 0); +int SetViewportScale(int nNewScale, bool bForce = false); +void SetAltEnterToggleFullScreen(bool mode); + +void SetLoadedSaveStateFlag(const bool bFlag); diff --git a/source/Memory.cpp b/source/Memory.cpp index cbfe9918..aeae07f1 100644 --- a/source/Memory.cpp +++ b/source/Memory.cpp @@ -31,11 +31,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "StdAfx.h" #include "Memory.h" +#include "Interface.h" #include "Core.h" #include "CardManager.h" #include "CPU.h" #include "Disk.h" -#include "Windows/WinFrame.h" #include "Harddisk.h" #include "Joystick.h" #include "Keyboard.h" diff --git a/source/MouseInterface.cpp b/source/MouseInterface.cpp index 95ef2956..1e3a025f 100644 --- a/source/MouseInterface.cpp +++ b/source/MouseInterface.cpp @@ -49,7 +49,7 @@ Etc. #include "Core.h" // g_SynchronousEventMgr #include "CardManager.h" #include "CPU.h" -#include "Windows/WinFrame.h" // FrameSetCursorPosByMousePos() +#include "Interface.h" // FrameSetCursorPosByMousePos() #include "Log.h" #include "Memory.h" #include "Video.h" diff --git a/source/NTSC_CharSet.cpp b/source/NTSC_CharSet.cpp index 70be74c1..2c8b2b82 100644 --- a/source/NTSC_CharSet.cpp +++ b/source/NTSC_CharSet.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "StdAfx.h" #include "NTSC_CharSet.h" -#include "Windows/AppleWin.h" +#include "Interface.h" #include "Core.h" #include "../resource/resource.h" #include "Video.h" diff --git a/source/Pravets.cpp b/source/Pravets.cpp index 70f97f1d..3b58134e 100644 --- a/source/Pravets.cpp +++ b/source/Pravets.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Pravets.h" #include "Core.h" -#include "Windows/WinFrame.h" +#include "Interface.h" #include "Keyboard.h" #include "Tape.h" diff --git a/source/SaveState.cpp b/source/SaveState.cpp index 311565cb..ccb4c29e 100644 --- a/source/SaveState.cpp +++ b/source/SaveState.cpp @@ -31,12 +31,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SaveState.h" #include "YamlHelper.h" -#include "Windows/AppleWin.h" +#include "Interface.h" #include "CardManager.h" #include "CPU.h" #include "Debug.h" #include "Disk.h" -#include "Windows/WinFrame.h" #include "Joystick.h" #include "Keyboard.h" #include "LanguageCard.h" diff --git a/source/SoundCore.cpp b/source/SoundCore.cpp index 2f224e82..c635b93e 100644 --- a/source/SoundCore.cpp +++ b/source/SoundCore.cpp @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SoundCore.h" #include "Core.h" -#include "Windows/WinFrame.h" +#include "Interface.h" #include "Log.h" #include "Speaker.h" diff --git a/source/Speaker.cpp b/source/Speaker.cpp index 2d8740ef..617e459e 100644 --- a/source/Speaker.cpp +++ b/source/Speaker.cpp @@ -31,11 +31,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Speaker.h" #include "Core.h" #include "CPU.h" -#include "Windows/WinFrame.h" +#include "Interface.h" #include "Log.h" #include "Memory.h" #include "SoundCore.h" -#include "Windows/WinVideo.h" // VideoRedrawScreen() #include "YamlHelper.h" #include "Riff.h" diff --git a/source/Utilities.cpp b/source/Utilities.cpp index a932a0af..1e08af28 100644 --- a/source/Utilities.cpp +++ b/source/Utilities.cpp @@ -43,7 +43,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "SerialComms.h" #include "Speaker.h" #include "Mockingboard.h" -#include "Windows/WinFrame.h" +#include "Interface.h" #include "Configuration/IPropertySheet.h" #include "Tfe/Tfe.h" diff --git a/source/Video.cpp b/source/Video.cpp index 99d1e52f..68e69c23 100644 --- a/source/Video.cpp +++ b/source/Video.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "Core.h" #include "CPU.h" #include "Frame.h" -#include "Windows/WinFrame.h" +#include "Interface.h" #include "Log.h" #include "Memory.h" #include "Registry.h" diff --git a/source/Windows/WinFrame.h b/source/Windows/WinFrame.h index 4c04970f..b9eacc17 100644 --- a/source/Windows/WinFrame.h +++ b/source/Windows/WinFrame.h @@ -1,8 +1,5 @@ #pragma once -// 1.19.0.0 Hard Disk Status/Indicator Light -#define HD_LED 1 - // Win32 extern HWND g_hFrameWindow; extern int g_nViewportCX;