summaryrefslogtreecommitdiff
path: root/src/hdc.c
diff options
context:
space:
mode:
authorEero Tamminen <oak@helsinkinet.fi>2020-08-30 21:17:01 (GMT)
committerEero Tamminen <oak@helsinkinet.fi>2020-10-04 22:35:28 (GMT)
commit2d8ada4bcfc5ec9fa7f9b419e235697ce90aa5ad (patch)
treecd3fee6802ea1df29172c035c0e0ec8962dcbab3 /src/hdc.c
parent70ac40855db016de5d5ea41af064f915e0840486 (diff)
downloadhatari-2d8ada4bc.zip
hatari-2d8ada4bc.tar.gz
Split SCSI init/uninit handling from ACSI init/uninit
This fixes internal partition count being wrong after either ACSI or SCSI HD settings have been changed, due to SCSI drives not being deducted on SCSI UnInit() (drive count would be corrected on next emulation reset though, as that resets also drive count). ACSI/SCSI/IDE comments are also fixed to use plural form as nowadays all of them can have multiple drives/images.
Diffstat (limited to 'src/hdc.c')
-rw-r--r--src/hdc.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/hdc.c b/src/hdc.c
index ccdf667..5e823c1 100644
--- a/src/hdc.c
+++ b/src/hdc.c
@@ -853,7 +853,7 @@ int HDC_InitDevice(SCSI_DEV *dev, char *filename, unsigned long blockSize)
}
/**
- * Open the disk image file, set partitions.
+ * Open the disk image files, set partitions.
*/
bool HDC_Init(void)
{
@@ -876,20 +876,12 @@ bool HDC_Init(void)
if (!ConfigureParams.Acsi[i].bUseDevice)
continue;
if (HDC_InitDevice(&AcsiBus.devs[i], ConfigureParams.Acsi[i].sDeviceFile, ConfigureParams.Acsi[i].nBlockSize) == 0)
- {
- bAcsiEmuOn = true;
nAcsiPartitions += HDC_PartitionCount(AcsiBus.devs[i].image_file, TRACE_SCSI_CMD, NULL);
- }
}
-
- /* add SCSI partition count to ACSI ones
- * to support GEMDOS HD emu partition skipping
- */
- nAcsiPartitions += Ncr5380_Init();
-
/* set total number of partitions */
nNumDrives += nAcsiPartitions;
-
+ if (nAcsiPartitions)
+ bAcsiEmuOn = true;
return bAcsiEmuOn;
}
@@ -915,10 +907,7 @@ void HDC_UnInit(void)
free(AcsiBus.buffer);
AcsiBus.buffer = NULL;
- Ncr5380_UnInit();
-
- if (bAcsiEmuOn)
- nNumDrives -= nAcsiPartitions;
+ nNumDrives -= nAcsiPartitions;
nAcsiPartitions = 0;
bAcsiEmuOn = false;
}