Hi, thankyou for this great library! I have discovered that the music files converted with kss2vgm resulted in a slightly faster playback (~1.7%) when compared to the KSS files played on nezplug++. I traced back the problem to the current handling of the kmz80_exec() calls, which might actually take more Z80 cycles than requested. This difference results in a faster vsync rate and consequently a faster playback speed.
The two commits in this pull request address this issue by:
fixing the calculation of step_inc so that it represents fractional values.
compensating step_cnt by the extra cycles calculated from kmz80_exec(). This solution is very similar to the way nezplug++ handles the cycle execution.
I have checked the playback rate on a couple of songs from Snatcher which seems to be ok now. Please review and see if this is a good general fix. Thanks!
Hi, thankyou for this great library! I have discovered that the music files converted with kss2vgm resulted in a slightly faster playback (~1.7%) when compared to the KSS files played on nezplug++. I traced back the problem to the current handling of the
kmz80_exec()
calls, which might actually take more Z80 cycles than requested. This difference results in a faster vsync rate and consequently a faster playback speed.The two commits in this pull request address this issue by:
step_inc
so that it represents fractional values.step_cnt
by the extra cycles calculated fromkmz80_exec()
. This solution is very similar to the way nezplug++ handles the cycle execution.I have checked the playback rate on a couple of songs from Snatcher which seems to be ok now. Please review and see if this is a good general fix. Thanks!