delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/05/05:59:49

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE3014A4A97@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Scrolling in SVGA
Date: Mon, 5 Jul 1999 11:00:47 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
Reply-To: djgpp AT delorie DOT com

Erwann ABALEA <erwann AT abalea DOT com> writes:
> Hardware scrolling is the fastest available method to scroll the 
> screen.... All you have to do is change the content of 2 registers 
> of the video hardware...

It's a nice theory, but unfortunately I can't recommend doing this
in practice, for two reasons:

- many (at least half) of VESA drivers have buggy implementations
of the scrolling functions, so if you use them, your program won't
work on a lot of cards.

- most SVGA cards (probably about 90% of things made within the last
five years) are only able to do horizontal scrolling in multiples
of four or eight pixels, so you won't be able to do smooth panning
on this hardware.

So in practice, hardware scrolling is not really all that useful.

If you really do want to try it, though, call VESA function int 
0x4F07, or the protected mode scroller function that can be obtained
by calling int 0x4F0A. See the VESA spec for details, or the 
vesa_scroll() function from the Allegro source file vesa.c.

In terms of making your game run fast enough, I would suggest 
using hardware accelerator functions through VBE/AF. This will
only work on cards that have an accelerated VBE/AF driver (you 
can buy these from SciTech, or the FreeBE/AF project on
http://www.talula.demon.co.uk/freebe/ provides a few for some
of the more common chipsets), but it will let you use special
hardware features for blitting from one part of video memory to 
another. When used intelligently, this can easily give an 
order of magnitude speed improvement over any kind of software
drawing.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019