Mail Archives: djgpp/1999/07/05/05:59:49
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 -