IPropertySheet: make it a standard C++ class with pure virtual functions (PR #892)

* Interface.h: ensure that functions in the interface are not exported by other header files.

This is generally harmless, except for the presence of default arguments, in which case the version with default arguments must come first.
To avoid the issue, these functions are only ever exported in the Interface.h header file.
This commit is contained in:
Andrea 2020-12-20 15:32:51 +00:00 committed by GitHub
parent 3cb8f3bb52
commit 2d2ba86f4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 82 additions and 90 deletions

View File

@ -25,8 +25,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "About.h" #include "About.h"
#include "../Core.h" #include "../Core.h"
#include "../Interface.h"
#include "../Windows/AppleWin.h" #include "../Windows/AppleWin.h"
#include "../Windows/WinFrame.h"
#include "../resource/resource.h" #include "../resource/resource.h"
static const TCHAR g_szGPL[] = static const TCHAR g_szGPL[] =

View File

@ -4,28 +4,29 @@
class CConfigNeedingRestart; class CConfigNeedingRestart;
__interface IPropertySheet class IPropertySheet
{ {
void Init(void); public:
DWORD GetVolumeMax(void); // TODO:TC: Move out of here virtual void Init(void) = 0;
bool SaveStateSelectImage(HWND hWindow, bool bSave); // TODO:TC: Move out of here virtual DWORD GetVolumeMax(void) = 0; // TODO:TC: Move out of here
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld); virtual bool SaveStateSelectImage(HWND hWindow, bool bSave) = 0; // TODO:TC: Move out of here
void ConfigSaveApple2Type(eApple2Type apple2Type); virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) = 0;
virtual void ConfigSaveApple2Type(eApple2Type apple2Type) = 0;
UINT GetScrollLockToggle(void); virtual UINT GetScrollLockToggle(void) = 0;
void SetScrollLockToggle(UINT uValue); virtual void SetScrollLockToggle(UINT uValue) = 0;
UINT GetJoystickCursorControl(void); virtual UINT GetJoystickCursorControl(void) = 0;
void SetJoystickCursorControl(UINT uValue); virtual void SetJoystickCursorControl(UINT uValue) = 0;
UINT GetJoystickCenteringControl(void); virtual UINT GetJoystickCenteringControl(void) = 0;
void SetJoystickCenteringControl(UINT uValue); virtual void SetJoystickCenteringControl(UINT uValue) = 0;
UINT GetAutofire(UINT uButton); virtual UINT GetAutofire(UINT uButton) = 0;
void SetAutofire(UINT uValue); virtual void SetAutofire(UINT uValue) = 0;
bool GetButtonsSwapState(void); virtual bool GetButtonsSwapState(void) = 0;
void SetButtonsSwapState(bool value); virtual void SetButtonsSwapState(bool value) = 0;
UINT GetMouseShowCrosshair(void); virtual UINT GetMouseShowCrosshair(void) = 0;
void SetMouseShowCrosshair(UINT uValue); virtual void SetMouseShowCrosshair(UINT uValue) = 0;
UINT GetMouseRestrictToWindow(void); virtual UINT GetMouseRestrictToWindow(void) = 0;
void SetMouseRestrictToWindow(UINT uValue); virtual void SetMouseRestrictToWindow(UINT uValue) = 0;
UINT GetTheFreezesF8Rom(void); virtual UINT GetTheFreezesF8Rom(void) = 0;
void SetTheFreezesF8Rom(UINT uValue); virtual void SetTheFreezesF8Rom(UINT uValue) = 0;
}; };

View File

@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "PageConfig.h" #include "PageConfig.h"
#include "PropertySheetHelper.h" #include "PropertySheetHelper.h"
#include "../Interface.h"
#include "../Windows/AppleWin.h" #include "../Windows/AppleWin.h"
#include "../Windows/WinFrame.h" #include "../Windows/WinFrame.h"
#include "../Registry.h" #include "../Registry.h"

View File

