Showing posts with label IBM PCjr.. Show all posts
Showing posts with label IBM PCjr.. Show all posts

Saturday, November 2, 2013

IBM PC Color Composite Graphics

In one of my recent posts, I discussed artifact color composite graphics as demonstrated by all computers which were intended to use them.  In this post, I want to focus on artifact color composite graphics as available on the IBM PC and compatible systems.

IBM PC CGA Color Composite Graphics

First, I would like to address some myths.  The first myth is that only a few games used composite color. Well over 100 games have been confirmed to use composite color.  The second myth is that virtually all of them used the 640x200 graphics mode.  In fact, many, many games used composite color, although many looked acceptable on an RGB monitor, and just as many games used 320x200 graphics mode and color composite graphics as those that used the 640x200 graphics mode.  Here are a list of games that are known to use composite artifact color graphics and the type of graphics they use :

Game Title Composite Color Type
Adventure in Serenia 320
Agent USA 320
Alphabet Zoo 320
Ancient Art of War 320
Archon: The Light and the Dark 320
Battle of Antietam 320
BC's Quest for Tires 640
Below the Root 320
Beneath Apple Manor 320
Black Cauldron, The 640
Blue Angels: Formation Flight Simulation 640
Borrowed Time 320
Boulderdash 320
Boulderdash II 320
Bruce Lee 640
BurgerTime 640
Buzzard Bait 320
California Games 640
Championship Baseball 640
Championship Golf: The Great Courses of the World - Volume One: Pebble Beach 320
Chuck Yeager's Advanced Flight Trainer 640
Crossfire 320
Demon's Forge 320
Dino Eggs 320
Donald Duck's Playground 640
Drag Race Eliminator 320
Dragon Wars 320
Exodus : Ultima III 320
Fooblitzky 320
Football 640
Freddy's Rescue Roundup 320
Frogger II: Three Deep 640
Gamma Force in Pit of a Thousand Screams 320
Gertrude's Puzzles 320
Gertrude's Secrets 320
Gettysburg: The Turning Point 320
Gold Rush 640
Indianapolis 500: The Simulation 640
J-Bird 640
Jumpman 640
Jungle Hunt 320
King's Quest 640
King's Quest II : Romancing the Throne 640
King's Quest III : To Heir is Human 640
King's Quest IV : The Perils of Rosella (AGI) 640
Lane Mastodon vs. the Blubbermen 320
Leisure Suit Larry in the Land of the Lounge Lizards 640
Lost Tomb 320
M.U.L.E. 320
Manhunter : New York 640
Manhunter 2 : San Francisco 640
Maniac Mansion (Low-Res) 320
MasterType 320
Mean 18 640
Mickey's Space Adventure 640
MicroLeague Baseball 320
MicroLeague Baseball II 320
Microsoft Decathlon 320
Microsoft Flight Simulator (v1.0) 640
Microsoft Flight Simulator (v2.0) 640
Mindshadow 320
Mixed-Up Mother Goose 640
Mr. Cool 320
Ms. Pac-Man 640
Murder on the Zinderneuf 320
Night Mission Pinball 640
Night Mission Pinball (v3.0) 640
Oil's Well 640
Pits & Stones ?
Pitstop II 640
Roadwar 2000 320
Roadwar Europa 320
Robot Odyssey 320
Rocky's Boots 320
Shamus 320
Sierra Championship Boxing 320
Solo Flight 320
Space Quest : Chapter I : The Sarien Encounter 640
Space Quest II : Vohaul's Revenge 640
Spy Hunter 320
Starflight 640
Strip Poker: A Sizzling Game of Chance 320
Sub Mission 320
Super Zaxxon 640
Superbowl Sunday 640
Tales of the Unknown: Volume I - The Bard's Tale 640
Tapper 640
Tass Times in Tonetown 320
The Bard's Tale II: The Destiny Knight 640
The Bard's Tale III: Thief of Fate 640
The Fourth Protocol 320
The Oregon Trail 320
The Seven Cities of Gold 640
The Tracer Sanction 320
The World's Greatest Baseball Game 640
Think Quick! 320
Transylvania 320
Troll's Tale 640
Ultima II : Revenge of the Enchantress 320
Ultima IV : Quest of the Avatar 320
Ulysses and the Golden Fleece 320
Wasteland 640
Where in the U.S.A. is Carmen Sandiego? 320
Where in the World is Carmen Sandiego? 320
Wilderness: A Survival Adventure 320
Winnie the Pooh in the Hundred Acre Wood 640
Wizard of Id's WizType 640
Zak McKracken and the Alien Mindbenders (Low-Res) 320
ZorkQuest: Assault on Egreth Castle 320
ZorkQuest: The Crystal of Doom 320

The advantage to using the 640x200 graphics mode is that a good color palette is available using white as the foreground color.  White or light gray, rather than high intensity or bright white was used because the brightness level was more tolerable on composite devices.  The disadvantages are that the game must support two completely different sets of graphics, otherwise users of RGB monitors would feel left out. Additionally, most games used an algorithm that requires extra coding and CPU time to implement for either the RGB or color composite mode.

