Game Boy: fix period 0 causing overflow

issue #835
This commit is contained in:
tildearrow 2023-01-12 17:59:40 -05:00
parent aea7a67d3e
commit f2fdeb9df8
1 changed files with 1 additions and 1 deletions

View File

@ -291,7 +291,7 @@ void DivPlatformGB::tick(bool sysTick) {
} else {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER);
if (chan[i].freq>2047) chan[i].freq=2047;
if (chan[i].freq<0) chan[i].freq=0;
if (chan[i].freq<1) chan[i].freq=1;
}
if (chan[i].keyOn) {
if (i==2) { // wave