Whenever the driver calculates the next tempo tick interval through ft_restore_speed, it has to do this for unfixed-tick BPM:
player.s L1738
lda var_Tempo_Accum
adc var_Tempo_Dec
sta var_Tempo_Accum
lda var_Tempo_Accum + 1
adc var_Tempo_Dec + 1
sta var_Tempo_Accum + 1
sec
lda var_Tempo_Accum
sbc var_Tempo_Modulus
sta var_Tempo_Accum
lda var_Tempo_Accum + 1
sbc var_Tempo_Modulus + 1
sta var_Tempo_Accum + 1
in pseudocode, this would mean Accumulator += RegionSpeedDivider; Accumulator -= Modulus;.
At this point, the modulus and the decrement would be constant after calling ft_calculate_speed. it would be optimal to cache the difference of RegionSpeedDivider and Modulus (DecrementMod = RegionSpeedDivider - Modulus;), and then add it to the Accumulator as Accumulator += DecrementMod;.
Whenever the driver calculates the next tempo tick interval through
ft_restore_speed, it has to do this for unfixed-tick BPM:player.s L1738
in pseudocode, this would mean
Accumulator += RegionSpeedDivider; Accumulator -= Modulus;.At this point, the modulus and the decrement would be constant after calling
ft_calculate_speed. it would be optimal to cache the difference ofRegionSpeedDividerandModulus(DecrementMod = RegionSpeedDivider - Modulus;), and then add it to the Accumulator asAccumulator += DecrementMod;.