id Software was Lazy – DOOM could have had PC Speaker Music!

I’m guessing everyone here has played DOOM before, or at least seen someone else play the game.
It will also be nothing new to most people here that DOOM has specific hard-coded sound drivers that talk directly to the sound hardware.
Now, many PCs did not have a dedicated (let alone supported) sound card for DOOM. Something that people often overlook is the PC speaker driver that comes with DOOM. At most it can only play sound effects (and do so very poorly). Many times it becomes inactive instead of being used.
For a long time, it has been speculated that PC speaker drivers never supported audio because it would have been too resource intensive to run the interface in real time while executing game logic. Now, on a 286, I would completely understand this logic, but on a processor as fast as a 486? There’s no chance it won’t work!Introduction: PC Speaker SNDServer Patch!
I had decided that the only way to answer the question of what if, was to try it. And try this I did:
https://youtu.be/bRHyQPhA_9A

A few weeks ago, I wrote a file format for efficiently playing PC speaker tunes on 32-bit systems, requiring only a few integer operations to transform the data into valid calls to the input/misc/PCSPKR device. format is being called PCSP And it is working like this:
A song is made up of a series of 32 bit tone cells
– 16 bit frequency value in Hz
– a 4 bit period scale (second*10^-scale)
– 12 bit period value

Now, all I had to do to get PC speaker music to work in DOM was to implement a priority mixer for it in SNDServer.
The groundwork for which was already present in the existing AdLib target.

Surprisingly, running the game with and without the patch showed no noticeable difference in speed.

Will this patch become public? Yes, soon.
I don’t feel comfortable publishing this right now as I currently only have the E1M1 soundtrack implemented and I would also like to fix some other issues with sndserver on modern Linux if I get a chance.



<a href

Leave a Comment