Hercules Graphics Card
Encyclopedia
The Hercules Graphics Card (HGC) was a computer graphics controller made by Hercules Computer Technology, Inc. which, through its popularity, became a widely supported display standard
Computer display standard
Computer display standards are often a combination of aspect ratio, display resolution, color depth, and refresh rate.This article describes the different display standards for computer displays.-History:...

. It was common on IBM PC compatible
IBM PC compatible
IBM PC compatible computers are those generally similar to the original IBM PC, XT, and AT. Such computers used to be referred to as PC clones, or IBM clones since they almost exactly duplicated all the significant features of the PC architecture, facilitated by various manufacturers' ability to...

s connected to a monochrome monitor
Monochrome monitor
A monochrome monitor is a type of CRT computer display which was very common in the early days of computing, from the 1960s through the 1980s, before color monitors became popular. They are still widely used in applications such as computerized cash register systems...

 (green, amber, or page white). It supported one high resolution text mode and a single graphics mode. In 1984 its list price was USD
United States dollar
The United States dollar , also referred to as the American dollar, is the official currency of the United States of America. It is divided into 100 smaller units called cents or pennies....

 499 although it was often sold for less than the manufacturer's suggested price.

Its provision of an MDA
Monochrome Display Adapter
The Monochrome Display Adapter introduced in 1981 was IBM's standard video display card and computer display standard for the PC. The MDA did not have any pixel-addressable graphics modes...

 compatible high quality text mode in combination with a (for its time) high resolution graphics mode (as well as aggressive pricing) made the Hercules card extraordinarily popular in the early days of the PC. The existence of CGA
Color Graphics Adapter
The Color Graphics Adapter , originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was IBM's first color graphics card, and the first color computer display standard for the IBM PC....

 emulation
Emulator
In computing, an emulator is hardware or software or both that duplicates the functions of a first computer system in a different second computer system, so that the behavior of the second system closely resembles the behavior of the first system...

 drivers/TSR
Terminate and Stay Resident
Terminate and Stay Resident is a computer system call in DOS computer operating systems that returns control to the system as if the program has quit, but keeps the program in memory...

s, which allowed Hercules users to run programs written for the CGA card's standard graphics modes (albeit only in monochrome, without actual color), may also have been a contributing factor to its success. Programming for the Hercules card's native graphics mode was somewhat hindered by a lack of BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 support and standardization from IBM — after all, the HGC was a competing technology. Popular IBM PC programs at the time (such as Lotus 1-2-3
Lotus 1-2-3
Lotus 1-2-3 is a spreadsheet program from Lotus Software . It was the IBM PC's first "killer application"; its huge popularity in the mid-1980s contributed significantly to the success of the IBM PC in the corporate environment.-Beginnings:...

 spreadsheet and Autocad
AutoCAD
AutoCAD is a software application for computer-aided design and drafting in both 2D and 3D. It is developed and sold by Autodesk, Inc. First released in December 1982, AutoCAD was one of the first CAD programs to run on personal computers, notably the IBM PC...

 computer-aided drafting) came with their own drivers to allow use of the Hercules graphics mode.

Long after its prime, the Hercules card continued to be popular for dual-monitor setups alongside another (colour) graphics adaptor. Certain software detected the HGC 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 colour monitor and the debugger on the HGC.

History

The Hercules 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
IBM PC
The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform. It is IBM model number 5150, and was introduced on August 12, 1981...

 using the Thai alphabet (his native language).

Connector

DE9F connector. Using 5V TTL electrical signaling.

Horizontal frequency 18.425 ±0.500 kHz, Vertical frequency 50 Hz.

Technical specifications

Its monochrome 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
Color Graphics Adapter
The Color Graphics Adapter , originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was IBM's first color graphics card, and the first color computer display standard for the IBM PC....

 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 Hercules card's single monochrome 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
Color depth
In computer graphics, color depth or bit depth is the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per pixel , particularly when specified along with the number of bits used...

) because, for technical reasons, the screen height had to be a multiple of four.

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
Video Graphics Array
Video Graphics Array refers specifically to the display hardware first introduced with the IBM PS/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analog computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution...

. This made dual screen operation possible simply through installation of a Hercules card next to, for instance, a VGA adapter.

Hercules also made a CGA-compatible card, the Hercules Color Card, which could coexist with a monochrome 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.

Programming

As part of its commercial packaging, the Hercules Graphics Card included a diskette with HBASIC, an interpreted version of the BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 computer language that enabled programming graphics on a monochrome monitor. An integrated development environment with the same name (HBasic
HBasic
HBasic is an integrated development environment used to create, execute and debug programs with a Basic language. HBasic has object oriented features either in combination with precompiled C++ components or class definitions . This also includes a version of inheritance.Hbasic is a mature Basic...

) has appeared.

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)

In graphics mode, the lines are interleaved so it is a bit harder. 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))

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
Motorola 6845
The Motorola 6845 is a video address generator first introduced by Motorola and used among others in the Videx VideoTerm display cards for the Apple II computers, the MDA and CGA video adapters for the IBM PC, in the Amstrad CPC and the BBC Micro. Its functionality was duplicated and extended by...

 would then be reprogrammed to display 80 "columns" of data (640 pixels) instead of the usual 90 (720). Data was then written just as it would on a real CGA (i.e. the video display was updated by writing to segment B800h) 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 or 640 x 200 pixels) to the higher resolution (720 x 348) Hercules. Because of the reformatting of data while copying to completely fill the 720x348 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.

Later cards

The HGC standard was extended by two later cards:
  • The Hercules Graphics Card Plus (June 1986) allowed user-defined fonts to be used in 80×25 text mode.
  • The Hercules InColor Card
    Hercules InColor Card
    The Hercules InColor Card was an IBM PC compatible graphics controller card released in April 1987 by Hercules Computer Technology, Inc. After the success of the monochrome Hercules Graphics Card which gained wide developer support, the market was changing with the release of new colour cards...

     (April 1987) included colour capabilities similar to the EGA
    Enhanced Graphics Adapter
    The Enhanced Graphics Adapter is the IBM PC computer display standard specification which is between CGA and VGA in terms of color and space resolution. Introduced in October 1984 by IBM shortly after its new PC/AT, EGA produces a display of 16 simultaneous colors from a palette of 64 at a...

    , with 16 colours from a palette of 64. It retained the same two modes - 80×25 text and 720×348 graphics.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK