The configuration loading code now initializes the default IDE channel and SCSI ID for every CD-ROM drive to sane values before attempting to read them from the configuration file, fixes the default values the devices get in the Settings dialog.

This commit is contained in:
OBattler
2017-12-15 06:39:13 +01:00
parent cf67c2a1a9
commit db8fe73917

View File

@@ -8,7 +8,7 @@
*
* Configuration file handler.
*
* Version: @(#)config.c 1.0.34 2017/12/09
* Version: @(#)config.c 1.0.35 2017/12/15
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
@@ -1025,6 +1025,9 @@ load_removable_devices(void)
sscanf("0, none", "%u, %s", &cdrom_drives[c].sound_on, s);
cdrom_drives[c].bus_type = hdd_string_to_bus(s, 1);
/* Default values, needed for proper operation of the Settings dialog. */
cdrom_drives[c].ide_channel = cdrom_drives[c].scsi_device_id = c + 2;
sprintf(temp, "cdrom_%02i_ide_channel", c+1);
if ((cdrom_drives[c].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) ||
(cdrom_drives[c].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA)) {