First post, by superfury
I've implemented a custom version of Dosbox SVN Gameblaster.cpp into my UniPCemu, but for some reason I get pretty noisy sound, instead of the normal sound Dosbox produces.
Anyone can see what's going wrong here?
https://bitbucket.org/superfury/unipcemu/src/ … ter.c?at=master
The register interface has been adjusted to work with UniPCemu. The sound producing code is partly Dosbox's and partly based on my OPL2 signal generation.
Anyone can see what's going wrong there?
A little recording of UniPCemu's Game Blaster emulation playing the CMS-SONG1 demo:
https://www.dropbox.com/s/kgeogsgx2c2tzwi/CMS … rding1.wav?dl=0
The demo playing the recording (within the archive, there's a CMS-SONG1.zip which contains the demo.bat, which is ran while recording the audio):
https://www.vogonsdrivers.com/getfile.php?fil … =16&menustate=0
Is this simply the amplifier amplifying too much? The samples generated should about be the same as Dosbox's, but it's amplified by the AMPLIFIER constant (__GAMEBLASTER_AMPLIFIER). This assumes however, that the samples, as used by the Dosbox renderer, are actually 8-bit PCM samples. Is this correct?
Edit: Just looked at the Dosbox mixing of the samples. It's adding the two channels, then clipping the samples to 16-bit range. So that means the samples aren't 8-bit samples, but 15-bit samples(which, when combined, give a full 16-bit sample)! So the range of amplification should be (SHRT_MAX/2) instead of 256.0. Is that correct?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io