MEGA65 / mega65-core

MEGA65 FPGA core
Other
241 stars 88 forks source link

audio_mixer.vhdl and audio_complex.vhdl: Fix a bunch of overflow and multiplication issues #794

Closed MassiveBattlebotsFan closed 5 months ago

MassiveBattlebotsFan commented 6 months ago

Fixed a bug in multiply_by_volume_coefficient that would convert an input value of $8000 to $0000 instead of $8000 * volume.

Added code to store $8000 in mixed_value when the value being added to mixed_value would result in an integer over/underflow.

Resolves #793. Tested on my R3A with ROM v920395 over 3.5mm, unable to test HDMI audio out.

MassiveBattlebotsFan commented 6 months ago

3cfb4b9 fixes an issue with the SID mixing in audio_complex.vhdl that would cause audio clicks on overflow.

markkrueg commented 6 months ago

I have tested this with about 20 games and demos so far. It fixes reproducible distortion in the 8580 SID. I have not detected any problems yet.

MassiveBattlebotsFan commented 5 months ago

Superseded by #801.