3 ms·
In the early 1990s, I was part of a group of high school students who wanted to enter the Finnish demo scene. I was responsible for coding most of our demos in
by metafunctor 4y ago
In the early 1990s, I was part of a group of high school students who wanted to enter the Finnish demo scene. I was responsible for coding most of our demos in 386 assembler. One of the things I wrote was a player for MOD, ST3, and S3M music files, which were similar to MIDI but included WAV samples. The player ran in the background on a hardware interrupt, while other code ran on the foreground to display something on the screen. For most sound cards, the player had to mix the samples in real-time and output a byte to an I/O port at a rate of 22 kHz, for example.
To enter a demo competition, one of the criteria was support for Sound Blaster sound cards. The problem was that we didn't have one and didn't want to buy one because we had already spent all our money on Gravis Ultrasound cards. Fortunately, a member of our group was able to borrow a Sound Blaster for a day. We had to figure out how to add support for it, but we had no documentation and there was no internet to speak of yet.
I figured that it must be possible to add support by sending I/O to the card. We put the card in my computer and started a third-party MOD player that had Sound Blaster support. I traced the execution in a debugger, instruction by instruction, while my friend took notes on all the I/O instructions. After some thought, it became clear that the program was scanning for a Sound Blaster and, if I recall correctly, configuring the card to DMA a particular byte in memory as the sound card output.
I added some hardcoded "OUT" instructions to my player and it worked instantly; my real-time mixer output was played through the Sound Blaster! There was a lot of cleaning up the code to be done, but we were able to add support for the Sound Blaster in just one day.