stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
112 stars 56 forks source link

sound: Poll SN76489 at 125 kHz #208

Closed sarah-walker-pcem closed 11 months ago

sarah-walker-pcem commented 11 months ago

Polling the SN76489 at 125 kHz (the native "update" rate on real hardware, 4 MHz / 32) improves the audio quality of multi-voice sample playback, by significantly reducing the time spent in "in-between" states where not all voices have yet had their volumes updated.

As part of this, the handling of SN write is modified to a poll as part of the 125 kHz update routine. This allows multiple writes with the chip enable held active to be honoured (eg the Castlevania III music conversion).

rjpontefract commented 11 months ago

Thanks for a nice update for the sound code, the speech demo is much better than it was before.

One thing I noticed was that on macOS there's the following build warning:

sysvia.c:87:17: warning: unused variable 'oldIC32' [-Wunused-variable] uint8_t oldIC32 = IC32;

SteveFosdick commented 11 months ago

I have pushed a further commit to fix this warning. The compiler is right, the variable was unused.