The advantage to using 320x200 graphics is that only one set of graphics, or in a few cases two sets of very similar graphics, need be used.  Both users of composite monitors and RGB monitors can be satisfied, although the result may not be as impressive as tailoring graphics to either RGB or composite monitors.  The disadvantage is that the graphics designer has to cope with both direct and artifact colors, often giving a fuzzy image.  With the green/red/brown palette, the results often look somewhat garish and it was seldom intended to be used for composite color graphics.  Often that palette, many times with a blue background, would be used for the RGB graphics selection.  The colors choices available in the 320x200 modes are not as flexible as they would be in the 640x200 mode.

320x200 Palette 1 High Intensity Composite Color Graphics from L to R : RGB, Old CGA, New CGA, PCjr., Tandy
320x200 Palette 0 High Intensity Composite Color Graphics from L to R : RGB, Old CGA, New CGA, PCjr., Tandy
The above palettes do not quite give the full array of color combinations which the CGA card is capable. Although the palette choices in the 320x200 modes are limited, the background & border color can be freely selected from the full 16 colors which the CGA can display.  Similarly, the foreground color in the 640x200 mode can be set to any of the 16 colors CGA can display.  These color choices will affect the resulting artifact colors available.

640x200 Color Composite Graphics from L to R : Old CGA, New CGA, PCjr., Tandy
While color composite graphics may appear to be one way to display graphics, in reality there are three major types of color composite graphics.  First there are those generated by the IBM PC Color/Graphics Display Adapter and 100% compatible adapters.  Within this type there are two subtypes, early cards and late cards with minor differences between them.  Second, there are those generated by the IBM PCjr.  Third, there are those generated by the Tandy 1000 computers.

IBM CGA cards, Catalog Part Number 1504910 come with Card and PCB numbers

Card           PCB
1804456
1804464
1804472
1501486     1501453
1501981     1501982
6278550     6133807?
6447058

Cards 1804456 to 1501486 are early CGA cards.  1501981 to 6447058 re late CGA cards. The 180xxxx cards have the black brackets on them which the very earliest IBM PC cards had.  Later cards use a silver bracket appropriate for an IBM PC, XT or any compatible machine.  The major physical differences between the two versions of these can be seen here :

Old CGA vs. New CGA, note the increased number of resistors on the New CGA card (courtesy of minuszerodegrees.net)
An old CGA card will have either 7, 8 or 12 resistors, a new CGA card will have 15.  Note also in the above photo that the old card has a Motorola MC6845 and the new card has a Hitachi HD6845.  While the two work identically for typical software, demos may require one or the other.  The party-version of the 8088MPH demo only looks correct with an MC6845.  The final version looks correct with either chip.

Old cards seem to come exclusively with MC6845s, while new cards will use either chip.  Old cards always seem to use a green PCB color, but new cards almost always use a brown PCB color.

One of the chief differences between these cards is the number of shades of gray it can produce when connected to a monochrome composite monitor or B&W TV set through an RF modulator.  Old cards can produce two shades of gray plus black, while new cards can produce 15 shades of gray plus black in black and white modes.  Many computer users had to use monochrome green, amber or white monitors back in the day, and the increase in shades of gray meant that more detail could be seen in the graphics.  With the old cards, you had black for black and gray, white for white and bright white and gray for all other colors.  This is found in CGA Mode 5, which on an RGB monitor gives a cyan, red and white palette but on a color composite monitor will give either black and white (2 colors) or black, dark gray, light gray and white (4 colors).

Colorwise, new CGA was adjusted to more closely adhere to the NTSC standard.  It will appear more consistently across different monitors than old CGA.  There are differences between the saturation and brightness between the colors output by old and new CGA.  Newer monitors may make the image too dark with old CGA, requiring the user to increase the brightness level of his monitor.  There is a test program that can tell you which type of CGA card you may have.  Here are the screenshots of it showing how it informs you of the type you may have :



Old CGA has a raster bendiness issue with certain computers, and the black and white modes may not always eliminate all colors.  Running the signal through a powered RF modulator like the Recoton Video RF Modulator V647 should eliminate the bendy horizontal sections of the picture without reducing the video quality (assuming you are not modulating an audio signal with the video.)

Unlike the Apple II, where the pixels being output in the high resolution and double high resolution modes were either white or black, on the PC the pixels being put out have direct color.  The six colors in between black and white, without accounting for intensity, are generated by adjusting the phase of the 3.58MHz color burst signal for the hue and the amplitude of that signal for the brightness.  Unlike on an RGB TTL monitors from IBM, color #6 is dark yellow, not brown, because a color composite monitor or TV does not have circuitry built inside it to detect color #6 and turn it to brown.

For direct or chroma colors, both the old and new CGA cards look similar to the RGB colors, but there are minor differences between them.  The PCjr. and Tandy 1000 show direct or chroma colors identically with the new CGA cards.  Here are the 16 direct or chroma colors :

