]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Added docs for all the tgi functions and improved Lynx documentation
[cc65] / doc / funcref.sgml
index e37f49ccbd55fb6fe0ebad0fdaf05bab73f28877..2a84f718535c14522fb61b63768832a60ee8d261 100644 (file)
@@ -504,8 +504,45 @@ It does not declare any functions.
 
 <sect1><tt/tgi.h/<label id="tgi.h"><p>
 
-(incomplete)
-
+<itemize>
+<item><ref id="tgi_bar" name="tgi_bar">
+<item><ref id="tgi_circle" name="tgi_circle">
+<item><ref id="tgi_clear" name="tgi_clear">
+<item><ref id="tgi_getcolor" name="tgi_getcolor">
+<item><ref id="tgi_getcolorcount" name="tgi_getcolorcount">
+<item><ref id="tgi_getdefpalette" name="tgi_getdefpalette">
+<item><ref id="tgi_done" name="tgi_done">
+<item><ref id="tgi_geterror" name="tgi_geterror">
+<item><ref id="tgi_geterrormsg" name="tgi_geterrormsg">
+<item><ref id="tgi_getmaxcolor" name="tgi_getmaxcolor">
+<item><ref id="tgi_getmaxx" name="tgi_getmaxx">
+<item><ref id="tgi_getmaxy" name="tgi_getmaxy">
+<item><ref id="tgi_getpagecount" name="tgi_getpagecount">
+<item><ref id="tgi_getpalette" name="tgi_getpalette">
+<item><ref id="tgi_getpixel" name="tgi_getpixel">
+<item><ref id="tgi_getxres" name="tgi_getxres">
+<item><ref id="tgi_getyres" name="tgi_getyres">
+<item><ref id="tgi_gotoxy" name="tgi_gotoxy">
+<item><ref id="tgi_init" name="tgi_init">
+<item><ref id="tgi_install" name="tgi_install">
+<item><ref id="tgi_ioctl" name="tgi_ioctl">
+<item><ref id="tgi_line" name="tgi_line">
+<item><ref id="tgi_lineto" name="tgi_lineto">
+<item><ref id="tgi_load" name="tgi_load">
+<item><ref id="tgi_load_driver" name="tgi_load_driver">
+<item><ref id="tgi_outtext" name="tgi_outtext">
+<item><ref id="tgi_outtextxy" name="tgi_outtextxy">
+<item><ref id="tgi_setcolor" name="tgi_setcolor">
+<item><ref id="tgi_setdrawpage" name="tgi_setdrawpage">
+<item><ref id="tgi_setpalette" name="tgi_setpalette">
+<item><ref id="tgi_setpixel" name="tgi_setpixel">
+<item><ref id="tgi_setviewpage" name="tgi_setviewpage">
+<item><ref id="tgi_textheight" name="tgi_textheight">
+<item><ref id="tgi_textstyle" name="tgi_textstyle">
+<item><ref id="tgi_textwidth" name="tgi_textwidth">
+<item><ref id="tgi_uninstall" name="tgi_uninstall">
+<item><ref id="tgi_unload" name="tgi_unload">
+</itemize>
 
 <sect1><tt/time.h/<label id="time.h"><p>
 
