From e394b5ca5a22c48ccdd3d633db020e7d552b3cac Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 19 Jan 2022 22:58:37 -0500 Subject: [PATCH] C64: solve one ADSR bug set decay to 0 if sustain is 15 --- src/engine/platform/c64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 414544056..0a5ade492 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -118,7 +118,7 @@ int DivPlatformC64::dispatch(DivCommand c) { if (chan[c.chan].insChanged) { chan[c.chan].wave=(ins->c64.noiseOn<<3)|(ins->c64.pulseOn<<2)|(ins->c64.sawOn<<1)|(ins->c64.triOn); chan[c.chan].attack=ins->c64.a; - chan[c.chan].decay=ins->c64.d; + chan[c.chan].decay=(ins->c64.s==15)?0:ins->c64.d; chan[c.chan].sustain=ins->c64.s; chan[c.chan].release=ins->c64.r; chan[c.chan].ring=ins->c64.ringMod;