@ -26,10 +26,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "PageDisk.h" #include "PageDisk.h"
#include "PropertySheetHelper.h" #include "PropertySheetHelper.h"
#include "../Interface.h"
#include "../Windows/AppleWin.h" #include "../Windows/AppleWin.h"
#include "../CardManager.h" #include "../CardManager.h"
#include "../Disk.h" // Drive_e, Disk_Status_e #include "../Disk.h" // Drive_e, Disk_Status_e
#include "../Windows/WinFrame.h"
#include "../Registry.h" #include "../Registry.h"
#include "../resource/resource.h" #include "../resource/resource.h"

View File

@ -31,8 +31,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "PropertySheet.h" #include "PropertySheet.h"
#include "../Interface.h"
#include "../Windows/AppleWin.h" #include "../Windows/AppleWin.h"
#include "../Windows/WinFrame.h"
#include "../resource/resource.h" #include "../resource/resource.h"
void CPropertySheet::Init(void) void CPropertySheet::Init(void)

View File

@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Log.h" #include "../Log.h"
#include "../Registry.h" #include "../Registry.h"
#include "../SaveState.h" #include "../SaveState.h"
#include "../Interface.h"
/* /*
Config causing AfterClose msgs: Config causing AfterClose msgs:
@ -386,7 +387,7 @@ void CPropertySheetHelper::SaveCurrentConfig(void)
m_ConfigOld.m_Slot[SLOT4] = GetCardMgr().QuerySlot(SLOT4); m_ConfigOld.m_Slot[SLOT4] = GetCardMgr().QuerySlot(SLOT4);
m_ConfigOld.m_Slot[SLOT5] = GetCardMgr().QuerySlot(SLOT5); m_ConfigOld.m_Slot[SLOT5] = GetCardMgr().QuerySlot(SLOT5);
m_ConfigOld.m_bEnableHDD = HD_CardIsEnabled(); m_ConfigOld.m_bEnableHDD = HD_CardIsEnabled();
m_ConfigOld.m_bEnableTheFreezesF8Rom = sg_PropertySheet.GetTheFreezesF8Rom(); m_ConfigOld.m_bEnableTheFreezesF8Rom = GetPropertySheet().GetTheFreezesF8Rom();
m_ConfigOld.m_videoRefreshRate = GetVideoRefreshRate(); m_ConfigOld.m_videoRefreshRate = GetVideoRefreshRate();
// Reset flags each time: // Reset flags each time:
@ -405,7 +406,7 @@ void CPropertySheetHelper::RestoreCurrentConfig(void)
GetCardMgr().Insert(SLOT4, m_ConfigOld.m_Slot[SLOT4]); GetCardMgr().Insert(SLOT4, m_ConfigOld.m_Slot[SLOT4]);
GetCardMgr().Insert(SLOT5, m_ConfigOld.m_Slot[SLOT5]); GetCardMgr().Insert(SLOT5, m_ConfigOld.m_Slot[SLOT5]);
HD_SetEnabled(m_ConfigOld.m_bEnableHDD); HD_SetEnabled(m_ConfigOld.m_bEnableHDD);
sg_PropertySheet.SetTheFreezesF8Rom(m_ConfigOld.m_bEnableTheFreezesF8Rom); GetPropertySheet().SetTheFreezesF8Rom(m_ConfigOld.m_bEnableTheFreezesF8Rom);
m_ConfigNew.m_videoRefreshRate = m_ConfigOld.m_videoRefreshRate; // Not SetVideoRefreshRate(), as this re-inits much Video/NTSC state! m_ConfigNew.m_videoRefreshRate = m_ConfigOld.m_videoRefreshRate; // Not SetVideoRefreshRate(), as this re-inits much Video/NTSC state!
} }

View File

@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Speaker.h" #include "Speaker.h"
#include "Registry.h" #include "Registry.h"
#include "SynchronousEventManager.h" #include "SynchronousEventManager.h"
#include "Configuration/PropertySheet.h"
#ifdef USE_SPEECH_API #ifdef USE_SPEECH_API
#include "Speech.h" #include "Speech.h"
@ -80,8 +79,6 @@ int g_nMemoryClearType = MIP_FF_FF_00_00; // Note: -1 = random MIP in Memory.c
SynchronousEventManager g_SynchronousEventMgr; SynchronousEventManager g_SynchronousEventMgr;
IPropertySheet& sg_PropertySheet = *new CPropertySheet;
HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom F8 ROM at $F800..$FFFF HANDLE g_hCustomRomF8 = INVALID_HANDLE_VALUE; // Cmd-line specified custom F8 ROM at $F800..$FFFF
bool g_bCustomRomF8Failed = false; // Set if custom F8 ROM file failed bool g_bCustomRomF8Failed = false; // Set if custom F8 ROM file failed
HANDLE g_hCustomRom = INVALID_HANDLE_VALUE; // Cmd-line specified custom ROM at $C000..$FFFF(16KiB) or $D000..$FFFF(12KiB) HANDLE g_hCustomRom = INVALID_HANDLE_VALUE; // Cmd-line specified custom ROM at $C000..$FFFF(16KiB) or $D000..$FFFF(12KiB)

View File

@ -67,8 +67,6 @@ extern bool g_bDisableDirectInput; // Cmd line switch: don't init DI (s
extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB/Speaker support) extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB/Speaker support)
extern bool g_bDisableDirectSoundMockingboard; // Cmd line switch: don't init MB support extern bool g_bDisableDirectSoundMockingboard; // Cmd line switch: don't init MB support
extern __interface IPropertySheet& sg_PropertySheet;
//#define LOG_PERF_TIMINGS //#define LOG_PERF_TIMINGS
#ifdef LOG_PERF_TIMINGS #ifdef LOG_PERF_TIMINGS
class PerfMarker class PerfMarker

View File

@ -36,6 +36,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Windows/AppleWin.h" #include "../Windows/AppleWin.h"
#include "../Core.h" #include "../Core.h"
#include "../Interface.h"
#include "../CardManager.h" #include "../CardManager.h"
#include "../CPU.h" #include "../CPU.h"
#include "../Disk.h" #include "../Disk.h"

View File

@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h" #include "Debug.h"
#include "../Windows/WinFrame.h" #include "../Interface.h"
// Commands _______________________________________________________________________________________ // Commands _______________________________________________________________________________________

View File

@ -32,8 +32,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Debug.h" #include "Debug.h"
#include "Debugger_Display.h" #include "Debugger_Display.h"
#include "../Windows/AppleWin.h"
#include "../Core.h" #include "../Core.h"
#include "../Interface.h"
#include "../CPU.h" #include "../CPU.h"
#include "../Frame.h" #include "../Frame.h"
#include "../Windows/WinFrame.h" #include "../Windows/WinFrame.h"

View File

@ -1,5 +1,7 @@
#pragma once #pragma once
class IPropertySheet;
extern HINSTANCE g_hInstance; extern HINSTANCE g_hInstance;
extern HWND g_hFrameWindow; extern HWND g_hFrameWindow;
extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE
@ -19,3 +21,5 @@ int SetViewportScale(int nNewScale, bool bForce = false);
void SetAltEnterToggleFullScreen(bool mode); void SetAltEnterToggleFullScreen(bool mode);
void SetLoadedSaveStateFlag(const bool bFlag); void SetLoadedSaveStateFlag(const bool bFlag);
IPropertySheet& GetPropertySheet();

View File

@ -44,6 +44,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "CPU.h" #include "CPU.h"
#include "Memory.h" #include "Memory.h"
#include "YamlHelper.h" #include "YamlHelper.h"
#include "Interface.h"
#include "Configuration/PropertySheet.h" #include "Configuration/PropertySheet.h"
@ -344,7 +345,7 @@ BOOL JoyProcessKey(int virtkey, bool extended, bool down, bool autorep)
BOOL keychange = 0; BOOL keychange = 0;
bool bIsCursorKey = false; bool bIsCursorKey = false;
const bool swapButtons0and1 = sg_PropertySheet.GetButtonsSwapState(); const bool swapButtons0and1 = GetPropertySheet().GetButtonsSwapState();
if (virtKeyWithExtended == g_buttonVirtKey[!swapButtons0and1 ? 0 : 1]) if (virtKeyWithExtended == g_buttonVirtKey[!swapButtons0and1 ? 0 : 1])
{ {
@ -433,7 +434,7 @@ BOOL JoyProcessKey(int virtkey, bool extended, bool down, bool autorep)
buttonlatch[1] = BUTTONTIME; buttonlatch[1] = BUTTONTIME;
} }
} }
else if ((down && !autorep) || (sg_PropertySheet.GetJoystickCenteringControl() == JOYSTICK_MODE_CENTERING)) else if ((down && !autorep) || (GetPropertySheet().GetJoystickCenteringControl() == JOYSTICK_MODE_CENTERING))
{ {
int xkeys = 0; int xkeys = 0;
int ykeys = 0; int ykeys = 0;
@ -488,7 +489,7 @@ BOOL JoyProcessKey(int virtkey, bool extended, bool down, bool autorep)
ypos[nJoyNum] = PDL_CENTRAL + g_nPdlTrimY; ypos[nJoyNum] = PDL_CENTRAL + g_nPdlTrimY;
} }
if (bIsCursorKey && sg_PropertySheet.GetJoystickCursorControl()) if (bIsCursorKey && GetPropertySheet().GetJoystickCursorControl())
{ {
// Allow AppleII keyboard to see this cursor keypress too // Allow AppleII keyboard to see this cursor keypress too
return 0; return 0;
@ -505,7 +506,7 @@ static void DoAutofire(UINT uButton, BOOL& pressed)
static BOOL lastPressed[3] = {0}; static BOOL lastPressed[3] = {0};
BOOL nowPressed = pressed; BOOL nowPressed = pressed;
if (sg_PropertySheet.GetAutofire(uButton) && pressed) if (GetPropertySheet().GetAutofire(uButton) && pressed)
{ {
toggle[uButton] = (!lastPressed[uButton]) ? TRUE : !toggle[uButton]; toggle[uButton] = (!lastPressed[uButton]) ? TRUE : !toggle[uButton];
pressed = pressed && toggle[uButton]; pressed = pressed && toggle[uButton];

View File

@ -31,7 +31,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Keyboard.h" #include "Keyboard.h"
#include "Windows/AppleWin.h" #include "Windows/AppleWin.h"
#include "Core.h" #include "Core.h"
#include "Windows/WinFrame.h" #include "Interface.h"
#include "Utilities.h"
#include "Pravets.h" #include "Pravets.h"
#include "Tape.h" #include "Tape.h"
#include "YamlHelper.h" #include "YamlHelper.h"

View File

@ -1572,7 +1572,7 @@ void MemInitializeROM(void)
default: default:
{ {
_tcscpy(sRomFileName, TEXT("Unknown type!")); _tcscpy(sRomFileName, TEXT("Unknown type!"));
sg_PropertySheet.ConfigSaveApple2Type(A2TYPE_APPLE2EENHANCED); GetPropertySheet().ConfigSaveApple2Type(A2TYPE_APPLE2EENHANCED);
} }
} }
@ -1674,7 +1674,7 @@ void MemInitializeCustomF8ROM(void)
} }
} }
if (sg_PropertySheet.GetTheFreezesF8Rom() && IS_APPLE2) if (GetPropertySheet().GetTheFreezesF8Rom() && IS_APPLE2)
{ {
HGLOBAL hResData = NULL; HGLOBAL hResData = NULL;
BYTE* pData = NULL; BYTE* pData = NULL;

View File

@ -515,7 +515,7 @@ static void Snapshot_LoadState_v2(void)
// . A change in h/w via loading a save-state avoids this VM restart // . A change in h/w via loading a save-state avoids this VM restart
// The latter is the desired approach (as the former needs a "power-on" / F2 to start things again) // The latter is the desired approach (as the former needs a "power-on" / F2 to start things again)
sg_PropertySheet.ApplyNewConfig(m_ConfigNew, ConfigOld); // Mainly just saves (some) new state to Registry GetPropertySheet().ApplyNewConfig(m_ConfigNew, ConfigOld); // Mainly just saves (some) new state to Registry
MemInitializeROM(); MemInitializeROM();
MemInitializeCustomROM(); MemInitializeCustomROM();

View File

@ -37,7 +37,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "SerialComms.h" #include "SerialComms.h"
#include "CPU.h" #include "CPU.h"
#include "Windows/WinFrame.h" #include "Interface.h"
#include "Log.h" #include "Log.h"
#include "Memory.h" #include "Memory.h"
#include "YamlHelper.h" #include "YamlHelper.h"

View File

@ -75,11 +75,11 @@ static void LoadConfigOldJoystick_v1(const UINT uJoyNum)
break; break;
case 2: // Keyboard (standard) case 2: // Keyboard (standard)
uNewJoyType = J0C_KEYBD_NUMPAD; uNewJoyType = J0C_KEYBD_NUMPAD;
sg_PropertySheet.SetJoystickCenteringControl(JOYSTICK_MODE_FLOATING); GetPropertySheet().SetJoystickCenteringControl(JOYSTICK_MODE_FLOATING);
break; break;
case 3: // Keyboard (centering) case 3: // Keyboard (centering)
uNewJoyType = J0C_KEYBD_NUMPAD; uNewJoyType = J0C_KEYBD_NUMPAD;
sg_PropertySheet.SetJoystickCenteringControl(JOYSTICK_MODE_CENTERING); GetPropertySheet().SetJoystickCenteringControl(JOYSTICK_MODE_CENTERING);
break; break;
case 4: // Mouse case 4: // Mouse
uNewJoyType = J0C_MOUSE; uNewJoyType = J0C_MOUSE;
@ -124,7 +124,7 @@ void LoadConfiguration(void)
"Load Configuration", "Load Configuration",
MB_ICONSTOP | MB_SETFOREGROUND); MB_ICONSTOP | MB_SETFOREGROUND);
sg_PropertySheet.ConfigSaveApple2Type((eApple2Type)dwComputerType); GetPropertySheet().ConfigSaveApple2Type((eApple2Type)dwComputerType);
} }
apple2Type = (eApple2Type) dwComputerType; apple2Type = (eApple2Type) dwComputerType;
@ -211,13 +211,13 @@ void LoadConfiguration(void)
SetFullScreenShowSubunitStatus(dwTmp ? true : false); SetFullScreenShowSubunitStatus(dwTmp ? true : false);
if(REGLOAD(TEXT(REGVALUE_THE_FREEZES_F8_ROM), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_THE_FREEZES_F8_ROM), &dwTmp))
sg_PropertySheet.SetTheFreezesF8Rom(dwTmp); GetPropertySheet().SetTheFreezesF8Rom(dwTmp);
if(REGLOAD(TEXT(REGVALUE_SPKR_VOLUME), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_SPKR_VOLUME), &dwTmp))
SpkrSetVolume(dwTmp, sg_PropertySheet.GetVolumeMax()); SpkrSetVolume(dwTmp, GetPropertySheet().GetVolumeMax());
if(REGLOAD(TEXT(REGVALUE_MB_VOLUME), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_MB_VOLUME), &dwTmp))
MB_SetVolume(dwTmp, sg_PropertySheet.GetVolumeMax()); MB_SetVolume(dwTmp, GetPropertySheet().GetVolumeMax());
if(REGLOAD(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), &dwTmp))
g_bSaveStateOnExit = dwTmp ? true : false; g_bSaveStateOnExit = dwTmp ? true : false;
@ -245,21 +245,21 @@ void LoadConfiguration(void)
JoySetTrim((short)dwTmp, false); JoySetTrim((short)dwTmp, false);
if(REGLOAD(TEXT(REGVALUE_SCROLLLOCK_TOGGLE), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_SCROLLLOCK_TOGGLE), &dwTmp))
sg_PropertySheet.SetScrollLockToggle(dwTmp); GetPropertySheet().SetScrollLockToggle(dwTmp);
if(REGLOAD(TEXT(REGVALUE_CURSOR_CONTROL), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_CURSOR_CONTROL), &dwTmp))
sg_PropertySheet.SetJoystickCursorControl(dwTmp); GetPropertySheet().SetJoystickCursorControl(dwTmp);
if(REGLOAD(TEXT(REGVALUE_AUTOFIRE), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_AUTOFIRE), &dwTmp))
sg_PropertySheet.SetAutofire(dwTmp); GetPropertySheet().SetAutofire(dwTmp);
if(REGLOAD(TEXT(REGVALUE_SWAP_BUTTONS_0_AND_1), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_SWAP_BUTTONS_0_AND_1), &dwTmp))
sg_PropertySheet.SetButtonsSwapState(dwTmp ? true : false); GetPropertySheet().SetButtonsSwapState(dwTmp ? true : false);
if(REGLOAD(TEXT(REGVALUE_CENTERING_CONTROL), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_CENTERING_CONTROL), &dwTmp))
sg_PropertySheet.SetJoystickCenteringControl(dwTmp); GetPropertySheet().SetJoystickCenteringControl(dwTmp);
if(REGLOAD(TEXT(REGVALUE_MOUSE_CROSSHAIR), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_MOUSE_CROSSHAIR), &dwTmp))
sg_PropertySheet.SetMouseShowCrosshair(dwTmp); GetPropertySheet().SetMouseShowCrosshair(dwTmp);
if(REGLOAD(TEXT(REGVALUE_MOUSE_RESTRICT_TO_WINDOW), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_MOUSE_RESTRICT_TO_WINDOW), &dwTmp))
sg_PropertySheet.SetMouseRestrictToWindow(dwTmp); GetPropertySheet().SetMouseRestrictToWindow(dwTmp);
if(REGLOAD(TEXT(REGVALUE_SLOT4), &dwTmp)) if(REGLOAD(TEXT(REGVALUE_SLOT4), &dwTmp))
GetCardMgr().Insert(4, (SS_CARDTYPE)dwTmp); GetCardMgr().Insert(4, (SS_CARDTYPE)dwTmp);
@ -503,7 +503,7 @@ void GetAppleWindowTitle()
if (g_hCustomRomF8 != INVALID_HANDLE_VALUE) if (g_hCustomRomF8 != INVALID_HANDLE_VALUE)
g_pAppTitle += TEXT(" (custom rom)"); g_pAppTitle += TEXT(" (custom rom)");
else if (sg_PropertySheet.GetTheFreezesF8Rom() && IS_APPLE2) else if (GetPropertySheet().GetTheFreezesF8Rom() && IS_APPLE2)
g_pAppTitle += TEXT(" (The Freeze's non-autostart F8 rom)"); g_pAppTitle += TEXT(" (The Freeze's non-autostart F8 rom)");
switch (g_nAppMode) switch (g_nAppMode)

View File

@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "StdAfx.h" #include "StdAfx.h"
#include "Windows/AppleWin.h" #include "Windows/AppleWin.h"
#include "Interface.h"
#include "Utilities.h" #include "Utilities.h"
#include "CmdLine.h" #include "CmdLine.h"
#include "Debug.h" #include "Debug.h"
@ -143,7 +144,7 @@ static void ContinueExecution(void)
// //
bool bScrollLock_FullSpeed = false; bool bScrollLock_FullSpeed = false;
if (sg_PropertySheet.GetScrollLockToggle()) if (GetPropertySheet().GetScrollLockToggle())
{ {
bScrollLock_FullSpeed = g_bScrollLock_FullSpeed; bScrollLock_FullSpeed = g_bScrollLock_FullSpeed;
} }
@ -833,7 +834,7 @@ static void RepeatInitialization(void)
if (g_cmdLine.bSwapButtons0and1) if (g_cmdLine.bSwapButtons0and1)
{ {
sg_PropertySheet.SetButtonsSwapState(true); GetPropertySheet().SetButtonsSwapState(true);
// Reapply after a restart - TODO: grey-out the Config UI for "Swap 0/1" when this cmd line is passed in // Reapply after a restart - TODO: grey-out the Config UI for "Swap 0/1" when this cmd line is passed in
} }
@ -1047,3 +1048,9 @@ static void Shutdown(void)
if (g_cmdLine.bSlot7EmptyOnExit) if (g_cmdLine.bSlot7EmptyOnExit)
UnplugHardDiskControllerCard(); UnplugHardDiskControllerCard();
} }
IPropertySheet& GetPropertySheet()
{
static CPropertySheet sg_PropertySheet;
return sg_PropertySheet;
}

View File

@ -5,10 +5,7 @@ void SingleStep(bool bReinit);
//=========================================== //===========================================
// Win32 // Win32
extern HINSTANCE g_hInstance;
bool GetLoadedSaveStateFlag(void); bool GetLoadedSaveStateFlag(void);
void SetLoadedSaveStateFlag(const bool bFlag);
bool GetHookAltGrControl(void); bool GetHookAltGrControl(void);
extern bool g_bRestartFullScreen; extern bool g_bRestartFullScreen;

View File

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Windows/WinFrame.h" #include "Windows/WinFrame.h"
#include "Windows/AppleWin.h" #include "Windows/AppleWin.h"
#include "Interface.h"
#include "Keyboard.h" #include "Keyboard.h"
#include "Log.h" #include "Log.h"
#include "Memory.h" #include "Memory.h"
@ -246,10 +247,10 @@ static void RevealCursor()
FrameShowCursor(TRUE); FrameShowCursor(TRUE);
if (sg_PropertySheet.GetMouseShowCrosshair()) // Erase crosshairs if they are being drawn if (GetPropertySheet().GetMouseShowCrosshair()) // Erase crosshairs if they are being drawn
DrawCrosshairs(0,0); DrawCrosshairs(0,0);
if (sg_PropertySheet.GetMouseRestrictToWindow()) if (GetPropertySheet().GetMouseRestrictToWindow())
SetUsingCursor(FALSE); SetUsingCursor(FALSE);
g_bLastCursorInAppleViewport = false; g_bLastCursorInAppleViewport = false;
@ -1294,7 +1295,7 @@ LRESULT CALLBACK FrameWndProc (
else if (wparam == VK_F11 && !KeybGetCtrlStatus()) // Save state (F11) else if (wparam == VK_F11 && !KeybGetCtrlStatus()) // Save state (F11)
{ {
SoundCore_SetFade(FADE_OUT); SoundCore_SetFade(FADE_OUT);
if(sg_PropertySheet.SaveStateSelectImage(window, true)) if(GetPropertySheet().SaveStateSelectImage(window, true))
{ {
Snapshot_SaveState(); Snapshot_SaveState();
} }
@ -1303,7 +1304,7 @@ LRESULT CALLBACK FrameWndProc (
else if (wparam == VK_F12) // Load state (F12 or Ctrl+F12) else if (wparam == VK_F12) // Load state (F12 or Ctrl+F12)
{ {
SoundCore_SetFade(FADE_OUT); SoundCore_SetFade(FADE_OUT);
if(sg_PropertySheet.SaveStateSelectImage(window, false)) if(GetPropertySheet().SaveStateSelectImage(window, false))
{ {
Snapshot_LoadState(); Snapshot_LoadState();
} }
@ -1337,7 +1338,7 @@ LRESULT CALLBACK FrameWndProc (
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG)) if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
VideoRedrawScreen(); VideoRedrawScreen();
} }
else if ((wparam == VK_SCROLL) && sg_PropertySheet.GetScrollLockToggle()) else if ((wparam == VK_SCROLL) && GetPropertySheet().GetScrollLockToggle())
{ {
g_bScrollLock_FullSpeed = !g_bScrollLock_FullSpeed; g_bScrollLock_FullSpeed = !g_bScrollLock_FullSpeed;
} }
@ -2070,7 +2071,7 @@ static void ProcessButtonClick(int button, bool bFromButtonUI /*=false*/)
case BTN_SETUP: case BTN_SETUP:
{ {
sg_PropertySheet.Init(); GetPropertySheet().Init();
} }
break; break;
@ -2716,7 +2717,7 @@ static void DrawCrosshairsMouse()
if (!GetCardMgr().IsMouseCardInstalled()) if (!GetCardMgr().IsMouseCardInstalled())
return; return;
if (!sg_PropertySheet.GetMouseShowCrosshair()) if (!GetPropertySheet().GetMouseShowCrosshair())
return; return;
int iX, iMinX, iMaxX; int iX, iMinX, iMaxX;
@ -2743,7 +2744,7 @@ static void UpdateMouseInAppleViewport(int iOutOfBoundsX, int iOutOfBoundsY, int
if (bOutsideAppleViewport) if (bOutsideAppleViewport)
{ {
if (sg_PropertySheet.GetMouseRestrictToWindow()) if (GetPropertySheet().GetMouseRestrictToWindow())
return; return;
g_bLastCursorInAppleViewport = false; g_bLastCursorInAppleViewport = false;
@ -2775,7 +2776,7 @@ static void UpdateMouseInAppleViewport(int iOutOfBoundsX, int iOutOfBoundsY, int
// //
if (sg_PropertySheet.GetMouseRestrictToWindow()) if (GetPropertySheet().GetMouseRestrictToWindow())
SetUsingCursor(TRUE); SetUsingCursor(TRUE);
} }
else else

View File

@ -1,40 +1,24 @@
#pragma once #pragma once
// Win32 // Win32
extern HWND g_hFrameWindow;
extern int g_nViewportCX; extern int g_nViewportCX;
extern int g_nViewportCY; extern int g_nViewportCY;
extern BOOL g_bConfirmReboot; // saved PageConfig REGSAVE
extern BOOL g_bMultiMon;
// Emulator // Emulator
extern bool g_bFreshReset;
extern std::string PathFilename[2];
extern bool g_bScrollLock_FullSpeed; extern bool g_bScrollLock_FullSpeed;
// Prototypes // Prototypes
void CtrlReset();
void FrameCreateWindow(void); void FrameCreateWindow(void);
HDC FrameGetDC (); HDC FrameGetDC ();
void FrameReleaseDC (); void FrameReleaseDC ();
void FrameRefreshStatus (int, bool bUpdateDiskStatus = true );
void FrameRegisterClass (); void FrameRegisterClass ();
void FrameSetCursorPosByMousePos();
int GetViewportScale(void); int GetViewportScale(void);
int SetViewportScale(int nNewScale, bool bForce = false);
void GetViewportCXCY(int& nViewportCX, int& nViewportCY); void GetViewportCXCY(int& nViewportCX, int& nViewportCY);
void FrameUpdateApple2Type(void);
bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedHeight=0);
bool IsFullScreen(void); bool IsFullScreen(void);
bool GetFullScreenShowSubunitStatus(void); bool GetFullScreenShowSubunitStatus(void);
void SetFullScreenShowSubunitStatus(bool bShow);
void FrameDrawDiskLEDS( HDC hdc );
void FrameDrawDiskStatus( HDC hdc );
LRESULT CALLBACK FrameWndProc ( LRESULT CALLBACK FrameWndProc (
HWND window, HWND window,
@ -47,5 +31,3 @@
UINT Get3DBorderWidth(void); UINT Get3DBorderWidth(void);
UINT Get3DBorderHeight(void); UINT Get3DBorderHeight(void);
void SetAltEnterToggleFullScreen(bool mode);

View File

@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Windows/WinVideo.h" #include "Windows/WinVideo.h"
#include "Windows/WinFrame.h" #include "Windows/WinFrame.h"
#include "Windows/AppleWin.h" #include "Windows/AppleWin.h"
#include "Interface.h"
#include "Video.h" #include "Video.h"
#include "Core.h" #include "Core.h"
#include "CPU.h" #include "CPU.h"

View File

@ -10,7 +10,6 @@ void VideoChooseMonochromeColor (); // FIXME: Should be moved to PageConfig a
void VideoDisplayLogo (); void VideoDisplayLogo ();
void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false); void VideoRedrawScreenDuringFullSpeed(DWORD dwCyclesThisFrame, bool bInit = false);
void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame); void VideoRedrawScreenAfterFullSpeed(DWORD dwCyclesThisFrame);
void VideoRedrawScreen (void);
void VideoRefreshScreen (uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedrawWholeScreen = false); void VideoRefreshScreen (uint32_t uRedrawWholeScreenVideoMode = 0, bool bRedrawWholeScreen = false);
void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename); void Video_RedrawAndTakeScreenShot(const char* pScreenshotFilename);