CS423x: Add some more missing CS4235 features and locks
This commit is contained in:
@@ -303,30 +303,35 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv)
|
|||||||
case 18:
|
case 18:
|
||||||
case 19:
|
case 19:
|
||||||
if (ad1848->type >= AD1848_TYPE_CS4236B) {
|
if (ad1848->type >= AD1848_TYPE_CS4236B) {
|
||||||
if ((ad1848->xregs[4] & 0x14) == 0x14) { /* FM remapping */
|
if (ad1848->type >= AD1848_TYPE_CS4235) {
|
||||||
ad1848->xregs[ad1848->index - 12] = val; /* real FM volume on extended registers 6 and 7 */
|
if (ad1848->xregs[18] & 0x20) /* AUX1 remapping */
|
||||||
temp = 1;
|
ad1848->regs[ad1848->index & 3] = val; /* also controls AUX1 on registers 2 and 3 */
|
||||||
|
} else {
|
||||||
|
if ((ad1848->xregs[4] & 0x14) == 0x14) { /* FM remapping */
|
||||||
|
ad1848->xregs[6 | (ad1848->index & 1)] = val; /* real FM volume on extended registers 6 and 7 */
|
||||||
|
temp = 1;
|
||||||
|
|
||||||
if (ad1848->index == 18) {
|
if (ad1848->index == 18) {
|
||||||
if (val & 0x80)
|
if (val & 0x80)
|
||||||
ad1848->fm_vol_l = 0;
|
ad1848->fm_vol_l = 0;
|
||||||
else
|
else
|
||||||
ad1848->fm_vol_l = ad1848_vols_7bits[val & 0x3f];
|
ad1848->fm_vol_l = ad1848_vols_7bits[val & 0x3f];
|
||||||
} else {
|
} else {
|
||||||
if (val & 0x80)
|
if (val & 0x80)
|
||||||
ad1848->fm_vol_r = 0;
|
ad1848->fm_vol_r = 0;
|
||||||
else
|
else
|
||||||
ad1848->fm_vol_r = ad1848_vols_7bits[val & 0x3f];
|
ad1848->fm_vol_r = ad1848_vols_7bits[val & 0x3f];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ad1848->wten && !(ad1848->xregs[4] & 0x08)) { /* wavetable remapping */
|
||||||
|
ad1848->xregs[16 | (ad1848->index & 1)] = val; /* real wavetable volume on extended registers 16 and 17 */
|
||||||
|
temp = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (ad1848->wten && !(ad1848->xregs[4] & 0x08)) { /* wavetable remapping */
|
|
||||||
ad1848->xregs[ad1848->index - 2] = val; /* real wavetable volume on extended registers 16 and 17 */
|
|
||||||
temp = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Stop here if any remapping is enabled. */
|
/* Stop here if any remapping is enabled. */
|
||||||
if (temp)
|
if (temp)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* HACK: the Windows 9x driver's "Synth" control writes to this
|
/* HACK: the Windows 9x driver's "Synth" control writes to this
|
||||||
register with no remapping, even if internal FM is enabled. */
|
register with no remapping, even if internal FM is enabled. */
|
||||||
@@ -366,9 +371,11 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv)
|
|||||||
|
|
||||||
switch (ad1848->xindex) {
|
switch (ad1848->xindex) {
|
||||||
case 0 ... 1:
|
case 0 ... 1:
|
||||||
/* Remapped line volume. */
|
if (ad1848->type < AD1848_TYPE_CS4235) {
|
||||||
ad1848->regs[18 + ad1848->xindex] = val;
|
/* Remapped line volume. */
|
||||||
return;
|
ad1848->regs[18 | ad1848->xindex] = val;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
if (val & 0x80)
|
if (val & 0x80)
|
||||||
@@ -747,7 +754,8 @@ ad1848_init(ad1848_t *ad1848, uint8_t type)
|
|||||||
ad1848->regs[30] = ad1848->regs[31] = 0;
|
ad1848->regs[30] = ad1848->regs[31] = 0;
|
||||||
|
|
||||||
if (type >= AD1848_TYPE_CS4236B) {
|
if (type >= AD1848_TYPE_CS4236B) {
|
||||||
ad1848->xregs[0] = ad1848->xregs[1] = 0xe8;
|
if (type < AD1848_TYPE_CS4235)
|
||||||
|
ad1848->xregs[0] = ad1848->xregs[1] = 0xe8;
|
||||||
ad1848->xregs[2] = ad1848->xregs[3] = 0xcf;
|
ad1848->xregs[2] = ad1848->xregs[3] = 0xcf;
|
||||||
ad1848->xregs[4] = 0x84;
|
ad1848->xregs[4] = 0x84;
|
||||||
ad1848->xregs[5] = 0;
|
ad1848->xregs[5] = 0;
|
||||||
|
|||||||
@@ -692,6 +692,10 @@ cs423x_pnp_enable(cs423x_t *dev, uint8_t update_rom, uint8_t update_hwconfig)
|
|||||||
dev->regs[4] &= ~0x40;
|
dev->regs[4] &= ~0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Update X18 bits. */
|
||||||
|
if (dev->type >= CRYSTAL_CS4235)
|
||||||
|
dev->ad1848.xregs[18] = (dev->ad1848.xregs[18] & ~0x3e) | (dev->ram_data[0x400b] & 0x3e);
|
||||||
|
|
||||||
/* Inform WSS codec of the changes. */
|
/* Inform WSS codec of the changes. */
|
||||||
ad1848_updatevolmask(&dev->ad1848);
|
ad1848_updatevolmask(&dev->ad1848);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user