The Developer’s Tidbit

March 16, 2008

DOSBox Graphic and Machine Emulation, CGA, VGA, Tandy, PCJr, Hercules

This article has been revised for DOSBox 0.73

If you have ever attacked the DOSBox.conf (configuration) file you might have encounter a not so obvious setting for DOSBox, MACHINE=VGA machine=svga_s3. For running games made during or after 1992 this setting is not all that important. But for many PC games that were created during the 1980’s this setting can be critical in maximising the best visual and even audio output the game has to offer.

By default DOSBox has the MACHINE setting set to VGA svga_s3. This is not only visually the best setting available, it is also the most compatible. If you read the commented section in the settings file as shown below it states machine — The type of machine tries to emulate: hercules, cga, tandy, pcjr, vga, vgaonly, svga_s3, svga_et3000, svga_et4000, svga_paradise, svga_nolfb, svga_oldvbe. Thats many different options that can dramatically change the way your game looks and plays, so in this tutorial I will explain what these different machines mean. I will list the different graphical display types for the IBM PC format in chronological order including those that are not directly supported by DOSBox. This should not only give you and overall understanding of what these machines mean but it might also help you in determining the best settings for your early DOS games and software.

DosBox 0.73 Graphics Settings

DosBox 0.73 Graphics Settings

MDA
IBM released the first PC back in 1981. MDA or Monochrome Display Adapter was the default graphics display for the system. Except for this is a slight oxymoron as MDA did not support any kind of software graphics, only a monochrome text mode display and text character effects. Occasionally you will encounter an early PC game that only supports text mode graphics and this is usually so it is usable in MDA. It was the lowest common denominator for PC’s of the period. In fact the first commercial game for the PC was the text adventure game, Microsoft Adventure. DOSBox does not support or emulate MDA, though there is really no need as all text mode software will work under any DOSBox machine mode.

Microsoft Adventure in MDA
Microsoft Adventure, the first game for the IBM PC in MDA text mode (720×350 pixels)

CGA
The Colour Graphics Adapter was introduced by IBM as a more expensive add-on for the IBM PC at the time of it’s initial release back in 1981. Unlike the cheaper MDA alternative, CGA allowed limited colour and graphics. The down side to this though was that it offered a significantly lower resolution text mode which didn’t appeal to business. In 1984 IBM would reduce the price of the CGA adapter after it released the successor, EGA. The cheaper and more affordable CGA then became the lowest common denominator for game developers for nearly a decade.

CGA offered various graphic modes but most games used the 320×200, 4 on screen from a choice of 16 colour mode. CGA also offered a NTSC composite colour and TV output. A feature that was never offered by later graphic cards until the age of 3D acceleration. With some hacks using colour blending and artifacts game developers managed to push many more on screen colours than what was initially though possible by using the CGA composite mode. This mode and the hacks are fully emulated by DOSBox. So if you ever encounter a CGA only game that supports composite in addition to the RGB or monitor mode, then make sure you set the DOSBox.conf MACHINE= to CGA so you can use this colourful hack.

Microsoft Adventure in CGA
Microsoft Adventure in CGA using a chunky 320×200 text mode

Microsoft Adventure in CGA Hi-res
Microsoft Adventure in CGA hi-res 640×200 text mode
Kings Quest 1 CGA Composite
King’s Quest (pre-AGI) title screen using CGA composite with DOSBox MACHINE=CGA mode
Kings Quest 1 CGA Composite
King’s Quest (pre-AGI) in game under CGA composite with DOSBox machine=CGA
Kings Quest 1 CGA RGB
King’s Quest (pre-AGI) under CGA RGB with DOSBox machine=CGA

This is what happens when you incorrectly run a CGA game using DOSBox’s default machine=VGA machine=svga_s3. Composite is left, RGB is right. As you can see VGA newer graphic modes such as EGA and VGA sometimes do not emulate the CGA mode or colours accurately.

Kings Quest 1 CGA CompositeKings Quest 1 CGA RGB

Hercules
This is probably the only non-IBM graphics standard that became popular on the IBM PC during the 1980’s. Introduced in 1982 by Hercules Computer Technology, Hercules Graphics or Herc became a popular, affordable alternative to the standard IBM offerings. Not only did it have a high resolution text mode like MDA, it also offered a high resolution graphics mode which surpassed anything that CGA could offer. More attractive for the customer though was that the Hercules was MDA-compatible. This meant consumers could use their cheaper MDA monitors to display high resolution graphics. The only downside to this was that Hercules, like MDA was monochrome.

