Re: [cc65] Re: TGI colors revisited

From: Karri Kaksonen <>
Date: 2011-05-03 08:35:04
On 05/02/2011 06:34 PM, Oliver Schmidt wrote:
> Hi,
> I didn't receive any feedback at all on my posting below. So I'm
> wondering by now if there was anything fundamentally wrong with it.
> Maybe...
> - to long to be read at all ?
> - to offending to be anything but ignored ?
> - to complicated to be understood ?
> - to boring to be thought about ?
> - to<whatever>  ?

It is spring in Finland. No time to sit by the computer when the sun shines.

>> 1. We aggreed on that there is no benefit in using the same color
>> macros (i.e. COLOR_RED) for both conio and TGI.
Agreed. The Lynx has no conio at all - only pixels and graphics.

>> 2. We aggreed that we live with the somewhat inconsistent usage of the
>> TGI_COLOR_... macros in the TGI API. As long as one doesn't modify the
>> default palette the macros can be used in the calls
>> tgi_setcolor/tgi_getcolor/tgi_getpixel just as expected.

True. But if the programmer starts changing the default palette I 
believe he is using sprites. He is probably also allocating one color 
for text and one color for text background. He is not interested in 
color macros found in cc65 at this point.

>> 3. We aggreed that the TGI_COLOR_... macros are defined in the target
>> header files thus allowing the targets to define them differently
>> (just like the COLOR_... macros for conio). However _ALL_ TGI drivers
>> for a single target need to share the TGI_COLOR... macros.

The Lynx has only one display mode: 160 by 102 pixels 16 colors. There 
will be just one driver.

>> 4. According to my records/memory we didn't discuss the actual palette
>> values.

>> - 'lynx' has only a 16-color mode driver. So the (black/white = 0/1)
>> rules do _NOT_ above apply. In fact white has the value $0F so this
>> target benefits from the target-specific TGI_COLOR_... macros. I
>> defined the 16 macros to be identical to the TGI_COLOR_... macros.
>> Please speak up if this is wrong and needs to be changed! However the
>> default palette has totally different values than the TGI_COLOR_...
>> macros - they even seem to be 16-bit values so there is some work in
>> the drivers necessary - which I can't do.

The Lynx is a bit tricky as the index 0 (black) may also be 
(transparent). In this case you may need a second black in your palette. 
For a default palette one black is enough.
The actual 16-bit value for a color is  RGB with 4 bits for each 
component. (The order is $0GBR to confuse the programmers.)

I can easily change all the color values to comply with the TGI_COLOR 
defines. Black can be 0 and white can be 1. Please tell me what the 
default TGI-palette should look like. I just need the RGB values and 
names for the colors.



To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue May 3 08:35:28 2011

This archive was generated by hypermail 2.1.8 : 2011-05-03 08:35:32 CEST