Config: More fixes and removed excess logging from ini.c.
This commit is contained in:
17
src/config.c
17
src/config.c
@@ -879,7 +879,7 @@ load_storage_controllers(void)
|
|||||||
path_normalize(cassette_fname);
|
path_normalize(cassette_fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
p = ini_section_get_string(cat, "cassette_mode", "");
|
p = ini_section_get_string(cat, "cassette_mode", "load");
|
||||||
if (strlen(p) > 511)
|
if (strlen(p) > 511)
|
||||||
fatal("load_storage_controllers(): strlen(p) > 511\n");
|
fatal("load_storage_controllers(): strlen(p) > 511\n");
|
||||||
else
|
else
|
||||||
@@ -2384,6 +2384,7 @@ save_storage_controllers(void)
|
|||||||
ini_section_t cat = ini_find_or_create_section(config, "Storage controllers");
|
ini_section_t cat = ini_find_or_create_section(config, "Storage controllers");
|
||||||
char temp[512];
|
char temp[512];
|
||||||
int c;
|
int c;
|
||||||
|
char *def_hdc;
|
||||||
|
|
||||||
ini_section_delete_var(cat, "scsicard");
|
ini_section_delete_var(cat, "scsicard");
|
||||||
|
|
||||||
@@ -2403,8 +2404,16 @@ save_storage_controllers(void)
|
|||||||
ini_section_set_string(cat, "fdc",
|
ini_section_set_string(cat, "fdc",
|
||||||
fdc_card_get_internal_name(fdc_current[0]));
|
fdc_card_get_internal_name(fdc_current[0]));
|
||||||
|
|
||||||
ini_section_set_string(cat, "hdc",
|
if (machine_has_flags(machine, MACHINE_HDC))
|
||||||
hdc_get_internal_name(hdc_current[0]));
|
def_hdc = "internal";
|
||||||
|
else
|
||||||
|
def_hdc = "none";
|
||||||
|
|
||||||
|
if (!strcmp(hdc_get_internal_name(hdc_current[0]), def_hdc))
|
||||||
|
ini_section_delete_var(cat, "hdc");
|
||||||
|
else
|
||||||
|
ini_section_set_string(cat, "hdc",
|
||||||
|
hdc_get_internal_name(hdc_current[0]));
|
||||||
|
|
||||||
if (cdrom_interface_current == 0)
|
if (cdrom_interface_current == 0)
|
||||||
ini_section_delete_var(cat, "cdrom_interface");
|
ini_section_delete_var(cat, "cdrom_interface");
|
||||||
@@ -2439,7 +2448,7 @@ save_storage_controllers(void)
|
|||||||
ini_section_set_string(cat, "cassette_file", cassette_fname);
|
ini_section_set_string(cat, "cassette_file", cassette_fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(cassette_mode) == 0)
|
if (!strcmp(cassette_mode, "load"))
|
||||||
ini_section_delete_var(cat, "cassette_mode");
|
ini_section_delete_var(cat, "cassette_mode");
|
||||||
else
|
else
|
||||||
ini_section_set_string(cat, "cassette_mode", cassette_mode);
|
ini_section_set_string(cat, "cassette_mode", cassette_mode);
|
||||||
|
|||||||
@@ -199,10 +199,7 @@ delete_section_if_empty(list_t *head, section_t *section)
|
|||||||
int j_nlen = strlen(j_ent->name);
|
int j_nlen = strlen(j_ent->name);
|
||||||
entry_t* j_next = (entry_t *) j_ent->list.next;
|
entry_t* j_next = (entry_t *) j_ent->list.next;
|
||||||
if (j_nlen > 0) {
|
if (j_nlen > 0) {
|
||||||
pclog("Comparing \"%s\" with \"%s\"...\n", j_ent->name, i_ent->name);
|
|
||||||
if ((j != i) && (strcmp(j_ent->name, i_ent->name) > 0)) {
|
if ((j != i) && (strcmp(j_ent->name, i_ent->name) > 0)) {
|
||||||
pclog("Swapping \"%s\" with \"%s\"...\n", j_ent->name, i_ent->name);
|
|
||||||
|
|
||||||
entry_t t_ent = { 0 };
|
entry_t t_ent = { 0 };
|
||||||
memcpy(&t_ent, j_ent, sizeof(entry_t));
|
memcpy(&t_ent, j_ent, sizeof(entry_t));
|
||||||
/* J: Contents of I, list of J */
|
/* J: Contents of I, list of J */
|
||||||
|
|||||||
Reference in New Issue
Block a user