WIP: 'Reset all to Default' button: Input tab: cursor, swap, autofire, centering

This commit is contained in:
tomcw
2026-01-19 22:09:52 +00:00
parent 441b1ac733
commit 90c564a032
6 changed files with 44 additions and 7 deletions

View File

@@ -53,6 +53,10 @@ CConfigNeedingRestart::CConfigNeedingRestart()
m_enhanceDiskAccessSpeed = false;
m_scrollLockToggle = 0;
m_machineSpeed = 0;
m_cursorControl = 0;
m_centeringControl = 0;
m_autofire = 0;
m_swapButtons0and1 = false;
m_RamWorksMemorySize = 0;
m_serialPortItem = 0;
}
@@ -109,6 +113,10 @@ void CConfigNeedingRestart::Reload()
m_scrollLockToggle = GetPropertySheet().GetScrollLockToggle();
m_enhanceDiskAccessSpeed = GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk();
m_machineSpeed = g_dwSpeed;
m_cursorControl = GetPropertySheet().GetJoystickCursorControl();
m_centeringControl = GetPropertySheet().GetJoystickCenteringControl();
m_autofire = GetPropertySheet().GetAutofire();
m_swapButtons0and1 = GetPropertySheet().GetButtonsSwapState();
m_RamWorksMemorySize = GetRamWorksMemorySize();
if (cardManager.IsParallelPrinterCardInstalled())
@@ -138,6 +146,10 @@ const CConfigNeedingRestart& CConfigNeedingRestart::operator= (const CConfigNeed
m_enhanceDiskAccessSpeed = other.m_enhanceDiskAccessSpeed;
m_scrollLockToggle = other.m_scrollLockToggle;
m_machineSpeed = other.m_machineSpeed;
m_cursorControl = other.m_cursorControl;
m_centeringControl = other.m_centeringControl;
m_autofire = other.m_autofire;
m_swapButtons0and1 = other.m_swapButtons0and1;
m_RamWorksMemorySize = other.m_RamWorksMemorySize;
m_parallelPrinterCard = other.m_parallelPrinterCard;
m_serialPortItem = other.m_serialPortItem;
@@ -154,9 +166,10 @@ const CConfigNeedingRestart& CConfigNeedingRestart::operator= (const CConfigNeed
bool CConfigNeedingRestart::operator== (const CConfigNeedingRestart& other) const
{
// Ignore: (as they don't require the VM to be restarted)
// . m_confirmReboot, m_masterVolume
// . m_videoType, m_videoStyle, m_monochromeRGB, m_fullScreen_ShowSubunitStatus
// . m_enhanceDiskAccessSpeed, m_scrollLockToggle, m_machineSpeed
// . [Config] m_confirmReboot, m_masterVolume
// . [Config] m_videoType, m_videoStyle, m_monochromeRGB, m_fullScreen_ShowSubunitStatus
// . [Config] m_enhanceDiskAccessSpeed, m_scrollLockToggle, m_machineSpeed
// . [Input] m_cursorControl, m_centeringControl, m_autofire, m_swapButtons0and1
return m_Apple2Type == other.m_Apple2Type &&
m_CpuType == other.m_CpuType &&

View File

@@ -44,6 +44,7 @@ public:
bool m_tfeVirtualDNS;
UINT m_bEnableTheFreezesF8Rom;
UINT m_uSaveLoadStateMsg;
// Configuration
bool m_confirmReboot;
uint32_t m_masterVolume;
VideoType_e m_videoType;
@@ -54,6 +55,12 @@ public:
bool m_enhanceDiskAccessSpeed;
UINT m_scrollLockToggle;
UINT m_machineSpeed;
// Input
UINT m_cursorControl;
UINT m_centeringControl;
UINT m_autofire;
bool m_swapButtons0and1;
// Slots
uint32_t m_RamWorksMemorySize; // Size in 64K banks
ParallelPrinterCard m_parallelPrinterCard; // Use entire card object, as there are many config vars
UINT m_serialPortItem; // SSC: Just one config var for this card (at the moment)

View File

@@ -21,6 +21,7 @@ public:
virtual UINT GetJoystickCenteringControl(void) = 0;
virtual void SetJoystickCenteringControl(UINT uValue) = 0;
virtual UINT GetAutofire(UINT uButton) = 0;
virtual UINT GetAutofire(void) = 0;
virtual void SetAutofire(UINT uValue) = 0;
virtual bool GetButtonsSwapState(void) = 0;
virtual void SetButtonsSwapState(bool value) = 0;

View File

@@ -415,6 +415,8 @@ void CPageConfig::ui_tfe_settings_dialog(HWND hWnd)
void CPageConfig::ResetAllToDefault(HWND hWnd)
{
// Configuration
const eApple2Type apple2Type = A2TYPE_APPLE2EENHANCED;
m_PropertySheetHelper.GetConfigNew().m_Apple2Type = apple2Type;
m_PropertySheetHelper.GetConfigNew().m_CpuType = ProbeMainCpuDefault(apple2Type);
@@ -433,6 +435,13 @@ void CPageConfig::ResetAllToDefault(HWND hWnd)
m_PropertySheetHelper.GetConfigNew().m_scrollLockToggle = kScrollLockToggle_Default;
m_PropertySheetHelper.GetConfigNew().m_machineSpeed = kMachineSpeed_Default;
// Input
m_PropertySheetHelper.GetConfigNew().m_cursorControl = CPageInput::kCursorControl_Default;
m_PropertySheetHelper.GetConfigNew().m_centeringControl = CPageInput::kCenteringControl_Default;
m_PropertySheetHelper.GetConfigNew().m_autofire = CPageInput::kAutofire_Default;
m_PropertySheetHelper.GetConfigNew().m_swapButtons0and1 = CPageInput::kSwapButtons0and1_Default;
// Slots
m_PropertySheetHelper.ResetSlotsToDefault();

View File

@@ -12,10 +12,10 @@ public:
CPageInput(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_INPUT),
m_PropertySheetHelper(PropertySheetHelper),
m_uCursorControl(1),
m_uCenteringControl(JOYSTICK_MODE_CENTERING),
m_bmAutofire(0),
m_bSwapButtons0and1(false)
m_uCursorControl(kCursorControl_Default),
m_uCenteringControl(kCenteringControl_Default),
m_bmAutofire(kAutofire_Default),
m_bSwapButtons0and1(kSwapButtons0and1_Default)
{
CPageInput::ms_this = this;
}
@@ -28,10 +28,16 @@ public:
UINT GetJoystickCenteringControl(void){ return m_uCenteringControl; }
void SetJoystickCenteringControl(UINT uValue){ m_uCenteringControl = uValue; }
UINT GetAutofire(UINT uButton) { return (m_bmAutofire >> uButton) & 1; } // Get a specific button
UINT GetAutofire(void) { return m_bmAutofire; } // Get all buttons
void SetAutofire(UINT uValue) { m_bmAutofire = uValue; } // Set all buttons
bool GetButtonsSwapState(void){ return m_bSwapButtons0and1; }
void SetButtonsSwapState(bool value){ m_bSwapButtons0and1 = value; }
static const UINT kCursorControl_Default = 1;
static const UINT kCenteringControl_Default = JOYSTICK_MODE_CENTERING;
static const UINT kAutofire_Default = 0;
static const bool kSwapButtons0and1_Default = false;
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);

View File

@@ -42,6 +42,7 @@ public:
virtual UINT GetJoystickCenteringControl(void){ return m_PageInput.GetJoystickCenteringControl(); }
virtual void SetJoystickCenteringControl(UINT uValue){ m_PageInput.SetJoystickCenteringControl(uValue); }
virtual UINT GetAutofire(UINT uButton) { return m_PageInput.GetAutofire(uButton); }
virtual UINT GetAutofire(void) { return m_PageInput.GetAutofire(); }
virtual void SetAutofire(UINT uValue) { m_PageInput.SetAutofire(uValue); }
virtual bool GetButtonsSwapState(void) { return m_PageInput.GetButtonsSwapState(); }
virtual void SetButtonsSwapState(bool value) { m_PageInput.SetButtonsSwapState(value); }