Microsoft Adventure in Herc
Microsoft Adventure in Hercules text mode
Kings Quest 2 Herc
King’s Quest II (AGI) title screen in Hercules mode
Kings Quest 2 Herc
King’s Quest II (AGI) in game in Hercules mode, the menu system and it’s text is significantly clearer than any other graphic mode

IBM PC Jr.
The IBM PC Jr. was an alternative line of the PC created by IBM to target the home computer user. Some might argue it was specifically created to cut into Apple’s series II sales. Introduced in 1984 the PC Jr. was a complete flop and was pulled within a year. While IBM created it to be reasonably compatible with it’s full price line, it wasn’t compatible enough for many disappointed owners. Price was also an issue for IBM with the system significantly more expensive than the competing home computer systems of the time. Many would argue though that it was the included cheap n’ nasty keyboard and cost cutting to the system’s parts that ultimately lead to the system’s quick demise.

While the PC Jr. format was dead and buried by the end of 1985, it did manage introduce a number of innovations to the PC line of computers. The PC Jr. included two built in joystick ports as standard as well as two cartridge ports for fast loading software. Sound was improved with a three channel tone generated chip as oppose to the standard IBM beeper (the beeper is still used today in modern PCs by the system BIOS). Most significant was the upgrade from CGA to CGA Plus / PC Jr graphics. This enabled 16 colours on screen at once from a choice of 64. Games that were designed exclusively for the IBM PC Jr. will not work on any other IBM systems or clones.


A failed attempt at trying to run the CGA only version of King’s Quest (non-AGI) on a IBM PC Jr.

The first published version of King’s Quest by Sierra Online released in 1984 by IBM. Only works on IBM PC Jr. machines or under DOSBox with MACHINE=PCJR

TGA or Tandy
TGA or Tandy Graphics Array is the name given to the Tandy 1000 series of computers. Tandy originally created this line as a clone of the IBM PC Jr. Just weeks before going retail with Tandy’s new product, IBM pulled the plug on the PC Jr. So Tandy were left on their own with their new system. Tandy managed to turn the situation to their advantage and successfully marketed the machine as their own, upgraded clone PC. Within the games industry the Tandy series eventually became a supported standard, so for a period during the mid to late 1980s the Tandy clones became the best PCs to play DOS games on.

Unlike the defunct IBM PC Jr. that were cloned, the Tandy series of computers were fully IBM PC compatible. This meant that users could run the majority of software and games that supported CGA mode when no Tandy support was provided. The Tandy 1000 series also offered two joystick ports, a 3 channel tone audio chip, volume control and had the operating system saved to fast ROM allowing for very short system boot times. Long startup times were an issue for most IBM PCs and clones from the period, specially for those that relied on floppy disks. The Tandy standard while supported by many software companies, was eventually superseded by the wide spread adoption of VGA graphics and audio sound cards.


Tandy 1000 version of King’s Quest (non-AGI) from 1984. The game also supports CGA, so for full colour DOSBox must be set to MACHINE=Tandy

EGA
Enhanced Video Adapter was introduced by IBM in 1984. Being a very expensive luxury for many meant that it took a while to catch on. Software companies did not offer EGA support for their titles until 1986-1988. Often if a game supported EGA it would be modified to support Tandy 1000 graphics. EGA generally offered 16 colours on screen at once from a choice of 64 at 320×200 resolution. It was backwardly compatible with CGA but this support was not 100% accurate. In addition EGA had a high resolution mode of 640 x 350 in 16 colours . This special mode required extra video memory which was not common, though a few titles such as the original SimCity allowed for the use of this mode. In DOSBox the MACHINE=VGA setting offers complete EGA compatibility. In DOSBox you can force the use of EGA by using the MACHINE=EGA setting. The VGAONLY and SVGA_* modes also allow backwards compatibility with EGA.


SimCity EGA 16 colour high-resolution mode 640 x 350.

The common 1987 AGI re-release of King’s Quest I which supports EGA graphics

King’s Quest 1990 SCI remake. Uses full 320 x 200 16 colour graphics and offered more graphical detail and animation than the earlier 1987 AGI re-release.

