Hi David,

> I'm doing some graphics programming, and I want to support many
> different graphics modes, but I need a way of checking to see if they
> are available. Currently I'm working on VGA. How do I check if it's
> available without just trying to enter graphics mode?

I suggest limiting yourself to the common color modes or,
probably even better, checking for VESA and then using the
modes offered there. If you have VGA without VESA, then I
would still assume the most common modes such as 640x480
and 320x200 to be safe :-)

To check for VESA: AX=4e00, int 10.

To check for VGA: AX=1130, int 10 "get font info" helps :-)
CGA does not have it and EGA has fewer fonts than VGA. Maybe
check int 43 (pointer to font) to check for "EGA or better",
but it might be pointless to check "int" 43 in text modes?

The int 11 installed hardware flag word can also help you to
know whether at least EGA is present and the word at 0x40:0x63
tells you whether your graphics are color (3d4) or mono (3b4).

Also, the byte at 0x40:0x87 tells you when less than 256k of
VGA RAM are present etc.

It is quite safe to support only VGA or above, but it is good
to still check whether they are supported before you use them.

I would not go into parsing data structures from 0x40:0xa8 or
anything similarily obscure and detailed, but rather use plain
VGA modes plus whichever VESA modes you detect.

Regards, Eric


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to