Re: [cc65] Atari TGI drivers, finally

From: Fatih Aygün <cyco1301yahoo.com>
Date: 2009-10-25 14:23:31
> That is true, but palettes *are* confusing. The alternative would be to no

> longer work with colors. There wouldn't be something like tgi_setcolor() or
> COLOR_RED, but tgi_setpaletteindex and PALETTE_3 or similar. This is highly
> non intuitive, especially for new users.

Maybe we should take a hybrid approach: Adding setpaletteindex but keeping 
setcolor too (which would do the mapping between colors and palettes)?

> So I would strongly suggest to keep it as it is: The palette functions are
> addons that aren't really well integrated. The normal functions like
> "setcolor" work with palette entries, but the names describe entries of the
> default palette. So tgi_setcolor (COLOR_WHITE) will call tgi_setcolor with the
> entry of the default palette that contains the color white. 

That's the exact problem I'm trying to describe. It works for c64 because 
COLOR_WHITE happens to be defined as 1. For atari it's defined as 0x0E
and setcolor wrapper prevents me from doing any reverse mapping. Either
the definition should change, which would break conio color routines, or
the wrapper should pass the setcolor parameter intact. Or maybe we should
define a new set of constants like TGI_COLOR_XXX?

Even the tgidemo.c changes palettes. In fact it uses somewhere
black on white, and draws black pixels after setcolor(COLOR_FORE), where
COLOR_FORE is defined as COLOR_WHITE! Now that is confusing :)

There is one more problem. Should the default palette be defined as white
on black? I assumed it would be whatever the platform's default palette is.
So, Atari returns whitish on bluish for mode 8 and reddish on black for other
2-color modes. Should I change them?

> As soon as someone starts using palettes it becomes non portable anyway.

Why is that? If the driver doesn't implement palettes, it returns an error code,
and everything else works as expected except you get, let's say a red circle
on a blue backrground instead of a white circle on a black background.

Regards,
Fatih.


      
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 25 14:23:36 2009

This archive was generated by hypermail 2.1.8 : 2009-10-25 14:23:39 CET