Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!dfoster From: dfoster@jarthur.Claremont.EDU (Derek R. Foster) Newsgroups: comp.os.msdos.programmer Subject: IBM Sound Message-ID: <8919@jarthur.Claremont.EDU> Date: 7 Oct 90 02:40:46 GMT Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 36 I am in the process (have been for the past ~2 years, actually) of writing a video game for IBM PC's in Turbo C and assembly language. By now, everything in my game pretty much works the way I want it to, with one major exception: sound generation. I want to be able to have multiple sounds from different events at the same time. (i.e. aliens firing vs. explosions vs. other stuff.) I am currently using the Turbo C sound() function and a complicated set of routines within my code to accomplish this, but I find this at best to be unsatisfactory, since this means that the sounds are dependent on the speed of the various parts of my program as it runs. (The sound-update routines only get called every so often, and the amount of code between calls may vary.) I am also very limited in what sorts of sounds I can generate, since I can only change the frequency very infrequently :-). I would _LIKE_ to have an interrupt-driven routine (perhaps on the clock-tick or a similar interrupt) which I could use to update the speaker at regular intervals, without having to bother the rest of my program about it all the time. For this I need a relatively frequently occurring interrupt, which I don't know how to generate, and I need to know which precautions need to be taken to make sure nothing gets screwed up in the system when I commandeer such an interrupt. None of the books I currently have seem to help much in this respect. I have heard tales about BASIC speeding up some sort of clock interrupt for its background music generation commands, but no details were forthcoming. Is there anyone out there who has done video-game style sound generation? Am I on the wrong track completely? Is there a better way? I am obviously not the first person to encounter this sort of problem. How have other people solved it? Is there an "accepted" way to do this? Thanks in advance! Derek Riippa Foster P.S. I would LOVE assembly-language code.