VOGONS


First post, by carlostex

User metadata
Rank l33t
Rank
l33t

I've been for about a year now, been trying to create from scratch a digital MSS3/AIL3 sound driver for the AdLib Gold card. Although there is an ADLIBG.MDI file, which is music only, there has never been a DIG extension (digital) driver for the Gold. I'm glad to say that one is a WIP, and also glad to say that the current status is in a "working" state where it is possible to get digital sound out of the Adlib Gold in some games that use MSS3 library. I will post this driver soon here on VOGONS, as i will probably need help from Adlib Gold / GoldLib owners to test everything i can.

During this i reached a state where i could here sound out of the Adlib Gold in Warcraft 2 (the infamous "Your sound card works perfectly") sound test. However, the sound was loud, crunchy and heavily distorted. And this was the exact SAME SYMPTOM i heard in games like Simon the Sorcerer (DIGPAK library) and Return of the Phantom (internal Microprose sound system). I did not understand what was going on (and i still barely do, why do you think it's taking so much time to finish the driver 🤣), so i started to investigate. Then i found about unsigned PCM and Signed PCM. In a nutshell:

In unsigned PCM (0 to 255), silence is 128, 0 is maximum negative amplitude and 255 is maximum positive amplitude.

In signed PCM (-128 to 127), silence is 0 (zero), -127 is maximum negative amplitude and 127 is maximum positive amplitude.

So apparently (haven't fully confirmed this yet) the AdLib Gold expects signed PCM data all the time. The “silence” value (128) becomes a huge positive amplitude, and the waveform is probably all shifted the other way around clipping and distorting the output. I'm 99.9% sure that this is what happens with Simon the Sorcerer (and Simon 2 as well probably) and Return of the Phantom.

So back to MSS3 again. I was looking into the library and the frequency tables have flags for the DMA buffer sizes and also for unsigned and signed PCM. I had nothing to lose so, i altered that flag for all 8 bit and 16 bit modes for SIGNED data only. And Warcraft 2 sound test worked fine, the sound wasn't distorted anymore 😀

Although DIGPAK already has a PROC that does XOR's the data to make unsigned data sound OK on the Gold, i'm imagining the game never requests it. In theory, it could be forced by calling the routine inside the PlayDIgitalAudio PROC. This should produce a driver that would at least be suitable for Simon 1 and possibly Simon 2.

Return of the Phantom is a different case scenario, where it requires a disassemble of the DIGITAL.PHA internal MicroProse driver and figure out if it would be possible to XOR the data before it reaches its destiny. I'm sure someone would wonder why to bother with all this and just use a Sound Blaster instead, but IMO finding and fixing bugs brings vitality to the hobby.

86Box/PCem AdLib Gold emulation is pretty decent. Maybe that work could be reused to emulate the Adlib Gold in a PicoMEM / PicoGUS and give more people access to experience something that is unobtanium. The MSS3 driver when ready will significantly add more games to the Adlib Gold support list.