Rows 1 & 4 : RGB CGA Colors, Rows 2 & 5 : Old CGA Direct Colors, Rows 2 & 6 : New CGA, Tandy and PCjr. Direct Colors
For at least two games, Microsoft Decathlon and Championship Golf, the earlier card makes it much easier to read text than the later card.  Championship Golf may require the brightness controls to be turned down on the monitor.  Other games designed for old CGA are Sorcerer of Claymorgue Castle. Tournament Tennis, Quadrel and Willow look better with new CGA.

320x200 Palette 1 Color Composite Graphics Example - Adventure in Serenia New CGA
Some games like Donkey Kong, Boulderdash II, I, Damiano: The Wizard of Partestrada and Turbo Champions look like they support color composite graphics due to the vertical striped pattern graphics seen in some screens or tiles, but they really do an overall poor job on a color composite monitor. It is suspected that the ports did not convert the graphics with a great deal of thought.

320x200 Palette 0 Color Composite Graphics Example - Jungle Hunt (Note the Diving Bar, New CGA)
Pitfall 2 is an interesting piece of software when it comes to color composite mode support.  If you press 1 at the text screen, you will see 640x200 graphics with green as the foreground color on an RGB monitor.  I know of no game other than this that uses any foreground color other than white for 640x200 color composite graphics.  Obviously, this gives the graphics a greenish hue on a color composite monitor.  If you press 2 at the text readability screen, you will get 320x200 graphics with intense palette 0.  However, the road and the mountains have vertical stripes, which suggest that this mode is also intended to be used with a color composite monitor.  However, the stripes are there as a crude dithering effect, as using this mode on a color composite monitor makes the text very difficult to read.  The Fourth Protocol allows the user full control over the CGA card, and has a stripey pattern for 640x200 graphics that make them look tolerable with a color composite monitor.  It may be limited to the title screen, however, because the in-game graphics appear to always be 320x200, with the pixels doubled in a 640x200 mode.

640x200 Color Composite Graphics Example #1 - Pitstop II, New CGA
Color composite graphics were not limited to booters.  Sierra supported it in every AGI engine game it released, from King's Quest to Manhunter II : San Francisco.  Interplay supported it in The Bard's Tale 1-3, Dragon Wars and Wasteland.  No doubt their Apple II origins contributed to this.  Interestingly, in Wasteland you must select the graphics adapter in the install program, which then converts the graphics from 16-color to composite color as it installs.  To use another graphics adapter, you have to reinstall the game.  Considering its support for every other type of graphics adapter on the market, the color composite support in Lucasarts' Maniac Mansion and Zak McKracken is uncharacteristically poor.

640x200 Color Composite Graphics Example #2, - King's Quest, Old CGA
Tandy 1000 Composite Color Graphics

Tandy can only show the same direct or chroma colors as CGA, but the Tandy 1000 artifact colors are different.  Changing the hue adjust will be sufficient to change Tandy colors to late CGA colors in DOSBox, and vice versa, but only in the 640x200 mode.  A hue adjustment in the 640x200 mode of 120 degrees will give a good Tandy palette.  You can only approximate the palette colors for the 320x200 modes.  Games that are not "Tandy-aware" with their color composite graphics will show different colors. This occurs either with either 320x200 or 640x200 graphics.

Blue Angels: Formation Flight Simulation is the only game known where the color composite graphics look correct on the Tandy 1000 but do not look right on the IBM CGA cards.  It also apparently was developed on a system with a comb filter.  For a 1989 game, this would not have been difficult to find, but comb filters were not used on the composite color monitor and TVs of the early 1980s when most of the composite color CGA games were developed.  Many early 1980s games look better on monitors without comb filters.  Compare these two screenshots :

IBM CGA Composite
Tandy 1000 Composite
In the Tandy extended modes 160x200x16, 320x200x16 and 640x200x4, you will see color on a color composite monitor or TV.  In the 160x200x16 mode, there is no real artifact color since the pixel clock and the color burst frequencies are the same, 3.58MHz.  The graphics look blocky in this mode, but reasonably sharp.  Maniac Mansion on the Tandy 1000, using the Tandy graphics setting, would look very similar to how it looks on the Commodore 64, although there are color differences and the text is blockier.

Indianapolis 500 specifically supported both IBM and Tandy color composite graphics with different command line arguments so that the colors would look correct regardless of system.  However, the colors in each mode are not identical.  The command line switch /c1 will give colors appropriate for a CGA card, and switch /c2 will give colors appropriate for a Tandy graphics adapter.

Indianapolis 500 - The Simulation 640x200 RGB CGA
Indianapolis 500 - The Simulation 640x200 RGB Tandy
Indianapolis 500 - The Simulation Color Composite Early CGA
Indianapolis 500 - The Simulation Color Composite Late CGA

In modes using true 320x200 graphics (the AGI games use the 320x200 16 color graphics mode, but the effective graphics resolution is 160x200, at least for graphics above the command line), you can see color, but detail is lost, unintended artifacts that look like Hanover bars appear, and the game usually looks bad.  As far as 640x200x4 graphics go, no game is known to use that graphics mode.

Indianapolis 500 - The Simulation Color Composite Tandy (Simulated)
On a monochrome composite monitors or B&W TV sets, 16 shades of gray are always visible with Tandy 1000 or PCjrs.

