VGA & Turbo-C

Gerald Hawkins jerry at starfish.Convergent.COM
Sun Feb 26 18:17:24 AEST 1989


I need help.  I've been trying to program my Vega VGA into mode 13 (320 x
200, 256 colors) with Turbo-C 2.0.  I'm able to easily set the modes
which Borland lists in the reference manual (like 640x480, 16 color), but
they have not apparently made any provision for some of the less-used 
modes.

Looking through the <graphics.h> file, I see #define MAXCOLORS 15, which
gives me at least one clue that they never thought people would use the
256 color modes.

I can place my board into mode 13 by using a BIOS interrupt after
initially setting it to mode 12h with a Turbo-C function (initgraph()).
One point of confusion is that Borland's nomenclature for mode numbers is
different from those used by BIOS, for no apparent reason.  Thanks, guys.
However, when I use the BIOS to reach mode 13h, though the display
reaches the correct mode, some of the TC stuff still thinks it is in mode
12h.  Therefore, getmaxx() will return 639 and getmaxcolor will return
15, so I apparently can't set the palette registers 16 - 255 without
error.

I may be able to use BIOS the whole way and skip most of the TC
functions, but that would be a major pain.  Does anyone have advice?  Am
I missing something obvious here?

Please post or e-mail:


Still thinking of a clever, witty, thoughtful, timely .signature file ...

These opinions are mine.
Jerry.  (jerry at starfish.convergent.COM)
-----



More information about the Comp.lang.c mailing list