OPN: apply max freq limit

This commit is contained in:
tildearrow 2022-02-17 22:07:20 -05:00
parent eafc3078cf
commit 36eaea0fa7
4 changed files with 4 additions and 0 deletions

View file

@ -270,6 +270,7 @@ void DivPlatformGenesisExt::tick() {
if (extMode) for (int i=0; i<4; i++) {
if (opChan[i].freqChanged) {
opChan[i].freq=parent->calcFreq(opChan[i].baseFreq,opChan[i].pitch);
if (opChan[i].freq>262143) opChan[i].freq=262143;
if (opChan[i].freq>=82432) {
opChan[i].freqH=((opChan[i].freq>>15)&7)|0x38;
opChan[i].freqL=(opChan[i].freq>>7)&0xff;