Mail Archives: djgpp/1998/10/26/06:04:18
Toni Rasanen writes:
> Okay, my LFB and banked flip() -functions work. The problem is that
> while linear flip is rather fast, doing that in banked mode is
> really, REALLY slow, probably because code has to switch into
> real mode 6 times during the whole flip-operation.
Very true. VESA 1.x bank switching is painfully slow, and not
a good thing to be using if you have any possible alternatives.
> The question is, is there a way to change video pages in
> protected mode (VESA 1.2), or some other way to do it _fast_?
No. VESA 1.x was designed for use by 16 bit programs, and doesn't
work at all well from 32 bit protected mode. This is the whole
reason why VBE 2.0 was invented, to correct those performance
problems!
In addition to using linear buffers and VESA 1.x bank switching,
there is a VBE 2.0 mechanism for doing bank switches entirely
in protected mode (call VESA function 0x4F0A to get a relocatable
32 bit bank switch routine, which you can copy into your own
address space and then call directly). This is still not as fast
as using a linear mode, and no good if the user doesn't have a
VBE 2.0 driver, but it gives a massive speed improvement over
VESA 1.x and is a nice option for hardware that is physically
incapable of using linear modes (such cards are now becoming
quite rare, but there are still a few around).
When it comes to doing fast bank switches on machines that don't
have a VBE 2.0 driver, I'm afraid you are out of luck. You can
write specific bank switching code for each individual chipset,
but that isn't really practical. Your best bet is IMHO to just
put up a large warning box telling the user that things will
be very slow, and advising them to install a better driver.
If you are interested in doing some work on drivers of your own,
I would urge you to think about contributing to the FreeBE/AF
project (http://www.talula.demon.co.uk/freebe/). This is an
attempt to provide a range of free VBE/AF video drivers, which
are external modules that provide basic mode setting functions,
both linear framebuffer and fast protected mode bank switching
routines, and can optionally also implement a range of hardware
accelerated drawing operations. This driver spec was designed
by SciTech software and is implemented by their Display Doctor
product, but they have since moved on to a different
(non-public) driver design for their more recent work, but
FreeBE/AF is still aiming to make a range of free VBE/AF
drivers available for people to use. At the moment we have
fully accelerated support for the ATI Mach64, Cirrus 54x, and
Matrox Millennium/Mystique, and a Trident TGUI driver by SET
is sitting on my hard drive at home just waiting to be
uploaded :-) Allegro is currently the only major system that
can make use of these drivers, but it would be great if you
wanted to support them from your code, and maybe think about
contributing support for some more video cards...
Shawn Hargreaves.
- Raw text -