From 862154b0a978b934cc9bde4076371bcb220ca5f3 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 3 Mar 2022 17:56:09 -0500 Subject: [PATCH] OPLL: fix drum mode slides --- src/engine/platform/opll.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index 9d56d609e..cb89215ce 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -257,7 +257,6 @@ void DivPlatformOPLL::tick() { chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,octave(chan[i].baseFreq)); if (chan[i].freq>262143) chan[i].freq=262143; int freqt=toFreq(chan[i].freq); - chan[i].freqH=freqt>>8; chan[i].freqL=freqt&0xff; if (i>=6 && properDrums) { immWrite(0x10+drumSlot[i],freqt&0xff); @@ -266,13 +265,14 @@ void DivPlatformOPLL::tick() { immWrite(0x10+i,freqt&0xff); // TODO high byte? } + chan[i].freqH=freqt>>8; } if (chan[i].keyOn && i>=6 && properDrums) { if (!isMuted[i]) { drumState|=(0x10>>(i-6)); immWrite(0x0e,0x20|drumState); } - chan[i].keyOn=false; + chan[i].keyOn=false; } else if (chan[i].keyOn && i>=6 && drums) { //printf("%d\n",chan[i].note%12); drumState|=(0x10>>(chan[i].note%12)); @@ -280,7 +280,9 @@ void DivPlatformOPLL::tick() { chan[i].keyOn=false; } else if ((chan[i].keyOn || chan[i].freqChanged) && i<9) { //immWrite(0x28,0xf0|konOffs[i]); - immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)|(chan[i].state.alg?0x20:0)); + if (!(i>=6 && properDrums)) { + immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)|(chan[i].state.alg?0x20:0)); + } chan[i].keyOn=false; } chan[i].freqChanged=false;