From 490c056406c113091f7f05f2aef518f22d655eec Mon Sep 17 00:00:00 2001 From: gcielniak Date: Sun, 28 Feb 2021 13:30:36 -0800 Subject: [PATCH] S86 volume envelope fix --- src/s2x/wsg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/s2x/wsg.c b/src/s2x/wsg.c index 9b30c9d..992d377 100644 --- a/src/s2x/wsg.c +++ b/src/s2x/wsg.c @@ -511,7 +511,6 @@ void S2X_S86WSGTrackUpdate(S2X_State *S,int TrackNo,S2X_Track *T) { T->SyncFlag = T->Channel[ch].WSG.SyncFlag; S2X_VoiceCommand(S,&T->Channel[ch],0,0); - S2X_S86WSGEnvelopeUpdate(S,&T->Channel[ch].WSG.Env[0],&T->Channel[ch]); S2X_S86WSGChannelUpdate(S,TrackNo,&T->Channel[ch],ch); } } @@ -848,6 +847,8 @@ void S2X_S86WSGChannelUpdate(S2X_State *S,int TrackNo,S2X_Channel *C,int Channel S2X_S86WSGEnvelopeStart(S,&C->WSG.Env[0]); } + S2X_S86WSGEnvelopeUpdate(S,&C->WSG.Env[0],C); + C->WSG.Env[1].Val = C->WSG.Env[0].Val; //C->WSG.Freq |= (C->WSG.WaveSet & 0xf0) << 16;