Hercules Graphics Card
The Hercules Graphics Card 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.
History
Background
The IBM Personal Computer was launched in 1981 with the Color Graphics Adapter expansion card and the Monochrome Display And Printer Adapter. The CGA offered two basic operating modes: 320×200 pixel low resolution or a 640×200 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 monitor. Still, since by design CGA was able to be connected to cheap composite monitors and even to home TVs, 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, often shortened to Monochrome Display Adapter, 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, that could be used on a monochrome monitor.
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 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, or check the current video mode, to configure itself appropriately.
Hercules
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, 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 were an MDA. For full MDA compatibility, the HGC used a Motorola 6845 CRT controller chip like the one found on the MDA. 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 and four times the RAM of a CGA card. The Hercules graphics mode had a lot in common with the CGA high-resolution two-color mode: the video buffer contained a packed-pixel bitmap 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, four interleaved banks were used in the Hercules mode instead of two as in the CGA modes. 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 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. Therefore, there was no BIOS support for the Hercules graphics mode, unlike all standard CGA, EGA, and VGA graphics modes. 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 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 it could also work 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
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 monitor.
Long after its prime, the Hercules card continued to be popular for dual-monitor setups alongside another 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 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 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. Therefore, an EGA or a VGA 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 was the only way to produce two graphics displays on two monitors at the same time.
Connector
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 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.
Technical specifications
Original Hercules Graphics Card
Like the IBM Monochrome Display Adapter it improved on, the Hercules Graphics Card had both a parallel printer port and a video output port.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. 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 as well as multiplying the character height of 14 pixels by the number of text lines. 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 because, for technical reasons, the screen height had to be a multiple of four. On a, 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.
Later cards
The HGC standard was extended by two later cards.- The Hercules Graphics Card Plus allowed user-defined fonts called RAMFONT to be used in 80×25 text mode.
- The Hercules InColor Card 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 combined a Hercules Graphics Card Plus with a network adapter.
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.
Clone boards
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
- CM607P
PC clones with HGC
Programming
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. The address of a given screen location in memory is given by the formula:
address = + +
Video timing on the HGC is provided by the Motorola 6845 video controller. This integrated circuit was originally designed only for character-based alphanumeric 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 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:
The memory address that contains a given pixel is given by:
mem = + +×90+
This code would set the correct pixel in that byte:
bitwise or contents with
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 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 within the same memory space; either by narrowing each scanline and adding additional lines to the raster, which required a multisync, EGA-class or unusually tolerant MDA-class monitor; or 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
CGA emulation on a Hercules card could be done almost entirely via hardware, or through software 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 instead of the usual 90 used in graphics mode. Data was then written just as it would on a real CGA 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 to the higher resolution 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.