From: cpg Date: Thu, 22 Jun 2000 00:50:05 +0000 (+0000) Subject: GTIA color defines; added c64 compatibility color defines X-Git-Tag: V2.12.0~3419 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=29f57b31962b65cd382048e2c0a44ac2add5ea2f;p=cc65 GTIA color defines; added c64 compatibility color defines git-svn-id: svn://svn.cc65.org/cc65/trunk@94 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/include/atari.h b/include/atari.h index da4e012f0..051d26950 100644 --- a/include/atari.h +++ b/include/atari.h @@ -10,10 +10,6 @@ #ifndef _ATARI_H #define _ATARI_H -/* Color Defines */ -#define COLOR_BLACK 0x00 -#define COLOR_WHITE 0x0E - /* Characters codes */ #define CH_DEL 0xFE #define CH_ESC 0x1B @@ -54,6 +50,54 @@ #define CH_HLINE 0x12 #define CH_VLINE 0x16 +/* color defines */ + +/* make GTIA color value */ +#define _gtia_mkcolor(hue,lum) (((hue) << 4) | ((lum) << 1)) + +/* luminance values go from 0 (black) to 7 (white) */ + +/* hue values */ +#define HUE_GREY 0 +#define HUE_GOLD 1 +#define HUE_GOLDORANGE 2 +#define HUE_REDORANGE 3 +#define HUE_ORANGE 4 +#define HUE_MAGENTA 5 +#define HUE_PURPLE 6 +#define HUE_BLUE 7 +#define HUE_BLUE2 8 +#define HUE_CYAN 9 +#define HUE_BLUEGREEN 10 +#define HUE_BLUEGREEN2 11 +#define HUE_GREEN 12 +#define HUE_YELLOWGREEN 13 +#define HUE_YELLOW 14 +#define HUE_YELLOWRED 15 + +/* Color defines, similar to c64 colors */ +#define COLOR_BLACK _gtia_mkcolor(HUE_GREY,0) +#define COLOR_WHITE _gtia_mkcolor(HUE_GREY,7) +#define COLOR_RED _gtia_mkcolor(HUE_REDORANGE,1) +#define COLOR_CYAN _gtia_mkcolor(HUE_CYAN,3) +#define COLOR_VIOLET _gtia_mkcolor(HUE_PURPLE,4) +#define COLOR_GREEN _gtia_mkcolor(HUE_GREEN,2) +#define COLOR_BLUE _gtia_mkcolor(HUE_BLUE,2) +#define COLOR_YELLOW _gtia_mkcolor(HUE_YELLOW,7) +#define COLOR_ORANGE _gtia_mkcolor(HUE_ORANGE,5) +#define COLOR_BROWN _gtia_mkcolor(HUE_YELLOW,2) +#define COLOR_LIGHTRED _gtia_mkcolor(HUE_REDORANGE,6) +#define COLOR_GRAY1 _gtia_mkcolor(HUE_GREY,2) +#define COLOR_GRAY2 _gtia_mkcolor(HUE_GREY,3) +#define COLOR_LIGHTGREEN _gtia_mkcolor(HUE_GREEN,6) +#define COLOR_LIGHTBLUE _gtia_mkcolor(HUE_BLUE,6) +#define COLOR_GRAY3 _gtia_mkcolor(HUE_GREY,5) + +/* color register functions */ +extern void __fastcall__ setcolor (unsigned char color_reg, unsigned char hue, unsigned char luminace); +extern void __fastcall__ setcolor_low (unsigned char color_reg, unsigned char color_value); +extern unsigned char __fastcall__ getcolor (unsigned char color_reg); + /* Define hardware */ #include <_gtia.h> #define GTIA (*(struct __gtia_write*)0xD000)