From: notaz Date: Thu, 3 Nov 2022 20:49:08 +0000 (+0200) Subject: spu: fix a wrong assumption X-Git-Tag: r24~284 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=1d5d35bc9d0d3d84873cd1d31870d09248ddc05b spu: fix a wrong assumption from 5aa94fa080e1b0a661b23aa912022dd464d41110 libretro/pcsx_rearmed#704 --- diff --git a/plugins/dfsound/registers.c b/plugins/dfsound/registers.c index e75f7086..e00939e6 100644 --- a/plugins/dfsound/registers.c +++ b/plugins/dfsound/registers.c @@ -505,10 +505,8 @@ static void SetPitch(int ch,unsigned short val) // SET PITCH spu.s_chan[ch].sinc = NP << 4; spu.s_chan[ch].sinc_inv = 0; spu.SB[ch * SB_SIZE + 32] = 1; // -> freq change in simple interpolation mode: set flag - if (val) - spu.dwChannelsAudible |= 1u << ch; - else - spu.dwChannelsAudible &= ~(1u << ch); + + // don't mess spu.dwChannelsAudible as adsr runs independently } //////////////////////////////////////////////////////////////////////// diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 3b4c051d..1127cd71 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -251,8 +251,7 @@ static void StartSoundMain(int ch) spu.dwNewChannel&=~(1<iRawPitch) - spu.dwChannelsAudible|=1<ADSRX, d); if (d < ns_to) { spu.dwChannelsAudible &= ~(1 << ch); + s_chan->ADSRX.State = ADSR_RELEASE; s_chan->ADSRX.EnvelopeVol = 0; } }