IBM PCjr. Color Composite Graphics

The PCjr. does support color composite artifact colors, but the artifact colors are different from the CGA cards and the Tandy 1000.  Again this is due not to differences in the phase of the color burst but the pixel clock delay compared with the CGA cards.  In the 320x200 mode, there is a pixel clock delay of 120 degrees compared with the CGA cards.  PCjr. color composite graphics can appear quite different to CGA color composite graphics.

Below the Root sounds best (at least the opening song does) when run on an IBM PCjr. and the direct colors when the game is run on a PCjr. were tweaked to look very appropriate for a color composite monitor with artifact color.  Ditto for The Seven Cities of Gold, except it uses 640x200-based color composite graphics.

IBM PC CGA RGB
IBM PCjr. RGB

IBM PC CGA Old Composite

IBM PC CGA New Composite
IBM PCjr Composite

As explained in the prior blog entry, the PCjr's default 320x200 palette is not identical to the CGA's default cyan, magenta and white palette.  The PCjr. intentionally uses high intensity white instead, causing brightness and saturation differences.

Below the Root 320x200 Color Composite Late CGA
Below the Root 320x200 Color Composite Early CGA

Below the Root 320x200 Color Composite PCjr.

Wilderness : A Survival Adventure may show the best composite color results using the PCjr., but the underlying patterns are not changed for the machine.  Frogger II is PCjr. aware and shows good composite or RGB colors either with CGA or PCjr.  A late version of Pitstop II has direct support for the PCjr.'s 160x200x16 mode, so it will always look better than the CGA with or without color composite graphics.  Ditto for Murder on the Zinderneuf, all versions use 160x200x16 on the PCjr.  Several other games just use 160x200x16 on the PCjr. because it looks excellent on an RGB or color composite monitor.

BC's Quest for Tires uses 320x200 composite color graphics on the PCjr. but 640x200 composite color graphics on the PC.  Microsoft Flight Simulator 2.xx uses 640x200 composite color graphics for the PC and PCjr., but the patterns are different for each.  There was a version of Ultima II for the PCjr. that uses appropriate composite color 320x200 graphics.  M.U.L.E. also uses 320x200 composite color graphics.

Current SVNs of DOSBox emulate old and new CGA with the cga machine type, 640x200 and 320x200 color composite graphics but does not emulate color composite graphics with the tandy or pcjr machine types.

Other computers may have inaccurate CGA artifact colors.  The Columbia Data Products 1600 (one of the very first PC clones) came with a CGA clone card that is almost as off as the Tandy or PCjr.  A hue adjustment of 315 degrees will get something like its palette in 640x200 mode.  Here are the games that intentionally support composite color on an IBM PCjr. with the type of composite color they use :

Game Title Composite Color Type
BC's Quest for Tires 320
Below the Root 320
M.U.L.E. 320
Ultima II : Revenge of the Enchantress PCjr. Version 320
Frogger II: Three Deep 640
Microsoft Flight Simulator (v2.0) 640
The Seven Cities of Gold 640

Lode Runner : Support for All Composite Color Types

Lode Runner for the PC always looks best in composite color mode, despite using the 320x200 resolution. Only the in-game border and certain objects on the screen really take advantage of composite color, but the solid objects always look appropriate regardless of monitor.

When first released for the PC, the game only supported the IBM PC and CGA.  A second release added PCjr. support by adjusting the patterns for the composite color objects.  A final release under the Tandy label retained the PC and PCjr.'s respective patterns but adjusted the patterns again when it detected a Tandy 1000 machine.  Here are correct screenshots for the CGA, PCjr. and Tandy both in RGB and Composite :
IBM PC CGA RGB
IBM PC Old CGA Composite
IBM PC New CGA Composite
IBM PCjr RGB
IBM PCjr Composite
Tandy 1000 RGB
Tandy 1000 Composite

Limitations of the Tint Control

NTSC color TVs and monitors have a tint (hue) control dial, buttons or function.  The tint control is intended to adjust for phase errors in a transmitted broadcast signal.  The tint control adjusts the phase of the TV's reference color burst signal slightly toward the green or red end of the spectrum.  The color burst is intended to have a phase of 180 degrees, and by using the tint control, you can adjust the TV's phase by about 40 degrees from the official phase.  This was important during the era of broadcast TV before cable became ubiquitous.  Here is an NTSC color wheel to give you an idea of where the colors fall by degrees :


Unfortunately, for Tandy and PCjr. display adapters, 40 degrees is not sufficient to turn Tandy or PCjr composite colors into CGA colors.  Relative to late CGA, assuming its color burst is near 180 degrees, 640x200 Tandy is at 300 degrees and 640x200 PCjr. is at 120 degrees.  In the 640x200 mode, you can get somewhat close to the CGA colors at the extreme end of the tint control (green for PCjr, red for Tandy), but in 320x200 mode, you really won't.  In DOSBox, F11 and Alt F11 emulate the function of the tint control.

This blog entry gives a very readable overview of how composite CGA works : http://8088mph.blogspot.com/2015/04/cga-in-1024-colors-new-mode-illustrated.html

Wednesday, October 30, 2013

The PCjr. and CGA Compatibility

When IBM designed the PCjr., it based it on its pre-existing IBM PC Color/Graphics Display Adapter (CGA).  However, IBM did not design it in a way that it would be guaranteed to be backwards compatible with all CGA software, especially games.  This article will demonstrate the limitations of the PCjr. with CGA games.

There are four types of games of CGA games, first those that are not aware of the PCjr (Adventure in Serenia), second those that are aware of the PCjr. but do not use the enhanced graphics features of the PCjr. (M.U.L.E.), third those that are aware of the PCjr. and enhance the graphics in some way (Alley Cat), and fourth those that do not really work on the PCjr. (Microsoft Decathlon).  (Interestingly, all these games were released by IBM).  This article is only concerned with the first two types of games.

CGA and the PCjr. are fully compatible at the BIOS level, but only partially compatible at the register level.  The PCjr. can do everything that CGA can do at the hardware level, it just has to do some things very differently.  The CGA is a relatively simple device with eight registers :

Hex Address       Register Function
3D4                    6845 Index Register (to access 18 internal registers)
3D5                    6845 Data Register
3D8                    Mode Control Register
3D9                    Color Select Register
3DA                   Status Register
3DB                   Clear Light Pen Latch
3DC                   Preset Light Pen Latch

IBM implemented all these registers except for the 6-bit Mode Control and Color Select Registers.  There is nothing present at 3D8 and 3D9 in the PCjr.  The CGA and PCjr. have true Motorola MC6845 CRTCs.  The PCjr. also has a video gate array that acts as the graphics controller.

In addition, the graphics memory window with CGA, B8000-BBFFF will also be found with the PCjr., regardless of the amount of memory the PCjr. has (since it shares its video memory with the CPU).

1.  What works

Anything that access the BIOS will work correctly in either the IBM PC with CGA or PCjr.  The PC BIOS through Int 10H, offers several video functions.  All the video functions in the PC are present on the PCjr. Among the chief functions of BIOS Int 10H include setting the graphics modes.  IBM defined seven modes in the BIOS for CGA, 0-6, as shown below

Mode 0 - 40 column x 25 line Text Color/Black and White
Mode 1 - 40 column x 25 line Text Color/Color
Mode 2 - 80 column x 25 line Text Color/Black and White
Mode 3 - 80 column x 25 line Text Color/Color
Mode 4 - 320x200 Graphics 4-Color
Mode 5 - 320x200 Graphics 4-Color/Black and White
Mode 6 - 640x200 Graphics Black and White

On an RGB monitor, all modes except 6 are color capable through the BIOS.  On a color composite monitor or TV, only Modes 1, 3 and 4 are capable of color.  IBM preferred the black and white modes so that text would appear legible on a color composite monitor or TV.

Two other important functions that Int 10H provides include setting the palette to either green/red/brown or cyan/magenta/white and setting the background + border color in the 320x200 graphics modes and the border color in the text modes.  Even though the register write is the same, it will not set the foreground color in the 640x200 mode.

Additionally, those tweaked text modes, found in games like Round 42 (160x100) or ICON : Quest for the Ring (320x200), may also work because the program tweaks the registers of the Motorola MC6845 CRTC.  ICON has a PCjr. executable, and some games like Styx had a PCjr. specific version.

2.  What doesn't work

Since the Mode Control Register does not exist in the PCjr., a program must select the modes using the BIOS.  Any program writing to the Mode Control Register to change its mode will not work.  In addition, for text modes CGA uses bit 5 to turn blinking off and allow a text cell to select the 8 intense colors.  Finally, when bit 2 is 0 it turns on color for the color composite mode.  This is the way that color composite graphics are shown on CGA using the 640x200 mode and the bit is 0 by default in Modes 1, 3 and 4.

The Color Select Register also does not exist in the PCjr., so any program that uses the register to select colors will not work.  Color selection in CGA is limited as follows :

For text modes, bits 0-3 selects the border color.
For 320x200 graphics modes, bits 0-3 select the background and border color.
For 640x200 graphics mode, bits 0-3 select the foreground color (background and border color is always black, works with color composite graphics when bit 2 of the Mode Control register is 0)

None of those functions will work at all on the PCjr.

Bit 5 selects the 3-color palette in 320x200 Mode 4.  If the bit is 0, then the palette is green, red and brown.  If the bit is 1, the palette is cyan, magenta and white.  This is the default.  In Mode 5, this bit has no effect, the palette is always cyan, red and white.  The background color is the only color that is freely selectable in the 320x200 modes.  Since bit 5 is not implemented, any game that uses the Color Select Register to change the palette will show the cyan, magenta and white palette, even though that is not what was intended.  Also, the cyan, red and white palette will not appear, the default palette will be used.

Bit 4 determines whether the palette colors are in low or high intensity.  It works for all three palettes described above.  Thus green, red and brown becomes light green, light red, yellow; cyan, magenta and white become light cyan, light magenta and high intensity white; and cyan, red and white becomes light cyan, light red and high intensity white.  Since bit 4 is not implemented on the PCjr. games will only use the low intensity palettes.

Thus on CGA there are really six palettes available :

IBM PC CGA Mode 4 Palette 1 Low Intensity :

Ultima II - Revenge of the Enchantress
IBM PC CGA Mode 4 Palette 0 Low Intensity :

Digger
IBM PC CGA Mode 5 Palette 0/1 Low Intensity :

Donkey Kong
IBM PC CGA Mode 4 Palette 1 High Intensity :

Battlezone
IBM PC CGA Mode 4 Palette 0 High Intensity :

Shamus
IBM PC CGA Mode 5 Palette 0/1 High Intensity :

Tapper
On the PCjr., however, there are really only two palettes available for games that aren't PCjr. aware, if they work at all :

IBM PCjr. "CGA" Mode 4/5 Palette 1 :

Ultima II - Revenge of the Enchantress
IBM PCjr. "CGA" Mode 4/5 Palette 0 :

Shamus
Note that for PCjr. CGA Palette 1, cyan and magenta are the same as real CGA, but white has become high intensity white.  This is intentional and has been verified on real hardware.  Apparently IBM decided the original palette was not bright enough and so decided to brighten things up a bit.  For PCjr. CGA Palette 0, the intense palette is not available, even for games that intended to use it.  However, several games that used Palette 0 will use Palette 1 on the PCjr. because they used a register write instead of the BIOS function to set the palette.

However, in a 4-color mode, the PCjr. is not limited to the 78 possible combinations of the three preset colors and the background color.  Through its palette registers, the PCjr. can set each of the four colors to any color in the 16-color palette.  1,820 combinations become available.  Likewise, in a two color mode, the PCjr. can set the foreground and background colors independently, and the background color need not be black.  In addition, the PCjr. can set the border color independently in any mode, whereas the CGA can only set a unique border color in text modes.  Instead of only fifteen choices, 120 choices become available.

Even though Tandy copied the PCjr.'s video gate array and graphics capabilities, it restored the Mode Control and Color Select Registers giving it near perfect compatibility with any non-Tandy aware CGA program using the those registers.

Sunday, June 2, 2013

IBM PCjr. and Tandy 1000 Sound : Multiplexer Weirdness

In the original sound system design for the IBM PCjr., there could be four sources of audio, the 8253 Timer-driven PC Speaker, the 3 Voice TI SN 76496, the Cassette input or an adapter on the bus like the IBM PCjr. Speech Attachment Sidecar.  IBM set aside two bits in the 8255 Programmable Peripheral Interface at I/O Port 61 to control a multiplexer which would determine the source to be used.  The bits used were 5 & 6, and here is what they controlled :

Bit 6  Bit 5
0       0       PC Speaker (Default)
0       1       I/O Channel Audio In (PCjr. Speech Attachment)
1       0       Cassette Audio Input
1       1       TI SN76496 3 Voice

Pretty logical.  An important point to note that this multiplexer only controlled the output to the external audio RCA output jack, the RF output connector or the PCjr. Monitor connector for an IBM 4863 PCjr. Display with built-in speaker.  The PCjr.'s internal beeper would only output PC Speaker Audio, doubtless IBM felt it was too tinny for anything else.

When Tandy cloned the PCjr., this arrangement served them just fine for the Tandy 1000 with two exceptions.  Since the 1000 did not support a cassette interface, the setting for the Cassette Audio Input sent nothing to the external audio RCA output jack.  However, they decided to engineer the outputs very differently.  The TI SN 76496 has an audio input pin which can mix an external audio source with the 3-voice sound the chip itself is producing.  On the PCjr., this pin is unconnected.  On the 1000, it is connected to the PC Speaker input.  Then the mixed audio is sent to the internal speaker and to the multiplexer.  Thus the bits operate as follows :

Bit 6  Bit 5
0       0       PC Speaker (Default)
0       1       I/O Channel Audio In
1       0       Nothing
1       1       PC Speaker + TI SN76496 3 Voice

No known device actually sent audio over the ISA bus, so the I/O Channel Audio In is effectively a "nothing" selection.  The Tandy 1000 had a very large internal speaker, so the PC Speaker and 3-Voice sound is done justice.  However, the internal speaker cannot be turned off without physically disconnecting it from the pins on the motherboard..

Thinking that inability to turn off the internal speaker was a bad thing, Tandy decided to make the multiplexer more complex in the SX and EX series.  They added a third bit which is intended to turn the internal speaker off if set to 1.  Tandy refers to these bits as follows :

SNDCTRL0 = Bit 5 of 8255 Port B / Connects to MC14529 Pin 6/"A"
SNDCTRL1 = Bit 6 of 8255 Port B / Connects to MC14529 Pin 7/"B"
SNDCTRL2 = Bit 4 of 8255 Port B / Connects to MC14529 Pin 15/"STy"

The internal outputs were thus made more complicated :

