From c35bb9749fac28a0652c5b9e324f1c475a92b1d5 Mon Sep 17 00:00:00 2001 From: Maxwell Scott Date: Tue, 30 Sep 2025 10:59:11 +0700 Subject: [PATCH] Added more BIOSes for GA-5AX and GA-686BX (#6256) --- src/include/86box/machine.h | 10 ++++-- src/machine/m_at_slot1.c | 67 +++++++++++++++++++++++++++++++++---- src/machine/m_at_sockets7.c | 67 +++++++++++++++++++++++++++++++++---- src/machine/machine_table.c | 8 ++--- 4 files changed, 134 insertions(+), 18 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 00562d455..3daba325f 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -1089,7 +1089,10 @@ extern int machine_at_p5a_init(const machine_t *); extern int machine_at_m579_init(const machine_t *); extern int machine_at_gwlucas_init(const machine_t *); extern int machine_at_5aa_init(const machine_t *); -extern int machine_at_5ax_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t g5x_device; +#endif +extern int machine_at_g5x_init(const machine_t *); /* VIA MVP3 */ extern int machine_at_ax59pro_init(const machine_t *); @@ -1154,7 +1157,10 @@ extern int machine_at_bx6_init(const machine_t *); extern int machine_at_ax6bc_init(const machine_t *); extern int machine_at_p2bls_init(const machine_t *); extern int machine_at_p3bf_init(const machine_t *); -extern int machine_at_686bx_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t ga686_device; +#endif +extern int machine_at_ga686_init(const machine_t *); #ifdef EMU_DEVICE_H extern const device_t ms6119_device; #endif diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 6a34b564a..c9fd9b6fb 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -604,17 +604,72 @@ machine_at_ax6bc_init(const machine_t *model) return ret; } +static const device_config_t ga686_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "686bx", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Award Modular BIOS v4.51PG - Revision 5/11/1998 (Amptron PII-3100)", + .internal_name = "pii3100", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 262144, + .files = { "roms/machines/686bx/31nologo.bin", "" } + }, + { + .name = "Award Modular BIOS v4.51PG - Revision F2a", + .internal_name = "686bx", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 262144, + .files = { "roms/machines/686bx/6BX.F2a", "" } + }, + { .files_no = 0 } + } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t ga686_device = { + .name = "Gigabyte GA-686BX", + .internal_name = "ga686_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = ga686_config +}; + int -machine_at_686bx_init(const machine_t *model) +machine_at_ga686_init(const machine_t *model) { - int ret; + int ret = 0; + const char *fn; - ret = bios_load_linear("roms/machines/686bx/6BX.F2a", - 0x000c0000, 262144, 0); - - if (bios_only || !ret) + /* No ROMs available */ + if (!device_available(model->device)) return ret; + device_context(model->device); + fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000c0000, 262144, 0); + device_context_restore(); + machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); diff --git a/src/machine/m_at_sockets7.c b/src/machine/m_at_sockets7.c index 0c2e81e1f..7aaffb6ba 100644 --- a/src/machine/m_at_sockets7.c +++ b/src/machine/m_at_sockets7.c @@ -177,17 +177,72 @@ machine_at_5aa_init(const machine_t *model) return ret; } +static const device_config_t g5x_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "5ax", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Award Modular BIOS v4.51PG - Revision F4", + .internal_name = "5ax", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 131072, + .files = { "roms/machines/5ax/5AX.F4", "" } + }, + { + .name = "Phoenix - AwardBIOS v6.00PG - Release 4.1 (by eSupport)", + .internal_name = "5ax_esupport", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 131072, + .files = { "roms/machines/5ax/6Z5KKG09.bin", "" } + }, + { .files_no = 0 } + } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t g5x_device = { + .name = "Gigabyte GA-5AX", + .internal_name = "g5x_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = g5x_config +}; + int -machine_at_5ax_init(const machine_t *model) +machine_at_g5x_init(const machine_t *model) { - int ret; + int ret = 0; + const char *fn; - ret = bios_load_linear("roms/machines/5ax/5AX.F4", - 0x000e0000, 131072, 0); - - if (bios_only || !ret) + /* No ROMs available */ + if (!device_available(model->device)) return ret; + device_context(model->device); + fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000e0000, 131072, 0); + device_context_restore(); + machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 72f742600..be70b897a 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -16421,7 +16421,7 @@ const machine_t machines[] = { .internal_name = "5ax", .type = MACHINE_TYPE_SOCKETS7, .chipset = MACHINE_CHIPSET_ALI_ALADDIN_V, - .init = machine_at_5ax_init, + .init = machine_at_g5x_init, .p1_handler = machine_generic_p1_handler, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, @@ -16451,7 +16451,7 @@ const machine_t machines[] = { .kbc_p1 = 0x00000cf0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &g5x_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL, @@ -17961,7 +17961,7 @@ const machine_t machines[] = { .internal_name = "686bx", .type = MACHINE_TYPE_SLOT1, .chipset = MACHINE_CHIPSET_INTEL_440BX, - .init = machine_at_686bx_init, + .init = machine_at_ga686_init, .p1_handler = machine_generic_p1_handler, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, @@ -17991,7 +17991,7 @@ const machine_t machines[] = { .kbc_p1 = 0x00000cf0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &ga686_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL,