add a full linear pitch mode, part 7

fix full linear pitch on OPL, OPLL, SAA1099 and Sound Unit
This commit is contained in:
tildearrow 2022-05-11 00:26:28 -05:00
parent ea118db499
commit 1c6e9c2cca
4 changed files with 9 additions and 9 deletions

View file

@ -298,13 +298,13 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
int destFreq=NOTE_FREQUENCY(c.value2);
bool return2=false;
if (destFreq>chan[c.chan].baseFreq) {
chan[c.chan].baseFreq+=c.value*(1+(chan[c.chan].baseFreq>>9));
chan[c.chan].baseFreq+=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9)));
if (chan[c.chan].baseFreq>=destFreq) {
chan[c.chan].baseFreq=destFreq;
return2=true;
}
} else {
chan[c.chan].baseFreq-=c.value*(1+(chan[c.chan].baseFreq>>9));
chan[c.chan].baseFreq-=c.value*((parent->song.linearPitch==2)?1:(1+(chan[c.chan].baseFreq>>9)));
if (chan[c.chan].baseFreq<=destFreq) {
chan[c.chan].baseFreq=destFreq;
return2=true;