[alt.msdos.programmer] VGA Memory Map & Base Addresses

raymond@ptolemy.arc.nasa.gov (Eric A. Raymond) (08/31/89)

Could some kind soul enlighten me on the VGA memory layout?  More
specifically, the 640x480x2 graphics mode (also a MCGA mode).

For instance, CGA 640x200 memory is split into two blocks.  One at
B800 has every other line (odd).  One at BA00 (me thinks) has the other
every other line (even).  So it can be described by these two base
adresses.

So what are the base adresses of the VGA 640x480x2 mode.  Is it
linear (No even/odd scanline stuff)? Me thinks it starts at A000, but
are there any other base addresses (for odd lines).

FYI, this even/odd stuff is to simplify interlace logic on the
graphics card.  Is this used on the VGA?
-- 
Eric A. Raymond  (raymond@ptolemy.arc.nasa.gov)
G7 C7 G7 G#7 G7 G+13 C7 GM7 Am7 Bm7 Bd7 Am7 C7 Do13 G7 C7 G7 D+13: Elmore James

ODX@PSUVM.BITNET (Tim Larson) (08/31/89)

In article <2117@edison.ptolemy.arc.nasa.gov>, raymond@ptolemy.arc.nasa.gov (Eric A. Raymond) says:
>
>Could some kind soul enlighten me on the VGA memory layout?  More
>specifically, the 640x480x2 graphics mode (also a MCGA mode).
>
...several lines deleted ...
>--
>Eric A. Raymond  (raymond@ptolemy.arc.nasa.gov)
>G7 C7 G7 G#7 G7 G+13 C7 GM7 Am7 Bm7 Bd7 Am7 C7 Do13 G7 C7 G7 D+13: Elmore James

This is the information given in The Programmer's PC Sourcbook, by Thom Hogan,
Microsoft Press, (c) 1988.

For High Resolution Graphics Display (640x480 all points addressable, mode 17)

Buffer Start: +------------------------+
   A000:0000  |Upper-left              |
              |corner                  |
              |             Lower-right| Buffer End:
              |                  corner|  A000:95FF
              +------------------------+
   A000:9600  |     MEMORY NOT USED    |
              |                        |  A000:FFFF
              +------------------------+
Data stored as follows:   * Pixels are stored in sequential order
                          * Highest numbered pixel is LO bit in byte
                                       +---+---+---+---+---+---+---+---+
                            bit number | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
                                       +---+---+---+---+---+---+---+---+
                          pixel number | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
                                       +---+---+---+---+---+---+---+---+
                          * No pixel attributes other than ON and OFF

Note that mode 18 (640x480x16) is mapped identically, except with four bit
planes all located at A000:0000.  The VGA hardware is used to manipulate
these planes.

BTW: The above mentioned book is a real life-saver for problems like these.
It consists simply of about 500 pages of tables designed for the PC program-
mer.

Hope this helps.
-Tim Larson
odx@psuvm.bitnet