From 5cd255a0e0e576db3346c2932d98c895be098865 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 3 Jun 2021 15:31:10 -0300 Subject: [PATCH] Fix CS4236 codec remapped register reads --- src/sound/snd_ad1848.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sound/snd_ad1848.c b/src/sound/snd_ad1848.c index 176da40da..ff4c0be83 100644 --- a/src/sound/snd_ad1848.c +++ b/src/sound/snd_ad1848.c @@ -135,9 +135,9 @@ ad1848_read(uint16_t addr, void *priv) case 18: case 19: if (ad1848->type == AD1848_TYPE_CS4236) { - if (ad1848->xregs[4] & 0x04) /* FM remapping */ + if ((ad1848->xregs[4] & 0x14) == 0x14) /* FM remapping */ ret = ad1848->xregs[ad1848->index - 12]; /* real FM volume on registers 6 and 7 */ - else if (ad1848->xregs[4] & 0x08) /* wavetable remapping */ + else if (ad1848->wten && !(ad1848->xregs[4] & 0x08)) /* wavetable remapping */ ret = ad1848->xregs[ad1848->index - 2]; /* real wavetable volume on registers 16 and 17 */ } break;