mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-05-28 17:41:37 +00:00
Add Disk Config GUI and save flag to Registry
This commit is contained in:
parent
815e0d4fa7
commit
e409ef82b4
|
@ -187,7 +187,8 @@ BEGIN
|
|||
COMBOBOX IDC_COMBO_DISK1,40,35,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO_DISK2,40,52,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
||||
CONTROL "Enable &Disk II controller in slot 5",IDC_DISKII_SLOT5_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,122,10
|
||||
CONTROL "Enable &Disk II controller in slot 5",IDC_DISKII_SLOT5_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,115,10
|
||||
CONTROL "Show status",IDC_DISKII_SLOT5_STATUS_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,76,60,10
|
||||
LTEXT "Disk 1:",IDC_STATIC,11,93,23,8
|
||||
LTEXT "Disk 2:",IDC_STATIC,11,110,23,8
|
||||
COMBOBOX IDC_COMBO_DISK1_SLOT5,40,92,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
|
|
|
@ -61,7 +61,8 @@
|
|||
#define IDC_MB_VOLUME 1010
|
||||
#define IDC_SAVESTATE_BROWSE 1011
|
||||
#define IDC_MONOCOLOR 1012
|
||||
#define IDC_DISKII_SLOT5_ENABLE 1020
|
||||
#define IDC_DISKII_SLOT5_ENABLE 1019
|
||||
#define IDC_DISKII_SLOT5_STATUS_ENABLE 1020
|
||||
#define IDC_HDD_ENABLE 1021
|
||||
#define IDC_HDD_SWAP 1022
|
||||
#define IDC_PASTE_FROM_CLIPBOARD 1023
|
||||
|
|
|
@ -67,6 +67,7 @@ enum AppMode_e
|
|||
#define REGVALUE_OLD_APPLE2_TYPE "Computer Emulation" // Deprecated
|
||||
#define REGVALUE_CONFIRM_REBOOT "Confirm Reboot" // Added at 1.24.1 PageConfig
|
||||
#define REGVALUE_FS_SHOW_SUBUNIT_STATUS "Full-screen show subunit status"
|
||||
#define REGVALUE_SHOW_DISKII_SLOT5_STATUS "Show Disk II Slot 5 status"
|
||||
#define REGVALUE_SOUND_EMULATION "Sound Emulation"
|
||||
#define REGVALUE_SPKR_VOLUME "Speaker Volume"
|
||||
#define REGVALUE_MB_VOLUME "Mockingboard Volume"
|
||||
|
|
|
@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
#include "PropertySheet.h"
|
||||
|
||||
#include "../Windows/AppleWin.h"
|
||||
#include "../Windows/Win32Frame.h"
|
||||
#include "../CardManager.h"
|
||||
#include "../Disk.h" // Drive_e, Disk_Status_e
|
||||
#include "../Harddisk.h"
|
||||
|
@ -279,6 +280,19 @@ void CPageDisk::DlgOK(HWND hWnd)
|
|||
REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (DWORD)bNewEnhanceDisk);
|
||||
}
|
||||
|
||||
Win32Frame& win32Frame = Win32Frame::GetWin32Frame();
|
||||
const bool bNewDiskiiSlot5Status = IsDlgButtonChecked(hWnd, IDC_DISKII_SLOT5_STATUS_ENABLE) ? true : false;
|
||||
|
||||
if (win32Frame.GetWindowedModeShowDiskiiSlot5Status() != bNewDiskiiSlot5Status)
|
||||
{
|
||||
REGSAVE(REGVALUE_SHOW_DISKII_SLOT5_STATUS, bNewDiskiiSlot5Status ? 1 : 0);
|
||||
win32Frame.SetWindowedModeShowDiskiiSlot5Status(bNewDiskiiSlot5Status);
|
||||
|
||||
if (!win32Frame.IsFullScreen())
|
||||
win32Frame.FrameRefreshStatus(DRAW_BACKGROUND | DRAW_LEDS | DRAW_DISK_STATUS);
|
||||
}
|
||||
|
||||
|
||||
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
|
||||
}
|
||||
|
||||
|
@ -292,9 +306,11 @@ void CPageDisk::InitOptions(HWND hWnd)
|
|||
const SS_CARDTYPE cardInSlot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[slot];
|
||||
|
||||
CheckDlgButton(hWnd, IDC_DISKII_SLOT5_ENABLE, (cardInSlot5 == CT_Disk2) ? BST_CHECKED : BST_UNCHECKED);
|
||||
CheckDlgButton(hWnd, IDC_DISKII_SLOT5_STATUS_ENABLE, Win32Frame::GetWin32Frame().GetWindowedModeShowDiskiiSlot5Status() ? BST_CHECKED : BST_UNCHECKED);
|
||||
|
||||
const BOOL enable = (cardInSlot5 == CT_Disk2 || cardInSlot5 == CT_Empty) ? TRUE : FALSE;
|
||||
EnableWindow(GetDlgItem(hWnd, IDC_DISKII_SLOT5_ENABLE), enable);
|
||||
EnableWindow(GetDlgItem(hWnd, IDC_DISKII_SLOT5_STATUS_ENABLE), (cardInSlot5 == CT_Disk2) ? TRUE : FALSE);
|
||||
|
||||
if (cardInSlot5 == CT_Disk2)
|
||||
InitComboFloppyDrive(hWnd, slot);
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
virtual void FrameSetCursorPosByMousePos() = 0;
|
||||
|
||||
virtual void SetFullScreenShowSubunitStatus(bool bShow) = 0;
|
||||
virtual void SetWindowedModeShowDiskiiSlot5Status(bool bShow) = 0;
|
||||
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedWidth=0, UINT userSpecifiedHeight=0) = 0;
|
||||
virtual int SetViewportScale(int nNewScale, bool bForce = false) = 0;
|
||||
virtual void SetAltEnterToggleFullScreen(bool mode) = 0;
|
||||
|
|
|
@ -193,6 +193,9 @@ void LoadConfiguration(bool loadImages)
|
|||
if(REGLOAD(TEXT(REGVALUE_FS_SHOW_SUBUNIT_STATUS), &dwTmp))
|
||||
GetFrame().SetFullScreenShowSubunitStatus(dwTmp ? true : false);
|
||||
|
||||
if (REGLOAD(TEXT(REGVALUE_SHOW_DISKII_SLOT5_STATUS), &dwTmp))
|
||||
GetFrame().SetWindowedModeShowDiskiiSlot5Status(dwTmp ? true : false);
|
||||
|
||||
if(REGLOAD(TEXT(REGVALUE_THE_FREEZES_F8_ROM), &dwTmp))
|
||||
GetPropertySheet().SetTheFreezesF8Rom(dwTmp);
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ Win32Frame::Win32Frame()
|
|||
g_bFrameActive = false;
|
||||
g_windowMinimized = false;
|
||||
g_bFullScreen_ShowSubunitStatus = true;
|
||||
m_showDiskiiSlot5Status = false;
|
||||
g_win_fullscreen_offsetx = 0;
|
||||
g_win_fullscreen_offsety = 0;
|
||||
m_bestWidthForFullScreen = 0;
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
virtual void FrameSetCursorPosByMousePos();
|
||||
|
||||
virtual void SetFullScreenShowSubunitStatus(bool bShow);
|
||||
virtual void SetWindowedModeShowDiskiiSlot5Status(bool bShow);
|
||||
virtual bool GetBestDisplayResolutionForFullScreen(UINT& bestWidth, UINT& bestHeight, UINT userSpecifiedWidth=0, UINT userSpecifiedHeight=0);
|
||||
virtual int SetViewportScale(int nNewScale, bool bForce = false);
|
||||
virtual void SetAltEnterToggleFullScreen(bool mode);
|
||||
|
@ -61,6 +62,7 @@ public:
|
|||
virtual std::shared_ptr<NetworkBackend> CreateNetworkBackend(const std::string & interfaceName);
|
||||
|
||||
bool GetFullScreenShowSubunitStatus(void);
|
||||
bool GetWindowedModeShowDiskiiSlot5Status(void);
|
||||
int GetFullScreenOffsetX(void);
|
||||
int GetFullScreenOffsetY(void);
|
||||
bool IsFullScreen(void);
|
||||
|
@ -140,6 +142,7 @@ private:
|
|||
bool g_windowMinimized;
|
||||
std::string driveTooltip;
|
||||
bool g_bFullScreen_ShowSubunitStatus;
|
||||
bool m_showDiskiiSlot5Status;
|
||||
int g_win_fullscreen_offsetx;
|
||||
int g_win_fullscreen_offsety;
|
||||
UINT m_bestWidthForFullScreen;
|
||||
|
|
|
@ -519,6 +519,16 @@ void Win32Frame::SetFullScreenShowSubunitStatus(bool bShow)
|
|||
g_bFullScreen_ShowSubunitStatus = bShow;
|
||||
}
|
||||
|
||||
bool Win32Frame::GetWindowedModeShowDiskiiSlot5Status(void)
|
||||
{
|
||||
return m_showDiskiiSlot5Status;
|
||||
}
|
||||
|
||||
void Win32Frame::SetWindowedModeShowDiskiiSlot5Status(bool bShow)
|
||||
{
|
||||
m_showDiskiiSlot5Status = bShow;
|
||||
}
|
||||
|
||||
void Win32Frame::FrameDrawDiskLEDS()
|
||||
{
|
||||
FrameDrawDiskLEDS((HDC)0);
|
||||
|
@ -561,7 +571,7 @@ void Win32Frame::FrameDrawDiskLEDS( HDC passdc )
|
|||
DrawBitmapRect(dc, x + 12, y + 6, &rDiskLed, g_hDiskWindowedLED[g_eStatusDrive1]);
|
||||
DrawBitmapRect(dc, x + 31, y + 6, &rDiskLed, g_hDiskWindowedLED[g_eStatusDrive2]);
|
||||
|
||||
if (g_nViewportScale > 1 && GetCardMgr().QuerySlot(SLOT5) == CT_Disk2)
|
||||
if (g_nViewportScale > 1 && GetCardMgr().QuerySlot(SLOT5) == CT_Disk2 && GetWindowedModeShowDiskiiSlot5Status())
|
||||
{
|
||||
Disk_Status_e eDrive1StatusSlot5 = DISK_STATUS_OFF;
|
||||
Disk_Status_e eDrive2StatusSlot5 = DISK_STATUS_OFF;
|
||||
|
@ -669,12 +679,12 @@ void Win32Frame::DrawTrackSector(HDC dc, UINT slot, int drive1Track, int drive1S
|
|||
const int x = buttonx;
|
||||
const int y = buttony + BUTTONS * BUTTONCY + 1;
|
||||
|
||||
const int diskIIInfoSize = (slot == SLOT6) ? 0 : 48;
|
||||
const int diskIIInfoHeight = (slot == SLOT6) ? 0 : 48;
|
||||
|
||||
// Erase background
|
||||
SelectObject(dc, GetStockObject(NULL_PEN));
|
||||
SelectObject(dc, btnfacebrush);
|
||||
Rectangle(dc, x + 4, y + 35 + diskIIInfoSize, x + BUTTONCX + 1, y + 59 + diskIIInfoSize);
|
||||
Rectangle(dc, x + 4, y + 35 + diskIIInfoHeight, x + BUTTONCX + 1, y + 59 + diskIIInfoHeight);
|
||||
|
||||
SetTextColor(dc, RGB(0, 0, 0));
|
||||
SetBkMode(dc, TRANSPARENT);
|
||||
|
@ -685,14 +695,14 @@ void Win32Frame::DrawTrackSector(HDC dc, UINT slot, int drive1Track, int drive1S
|
|||
|
||||
std::string text;
|
||||
text = "T" + strTrackDrive1;
|
||||
TextOut(dc, x + 6, y + 35 + diskIIInfoSize, text.c_str(), text.length());
|
||||
TextOut(dc, x + 6, y + 35 + diskIIInfoHeight, text.c_str(), text.length());
|
||||
text = "S" + strSectorDrive1;
|
||||
TextOut(dc, x + 6, y + 35 + smallfontHeight + diskIIInfoSize, text.c_str(), text.length());
|
||||
TextOut(dc, x + 6, y + 35 + smallfontHeight + diskIIInfoHeight, text.c_str(), text.length());
|
||||
|
||||
text = "T" + strTrackDrive2;
|
||||
TextOut(dc, x + 26, y + 35 + diskIIInfoSize, text.c_str(), text.length());
|
||||
TextOut(dc, x + 26, y + 35 + diskIIInfoHeight, text.c_str(), text.length());
|
||||
text = "S" + strSectorDrive2;
|
||||
TextOut(dc, x + 26, y + 35 + smallfontHeight + diskIIInfoSize, text.c_str(), text.length());
|
||||
TextOut(dc, x + 26, y + 35 + smallfontHeight + diskIIInfoHeight, text.c_str(), text.length());
|
||||
}
|
||||
|
||||
// Feature Request #201 Show track status
|
||||
|
@ -756,7 +766,7 @@ void Win32Frame::FrameDrawDiskStatus( HDC passdc )
|
|||
DrawTrackSector(dc, SLOT6, nDrive1Track, g_nSector[SLOT6][0], nDrive2Track, g_nSector[SLOT6][1]);
|
||||
|
||||
// Slot 5's Disk II
|
||||
if (GetCardMgr().QuerySlot(SLOT5) == CT_Disk2)
|
||||
if (GetCardMgr().QuerySlot(SLOT5) == CT_Disk2 && GetWindowedModeShowDiskiiSlot5Status())
|
||||
{
|
||||
GetTrackSector(SLOT5, nDrive1Track, nDrive2Track, nActiveFloppy);
|
||||
DrawTrackSector(dc, SLOT5, nDrive1Track, g_nSector[SLOT5][0], nDrive2Track, g_nSector[SLOT5][1]);
|
||||
|
@ -864,11 +874,24 @@ void Win32Frame::DrawStatusArea (HDC passdc, int drawflags)
|
|||
|
||||
if (g_nViewportScale > 1 && GetCardMgr().QuerySlot(SLOT5) == CT_Disk2)
|
||||
{
|
||||
std::string slot5 = "Slot 5:";
|
||||
TextOut(dc, x + 14, y + 59, slot5.c_str(), slot5.length());
|
||||
const int yOffsetDiskIISlot5 = 59;
|
||||
|
||||
TextOut(dc, x + 7, y + 70, TEXT("1"), 1);
|
||||
TextOut(dc, x + 27, y + 70, TEXT("2"), 1);
|
||||
if (!GetWindowedModeShowDiskiiSlot5Status())
|
||||
{
|
||||
// Erase background
|
||||
SelectObject(dc, GetStockObject(NULL_PEN));
|
||||
SelectObject(dc, btnfacebrush);
|
||||
const int diskIIInfoHeight = 48;
|
||||
Rectangle(dc, x + 1, y + yOffsetDiskIISlot5, x + BUTTONCX + 1, y + yOffsetDiskIISlot5 + diskIIInfoHeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string slot5 = "Slot 5:";
|
||||
TextOut(dc, x + 14, y + yOffsetDiskIISlot5, slot5.c_str(), slot5.length());
|
||||
|
||||
TextOut(dc, x + 7, y + yOffsetDiskIISlot5 + smallfontHeight, "1", 1);
|
||||
TextOut(dc, x + 27, y + yOffsetDiskIISlot5 + smallfontHeight, "2", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user