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

@ -209,7 +209,7 @@ void DivPlatformPCE::tick() {
off=8363.0/(double)s->centerRate;
}
}
chan[i].dacRate=((double)chipClock/2)/(off*chan[i].freq);
chan[i].dacRate=((double)chipClock/2)/MIN(1,off*chan[i].freq);
if (dumpWrites) addWrite(0xffff0001+(i<<8),chan[i].dacRate);
}
if (chan[i].freq>4095) chan[i].freq=4095;