diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 4d312e1da..87713712a 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -262,7 +262,8 @@ ad1848_write(uint16_t addr, uint8_t val, void *priv) break; case 17: - if (ad1848->type >= AD1848_TYPE_CS4231) /* enable additional data formats on modes 2 and 3 */ + /* Enable additional data formats on modes 2 and 3 where supported. */ + if ((ad1848->type == AD1848_TYPE_CS4231) || (ad1848->type == AD1848_TYPE_CS4236)) ad1848->fmt_mask = (val & 0x40) ? 0xf0 : 0x70; break; @@ -659,7 +660,10 @@ ad1848_init(ad1848_t *ad1848, uint8_t type) ad1848->out_l = ad1848->out_r = 0; ad1848->fm_vol_l = ad1848->fm_vol_r = 65536; ad1848_updatevolmask(ad1848); - ad1848->fmt_mask = 0x70; + if (type == AD1848_TYPE_CS4235) + ad1848->fmt_mask = 0x50; + else + ad1848->fmt_mask = 0x70; for (c = 0; c < 128; c++) { attenuation = 0.0; diff --git a/src/sound/snd_cs423x.c b/src/sound/snd_cs423x.c index 34d4fb21d..6d4a5ff2e 100644 --- a/src/sound/snd_cs423x.c +++ b/src/sound/snd_cs423x.c @@ -727,7 +727,7 @@ cs423x_init(const device_t *info) case CRYSTAL_CS4237B: case CRYSTAL_CS4238B: /* Same WSS codec and EEPROM structure. */ - dev->ad1848_type = AD1848_TYPE_CS4236; + dev->ad1848_type = (dev->type == CRYSTAL_CS4235) ? AD1848_TYPE_CS4235 : AD1848_TYPE_CS4236; dev->pnp_offset = 0x4013; /* Different Chip Version and ID registers, which shouldn't be reset by ad1848_init */