WIP: 'Reset all to Default' button: enhance disk speed, scroll-lock toggle, machine speed

This commit is contained in:
tomcw
2026-01-18 20:41:50 +00:00
parent 8e7254e981
commit 3cdffdd986
6 changed files with 32 additions and 12 deletions

View File

@@ -50,6 +50,9 @@ CConfigNeedingRestart::CConfigNeedingRestart()
m_videoRefreshRate = VR_NONE;
m_monochromeRGB = Video::MONO_COLOR_DEFAULT;
m_fullScreen_ShowSubunitStatus = false;
m_enhanceDiskAccessSpeed = false;
m_scrollLockToggle = 0;
m_machineSpeed = 0;
m_RamWorksMemorySize = 0;
m_serialPortItem = 0;
}
@@ -103,6 +106,9 @@ void CConfigNeedingRestart::Reload()
m_videoRefreshRate = GetVideo().GetVideoRefreshRate();
m_monochromeRGB = GetVideo().GetMonochromeRGB();
m_fullScreen_ShowSubunitStatus = Win32Frame::GetWin32Frame().GetFullScreenShowSubunitStatus();
m_scrollLockToggle = GetPropertySheet().GetScrollLockToggle();
m_enhanceDiskAccessSpeed = GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk();
m_machineSpeed = g_dwSpeed;
m_RamWorksMemorySize = GetRamWorksMemorySize();
if (cardManager.IsParallelPrinterCardInstalled())
@@ -129,6 +135,9 @@ const CConfigNeedingRestart& CConfigNeedingRestart::operator= (const CConfigNeed
m_videoRefreshRate = other.m_videoRefreshRate;
m_monochromeRGB = other.m_monochromeRGB;
m_fullScreen_ShowSubunitStatus = other.m_fullScreen_ShowSubunitStatus;
m_enhanceDiskAccessSpeed = other.m_enhanceDiskAccessSpeed;
m_scrollLockToggle = other.m_scrollLockToggle;
m_machineSpeed = other.m_machineSpeed;
m_RamWorksMemorySize = other.m_RamWorksMemorySize;
m_parallelPrinterCard = other.m_parallelPrinterCard;
m_serialPortItem = other.m_serialPortItem;
@@ -147,6 +156,7 @@ bool CConfigNeedingRestart::operator== (const CConfigNeedingRestart& other) cons
// 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
return m_Apple2Type == other.m_Apple2Type &&
m_CpuType == other.m_CpuType &&

View File

@@ -51,6 +51,9 @@ public:
VideoRefreshRate_e m_videoRefreshRate;
COLORREF m_monochromeRGB;
bool m_fullScreen_ShowSubunitStatus;
bool m_enhanceDiskAccessSpeed;
UINT m_scrollLockToggle;
UINT m_machineSpeed;
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

@@ -224,14 +224,14 @@ void CPageConfig::InitOptions(HWND hWnd)
CheckDlgButton(hWnd, IDC_CHECK_CONFIRM_REBOOT, m_PropertySheetHelper.GetConfigNew().m_confirmReboot ? BST_CHECKED : BST_UNCHECKED);
//
// Master Volume
SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETRANGE, TRUE, MAKELONG(VOLUME_MIN, VOLUME_MAX));
SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETPAGESIZE, 0, 10);
SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETTICFREQ, 10, 0);
SendDlgItemMessage(hWnd, IDC_SLIDER_MASTER_VOLUME, TBM_SETPOS, TRUE, VOLUME_MAX - m_PropertySheetHelper.GetConfigNew().m_masterVolume); // Invert: L=MIN, R=MAX
//
// Video
m_PropertySheetHelper.FillComboBox(hWnd, IDC_VIDEOTYPE, GetVideo().GetVideoChoices(), m_PropertySheetHelper.GetConfigNew().m_videoType);
const VideoStyle_e style = m_PropertySheetHelper.GetConfigNew().m_videoStyle;
@@ -242,21 +242,18 @@ void CPageConfig::InitOptions(HWND hWnd)
CheckDlgButton(hWnd, IDC_CHECK_FS_SHOW_SUBUNIT_STATUS, m_PropertySheetHelper.GetConfigNew().m_fullScreen_ShowSubunitStatus ? BST_CHECKED : BST_UNCHECKED);
//
// Emulation Speed
CheckDlgButton(hWnd, IDC_ENHANCE_DISK_ENABLE, GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_SCROLLLOCK_TOGGLE, m_uScrollLockToggle ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_ENHANCE_DISK_ENABLE, m_PropertySheetHelper.GetConfigNew().m_enhanceDiskAccessSpeed ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_SCROLLLOCK_TOGGLE, m_PropertySheetHelper.GetConfigNew().m_scrollLockToggle ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETRANGE, TRUE, MAKELONG(0, 40));
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPAGESIZE, 0, 5);
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETTICFREQ, 10, 0);
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPOS, TRUE, g_dwSpeed);
//
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPOS, TRUE, m_PropertySheetHelper.GetConfigNew().m_machineSpeed);
BOOL bCustom = TRUE;
if (g_dwSpeed == SPEED_NORMAL)
if (m_PropertySheetHelper.GetConfigNew().m_machineSpeed == SPEED_NORMAL)
{
uint32_t dwCustomSpeed;
REGLOAD_DEFAULT(REGVALUE_CUSTOM_SPEED, &dwCustomSpeed, 0);
@@ -432,6 +429,10 @@ void CPageConfig::ResetAllToDefault(HWND hWnd)
m_PropertySheetHelper.GetConfigNew().m_fullScreen_ShowSubunitStatus = Win32Frame::kFullScreen_ShowSubunitStatus_Default;
m_PropertySheetHelper.GetConfigNew().m_enhanceDiskAccessSpeed = kEnhanceDiskAccessSpeed_Default;
m_PropertySheetHelper.GetConfigNew().m_scrollLockToggle = kScrollLockToggle_Default;
m_PropertySheetHelper.GetConfigNew().m_machineSpeed = kMachineSpeed_Default;
// Slots
m_PropertySheetHelper.ResetSlotsToDefault();

View File

@@ -12,9 +12,10 @@ public:
CPageConfig(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_CONFIG),
m_PropertySheetHelper(PropertySheetHelper),
m_uScrollLockToggle(0)
m_uScrollLockToggle(kScrollLockToggle_Default)
{
CPageConfig::ms_this = this;
memset(m_customColors, 0, sizeof(m_customColors));
}
virtual ~CPageConfig(){}
@@ -44,6 +45,9 @@ private:
static const UINT VOLUME_MIN = 0;
static const UINT VOLUME_MAX = 59;
static const UINT kScrollLockToggle_Default = 0;
static const UINT kMachineSpeed_Default = SPEED_NORMAL;
const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uScrollLockToggle;

View File

@@ -69,7 +69,7 @@ Disk2InterfaceCard::Disk2InterfaceCard(UINT slot) :
m_saveDiskImage = true; // Save the DiskImage name to Registry
m_diskLastCycle = 0;
m_diskLastReadLatchCycle = 0;
m_enhanceDisk = true;
m_enhanceDisk = kEnhanceDiskAccessSpeed_Default;
m_is13SectorFirmware = false;
m_force13SectorFirmware = false;
m_deferredStepperEvent = false;

View File

@@ -42,6 +42,8 @@ const bool IMAGE_FORCE_WRITE_PROTECTED = true;
const bool IMAGE_DONT_CREATE = false;
const bool IMAGE_CREATE = true;
const bool kEnhanceDiskAccessSpeed_Default = true;
class FloppyDisk
{
public: