From 0931e82bd195fd4b8fe0bc774f7ba27ad043e7e1 Mon Sep 17 00:00:00 2001 From: GetDizzy Date: Sat, 11 Jan 2025 00:10:38 -0500 Subject: [PATCH 1/3] Add BIOS selection to Packard Bell PB450. --- src/machine/m_at_386dx_486.c | 51 +++++++++++++++++++++++++++++++++--- src/machine/machine_table.c | 3 ++- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 1c35d7290..2a4b6f3c6 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -684,20 +684,64 @@ machine_at_403tg_d_mr_init(const machine_t *model) return ret; } +static const device_config_t pb450_config[] = { + // clang-format off + { + .name = "bios", + .description = "BIOS Version", + .type = CONFIG_BIOS, + .default_string = "pci10a", + .default_int = 0, + .file_filter = "", + .spinner = { 0 }, + .bios = { + { .name = "PCI 1.0A", .internal_name = "pci10a", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/OPTI802.bin", "" } }, + { .name = "PNP 1.1A", .internal_name = "pnp11a", .bios_type = BIOS_NORMAL, + .files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/PNP11A.bin", "" } }, + { .files_no = 0 } + }, + }, + { .name = "", .description = "", .type = CONFIG_END } + // clang-format on +}; + +const device_t pb450_device = { + .name = "Packard Bell PB450 Devices", + .internal_name = "pb450_device", + .flags = 0, + .local = 0, + .init = NULL, + .close = NULL, + .reset = NULL, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = pb450_config +}; + int machine_at_pb450_init(const machine_t *model) { - int ret; + int ret = 0; + const char* fn; - ret = bios_load_linear("roms/machines/pb450/OPTI802.bin", - 0x000e0000, 131072, 0); + /* No ROMs available */ + if (!device_available(model->device)) + return ret; + device_context(model->device); + fn = device_get_bios_file(model->device, device_get_config_bios("bios"), 0); + ret = bios_load_linear(fn, 0x000e0000, 131072, 0); + device_context_restore(); + if (bios_only || !ret) return ret; machine_at_common_init_ex(model, 2); device_add(&ide_vlb_2ch_device); + /* TODO: Detect if we're using the PNP and not the PCI ROM and don't add these? */ pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); @@ -713,6 +757,7 @@ machine_at_pb450_init(const machine_t *model) device_add(&fdc37c665_ide_device); device_add(&ide_opti611_vlb_sec_device); device_add(&intel_flash_bxt_device); + /* TODO: Detect if we're using the PNP and not the PCI ROM and don't add this? */ device_add(&phoenix_486_jumper_pci_device); return ret; diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 3fc3bcc8a..06aea8597 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -63,6 +63,7 @@ extern const device_t ibmxt_device; extern const device_t ibmxt86_device; extern const device_t ibmat_device; extern const device_t ibmxt286_device; +extern const device_t pb450_device; const machine_filter_t machine_types[] = { { "None", MACHINE_TYPE_NONE }, @@ -6888,7 +6889,7 @@ const machine_t machines[] = { .kbc_p1 = 0xff, .gpio = 0xffffffff, .gpio_acpi = 0xffffffff, - .device = NULL, + .device = &pb450_device, .fdc_device = NULL, .sio_device = NULL, .vid_device = &gd5428_vlb_onboard_device, From 6ec9c33940bbe864fb58f670fb1925d28cc32241 Mon Sep 17 00:00:00 2001 From: GetDizzy Date: Sat, 11 Jan 2025 02:19:32 -0500 Subject: [PATCH 2/3] Formatting fixes. --- src/machine/m_at_386dx_486.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 2a4b6f3c6..43ba9a6d9 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -707,10 +707,10 @@ static const device_config_t pb450_config[] = { }; const device_t pb450_device = { - .name = "Packard Bell PB450 Devices", + .name = "Packard Bell PB450 Devices", .internal_name = "pb450_device", - .flags = 0, - .local = 0, + .flags = 0, + .local = 0, .init = NULL, .close = NULL, .reset = NULL, From 7d3d15853de68f8fbcb37844498cae3839b608c4 Mon Sep 17 00:00:00 2001 From: GetDizzy Date: Sat, 11 Jan 2025 04:11:54 -0500 Subject: [PATCH 3/3] Remove outdated TODOs. --- src/machine/m_at_386dx_486.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 43ba9a6d9..d3c7a21d2 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -741,7 +741,6 @@ machine_at_pb450_init(const machine_t *model) machine_at_common_init_ex(model, 2); device_add(&ide_vlb_2ch_device); - /* TODO: Detect if we're using the PNP and not the PCI ROM and don't add these? */ pci_init(PCI_CONFIG_TYPE_1); pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4); @@ -757,7 +756,6 @@ machine_at_pb450_init(const machine_t *model) device_add(&fdc37c665_ide_device); device_add(&ide_opti611_vlb_sec_device); device_add(&intel_flash_bxt_device); - /* TODO: Detect if we're using the PNP and not the PCI ROM and don't add this? */ device_add(&phoenix_486_jumper_pci_device); return ret;