MCGA
The Multicolour Graphics Adapter was introduced by IBM in 1987 on their propriety PS/2 range of computers. It was backwardly compatible with CGA but not with EGA. This left many unsupported games using the limited range of 4 colour CGA even for titles that supported 16 colour EGA. MCGA itself had the capacity of displaying 256 colours on screen at once. A few games do support 256 colour MCGA but the majority of those also support VGA, the standard that instantly superseded it.

VGA
Video Graphic Array was introduced by IBM in 1988. It was backwardly compatible with EGA and is fairly compatible with CGA. Two modes of VGA were popular with software developers, either the low resolution 320 x 200 with 256 colours from a palette of 262,144 colours. Or a high resolution 16 colour mode at 640 x 480 pixels. The game industry took a while to catch on to VGA. Initially it was only used it when porting 32 on screen colour Amiga titles such as the popular Lemmings or Space Ace. It wasn’t until 1990 when large software publishers hit the retail selves with their first full 256 colour VGA titles. Games such as The Secret of Monkey Island, Kings Quest V and Links: The Challenge of Golf helped encourage the VGA take up on home computer which lead to the later multimedia, PC movement.

The default MACHINE=svga_s3 setting in DosBox 0.73 is fully compatible with all VGA modes.


King’s Quest V from 1990 with low resolution VGA supporting 256 colour graphics

Darkseed from 1992 requires VGA and uses a 16 colour high resolution mode

Once 256 colour VGA graphic hardware, hard disks and audio sound cards had become common place in consumer PCs. It was clear by 1992 that even with it’s many short comings that the PC would become the dominate, home computing and gaming platform. Doom by ID Software released a year later totally cemented this realisation for many people.

Super VGA,  SVGA, VBE and VESA

Unfortunately after the earlier, orderly history of PC graphic standards things became very muddled. Around the same time IBM started promoting VGA they released a new piece of hardware known as the IBM 8514/A. This was a new and very expensive graphics system that could pump out a display of 1024×786 interlaced pixels with 256 colours. IBM decided to keep the specifications propriety and from then on, other manufactures designed VGA extensions to their own, in-house specifications.

As each manufacture went their own way with these new graphic modes, they became incompatible with each other. Worse, software developers needed to create drivers for each different graphic chipset that was on the market. So as a consumer, if you bought the latest and greatest graphics card, the chances were that older titles would not support your card in high resolution mode. Collectively these varying VGA extensions became known as Super VGA or SVGA. But in reality there is no hard and fast rule as to what constitutes SVGA with cards from the period of 1987 through to 1989.

Manufactures saw the obvious problem so they collectively banded together to form the VESA or Video Electronics Standards Association in 1989. One of the first tasks was to formalise a universal SVGA standard. This standard had limited use but was common with games as it supported 640×480 up to 256 colours and 800×600 with 16 colours.

SimCity 2000 setup displaying supported graphic cards

SimCity 2000 setup displaying supported graphic cards

SVGA was later incorporated into what became VESA 1.0. VESA required a special BIOS extension added to the graphics card to allow it to be compatible. This VESA BIOS Extension was alternatively known as VBE.

  • VESA VBE 1.0 introduced in 1989 allowed for modes up to 1280×1024 with 256 colours.
  • VESA VBE 1.1 added some new high resolution text modes, the standard remained virtually unknown.
  • VESA VBE 1.2 from October 1991 later became a well supported standard with DOS software. It introduced 15/16 bit high colour support on all resolution modes up to 1280X1024.
  • VESA VBE 2.0 from November 1994 upped the standard, adding 24 bit true colour support and a bunch of new and then unusual modes, including the increasing of the maximum resolution up to 1600*1200.
  • VESA VBE 3.0 was introduced in September of 1998 and mainly focused on Windows 2D accelleration, but we can choose to ignore it as by then DOS gaming was for the most part dead.
Links386Pro one of the first games to support SuperVGA at 640x480

Links386Pro one of the first games to support SuperVGA at 640x480

Duke 3D with high resolution 800x600 graphics

Duke 3D with high resolution 800x600 graphics

So now that we have explained the history of SVGA we can go on to how this all relates to DOSBox. Since version 0.71 DOSBox has used the once, popular S3 Trio 64 chipset as its emulated graphics hardware. The Trio 64 from 1995 is a good choice and supports VESA VBE 2.0.

Unfortunately the DOSBox emulation of the S3 chipset is not complete. And there are a number of early software titles from the hazy, pre-VESA high resolution days that do not know or understand either the VESA standard or the S3 chipset. This is why a number of new SVGA emulation modes were introduced into DOSBox 0.73, but they have a side effect of making things more complicated.