Bit 6  Bit 5  Bit 4       Internal                                                      External
0       0       0             PC Speaker + TI SN76496 3 Voice         PC Speaker (Default)
1       0       0             PC Speaker + TI SN76496 3 Voice         Nothing
0       1       0             I/O Channel Audio In                                I/O Channel Audio In
1       1       0             PC Speaker + TI SN76496 3 Voice         PC Speaker + TI SN76496 3 Voice
0       0       1             Nothing                                                     PC Speaker
0       1       1             Nothing                                                     Nothing
1       0       1             Nothing                                                     I/O Channel Audio In
1       1       1             Nothing                                                     PC Speaker + TI SN76496 3 Voice

Thus if a program sets Bit 4, the best you would hear from the external speaker would be the PC Speaker sound.  The SX's multiplexer is wired to have two outputs, one for the RCA jack and another for the internal speaker.  The EX's multiplexer has only one output wired, and it goes to an earphone jack and the internal speaker.  By default the audio is heard through the internal speaker, but plug in a mini-jack and the audio is switched to whatever is plugged into the jack, headphones or external speakers.  However, the the portion of the multiplexer the EX uses is controlled by Bit 4, so if that bit is set you will have the same problem as on the SX.  You will also have the same problem if a program sets bit Bit 5 without setting Bit 6.  If Bit 6 is set without Bit 5, you will get no external audio output on the SX.  The SX has a potentiometer inside the machine that can control the internal speaker's volume, but the EX has a volume wheel on the outside.

The HX, TX, TL, SL and later systems also have headphone jacks with external volume wheels.  However, Bits 5 & 6 do nothing in the HX, and in the TX and the other systems bit 5 has no function while bit 6's function is completely different.  Only bit 4 functions in these systems.  In addition, I/O Channel Audio In is no longer supported.

Since I have an SX, I can discuss its multiplexing scheme.  The default value for I/O port 61 on bootup is 08.    This means that Bits 4-6 are 0.  The external output will only output PC Speaker sound.  This is generally not desirable, and Sierra's games will enable the external audio.  After exiting from a Sierra game, the value for I/O port 61 is now 68.  The program has set bits 5 & 6.  LucasArts games will not enable the external audio output on the SX, so the simplest solution is to run a Sierra game before hand.  There is a program called tdyspkr.com that will allow you to make settings designed for the SX or easily allow you to manipulate the bits yourself.

Monday, March 25, 2013

IBM PC & PCjr. vs. Tandy 1000 : Price Wars

I recently opined that the Tandy 1000 shared the benefits of the IBM PC and PCjr. while being cheaper than either of them.  I wanted to find out how true that was.  The IBM PC Model 5150 was released in August, 1981, the PCjr. in January, 1984 and the Tandy 1000 in November, 1984.  (I know the Jr. was available for sale in November, 1983, but users actually did not get the machine until January, if they were lucky).

The comparison between the IBM PC and the Tandy 1000 is easy enough.  For the prices I am using "A Guide to IBM Personal Computers", January 1985 Edition and the Tandy Radio Shack 1985 Catalog.  For the PCjr. prices, I am using the IBM PCjr. Order Form, November 1983 and Compute! Issue 53, October 1984 Article : "IBM's New & Improved PCjr." by Tom R. Halfhill.  I know that there could be deals to be had with either system, and you weren't always required to buy the maker's hardware but I am interested in the base price were you to talk into IBM's Business Center or a Radio Shack store.

Lets compare the base system units:

IBM 5150 System Unit Model 176
CPU - Intel 8088 @ 4.77MHz
NPU - Option
RAM - 256K Parity
83-Key Keyboard
5.25" Diskette Drive Adapter
2 x 5.25" Diskette Drives (Full Height)
5 x ISA slots

Base 1985 Price - $2,295.00

Tandy 1000 25-1000
CPU - Intel 8088 @ 4.77MHz
NPU - No Option (until the Tandy 1000A)
RAM - 128K Non-Parity
90-Key Keyboard
1 x 5.25" Diskette Drive
3 x ISA slots
Also has the following built-in :
Tandy Graphics Adapter (PCjr compatible.)
Tandy Sound (ditto)
Printer Adapter (card-edge)
Game Ports (Tandy joysticks only)
Diskette Drive Adapter (two internal floppies max)

Base 1985 Price - $1,199.00

For almost $1,100 less than what IBM would want, you get virtually all the functionality of the PC and some very nice extras.  Parity memory and math co-processor support may have been important to the business world, but was not much of a value for home users.  And while 5 ISA slots beats 3 ISA slots, IBM took up two with the floppy controller and any display adapter.  

Still, even with this you still need some stuff.  Here is the rough equivalent IBM and Tandy upgrade paths and the cost of them :

IBM Prices
Color/Graphics Adapter

244

Tandy Prices
Tandy 1000 Disk Drive Kit

299.95
Printer Adapter 75
Built-In
Game Control Adapter 45
Built-In
5153 Color Display 680
CM-2 Color Monitor 549.95
PC-DOS 2.1 65
Included
256K Memory Expansion Option 489
256K Memory Expansion Board 299.95



128K RAM Upgrade 149.95



512K Memory Expansion Board 249.95





