Mail Archives: djgpp/1999/08/11/09:45:31
Michael Stewart writes:
> Snew Flat requested _easy_to_see_thru_ routines which I interpret as being
> simple routines, which unfortunately mine currently are not (hopefully
they
> will be soon).
The problem with asking for easily understood VESA code is that there
isn't really any such thing. You need to deal with a lot of protected
mode memory mapping issues, differences between each version of VESA,
possible variations in hardware capabilities, and the fact that many
VESA drivers are extremely buggy, so you need to treat them with
extreme caution.
It is of course possible to write a single page, easily understood
routine to set a VESA mode and plot a pixel, but only if you don't
bother with things like querying the driver for the mode list and
supporting different combinations of read/write windows and bank
size/granularity. The end result is a piece of code that has been
optimised so far that it doesn't actually work properly, which isn't
really all that much use.
There are several tutorials about VESA programming with djgpp, which
you can find on www.delorie.com (the User's Guide has a section that
I wrote, and there are other links in the documentation section).
These are accurate and fairly complete, but you'll need to read
them alongside the official VESA spec to get all the details. Or
look at the source code to something like Allegro: yes, that's a
large and complex file, but all those special cases are included
for a reason (most often to work around particular bugs in some
hardware). If you take out any of that complexity, that means one
more card that your program won't work properly on...
Shawn Hargreaves.
- Raw text -