diff --git a/src/chipset/intel_piix.c b/src/chipset/intel_piix.c index b73285f70..e0d80f348 100644 --- a/src/chipset/intel_piix.c +++ b/src/chipset/intel_piix.c @@ -1621,7 +1621,10 @@ piix_init(const device_t *info) else cpu_set_isa_pci_div(3); - dma_alias_set(); + if (dev->type > 1) + dma_alias_set(); + else + dma_alias_set_piix(); if (dev->type < 4) pci_enable_mirq(0); @@ -1709,7 +1712,7 @@ const device_t piix4_device = { .name = "Intel 82371AB/EB (PIIX4/PIIX4E)", .internal_name = "piix4", .flags = DEVICE_PCI, - .local = 0x71100014, + .local = 0x71100004, .init = piix_init, .close = piix_close, .reset = piix_reset, diff --git a/src/chipset/intel_sio.c b/src/chipset/intel_sio.c index 9b6d28ab1..b11ec0765 100644 --- a/src/chipset/intel_sio.c +++ b/src/chipset/intel_sio.c @@ -355,7 +355,23 @@ sio_config_read(uint16_t port, UNUSED(void *priv)) ret = 0xff; break; case 5: - ret = 0xd3; + /* + Dell Dimension XPS P60 jumpers: + - Bit 5: Disable CMOS Setup (1 = yes, 0 = no). + + Dell OptiPlex 560/L jumpers: + - Bit 1: Password (1 = disable, 0 = enable); + - Bit 5: Clear CMOS (1 = no, 0 = yes). + - Bits 7, 6: Board type: + - 0, 0 = L; + - 0, 1 = MT; + - 1, 0 = M; + - 1, 1 = M. + */ + if (!strcmp(machine_get_internal_name(), "opti560l")) + ret = 0x20; + else + ret = 0xd3; switch (cpu_pci_speed) { case 20000000: diff --git a/src/device/CMakeLists.txt b/src/device/CMakeLists.txt index bbbab22fd..486d40b07 100644 --- a/src/device/CMakeLists.txt +++ b/src/device/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(dev OBJECT cartridge.c cassette.c clock_ics9xxx.c + dell_jumper.c hasp.c hwm.c hwm_gl518sm.c diff --git a/src/device/dell_jumper.c b/src/device/dell_jumper.c new file mode 100644 index 000000000..12fc3d13b --- /dev/null +++ b/src/device/dell_jumper.c @@ -0,0 +1,175 @@ +/* + * 86Box A hypervisor and IBM PC system emulator that specializes in + * running old operating systems and software designed for IBM + * PC systems and compatibles from 1981 through fairly recent + * system designs based on the PCI bus. + * + * This file is part of the 86Box distribution. + * + * Implementation of the Dell 486 and 586 Jumper Readout. + * + * Register 0x02: + * - Bit 0: ATX power: 1 = off, 0 = on. + * + * Register 0x05: + * - Appears to be: 0x02 = On-board audio enabled; + * 0x07 = On-board audio disabled. + * + * Register 0x07: + * - Bit 0: On-board NIC: 1 = present, 0 = absent; + * - Bit 1: On-board audio: 1 = present, 0 = absent; + * - Bits 4-2: + * - 0, 0, 0 = GXL; + * - 0, 0, 1 = GL+; + * - 0, 1, 0 = GXMT; + * - 0, 1, 1 = GMT+; + * - 1, 0, 0 = GXM; + * - 1, 0, 1 = GM+; + * - 1, 1, 0 = WS; + * - 1, 1, 1 = GWS+. + * + * Authors: Miran Grca, + * + * Copyright 2025 Miran Grca. + */ +#include +#include +#include +#include +#include +#include +#define HAVE_STDARG_H +#include <86box/86box.h> +#include "cpu.h" +#include <86box/timer.h> +#include <86box/io.h> +#include <86box/device.h> +#include <86box/machine.h> +#include <86box/sound.h> +#include <86box/chipset.h> +#include <86box/plat.h> +#include <86box/plat_unused.h> + +typedef struct dell_jumper_t { + uint8_t index; + uint8_t regs[256]; +} dell_jumper_t; + +#ifdef ENABLE_DELL_JUMPER_LOG +int dell_jumper_do_log = ENABLE_DELL_JUMPER_LOG; + +static void +dell_jumper_log(const char *fmt, ...) +{ + va_list ap; + + if (dell_jumper_do_log) { + va_start(ap, fmt); + pclog_ex(fmt, ap); + va_end(ap); + } +} +#else +# define dell_jumper_log(fmt, ...) +#endif + +static void +dell_jumper_write(uint16_t addr, uint8_t val, void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + dell_jumper_log("Dell Jumper: Write %02x\n", val); + + if (addr & 1) switch (dev->index) { + default: + dev->regs[dev->index] = val; + break; + case 0x02: + dev->regs[dev->index] = val; + if (val & 0x04) + /* Soft power off. */ + plat_power_off(); + break; + case 0x05: + dev->regs[dev->index] = (dev->regs[dev->index] & 0x02) | (val & 0xfd); + if (machine_snd != NULL) switch (val & 0x05) { + default: + case 0x05: + sb_vibra16s_onboard_relocate_base(0x0000, machine_snd); + break; + case 0x00: + sb_vibra16s_onboard_relocate_base(0x0220, machine_snd); + break; + } + break; + case 0x07: + break; + } else + dev->index = val; +} + +static uint8_t +dell_jumper_read(uint16_t addr, void *priv) +{ + const dell_jumper_t *dev = (dell_jumper_t *) priv; + uint8_t ret = 0xff; + + dell_jumper_log("Dell Jumper: Read %02x\n", dev->jumper); + + if (addr & 1) + ret = dev->regs[dev->index]; + else + ret = dev->index; + + return ret; +} + +static void +dell_jumper_reset(void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + dev->index = 0x00; + memset(dev->regs, 0x00, 256); + + if (sound_card_current[0] == SOUND_INTERNAL) + /* GXL, on-board audio present, on-board NIC absent. */ + dev->regs[0x07] = 0x02; + else + /* GXL, on-board audio absent, on-board NIC absent. */ + dev->regs[0x07] = 0x00; +} + +static void +dell_jumper_close(void *priv) +{ + dell_jumper_t *dev = (dell_jumper_t *) priv; + + free(dev); +} + +static void * +dell_jumper_init(const device_t *info) +{ + dell_jumper_t *dev = (dell_jumper_t *) calloc(1, sizeof(dell_jumper_t)); + + dell_jumper_reset(dev); + + io_sethandler(0x00e8, 0x0002, dell_jumper_read, NULL, NULL, dell_jumper_write, NULL, NULL, dev); + + return dev; +} + +const device_t dell_jumper_device = { + .name = "Dell Jumper Readout", + .internal_name = "dell_jumper", + .flags = 0, + .local = 0, + .init = dell_jumper_init, + .close = dell_jumper_close, + .reset = dell_jumper_reset, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; diff --git a/src/device/kbc_at.c b/src/device/kbc_at.c index 9a1800ed9..dc93a4fba 100644 --- a/src/device/kbc_at.c +++ b/src/device/kbc_at.c @@ -1125,7 +1125,9 @@ write_cmd_generic(void *priv, uint8_t val) */ uint8_t p1 = 0x30; kbc_delay_to_ob(dev, p1, 0, 0x00); - } else if (!strcmp(machine_get_internal_name(), "dellplato") || !strcmp(machine_get_internal_name(), "dellhannibalp")) { + } else if (!strcmp(machine_get_internal_name(), "dellplato") || + !strcmp(machine_get_internal_name(), "dellhannibalp") || + !strcmp(machine_get_internal_name(), "dellxp60")) { /* Dell Dimension XPS Pxxx & Pxxxa/Mxxxa: - Bit 3: Password disable jumper (must be clear); diff --git a/src/device/pci_bridge.c b/src/device/pci_bridge.c index 7dda00aee..8893acf69 100644 --- a/src/device/pci_bridge.c +++ b/src/device/pci_bridge.c @@ -30,8 +30,10 @@ #include <86box/mem.h> #include <86box/device.h> #include <86box/pci.h> +#include <86box/plat_fallthrough.h> #define PCI_BRIDGE_DEC_21150 0x10110022 +#define PCI_BRIDGE_DEC_21152 0x10110024 #define AGP_BRIDGE_ALI_M5243 0x10b95243 #define AGP_BRIDGE_ALI_M5247 0x10b95247 #define AGP_BRIDGE_INTEL_440LX 0x80867181 @@ -242,12 +244,15 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv) case 0x40: if (dev->local == PCI_BRIDGE_DEC_21150) val &= 0x32; + else if (dev->local == PCI_BRIDGE_DEC_21152) + val &= 0x12; break; case 0x41: if (AGP_BRIDGE_VIA(dev->local)) val &= 0x7e; - else if (dev->local == PCI_BRIDGE_DEC_21150) + else if ((dev->local == PCI_BRIDGE_DEC_21150) || + (dev->local == PCI_BRIDGE_DEC_21152)) val &= 0x07; break; @@ -257,18 +262,22 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv) break; case 0x43: - if (dev->local == PCI_BRIDGE_DEC_21150) + if ((dev->local == PCI_BRIDGE_DEC_21150) || + (dev->local == PCI_BRIDGE_DEC_21152)) val &= 0x03; break; case 0x64: - if (dev->local == PCI_BRIDGE_DEC_21150) + if ((dev->local == PCI_BRIDGE_DEC_21150) || + (dev->local == PCI_BRIDGE_DEC_21152)) val &= 0x7e; break; case 0x69: if (dev->local == PCI_BRIDGE_DEC_21150) val &= 0x3f; + else if (dev->local == PCI_BRIDGE_DEC_21152) + val = (val & 0x01) | 0x3e; break; case 0x86: @@ -302,6 +311,15 @@ pci_bridge_write(int func, int addr, uint8_t val, void *priv) break; case 0xe0: + if (AGP_BRIDGE_ALI(dev->local)) { + if (!(dev->ctl & 0x20)) + return; + } else if (dev->local == PCI_BRIDGE_DEC_21152) + val &= 0x03; + else + return; + break; + case 0xe1: if (AGP_BRIDGE_ALI(dev->local)) { if (!(dev->ctl & 0x20)) @@ -399,6 +417,14 @@ pci_bridge_reset(void *priv) /* command and status */ switch (dev->local) { + case PCI_BRIDGE_DEC_21152: + dev->regs[0x08] = 0x03; + dev->regs[0x34] = 0xdc; + dev->regs[0x69] = 0x3e; + dev->regs[0xdc] = 0x01; + dev->regs[0xde] = 0x01; + dev->regs[0xe2] = 0x80; + fallthrough; case PCI_BRIDGE_DEC_21150: dev->regs[0x06] = 0x80; dev->regs[0x07] = 0x02; @@ -490,6 +516,8 @@ pci_bridge_init(const device_t *info) uint8_t interrupt_count; uint8_t interrupt_mask; 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)); @@ -499,7 +527,10 @@ pci_bridge_init(const device_t *info) pci_bridge_reset(dev); - pci_add_bridge(AGP_BRIDGE(dev->local), pci_bridge_read, pci_bridge_write, dev, &dev->slot); + 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; @@ -513,16 +544,23 @@ pci_bridge_init(const device_t *info) 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 slot_count = 1; /* AGP bridges always have 1 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, i, interrupts[i & interrupt_mask], + dev->bus_index, slot, 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, i, AGP_BRIDGE(dev->local) ? PCI_CARD_AGP : PCI_CARD_NORMAL, + pci_register_bus_slot(dev->bus_index, slot, AGP_BRIDGE(dev->local) ? PCI_CARD_AGP : PCI_CARD_NORMAL, interrupts[i & interrupt_mask], interrupts[(i + 1) & interrupt_mask], interrupts[(i + 2) & interrupt_mask], @@ -547,6 +585,20 @@ const device_t dec21150_device = { .config = NULL }; +const device_t dec21152_device = { + .name = "DEC 21152 PCI Bridge", + .internal_name = "dec21152", + .flags = DEVICE_PCI, + .local = PCI_BRIDGE_DEC_21152, + .init = pci_bridge_init, + .close = NULL, + .reset = pci_bridge_reset, + .available = NULL, + .speed_changed = NULL, + .force_redraw = NULL, + .config = NULL +}; + /* AGP bridges */ const device_t ali5243_agp_device = { .name = "ALi M5243 AGP Bridge", diff --git a/src/device/postcard.c b/src/device/postcard.c index 058684c0b..19d81b692 100644 --- a/src/device/postcard.c +++ b/src/device/postcard.c @@ -99,7 +99,8 @@ postcard_setui(void) ps[1][0], ps[1][1], ps[1][2], ps[1][3]); break; } - } else if (strstr(machines[machine].name, " Dell ")) { + } else if (strstr(machines[machine].name, " Dell ") && + (machine_get_chipset(machine) >= MACHINE_CHIPSET_INTEL_430FX)) { char dell_diags[10] = { 0 }; if (!postcard_written[1]) @@ -223,7 +224,8 @@ 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 ")) + if (strstr(machines[machine].name, " Dell ") && + (machine_get_chipset(machine) >= MACHINE_CHIPSET_INTEL_430FX)) io_sethandler(0x00e0, 0x0001, NULL, NULL, NULL, NULL, NULL, postcard_writel, NULL); diff --git a/src/disk/hdc_ide_rz1000.c b/src/disk/hdc_ide_rz1000.c index e2c7179ad..06586b267 100644 --- a/src/disk/hdc_ide_rz1000.c +++ b/src/disk/hdc_ide_rz1000.c @@ -130,38 +130,6 @@ rz1000_pci_write(int func, int addr, uint8_t val, void *priv) rz1000_ide_handlers(dev); } break; - case 0x10: - dev->regs[0x10] = (val & 0xf8) | 1; - rz1000_ide_handlers(dev); - break; - case 0x11: - dev->regs[0x11] = val; - rz1000_ide_handlers(dev); - break; - case 0x14: - dev->regs[0x14] = (val & 0xfc) | 1; - rz1000_ide_handlers(dev); - break; - case 0x15: - dev->regs[0x15] = val; - rz1000_ide_handlers(dev); - break; - case 0x18: - dev->regs[0x18] = (val & 0xf8) | 1; - rz1000_ide_handlers(dev); - break; - case 0x19: - dev->regs[0x19] = val; - rz1000_ide_handlers(dev); - break; - case 0x1c: - dev->regs[0x1c] = (val & 0xfc) | 1; - rz1000_ide_handlers(dev); - break; - case 0x1d: - dev->regs[0x1d] = val; - rz1000_ide_handlers(dev); - break; case 0x40 ... 0x4f: dev->regs[addr] = val; break; @@ -233,16 +201,13 @@ rz1000_reset(void *priv) dev->regs[0x01] = 0x10; dev->regs[0x02] = 0x00; /* RZ-1000 */ dev->regs[0x03] = 0x10; - dev->regs[0x04] = 0x01; + dev->regs[0x04] = 0x00; dev->regs[0x07] = 0x02; /* DEVSEL timing: 01 medium */ dev->regs[0x08] = 0x02; /* Revision 02 */ dev->regs[0x09] = dev->local; /* Programming interface */ dev->regs[0x0a] = 0x01; /* IDE controller */ dev->regs[0x0b] = 0x01; /* Mass storage controller */ - dev->regs[0x3c] = 0x14; /* IRQ 14 */ - dev->regs[0x3d] = 0x01; /* INTA */ - dev->irq_mode[0] = dev->irq_mode[1] = 0; dev->irq_pin = PCI_INTA; dev->irq_line = 14; @@ -299,7 +264,7 @@ const device_t ide_rz1000_pci_device = { .name = "PC Technology RZ-1000 PCI", .internal_name = "ide_rz1000_pci", .flags = DEVICE_PCI, - .local = 0x6000a, + .local = 0x60000, .init = rz1000_init, .close = rz1000_close, .reset = rz1000_reset, @@ -313,7 +278,7 @@ const device_t ide_rz1000_pci_single_channel_device = { .name = "PC Technology RZ-1000 PCI", .internal_name = "ide_rz1000_pci_single_channel", .flags = DEVICE_PCI, - .local = 0x2000a, + .local = 0x20000, .init = rz1000_init, .close = rz1000_close, .reset = rz1000_reset, diff --git a/src/include/86box/chipset.h b/src/include/86box/chipset.h index 94884383b..688a5fecb 100644 --- a/src/include/86box/chipset.h +++ b/src/include/86box/chipset.h @@ -197,6 +197,8 @@ extern const device_t vlsi_scamp_device; extern const device_t wd76c10_device; /* Miscellaneous Hardware */ +extern const device_t dell_jumper_device; + extern const device_t nec_mate_unk_device; extern const device_t phoenix_486_jumper_device; diff --git a/src/include/86box/machine.h b/src/include/86box/machine.h index be9f17505..0dbbe98c5 100644 --- a/src/include/86box/machine.h +++ b/src/include/86box/machine.h @@ -385,6 +385,7 @@ extern int machine_get_min_ram(int m); extern int machine_get_max_ram(int m); extern int machine_get_ram_granularity(int m); extern int machine_get_type(int m); +extern int machine_get_chipset(int m); extern void machine_close(void); extern int machine_has_mouse(void); extern int machine_is_sony(void); @@ -804,6 +805,7 @@ extern int machine_at_686nx_init(const machine_t *); extern int machine_at_acerv60n_init(const machine_t *); extern int machine_at_lgibmx61_init(const machine_t *); extern int machine_at_vs440fx_init(const machine_t *); +extern int machine_at_dellvenus_init(const machine_t *); extern int machine_at_gw2kvenus_init(const machine_t *); extern int machine_at_ap440fx_init(const machine_t *); extern int machine_at_mb600n_init(const machine_t *); diff --git a/src/include/86box/pci.h b/src/include/86box/pci.h index 097fcf502..462b4f821 100644 --- a/src/include/86box/pci.h +++ b/src/include/86box/pci.h @@ -286,6 +286,7 @@ extern void pci_bridge_set_ctl(void *priv, uint8_t ctl); #ifdef EMU_DEVICE_H extern const device_t dec21150_device; +extern const device_t dec21152_device; extern const device_t ali5243_agp_device; extern const device_t ali5247_agp_device; diff --git a/src/machine/m_at_386dx_486.c b/src/machine/m_at_386dx_486.c index c1f471ff3..9f7534244 100644 --- a/src/machine/m_at_386dx_486.c +++ b/src/machine/m_at_386dx_486.c @@ -1727,7 +1727,6 @@ machine_at_sb486pv_init(const machine_t *model) device_context_restore(); machine_at_common_init(model); - device_add(&ide_pci_device); pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); diff --git a/src/machine/m_at_slot1.c b/src/machine/m_at_slot1.c index 54cf1a03a..a147d0e13 100644 --- a/src/machine/m_at_slot1.c +++ b/src/machine/m_at_slot1.c @@ -164,18 +164,20 @@ machine_at_optiplex_gxa_init(const machine_t *model) machine_at_common_init_ex(model, 2); pci_init(PCI_CONFIG_TYPE_1); - pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 1, 2, 3, 4); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 1, 3, 4); - pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 2, 1); - pci_register_slot(0x11, PCI_CARD_NETWORK, 4, 0, 0, 0); pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 1, 2, 3, 4); pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); + 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); 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); 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_socket370.c b/src/machine/m_at_socket370.c index 3f8db4e8c..ff299ee50 100644 --- a/src/machine/m_at_socket370.c +++ b/src/machine/m_at_socket370.c @@ -386,7 +386,7 @@ machine_at_awo671r_init(const machine_t *model) pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1); pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2); pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3); - pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x0D, PCI_CARD_VIDEO, 2, 3, 4, 1); pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4); device_add(&i440bx_device); device_add(&piix4e_device); @@ -394,9 +394,8 @@ machine_at_awo671r_init(const machine_t *model) device_add_inst(&w83977ef_device, 2); device_add(&keyboard_ps2_pci_device); device_add(&sst_flash_39sf020_device); - if (gfxcard[0] == VID_INTERNAL) { - device_add(&chips_69000_onboard_device); - } + if (gfxcard[0] == VID_INTERNAL) + device_add(machine_get_vid_device(machine)); spd_register(SPD_TYPE_SDRAM, 0x3, 256); return ret; diff --git a/src/machine/m_at_socket4.c b/src/machine/m_at_socket4.c index 88474d431..2d4e1a51a 100644 --- a/src/machine/m_at_socket4.c +++ b/src/machine/m_at_socket4.c @@ -157,7 +157,9 @@ machine_at_dellxp60_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_init(model); + machine_at_common_init_ex(model, 2); + + device_add(&amstrad_megapc_nvr_device); device_add(&ide_pci_device); pci_init(PCI_CONFIG_TYPE_2); @@ -170,7 +172,7 @@ machine_at_dellxp60_init(const machine_t *model) pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); - device_add(&keyboard_ps2_intel_ami_pci_device); + device_add(&keyboard_ps2_phoenix_device); device_add(&sio_zb_device); device_add(&fdc37c665_device); device_add(&intel_flash_bxt_ami_device); @@ -189,8 +191,10 @@ machine_at_opti560l_init(const machine_t *model) if (bios_only || !ret) return ret; - machine_at_common_init(model); - device_add(&ide_pci_2ch_device); + machine_at_common_init_ex(model, 2); + + device_add(&amstrad_megapc_nvr_device); + device_add(&ide_pci_device); pci_init(PCI_CONFIG_TYPE_2); pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); @@ -199,7 +203,7 @@ machine_at_opti560l_init(const machine_t *model) pci_register_slot(0x08, PCI_CARD_NORMAL, 2, 1, 3, 4); pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&i430lx_device); - device_add(&keyboard_ps2_intel_ami_pci_device); + device_add(&keyboard_ps2_phoenix_device); device_add(&sio_zb_device); device_add(&i82091aa_device); device_add(&intel_flash_bxt_ami_device); @@ -266,8 +270,7 @@ machine_at_valuepointp60_init(const machine_t *model) pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); device_add(&keyboard_ps2_ps1_pci_device); device_add(&sio_device); - device_add(&ide_rz1000_pci_single_channel_device); - device_add(&fdc37c665_device); + device_add(&fdc37c665_ide_device); device_add(&intel_flash_bxt_ami_device); device_add(&i430lx_device); diff --git a/src/machine/m_at_socket5.c b/src/machine/m_at_socket5.c index 5572d0484..442281811 100644 --- a/src/machine/m_at_socket5.c +++ b/src/machine/m_at_socket5.c @@ -268,6 +268,7 @@ machine_at_optiplex_gxl_init(const machine_t *model) device_add(&i430fx_device); device_add(&piix_device); device_add(&pc87332_device); + device_add(&dell_jumper_device); device_add(&intel_flash_bxt_device); return ret; diff --git a/src/machine/m_at_socket7.c b/src/machine/m_at_socket7.c index 3d51e1a06..7d2441e18 100644 --- a/src/machine/m_at_socket7.c +++ b/src/machine/m_at_socket7.c @@ -24,7 +24,6 @@ #include <86box/mem.h> #include <86box/io.h> #include <86box/rom.h> -#include <86box/pci.h> #include <86box/device.h> #include <86box/chipset.h> #include <86box/hdc.h> @@ -45,6 +44,7 @@ #include <86box/scsi_ncr53c8xx.h> #include <86box/thread.h> #include <86box/network.h> +#include <86box/pci.h> int machine_at_acerv35n_init(const machine_t *model) @@ -989,6 +989,7 @@ machine_at_optiplex_gn_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); if (gfxcard[0] == VID_INTERNAL) device_add(machine_get_vid_device(machine)); @@ -998,6 +999,7 @@ machine_at_optiplex_gn_init(const machine_t *model) device_add(&i430tx_device); device_add(&piix4_device); + device_add(&dec21152_device); 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/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index aabfb9b4f..d81b41502 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -260,6 +260,42 @@ machine_at_vs440fx_init(const machine_t *model) return ret; } +int +machine_at_dellvenus_init(const machine_t *model) +{ + int ret; + + ret = bios_load_linear_combined2("roms/machines/dellvenus/1006CS1J.BIO", + "roms/machines/dellvenus/1006CS1J.BI1", + "roms/machines/dellvenus/1006CS1J.BI2", + "roms/machines/dellvenus/1006CS1J.BI3", + "roms/machines/dellvenus/1006CS1J.RCV", + 0x3a000, 128); + + if (bios_only || !ret) + return ret; + + machine_at_common_init(model); + + pci_init(PCI_CONFIG_TYPE_1); + pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0); + pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4); + pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3); + pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2); + pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1); + pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0); + device_add(&i440fx_device); + device_add(&piix3_device); + device_add_params(&pc87307_device, (void *) (PCX730X_AMI | PCX7307_PC87307)); + + device_add(&intel_flash_bxt_ami_device); + + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(machine_get_snd_device(machine)); + + return ret; +} + int machine_at_gw2kvenus_init(const machine_t *model) { diff --git a/src/machine/m_xt_olivetti.c b/src/machine/m_xt_olivetti.c index 34ca441ec..acdb77fd1 100644 --- a/src/machine/m_xt_olivetti.c +++ b/src/machine/m_xt_olivetti.c @@ -2366,8 +2366,8 @@ machine_xt_m240_init(const machine_t *model) m24_kbd_t *m24_kbd; nvr_t *nvr; - ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchj_2.11_low.bin", - "roms/machines/m240/olivetti_m240_pchk_2.11_high.bin", + ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pchm_2.12_low.bin", + "roms/machines/m240/olivetti_m240_pchl_2.12_high.bin", 0x000f8000, 32768, 0); if (bios_only || !ret) diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index de830cb89..a3a02bfcd 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -8650,7 +8650,7 @@ const machine_t machines[] = { .gpio_acpi_handler = NULL, .cpu = { .package = CPU_PKG_SOCKET3, - .block = CPU_BLOCK(CPU_i486SX, CPU_i486DX, CPU_Am486SX, CPU_Am486DX), + .block = CPU_BLOCK_NONE, .min_bus = 0, .max_bus = 0, .min_voltage = 0, @@ -13838,7 +13838,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -13878,7 +13878,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -13920,7 +13920,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 786432, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -14084,7 +14084,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_AGP | MACHINE_BUS_USB, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_USB, .ram = { - .min = 1024, + .min = 8192, .max = 1572864, .step = 8192 }, @@ -14443,7 +14443,7 @@ const machine_t machines[] = { .cpu = { .package = CPU_PKG_SOCKET5_7, .block = CPU_BLOCK_NONE, - .min_bus = 66666667, + .min_bus = 60000000, .max_bus = 100000000, .min_voltage = 2000, .max_voltage = 3520, @@ -14455,7 +14455,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 786432, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -14675,7 +14675,47 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* It's a Intel VS440FX with a Gateway 2000 OEM BIOS */ + /* It's an Intel VS440FX with a Dell OEM BIOS */ + { + .name = "[i440FX] Dell Dimension XPS Pro___n", + .internal_name = "dellvenus", + .type = MACHINE_TYPE_SOCKET8, + .chipset = MACHINE_CHIPSET_INTEL_440FX, + .init = machine_at_dellvenus_init, + .p1_handler = NULL, + .gpio_handler = NULL, + .available_flag = MACHINE_AVAILABLE, + .gpio_acpi_handler = NULL, + .cpu = { + .package = CPU_PKG_SOCKET8, + .block = CPU_BLOCK_NONE, + .min_bus = 60000000, + .max_bus = 66666667, + .min_voltage = 2100, + .max_voltage = 3500, + .min_multi = 2.0, + .max_multi = 3.5 + }, + .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .ram = { + .min = 8192, + .max = 524288, + .step = 8192 + }, + .nvrmask = 127, + .kbc_device = NULL, + .kbc_p1 = 0xff, + .gpio = 0xffffffff, + .gpio_acpi = 0xffffffff, + .device = NULL, + .fdc_device = NULL, + .sio_device = NULL, + .vid_device = NULL, + .snd_device = &cs4236_onboard_device, + .net_device = NULL + }, + /* It's an Intel VS440FX with a Gateway 2000 OEM BIOS */ { .name = "[i440FX] Gateway 2000 Venus", .internal_name = "gw2kvenus", @@ -14987,7 +15027,7 @@ const machine_t machines[] = { .bus_flags = MACHINE_PS2_AGP | MACHINE_BUS_USB, .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI | MACHINE_GAMEPORT | MACHINE_USB, /* Machine has internal sound: C-Media CMI8330 */ .ram = { - .min = 1024, + .min = 8192, .max = 1572864, .step = 8192 }, @@ -16068,7 +16108,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -16108,7 +16148,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -16462,7 +16502,7 @@ const machine_t machines[] = { .device = NULL, .fdc_device = NULL, .sio_device = NULL, - .vid_device = NULL, + .vid_device = &chips_69000_onboard_device, .snd_device = NULL, .net_device = NULL }, @@ -16869,7 +16909,7 @@ const machine_t machines[] = { .ram = { .min = 8192, .max = 1572864, - .step = 1024 + .step = 8192 }, .nvrmask = 255, .kbc_device = NULL, @@ -17306,6 +17346,12 @@ machine_get_type(int m) return (machines[m].type); } +int +machine_get_chipset(int m) +{ + return (machines[m].chipset); +} + int machine_get_machine_from_internal_name(const char *s) { diff --git a/src/network/net_pcnet.c b/src/network/net_pcnet.c index b13fd8438..16fd7c65c 100644 --- a/src/network/net_pcnet.c +++ b/src/network/net_pcnet.c @@ -3256,8 +3256,12 @@ const device_t pcnet_am79c960_eb_device = { .config = pcnet_isa_config }; +/* + Used to be incorrectly called "AMD PCnet-VL" but the real name of the chip is "AMD PCnet-32" per the relevant datasheet. + https://theretroweb.com/chip/documentation/am79c965-66c24a7e6969d347126123.pdf +*/ const device_t pcnet_am79c960_vlb_device = { - .name = "AMD PCnet-VL", + .name = "AMD PCnet-32", .internal_name = "pcnetvlb", .flags = DEVICE_VLB, .local = DEV_AM79C960_VLB, diff --git a/src/sio/sio_pc87309.c b/src/sio/sio_pc87309.c index 8bbbb7036..5a3f0d828 100644 --- a/src/sio/sio_pc87309.c +++ b/src/sio/sio_pc87309.c @@ -58,8 +58,8 @@ enum { LD_UART2, LD_UART1, LD_PM, - LD_KBD, - LD_MOUSE + LD_MOUSE, + LD_KBD } pc87309_ld_t; #define LD_MIN LD_FDC diff --git a/src/sound/snd_sb.c b/src/sound/snd_sb.c index 160e79881..7cfeae95e 100644 --- a/src/sound/snd_sb.c +++ b/src/sound/snd_sb.c @@ -2091,35 +2091,39 @@ sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv) sb_t *sb = (sb_t *) priv; uint16_t addr = sb->dsp.sb_addr; - io_removehandler(addr, 0x0004, - sb->opl.read, NULL, NULL, - sb->opl.write, NULL, NULL, - sb->opl.priv); - io_removehandler(addr + 8, 0x0002, - sb->opl.read, NULL, NULL, - sb->opl.write, NULL, NULL, - sb->opl.priv); - io_removehandler(addr + 4, 0x0002, - sb_ct1745_mixer_read, NULL, NULL, - sb_ct1745_mixer_write, NULL, NULL, - sb); + if (addr != 0x0000) { + io_removehandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_removehandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + } sb_dsp_setaddr(&sb->dsp, 0); addr = new_addr; - io_sethandler(addr, 0x0004, - sb->opl.read, NULL, NULL, - sb->opl.write, NULL, NULL, - sb->opl.priv); - io_sethandler(addr + 8, 0x0002, - sb->opl.read, NULL, NULL, - sb->opl.write, NULL, NULL, - sb->opl.priv); - io_sethandler(addr + 4, 0x0002, - sb_ct1745_mixer_read, NULL, NULL, - sb_ct1745_mixer_write, NULL, NULL, - sb); + if (addr != 0x0000) { + io_sethandler(addr, 0x0004, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 8, 0x0002, + sb->opl.read, NULL, NULL, + sb->opl.write, NULL, NULL, + sb->opl.priv); + io_sethandler(addr + 4, 0x0002, + sb_ct1745_mixer_read, NULL, NULL, + sb_ct1745_mixer_write, NULL, NULL, + sb); + } sb_dsp_setaddr(&sb->dsp, addr); } diff --git a/src/video/vid_chips_69000.c b/src/video/vid_chips_69000.c index c9830f0ed..8267e271c 100644 --- a/src/video/vid_chips_69000.c +++ b/src/video/vid_chips_69000.c @@ -2247,8 +2247,8 @@ chips_69000_pci_write(UNUSED(int func), int addr, uint8_t val, void *priv) break; case 0x13: - chips->linear_mapping.base = val << 24; mem_mapping_disable(&chips->linear_mapping); + chips->linear_mapping.base = val << 24; if ((chips->pci_conf_status & PCI_COMMAND_MEM) && (chips->linear_mapping.base > 0x00000000)) mem_mapping_set_addr(&chips->linear_mapping, chips->linear_mapping.base, (1 << 24)); @@ -2785,6 +2785,8 @@ chips_69000_disable_handlers(chips_69000_t *chips) mem_mapping_disable(&chips->svga.mapping); if (!chips->on_board) mem_mapping_disable(&chips->bios_rom.mapping); + + chips->linear_mapping.base = 0; /* Save all the mappings and the timers because they are part of linked lists. */ reset_state->linear_mapping = chips->linear_mapping;