From: "DeHackEd" References: <349EB8ED DOT DCC54887 AT inlink DOT com> Subject: Re: Help with Allegro Date: Mon, 22 Dec 1997 19:55:26 -0500 Lines: 33 Message-ID: <#Qh$4zzD9GA.347@upnetnews02.moswest.msn.net> Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Jason Eastham wrote in message <349EB8ED DOT DCC54887 AT inlink DOT com>... >Hello, > > I am making a program using DJGPP and Allegro to play MIDIs while >displaying a Christmas pic. My problem is that I cannot figure out how >to check for a keypress while the MIDI is playing. All the attempts >that I have made have either not read any input at all, or made a >repeating drum-like sound in the background. A copy of my code is >below. > > You have a do-nothing loop who's test is to see if the MIDI is done playing. while (midipos != -1) { } Why not make it something like this? while (midipos!= -1) { if (keypressed()) break; } And one thing - if your code is to be given around, considder appending the files to the EXE, and having install_sound() autodetect the card. If you won't be using sound, don't give it a digital card. Anyway... and another crt0.o references crt1.o, and it references main(), which no library has. Oh dear...