From b7f79750549274b5c2c8fe27178911d121937789 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 7 Feb 2025 20:44:21 -0300 Subject: [PATCH] CS423x: Add on-board CS4236 to the VS440FX --- src/include/86box/sound.h | 1 + src/machine/m_at_socket8.c | 6 ++++++ src/machine/machine_table.c | 8 ++++---- src/sound/snd_cs423x.c | 16 +++++++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 645d974dd..ba6ac2f83 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -170,6 +170,7 @@ extern const device_t sb_awe64_gold_device; /* Crystal CS423x */ extern const device_t cs4235_device; extern const device_t cs4235_onboard_device; +extern const device_t cs4236_onboard_device; extern const device_t cs4236b_device; extern const device_t cs4237b_device; extern const device_t cs4238b_device; diff --git a/src/machine/m_at_socket8.c b/src/machine/m_at_socket8.c index e6f78f6a2..935a26fb2 100644 --- a/src/machine/m_at_socket8.c +++ b/src/machine/m_at_socket8.c @@ -256,6 +256,9 @@ machine_at_vs440fx_init(const machine_t *model) device_add(&intel_flash_bxt_ami_device); + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(machine_get_snd_device(machine)); + return ret; } @@ -290,6 +293,9 @@ machine_at_gw2kvenus_init(const machine_t *model) device_add(&intel_flash_bxt_ami_device); + if (sound_card_current[0] == SOUND_INTERNAL) + device_add(machine_get_snd_device(machine)); + return ret; } diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index 26b42bc5b..82b0082fe 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -14072,7 +14072,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14087,7 +14087,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &cs4236_onboard_device, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ @@ -14196,7 +14196,7 @@ const machine_t machines[] = { .max_multi = 3.5 }, .bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB, - .flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_GAMEPORT | MACHINE_USB, .ram = { .min = 8192, .max = 524288, @@ -14211,7 +14211,7 @@ const machine_t machines[] = { .fdc_device = NULL, .sio_device = NULL, .vid_device = NULL, - .snd_device = NULL, + .snd_device = &cs4236_onboard_device, .net_device = NULL }, /* Has the AMIKey-2 (updated 'H') KBC firmware. */ diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index 4e65c3810..bef57d992 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -259,7 +259,7 @@ cs423x_write(uint16_t addr, uint8_t val, void *priv) break; case 3: /* Control Indirect Access Register (CS4236B+) */ - if (dev->type < CRYSTAL_CS4236B) + if (dev->type < CRYSTAL_CS4236) /* must be writable on CS4236 for the aforementioned VS440FX BIOS check */ return; val &= 0x0f; break; @@ -1089,6 +1089,20 @@ const device_t cs4235_onboard_device = { .config = NULL }; +const device_t cs4236_onboard_device = { + .name = "Crystal CS4236 (On-Board)", + .internal_name = "cs4236_onboard", + .flags = DEVICE_ISA | DEVICE_AT, + .local = CRYSTAL_CS4236 | CRYSTAL_NOEEPROM, + .init = cs423x_init, + .close = cs423x_close, + .reset = cs423x_reset, + .available = cs423x_available, + .speed_changed = cs423x_speed_changed, + .force_redraw = NULL, + .config = NULL +}; + const device_t cs4236b_device = { .name = "Crystal CS4236B", .internal_name = "cs4236b",