From: cuz Date: Sat, 22 Jun 2002 21:53:58 +0000 (+0000) Subject: Working on the TGI library X-Git-Tag: V2.12.0~2299 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=207c4a9e5604c4b75960faabf74e36cf7fba1c27;p=cc65 Working on the TGI library git-svn-id: svn://svn.cc65.org/cc65/trunk@1325 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/asminc/tgi-kernel.inc b/asminc/tgi-kernel.inc index bd81082e2..bed920317 100644 --- a/asminc/tgi-kernel.inc +++ b/asminc/tgi-kernel.inc @@ -72,7 +72,6 @@ TGI_HDR_JUMPCOUNT = 14 ; Number of jump vectors .global _tgi_curx ; Current drawing cursor X .global _tgi_cury ; Current drawing cursor Y .global _tgi_color ; Current drawing color - .global _tgi_bgcolor ; Current background color .global _tgi_xres ; X resolution of the current mode .global _tgi_yres ; Y resolution of the current mode .global _tgi_colorcount ; Number of available colors diff --git a/include/tgi.h b/include/tgi.h index da1a87187..f69d453f1 100644 --- a/include/tgi.h +++ b/include/tgi.h @@ -131,34 +131,33 @@ void __fastcall__ tgi_setcolor (unsigned char color); unsigned char __fastcall__ tgi_getcolor (void); /* Return the current drawing color */ -unsigned char __fastcall__ tgi_getbkcolor (void); -/* Return the current background color */ - -void __fastcall__ tgi_setbkcolor (unsigned char color); -/* Set the background color */ - unsigned char __fastcall__ tgi_getpixel (int x, int y); /* Get the color value of a pixel */ void __fastcall__ tgi_setpixel (int x, int y); /* Plot a point in the current drawing color */ +void __fastcall__ tgi_gotoxy (int x, int y); +/* Set the graphics cursor to the given position. */ + void __fastcall__ tgi_line (int x1, int y1, int x2, int y2); -/* Draw a line in the current drawing color */ +/* Draw a line in the current drawing color. The graphics cursor will + * be set to x2/y2 by this call. + */ void __fastcall__ tgi_lineto (int x2, int y2); /* Draw a line in the current drawing color from the graphics cursor to the - * new end point. + * new end point. The graphics cursor will be updated to x2/y2. */ void __fastcall__ tgi_circle (int x, int y, unsigned char radius); -/* Draw a circle in the current drawing color */ +/* Draw a circle in the current drawing color. */ void __fastcall__ tgi_outtext (int x, int y, const char* text); /* Print a text in graphics mode */ void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2); -/* Draw a bar (a filled rectangle) using the current color */ +/* Draw a bar (a filled rectangle) using the current color. */ diff --git a/include/tgi/tgi-kernel.h b/include/tgi/tgi-kernel.h index ff534737a..bf83d49aa 100644 --- a/include/tgi/tgi-kernel.h +++ b/include/tgi/tgi-kernel.h @@ -86,7 +86,6 @@ extern unsigned char tgi_mode; /* Graphics mode or zero */ extern int tgi_curx; /* Current drawing cursor X */ extern int tgi_cury; /* Current drawing cursor Y */ extern unsigned char tgi_color; /* Current drawing color */ -extern unsigned char tgi_bgcolor; /* Current background color */ extern unsigned tgi_xres; /* X resolution of the current mode */ extern unsigned tgi_yres; /* Y resolution of the current mode */ extern unsigned char tgi_colorcount; /* Number of available colors */ diff --git a/libsrc/tgi/Makefile b/libsrc/tgi/Makefile index 6f436fc87..df324661e 100644 --- a/libsrc/tgi/Makefile +++ b/libsrc/tgi/Makefile @@ -29,6 +29,7 @@ S_OBJS = tgi-kernel.o \ tgi_getset.o \ tgi_getxres.o \ tgi_getyres.o \ + tgi_gotoxy.o \ tgi_init.o \ tgi_line.o \ tgi_linepop.o \ diff --git a/libsrc/tgi/tgi-kernel.s b/libsrc/tgi/tgi-kernel.s index 298108932..c2be3d473 100644 --- a/libsrc/tgi/tgi-kernel.s +++ b/libsrc/tgi/tgi-kernel.s @@ -22,7 +22,6 @@ _tgi_mode: .res 1 ; Graphics mode or zero _tgi_curx: .res 2 ; Current drawing cursor X _tgi_cury: .res 2 ; Current drawing cursor Y _tgi_color: .res 1 ; Current drawing color -_tgi_bgcolor: .res 1 ; Current background color _tgi_xres: .res 2 ; X resolution of the current mode _tgi_yres: .res 2 ; Y resolution of the current mode _tgi_colorcount:.res 1 ; Number of available colors diff --git a/libsrc/tgi/tgi_gotoxy.s b/libsrc/tgi/tgi_gotoxy.s new file mode 100644 index 000000000..c36324285 --- /dev/null +++ b/libsrc/tgi/tgi_gotoxy.s @@ -0,0 +1,22 @@ +; +; Ullrich von Bassewitz, 22.06.2002 +; +; void __fastcall__ tgi_gotoxy (int x, int y); +; /* Set the current drawing pointer to the given position. */ +; + + .include "tgi-kernel.inc" + + .import popax + .export _tgi_gotoxy + +_tgi_gotoxy: + sta _tgi_cury ; Y + stx _tgi_cury+1 + jsr popax + sta _tgi_curx ; X + stx _tgi_curx+1 + rts + + +