5152 Graphics Printer 449
DMP-120 499.95

IBM curiously would be happy to sell you a computer that was unusable for any practical purpose by omitting the display adapter, DOS and in some configurations, floppy drives.  I chose IBM's CGA adapter over IBM's recently released Enhanced Graphics Adapter, which while it would provide graphics parity with the Tandy Graphics Adapter, nothing supported it yet.  The EGA would set you back an additional $280.  Both 14/13" color monitors were suitable for high resolution 640x200 graphics, although the 5153 would have the nicer dot pitch.  (.31 vs. .43).  

IBM sold either a 64/256K Memory Expansion Option or a 256K Memory Expansion Option.  At IBM's prices, a fully stacked 64/256K Memory Expansion Option would cost $565, so I saved money here.  However, this adapter uses up slot 3, the Printer Adapter slot 4 and the Game Control Adapter slot 5.  No more slots, so there is no room for a second memory expansion or a Asychronous Communications Adapter (Serial) unless you added the 5161 Expansion Unit for the low, low price of $2,585.  

Tandy required a memory expansion adapter to upgrade the RAM above 128K.  The first ISA adapter came with 128K, supported 128K more and added the very important DMA compatibility.  The second ISA adapter also came with 128K but no DMA chip, and 128K more could be added for the maximum 640K.  Even though Tandy later released a board that consolidated these two expansions into one, you still had one slot for a serial card or a hard disk controller.

Tandy did not offer a two-floppy system until the SX, but it did include Tandy MS-DOS 2.11 (and GW-BASIC).  IBM hit you for extra for DOS.  In the 1980s no one could purchase a computer without a printer.  The IBM 5152 Graphics Printer was a solid, reliable unit, and I chose the nearest dot-matrix printer from Tandy's Catalog for a comparison.  Tandy's printer offerings could get very expensive.  

Total IBM PC 1985 Cost : $4,342.00.  
Total Tandy 1000 1985 Cost : $3,248.70.  

The home user clearly got better value here.  IBM had no adapter card that could replicate the PCjr./Tandy Graphics and Sound and no one else did.  More and more games were starting to take advantage of them.  

But what about the PCjr.?  The Enhanced Model was $1,269 at launch but $999 by August 1984.  Here is what that would get you :

IBM PCjr. 4863 Model 067
CPU - Intel 8088 @ 4.77MHz

NPU - No Option
RAM - 128K Non-Parity
62-Key Wireless Infrared Keyboard
1 x 5.25" Diskette Drive
Diskette Drive Adapter
Sidecar Expansion
2 Cartridge Slots
Also has the following built-in :
PCjr. Graphics Adapter
PCjr. Sound
Game Ports
Serial Adapter

Here is what you need to build an roughly equivalent system :

IBM PCjr. Prices
PC-DOS 2.1

65

Tandy Prices
RS-232C Option Board

99.95
Cartridge BASIC 75


Parallel Printer Attachment 99



BASIC was important in the 1980s, and to fully use BASIC on the PCjr., you needed Cartridge BASIC.  PC-DOS's BASIC and BASICA required it.  Tandy's DOS included GW-BASIC, which incorporated the functions of Cartridge BASIC.  

Although I do not know how much IBM charged for the 4863 PCjr. Display, I would assume it was roughly equivalent to the price of the CM-2.  If you wanted a cord for the keyboard, that would be an extra $20, payable to IBM.  Before the July 31, 1984 price cuts, the IBM and Tandy costs are as follows :

Total IBM PCjr. 1984 Cost : $1,508.00.
Total Tandy 1000 1984 Cost : $1,298.95.

IBM's 128K Memory Expansion Sidecar would cost $325, but the PCjr. needed a device driver to recognize more than 128K.  It was more expensive than the Tandy card and did not add DMA capability, which turned the Tandy 1000 into a truly functional machine.

While IBM's price cut and deals would eventually make the system as cheap as the new Tandy 1000 by Christmas 1984, it was scant consolation to those people who bought the PCjr. at full market price, suffered from the chicklet keyboard and found out that someone else bought virtually the exact same system and more expandable to boot only a few months later for more than $200 less.  Tandy also had a good Christmas 1984 deal, $999 could get you the 1000 and a Color Monitor (the cheap CM-4).  For a realistic user in 1985, the discounts on the PCjr. were not worth it because it was essentially a dead-end system.  A well-informed computer buyer, having read magazine articles detailing the troubles with the PCjr. and every conscientious salesperson who did not work for IBM trying to steer customers away from the Peanut should have made scared away potential buyers in droves.  All of a sudden, IBM's name no longer held the marquee value it had in the business world, and home computers from Tandy, Commodore and Apple should have looked a lot more attractive.

After March of 1985, when IBM discontinued the PCjr., the system could be had at steep discounts, but there was no future for the machine.  Game support quickly disappeared for the PCjr., but for the Tandy 1000 it increased dramatically.  Third-party options to add disk and hard drives were very expensive.  Tandy could stick it to the customer with prices for its upgrades, and compatibility with PC upgrades could be a little hit-or-miss, but at least there were first and third party options available.