[hatari-devel] Support for a second ACSI drive

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi all,

I'd appreciate if support for a second ACSI drive could be added. As far
as I can tell the attached diff provides this support without losing
backwards compatibility as far as configuration files are concerned.
Any chance to get this added to the development tree?

Best regards

Uwe
diff -r 230cc43f07e2 src/configuration.c
--- a/src/configuration.c	Sun Jan 15 07:13:08 2017 +0100
+++ b/src/configuration.c	Sun Jan 15 15:16:13 2017 +0100
@@ -432,7 +432,9 @@
 	{ "nWriteProtection", Int_Tag, &ConfigureParams.HardDisk.nWriteProtection },
 	{ "bFilenameConversion", Bool_Tag, &ConfigureParams.HardDisk.bFilenameConversion },
 	{ "bUseHardDiskImage", Bool_Tag, &ConfigureParams.Acsi[0].bUseDevice },
+	{ "bUseHardDiskImage1", Bool_Tag, &ConfigureParams.Acsi[1].bUseDevice },
 	{ "szHardDiskImage", String_Tag, ConfigureParams.Acsi[0].sDeviceFile },
+	{ "szHardDiskImage1", String_Tag, ConfigureParams.Acsi[1].sDeviceFile },
 	{ "bUseIdeMasterHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage },
 	{ "bUseIdeSlaveHardDiskImage", Bool_Tag, &ConfigureParams.HardDisk.bUseIdeSlaveHardDiskImage },
 	{ "szIdeMasterHardDiskImage", String_Tag, ConfigureParams.HardDisk.szIdeMasterHardDiskImage },
diff -r 230cc43f07e2 src/gui-sdl/dlgHardDisk.c
--- a/src/gui-sdl/dlgHardDisk.c	Sun Jan 15 07:13:08 2017 +0100
+++ b/src/gui-sdl/dlgHardDisk.c	Sun Jan 15 15:16:13 2017 +0100
@@ -14,64 +14,72 @@
 #include "file.h"
 
 
-#define DISKDLG_ACSIEJECT          3
-#define DISKDLG_ACSIBROWSE         4
-#define DISKDLG_ACSINAME           5
-#define DISKDLG_IDEMASTEREJECT     7
-#define DISKDLG_IDEMASTERBROWSE    8
-#define DISKDLG_IDEMASTERNAME      9
-#define DISKDLG_IDESLAVEEJECT     11
-#define DISKDLG_IDESLAVEBROWSE    12
-#define DISKDLG_IDESLAVENAME      13
-#define DISKDLG_GEMDOSEJECT       15
-#define DISKDLG_GEMDOSBROWSE      16
-#define DISKDLG_GEMDOSNAME        17
-#define DISKDLG_GEMDOSCONV        18
-#define DISKDLG_DRIVESKIP         19
-#define DISKDLG_PROTOFF           21
-#define DISKDLG_PROTON            22
-#define DISKDLG_PROTAUTO          23
-#define DISKDLG_BOOTHD            24
-#define DISKDLG_EXIT              25
+#define DISKDLG_ACSI0EJECT         3
+#define DISKDLG_ACSI0BROWSE        4
+#define DISKDLG_ACSI0NAME          5
+#define DISKDLG_ACSI1EJECT         7
+#define DISKDLG_ACSI1BROWSE        8
+#define DISKDLG_ACSI1NAME          9
+#define DISKDLG_IDEMASTEREJECT    11
+#define DISKDLG_IDEMASTERBROWSE   12
+#define DISKDLG_IDEMASTERNAME     13
+#define DISKDLG_IDESLAVEEJECT     15
+#define DISKDLG_IDESLAVEBROWSE    16
+#define DISKDLG_IDESLAVENAME      17
+#define DISKDLG_GEMDOSEJECT       19
+#define DISKDLG_GEMDOSBROWSE      20
+#define DISKDLG_GEMDOSNAME        21
+#define DISKDLG_GEMDOSCONV        22
+#define DISKDLG_DRIVESKIP         23
+#define DISKDLG_PROTOFF           25
+#define DISKDLG_PROTON            26
+#define DISKDLG_PROTAUTO          27
+#define DISKDLG_BOOTHD            28
+#define DISKDLG_EXIT              29
 
 
 /* The disks dialog: */
 static SGOBJ diskdlg[] =
 {
-	{ SGBOX, 0, 0, 0,0, 64,22, NULL },
+	{ SGBOX, 0, 0, 0,0, 64,24, NULL },
 	{ SGTEXT, 0, 0, 27,1, 10,1, "Hard disks" },
 
-	{ SGTEXT, 0, 0, 2,3, 14,1, "ACSI HD image:" },
+	{ SGTEXT, 0, 0, 2,3, 14,1, "ACSI HD drive 0 image:" },
 	{ SGBUTTON, 0, 0, 46,3, 7,1, "Ejec_t" },
 	{ SGBUTTON, 0, 0, 54,3, 8,1, "Brow_se" },
 	{ SGTEXT, 0, 0, 3,4, 58,1, NULL },
 
-	{ SGTEXT, 0, 0, 2,5, 20,1, "IDE HD master image:" },
-	{ SGBUTTON, 0, 0, 46,5, 7,1, "Eje_ct" },
-	{ SGBUTTON, 0, 0, 54,5, 8,1, "Bro_wse" },
+	{ SGTEXT, 0, 0, 2,5, 14,1, "ACSI HD drive 1 image:" },
+	{ SGBUTTON, 0, 0, 46,5, 7,1, "Eject" },
+	{ SGBUTTON, 0, 0, 54,5, 8,1, "Browse" },
 	{ SGTEXT, 0, 0, 3,6, 58,1, NULL },
 
-	{ SGTEXT, 0, 0, 2,7, 19,1, "IDE HD slave image:" },
-	{ SGBUTTON, 0, 0, 46,7, 7,1, "E_ject" },
-	{ SGBUTTON, 0, 0, 54,7, 8,1, "Br_owse" },
+	{ SGTEXT, 0, 0, 2,7, 20,1, "IDE HD master image:" },
+	{ SGBUTTON, 0, 0, 46,7, 7,1, "Eje_ct" },
+	{ SGBUTTON, 0, 0, 54,7, 8,1, "Bro_wse" },
 	{ SGTEXT, 0, 0, 3,8, 58,1, NULL },
 
-	{ SGTEXT, 0, 0, 2,9, 13,1, "GEMDOS drive:" },
-	{ SGBUTTON, 0, 0, 46,9, 7,1, "_Eject" },
-	{ SGBUTTON, 0, 0, 54,9, 8,1, "B_rowse" },
+	{ SGTEXT, 0, 0, 2,9, 19,1, "IDE HD slave image:" },
+	{ SGBUTTON, 0, 0, 46,9, 7,1, "E_ject" },
+	{ SGBUTTON, 0, 0, 54,9, 8,1, "Br_owse" },
 	{ SGTEXT, 0, 0, 3,10, 58,1, NULL },
 
-	{ SGCHECKBOX, 0, 0, 8,12, 42,1, "Atari <-> _host 8-bit file name conversion" },
-	{ SGCHECKBOX, 0, 0, 8,13, 42,1, "Add GEMDOS HD after ACSI/IDE _partitions" },
+	{ SGTEXT, 0, 0, 2,11, 13,1, "GEMDOS drive:" },
+	{ SGBUTTON, 0, 0, 46,11, 7,1, "_Eject" },
+	{ SGBUTTON, 0, 0, 54,11, 8,1, "B_rowse" },
+	{ SGTEXT, 0, 0, 3,12, 58,1, NULL },
 
-	{ SGTEXT, 0, 0, 8,15, 31,1, "Write protection:" },
-	{ SGRADIOBUT, 0, 0, 26,15, 5,1, "O_ff" },
-	{ SGRADIOBUT, 0, 0, 32,15, 4,1, "O_n" },
-	{ SGRADIOBUT, 0, 0, 37,15, 6,1, "_Auto" },
+	{ SGCHECKBOX, 0, 0, 8,14, 42,1, "Atari <-> _host 8-bit file name conversion" },
+	{ SGCHECKBOX, 0, 0, 8,15, 42,1, "Add GEMDOS HD after ACSI/IDE _partitions" },
 
-	{ SGCHECKBOX, 0, 0, 2,17, 16,1, "_Boot from HD" },
+	{ SGTEXT, 0, 0, 8,17, 31,1, "Write protection:" },
+	{ SGRADIOBUT, 0, 0, 26,17, 5,1, "O_ff" },
+	{ SGRADIOBUT, 0, 0, 32,17, 4,1, "O_n" },
+	{ SGRADIOBUT, 0, 0, 37,17, 6,1, "_Auto" },
 
-	{ SGBUTTON, SG_DEFAULT, 0, 22,20, 20,1, "Back to main menu" },
+	{ SGCHECKBOX, 0, 0, 2,19, 16,1, "_Boot from HD" },
+
+	{ SGBUTTON, SG_DEFAULT, 0, 22,22, 20,1, "Back to main menu" },
 	{ SGSTOP, 0, 0, 0,0, 0,0, NULL }
 };
 
@@ -107,7 +115,7 @@
 void DlgHardDisk_Main(void)
 {
 	int but, i;
-	char dlgname_gdos[64], dlgname_acsi[64];
+	char dlgname_gdos[64], dlgname_acsi0[64], dlgname_acsi1[64];
 	char dlgname_ide_master[64], dlgname_ide_slave[64];
 
 	SDLGui_CenterDlg(diskdlg);
@@ -132,13 +140,21 @@
 	else
 		diskdlg[DISKDLG_BOOTHD].state &= ~SG_SELECTED;
 
-	/* ACSI hard disk image: */
+	/* ACSI hard disk image 0: */
 	if (ConfigureParams.Acsi[0].bUseDevice)
-		File_ShrinkName(dlgname_acsi, ConfigureParams.Acsi[0].sDeviceFile,
-		                diskdlg[DISKDLG_ACSINAME].w);
+		File_ShrinkName(dlgname_acsi0, ConfigureParams.Acsi[0].sDeviceFile,
+		                diskdlg[DISKDLG_ACSI0NAME].w);
 	else
-		dlgname_acsi[0] = '\0';
-	diskdlg[DISKDLG_ACSINAME].txt = dlgname_acsi;
+		dlgname_acsi0[0] = '\0';
+	diskdlg[DISKDLG_ACSI0NAME].txt = dlgname_acsi0;
+
+	/* ACSI hard disk image 1: */
+	if (ConfigureParams.Acsi[1].bUseDevice)
+		File_ShrinkName(dlgname_acsi1, ConfigureParams.Acsi[1].sDeviceFile,
+		                diskdlg[DISKDLG_ACSI1NAME].w);
+	else
+		dlgname_acsi1[1] = '\0';
+	diskdlg[DISKDLG_ACSI1NAME].txt = dlgname_acsi1;
 
 	/* IDE master hard disk image: */
 	if (ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage)
@@ -177,16 +193,26 @@
 		but = SDLGui_DoDialog(diskdlg, NULL, false);
 		switch (but)
 		{
-		 case DISKDLG_ACSIEJECT:
+		 case DISKDLG_ACSI0EJECT:
 			ConfigureParams.Acsi[0].bUseDevice = false;
-			dlgname_acsi[0] = '\0';
+			dlgname_acsi0[0] = '\0';
 			break;
-		 case DISKDLG_ACSIBROWSE:
-			if (SDLGui_FileConfSelect("ACSI HD image:", dlgname_acsi,
+		 case DISKDLG_ACSI1EJECT:
+			ConfigureParams.Acsi[1].bUseDevice = false;
+			dlgname_acsi1[1] = '\0';
+			break;
+		 case DISKDLG_ACSI0BROWSE:
+			if (SDLGui_FileConfSelect("ACSI HD drive 0 image:", dlgname_acsi0,
 			                          ConfigureParams.Acsi[0].sDeviceFile,
-			                          diskdlg[DISKDLG_ACSINAME].w, false))
+			                          diskdlg[DISKDLG_ACSI0NAME].w, false))
 				ConfigureParams.Acsi[0].bUseDevice = true;
 			break;
+		 case DISKDLG_ACSI1BROWSE:
+			if (SDLGui_FileConfSelect("ACSI HD drive 1 image:", dlgname_acsi1,
+			                          ConfigureParams.Acsi[1].sDeviceFile,
+			                          diskdlg[DISKDLG_ACSI1NAME].w, false))
+				ConfigureParams.Acsi[1].bUseDevice = true;
+			break;
 		 case DISKDLG_IDEMASTEREJECT:
 			ConfigureParams.HardDisk.bUseIdeMasterHardDiskImage = false;
 			dlgname_ide_master[0] = '\0';


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/