diff --git a/src/86box.c b/src/86box.c index b2311f0e2..615d904bf 100644 --- a/src/86box.c +++ b/src/86box.c @@ -1353,7 +1353,7 @@ pc_init_roms(void) while (machine_get_internal_name_ex(c) != NULL) { m = machine_available(c); if (!m) - pclog("Missing machine: %s\n", machine_getname_ex(c)); + pclog("Missing machine: %s\n", machine_getname(c)); c++; } @@ -1394,7 +1394,7 @@ pc_init_modules(void) /* Load the ROMs for the selected machine. */ if (!machine_available(machine)) { - swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname()); + swprintf(temp, sizeof_w(temp), plat_get_string(STRING_HW_NOT_AVAILABLE_MACHINE), machine_getname(machine)); c = 0; machine = -1; while (machine_get_internal_name_ex(c) != NULL) { @@ -1816,7 +1816,7 @@ update_mouse_msg(void) wchar_t wmachine[2048]; wchar_t *wcp; - mbstowcs(wmachine, machine_getname(), strlen(machine_getname()) + 1); + mbstowcs(wmachine, machine_getname(machine), strlen(machine_getname(machine)) + 1); if (!cpu_override) mbstowcs(wcpufamily, cpu_f->name, strlen(cpu_f->name) + 1); diff --git a/src/device/postcard.c b/src/device/postcard.c index d94bc8ddf..f33574452 100644 --- a/src/device/postcard.c +++ b/src/device/postcard.c @@ -191,7 +191,7 @@ postcard_init(UNUSED(const device_t *info)) if (machine_has_bus(machine, MACHINE_BUS_MCA)) postcard_port = 0x680; /* MCA machines */ else if (strstr(machines[machine].name, " PS/2 ") || - strstr(machine_getname_ex(machine), " PS/1 ")) + strstr(machine_getname(machine), " PS/1 ")) postcard_port = 0x190; /* ISA PS/2 machines */ else if (strstr(machines[machine].name, " IBM XT ")) postcard_port = 0x60; /* IBM XT */ diff --git a/src/discord.c b/src/discord.c index 091d4c95f..3eb5424e9 100644 --- a/src/discord.c +++ b/src/discord.c @@ -91,9 +91,9 @@ discord_update_activity(int paused) #endif if (strlen(vm_name) < 100) { snprintf(activity.details, sizeof(activity.details), "Running \"%s\"", vm_name); - snprintf(activity.state, sizeof(activity.state), "%s (%s/%s)", strchr(machine_getname(), ']') + 2, cpufamily, cpu_s->name); + snprintf(activity.state, sizeof(activity.state), "%s (%s/%s)", strchr(machine_getname(machine), ']') + 2, cpufamily, cpu_s->name); } else { - strncpy(activity.details, strchr(machine_getname(), ']') + 2, sizeof(activity.details) - 1); + strncpy(activity.details, strchr(machine_getname(machine), ']') + 2, sizeof(activity.details) - 1); snprintf(activity.state, sizeof(activity.state), "%s/%s", cpufamily, cpu_s->name); } #pragma GCC diagnostic pop diff --git a/src/floppy/fdd.c b/src/floppy/fdd.c index 5cf21c77c..89ec2e9f6 100644 --- a/src/floppy/fdd.c +++ b/src/floppy/fdd.c @@ -484,7 +484,7 @@ fdd_type_invert_densel(int type) int ret; if (drive_types[type].flags & FLAG_PS2) - ret = (!!strstr(machine_getname(), "PS/1")) || (!!strstr(machine_getname(), "PS/2")) || (!!strstr(machine_getname(), "PS/55")); + ret = (!!strstr(machine_getname(machine), "PS/1")) || (!!strstr(machine_getname(machine), "PS/2")) || (!!strstr(machine_getname(machine), "PS/55")); else ret = drive_types[type].flags & FLAG_INVERT_DENSEL; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index de4e75ff8..67a120523 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -387,8 +387,7 @@ extern void * machine_snd; /* Core functions. */ extern int machine_count(void); extern int machine_available(int m); -extern const char * machine_getname(void); -extern const char * machine_getname_ex(int m); +extern const char * machine_getname(int m); extern const char * machine_get_internal_name(void); extern const char * machine_get_nvr_name(void); extern int machine_get_machine_from_internal_name(const char *s); diff --git a/src/machine/machine.c b/src/machine/machine.c index 30f979fd4..2db543cf2 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -69,7 +69,7 @@ machine_init_ex(int m) int ret = 0; if (!bios_only) { - machine_log("Initializing as \"%s\"\n", machine_getname()); + machine_log("Initializing as \"%s\"\n", machine_getname(machine)); machine_init_p1(); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 12ed4a874..75ecabe2c 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -20472,13 +20472,7 @@ machine_count(void) } const char * -machine_getname(void) -{ - return (machines[machine].name); -} - -const char * -machine_getname_ex(int m) +machine_getname(int m) { return (machines[m].name); }