Essentially the svga_et3000, svga_et4000 and the svga_paradise modes allow you to emulate a number of once popular, pre-VESA, high resolution chipsets. When troubleshooting an older game you should find at least one of these cards supported.

vga_only disables any VGA extensions so you will be restricted to 320×200 with 256 colours or 640×480 with 16 colours modes, as well as the legacy CGA, EGA modes.

svga_paradise I think emulates the Paradise PVGA1A which is only capable of a SVGA resolution of 640×480 with 256 colours or 800×600 with 16 colours.

svga_et3000 emulates the Tseng Labs ET3000 which manages 800×600 with 256 colours and  1024×768 with 16 colours.

svga_et4000 emulates the Tseng Labs ET4000 is the same as the ET3000 but also manages 1024×768 with 256 colours.

svga_oldvbe implements a VESA VBE 1.2 BIOS under the S3 Trio 64 card.

svga_nolfb implements VESA VBE 2.0 but introduces a no-line frame buffer hack. Don’t ask me where you will need that, because I am not sure. According to DosFreak .. “svga_nolfb fixes speed or graphics issues with some SVGA games. The old UniVBE utility had the ability to disable the LFB which performs the same function as svga_nolfb.

svga_s3 is the default DOSBox mode that  has reasonable VESA VBE 2.0 support. It is the most capable out of all the modes supported and should be left as default unless something is not working.

9 Comments »

  1. A very well-written and accurate article! I’m an old-time PC user who actually played games on all the displays you mentioned, except for PCjr – never had one of those.
    There were a few 1980’s CGA games that used certain tweaks to the graphics mode. Like Round 42 and Moonbees that used a 160×100 16 color mode on an ordinary CGA machine. These tweaks would not work on EGA or VGA cards, so these games could not be played on modern PC’s until DOSBOX came along. The guys who wrote DOSBOX did a real favor to all old gamers!
    I wrote a little shareware game in 1991 that had 4 color CGA and 16 color Tandy modes. It was called Darwin’s Arena.I never got around to porting the 16 color graphics to EGA, so the 16 color version was also unplayable on modern PC’s until DOSBOX. Seeing it again after 10+ years made me very grateful to the DOSBOX crew.

    Comment by Matt — March 26, 2008 @ 1:17 pm | Reply

  2. I’m happy to read good article like this. It is really worth job. Thank you.

    Comment by patrick.jakubowski — May 10, 2009 @ 3:50 am | Reply

  3. svga_nolfb fixes speed or graphics issues with some SVGA games.

    The old UNIVBE utility had the ability to disable the LFB which performs the same function as svga_nolfb.

    Comment by DosFreak — June 4, 2009 @ 11:48 am | Reply

    • Thanks for that information DosFreak, I’ll update the entry.

      Comment by Ben — June 4, 2009 @ 5:26 pm | Reply

  4. A small nitpick: Darkseed is a 640*350*16 EGA game. The 64 color palette was available in that mode too (and possibly in that mode only, if my GWBasic memories don’t fail me).

    If you need a high resolution VGA game, look for Knights of Xentar (X-rated, but you can find nice, child proof pictures too), or Flight Simulator 4.

    Comment by Pygy — June 4, 2009 @ 11:41 pm | Reply

    • I can tell you by just looking at the screen shots that Darkseed has a need for VGA because of the palette requirements. EGA’s range of 64 colours was too limited, specially by the time Darkseed was released in 1992. The Atari ST from 1985 had a range of 512 colours, the Commodore Amiga 1000 also from 1985 had a range of 4,096 colours. Both of which made the EGA range of 64 colours look feeble in comparison.

      Here is the results of Darkseed in EGA mode.
      http://ipggi.wordpress.com/files/2009/06/start_000.png

      Comment by Ben — June 5, 2009 @ 12:48 am | Reply

  5. You may also detail the more accurate vgaonly mode, required for a lot of demos and a few games.

    Comment by Pygy — June 4, 2009 @ 11:45 pm | Reply

    • If you can give me an example or two of games that will not work under the svga_s3 but will work under vgaonly, that would be great.

      Comment by Ben — June 5, 2009 @ 12:56 am | Reply

  6. lemmings,kellogs and pinball fantasies benefit from it. Those games change the palette while the screen is updated.
    vgaonly support this.

    lemmings the titel screen I think.

    Comment by Moi — June 15, 2009 @ 3:36 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.