cc65: [bug][tgi][atari_lynx] TGI_COLOR_BLACK is transparent and not a solid color

Issue #956 was never fully solved. On a white background, it is not possible to display black text. The TGI_COLOR_BLACK is still implemented as transparent. TGI_COLOR_BLACK should be a real solid color.

The problem is reproduced with this example:

#include <tgi.h>
#define CLI() asm("\tcli")
int main(void)
{
    tgi_install (tgi_static_stddrv);
    tgi_init ();        
    CLI();
    while (tgi_busy())  {  };
    tgi_setpalette(tgi_getdefpalette());
    tgi_setbgcolor(TGI_COLOR_WHITE);
    tgi_outtextxy(8,8,"    "); 
    tgi_setcolor(TGI_COLOR_BLACK);
    // tgi_setcolor(TGI_COLOR_RED);
    tgi_outtextxy(8,8,"hello");
        
    while(1){};
    return 0;
}

@greg-king5 We still have a problem with the black color… Do you know what is still wrong?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 41 (41 by maintainers)

Most upvoted comments

Sure. I already wrote a small animated example of tiles I found in your repo. Perhaps we don’t clutter this thread. literaldemo.zip

I know nothing about the lynx, so i’ll have to take your word for whatever you say 😃 So did i understand correctly that there are 16 available hardware colors, of which one (index 0) will be transparent? what if we just shift all colors up one index and have 15 colors?

Then, i am not sure rendering (only) text as sprites to get black is really the solution. TGI isnt just for text - so what about all the other things you can do with it? how will those work with black?

That would work. Screenshot from 2022-02-23 15-44-53

Usually I use the 17th colour that does not exist when I design the sprites. This allows me to use all 16 colours for shaped sprites. But if you are happy with a 15 colour palette then I might sacrifice colour index 11 which is DARK_BROWN. And move the colours from index 0 to 10 to become hardware indices 1 to 11.

Be aware! There is no index 0 anymore after this as TGICOLOR_BLACK = 1.