SMS/T6W28: limit upper period

This commit is contained in:
tildearrow 2023-01-02 00:00:23 -05:00
parent 565e8cc314
commit 560ec19176
2 changed files with 2 additions and 0 deletions

View file

@ -146,6 +146,7 @@ void DivPlatformT6W28::tick(bool sysTick) {
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
chan[i].freq=snCalcFreq(i);
if (chan[i].freq<0) chan[i].freq=0;
if (chan[i].freq>1023) chan[i].freq=1023;
if (i==3) {
rWrite(1,0x80|(2<<5)|(chan[3].freq&15));