From 30324bb859a60e76fec7cebfcb7af302674391bd Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 28 May 2025 15:13:52 -0300 Subject: [PATCH 1/5] Add internal PCI flag to STPC SBCs without PCI slots --- src/machine/machine_table.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 780f8d474..52c483ff5 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -9422,7 +9422,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, /* Machine has internal video: ST STPC Atlas */ + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_PCI_INTERNAL, /* Machine has internal video: ST STPC Atlas */ .ram = { .min = 32768, .max = 163840, @@ -9463,7 +9463,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_USB, /* Machine has internal video: ST STPC Atlas */ + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_PCI_INTERNAL | MACHINE_USB, /* Machine has internal video: ST STPC Atlas */ .ram = { .min = 32768, .max = 163840, @@ -9504,7 +9504,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2, - .flags = MACHINE_IDE | MACHINE_APM, /* Machine has internal video: ST STPC Atlas and NIC: Realtek RTL8139C+ */ + .flags = MACHINE_IDE | MACHINE_APM | MACHINE_PCI_INTERNAL, /* Machine has internal video: ST STPC Atlas and NIC: Realtek RTL8139C+ */ .ram = { .min = 32768, .max = 131072, @@ -9545,7 +9545,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_PCI_INTERNAL, .ram = { .min = 32768, .max = 98304, @@ -9586,7 +9586,7 @@ const machine_t machines[] = { .max_multi = 2.0 }, .bus_flags = MACHINE_PS2_PCI, - .flags = MACHINE_IDE_DUAL | MACHINE_APM, + .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_PCI_INTERNAL, .ram = { .min = 32768, .max = 131072, From 81af1f8195361cf8b7bcc5a8813076dda9f9d7f0 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 28 May 2025 15:35:43 -0300 Subject: [PATCH 2/5] De-underscore the ASUS 386/33-64K --- src/include/86box/machine.h | 2 +- src/machine/m_at_386dx_486.c | 4 ++-- src/machine/machine_table.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 98667f244..53b47c4c1 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -512,7 +512,7 @@ extern int machine_at_ga486l_init(const machine_t *); extern int machine_at_cougar_init(const machine_t *); extern int machine_at_acc386_init(const machine_t *); -extern int machine_at_asus386_3364k_init(const machine_t *); +extern int machine_at_asus3863364k_init(const machine_t *); extern int machine_at_asus386_init(const machine_t *); extern int machine_at_ecs386_init(const machine_t *); extern int machine_at_spc6000a_init(const machine_t *); diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index 9f7534244..b81a6bda7 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -73,11 +73,11 @@ machine_at_acc386_init(const machine_t *model) } int -machine_at_asus386_3364k_init(const machine_t *model) +machine_at_asus3863364k_init(const machine_t *model) { int ret; - ret = bios_load_linear("roms/machines/asus386_3364k/am27c512dip28-64b53c26be3d8160533563.bin", + ret = bios_load_linear("roms/machines/asus3863364k/am27c512dip28-64b53c26be3d8160533563.bin", 0x000f0000, 65536, 0); if (bios_only || !ret) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 52c483ff5..63d19c8c6 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -5671,10 +5671,10 @@ const machine_t machines[] = { /* Has Award KBC firmware. */ { .name = "[SiS 310] ASUS 386/33-64K", - .internal_name = "asus386_3364k", + .internal_name = "asus3863364k", .type = MACHINE_TYPE_386DX, .chipset = MACHINE_CHIPSET_SIS_310, - .init = machine_at_asus386_3364k_init, + .init = machine_at_asus3863364k_init, .p1_handler = NULL, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, From 4a3eb800828e2ce176cc446be97563f84ea4556c Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 28 May 2025 15:36:53 -0300 Subject: [PATCH 3/5] De-underscore the Dell OptiPlex machines --- src/include/86box/machine.h | 6 +++--- src/machine/m_at_slot1.c | 4 ++-- src/machine/m_at_socket5.c | 4 ++-- src/machine/m_at_socket7.c | 4 ++-- src/machine/machine_table.c | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 53b47c4c1..155e6aecc 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -670,7 +670,7 @@ extern int machine_at_tek932_init(const machine_t *); extern int machine_at_acerv30_init(const machine_t *); extern int machine_at_apollo_init(const machine_t *); -extern int machine_at_optiplex_gxl_init(const machine_t *); +extern int machine_at_optiplexgxl_init(const machine_t *); extern int machine_at_zappa_init(const machine_t *); extern int machine_at_powermatev_init(const machine_t *); extern int machine_at_hawk_init(const machine_t *); @@ -750,7 +750,7 @@ extern int machine_at_gw2kte_init(const machine_t *); extern int machine_at_ma23c_init(const machine_t *); extern int machine_at_nupro592_init(const machine_t *); extern int machine_at_tx97_init(const machine_t *); -extern int machine_at_optiplex_gn_init(const machine_t *); +extern int machine_at_optiplexgn_init(const machine_t *); extern int machine_at_ym430tx_init(const machine_t *); extern int machine_at_thunderbolt_init(const machine_t *); extern int machine_at_an430tx_init(const machine_t *); @@ -819,7 +819,7 @@ extern int machine_at_p65up5_cpknd_init(const machine_t *); extern int machine_at_kn97_init(const machine_t *); extern int machine_at_lx6_init(const machine_t *); -extern int machine_at_optiplex_gxa_init(const machine_t *); +extern int machine_at_optiplexgxa_init(const machine_t *); extern int machine_at_spitfire_init(const machine_t *); extern int machine_at_ma30d_init(const machine_t *); diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index a147d0e13..280462858 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -151,11 +151,11 @@ machine_at_lx6_init(const machine_t *model) } int -machine_at_optiplex_gxa_init(const machine_t *model) +machine_at_optiplexgxa_init(const machine_t *model) { int ret; - ret = bios_load_linear("roms/machines/optiplex_gxa/DELL.ROM", + ret = bios_load_linear("roms/machines/optiplexgxa/DELL.ROM", 0x000c0000, 262144, 0); if (bios_only || !ret) diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 442281811..0d50fead8 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -238,11 +238,11 @@ machine_at_apollo_init(const machine_t *model) } int -machine_at_optiplex_gxl_init(const machine_t *model) +machine_at_optiplexgxl_init(const machine_t *model) { int ret; - ret = bios_load_linear("roms/machines/optiplex_gxl/DELL.ROM", + ret = bios_load_linear("roms/machines/optiplexgxl/DELL.ROM", 0x000e0000, 131072, 0); if (bios_only || !ret) diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index d4b71f92f..dbc59ef17 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -970,11 +970,11 @@ machine_at_tx97_init(const machine_t *model) } int -machine_at_optiplex_gn_init(const machine_t *model) +machine_at_optiplexgn_init(const machine_t *model) { int ret; - ret = bios_load_linear("roms/machines/optiplex_gn/DELL.ROM", + ret = bios_load_linear("roms/machines/optiplexgn/DELL.ROM", 0x000c0000, 262144, 0); if (bios_only || !ret) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 63d19c8c6..4c6d90cea 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -10549,10 +10549,10 @@ const machine_t machines[] = { /* Has a National Semiconductor PC87332VLJ Super I/O with AMIKey 'F' KBC firmware. */ { .name = "[i430FX] Dell OptiPlex GXL/GXM", - .internal_name = "optiplex_gxl", + .internal_name = "optiplexgxl", .type = MACHINE_TYPE_SOCKET5, .chipset = MACHINE_CHIPSET_INTEL_430FX, - .init = machine_at_optiplex_gxl_init, + .init = machine_at_optiplexgxl_init, .p1_handler = NULL, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, @@ -13147,10 +13147,10 @@ const machine_t machines[] = { */ { .name = "[i430TX] Dell OptiPlex GN+", - .internal_name = "optiplex_gn", + .internal_name = "optiplexgn", .type = MACHINE_TYPE_SOCKET7, .chipset = MACHINE_CHIPSET_INTEL_430TX, - .init = machine_at_optiplex_gn_init, + .init = machine_at_optiplexgn_init, .p1_handler = NULL, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, @@ -15210,10 +15210,10 @@ const machine_t machines[] = { firmwares: AMI '5' MegaKey, Phoenix MultiKey/42 1.37, or Phoenix MultiKey/42i 4.16. */ { .name = "[i440LX] Dell OptiPlex GXa", - .internal_name = "optiplex_gxa", + .internal_name = "optiplexgxa", .type = MACHINE_TYPE_SLOT1, .chipset = MACHINE_CHIPSET_INTEL_440LX, - .init = machine_at_optiplex_gxa_init, + .init = machine_at_optiplexgxa_init, .p1_handler = NULL, .gpio_handler = NULL, .available_flag = MACHINE_AVAILABLE, From 72a52318f56e274d6f66553d1a872604d07bed20 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 28 May 2025 16:08:44 -0300 Subject: [PATCH 4/5] POST card: Streamline printing of the Dell ASCII mode --- src/device/postcard.c | 41 +++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/src/device/postcard.c b/src/device/postcard.c index 27f5a5aa3..ec031c2b8 100644 --- a/src/device/postcard.c +++ b/src/device/postcard.c @@ -36,6 +36,7 @@ static uint16_t postcard_port; static uint8_t postcard_written[POSTCARDS_NUM]; static uint8_t postcard_ports_num = 1; static uint8_t postcard_prev_codes[POSTCARDS_NUM]; +static uint8_t postcard_dell_mode = 0; static char postcard_prev_diags[5] = { 0 }; #define UISTR_LEN 32 static char postcard_str[UISTR_LEN]; /* UI output string */ @@ -99,31 +100,23 @@ postcard_setui(void) ps[1][0], ps[1][1], ps[1][2], ps[1][3]); break; } - } else if (strstr(machines[machine].name, " Dell ") && - ((machine_get_chipset(machine) >= MACHINE_CHIPSET_INTEL_430FX) || - (machine_get_chipset(machine) >= MACHINE_CHIPSET_VLSI_SCAMP))) { - char dell_diags[10] = { 0 }; - - if (!postcard_written[1]) - snprintf(dell_diags, sizeof(dell_diags), "---- ----"); - else if (postcard_written[1] == 1) - snprintf(dell_diags, sizeof(dell_diags), "%s ----", postcard_diags); - else - snprintf(dell_diags, sizeof(dell_diags), "%s %s", postcard_diags, postcard_prev_diags); - - if (!postcard_written[0]) - snprintf(postcard_str, sizeof(postcard_str), "POST: -- -- %s", dell_diags); - else if (postcard_written[0] == 1) - snprintf(postcard_str, sizeof(postcard_str), "POST: %02X -- %s", postcard_codes[0], dell_diags); - else - snprintf(postcard_str, sizeof(postcard_str), "POST: %02X %02X %s", postcard_codes[0], postcard_prev_codes[0], dell_diags); } else { + char dell_diags[11] = { 0 }; + if (postcard_dell_mode) { + if (!postcard_written[1]) + snprintf(dell_diags, sizeof(dell_diags), " ---- ----"); + else if (postcard_written[1] == 1) + snprintf(dell_diags, sizeof(dell_diags), " %s ----", postcard_diags); + else + snprintf(dell_diags, sizeof(dell_diags), " %s %s", postcard_diags, postcard_prev_diags); + } + if (!postcard_written[0]) - snprintf(postcard_str, sizeof(postcard_str), "POST: -- --"); + snprintf(postcard_str, sizeof(postcard_str), "POST: -- --%s", dell_diags); else if (postcard_written[0] == 1) - snprintf(postcard_str, sizeof(postcard_str), "POST: %02X --", postcard_codes[0]); + snprintf(postcard_str, sizeof(postcard_str), "POST: %02X --%s", postcard_codes[0], dell_diags); else - snprintf(postcard_str, sizeof(postcard_str), "POST: %02X %02X", postcard_codes[0], postcard_prev_codes[0]); + snprintf(postcard_str, sizeof(postcard_str), "POST: %02X %02X%s", postcard_codes[0], postcard_prev_codes[0], dell_diags); } ui_sb_bugui(postcard_str); @@ -225,9 +218,9 @@ postcard_init(UNUSED(const device_t *info)) io_sethandler(postcard_port, postcard_ports_num, NULL, NULL, NULL, postcard_write, NULL, NULL, NULL); - if (strstr(machines[machine].name, " Dell ") && - ((machine_get_chipset(machine) >= MACHINE_CHIPSET_INTEL_430FX) || - (machine_get_chipset(machine) >= MACHINE_CHIPSET_VLSI_SCAMP))) + postcard_dell_mode = strstr(machines[machine].name, " Dell ") && + (machine_get_chipset(machine) >= MACHINE_CHIPSET_INTEL_430FX); + if (postcard_dell_mode) io_sethandler(is486 ? 0x00e0 : 0x00e4, 0x0001, NULL, NULL, NULL, NULL, NULL, postcard_writel, NULL); From 2b71002daba7a02480507f480815d01cb8c05aba Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 28 May 2025 16:35:38 -0300 Subject: [PATCH 5/5] PCI: Fix and delegate bridge initialization on Dell riser machines --- src/device/pci_bridge.c | 45 +++++++++++++++++++------------------ src/include/86box/machine.h | 2 ++ src/include/86box/pci.h | 1 + src/machine/m_at_slot1.c | 4 ++-- src/machine/m_at_socket7.c | 13 +++++++++-- src/pci.c | 4 ++-- 6 files changed, 41 insertions(+), 28 deletions(-) diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index 8893acf69..bf49baf14 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -87,6 +87,14 @@ pci_bridge_set_ctl(void *priv, uint8_t ctl) dev->ctl = ctl; } +uint8_t +pci_bridge_get_bus_index(void *priv) +{ + pci_bridge_t *dev = (pci_bridge_t *) priv; + + return dev->bus_index; +} + static void pci_bridge_write(int func, int addr, uint8_t val, void *priv) { @@ -513,11 +521,9 @@ static void * pci_bridge_init(const device_t *info) { uint8_t interrupts[4]; - uint8_t interrupt_count; uint8_t interrupt_mask; + uint8_t add_type; uint8_t slot_count; - uint8_t dell_slots[3] = { 0x09, 0x0a, 0x0b }; - uint8_t dell_interrupts[3][4] = { { 1, 2, 3, 4 }, { 4, 2, 1, 3 }, { 1, 3, 4, 2 } }; pci_bridge_t *dev = (pci_bridge_t *) calloc(1, sizeof(pci_bridge_t)); @@ -527,40 +533,35 @@ pci_bridge_init(const device_t *info) pci_bridge_reset(dev); - if (info->local == PCI_BRIDGE_DEC_21152) - pci_add_card(PCI_ADD_BRIDGE, pci_bridge_read, pci_bridge_write, dev, &dev->slot); - else - pci_add_bridge(AGP_BRIDGE(dev->local), pci_bridge_read, pci_bridge_write, dev, &dev->slot); - - interrupt_count = sizeof(interrupts); - interrupt_mask = interrupt_count - 1; + interrupt_mask = sizeof(interrupts) - 1; if (dev->slot < 32) { - for (uint8_t i = 0; i < interrupt_count; i++) + for (uint8_t i = 0; i <= interrupt_mask; i++) interrupts[i] = pci_get_int(dev->slot, PCI_INTA + i); } pci_bridge_log("PCI Bridge %d: upstream bus %02X slot %02X interrupts %02X %02X %02X %02X\n", dev->bus_index, (dev->slot >> 5) & 0xff, dev->slot & 31, interrupts[0], interrupts[1], interrupts[2], interrupts[3]); - if (info->local == PCI_BRIDGE_DEC_21150) + if (info->local == PCI_BRIDGE_DEC_21150) { slot_count = 9; /* 9 bus masters */ - else if (info->local == PCI_BRIDGE_DEC_21152) - slot_count = 3; /* 3 bus masters */ - else + add_type = PCI_ADD_NORMAL; + } else if (info->local == PCI_BRIDGE_DEC_21152) { + slot_count = 0; /* 4 bus masters, but slots are added by the Dell machines */ + add_type = PCI_ADD_BRIDGE; + } else { slot_count = 1; /* AGP bridges always have 1 slot */ + add_type = PCI_ADD_AGPBRIDGE; + } + + pci_add_bridge(add_type, pci_bridge_read, pci_bridge_write, dev, &dev->slot); for (uint8_t i = 0; i < slot_count; i++) { - uint8_t slot = i; - if (info->local == PCI_BRIDGE_DEC_21152) { - slot = dell_slots[i]; - memcpy(interrupts, dell_interrupts[i], 4); - } /* Interrupts for bridge slots are assigned in round-robin: ABCD, BCDA, CDAB and so on. */ pci_bridge_log("PCI Bridge %d: downstream slot %02X interrupts %02X %02X %02X %02X\n", - dev->bus_index, slot, interrupts[i & interrupt_mask], + dev->bus_index, i, interrupts[i & interrupt_mask], interrupts[(i + 1) & interrupt_mask], interrupts[(i + 2) & interrupt_mask], interrupts[(i + 3) & interrupt_mask]); - pci_register_bus_slot(dev->bus_index, slot, AGP_BRIDGE(dev->local) ? PCI_CARD_AGP : PCI_CARD_NORMAL, + pci_register_bus_slot(dev->bus_index, i, AGP_BRIDGE(dev->local) ? PCI_CARD_AGP : PCI_CARD_NORMAL, interrupts[i & interrupt_mask], interrupts[(i + 1) & interrupt_mask], interrupts[(i + 2) & interrupt_mask], diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index 4129cead7..3231acd80 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -722,6 +722,8 @@ extern int machine_at_vectra54_init(const machine_t *); extern int machine_at_5sbm2_init(const machine_t *); /* m_at_socket7.c */ +extern void machine_at_optiplex_21152_init(void); + extern int machine_at_acerv35n_init(const machine_t *); extern int machine_at_p55t2p4_init(const machine_t *); extern int machine_at_m7shi_init(const machine_t *); diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 462b4f821..8887f89f4 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -283,6 +283,7 @@ extern void pci_init(int flags); /* PCI bridge stuff. */ extern void pci_bridge_set_ctl(void *priv, uint8_t ctl); +extern uint8_t pci_bridge_get_bus_index(void *priv); #ifdef EMU_DEVICE_H extern const device_t dec21150_device; diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 280462858..2ac805bee 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -170,14 +170,14 @@ machine_at_optiplexgxa_init(const machine_t *model) pci_register_slot(0x11, PCI_CARD_NETWORK, 4, 0, 0, 0); pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 2, 1); pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0F, PCI_CARD_BRIDGE, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_BRIDGE, 0, 0, 0, 0); if (sound_card_current[0] == SOUND_INTERNAL) device_add(machine_get_snd_device(machine)); device_add(&i440lx_device); device_add(&piix4_device); - device_add(&dec21152_device); + machine_at_optiplex_21152_init(); device_add_params(&pc87307_device, (void *) (PCX730X_PHOENIX_42 | PCX7307_PC87307)); device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x7, 256); diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index dbc59ef17..46c7b7623 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -46,6 +46,15 @@ #include <86box/network.h> #include <86box/pci.h> +void +machine_at_optiplex_21152_init(void) +{ + uint8_t bus_index = pci_bridge_get_bus_index(device_add(&dec21152_device)); + pci_register_bus_slot(bus_index, 0x09, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_bus_slot(bus_index, 0x0a, PCI_CARD_NORMAL, 4, 2, 1, 3); + pci_register_bus_slot(bus_index, 0x0b, PCI_CARD_NORMAL, 1, 3, 4, 2); +} + int machine_at_acerv35n_init(const machine_t *model) { @@ -989,7 +998,7 @@ machine_at_optiplexgn_init(const machine_t *model) pci_register_slot(0x10, PCI_CARD_VIDEO, 4, 0, 0, 0); /* Trio64V2/GX, temporarily Trio64V2/DX is given */ pci_register_slot(0x11, PCI_CARD_NETWORK, 4, 0, 0, 0); /* 3C905, not yet emulated */ pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); - pci_register_slot(0x0F, PCI_CARD_BRIDGE, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_BRIDGE, 0, 0, 0, 0); if (gfxcard[0] == VID_INTERNAL) device_add(machine_get_vid_device(machine)); @@ -999,7 +1008,7 @@ machine_at_optiplexgn_init(const machine_t *model) device_add(&i430tx_device); device_add(&piix4_device); - device_add(&dec21152_device); + machine_at_optiplex_21152_init(); device_add_params(&pc87307_device, (void *) (PCX730X_PHOENIX_42 | PCX7307_PC87307)); device_add(&intel_flash_bxt_device); spd_register(SPD_TYPE_SDRAM, 0x3, 128); diff --git a/src/pci.c b/src/pci.c index c3020ca73..94ab9d5f2 100644 --- a/src/pci.c +++ b/src/pci.c @@ -855,10 +855,10 @@ pci_register_card(int pci_card) /* Add an instance of the PCI bridge. */ void -pci_add_bridge(uint8_t agp, uint8_t (*read)(int func, int addr, void *priv), void (*write)(int func, int addr, uint8_t val, void *priv), void *priv, uint8_t *slot) +pci_add_bridge(uint8_t add_type, uint8_t (*read)(int func, int addr, void *priv), void (*write)(int func, int addr, uint8_t val, void *priv), void *priv, uint8_t *slot) { pci_card_t *card; - uint8_t bridge_slot = agp ? pci_find_slot(PCI_ADD_AGPBRIDGE, 0xff) : last_normal_pci_card_id; + uint8_t bridge_slot = (add_type == PCI_ADD_NORMAL) ? last_normal_pci_card_id : pci_find_slot(add_type, 0xff); if (bridge_slot != PCI_CARD_INVALID) { card = &pci_cards[bridge_slot];