From ca51ee9f320f2aef1e2d3b32c3d953e99230dbba Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 29 Aug 2023 03:38:59 -0500 Subject: [PATCH] C219: fix bank note off --- src/engine/platform/c140.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/c140.cpp b/src/engine/platform/c140.cpp index 873825648..d3ddb1133 100644 --- a/src/engine/platform/c140.cpp +++ b/src/engine/platform/c140.cpp @@ -249,7 +249,7 @@ void DivPlatformC140::tick(bool sysTick) { // shut everyone else up for (int j=0; j<4; j++) { int ch=(i&(~3))|j; - if (chan[ch].active && (i&3)!=j) { + if (chan[ch].active && !chan[ch].keyOn && (i&3)!=j) { chan[ch].sample=-1; chan[ch].active=false; chan[ch].keyOff=true; @@ -447,6 +447,12 @@ void DivPlatformC140::forceIns() { chan[i].volChangedR=true; chan[i].sample=-1; } + if (is219) { + // restore banks + for (int i=0; i<4; i++) { + rWrite(0x1f1+(((3+(i>>2))&3)<<1),groupBank[i>>2]); + } + } } void* DivPlatformC140::getChanState(int ch) {