From: aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro and SB05_DJ2 problem Date: Wed, 05 Mar 1997 00:06:24 GMT Organization: Southwest Missouri State University Lines: 27 Message-ID: <331c94e6.815065@ursa.smsu.edu> References: <3319eaa3 DOT 7656395 AT ursa DOT smsu DOT edu> <5feeam$1u2a AT ausnews DOT austin DOT ibm DOT com> <331add31 DOT 3781849 AT ursa DOT smsu DOT edu> <5fh0jb$1u5k AT ausnews DOT austin DOT ibm DOT com> NNTP-Posting-Host: forseti.i54.smsu.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 4 Mar 1997 11:21:15 GMT, steve_chew AT uk DOT ibm DOT com wrote: >Sorry about the confusion - the docs do not mention Allegro, just the timing >issue. SB05_DJ2 appears to be the latest version of the library. > >I am using slightly older versions of DJGPP and Allegro - I will link my program >to Allegro 2.2 and see if this makes any difference. The same problem occurs with Allegro 2.11. Through experimentation, I have narrowed the culprit to the blit() command. I haven't scoured the blit() code to see what could possibly be causing the problem, but the problem goes away if I remove all references to blit(). Since the code in question uses only one blit() command (in a loop), it was easy to positively identify. Here is the interesting part, though. If I enable an Allegro timer interrupt and put a long enough delay between interrupts (80 milliseconds works on my machine), then the problem doesn't show itself. My timer interrupt just increments a counter. My blit() loop checks for a non-zero counter value (which occurs every 80 milliseconds) before blitting it's bitmaps to the screen, then resets the counter to zero. My first guess is that blit() my disable the timer interrupt long enough to make SBLIB miss its timing mark, but a quick grep of the Allegro source doesn't reveal an assembly language cli or a C disable(). I have to check for direct writes to the interrupt ports next. I'll let you know what I find (or don't find).