Search code examples
assemblymasmtasmemu8086dosbox

Adding background music to a 8086 assembly game


I'm creating a dosbox game using assembly 8086 as my programming language. I want to add some background music to the game. I'm using tasm/masm assembler.

How am I supposed to do that and what do I exactly need ?

I'm trying to play midi files while the game is running.


Solution

  • DOS doesn't have any abstractions for PCM or MIDI sound, so you need to program the hardware directly. How this is done depends on the hardware.

    Here's a manual I found online about SoundBlaster cards: https://pdos.csail.mit.edu/6.828/2008/readings/hardware/SoundBlaster.pdf

    And here is some information about AdLib cards: http://shipbrook.net/jeff/sb.html

    There are many more resources you can find on Google with search terms such as "AdLib Programming", including YouTube tutorials.