From 5b0267e4d3738ece390f664cc0cac9ebe31939fe Mon Sep 17 00:00:00 2001 From: MaxwellS04 Date: Tue, 21 Oct 2025 16:28:37 +0700 Subject: [PATCH] Added the 1999 v4.51PG BIOS to P5VX-B --- src/include/86box/machine.h | 3 ++ src/machine/m_at_socket7.c | 65 ++++++++++++++++++++++++++++++++++--- src/machine/machine_table.c | 2 +- 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 061c6473f..8cc928f91 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -1062,6 +1062,9 @@ extern int machine_at_8500tvxa_init(const machine_t *); extern int machine_at_presario2240_init(const machine_t *); extern int machine_at_presario4500_init(const machine_t *); extern int machine_at_dellhannibalp_init(const machine_t *); +#ifdef EMU_DEVICE_H +extern const device_t p5vxb_device; +#endif extern int machine_at_p5vxb_init(const machine_t *); extern int machine_at_p55va_init(const machine_t *); extern int machine_at_gw2kte_init(const machine_t *); diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 7916db2d4..15e0316f2 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -813,17 +813,72 @@ machine_at_dellhannibalp_init(const machine_t *model) return ret; } +static const device_config_t p5vxb_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "p5vxb", + .default_int = 0, + .file_filter = NULL, + .spinner = { 0 }, + .selection = { { 0 } }, + .bios = { + { + .name = "Award Modular BIOS v4.50PG - Revision 1.0", + .internal_name = "p5vxb", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 131072, + .files = { "roms/machines/p5vxb/P5VXB10.BIN", "" } + }, + { + .name = "Award Modular BIOS v4.51PG - Revision 1.5c", + .internal_name = "p5vxb_451pg", + .bios_type = BIOS_NORMAL, + .files_no = 1, + .local = 0, + .size = 131072, + .files = { "roms/machines/p5vxb/P5VXB15C.BIN", "" } + }, + { .files_no = 0 } + } + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t p5vxb_device = { + .name = "ECS P5VX-B", + .internal_name = "p5vxb_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = p5vxb_config +}; + int machine_at_p5vxb_init(const machine_t *model) { - int ret; + int ret = 0; + const char *fn; - ret = bios_load_linear("roms/machines/p5vxb/P5VXB10.BIN", - 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(model); pci_init(PCI_CONFIG_TYPE_1); diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 47fb21303..244bf83df 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -15218,7 +15218,7 @@ const machine_t machines[] = { .kbc_p1 = 0x00000cf0, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &p5vxb_device, .kbd_device = NULL, .fdc_device = NULL, .sio_device = NULL,