Sunday, July 9, 2023

Tandy Video vs. EGA - Battle of the 16-colors Graphic Adapters

When the PC was first released in 1981, IBM designed the Color/Graphics Adapter (CGA) card, a card that could display 16 colors on a special high quality RGBI monitor through a digital output.  While CGA could only display all those 16 colors on the screen at the same time in text modes absent trickery, IBM's 16-color digital RGBI video display standard proved quite durable.  IBM used the same color standard in its IBM PCjr. video graphics adapter in 1983 and returned to the standard the next year in the form of its Enhanced Graphics Adapter (EGA).  When Tandy released its Tandy 1000, which was designed as a clone of the PCjr., it included the graphical capabilities of the PCjr and would later expand on them.  The Tandy Graphics Adapter (TGA) really popularized 16-color full screen graphics but by the late 1980s most games would support Tandy and EGA graphics.  So which is better?  In this blog article we will attempt to answer this question.

TGA's Basic Capabilities

TGA is always integrated on a mainboard and only found in the Tandy 1000 series.  It would be extremely difficult to implement TGA on a non-Tandy 1000 as it has special BIOS routines and games use various detection methods requiring the Tandy BIOS.  TGA as originally found in the Tandy 1000s could support a variety of display modes (see below).  It supported 200-line RGBI monitors and composite video monitors.  There are two revisions of TGA, the TGA as found in the Tandy 1000, A & HD has a few missing features compared to the "Big Blue" revision found in the EX, HX SX and TX.

In 1988 Tandy made an improvement in their video chip known as the Tandy Graphics Adapter II (TGAII) to be able to display 640x200 16-color graphics.  Alternatively TGAII could, when connected to a high resolution digital monochrome display, support 80 column by 25 line Monochrome Display and Printer (MDA) compatible text with a 9x14 text cell size and 720x348 monochrome Hercules-compatible graphics.  TGAII-equipped computers do not support composite video output.

As DMA was an optional feature on the  Tandy 1000, A, HD, EX & HX, DRAM refresh on the mainboard in these systems is handled by TGA.  128KiB or 256KiB of mainboard memory is shared between the video controller and the CPU.  The original TGA revision can use up to 128KiB of video memory but "Big Blue" and TGAII can use use up to 256KiB.  The amount of video memory a program requires depends on the graphics mode and number of graphics pages used.  DuckTales: The Quest for Gold uses 320x200x16 graphics with two pages, requiring 64 KiB of video memory for a frame buffer.

As consequence of video being memory shared with conventional memory. many games have higher memory requirements when run with TGA video than with other video adapters.  As a consequence, many games will say something on their boxes like "512K required, 640K for Tandy."  The TX, TLs and RLs have a feature to reserve 128KiB of memory solely for the use of video memory via a memory upgrade.

While IBM's CGA BIOS text modes supported 8x8 text cell sizes, Tandy's BIOS text mode supported 8x9 text cell sizes by default.  This gives Tandy text modes the equivalent of 225 lines of vertical resolution in text modes.

TGA is found in the 1000, A, HD, EX, SX, HX & TX.  TGAII is found in the TL, SL, TL/2, SL/2, TL/3, RL & RL-HD.  Only the 1000, A, HD & SX have a light pen connector present and I cannot find a light pen which uses this style of connector.  The Tandy 1000 RLXs and RSXs do not support TGA, they use VGA.  

EGA's Basic Capabilities

IBM's EGA came on an 8-bit expansion card and could be plugged into any PC with an appropriate ISA expansion slot, whether 8-bit or 16-bit.  The card's capabilities were dependent on the amount of memory on the card and the type of monitor to which it was connected.  The base card came with 64KiB of RAM and a daughterboard upgrade added 64KiB and could be expanded with 128KiB for a total amount of 256KiB of RAM available to the card.

The capabilities of EGA depended on the type of monitor connected to it.  It could use the same 200-line RGB monitors like the IBM 5153 Color Display or the Tandy CM-11 High Resolution RGB Monitor that CGA and TGA used.  It could use a high resolution digital monochrome monitor like the IBM 5151 Personal Computer Display, which limited EGA to two monochrome compatible modes.  Finally EGA could use a special 350-line IBM 5154 Enhanced Color Display which had backwards compatibility for 200-line modes.  There are dipswitches and jumpers on most EGA cards to choose the correct capabilities for the attached monitor.

When EGA is connected to a 200-line monitor or a 350-line monitor in 200-line compatibility mode, the text cell size it uses is 8x8.  When EGA is connected to a monochrome display, the text cell is 9x14.  A 350-line monitor being used with an EGA card at its full capacity will show 8x14 text cells.  The high resolution 640x350 graphics mode can display 16 colors from a palette of 64 colors using a 2-bit RGB scheme (RrGgBb).  128KiB is required for full color support with the 640x350 graphics mode. Shareware games from Apogee & Softdisk will require the full 256KiB to show their graphics properly even though they only use the 320x200 16-color graphics mode.  SimCity is the most well-known game that supported the 350-line 640x350 color mode. EGA will disable modes which the attached monitor cannot display.  While IBM's EGA monitor will not show anything other than the CGA 16 colors in 200 line modes, other monitors may not be so limiting.

EGA has a pair of RCA jacks on its card but no circuitry to drive a composite video signal.  A feature connector is present on the card for a daughterboard which could supply composite output, but IBM never released one and I cannot find any third party which did.  It supports a light pen via a header on the card.  EGA has a BIOS extension ROM to enhance the video BIOS routines found in the PC, XT and AT BIOSes.

Video Mode Support

The chart located here gives an excellent overview of official IBM BIOS modes and which card supports which modes.  TGA supports all PCjr. modes and TGAII adds MDA Text, Hercules Graphics and 640x200 16-color modes.

Palette Registers

Even though EGA and TGA both only support 16 colors, both have 16 palette registers which can be altered to change the order of those colors.  A byte in video memory does not display color directly in graphics modes, it maps to a palette register.  The way these palette registers are accessed are unique to each adapter.  The BIOSes of these adapters program the palette registers so that when a CGA modes are called, the correct colors will be displayed (at least TGA does).  A game can be EGA or TGA aware and program these registers to show color combinations outside the CGA's capabilities without having to support a new mode.

Linear vs. Planar Video Memory

CGA and TGA use a linear memory structure.  One byte of video memory defines the color of two or four adjacent pixels on a line.  1/2 of a byte is a nybble or 4 bits, and each set of 4 bits points to one of the 16 palette entries of the TGA in 16-color modes.  CGA and TGA graphics modes have an interleaved memory structure where every other line is located 8KiB later in the memory than the previous line in 16KiB modes and every fourth line is located 8KiB later for 32KiB modes.  

EGA uses a planar video structure with its own 16-color graphics modes.  In an EGA card the memory is split into 4 bit planes, one for each color attribute.  A single byte will set one of the color attribute bits  (R, G, B, or I) for eight pixels.  You must write 4 bytes to the video memory to draw a single pixel completely, but you can draw up to 8 pixels with those 4 bytes.  EGA retains the linear memory structure for the CGA compatible modes.  

Multiple Video Adapter Support

Except for the 1000, A & HD, TGA will disable itself if the system detects another graphics adapter is installed in the system.  This includes MDA, Hercules, CGA, EGA or VGA.  For TGAII systems there exists software that will allow you to switch between an installed EGA or VGA and the built-in TGAII.

EGA has the ability to coexist with a second video adapter in the system.  The adapter can be MDA, Hercules or CGA.  There are dipswitches on the EGA card to indicate which adapter is attached.  When a CGA is also in the system, EGA is limited to monochrome modes.  When an MDA or Hercules is attached, EGA is limited to color modes.  The switches also let you determine whether the EGA is the primary or secondary adapter in the system.  The primary adapter is what the system uses on boot, you can change the active adapter using the DOS MODE command, a program using a video mode not supported by the primary adapter should switch to the secondary adapter.  

Lesser-Used Features

Both TGA and EGA can use an IRQ to signal vertical retrace to the CPU.  TGA uses IRQ5 and EGA IRQ2.  IRQ5 was also used by default by 8-bit MFM hard disk controller cards, so vertical retrace was not often used by TGA-supporting games.  Ghostbusters is a notable exception, but that was a self-booting program and only compatible with the Tandy 1000s and IBM PCjr.  Gauntlet with EGA mode requires an IRQ2 at 60Hz, something VGA cards do not provide.  My otherwise highly-compatible Everex EV-657B EGA card does not work properly with Gauntlet, I needed to use the IBM card.  IRQ2 was used as the cascade for IRQs 8-15 in AT-class PCs, so its usage was similarly unpopular.  IRQ2 is also used by the Roland MPU-401 interface but it was not commonly used with games either (It Came from the Desert and Legend Entertaiment games require a functional MPU-401 IRQ2 for Roland MT-32 support).  

TGA does not have any hardware features that allow you for horizontal per-pixel screen scrolling.  All Tandy video adapters after the one in the original 1000, A and HD have a hidden ability to scroll the screen vertically by line.  The Big Blue TGA revision also has a functional interlace mode, allowing 320x400 16-color and 640x400 4-color graphics at 30Hz.  The interlace ability was lost in TGAII.

EGA has many hardware features that were rather obtusely described in its Technical Reference.  These included the ability to scroll the screen horizontally per pixel and vertically per line and to split the screen vertically into scrolling and fixed areas.  These features went almost wholly unused until 1990 with Beverly Hills Cop, Rastan & Commander Keen 1: Marooned on Mars.  It should be noted by 1991 that the world was generally using VGA cards but EGA had something of an "Indian Summer" from 1991-1993 due to shareware companies like ID Software and Apogee selling shareware games that only required an EGA card.  

Backwards Compatibility

Almost all PC games prior to 1984 and many thereafter were written for CGA cards and often used hardware features specific to CGA that went beyond what the PC BIOS supported.  TGA was designed to be fully backwards compatible with CGA in hardware and Tandy almost totally succeeded in that goal.  TGAII is slightly less compatible than TGA due to differences in how its CRTC works and color composite video support was dropped.  TGA composite video was rarely able to show colors intended by the developer but it is easier to find a monitor to display the video and composite capture devices are cheap.  Hercules graphics of TGAII will fail in some games because they detect a Tandy and do not fully adjust their code for Hercules.  Sierra's AGI games will not display properly with the built-in Hercules graphics capabilities of TGAII.

EGA's compatibility with CGA is only guaranteed when using BIOS features.  Games that only support 4-color graphics can be "EGA aware" and use a code path compatible with EGA hardware, but if they are not and use something other than the basic Red/Green/Brown or Light Cyan/Light Magenta/High Intensity White palettes, you may not see the intended colors.  640x200 graphics mode cannot change its foreground color.  Games that manipulate the CGA CRTC for modes like 160x100 with 16-colors won't work.  

Strengths and Weaknesses

TGA's biggest strength is its compatibility with pretty much almost any game published for the PC platform during the 1980s.  This is of course tied to its computer platform, the Tandy 1000, which was always a target for PC game makers during the late 1980s.  While TGA and EGA were released in 1984, EGA was very expensive for the first few years of its life.  Only when EGA clone cards became widely available for less money than IBM's offering did EGA gain significant traction in the PC gaming space.  Even in 1987 there were many PC games still being released which only supported CGA or TGA.

EGA's biggest strength is, that as an expansion card, it is not limited to a narrow range of CPU speed.  The Tandy 1000 with TGAII maxed out at a 10MHz 286 officially but an EGA card can be installed in a faster 286, 386 or 486 computer.  I am aware there are accelerators which can fit into the 286 socket in the Tandys but they tend to bring their own issues with them and are rare.  

Moreover, VGA cards are almost 100% compatible with EGA-supporting games.  Games which will fail on an VGA card are few, they include Gauntlet, Jr. Pac-Man & Beverly Hills Cop.  A VGA monitor can display the 350-line EGA graphics mode without an expensive 350-line TTL monitor.  350-line monitors were expensive during EGA's lifespan and are expensive today as a result.  When you could draw one set of graphics that would cover both TGA and EGA, that one significant reason why the vast majority of EGA games only support 320x200 16-color graphics.  

In the early years, there were at least a few dozen games that supported TGA but not EGA or had support for more colors.  By the 1990s the situation had reversed itself with dozens of shareware titles supporting EGA but not TGA.  Anything from ID Software or Apogee that supported 16-colors was an EGA (and VGA) exclusive.  Also the Sierra games which were ported from the PC-8801 (Thexder, Silpheed, Fire Hawk, Zeliard) look much closer to how those games originally looked on the PC-8801 and PC-9801 thanks to EGA's 640x200 16-color mode.  Falcon A.T. and Sorcerian are games from this timeframe require an EGA card.  TGAII's 640x200 16-color mode had no BIOS support and was seldom supported in games and when it was those games supported the equivalent EGA mode as well.

Speed

At the same clock speeds, TGA may be faster than EGA in many games.  EGA cards are limited to an 8-bit data path but TGA uses a 16-bit data path to memory.  Originally this may have been developed to offset the performance penalty that came with the CPU and Video sharing memory, something that plagued the PCjr.  Sierra's SCI engine games are much more playable on an 8MHz 286 Tandy than with an IBM AT at 286 with EGA.  

One issue that affects graphical processing is whether a game's drawing routines were optimized for Tandy's linear interlaced layout or optimized for EGA's planar layout.  16-color graphics are usually stored in a format suited to one adapter or the other and have to be converted to the other, causing the CPU to spend extra time performing the conversion.

3 comments:

  1. Tandy Video vs. EGA what was better for 80s games?

    ReplyDelete
  2. is the CM11 the best for Tandy Graphics

    ReplyDelete
  3. Very interesting! I had a Tandy 1000 SX and I can remember playing Sierra games I think up to Space Quest 4 and Kings Quest 5. I was a very lucky boy back then to have a Tandy computer.

    ReplyDelete