Jump to content
  • Advertisement
Sign in to follow this  
petermsmith

DJGPP - DOS sound programming

This topic is 4409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!