Re: [cc65] A Bad Change to "tgi.h"

From: Ullrich von Bassewitz <>
Date: 2011-04-22 20:39:52
On Fri, Apr 22, 2011 at 01:10:01PM -0400, Greg King wrote:
> I am unhappy with the April 20th patch to <tgi.h>.
> I believe that TGI's black and white colors should be defined globally.
> They should be 0 and 1 on _all_ platforms -- they shouldn't be
> target-specific.  On targets where the hardware uses different numbers,
> the graphics drivers should remap the numbers.
> I recall that one of the reasons why we decided to do things that way is
> so that tgi_init() can set the initial color to WHITE without needing to
> know anything about any specific target and its hardware.

I've discussed this with Oliver before he made the change (or, more exactly,
he discussed it with me :-). There are platforms where black and white have
other color codes than 0 and 1. So for these platforms we would need to
translate colors at runtime, which costs memory and CPU cycles.

So Oliver suggested to supply the values for black and white as target
specific values that come from linkable modules. This means that tgi_init
works as before: It will still set the initial color to WHITE. The only change
is that the constant will (in the future) come from a platform specific module
via the linker.

So we get the best of two worlds: Nothing will change in regard to tgi_init or
other tgi functions relying on the color codes for black and white, but we
don't need translation for platforms that don't use 0 for black and 1 for

The only exception are platforms were different drivers use different color
codes. In this case some of them need to use translation.

Maybe it's the fact that the change is currently not complete that causes your
worries. Please be patient, I'm sure Oliver will do the remaining changes



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Apr 22 20:41:06 2011

This archive was generated by hypermail 2.1.8 : 2011-04-22 20:41:09 CEST