Saturday, July 21, 2012

Better Graphics for the TRS-80 Color Computer

I am a fan of the TRS-80 Color Computer.  That was the first computer which I had as a kid, and it has continued to entertain me as the main object of my retro-computing hobby for about three decades.  Perhaps interestingly, one of the ironic things about the TRS-80 Color Computer (aka "CoCo") is that even in its own time the CoCo was never really regarded as a great graphics performer.

The original CoCo relies on the Motorola 6847 Video Graphics Controller (aka "VDG").  On paper, the specifications of the VDG compare reasonably well to those of its contemporaries.  But, it is restricted to the use of one of two 4-color palettes in its graphics modes -- both sets being rather hard on the eyes and neither containing black.  It does offer a set of "semi-graphics" modes that allow for the use of all 8 colors plus black, but that comes at the price of even lower resolution.

The CoCo3 is different, of course.  But even with the advent of Fahrfall, in my opinion the original CoCo (and CoCo2) remains a bit under-loved.  Besides, the project I have undertaken will teach me some crucial details about timing on the CoCo.  Hopefully those details will help me add some final features (like in-game music) to Fahrfall!

Raster Effects

The CoCo wasn't the only machine to use the VDG.  Another machine using the VDG was the Dick Smith VZ200.  At some point I was surfing the web and came upon an article about the VZ200 that describes changing VDG display modes while the screen is actively being drawn, allowing for more than one mode to display on the screen at a given time.  Looking closer at the datasheet for the VDG also reveals that the mode control inputs "may be changed on a character by character basis".  In fact, this is exactly the technique the CoCo hardware uses to choose between displaying alphanumeric characters and semi-graphics blocks.

The ability to change modes "on the fly" provides some flexibility not otherwise available to a static VDG configuration.  In exchange for some properly utilized CPU cycles, we can create a variety of custom video modes.  This capability can be used to enable the use of all 8 colors (but still no black) in the VDG's color graphics modes.

Flicker Mode

Another technique that others have used to improve available color counts is to alternate between two screens of graphic data for a given image.  By doing this switching quickly enough (one switch every 1/60th of a second), the two screens blend to create a new image in the viewer's mind.  I recently came across a presentation describing just this sort of technique being used to produce 105-color images with the 15-color palette available on the MSX1.  A particular point about that presentation gave me an idea about how to combine a couple of VDG modes to produce improved graphics output on the CoCo.

So, hopefully that provides an outline of my entry for this Summer's Retrochallenge event.  Much of the work is already done, but it still needs a good write-up -- I intend to provide that over the next week or so.  In the meantime, I hope that everyone will enjoy my little CoCo project!

1 comment:

  1. I owned a Coco and I well remember using the horizontal line interrupt to play with graphics modes the way you did. Good work. I miss having old hardware around.

    I also remember the undocumented 2x16 subpixel 8 color mode; someone wrote a Defender clone based on that. I suppose you could get faces from that mode, sort of kind of, from 50 feet away. :)