From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: HELP: Scrolling modex/13h Allegro Date: Sat, 21 Jun 1997 19:20:33 +0100 Organization: None Distribution: world Message-ID: <+E6MFNAxtBrzEwa9@talula.demon.co.uk> References: <19970620233901 DOT TAA22702 AT ladder01 DOT news DOT aol DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 38 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Quackerz writes: >Hello, I am trying to find the best way to make a scrolling tile based >game. I want low resolution, with a virtual screen about 4 times as large >as the visible twice as big in each dimention. Is it better to use mode x >or 13h? The best way to use allegro? How can you double buffer using >hardware scrolling, or is that not needed? Is there a way to get parallax >effects using hardware scrolling? Any other thingies related to the topic >would be much appreciated. This is really off-topic for this group: rec.games.programmer would be a much better place for such questions. Since you're here, though, I do have a couple of things to suggest :-) The obvious and easy way to do it would be in mode 13h, preparing each frame in memory and then blitting across to the screen. Simple, but can still go at a decent speed on modern machines, and parallax effects are trivial to add. Alternatively you could go with mode-X and hardware scrolling. All your screen updates will take much longer in this mode, but you can probably get away with a lot less of them. The VGA has enough memory to hold your 4x virtual screen in 320x200 rez, so you could maintain the entire map in video ram and just scroll around it. Parallaxing would be very tricky, and hardware scrolling tends to be jerky under win95, but in DOS mode I think that would be very effective. Depending on how much screen space you are updating on every frame, you might be able to get away without any double-buffering, by syncing with the retrace and then moving your sprites sorted top->bottom so the redraw stays ahead of the refresh beam. If you can't draw everything quickly enough for that to work, you could double buffer the entire map in a memory framebuffer (ah, the joys of protected mode! :-) and maintain a dirty rectangle list so you only need to copy the modified portions across to the screen... -- 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.