@@ -4834,6 +4871,786 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>tgi_bar<label id="tgi_bar"><p>
+
+<quote>
+<descrip>
+<tag/Function/The function fills a rectangle on the drawpage with the current
+color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_bar (int x1, int y1, int x2, int y2);/
+<tag/Description/The function fills a rectangle on the drawpage with the current
+color.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi function
+<tag/Example/<verb>
+tgi_setcolor(COLOR_GREEN);
+tgi_bar(10, 10, 100, 60);
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_circle<label id="tgi_circle"><p>
+
+<quote>
+<descrip>
+<tag/Function/The function draws a circle in the current color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_circle (int x, int y, unsigned char radius);/
+<tag/Description/The function draws a circle in the current color.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/<verb>
+tgi_setcolor(COLOR_BLACK);
+tgi_circle(50, 40, 40);
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_clear<label id="tgi_clear"><p>
+
+<quote>
+<descrip>
+<tag/Function/Clear the screen
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_clear (void);/
+<tag/Description/Clear the screen
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_done<label id="tgi_done"><p>
+
+<quote>
+<descrip>
+<tag/Function/End graphics mode, switch back to text mode.
+Will NOT uninstall or unload the driver! 
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_done (void);/
+<tag/Description/End graphics mode, switch back to text mode.
+Will NOT uninstall or unload the driver! 
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getcolor<label id="tgi_getcolor"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return the current drawing color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getcolor (void);/
+<tag/Description/The actual color is an index to a palette. During tgi_init
+you will get a default palette. The number of colors depend on the platform.
+All platforms recognize at least COLOR_BLACK and COLOR_WHITE. But some
+platforms have many more predefined colors. If you paint using COLOR_GREEN
+and then you change the green of the palette to blue using tgi_setpalette then
+after this painting in COLOR_GREEN will actually be blue.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/<verb>
+color = tgi_getcolor();
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_getcolorcount<label id="tgi_getcolorcount"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the number of available colors.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getcolorcount (void);/
+<tag/Description/Tgi platforms use indexed color palettes. This function
+returns the number of entries we can use in the palette.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/<verb>
+if (tgi_getcolorcount() == 2) {
+  printf("Only monochrome graphics is supported\n");
+}
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_getdefpalette<label id="tgi_getdefpalette"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the palette installed by default.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const unsigned char* __fastcall__ tgi_getdefpalette (void);/
+<tag/Description/The tgi driver has a default palette that is active at startup.
+The named colors COLOR_BLACK, COLOR_WHITE, COLOR_RED... need this palette to
+work correctly.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_geterror<label id="tgi_geterror"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return the error code for the last operation.
+This will also clear the error.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_geterror (void);/
+<tag/Description/Return the error code for the last operation.
+This will also clear the error.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_geterrormsg<label id="tgi_geterrormsg"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get an error message describing the error.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const char* __fastcall__ tgi_geterrormsg (unsigned char code);/
+<tag/Description/Get an error message describing the error.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getmaxcolor<label id="tgi_getmaxcolor"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the highest index of the palette.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getmaxcolor (void);/
+<tag/Description/Get the highest index of the palette.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getmaxx<label id="tgi_getmaxx"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the maximum x coordinate that can be used on this screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getmaxx (void);/
+<tag/Description/Get the maximum x coordinate that can be used on this screen.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getmaxy<label id="tgi_getmaxy"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the maximum y coordinate that can be used on this screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getmaxy (void);/
+<tag/Description/Get the maximum y coordinate that can be used on this screen.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getpagecount<label id="tgi_getpagecount"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return the number of screen pages available.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getpagecount (void);/
+<tag/Description/Return the number of screen pages available.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="tgi_setdrawpage" name="tgi_setdrawpage">,
+<ref id="tgi_setviewpage" name="tgi_setviewpage">
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getpalette<label id="tgi_getpalette"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the palette installed.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/const unsigned char* __fastcall__ tgi_getpalette (void);/
+<tag/Description/Get the palette installed.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getpixel<label id="tgi_getpixel"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the color of a pixel from the viewpage.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_getpixel (int x, int y);/
+<tag/Description/Get the color of a pixel from the viewpage.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getxres<label id="tgi_getxres"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get number of horisontal pixels on the screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getxres (void);/
+<tag/Description/Get number of horisontal pixels on the screen.
+This is same as tgi_maxx()+1.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_getyres<label id="tgi_getyres"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get number of vertical pixels on the screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_getyres (void);/
+<tag/Description/Get number of vertical pixels on the screen.
+This is same as tgi_maxy()+1.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_gotoxy<label id="tgi_gotoxy"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set graphics cursor at x, y.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_gotoxy (int x, int y);/
+<tag/Description/Set graphics cursor at x, y.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_init<label id="tgi_init"><p>
+
+<quote>
+<descrip>
+<tag/Function/Initialize the already loaded graphics driver.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_init (void);/
+<tag/Description/The tgi_init function will set the default palette to the
+hardware and clear the screen.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+extern char lynxtgi[]; //Include the driver statically instead of loading it.
+tgi_install(&amp;lynxtgi);
+tgi_init(); //Set up the default palette and clear the screen.
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_install<label id="tgi_install"><p>
+
+<quote>
+<descrip>
+<tag/Function/Install an already loaded driver and return an error code.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ tgi_install (void* driver);/
+<tag/Description/The function installs a driver that was already loaded into
+memory (or linked statically to the program). It returns an error code
+(<tt/TGI_ERR_OK/ in case of success).
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only be
+used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="tgi_load_driver" name="tgi_load_driver">,
+<ref id="tgi_uninstall" name="tgi_uninstall">,
+<ref id="tgi_unload" name="tgi_unload">
+<tag/Example/<verb>
+extern char lynxtgi[]; //Include the driver statically instead of loading it.
+
+tgi_install(&amp;lynxtgi);
+tgi_init(); //Set up the default palette and clear the screen.
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_ioctl<label id="tgi_ioctl"><p>
+
+<quote>
+<descrip>
+<tag/Function/Platform dependent code extensions.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_ioctl (unsigned char code, unsigned val);/
+<tag/Description/Some platforms have extra display hardware that is not
+supported by standard tgi functions. You can extend the driver to support
+this extra hardware using tgi_ioctl functions.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>These functions are not easily portable to other cc65 platforms.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+#define tgi_sprite(spr) tgi_ioctl(0, (unsigned)(spr))
+#define tgi_flip() tgi_ioctl(1, 0)
+#define tgi_setbgcolor(bgcol) tgi_ioctl(2, (unsigned)(bgcol))
+#define tgi_setframerate(rate) tgi_ioctl(3, (unsigned)(rate))
+#define tgi_busy() tgi_ioctl(4, 0)
+#define tgi_updatedisplay() tgi_ioctl(4, 1)
+if (!tgi_busy()) {
+  tgi_sprite(&amp;background);
+  tgi_setcolor(COLOR_BLUE);
+  tgi_outttextxy(20,40,"Hello World");
+  tgi_updatedisplay();
+}
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_line<label id="tgi_line"><p>
+
+<quote>
+<descrip>
+<tag/Function/Draw a line in the current drawing color.
+The graphics cursor will be set to x2/y2 by this call.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_line (int x1, int y1, int x2, int y2);/
+<tag/Description/Draw a line in the current drawing color.
+The graphics cursor will be set to x2/y2 by this call.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_lineto<label id="tgi_lineto"><p>
+
+<quote>
+<descrip>
+<tag/Function/Draw a line in the current drawing color from the graphics
+cursor to the new end point. The graphics cursor will be updated to x2/y2.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_lineto (int x2, int y2);/
+<tag/Description/Draw a line in the current drawing color from the graphics
+cursor to the new end point. The graphics cursor will be updated to x2/y2.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_load<label id="tgi_load"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load and install the matching driver for the given mode.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_load (unsigned char mode);/
+<tag/Description/Load and install the matching driver for the given mode.
+Will just load the driver and check if loading was successul.
+Will not switch to graphics mode.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_load_driver<label id="tgi_load_driver"><p>
+
+<quote>
+<descrip>
+<tag/Function/Load and install the given driver. This function is identical
+to tgi_load with the only difference that the name of the driver is specified
+explicitly.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_load_driver (const char *name);/
+<tag/Description/Load and install the driver by name.
+Will just load the driver and check if loading was successul.
+Will not switch to graphics mode.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_outtext<label id="tgi_outtext"><p>
+
+<quote>
+<descrip>
+<tag/Function/Output text at the current graphics cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_outtext (const char* s);/
+<tag/Description/Output text at the current graphics cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_outtextxy<label id="tgi_outtextxy"><p>
+
+<quote>
+<descrip>
+<tag/Function/Output text at the given cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_outtextxy (int x, int y, const char* s);/
+<tag/Description/Output text at the given cursor position.
+The graphics cursor is moved to the end of the text.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_setcolor<label id="tgi_setcolor"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set color to be used in future draw operations.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setcolor (unsigned char color);/
+<tag/Description/Set color to be used in future draw operations.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setcolor(COLOR_BLACK);
+tgi_bar(0,0,30,30);
+tgi_setcolor(COLOR_WHITE);
+tgi_bar(10,10,20,20);
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_setdrawpage<label id="tgi_setdrawpage"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the page for drawing.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setdrawpage (unsigned char page);/
+<tag/Description/If the drawpage and the viewpage are the same then all drawing
+is seen immediately as it is drawn. For double buffered games you can set the
+drawpage to a different page than the viewpage. This lets you draw the next
+screen in the background and when the screen is ready you display it.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setdrawpage(1);
+tgi_outtextxy(10, 10, "Hello World");
+tgi_setviewpage(1); // Show page 1
+tgi_setdrawpage(0);
+tgi_outtextxy(10, 10, "Creating next frame");
+...
+tgi_setviewpage(0); // Show page 0
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_setpalette<label id="tgi_setpalette"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the palette (not available with all drivers/hardware).
+Palette is a pointer to as many entries as there are colors.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setpalette (const unsigned char* palette);/
+<tag/Description/Set the palette (not available with all drivers/hardware).
+Palette is a pointer to as many entries as there are colors.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_setpixel<label id="tgi_setpixel"><p>
+
+<quote>
+<descrip>
+<tag/Function/Plot a pixel on the drawpage with the current color.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setpixel (int x, int y);/
+<tag/Description/Plot a pixel on the drawpage with the current color.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_setviewpage<label id="tgi_setviewpage"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set page to be visible on screen.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_setviewpage (unsigned char page);/
+<tag/Description/If the drawpage and the viewpage are the same then all drawing
+is seen immediately as it is drawn. For double buffered games you can set the
+drawpage to a different page than the viewpage. This lets you draw the next
+screen in the background and when the screen is ready you display it.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/<verb>
+tgi_setdrawpage(1);
+tgi_outtextxy(10, 10, "Hello World");
+tgi_setviewpage(1); // Show page 1
+tgi_setdrawpage(0);
+tgi_outtextxy(10, 10, "Creating next frame");
+...
+tgi_setviewpage(0); // Show page 0
+</verb>
+</descrip>
+</quote>
+
+<sect1>tgi_textheight<label id="tgi_textheight"><p>
+
+<quote>
+<descrip>
+<tag/Function/Calculate the height of the text in pixels according to
+the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_textheight (const char* s);/
+<tag/Description/Calculate the height of the text in pixels according to
+the current text style.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_textstyle<label id="tgi_textstyle"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the style for text output.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_textstyle (unsigned char magx, unsigned char magy, unsigned char dir);/
+<tag/Description/Set the style for text output.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_textwidth<label id="tgi_textwidth"><p>
+
+<quote>
+<descrip>
+<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ tgi_textwidth (const char* s);/
+<tag/Function/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Description/Calculate the width of the text in pixels according to the current text style.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_uninstall<label id="tgi_uninstall"><p>
+
+<quote>
+<descrip>
+<tag/Function/Uninstall the currently loaded driver but do not unload it.
+Will call tgi_done if necessary.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_uninstall (void);/
+<tag/Description/Uninstall the currently loaded driver but do not unload it.
+Will call tgi_done if necessary.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>tgi_unload<label id="tgi_unload"><p>
+
+<quote>
+<descrip>
+<tag/Function/Uninstall, then unload the currently loaded driver.
+Will call tgi_done if necessary.
+<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
+<tag/Declaration/<tt/void __fastcall__ tgi_unload (void);/
+<tag/Description/Uninstall, then unload the currently loaded driver.
+Will call tgi_done if necessary.
+<tag/Limits/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/Other tgi functions.
+<tag/Example/None.
+</descrip>
+</quote>
+
 <sect1>time<label id="time"><p>
 
 <quote>