From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Linear FB ..vs.. Banking??? Date: Mon, 30 Jun 1997 15:00:09 +0100 Organization: None Distribution: world Message-ID: <++6sLFApv7tzEwJ6@talula.demon.co.uk> References: <33b7ac0c DOT 9602160 AT news DOT algonet DOT se> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Lines: 45 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Christian Granström writes: >I have been coding demos on the Amiga since the late 80:s. >To avoid flicker on the Amiga you just keep two buffers >in your videomemory. Then you switch between those during >a vertical blanking. > >On the pc this seems to be a lot more complicated. The method >I used on the Amiga could be compared to banking or...? No. Banking is the term used to describe the method used to access video memory before linear framebuffers came along, where there was only a 64k range of memory addresses (at 0xA0000) mapped to the video card. Since SVGA modes use more than 64k of image data, that 64k aperture was remapped to refer to different areas of the real, larger block of video memory, by setting hardware registers in the graphics card. So first you'd set the bank indicating which 64k block you wanted to access, and then you would refer to the appropriate offset within that 64k block. Slow and clunky, but even today there are some cards that don't support linear addressing so it's still a good idea to support this method of access... >But using a Linear Framebuffer is much easier. But then you >have to move all data from a buffer into the videomemory wasting >a lot of cpu power in larger resolutions. Not necessarily: you could draw the whole thing directly into video ram, and flip between two pages like you would on the Amiga (assuming you have enough video ram, of course: you need a 1 meg card to hold two 640x480 pages). The reason many people prepare the images in main memory is that it's harder to access video RAM (memory protection, and potentially the bank switching and 64k apertures can be a pain), and also that video memory is a lot slower to access than regular RAM. If you are going to be overdrawing the same pixel many times (eg. plotting a background tile, overlaying it with a sprite, and then maybe drawing some parallax stuff or other sprites over the top of that), it can often be faster to do this in main memory and then only copy the finished image (one write per pixel) to video memory, rather than doing the drawing straight to the screen. Which is best depends on exactly what you are doing, and the speed of the bus and graphics card in your machine... -- 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.