First post, by superfury
I've adjusted my emulator Disney Sound Source emulation (with triple buffering on the Sound Source(CPU-locked buffer for the CPU for detection etc., and double buffering for rendering it) and Double buffering on the Covox Speech Thing).
1. The output from the Sound Source adds to it's 16-byte FIFO. The output from the Covox Speech Thing sets it's current value to render.
2. The timer (tickssourcecovox) renders sound source data(from primary buffer) and covox data(from current values) to the secondary(sound source) and primary(covox) buffer.
3. The timer (tickssourcecovox) moves sound source samples and covox data from the secondary(sound source) or primary(covox) buffer to the rendering buffer when enough samples are collected(__SSOURCE_TRESHOLD and __COVOX_TRESHOLD samples). These extra buffers are used, so that the CPU emulation and sound renderers won't suffer from the sample rendering every sample(instead of multiple samples, see the threshold) as much.
This is the source code:
https://bitbucket.org/superfury/x86emu/src/5e … rce.c?at=master
Is this correct? Also I seem to notice that Dosbox doesn't check control bit 4 being set, which needs to be set according to the manuals I can find on the Sound Source?
Edit: I've optimized the code a bit:
https://bitbucket.org/superfury/x86emu/src/80 … rce.c?at=master
Removed unneeded defines and optimized loops and variables.
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io