Move PS/2 floppy drive type migration to config

This commit is contained in:
RichardG867
2025-07-10 10:42:08 -03:00
parent 7073a184fe
commit e7d0f153ae
2 changed files with 10 additions and 12 deletions

View File

@@ -1215,14 +1215,20 @@ load_floppy_and_cdrom_drives(void)
unsigned int board = 0;
unsigned int dev = 0;
int c;
int d = 0;
int d;
int count = cdrom_get_type_count();
memset(temp, 0x00, sizeof(temp));
for (c = 0; c < FDD_NUM; c++) {
sprintf(temp, "fdd_%02i_type", c + 1);
p = ini_section_get_string(cat, temp, (c < 2) ? "525_2dd" : "none");
fdd_set_type(c, fdd_get_from_internal_name(p));
if (!strcmp(p, "525_2hd_ps2"))
d = fdd_get_from_internal_name("525_2hd");
else if (!strcmp(p, "35_2hd_ps2"))
d = fdd_get_from_internal_name("35_2hd");
else
d = fdd_get_from_internal_name(p);
fdd_set_type(c, d);
if (fdd_get_type(c) > 13)
fdd_set_type(c, 13);
@@ -1301,6 +1307,7 @@ load_floppy_and_cdrom_drives(void)
ini_section_delete_var(cat, temp);
sprintf(temp, "cdrom_%02i_parameters", c + 1);
d = 0;
p = ini_section_get_string(cat, temp, NULL);
if (p != NULL)
sscanf(p, "%01u, %s", &d, s);

View File

@@ -212,18 +212,9 @@ int
fdd_get_from_internal_name(char *s)
{
int c = 0;
char *n;
/* TODO: Remove this once the migration period is over. */
if (!strcmp(s, "525_2hd_ps2"))
n = "525_2hd";
else if (!strcmp(s, "35_2hd_ps2"))
n = "35_2hd";
else
n = s;
while (strlen(drive_types[c].internal_name)) {
if (!strcmp((char *) drive_types[c].internal_name, n))
if (!strcmp((char *) drive_types[c].internal_name, s))
return c;
c++;
}