|Dͻ
|D |5The Happy Hacker |D
|Dͼ

^C^1A VIDEO PRIMER
^Cby Joel Ellis Rea

^CInstallment 9:  Introducing the EGA

   The last 8 installments of this series have gone into quite a bit of detail
on the capabilities of IBM's first two video boards for the PC, the Monochrome
Display Adapter (MDA) and the Color Graphics Adapter (CGA), along with their
compatible monitor displays.  The MDA has sharp text but no color or graphics,
while the CGA has both color text and limited color graphics, but the text is
only marginably readable, and then only for short-term use.  IBM (prompted, of
course, by the numerous 3rd party solutions to this problem) decided that a new
video standard was needed.  Rather than use any of the 3rd party de facto
standards that had previously appeared (such as the Hercules Monochrome Graphics
standard, the Plantronics ColorPLUS enhanced CGA standard, or any of the various
"double-scan CGA" [400-line] solutions), they invented a new standard, totally
incompatible with any of these (and thus largely incompatible with their own MDA
and CGA standards), called the Enhanced Graphics Adapter (EGA).

   The EGA's basic features and specifications look pretty impressive at first,
until compared more closely with some of the previous 3rd party standards.  It
can display on an MDA-compatible monochrome monitor, a CGA-compatible color
monitor, or its own standard, the new EGA-compatible color monitor.  On an MDA,
it could display 80x25 text just like the MDA, but with more attributes, inclu-
ding "assignable" attributes.  It could also display a graphics mode on the MDA
of 640x350 pixels with 4 assignable attributes.  But the Hercules could display
720x348 pixels on an MDA monitor, and remained more compatible.  True, the EGA
could display up to 4 such graphics pages, compared to the Hercules's 2.  But 2
is sufficient for "page-flipping animation", the most common requirement for
multiple pages.

   On a CGA monitor, the EGA can display up to 16 colors in 320x200 mode or
640x200 mode.  But it was not fully compatible with the CGA on the hardware
level.  It does not have the Motorola 6845 CRTC chip, so programs which depend
on direct access to that chip or to most of the CGA on-board ports would fail to
work properly.  In comparison, the Planatronics ColorPLUS provided 16-color 320x
200 and 4-color 640x200 graphics modes, and certain enhanced ColorPLUS
compatible boards (such as the ATI Graphics Solution) provided 16-color 640x200
mode, and cheaper than the EGA.  These boards were also reasonably easy to
program using existing BIOS and language features, since the extra colors were
obtained from an extra "page" which could be swapped in or out with a single OUT
to a port.  These also were fully compatible with the CGA.  The EGA has its own
on-board BIOS which must "hook" itself into the machine's ROM BIOS on system
boot. This required a ROM BIOS that could handle this.  IBM had to release new
ROM BIOS chips, and compatibles soon followed up.

   But it is with the EGA-compatible monitors that the EGA really shines!  In
addition to all of the CGA modes, it can display sharper color text by providing
14 scan lines per character row instead of a mere 8, similar to the MDA.
However, in this mode, the EGA will not support a text border color other than
black.   In all 350-line modes, the EGA instead has an "overscan" color, which
barely (and unevenly) surrounds the display area.  The only use I have seen for
this is to set it to the same color as the screen background (when non-black) to
provide the effect of a slightly-larger display with "margins".  It also adds
new modes of 320x350 (not supported by the EGA BIOS) and 640x350, both with up
to 16 colors (640x350x16 colors requires more than the standard 64K of RAM).  In
any video mode, all 17 colors (16 + overscan/border) can be assigned to any one
of 64 possible shades.  For a while, though, IBM made it appear that assignable
palette was only active in the 640x350x16-color graphics mode.

   How is it possible to get 64 shades from a TTL RGBI color monitor?  Well, it
isn't.  What IBM did was to expand the color information from 4 to 6 bits.  They
got rid of the Intensity signal, and instead provided two each (a Primary and a
Secondary) of Red, Green and Blue.  If the Secondary alone of a color was high,
you got a dim version of that primary color mixed into the final shade.  If the
Primary alone was high, you got medium intensity of that primary.  But if both
were high, you got high intensity primary built-in.  This method is called
"RrGgBb", due to the Primary and secondary of Red, Green and Blue.

   Next issue we will discuss more of the capabilities of the EGA, including a
list of the 64 possible shades, and a program that helps you create palettes for
your own programs (as well as letting you view the 64 shades).  Until then, may
your CRT never develop a burn-in!
