There goes the legacy host_drive.

This commit is contained in:
OBattler
2024-05-20 02:15:17 +02:00
parent 9dc92bc1d4
commit 7c74a977fa
11 changed files with 38 additions and 75 deletions

View File

@@ -1175,8 +1175,7 @@ load_floppy_and_cdrom_drives(void)
memset(temp, 0x00, sizeof(temp));
for (c = 0; c < CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c + 1);
cdrom[c].host_drive = ini_section_get_int(cat, temp, 0);
cdrom[c].prev_host_drive = cdrom[c].host_drive;
ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_parameters", c + 1);
p = ini_section_get_string(cat, temp, NULL);
@@ -1263,12 +1262,6 @@ load_floppy_and_cdrom_drives(void)
path_normalize(cdrom[c].image_path);
}
if (cdrom[c].host_drive && (cdrom[c].host_drive != 200) && (cdrom[c].host_drive != 201))
cdrom[c].host_drive = 0;
if ((cdrom[c].host_drive == 0x200) && (strlen(cdrom[c].image_path) == 0))
cdrom[c].host_drive = 0;
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
cdrom[c].image_history[i] = (char *) calloc((MAX_IMAGE_PATH_LEN + 1) << 1, sizeof(char));
sprintf(temp, "cdrom_%02i_image_history_%02i", c + 1, i + 1);
@@ -1289,9 +1282,6 @@ load_floppy_and_cdrom_drives(void)
/* If the CD-ROM is disabled, delete all its variables. */
if (cdrom[c].bus_type == CDROM_BUS_DISABLED) {
sprintf(temp, "cdrom_%02i_host_drive", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_parameters", c + 1);
ini_section_delete_var(cat, temp);
@@ -1422,9 +1412,6 @@ load_other_removable_devices(void)
/* If the ZIP drive is disabled, delete all its variables. */
if (zip_drives[c].bus_type == ZIP_BUS_DISABLED) {
sprintf(temp, "zip_%02i_host_drive", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "zip_%02i_parameters", c + 1);
ini_section_delete_var(cat, temp);
@@ -1538,9 +1525,6 @@ load_other_removable_devices(void)
/* If the MO drive is disabled, delete all its variables. */
if (mo_drives[c].bus_type == MO_BUS_DISABLED) {
sprintf(temp, "mo_%02i_host_drive", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "mo_%02i_parameters", c + 1);
ini_section_delete_var(cat, temp);
@@ -2575,10 +2559,7 @@ save_floppy_and_cdrom_drives(void)
for (c = 0; c < CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c + 1);
if ((cdrom[c].bus_type == 0) || ((cdrom[c].host_drive != 200) && (cdrom[c].host_drive != 201)))
ini_section_delete_var(cat, temp);
else
ini_section_set_int(cat, temp, cdrom[c].host_drive);
ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_speed", c + 1);
if ((cdrom[c].bus_type == 0) || (cdrom[c].speed == 8))