Allowed the TGI API to support 256 colors.

This commit is contained in:
Greg King 2020-06-04 12:58:05 -04:00
parent f9204e5b6f
commit 14c62f1368
2 changed files with 8 additions and 5 deletions

View File

@ -134,7 +134,7 @@ void __fastcall__ tgi_setdrawpage (unsigned char page);
/* Set the drawable page. Will set an error if the page is not available. */
unsigned char tgi_getcolorcount (void);
/* Get the number of available colors. */
/* Get the number of available colors. Zero means 256 colors. */
unsigned char tgi_getmaxcolor (void);
/* Return the maximum supported color number (the number of colors would

View File

@ -1,5 +1,6 @@
;
; Ullrich von Bassewitz, 21.06.2002
; 2002-06-21, Ullrich von Bassewitz
; 2020-06-04, Greg King
;
; void __fastcall__ tgi_setcolor (unsigned char color);
; /* Set the current drawing color */
@ -11,9 +12,11 @@
cmp _tgi_colorcount ; Compare to available colors
bcs @L1
sta _tgi_color ; Remember the drawing color
@L0: sta _tgi_color ; Remember the drawing color
jmp tgi_setcolor ; Call the driver
@L1: jmp tgi_inv_arg ; Invalid argument
@L1: ldx _tgi_colorcount
beq @L0 ; Zero means 256 colors
jmp tgi_inv_arg ; Invalid argument
.endproc