YM2612: fix several sample bugs

This commit is contained in:
tildearrow 2022-04-25 01:24:42 -05:00
parent c84ff399d9
commit 832df58929
3 changed files with 74 additions and 19 deletions

View file

@ -894,7 +894,15 @@ unsigned short DivEngine::calcBaseFreqFNumBlock(double clock, double divider, in
if (block>7) block=7;
bf>>=block;
if (bf<0) bf=0;
if (bf>((1<<bits)-1)) bf=(1<<bits)-1;
if (bf>1288) { // apparently octave boundary
while (block<7) {
bf>>=1;
block++;
}
if (bf>((1<<bits)-1)) {
bf=(1<<bits)-1;
}
}
return bf|(block<<bits);
}