From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Graphics not drawn properly problem. (Allegro). Date: Fri, 20 Jun 1997 20:16:05 +0100 Organization: None Distribution: world Message-ID: References: NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 44 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk >Here's another data point: I get a similar problem with the Trident >card&driver. Sometimes part of a horizontal line that should be drawn in >one place gets drawn somewhere else, making two messes: Missing partial >line, unwanted partial line. ... >It never takes an entire scan line. It certainly doesn't start at the >beginning of a line, and continues to the end of a bitmap's line. This sounds very much like a problem with accidental bank switches. Allegro sets the bank at the start of the scanline, so the first part draws correctly, but then something changes it with the result that the rest of the blit goes to the wrong part of the screen. At the end of the line Allegro checks the bank selection, and (this is the interesting bit!) repairs it before blitting the next scanline. My blit code will normally copy many lines (on average around 64 of them) within a single bank, so the fact that it resets the registers immediately means that it notices the bank has changed, which means my _last_bank cache variables are being updated along with the hardware registers, which in turn means that it is another part of Allegro that is doing the bank switch! Are you sure you aren't doing any drawing from places that could preempt the blit, eg. in a timer interrupt, or displaying a mouse pointer? >It sounds very much like a problem with banks getting confused, but I >can't see why it should be so unpredictable then, and why it should >occur in different programs. I doubt anything I'm doing should corrupt >your bank array in any of them, let alone so many. It's not my bank array that's being changed (if that was corrupted it would stay broken for the duration of the program), but the actual hardware registers in the video card... >It usually occurs in GUI dialogs, but maybe that's just because I've >spent disproportionate time in those. Also, the mouse is usually displayed while running GUI code. Are you 100% sure you aren't failing to turn it off somewhere? If you weren't, this is exactly the effect I would expect to see. Is there any correlation between moving the mouse and the problem showing up? -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.