From 41809098406c5900724ffeb1124526862a00dff7 Mon Sep 17 00:00:00 2001 From: Verloren50000 <110334428+Verloren50000@users.noreply.github.com> Date: Fri, 26 Sep 2025 11:21:12 +0800 Subject: [PATCH] Add BIOS selector and the mid-1999 BIOS to the ABit AB-LX6 (#6224) * machine.h: Configuration added for ABit AB-LX6 * m_at_slot1.c: Configuration is almost there for ABit AB-LX6 * Congratulations! BIOS Selector for ABit AB-LX6 is complete. --- src/include/86box/machine.h | 3 +++ src/machine/m_at_slot1.c | 50 +++++++++++++++++++++++++++++++++---- src/machine/machine_table.c | 2 +- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 101ed2934..b88d8f492 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -1117,6 +1117,9 @@ extern int machine_at_p65up5_cpknd_init(const machine_t *); extern int machine_at_kn97_init(const machine_t *); /* i440LX */ +#ifdef EMU_DEVICE_H +extern const device_t lx6_device; +#endif extern int machine_at_lx6_init(const machine_t *); extern int machine_at_optiplexgxa_init(const machine_t *); extern int machine_at_spitfire_init(const machine_t *); diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 4c25799f6..22d6baac8 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -151,17 +151,57 @@ machine_at_kn97_init(const machine_t *model) } /* i440LX */ +static const device_config_t lx6_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "lx6", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .bios = { + { .name = "Award Modular BIOS v4.51PG - Revision LY", .internal_name = "lx6", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/lx6/LX6C_LY.BIN", "" } }, + { .name = "Award Modular BIOS v4.51PG - Revision PZ Beta", .internal_name = "lx6_beta", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/lx6/LX6C_PZ.B00", "" } }, + { .files_no = 0 } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t lx6_device = { + .name = "ABIT AB-LX6", + .internal_name = "lx6_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = lx6_config +}; + int machine_at_lx6_init(const machine_t *model) { - int ret; + int ret = 0; + const char* fn; - ret = bios_load_linear("roms/machines/lx6/LX6C_PZ.B00", - 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 cbc48db1d..8c9055c9b 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -17217,7 +17217,7 @@ const machine_t machines[] = { .kbc_p1 = 0x00000cf0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &lx6_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL,