This commit is contained in:
OBattler
2025-05-16 05:05:02 +02:00
3 changed files with 26 additions and 7 deletions

View File

@@ -100,6 +100,7 @@
#define AC97_CODEC_STAC9708 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x08) #define AC97_CODEC_STAC9708 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x08)
#define AC97_CODEC_STAC9721 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x09) #define AC97_CODEC_STAC9721 AC97_VENDOR_ID(0x83, 0x84, 0x76, 0x09)
#define AC97_CODEC_TR28023 AC97_VENDOR_ID('T', 'R', 'A', 0x03) #define AC97_CODEC_TR28023 AC97_VENDOR_ID('T', 'R', 'A', 0x03)
#define AC97_CODEC_W83971D AC97_VENDOR_ID('W', 'E', 'C', 0x01)
#define AC97_CODEC_WM9701A AC97_VENDOR_ID('W', 'M', 'L', 0x00) #define AC97_CODEC_WM9701A AC97_VENDOR_ID('W', 'M', 'L', 0x00)
typedef struct ac97_vendor_reg_t { typedef struct ac97_vendor_reg_t {
@@ -150,6 +151,7 @@ extern const device_t cs4297a_device;
extern const device_t stac9708_device; extern const device_t stac9708_device;
extern const device_t stac9721_device; extern const device_t stac9721_device;
extern const device_t tr28023_device; extern const device_t tr28023_device;
extern const device_t w83971d_device;
extern const device_t wm9701a_device; extern const device_t wm9701a_device;
extern const device_t ac97_via_device; extern const device_t ac97_via_device;

View File

@@ -6428,7 +6428,7 @@ const machine_t machines[] = {
.flags = MACHINE_APM, .flags = MACHINE_APM,
.ram = { .ram = {
.min = 1024, .min = 1024,
.max = 65536, .max = 32768,
.step = 1024 .step = 1024
}, },
.nvrmask = 127, .nvrmask = 127,

View File

@@ -68,7 +68,6 @@ static const struct {
.device = &cs4297_device, .device = &cs4297_device,
.misc_flags = AC97_MASTER_6B | AC97_AUXOUT | AC97_AUXOUT_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK, .misc_flags = AC97_MASTER_6B | AC97_AUXOUT | AC97_AUXOUT_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK,
.reset_flags = AC97_HPOUT | AC97_DAC_18B | AC97_ADC_18B, .reset_flags = AC97_HPOUT | AC97_DAC_18B | AC97_ADC_18B,
.extid_flags = 0,
.pcsr_mask = 0x7f, .pcsr_mask = 0x7f,
.vendor_regs = (const ac97_vendor_reg_t[]) {{0, 0x5a, 0x0301, 0x0000}, {0}} .vendor_regs = (const ac97_vendor_reg_t[]) {{0, 0x5a, 0x0301, 0x0000}, {0}}
}, },
@@ -100,15 +99,18 @@ static const struct {
{ {
.device = &tr28023_device, .device = &tr28023_device,
.misc_flags = AC97_MASTER_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_POP | AC97_MS | AC97_LPBK, .misc_flags = AC97_MASTER_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_POP | AC97_MS | AC97_LPBK,
.reset_flags = 0, .pcsr_mask = 0x3f
.extid_flags = 0, },
{
.device = &w83971d_device,
.misc_flags = AC97_MASTER_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK,
.reset_flags = (27 << AC97_3D_SHIFT),
.pcsr_mask = 0x3f .pcsr_mask = 0x3f
}, },
{ {
.device = &wm9701a_device, .device = &wm9701a_device,
.misc_flags = AC97_AUXOUT | AC97_MONOOUT | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK, .misc_flags = AC97_AUXOUT | AC97_MONOOUT | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK,
.reset_flags = AC97_DAC_18B | AC97_ADC_18B, .reset_flags = AC97_DAC_18B | AC97_ADC_18B,
.extid_flags = 0,
.pcsr_mask = 0x3f .pcsr_mask = 0x3f
} }
// clang-format on // clang-format on
@@ -284,8 +286,9 @@ line_gain:
case 0x22: /* 3D Control */ case 0x22: /* 3D Control */
switch (ac97_codecs[dev->model].reset_flags >> AC97_3D_SHIFT) { switch (ac97_codecs[dev->model].reset_flags >> AC97_3D_SHIFT) {
case 1: /* Analog Devices */ case 1: /* Analog Devices */
case 6: /* Crystal */ case 6: /* Crystal */
case 27: /* Winbond */
val &= 0x000f; val &= 0x000f;
break; break;
@@ -764,6 +767,20 @@ const device_t tr28023_device = {
.config = NULL .config = NULL
}; };
const device_t w83971d_device = {
.name = "Winbond W83971D",
.internal_name = "w83971d",
.flags = DEVICE_AC97,
.local = AC97_CODEC_W83971D,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
.available = NULL,
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t wm9701a_device = { const device_t wm9701a_device = {
.name = "Wolfson WM9701A", .name = "Wolfson WM9701A",
.internal_name = "wm9701a", .internal_name = "wm9701a",