From 2fbc39bc903cae7265033caee7f8ae53919eb013 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 11:28:59 -0500 Subject: [PATCH] N163: fix potential linear pitch regression how in the world --- src/engine/platform/n163.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index 9318b4f8b..691cdc04a 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -357,7 +357,9 @@ void DivPlatformN163::tick(bool sysTick) { chan[i].waveUpdated=false; } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { - chan[i].freq=parent->calcFreq((((chan[i].baseFreq*chan[i].waveLen)*(chanMax+1))/16),chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE); + // TODO: what is this mess? + chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE); + chan[i].freq=(((chan[i].freq*chan[i].waveLen)*(chanMax+1))/16); if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>0x3ffff) chan[i].freq=0x3ffff; if (chan[i].keyOn) {