prevent division by zero, part 1

This commit is contained in:
tildearrow 2022-02-15 15:19:36 -05:00
parent 6960112f69
commit b24c572632
4 changed files with 6 additions and 4 deletions

View file

@ -57,6 +57,7 @@ unsigned char DivPlatformTIA::dealWithFreq(unsigned char shape, int base, int pi
}
int bp=base+pitch;
double mult=0.25*(parent->song.tuning*0.0625)*pow(2.0,double(768+bp)/(256.0*12.0));
if (mult<0.5) mult=0.5;
switch (shape) {
case 1: // buzzy
return ceil(31400/(30.6*mult))-1;