From b3448c1f1605823025dddf662d8b5d84245b4cfb Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 16 Jun 2024 19:08:10 -0500 Subject: [PATCH] VIC-20: fix on/off unmute --- src/engine/platform/vic20.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/engine/platform/vic20.cpp b/src/engine/platform/vic20.cpp index fae616370..c3881e4ef 100644 --- a/src/engine/platform/vic20.cpp +++ b/src/engine/platform/vic20.cpp @@ -263,17 +263,26 @@ int DivPlatformVIC20::dispatch(DivCommand c) { void DivPlatformVIC20::muteChannel(int ch, bool mute) { isMuted[ch]=mute; - if (mute) { - chan[ch].keyOff=true; - } else if (chan[ch].active) { - chan[ch].keyOn=true; + if (chan[ch].onOff) { + if (mute) { + chan[ch].keyOff=true; + } else if (chan[ch].active) { + chan[ch].keyOn=true; + } } } void DivPlatformVIC20::forceIns() { for (int i=0; i<4; i++) { chan[i].insChanged=true; - chan[i].freqChanged=true; + // I give up! + if (chan[i].onOff) { + chan[i].freqChanged=true; + } else { + chan[i].freqChanged=false; + chan[i].keyOff=true; + chan[i].keyOn=false; + } writeOutVol(i); } }