diff --git a/help/cfg-disk.html b/help/cfg-disk.html
index 96dc370c..67df107c 100644
--- a/help/cfg-disk.html
+++ b/help/cfg-disk.html
@@ -1,23 +1,13 @@
-
-
-
-
-
Disk Settings
-
-
-
-
Disk Settings
-
-
+
Floppy Controller Settings:
Disk Access Speed:
Here you can choose the speed at which the system can access
@@ -26,14 +16,14 @@ By default, you would want "Enhanced Speed" so that data can
be accessed as fast as possible. However, it is also possible that
certain programs might depend on the "Authentic Speed" to function
properly. This is the speed at which the real hardware
-would access data from your drives.
-
+would access data from your drives.
+
Disk 1/2 drop-down menus:
-
These menus allow you to select floppy disk images (.dsk files) to
'insert' into the
-emulated floppy drives 1 and 2. This can also be done during emulation by using the toolbar or using the F3/F4 keys. Diskettes can be swapped by pressing F5 during emulation. You can also eject images from this menu.
+emulated floppy drives 1 and 2. This can also be done during emulation by using the toolbar or using the F3/F4 keys. Diskettes can be swapped by pressing F5 during emulation. You can also eject images from this menu.
+
Hard disk Controller Settings:
@@ -42,16 +32,20 @@ A hard disk controller (or interface) card can be plugged in to slot 7 by checki
See Hard disk Images for more details.
+Swap:
+Swap the hard disk images.
+WARNING! If done during image access this could result in undefined behavior (eg. Apple II program crash) or data corruption on the image.
+
+
HDD 1/2 drop-down menus:
-
These menus allow you to select hard disk images (eg. .hdv files) to
-connect to the emulated hard disk controller card. You can also unplug images from this menu.
-
-
-Path to CiderPress:
+connect to the emulated hard disk controller card. You can also unplug images from this menu.
+
+Path to CiderPress:
Use this to specify where CiderPress is installed.
The right mouse button context menu on either of the drive icons allows you to open CiderPress with the image in the drive.
+
diff --git a/help/ddi-harddisk.html b/help/ddi-harddisk.html
index a1d579ed..046583de 100644
--- a/help/ddi-harddisk.html
+++ b/help/ddi-harddisk.html
@@ -3,7 +3,7 @@
- Transferring Disk Images
+ Hard Disk Images
@@ -20,8 +20,9 @@
Just check Enable hard disk controller in slot 7.
There is provision to connect two hard disks to this card.
-This is done by using .hdv files on your PC.
+This is done by using .hdv or 800KB .2mg files on your PC.
Each hard disk can have a maximum capacity of 32MB.
+NB. The hard disk controller supports both fixed-disk types (up to 32MB) and 3.5" floppy types (800KB).
On booting, the Apple will always
attempt to
@@ -33,9 +34,6 @@ interface card in it).
To boot a floppy disk with the hard disk card enabled, either hold down the Open-Apple key during an Apple II restart or
issue PR#6 from an AppleSoft prompt.
-You can download sample .hdv
-images from Asimov (eg. ftp://public.asimov.net/pub/apple_II/images/utility/misc/hardpc.zip).
-
Warnings:
diff --git a/help/img/disk.png b/help/img/disk.png
index 787252d5..b720b226 100644
Binary files a/help/img/disk.png and b/help/img/disk.png differ
diff --git a/resource/Applewin.rc b/resource/Applewin.rc
index ffcc230e..532067b2 100644
--- a/resource/Applewin.rc
+++ b/resource/Applewin.rc
@@ -175,6 +175,7 @@ BEGIN
GROUPBOX "Hard Disk Drives",IDC_STATIC,5,83,200,64
CONTROL "&Enable hard disk controller in slot 7",IDC_HDD_ENABLE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,96,122,10
+ PUSHBUTTON "Swap",IDC_HDD_SWAP,156,92,40,14
LTEXT "&Path to CiderPress:",IDC_STATIC,7,155,74,8
EDITTEXT IDC_CIDERPRESS_FILENAME,7,165,143,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&Browse...",IDC_CIDERPRESS_BROWSE,156,164,50,14
diff --git a/resource/resource.h b/resource/resource.h
index 27f64ebd..a367d19a 100644
--- a/resource/resource.h
+++ b/resource/resource.h
@@ -66,6 +66,7 @@
#define IDC_EDIT_HDD1 1019
#define IDC_EDIT_HDD2 1020
#define IDC_HDD_ENABLE 1021
+#define IDC_HDD_SWAP 1022
#define IDC_SPIN_XTRIM 1026
#define IDC_SPIN_YTRIM 1027
#define IDC_PHASOR_ENABLE 1029
diff --git a/source/Configuration/PageDisk.cpp b/source/Configuration/PageDisk.cpp
index 2e0d97ed..68b6cd8f 100644
--- a/source/Configuration/PageDisk.cpp
+++ b/source/Configuration/PageDisk.cpp
@@ -115,7 +115,9 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l
case IDC_HDD_ENABLE:
EnableHDD(hWnd, IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE));
break;
-
+ case IDC_HDD_SWAP:
+ HandleHDDSwap(hWnd);
+ break;
case IDC_CIDERPRESS_BROWSE:
{
std::string CiderPressLoc = m_PropertySheetHelper.BrowseToFile(hWnd, TEXT("Select path to CiderPress"), REGVALUE_CIDERPRESSLOC, TEXT("Applications (*.exe)\0*.exe\0") TEXT("All Files\0*.*\0") );
@@ -131,8 +133,6 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l
m_PropertySheetHelper.FillComboBox(hWnd, IDC_DISKTYPE, m_discchoices, Disk_GetEnhanceDisk() ? 1 : 0);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK1, m_defaultDiskOptions, -1);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK2, m_defaultDiskOptions, -1);
- m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD1, m_defaultHDDOptions, -1);
- m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD2, m_defaultHDDOptions, -1);
if (strlen(DiskGetFullName(DRIVE_1)) > 0)
{
@@ -146,17 +146,7 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_SETCURSEL, 0, 0);
}
- if (strlen(HD_GetFullName(HARDDISK_1)) > 0)
- {
- SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_1));
- SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_SETCURSEL, 0, 0);
- }
-
- if (strlen(HD_GetFullName(HARDDISK_2)) > 0)
- {
- SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_2));
- SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_SETCURSEL, 0, 0);
- }
+ InitComboHDD(hWnd);
TCHAR PathToCiderPress[MAX_PATH] = "";
RegLoadString(TEXT(REG_CONFIG), REGVALUE_CIDERPRESSLOC, 1, PathToCiderPress,MAX_PATH);
@@ -176,6 +166,24 @@ BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM l
return FALSE;
}
+void CPageDisk::InitComboHDD(HWND hWnd)
+{
+ m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD1, m_defaultHDDOptions, -1);
+ m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD2, m_defaultHDDOptions, -1);
+
+ if (strlen(HD_GetFullName(HARDDISK_1)) > 0)
+ {
+ SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_1));
+ SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_SETCURSEL, 0, 0);
+ }
+
+ if (strlen(HD_GetFullName(HARDDISK_2)) > 0)
+ {
+ SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_2));
+ SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_SETCURSEL, 0, 0);
+ }
+}
+
void CPageDisk::DlgOK(HWND hWnd)
{
const bool bNewEnhanceDisk = SendDlgItemMessage(hWnd, IDC_DISKTYPE,CB_GETCURSEL, 0, 0) ? true : false;
@@ -207,6 +215,7 @@ void CPageDisk::EnableHDD(HWND hWnd, BOOL bEnable)
{
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_HDD1), bEnable);
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_HDD2), bEnable);
+ EnableWindow(GetDlgItem(hWnd, IDC_HDD_SWAP), bEnable);
}
void CPageDisk::EnableDisk(HWND hWnd, BOOL bEnable)
@@ -340,19 +349,34 @@ void CPageDisk::HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelecte
}
}
+void CPageDisk::HandleHDDSwap(HWND hWnd)
+{
+ if (!RemovalConfirmation(IDC_HDD_SWAP))
+ return;
+
+ if (!HD_ImageSwap())
+ return;
+
+ InitComboHDD(hWnd);
+}
UINT CPageDisk::RemovalConfirmation(UINT uCommand)
{
TCHAR szText[100];
+ const size_t strLen = sizeof(szText)-1;
bool bMsgBox = true;
if (uCommand == IDC_COMBO_DISK1 || uCommand == IDC_COMBO_DISK2)
- wsprintf(szText, "Do you really want to eject the disk in drive-%c ?", '1' + uCommand - IDC_COMBO_DISK1);
+ _snprintf(szText, strLen, "Do you really want to eject the disk in drive-%c ?", '1' + uCommand - IDC_COMBO_DISK1);
else if (uCommand == IDC_COMBO_HDD1 || uCommand == IDC_COMBO_HDD2)
- wsprintf(szText, "Do you really want to unplug harddisk-%c ?", '1' + uCommand - IDC_COMBO_HDD1);
+ _snprintf(szText, strLen, "Do you really want to unplug harddisk-%c ?", '1' + uCommand - IDC_COMBO_HDD1);
+ else if (uCommand == IDC_HDD_SWAP)
+ _snprintf(szText, strLen, "Do you really want to swap the harddisk images?");
else
bMsgBox = false;
+ szText[strLen] = 0;
+
if (bMsgBox)
{
int nRes = MessageBox(g_hFrameWindow, szText, TEXT("Eject/Unplug Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
diff --git a/source/Configuration/PageDisk.h b/source/Configuration/PageDisk.h
index 0764c434..89c2e7d1 100644
--- a/source/Configuration/PageDisk.h
+++ b/source/Configuration/PageDisk.h
@@ -25,10 +25,12 @@ protected:
private:
void InitOptions(HWND hWnd);
+ void InitComboHDD(HWND hWnd);
void EnableHDD(HWND hWnd, BOOL bEnable);
void EnableDisk(HWND hWnd, BOOL bEnable);
void HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected);
void HandleDiskCombo(HWND hWnd, UINT driveSelected, UINT comboSelected);
+ void HandleHDDSwap(HWND hWnd);
UINT RemovalConfirmation(UINT uCommand);
static CPageDisk* ms_this;
diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp
index 5755b655..a98f4bab 100644
--- a/source/Harddisk.cpp
+++ b/source/Harddisk.cpp
@@ -695,6 +695,18 @@ void HD_GetLightStatus (Disk_Status_e *pDisk1Status_)
}
}
+bool HD_ImageSwap(void)
+{
+ std::swap(g_HardDisk[HARDDISK_1], g_HardDisk[HARDDISK_2]);
+
+ HD_SaveLastDiskImage(HARDDISK_1);
+ HD_SaveLastDiskImage(HARDDISK_2);
+
+ FrameRefreshStatus(DRAW_LEDS, false);
+
+ return true;
+}
+
//===========================================================================
#define SS_YAML_VALUE_CARD_HDD "Generic HDD"
diff --git a/source/Harddisk.h b/source/Harddisk.h
index e6f36518..25d4f3c1 100644
--- a/source/Harddisk.h
+++ b/source/Harddisk.h
@@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// 1.19.0.0 Hard Disk Status/Indicator Light
void HD_GetLightStatus (Disk_Status_e *pDisk1Status_);
+ bool HD_ImageSwap(void);
std::string HD_GetSnapshotCardName(void);
void HD_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper);