Hercules Graphics Card
The Hercules Graphics Card (HGC) is a computer graphics controller made by Hercules Computer Technology, Inc. that combines IBM's text-only MDA display standard with a bitmapped graphics mode. This allows the HGC to offer both high-quality text and graphics from a single card. The HGC was very popular, and became a widely supported de facto display standard on IBM PC compatibles connected to a monochrome monitor. The HGC standard was used long after more technically capable systems had entered the market, especially on dual-monitor setups.
|Entry-level||Hercules Graphics Card|
|Mid-range||Hercules Graphics Card Plus|
|High-end||Hercules InColor Card|
|Successor||Enhanced Graphics Adapter|
The IBM Personal Computer was launched in 1981 with the Color Graphics Adapter (CGA) expansion card and the Monochrome Display And Printer Adapter. The CGA offered two basic operating modes: 320×200 pixel (or 40×25 character) low resolution or a 640×200 (or 80×25 characters) pixels high resolution mode. While the low-resolution mode was very comparable to 8-bit home computers of the era, the higher-resolution mode offered a fair advance, used with a suitable RGBI (or RGB) monitor (such as the IBM 5153 Personal Computer Color Display). Still, since by design CGA was able to be connected to cheap composite monitors and even to home TVs (via RF modulator), CGA was limited in resolution; its text modes has a character box size of 8×8 pixels, which made text fairly rough-looking, especially in the vertical direction, which had only one pixel row for descenders.
Simultaneously announced, The Monochrome Display and Printer Adapter (MDPA), often shortened to Monochrome Display Adapter (MDA), which did not support pixel-addressable graphics of any sort, offered a high-quality 80×25 character mode, having a relatively high pixel-resolution of 720×350 (character box size 9×14), that could be used on a monochrome monitor (originally, specifically the IBM 5151 Personal Computer Display).
Due to a continuous single-color phosphor, a digital connection with separate video and sync, and a signal format making no compromises for compatibility with lower resolution (e.g. composite NTSC) displays, monochrome monitors were sharper than CGA color. The MDPA also included a Centronics compatible parallel port for printers, which the CGA did not. Furthermore, a similar printer port was not originally available from IBM on any other card for the IBM PC.
Many imitations were available, but many of them did not include the parallel port, so the video standard became known as "MDA", for "Monochrome Display Adapter", since MDPA was not applicable.
An internal IBM publication described MDA's text output as "beautiful" and CGA's text output as "rough". For graphics and highest-quality text on one PC, it needed both video cards with two monitors. Most games only supported CGA, while a few extremely rare business applications only supported MDA. Since business software at the time was text based, most of it could run on either. Most software that used any specific capabilities of either would simply check the system settings for monitor type (via Int 11h), or check the current video mode (via Int 10h), to configure itself appropriately.
The Hercules Graphics Card was developed in 1982 by Van Suwannukul, founder of Hercules Computer Technology. The system was created by Suwannukul initially so that he could work on his doctoral thesis on an IBM PC using the Thai alphabet, as Thai was his native language. In 1984, its list price was US$499 (equivalent to $1,203 in 2018), although it was often sold for less than the manufacturer's suggested price.
The Hercules card was essentially an MDA-compatible monochrome card with an added all-points-addressable graphics mode. The card connected to IBM's monochrome 5151 monitor or a third-party monitor compatible with the 5151, and it displayed text and graphics in the same 720×350 pixel resolution format, in the same raster format, and at the same horizontal and vertical scan frequencies as the MDA. In the text mode, which the Hercules card reverted to when the PC was reset, it was almost exactly like the IBM MDA and could be treated by software as if it was an MDA. For full MDA compatibility, the HGC used a 6845 CRT controller (CRTC) chip like the one found on the MDA.[nb 1] The HGC was so compatible with the MDA in this regard that it did not provide its own BIOS ROM and was recognized and operated by the standard PC system board BIOS as an MDA.
The graphics mode of the Hercules card used the same raster format and timing as the MDA text mode, as stated above, but unlike the text mode, it made all pixels addressable. To support this mode, the Hercules had a full 64 KB of video RAM—16 times the RAM of an MDA (4 KB) and four times the RAM of a CGA card (16 KB). The Hercules graphics mode had a lot in common with the CGA high-resolution (640×200) two-color mode: the video buffer contained a packed-pixel bitmap (eight pixels per byte, one bit per pixel) with the same byte format, including the pixel-to-bit mapping and byte order, as the CGA two-color graphics mode, and the video buffer was split into interleaved banks, each 8 KB in size, as in the CGA graphics modes. However, because in the Hercules graphics mode there were more than 256 scanlines and the display buffer size was nearly 32 KB (instead of 16,000 bytes as in all CGA graphics modes), four interleaved banks were used in the Hercules mode instead of two as in the CGA modes.[nb 2] Also, to represent 720 pixels per line instead of 640 as on the CGA, each scanline had 90 bytes of pixel data instead of 80.
The 64 KB RAM of the HGC could hold two graphics display pages. Either page could be selected for display by setting or resetting a single bit in the Mode Control Register. Another bit, in a configuration register exclusive to the HGC, determined whether the second 32 KB of RAM on the HGC was accessible to the CPU at the base address B8000h. This bit was reset at system reset (e.g. power-on) so that the card would not conflict with a CGA or other color card at address B8000h.
Programming for the Hercules card's native graphics mode was somewhat hindered by a lack of BIOS support and standardization from IBM—after all, the HGC was a competing technology. As stated, the Hercules card was supported as an MDA by the IBM PC BIOS and did not provide its own BIOS ROM (unlike most other video adapters after the MDA and CGA). Therefore, there was no BIOS support for the Hercules graphics mode, unlike all standard CGA, EGA, and VGA graphics modes.[nb 3] At least by December 1983, Hercules cards came with a "GRAPH X" installable program which enhanced the BIOS by adding Hercules graphics-mode support and even geometric drawing primitives. Popular IBM PC programs at the time (such as Lotus 1-2-3 spreadsheet, AutoCAD computer-aided drafting, Pagemaker and Xerox Ventura desktop publishing, and Microsoft Flight Simulator) came with their own drivers to use the Hercules graphics mode.
Though the graphics mode of the Hercules card was not CGA-compatible, it was technically similar enough to the two CGA graphics modes that eventually through the use of third-party drivers (TSRs) it could also work (suboptimally) with most programs written for the CGA card's standard graphics modes. As the Hercules card did not actually have color-generating circuitry, nor could it connect to a color monitor, color appeared as simulated greyscale in varying patterns (in essence, a primitive form of half-toning or dithering.)
Very large numbers of imitations of the Hercules appeared, including generic clones at very low prices, usually without the printer port. Hercules briefly ran ads implying that use of generic clones of the Hercules card could damage the computer.
Long after its prime, the Hercules card continued to be popular for dual-monitor setups alongside another (color) graphics adapter. Certain software detected the presence of both video systems, and used the monochrome display for extra data display, while running the application on the other screen—for example, a CAD work area would be displayed on the main (non-Hercules driven) screen, and a list of drawing commands would be shown on the HGC-driven monochrome screen. Some software debuggers could take advantage of an HGC to run the main program on the color monitor and the debugger on the HGC. Later on, the multi-monitor trick became obsolete with OS-related improvements such as the introduction of GUIs for debug commands as a software analogy for debug command modules.
The dual-monitor capability of the original Hercules card and its imitations (and some successors) came from its emulation of an MDA rather than a CGA. When IBM designed the original two cards for the PC, the MDA and the CGA, it assigned them different I/O and memory address ranges. This made it possible for both cards to be installed and operated in the same computer at the same time. Subsequent video hardware standards from IBM—the EGA and VGA—used the same I/O and memory address ranges as the CGA (optionally emulating an MDA in its address ranges or using additional I/O and memory addresses not used by earlier cards). Therefore, an EGA or a VGA[nb 4] could replace a CGA and operate in color modes, but either could only replace an MDA, and operate alongside another color graphics card, if it was put into MDA-compatible mode, which gave no more display capability than the Hercules graphics card. Two color cards could not operate in color modes at the same time in a PC, PC XT, or PC AT. Therefore, the Hercules card (or, later, a much more expensive EGA operating in a configuration to essentially emulate the Hercules card) was the only way to produce two graphics displays on two monitors at the same time.
The monitor is connected to the Hercules card through a DE9F connector using 5V TTL electrical signaling; the same as for an MDA card. Nominally, the Hercules card provides a horizontal scanning frequency of 18.425 ±0.500 kHz, and 50 Hz vertical.
However, the Hercules actually ran at two slightly different frequencies depending on whether it was running in Text or Graphics mode. This is a side effect of the CRT controller using 9-pixel, 14-line character cells when impersonating the MDA, but having to use 8-by-4 pixel blocks to turn memory bytes into 1-bit pixels in graphics mode, with neither the total pixel count in a horizontal period nor total number of scanlines matching up completely. As the card's onboard clock crystal was also slightly different, at 16.000 MHz vs the MDA's (and later, EGA's) actual 16.257 MHz, neither mode was an exact match for the original sync structure, with the exact figures being 18.141 kHz and 49.84 Hz in text mode, plus 18.519 kHz and 50.32 Hz in graphics. However both are close enough to MDA's own 18.432 kHz and 49.82 Hz timings to fit within the sync tolerance of and work reliably on a typical IBM monochrome monitor or compatible. This tolerance was taken advantage of by the various Hercules clone cards, which themselves often exhibited less than accurate timings versus the original.
Original Hercules Graphics CardEdit
Its text mode could display 80×25 text characters and was MDA-compatible. As such, it rendered characters in a box of 9×14 pixels, of which 7×11 made out the character itself (the other pixels being used for space between character columns and lines). This amounted to markedly clearer text display than the competing CGA adapter could offer. The total theoretical resolution of this text mode was 720×350 pixels. This number is arrived at through multiplying the character width of 9 pixels by the number of text columns possible on screen (80) as well as multiplying the character height of 14 pixels by the number of text lines (25). In the MDA-compatible text mode, however, these pixels were not individually addressable.
The graphics mode simply made all pixels directly addressable. This translated to a resolution of not 720×350, but only 720×348 pixels (at 1 bit per pixel) because, for technical reasons (see Programming below), the screen height had to be a multiple of four. On a 4:3 monitor, which was the most common back then, the pixel ratio was 1:1.55.
The Hercules card supported two graphic pages, one at address B0000h and one at address B8000h. The second page could be enabled or disabled by software. When it was disabled, the addresses used by the card did not overlap with those used by color adapters such as CGA or VGA. This made dual-screen operation possible simply through installation of a Hercules card next to, for instance, a VGA adapter.
The HGC standard was extended by two later cards.
- The Hercules Graphics Card Plus (HGC+) (June 1986) allowed user-defined fonts called RAMFONT to be used in 80×25 text mode.
- The Hercules InColor Card (April 1987) included colour capabilities similar to the EGA, with 16 colours from a palette of 64. It retained the same two modes - 80×25 text with redefinable fonts and 720×348 graphics.
- The Hercules Network Card Plus (1988) combined a Hercules Graphics Card Plus with a network adapter.
Hercules also sold the Hercules Color Card (not to be confused with the InColor Card), a CGA-compatible video board. This board could coexist with the HGC and still allow both graphics pages to be used. It would detect when the second graphics page was selected and disable access to its own memory, which would otherwise have been at the same addresses.
Other boards offered Hercules compatibility.
- SiS 86C12, 86C22
- ATi Small Wonder Graphics Solution, 18700, Graphics Solution Plus
- Tamarack Microelectronics TD3088A, TD3088A2, TD3088A3, TD3010, RY-3301, TD3010
- Yamaha V6366C-F, V6363-F, V6363
- Winbond W86855AF, W86855AF
- NEC μPD65042GD
- Tseng Labs ET1000-A
- DFI MG-150
- Hitachi HD6445P4, HD6845SP
- RAM MCG2502, MCG2502
- Proton PT6121T
- Acer M3127
- Sigma Designs 53C101+53C280A
PC clones with HGCEdit
Certain later models of the Tandy 1000 (such as the 1000 TL and SL) and the Epson Equity contained circuitry built into their CPU boards that supported Hercules display modes in addition to their standard CGA modes.
As part of its commercial packaging, the Hercules Graphics Card included a diskette with HBASIC, an interpreted version of the BASIC computer language that enabled programming graphics on a monochrome monitor.
In text modes, the memory appears just like an MDA card. The screen has 80×25 chars, so there are 80 ASCII code/attribute pairs per line (160 bytes per line, 2 bytes per symbol). The address of a given screen location in memory is given by the formula:
address = (0xB0000) + ( row × 160 ) + (column × 2)
Video timing on the HGC is provided by the Motorola 6845 video controller. This integrated circuit was originally designed only for character-based alphanumeric (text) displays and can only address a maximum of 128 character rows. To realize a graphics mode with 348 scanlines on the HGC, the MC6845 is programmed with 87 character rows per picture and four scanlines per character row. Because the video memory address output by the MC6845 is identical for each row within a character, the HGC must use the MC6845's "row address" output (i.e. the scanline within the character row) as additional address bits to fetch raster data from video memory. This implies that unless the size of a single scanline's raster data is a power of two, raster data cannot be laid out continuously in video memory. Instead, the lines are interleaved and thus addressing is slightly more complicated. There are 8 pixels per byte, 90 bytes per line. Consecutive lines on the screen are interleaved by 4 lines in memory, so in memory it looks like this:
- Screen Line #0 starts at B000:0000
- Screen Line #1 starts at B000:2000
- Screen Line #2 starts at B000:4000
- Screen Line #3 starts at B000:6000
- Screen Line #4 starts at B000:005A
The memory address that contains a given pixel is given by:
mem = (0xb8000) + ((y&3)<<13)+(y>>2)×90+(x>>3)
This code would set the correct pixel in that byte:
bitwise or contents with (128 >> (x & 7))
The lack of preset BIOS modes for graphics meant the card was quite reprogrammable, within the limits of monitor sync tolerance. A somewhat popular modified driver called HERKULES was able to produce 720x360 graphics or 90x45 text (8x8 font) on a standard display, just short of the maximum 720x364 that would fit within a 32kb memory page, by careful adjustment of the sync parameters and coercing the card into using the CGA character set still present within the MDA ROM. Other drivers were able to produce different effects, for example a squarer 640x400 "double CGA" mode (similar to that offered by certain more upgraded and customised PC clones made by e.g. AT&T) within the same memory space; either by narrowing each scanline (increasing the scan frequency) and adding additional lines to the raster (thus also keeping the Vsync rate about the same), which required a multisync, EGA-class or unusually tolerant MDA-class monitor; or (for less tolerant monitors) by keeping the scan layout the same but turning on interlace which, in contrast to IBM's own CGA card, usually worked as intended with Hercules and suffered less flicker than might otherwise be expected thanks to the monochrome monitors' generally quite long-persistence phosphors.
CGA emulation on a Hercules card could be done almost entirely via hardware, or through software (such as "SIMCGA" PC program) via "brute force" copying of data on a regular interrupt. Hardware emulation was normally something done by programmers of an application, such as a game, as a "quick and dirty" way to add Hercules support. Software emulation was performed by third-party utilities as a way to get graphics programs with only CGA support working on a Hercules.
Hardware emulation was achieved by enabling the second Hercules video page, which would appear at segment B800h just like CGA, and then making it the visible page. The HGC onboard Motorola 6845 would then be reprogrammed to display 80 "columns" of data (640 pixels where each character is 8 pixels wide) instead of the usual 90 used in graphics mode (720 pixels with a character box of 8×4 pixels). Data was then written just as it would on a real CGA (i.e. the video display was updated by writing to segment 0xB800) with only minor changes due to the different memory interlacing structure. The advantage of this method was no loss of speed during the emulation: Data did not need to be significantly reformatted from the original CGA data while written, only interlaced differently. The disadvantage was that the image appeared vertically "squashed", as CGA data only used 200 lines of the 350 available.
Software emulation would copy from the CGA video memory location to the Hercules memory location. It would reformat the CGA data (320×200 or 640×200 pixels) to the higher resolution (720×348) Hercules. Because of the reformatting of data while copying to completely fill the 720×348 graphics space, and the speed penalty introduced via that method, this introduced an interlacing type of display artifact since the copying could not complete before the beginning of the next display cycle.
Although it cited flaws in the hardware and software, BYTE called the Hercules Graphics Card "a fine product" that gave owners of monochrome monitors graphics capability. PC Magazine reported successfully running CGA-compatible games on a monochrome display, and using the card with a Columbia MPC.
- The CGA also uses a 6845 CRTC; EGA and VGA do not.
- This foreshadowed the four-bank structure of the two PCjr enhanced graphics modes with a 32 KB display buffer size, which use exactly the same four-way interleaved bank scheme as Hercules graphics.
- The CGA 160×100 16-color mode, hinted at by IBM but not fully described or BIOS-supported by them, might be considered an exception. On the other hand, it might not be considered a standard mode, especially since it is implemented with the text/graphics mode bit, in the mode select register of the CGA or compatible card, set for text mode.
- The VGA was originally a chip on PS/2 motherboards, but later, VGA hardware became available on IBM and third-party ISA cards.
- Dievendorff, Dick (1981). IBM Personal Computer Questions and Answers. IBM. pp. 9–10, 25.
- PC Magazine (advertisement): 5. 1984-03-06. Missing or empty
- Wadlow, Tom "The Hercules Graphics Card", BYTE, Volume 8, Number 12, December 1983. Retrieved on 14 July 2017.
- "IBM PC-Compatible EGA Video Reference". 070822 nemesis.lonestar.org
- "Monitor Ports". 071105 whitefiles.org
- "Industrial monochrome monitors 7" - 14"" (PDF). Archived from the original (PDF) on 2007-02-02. 070822 adm-electronic.de
- "'MDA, Hercules, and other clones, what's the frequency Kenneth?' VCF discussion thread". Vintage Computer Forums.
- Wadlow, Tom (December 1983). "The Hercules Graphics Card". BYTE. p. 343. Retrieved 2013-10-20.
- Sargent III., Murray; Shoemaker, Richard L.; Stelzer, Ernst H. K. (1988). Assemblersprache und Hardware des IBM PC/XT/AT (in German) (1 ed.). Addison-Wesley Verlag (Deutschland) GmbH / Addison-Wesley Publishing Company. ISBN 3-89319-110-0. VVA-Nr. 563-00110-4.
- VGA Legacy
- Machrone, Bill (July 1983). "Three Alternative Graphics Boards". PC Magazine. p. 435. Retrieved 2013-10-21.
- Wilton, Richard (1987) Programmer's Guide To PC and PS/2 Video Systems, Microsoft Press, ISBN 1-55615-103-9
- Hercules Computer Technology (1987) Hercules Compatibility Guide (a leaflet)
- "Hercules graphics" definition, Wi-FiPlanet.com
- How to Print Hercules Graphics SCREEN 3 to an Epson Printer, Microsoft.com
- Hercules Monochrome Graphics Adapter, Everything2.com