Fix on-board audio on the GXL and the jumpers on the XPS P60 and 560/L.

This commit is contained in:
OBattler
2025-05-24 06:17:16 +02:00
parent aa45f9255c
commit e083daf4bb
11 changed files with 76 additions and 34 deletions

View File

@@ -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);

View File

@@ -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:

View File

@@ -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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -17346,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)
{

View File

@@ -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);
}