OPLL: fix drum mode slides

This commit is contained in:
tildearrow 2022-03-03 17:56:09 -05:00
parent 05bdfe74db
commit 862154b0a9

View file

@ -257,7 +257,6 @@ void DivPlatformOPLL::tick() {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,octave(chan[i].baseFreq)); 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; if (chan[i].freq>262143) chan[i].freq=262143;
int freqt=toFreq(chan[i].freq); int freqt=toFreq(chan[i].freq);
chan[i].freqH=freqt>>8;
chan[i].freqL=freqt&0xff; chan[i].freqL=freqt&0xff;
if (i>=6 && properDrums) { if (i>=6 && properDrums) {
immWrite(0x10+drumSlot[i],freqt&0xff); immWrite(0x10+drumSlot[i],freqt&0xff);
@ -266,6 +265,7 @@ void DivPlatformOPLL::tick() {
immWrite(0x10+i,freqt&0xff); immWrite(0x10+i,freqt&0xff);
// TODO high byte? // TODO high byte?
} }
chan[i].freqH=freqt>>8;
} }
if (chan[i].keyOn && i>=6 && properDrums) { if (chan[i].keyOn && i>=6 && properDrums) {
if (!isMuted[i]) { if (!isMuted[i]) {
@ -280,7 +280,9 @@ void DivPlatformOPLL::tick() {
chan[i].keyOn=false; chan[i].keyOn=false;
} else if ((chan[i].keyOn || chan[i].freqChanged) && i<9) { } else if ((chan[i].keyOn || chan[i].freqChanged) && i<9) {
//immWrite(0x28,0xf0|konOffs[i]); //immWrite(0x28,0xf0|konOffs[i]);
if (!(i>=6 && properDrums)) {
immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)|(chan[i].state.alg?0x20:0)); immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)|(chan[i].state.alg?0x20:0));
}
chan[i].keyOn=false; chan[i].keyOn=false;
} }
chan[i].freqChanged=false; chan[i].freqChanged=false;