Config: Fix HDC migration to avoid "internal" devices on hard disk controllers above the first and also remove them from the config on save.

This commit is contained in:
OBattler
2025-09-16 22:14:52 +02:00
parent ce5e8a28e2
commit 81e4d95fc7

View File

@@ -1034,7 +1034,7 @@ load_storage_controllers(void)
if (!hdc_current[j]) { if (!hdc_current[j]) {
if (!legacy_cards[i]) { if (!legacy_cards[i]) {
if (!p) { if (!p) {
hdc_current[j] = hdc_get_from_internal_name("internal"); hdc_current[j] = hdc_get_from_internal_name((j == 0) ? "internal" : "none");
} else if (!strcmp(p, "xtide_plus")) { } else if (!strcmp(p, "xtide_plus")) {
hdc_current[j] = hdc_get_from_internal_name("xtide"); hdc_current[j] = hdc_get_from_internal_name("xtide");
sprintf(temp, "PC/XT XTIDE #%i", j + 1); sprintf(temp, "PC/XT XTIDE #%i", j + 1);
@@ -3063,7 +3063,7 @@ save_storage_controllers(void)
else else
def_hdc = "none"; def_hdc = "none";
if (!strcmp(hdc_get_internal_name(hdc_current[c]), def_hdc)) if (!strcmp(hdc_get_internal_name(hdc_current[c]), def_hdc) || ((c > 0) && (hdc_current[c] == 1)))
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
else else
ini_section_set_string(cat, temp, ini_section_set_string(cat, temp,