First post, by Peter Swinkels
I found a pretty good article concerning playing sound using a Sound Blaster in Quick Basic here: http://www.phatcode.net/articles.php?id=208 and used it to create my own wave file player: https://github.com/PeterSwinkels/Quick-Basic- … in/PlayWav2.bas
I got everything to work fine, but I realized I didn't quite understand the code regarding the DMA controller. I have questions about these code fragments:
OUT &HA, SB.DMAchan + &H4 'Reset the DMA controller by setting the mask
' bit in the DMA mask register and clearing
OUT &HC, &H0 ' any current transfers by sending a 0 to the
' DMA clear register.
What exactly is a mask bit and what does the DMA clear register do? And:
OUT &HB, SB.DMAchan + &H48 'Set the transfer mode to
' "output" with the DMA mode
' register.
"Set the transfer mode to 'output' with the DMA mode register." Why is the code also supplying the Sound Blaster's DMA port?
Also I suspect we have yet another case of not understanding the difference between arithmetic addition and bitwise OR. (Sigh.) Shouldn't bitwise OR be used in those code snippets?
Also what little info I could find online directly relating to the specific DMA stuff I am doing was this: http://helppc.netcore2k.net/hardware/ports - It's very helpful (not):
00A Mask register
00B Mode register
00C Clear MSB/LSB flip flop
All very nice, but no where is it explained what a mask is or what modes there are, etc, etc.
Can anyone help me out with these questions? Thank you.
Do not read if you don't like attention seeking self-advertisements!
Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels