commanderx16 / x16-emulator

Emulator for the Commander X16 8-bit computer
384 stars 61 forks source link

Implement new audio mixing and emulation timing and update VERA audio emulation #467

Closed akumanatt closed 1 year ago

akumanatt commented 1 year ago

In preparation of a new YM2151 core which lacks resampling, the audio routine is very much rewritten.

Timing now uses elapsed CPU clocks as a base instead of elapsed frames, as VERA has different frame rates in each output mode which is not exactly 60Hz and reliable. This reduces (almost) all crackling problems introduced after the video timing rewrite.

VERA PSG and PCM behavior is updated to upstream hardware. Changes including full 24-bit mixing, more PSG resolution (less triangle aliasing and finer volume steps), same LFSR noise algorithm and phase resetting on disabled output. However, this necessitates a removal of anti-aliasing code introduced in #355 as this is not a hardware behavior to begin with.

This still needs lots of testing. I'm still not sure if tiny clicks are completely removed and web builds still work.

mooinglemur commented 1 year ago

Very much improved audio quality in my testing on Linux. The clicking is all but gone. <3

indigodarkwolf commented 1 year ago

Well, I've finally found the time to review this. I feel confident that this conforms to all of Michael's programming standards, and that I more-or-less understand everything that went in and why, and I agree with all the changes. Thanks for all this work! I'll give Michael until Monday to veto the merge, and if I don't hear back then I'll go ahead. <3