From 39c109fbc58c25057b10bc1caf6ce3d3e9a6862d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 17 Mar 2024 16:39:27 -0500 Subject: [PATCH] NDS: a couple fixes - don't reset phase on duty or pitch change - don't set volume in freqChanged --- src/engine/platform/nds.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/engine/platform/nds.cpp b/src/engine/platform/nds.cpp index b52980198..703e4d8fb 100644 --- a/src/engine/platform/nds.cpp +++ b/src/engine/platform/nds.cpp @@ -239,11 +239,9 @@ void DivPlatformNDS::tick(bool sysTick) { if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>65535) chan[i].freq=65535; ctrl=(chan[i].active?0xe8:0)|(chan[i].duty&7); - rWrite8(0x03+i*16,ctrl&~0x80); // force keyoff first - } - if (!chan[i].std.vol.had) { - chan[i].outVol=chan[i].vol; - writeOutVol(i); + if (chan[i].keyOff || chan[i].keyOn) { + rWrite8(0x03+i*16,ctrl&~0x80); // force keyoff first + } } chan[i].keyOn=false; if (chan[i].keyOff) {