VGA Alphanumeric Row Modes

The VGA is capable of displaying 12, 14, 21, 25, 28, 43, or 50
rows of characters in alphanumeric video modes.  The only VGA
row modes commonly in use are 25 and 50.  The 12 and 14 row
modes have largely been ignored, probably because most
programmer's are either unaware of their existence or think
people want to see more, not less.  The 21 and 28 row modes have
also largely been ignored, probably because most programmer's
are unaware of their existence or because of their closeness to
standard 25 row mode.

Of particular interest are the 12 and 14 row modes in 40
columns.  Because the characters are much larger than normal,
people with impaired vision could benefit significantly.

I have never been able to stand 43 or 50 row modes, because the
text is just too small.  I find that I like 28 rows in 80
columns, because I see 12% more than 25 rows in 80 columns
without a significant reduction in character size.

An interesting thing about these non-standard row modes is that
there is practically no reason not to support them.  They're
easy to program and because they're alphanumeric modes and not
graphics modes they're fast.  Supporting 40 columns is generally
more of a problem, because error messages, prompts, status
lines, etc., may be longer than 40 columns and have to be
truncated or dealt with otherwise.

How Its Done

The different row modes are possible because you can control the
height of the character matrix in which characters are
displayed, because the VGA can set up alphanumeric modes with
different vertical resolutions, and because the ROM BIOS
contains several character definition tables.  For example, you
can display 28 rows by setting 400-line vertical resolution and
displaying 8-by-14 characters.  Note that 400 divided by 14 is
28 plus a remainder.  See Figure 1 for all possible
combinations.

You may have seen a problem that some programs have displaying
43 rows on the VGA.  The problem occurs because the program was
written for the EGA with a 350-line display.  The program
displays 8-by-8 characters, which translates to 43 rows for
350-line vertical resolution, but 50 rows for 400-line vertical
resolution.  The program assumes it is displaying 43 rows, so on
the VGA with 400-line vertical resolution you get 43 rows with
14% of the display unused.

To display 8-by-14 characters, you load 8-by-14 character
definitions into character generator RAM and then program the
CRT Controller to display characters that are 14 pixels high.
On the VGA, you can perform both these tasks by calling INT 10H
function 11H.  You can set the video mode's vertical resolution
by calling INT 10H function 12H (with BL = 30H) before calling
function 11H.

If your program changes the number of displayed character rows,
it should call INT 10H function 12H (with BL = 20H) to select
the alternate print-screen routine.  This routine is
functionally equivalent to the one in the motherboard BIOS (the
default) except that it uses the Video Display Data Area value
ROWS to determine how many rows to print.  (The motherboard BIOS
routine always prints 25 rows.)

The Code

The function gettype() in Figure 3, in addition to returning
whether or not you have a VGA, returns the number of displayed
character rows (specifically the Video Display Data Area value
ROWS plus 1).  I return the number of displayed character rows,
because this value can be very important if you are going to
support non-standard row modes.

The C code in Figure 2 was compiled with Microsoft C 5.1, the
assembly language code in Figure 3 was assembled with MASM 5.1,
and the resulting object modules were linked together to form an
executable module called VGAMODE.

You can use VGAMODE to set your VGA to any row mode in either 40
or 80 columns.  For starters, I recommend you try one extreme
and then the other, i.e. "VGAMODE 1 12" (12 rows in 40 columns)
and then "VGAMODE 3 50" (50 rows in 80 columns).  Newer versions
of DOS support all VGA row modes and also 40 columns, but many
programs do not.  One program that does, is Vernon D. Buerg's
shareware program called LIST.

Jack Whitney

------------------------------------------------------------------------------

Figure 1 - VGA Alphanumeric Row Modes

Row Mode     Character Matrix                Vertical Resolution
             (width by height in pixels)
12           8-by-16                         200-line
14           8-by-14                         200-line
21           8-by-16                         350-line
25           8-by-16                         400-line
28           8-by-14                         400-line
43           8-by-8                          350-line
50           8-by-8                          400-line
