Skip to main content
GameDev.net gamedev.net
🔒 Locked

DJGPP - DOS sound programming

Started by petermsmith Nov 18, 2006 at 11:05 PM 3 replies 2.6k views
Original Post
petermsmith
petermsmith
Hi. I have only a little C programming experience (I've been programming in other languages for most of my life, though never very seriously), and I'm trying to program a retro-styled adventure game with DJGPP (Sierra AGI style, if that means anything). I'd like to include sound, but on a very basic level, probably around what the original Nintendo can do--three sine waves and one noise wave, or something like that. What I'd like to do is make a very basic sound library that would run in Windows-based DOS, would detect most standard sound cards, and would play a few simultaneous waves. It wouldn't need to play digital samples or anything; no .WAV files. I'd just like to write my own data files storing frequencies and durations, and write code to load them. I realize I could probably use Allegro or a similar library, but that seems like overkill, for one thing, and also seems sort of like buying a LEGO set and opening the box to find the whole thing already put together--a lot of the pleasure is building the thing up myself. BUT, given the troubled state of Windows/DOS sound relations, and what I think is the idiosyncratic nature of sound cards in general, I realize that this might be very difficult or just more trouble than it's worth. Still, I'm holding out hope. Does anyone have any advice on how to access sound cards, on the most basic level, using DJGPP? Again, all I want to do is initialize the sound card, and then have enough access to start/stop simple looped waveforms. Thanks, Pete
Erkokite
Erkokite
Flights of Fantasy has a lot of info on programming games in DOS, including a chapter of programming the FM synthesizer of a PC. Be warned though, the book uses Borland, so you'll have to port over the asm stuff to DJGPP compatible code.
cnstrnd
cnstrnd
Quote:
Original post by petermsmith
I'd just like to write my own data files storing frequencies and durations, and write code to load them.
You can take advantage of the MPU-401 emulation then send midi messages with just a few outs.

petermsmith
petermsmith
These both sound promising, thanks. I'll pick up a copy of Flights of Fantasy, and in the meantime, can anyone elaborate on using MPU-401 emulation? (Try to dumb it down for me, if possible :) ). Thanks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.