[comp.sys.ibm.pc.hardware] writing to super-VGA in higher modes

md@sco.COM (Michael Davidson) (01/13/91)

In article <1991Jan11.172806.2477@ctr.columbia.edu> david@ctr.columbia.edu (David Freidlander) writes:
>We are addressing a VGA board directly from memory.  We have 1 MB of
>memory for display, and we are trying to put up a display at 8 bits
>per pixel.  When the length of the image is more than 64K, we find
>that the second 64K does not begin displaying at the proper place, but
>at some random place in the window of the first 64K.  We're sure some
>of you have solved this problem.  Would you be good enough to share
>your solution with us?

Unfortunately the horrors of the PC/AT "architecture" mean that only
128k of address space is available for screen memory - this is the
area between A0000 and BFFFF. Typically only 64k of this address space
is used in graphics modes - the region between A0000 and AFFFF.

All of the SVGA cards use some form of "bank-switching" to map parts
of their screen memory into this 64k window.

There is no "standard" way of controlling this bank switching - all of
the SVGA chip-sets do if differently.

I *strongly* recommend that you get hold of the following book:

	Programmer's Guide to the EGA and VGA Cards.
	Second Edition
	Richard F Ferraro
	Addison-Wesley
	ISBN 0-201-57025-4

Note - it is important to get the *second* edition which has an extensive
section on programming SVGA cards.

So far this is the *only* book that I have seen that describes in
detail how to program SVGA cards including how to detect which card
is present and how to do bank switching in the extended modes.
It covers chip-sets from ATI (VGAWonder), Tseng ET3000 and ET4000
(Orchid Prodesigner, Sigma VGA Legend and STB), Paradise, Trident 8800
and Trident 8900, Chips & Technologies and Video 7.

Overall the book is excellent - it's only flaw is that there are quite
a lot of typos in the source code examples - most of these will be
obvious to any competent C programmer, but be careful when typing
in the code. In particular whoever typeset the source code was rather
fond of adding extra semi-colons - this example from page 875 is
one of many .....

        if (new_value != 0);  return(2);
                           ^
                           ^

Despite this, the book is absolutely invaluable to anyone who wants
to program SVGA cards in their extended modes.