]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Adaptations due to code review.
[cc65] / doc / funcref.sgml
index d7c477958b7e09ada6a5c7206182e8a4984c73cd..ade7a855fd64fbad656bfde8cf181d6b0b960761 100644 (file)
@@ -2,8 +2,8 @@
 
 <article>
 <title>cc65 function reference
-<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
-<date>2015-07-21
+<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
+<url url="mailto:greg.king5@verizon.net" name="Greg King">
 
 <abstract>
 cc65 is a C compiler for 6502 based systems. This function reference describes
@@ -64,6 +64,30 @@ function.
 </itemize>
 
 
+<sect1><tt/accelerator.h/<label id="accelerator.h"><p>
+
+<itemize>
+<item><ref id="detect_c128" name="detect_c128">
+<item><ref id="detect_c64dtv" name="detect_c64dtv">
+<item><ref id="detect_c65" name="detect_c65">
+<item><ref id="detect_chameleon" name="detect_chameleon">
+<item><ref id="detect_scpu" name="detect_scpu">
+<item><ref id="detect_turbomaster" name="detect_turbomaster">
+<item><ref id="get_c128_speed" name="get_c128_speed">
+<item><ref id="get_c64dtv_speed" name="get_c64dtv_speed">
+<item><ref id="get_c65_speed" name="get_c65_speed">
+<item><ref id="get_chameleon_speed" name="get_chameleon_speed">
+<item><ref id="get_scpu_speed" name="get_scpu_speed">
+<item><ref id="get_turbomaster_speed" name="get_turbomaster_speed">
+<item><ref id="set_c128_speed" name="set_c128_speed">
+<item><ref id="set_c64dtv_speed" name="set_c64dtv_speed">
+<item><ref id="set_c65_speed" name="set_c65_speed">
+<item><ref id="set_chameleon_speed" name="set_chameleon_speed">
+<item><ref id="set_scpu_speed" name="set_scpu_speed">
+<item><ref id="set_turbomaster_speed" name="set_turbomaster_speed">
+</itemize>
+
+
 <sect1><tt/apple2.h/<label id="apple2.h"><p>
 
 <itemize>
@@ -79,8 +103,6 @@ function.
 <item>_dos_type
 <item><ref id="get_ostype" name="get_ostype">
 <item>rebootafterexit
-<item>textframe
-<item>textframexy
 <item><ref id="videomode" name="videomode">
 </itemize>
 
@@ -98,6 +120,7 @@ function.
 <!-- <item><ref id="_getcolor" name="_getcolor"> -->
 <!-- <item><ref id="_getdefdev" name="_getdefdev"> -->
 <!-- <item><ref id="_graphics" name="_graphics"> -->
+<item><ref id="_is_cmdline_dos" name="_is_cmdline_dos">
 <!-- <item><ref id="_rest_vecs" name="_rest_vecs"> -->
 <!-- <item><ref id="_save_vecs" name="_save_vecs"> -->
 <!-- <item><ref id="_scroll" name="_scroll"> -->
@@ -113,24 +136,23 @@ function.
 <sect1><tt/atmos.h/<label id="atmos.h"><p>
 
 <itemize>
+<item><ref id="atmos_explode" name="atmos_explode">
 <item><ref id="atmos_load" name="atmos_load">
+<item><ref id="atmos_ping" name="atmos_ping">
 <item><ref id="atmos_save" name="atmos_save">
-<!-- <item><ref id="atmos_explode" name="atmos_explode"> -->
-<!-- <item><ref id="atmos_ping" name="atmos_ping"> -->
-<!-- <item><ref id="atmos_shoot" name="atmos_shoot"> -->
-<!-- <item><ref id="atmos_tick" name="atmos_tick"> -->
-<!-- <item><ref id="atmos_tock" name="atmos_tock"> -->
-<!-- <item><ref id="atmos_zap" name="atmos_zap"> -->
+<item><ref id="atmos_shoot" name="atmos_shoot">
+<item><ref id="atmos_tick" name="atmos_tick">
+<item><ref id="atmos_tock" name="atmos_tock">
+<item><ref id="atmos_zap" name="atmos_zap">
 </itemize>
 
-(incomplete)
-
 
 <sect1><tt/c128.h/<label id="c128.h"><p>
 
 <itemize>
 <item><ref id="c64mode" name="c64mode">
 <item><ref id="fast" name="fast">
+<item><ref id="isfast" name="isfast">
 <item><ref id="slow" name="slow">
 <item><ref id="toggle_videomode" name="toggle_videomode">
 <item><ref id="videomode" name="videomode">
@@ -139,6 +161,12 @@ function.
 
 <sect1><tt/c16.h/<label id="c16.h"><p>
 
+<itemize>
+<item><ref id="fast" name="fast">
+<item><ref id="isfast" name="isfast">
+<item><ref id="slow" name="slow">
+</itemize>
+
 (incomplete)
 
 
@@ -168,9 +196,15 @@ function.
 <item><ref id="cbm_k_open" name="cbm_k_open">
 <item><ref id="cbm_k_readst" name="cbm_k_readst">
 <item><ref id="cbm_k_save" name="cbm_k_save">
+<item><ref id="cbm_k_scnkey" name="cbm_k_scnkey">
+<item><ref id="cbm_k_second" name="cbm_k_second">
 <item><ref id="cbm_k_setlfs" name="cbm_k_setlfs">
 <item><ref id="cbm_k_setnam" name="cbm_k_setnam">
+<item><ref id="cbm_k_talk" name="cbm_k_talk">
+<item><ref id="cbm_k_tksa" name="cbm_k_tksa">
+<item><ref id="cbm_k_udtim" name="cbm_k_udtim">
 <item><ref id="cbm_k_unlsn" name="cbm_k_unlsn">
+<item><ref id="cbm_k_untlk" name="cbm_k_untlk">
 <!-- <item><ref id="cbm_load" name="cbm_load"> -->
 <!-- <item><ref id="cbm_open" name="cbm_open"> -->
 <!-- <item><ref id="cbm_opendir" name="cbm_opendir"> -->
@@ -179,9 +213,8 @@ function.
 <!-- <item><ref id="cbm_save" name="cbm_save"> -->
 <!-- <item><ref id="cbm_write" name="cbm_write"> -->
 <!-- <item><ref id="get_tv" name="get_tv"> -->
+<item><ref id="waitvsync" name="waitvsync">
 <item><ref id="kbrepeat" name="kbrepeat">
-<item><ref id="kbrepeatdelay" name="kbrepeatdelay">
-<item><ref id="kbrepeatrate" name="kbrepeatrate">
 </itemize>
 
 (incomplete)
@@ -209,7 +242,7 @@ function.
 
 <sect1><tt/cc65.h/<label id="cc65.h"><p>
 
-<!-- <itemize> -->
+<itemize>
 <!-- <item><ref id="cc65_cos" name="cc65_cos"> -->
 <!-- <item><ref id="cc65_idiv32by16r16" name="cc65_idiv32by16r16"> -->
 <!-- <item><ref id="cc65_imul16x16r32" name="cc65_imul16x16r32"> -->
@@ -219,7 +252,8 @@ function.
 <!-- <item><ref id="cc65_umul16x16r32" name="cc65_umul16x16r32"> -->
 <!-- <item><ref id="cc65_umul16x8r32" name="cc65_umul16x8r32"> -->
 <!-- <item><ref id="cc65_umul8x8r16" name="cc65_umul8x8r16"> -->
-<!-- </itemize> -->
+<item><ref id="doesclrscrafterexit" name="doesclrscrafterexit">
+</itemize>
 
 (incomplete)
 
@@ -235,6 +269,10 @@ function.
 <item><ref id="chline" name="chline">
 <item><ref id="chlinexy" name="chlinexy">
 <item><ref id="clrscr" name="clrscr">
+<item><ref id="cpeekc" name="cpeekc">
+<item><ref id="cpeekcolor" name="cpeekcolor">
+<item><ref id="cpeekrevers" name="cpeekrevers">
+<item><ref id="cpeeks" name="cpeeks">
 <item><ref id="cprintf" name="cprintf">
 <item><ref id="cputc" name="cputc">
 <item><ref id="cputcxy" name="cputcxy">
@@ -286,6 +324,16 @@ function.
 (incomplete)
 
 
+<sect1><tt/device.h/<label id="device.h"><p>
+
+<itemize>
+<item><ref id="getcurrentdevice" name="getcurrentdevice">
+<item><ref id="getdevicedir" name="getdevicedir">
+<item><ref id="getfirstdevice" name="getfirstdevice">
+<item><ref id="getnextdevice" name="getnextdevice">
+</itemize>
+
+
 <sect1><tt/dio.h/<label id="dio.h"><p>
 
 <url url="dio.html" name="Low-level disk I/O API">.
@@ -306,11 +354,12 @@ function.
 <item><ref id="telldir" name="telldir">
 </itemize>
 
-(incomplete)
-
 
 <sect1><tt/em.h/<label id="em.h"><p>
 
+This header file contains definitions for extended memory access,
+see also <tt>testcode/lib/em-test.c</tt> and <tt>samples/multidemo.c</tt>.
+
 <itemize>
 <item><ref id="em_commit" name="em_commit">
 <item><ref id="em_copyfrom" name="em_copyfrom">
@@ -346,11 +395,21 @@ function.
 </itemize>
 
 
-<sect1><tt/geos.h/<label id="geos.h"><p>
+<sect1><tt/gamate.h/<label id="gamate.h"><p>
+
+<itemize>
+<!-- <item><ref id="get_tv" name="get_tv"> -->
+<item><ref id="waitvsync" name="waitvsync">
+</itemize>
 
 (incomplete)
 
 
+<sect1><tt/geos.h/<label id="geos.h"><p>
+
+<url url="geos.html" name="GEOS API">.
+
+
 <sect1><tt/joystick.h/<label id="joystick.h"><p>
 
 <itemize>
@@ -386,6 +445,13 @@ function.
 (incomplete)
 
 
+<sect1><tt/lz4.h/<label id="lz4.h"><p>
+
+<itemize>
+<item><ref id="decompress_lz4" name="decompress_lz4">
+</itemize>
+
+
 <sect1><tt/modload.h/<label id="modload.h"><p>
 
 <itemize>
@@ -416,10 +482,10 @@ function.
 
 <sect1><tt/nes.h/<label id="nes.h"><p>
 
-<!-- <itemize> -->
+<itemize>
 <!-- <item><ref id="get_tv" name="get_tv"> -->
-<!-- <item><ref id="waitvblank" name="waitvblank"> -->
-<!-- </itemize> -->
+<item><ref id="waitvsync" name="waitvsync">
+</itemize>
 
 (incomplete)
 
@@ -432,6 +498,16 @@ url="http://www.6502.org/users/andre/o65/fileformat.html" name="the o65 format">
 It does not declare any functions.
 
 
+<sect1><tt/pce.h/<label id="pce.h"><p>
+
+<itemize>
+<!-- <item><ref id="get_tv" name="get_tv"> -->
+<item><ref id="waitvsync" name="waitvsync">
+</itemize>
+
+(incomplete)
+
+
 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
 
 <itemize>
@@ -442,6 +518,16 @@ It does not declare any functions.
 </itemize>
 
 
+<sect1><tt/pen.h/<label id="pen.h"><p>
+
+<!-- <itemize> -->
+<!-- <item><ref id="pen_adjust" name="pen_adjust"> -->
+<!-- <item><ref id="pen_calibrate" name="pen_calibrate"> -->
+<!-- </itemize> -->
+
+(incomplete)
+
+
 <sect1><tt/pet.h/<label id="pet.h"><p>
 
 (incomplete)
@@ -449,13 +535,19 @@ It does not declare any functions.
 
 <sect1><tt/plus4.h/<label id="plus4.h"><p>
 
+<itemize>
+<item><ref id="fast" name="fast">
+<item><ref id="isfast" name="isfast">
+<item><ref id="slow" name="slow">
+</itemize>
+
 (incomplete)
 
 
 <sect1><tt/serial.h/<label id="serial.h"><p>
 
-The <tt/serial.h/ header file contains definitions for initializing serial
-communication.
+This header file contains definitions for initializing serial
+communication, see also <tt>testcode/lib/ser-test.c</tt>.
 
 <itemize>
 <item><ref id="ser_close" name="ser_close">
@@ -617,9 +709,12 @@ communication.
 <item><ref id="strlen" name="strlen">
 <item><ref id="strlower" name="strlower">
 <item><ref id="strlwr" name="strlwr">
+<item><ref id="strncasecmp" name="strncasecmp">
 <item><ref id="strncat" name="strncat">
 <item><ref id="strncmp" name="strncmp">
 <item><ref id="strncpy" name="strncpy">
+<item><ref id="strnicmp" name="strnicmp">
+<item><ref id="strpbrk" name="strpbrk">
 <item><ref id="strqtok" name="strqtok">
 <item><ref id="strrchr" name="strrchr">
 <item><ref id="strspn" name="strspn">
@@ -630,64 +725,34 @@ communication.
 <item><ref id="strupr" name="strupr">
 </itemize>
 
+
+<sect1><tt/telestrat.h/<label id="telestrat.h"><p>
+
+<itemize>
+<item><ref id="atmos_explode" name="explode">
+<item><ref id="atmos_ping" name="ping">
+<item><ref id="atmos_shoot" name="shoot">
+<item><ref id="atmos_zap" name="zap">
+<!-- <item><ref id="kbdclick1" name="kbdclick1"> -->
+<!-- <item><ref id="oups" name="oups"> -->
+</itemize>
+
 (incomplete)
 
 
 <sect1><tt/tgi.h/<label id="tgi.h"><p>
 
-<itemize>
-<item><ref id="tgi_arc" name="tgi_arc">
-<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_done" name="tgi_done">
-<item><ref id="tgi_ellipse" name="tgi_ellipse">
-<item><ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
-<item><ref id="tgi_getaspectratio" name="tgi_getaspectratio">
-<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_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_gettextheight" name="tgi_gettextheight">
-<item><ref id="tgi_gettextwidth" name="tgi_gettextwidth">
-<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_install_vectorfont" name="tgi_install_vectorfont">
-<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_driver" name="tgi_load_driver">
-<item><ref id="tgi_load_vectorfont" name="tgi_load_vectorfont">
-<item><ref id="tgi_outtext" name="tgi_outtext">
-<item><ref id="tgi_outtextxy" name="tgi_outtextxy">
-<item><ref id="tgi_setaspectratio" name="tgi_setaspectratio">
-<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_settextscale" name="tgi_settextscale">
-<item><ref id="tgi_settextstyle" name="tgi_settextstyle">
-<item><ref id="tgi_uninstall" name="tgi_uninstall">
-<item><ref id="tgi_unload" name="tgi_unload">
-</itemize>
+<url url="tgi.html" name="Tiny Graphics Interface">.
+
 
 <sect1><tt/time.h/<label id="time.h"><p>
 
 <itemize>
-<!-- <item><ref id="_systime" name="_systime"> -->
 <!-- <item><ref id="asctime" name="asctime"> -->
 <item><ref id="clock" name="clock">
+<item><ref id="clock_getres" name="clock_getres">
+<item><ref id="clock_gettime" name="clock_gettime">
+<item><ref id="clock_settime" name="clock_settime">
 <!-- <item><ref id="ctime" name="ctime"> -->
 <!-- <item><ref id="gmtime" name="gmtime"> -->
 <!-- <item><ref id="localtime" name="localtime"> -->
@@ -704,7 +769,7 @@ communication.
 <itemize>
 <!-- <item><ref id="chdir" name="chdir"> -->
 <item><ref id="exec" name="exec">
-<!-- <item><ref id="getcwd" name="getcwd"> -->
+<item><ref id="getcwd" name="getcwd">
 <item><ref id="getopt" name="getopt">
 <!-- <item><ref id="lseek" name="lseek"> -->
 <!-- <item><ref id="mkdir" name="mkdir"> -->
@@ -942,6 +1007,20 @@ id="malloc" name="malloc"> may still return <tt/NULL/.
 </quote>
 
 
+<sect1>_is_cmdline_dos<label id="_is_cmdline_dos"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determines whether the underlying DOS supports command line arguments.
+<tag/Header/<tt/<ref id="atari.h" name="atari.h">/
+<tag/Declaration/<tt/unsigned char _is_cmdline_dos (void);/
+<tag/Description/The function returns 0 if the DOS doesn't support command line arguments.
+It returns 1 if it does.
+<tag/Availability/cc65 (<tt/atari/ and <tt/atarixl/ platforms)
+</descrip>
+</quote>
+
+
 <sect1>_poserror<label id="_poserror"><p>
 
 <quote>
@@ -1322,6 +1401,30 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>atmos_explode<label id="atmos_explode"><p>
+
+<quote>
+<descrip>
+<tag/Function/Bomb sound effect.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_explode(void);/
+<tag/Description/<tt/atmos_explode/ plays the BASIC sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_ping" name="atmos_ping">,
+<ref id="atmos_shoot" name="atmos_shoot">,
+<ref id="atmos_tick" name="atmos_tick">,
+<ref id="atmos_tock" name="atmos_tock">,
+<ref id="atmos_zap" name="atmos_zap">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>atmos_load<label id="atmos_load"><p>
 
 <quote>
@@ -1342,6 +1445,30 @@ only in the presence of a prototype.
 </quote>
 
 
+<sect1>atmos_ping<label id="atmos_ping"><p>
+
+<quote>
+<descrip>
+<tag/Function/Bell or ricochet sound effect.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_ping(void);/
+<tag/Description/<tt/atmos_ping/ plays the BASIC sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_explode" name="atmos_explode">,
+<ref id="atmos_shoot" name="atmos_shoot">,
+<ref id="atmos_tick" name="atmos_tick">,
+<ref id="atmos_tock" name="atmos_tock">,
+<ref id="atmos_zap" name="atmos_zap">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>atmos_save<label id="atmos_save"><p>
 
 <quote>
@@ -1364,6 +1491,102 @@ atmos_save("hires", 0xa000, 0xc000);
 </quote>
 
 
+<sect1>atmos_shoot<label id="atmos_shoot"><p>
+
+<quote>
+<descrip>
+<tag/Function/Pistol sound effect.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_shoot(void);/
+<tag/Description/<tt/atmos_shoot/ plays the BASIC sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_explode" name="atmos_explode">,
+<ref id="atmos_ping" name="atmos_ping">,
+<ref id="atmos_tick" name="atmos_tick">,
+<ref id="atmos_tock" name="atmos_tock">,
+<ref id="atmos_zap" name="atmos_zap">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>atmos_tick<label id="atmos_tick"><p>
+
+<quote>
+<descrip>
+<tag/Function/High-pitch click.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_tick(void);/
+<tag/Description/<tt/atmos_tick/ plays the system sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_explode" name="atmos_explode">,
+<ref id="atmos_ping" name="atmos_ping">,
+<ref id="atmos_shoot" name="atmos_shoot">,
+<ref id="atmos_tock" name="atmos_tock">,
+<ref id="atmos_zap" name="atmos_zap">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>atmos_tock<label id="atmos_tock"><p>
+
+<quote>
+<descrip>
+<tag/Function/Low-pitch click.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_tock(void);/
+<tag/Description/<tt/atmos_tock/ plays the system sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_explode" name="atmos_explode">,
+<ref id="atmos_ping" name="atmos_ping">,
+<ref id="atmos_shoot" name="atmos_shoot">,
+<ref id="atmos_tick" name="atmos_tick">,
+<ref id="atmos_zap" name="atmos_zap">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>atmos_zap<label id="atmos_zap"><p>
+
+<quote>
+<descrip>
+<tag/Function/Raygun sound effect.
+<tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
+<tag/Declaration/<tt/void __fastcall__ atmos_zap(void);/
+<tag/Description/<tt/atmos_zap/ plays the BASIC sound.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="atmos_explode" name="atmos_explode">,
+<ref id="atmos_ping" name="atmos_ping">,
+<ref id="atmos_shoot" name="atmos_shoot">,
+<ref id="atmos_tick" name="atmos_tick">,
+<ref id="atmos_tock" name="atmos_tock">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>atoi<label id="atoi"><p>
 
 <quote>
@@ -1870,7 +2093,7 @@ only be used in presence of a prototype.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
-<ref id="cbm_k_unlsn" name="cbm_k_unlsn">,
+<ref id="cbm_k_unlsn" name="cbm_k_unlsn">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -1977,6 +2200,56 @@ only be used in presence of a prototype.
 </quote>
 
 
+<sect1>cbm_k_scnkey<label id="cbm_k_scnkey"><p>
+
+<quote>
+<descrip>
+<tag/Function/Scan the keyboard matrix.
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void cbm_k_scnkey (void);/
+<tag/Description/This function looks at the switches in the keyboard, to see
+if any of them are being pressed.  If they are, then code numbers for them are
+stored in RAM.  Other functions use those numbers to input text.  Normally,
+the keyboard is scanned by the Kernal's Interrupt Service Routine.  But, if
+you divert the "Jiffy interrupt" to a C-code ISR, then that ISR must call this
+function, in order to provide input from the keyboard.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_getin" name="cbm_k_getin">,
+<ref id="cbm_k_udtim" name="cbm_k_udtim">,
+<ref id="cgetc" name="cgetc">,
+<!-- <ref id="getc" name="getc"> -->
+<!-- <ref id="getchar" name="getchar"> -->
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cmb_k_second<label id="cbm_k_second"><p>
+
+<quote>
+<descrip>
+<tag/Function/Send secondary address for LISTEN.
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/void __fastcall__ cbm_k_second (unsigned char addr);/
+<tag/Description/This function is used to send a secondary address to an I/O
+device after a call to LISTEN is made, and the device is commanded to LISTEN.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may
+only be used in presence of a prototype.
+<item>The function can only be called after a call to LISTEN.
+<item>The function will not work after a TALK.
+<item>When a secondary address is to be sent to a device on the serial bus,
+the address must first be ORed with $60.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cbm_k_listen" name="cbm_k_listen">
+<tag/Exampe/None.
+</descrip>
+</quote>
+
+
 <sect1>cbm_k_setlfs<label id="cbm_k_setlfs"><p>
 
 <quote>
@@ -2042,95 +2315,93 @@ only be used in presence of a prototype.
 </quote>
 
 
-<sect1>cbm_k_unlsn<label id="cbm_k_unlsn"><p>
+<sect1>cbm_k_tksa<label id="cbm_k_tksa"><p>
 
 <quote>
 <descrip>
-<tag/Function/Send an UNLISTEN command
+<tag/Function/Send TALK secondary address to serial bus
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
-<tag/Declaration/<tt/void cbm_k_unlsn (void);/
-<tag/Description/This function commands all devices on the serial bus to
-stop receiving data from the host computer (i.e., UNLISTEN). Calling this
-function results in an UNLISTEN command being transmitted on the serial
-bus. Only devices previously commanded to LISTEN are affected. This
-function is normally used after the host computer is finished sending data
-to external devices. Sending the UNLISTEN commands the listening devices
-to get off the serial bus so it can be used for other purposes.
+<tag/Declaration/<tt/void __fastcall__ cbm_k_tksa (unsigned char addr);/
+<tag/Description/This function transmits a secondary address on the serial bus for a TALK device.
 <tag/Notes/<itemize>
-<item>
+<item>The function is only available as fastcall function, so it may
+only be used in presence of a prototype.
+<item>The function can only be called after a call to TALK.
+<item>The function will not work after a LISTEN.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
-<ref id="cbm_k_listen" name="cbm_k_listen">
+<ref id="cbm_k_talk" name="cbm_k_talk">
 <tag/Example/None.
 </descrip>
 </quote>
 
-<sect1>kbrepeat<label id="kbrepeat"><p>
+
+<sect1>cbm_k_udtim<label id="cbm_k_udtim"><p>
 
 <quote>
 <descrip>
-<tag/Function/Set keyboard repeat mode
+<tag/Function/Update the Jiffy clock.
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
-<tag/Declaration/<tt/unsigned char kbrepeat (unsigned char);/
-<tag/Description/This function changes what keys will have automatic repeat when
-being hold down for a certain time. Possible values are KBDREPEAT_CURSOR (repeat
-only cursor-related keys), KBDREPEAT_NONE (no repeat for any keys) and 
-KBDREPEAT_ALL (repeat all keys).
-The old mode is returned so it can be restored later.
-<tag/Notes/<itemize>
-<item>
-</itemize>
+<tag/Declaration/<tt/void cbm_k_udtim (void);/
+<tag/Description/This function adds one count to the Jiffy clock.  That clock
+counts sixtieths of a second.  It is used by the library's <tt/clock()/
+function.  Normally, the Jiffy clock is updated by the Kernal's Interrupt
+Service Routine.  But, if you divert the "Jiffy interrupt" to a C-code ISR,
+then that ISR must call this function, in order to keep the clock valid.
 <tag/Availability/cc65
 <tag/See also/
-<ref id="kbrepeatdelay" name="kbrepeatdelay">
-<ref id="kbrepeatrate" name="kbrepeatrate">
+<ref id="cbm_k_scnkey" name="cbm_k_scnkey">,
+<ref id="clock" name="clock">
 <tag/Example/None.
 </descrip>
 </quote>
 
-<sect1>kbrepeatdelay<label id="kbrepeatdelay"><p>
+
+<sect1>cbm_k_unlsn<label id="cbm_k_unlsn"><p>
 
 <quote>
 <descrip>
-<tag/Function/Set keyboard repeat delay
+<tag/Function/Send an UNLISTEN command
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
-<tag/Declaration/<tt/unsigned char kbrepeatdelay (unsigned char);/
-<tag/Description/This function changes the delay until a keypress is being
-repeated automatically.
-The old value is returned so it can be restored later.
-<tag/Notes/<itemize>
-<item>
-</itemize>
+<tag/Declaration/<tt/void cbm_k_unlsn (void);/
+<tag/Description/This function commands all devices on the serial bus to
+stop receiving data from the host computer (i.e., UNLISTEN). Calling this
+function results in an UNLISTEN command being transmitted on the serial
+bus. Only devices previously commanded to LISTEN are affected. This
+function is normally used after the host computer is finished sending data
+to external devices. Sending the UNLISTEN commands the listening devices
+to get off the serial bus so it can be used for other purposes.
 <tag/Availability/cc65
 <tag/See also/
-<ref id="kbrepeat" name="kbrepeat">
-<ref id="kbrepeatrate" name="kbrepeatrate">
+<ref id="cbm_k_listen" name="cbm_k_listen">
 <tag/Example/None.
 </descrip>
 </quote>
 
-<sect1>kbrepeatrate<label id="kbrepeatrate"><p>
+
+<sect1>cbm_k_untlk<label id="cbm_k_untlk"><p>
 
 <quote>
 <descrip>
-<tag/Function/Set keyboard repeat rate
+<tag/Function/Send an UNTALK command
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
-<tag/Declaration/<tt/unsigned char kbrepeatrate (unsigned char);/
-<tag/Description/This function changes the keyboard repeat rate (the time between
-repeated keypresses).
-The old value is returned so it can be restored later.
-<tag/Notes/<itemize>
-<item>
-</itemize>
+<tag/Declaration/<tt/void cbm_k_untlk (void);/
+<tag/Description/This function commands all devices on the serial bus to
+stop sending data to the host computer (i.e., UNTALK). Calling this
+function results in an UNTALK command being transmitted on the serial
+bus. Only devices previously commanded to TALK are affected. This
+function is normally used after the host computer is finished listening to data
+from an external device. Sending the UNTALK commands the sending devices
+to get off the serial bus so it can be used for other purposes.
 <tag/Availability/cc65
 <tag/See also/
-<ref id="kbrepeat" name="kbrepeat">
-<ref id="kbrepeatdelay" name="kbrepeatdelay">
+<ref id="cbm_k_talk" name="cbm_k_talk">
 <tag/Example/None.
 </descrip>
 </quote>
 
+
 <sect1>cclear<label id="cclear"><p>
 
 <quote>
@@ -2185,15 +2456,18 @@ only be used in presence of a prototype.
 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
 <tag/Declaration/<tt/char cgetc (void);/
 <tag/Description/The function reads a character from the keyboard. If there is
-no character available, <tt/cgetc/ waits until the user presses a key. If the
+no character available, <tt/cgetc()/ waits until the user presses a key. If the
 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
 displayed while waiting.
 <tag/Notes/<itemize>
-<item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
-from this buffer and wait only if the buffer is empty.
+<item>If the system supports a keyboard buffer, <tt/cgetc()/ will fetch a key
+from that buffer; and, wait only if the buffer is empty.
+<item>The keyboard must be scanned periodically, in order for this function to
+see anything that you type.  (See the description of <tt/cbm_k_scnkey()/.)
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
+<ref id="cbm_k_scnkey" name="cbm_k_scnkey">,
 <ref id="cursor" name="cursor">,
 <ref id="kbhit" name="kbhit">
 <tag/Example/None.
@@ -2283,47 +2557,133 @@ used in presence of a prototype.
 <tag/Header/<tt/<ref id="time.h" name="time.h">/
 <tag/Declaration/<tt/clock_t clock (void);/
 <tag/Description/The <tt/clock/ function returns an approximaton of processor
-time used by the program. The time is returned in implementation defined
+time used by the program. The time is returned in implementation-defined
 units. It can be converted to seconds by dividing by the value of the macro
 <tt/CLOCKS_PER_SEC/.
 <tag/Notes/<itemize>
-<item>Since the machines, cc65 generated programs run on, cannot run multiple
-processes, the function will actually return the time since some
-implementation defined point in the past.
+<item>Since the machines that cc65-generated programs run on cannot run multiple
+processes, the function actually will return the time since some
+implementation-defined point in the past.
+<item>The Jiffy clock must be "running", in order for this function to return
+changing values.  (See the description of <tt/cbm_k_udtim()/.)
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
+<ref id="cbm_k_udtim" name="cbm_k_udtim">,
 <ref id="time" name="time">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>clrscr<label id="clrscr"><p>
+<sect1>clock_getres<label id="clock_getres"><p>
 
 <quote>
 <descrip>
-<tag/Function/Clear the text screen.
-<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
-<tag/Declaration/<tt/void clrscr (void);/
-<tag/Description/The function clears the text screen and moves the cursor to
-the upper left corner.
-<tag/Availability/cc65
+<tag/Function/Determine the realtime clock resolution.
+<tag/Header/<tt/<ref id="time.h" name="time.h">/
+<tag/Declaration/<tt/int __fastcall__ clock_getres (clockid_t clock_id, struct timespec *res);/
+<tag/Description/The <tt/clock_getres/ function finds the resolution (precision)
+of the realtime clock. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. If <tt/res/
+is not <tt/NULL/, the resolution of the realtime clock is stored in the location
+pointed to by <tt/res/. If <tt/res/ is <tt/NULL/, the clock resolution is not returned.
+If the <tt/time/ argument of <tt/<ref id="clock_settime" name="clock_settime">/ is not
+a multiple of <tt/res/, then the value is truncated to a multiple of <tt/res/. On
+success, zero is returned. On error, -1 is returned and <tt/errno/ is set to an
+error code describing the reason for the failure.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>Depending on the target either the <tt/tv_sec/ or the <tt/tv_nsec/
+field of the <tt/struct timespec/ returned is zero.
+</itemize>
+<tag/Availability/POSIX 1003.1
 <tag/See also/
-<ref id="cclear" name="cclear">,
-<ref id="cclearxy" name="cclearxy">
+<ref id="clock_gettime" name="clock_gettime">,
+<ref id="clock_settime" name="clock_settime">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>close<label id="close"><p>
+<sect1>clock_gettime<label id="clock_gettime"><p>
 
 <quote>
 <descrip>
-<tag/Function/Close a file descriptor.
-<tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
-<tag/Declaration/<tt/int __fastcall__ close (int fd);/
+<tag/Function/Get the time from the realtime clock.
+<tag/Header/<tt/<ref id="time.h" name="time.h">/
+<tag/Declaration/<tt/int __fastcall__ clock_gettime (clockid_t clock_id, struct timespec *tp);/
+<tag/Description/The <tt/clock_gettime/ function retrieves the time since the 1970-01-01 00:00:00
+measured in nanoseconds. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. On success, zero is
+returned. On error, -1 is returned and <tt/errno/ is set to an error code describing the
+reason for the failure.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>Many platforms supported by cc65 do not have a realtime clock, so the
+retrieved value may not be valid. See also the platform-specific information.
+</itemize>
+<tag/Availability/POSIX 1003.1
+<tag/See also/
+<ref id="clock_getres" name="clock_getres">,
+<ref id="clock_settime" name="clock_settime">
+<ref id="time" name="time">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>clock_settime<label id="clock_settime"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the time from the realtime clock.
+<tag/Header/<tt/<ref id="time.h" name="time.h">/
+<tag/Declaration/<tt/int __fastcall__ clock_settime (clockid_t clock_id, const struct timespec *tp);/
+<tag/Description/The <tt/clock_settime/ function sets the time since the 1970-01-01 00:00:00
+measured in nanoseconds. <tt/clock_id/ has to be <tt/CLOCK_REALTIME/. On success, zero is
+returned. On error, -1 is returned and <tt/errno/ is set to an error code describing the
+reason for the failure.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>Many platforms supported by cc65 do not have a realtime clock, so
+setting the time may not work. See also the platform-specific information.
+</itemize>
+<tag/Availability/POSIX 1003.1
+<tag/See also/
+<ref id="clock_getres" name="clock_getres">,
+<ref id="clock_gettime" name="clock_gettime">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>clrscr<label id="clrscr"><p>
+
+<quote>
+<descrip>
+<tag/Function/Clear the text screen.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/void clrscr (void);/
+<tag/Description/The function clears the text screen and moves the cursor to
+the upper left corner.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cclear" name="cclear">,
+<ref id="cclearxy" name="cclearxy">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>close<label id="close"><p>
+
+<quote>
+<descrip>
+<tag/Function/Close a file descriptor.
+<tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
+<tag/Declaration/<tt/int __fastcall__ close (int fd);/
 <tag/Description/The function closes the given file descriptor. It returns zero
 on success and -1 on error. If an error occurs, the cause can be determined by
 reading the <tt/errno/ variable.
@@ -2363,6 +2723,121 @@ be used in presence of a prototype.
 </quote>
 
 
+<sect1>cpeekc<label id="cpeekc"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get a character from the display memory.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/char cpeekc (void);/
+<tag/Description/The function gets the character that's at the current location
+of the cursor in the display screen RAM.  That character is converted, if
+needed, into the encoding that can be passed to <tt/cputc()/.
+<tag/Notes/<itemize>
+<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
+done to make it obvious that peeking doesn't move the cursor in any way.  Your
+program must place the cursor where it wants to peek before it calls any of
+those functions.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cpeekcolor" name="cpeekcolor">,
+<ref id="cpeekrevers" name="cpeekrevers">,
+<ref id="cpeeks" name="cpeeks">,
+<ref id="cputc" name="cputc">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cpeekcolor<label id="cpeekcolor"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get a color from the display memory.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/unsigned char cpeekcolor (void);/
+<tag/Description/The function gets the color number that's at the current
+location of the cursor in the display screen RAM.  That number can be passed to
+<tt/textcolor()/.
+<tag/Notes/<itemize>
+<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
+done to make it obvious that peeking doesn't move the cursor in any way.  Your
+program must place the cursor where it wants to peek before it calls any of
+those functions.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cpeekc" name="cpeekc">,
+<ref id="cpeekrevers" name="cpeekrevers">,
+<ref id="cpeeks" name="cpeeks">,
+<ref id="cputc" name="cputc">,
+<ref id="textcolor" name="textcolor">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cpeekrevers<label id="cpeekrevers"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get a reverse-character attribute from the display memory.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/unsigned char cpeekrevers (void);/
+<tag/Description/The function gets the "reverse-mode" attribute of the
+character that's at the current location of the cursor in the display screen
+RAM.  It returns a boolean value (0/1) that can be passed to <tt/revers()/.
+<tag/Notes/<itemize>
+<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
+done to make it obvious that peeking doesn't move the cursor in any way.  Your
+program must place the cursor where it wants to peek before it calls any of
+those functions.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cpeekc" name="cpeekc">,
+<ref id="cpeekcolor" name="cpeekcolor">,
+<ref id="cpeeks" name="cpeeks">,
+<ref id="cputc" name="cputc">,
+<ref id="revers" name="revers">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cpeeks<label id="cpeeks"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get a string from the display memory.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/void __fastcall__ cpeeks (char* s, unsigned length);/
+<tag/Description/The function gets a fixed-length string ('\0'-terminated) of
+characters that start at the current location of the cursor in the display
+screen RAM.  Those characters are converted, if needed, into the encoding that
+can be passed to <tt/cputs()/.  The first argument must point to a RAM area
+that's large enough to hold "length + 1" bytes.
+<tag/Notes/<itemize>
+<item>Conio peek functions don't have <tt/cpeek...xy()/ versions.  That was
+done to make it obvious that peeking doesn't move the cursor in any way.  Your
+program must place the cursor where it wants to peek before it calls any of
+those functions.
+<item>The function is available as only a fastcall function;
+so, it may be used only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="cpeekc" name="cpeekc">,
+<ref id="cpeekcolor" name="cpeekcolor">,
+<ref id="cpeekrevers" name="cpeekrevers">,
+<ref id="cputc" name="cputc">,
+<ref id="cputs" name="cputs">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>creat<label id="creat"><p>
 
 <quote>
@@ -2598,6 +3073,143 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>decompress_lz4<label id="decompress_lz4"><p>
+
+<quote>
+<descrip>
+<tag/Function/Uncompress a LZ4-compressed buffer.
+<tag/Header/<tt/<ref id="lz4.h" name="lz4.h">/
+<tag/Declaration/<tt/void decompress_lz4 (const unsigned char* src, unsigned char* const dst, const unsigned short uncompressed_size);/
+<tag/Description/<tt/decompress_lz4/ uncompresses a LZ4-compressed buffer.
+<tag/Notes/<itemize>
+<item>Use LZ4_compress_HC with compression level 16 for best compression.
+</itemize>
+<tag/Availability/cc65
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_c128<label id="detect_c128"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check if a C128 CPU is the current CPU.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_c128 (void);/
+<tag/Description/The function returns a 1 if a C128 CPU is the current CPU.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64 and C128.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_c128_speed" name="get_c128_speed">,
+<ref id="set_c128_speed" name="set_c128_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_c64dtv<label id="detect_c64dtv"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check for the presence of the C64DTV.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_c64dtv (void);/
+<tag/Description/The function returns a 1 if a C64DTV has been detected.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_c64dtv_speed" name="get_c64dtv_speed">,
+<ref id="set_c64dtv_speed" name="set_c64dtv_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_c65<label id="detect_c65"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check for the presence of a C65/C64DX in C64 mode.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_c65 (void);/
+<tag/Description/The function returns a 1 if a C65/C64DX in C64 mode has been detected.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_c65_speed" name="get_c65_speed">,
+<ref id="set_c65_speed" name="set_c65_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_chameleon<label id="detect_chameleon"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check for the presence of the C64 Chameleon cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_chameleon (void);/
+<tag/Description/The function returns a 1 if a C64 Chameleon cartridge has been detected.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_chameleon_speed" name="get_chameleon_speed">,
+<ref id="set_chameleon_speed" name="set_chameleon_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_scpu<label id="detect_scpu"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check for the presence of the C64/C128 SuperCPU cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_scpu (void);/
+<tag/Description/The function returns a 1 if a SuperCPU cartridge has been detected.
+<tag/Notes/<itemize>
+<item>The function is specific to the C128 and C64.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_scpu_speed" name="get_scpu_speed">,
+<ref id="set_scpu_speed" name="set_scpu_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>detect_turbomaster<label id="detect_turbomaster"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check for the presence of the C64 Turbo Master cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char detect_turbomaster (void);/
+<tag/Description/The function returns a 1 if a C64 Turbo Master cartridge has been detected.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="get_turbomaster_speed" name="get_turbomaster_speed">,
+<ref id="set_turbomaster_speed" name="set_turbomaster_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>div<label id="div"><p>
 
 <quote>
@@ -2619,6 +3231,40 @@ ldiv
 </quote>
 
 
+<sect1>doesclrscrafterexit<label id="doesclrscrafterexit"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determines whether the screen is going to be cleared after program exit.
+<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
+<tag/Declaration/<tt/unsigned char doesclrscrafterexit (void);/
+<tag/Description/The function returns zero if the screen won't be cleared immediately after
+program termination. It returns a non-zero value if it will.
+<tag/Notes/<itemize>
+<item>Some systems, maybe depending on configuration, immediately clear the screen
+after a program exits. Therefore it might be difficult to read
+the last messages printed by the program prior to its exit. This function can be used
+to decide if a delay or wait for a key press should be executed when then program
+exits.
+</itemize>
+<tag/Availability/cc65
+<tag/Example/<verb>
+/* Hello World */
+#include &lt;stdio.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;cc65.h&gt;
+int main(void)
+{
+    printf("Hello World\n");
+    if (doesclrscrafterexit())
+        sleep(5);
+    return 0;
+}
+</verb>
+</descrip>
+</quote>
+
+
 <sect1>em_commit<label id="em_commit"><p>
 
 <quote>
@@ -2957,20 +3603,21 @@ program, it may not be able to read it.
 
 <quote>
 <descrip>
-<tag/Function/Switch the C128 into 2MHz mode.
-<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Function/Switch the CPU into fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
+<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
 <tag/Declaration/<tt/void fast (void);/
-<tag/Description/The function will switch the clock of the C128 to 2MHz. This
-will nearly double the speed compared to slow mode.
+<tag/Description/The function will switch the clock of the CPU to fast mode. For the C128
+target it means switching the CPU into 2MHz mode. For the C16/Plus4 target it means
+switching the CPU into double clock mode.
 <tag/Notes/<itemize>
-<item>The function is specific to the C128.
-<item>2MHz clock will not work in 40 column mode.
+<item>The function is specific to the C128, C16 and Plus4.
+<item>On the C128 the 2MHz clock will not work in 40 column mode.
 </itemize>
-<tag/Availability/C128
+<tag/Availability/cc65 (not all platforms)
 <tag/See also/
+<ref id="isfast" name="isfast">,
 <ref id="slow" name="slow">,
-<ref id="toggle_videomode" name="toggle_videomode">,
-<ref id="videomode" name="videomode">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -3102,58 +3749,325 @@ header files define constants that can be used to check the return code.
 </quote>
 
 
-<sect1>getcpu<label id="getcpu"><p>
+<sect1>get_c128_speed<label id="get_c128_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Determine on which CPU the program is running.
-<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
-<tag/Declaration/<tt/unsigned char getcpu (void);/
-<tag/Description/The function checks on which CPU the code is running. It
-returns one of the constants<itemize>
-<item><tt/CPU_6502/
-<item><tt/CPU_65C02/
-<item><tt/CPU_65816/
+<tag/Function/Get the current speed of the C128 CPU.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_c128_speed (void);/
+<tag/Description/The function returns the current speed of the C128 CPU.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64 and C128.
+<item>The function does not check if the C128 CPU is the current CPU.
+<item>See the accelerator.h header for the speed definitions.
 </itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c128" name="detect_c128">,
+<ref id="set_c128_speed" name="set_c128_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>get_c64dtv_speed<label id="get_c64dtv_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the current speed of the C64DTV.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_c64dtv_speed (void);/
+<tag/Description/The function returns the current speed of the C64DTV.
 <tag/Notes/<itemize>
-<item>Other, more exotic CPU types are not disinguished.
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64DTV.
+<item>See the accelerator.h header for the speed definitions.
 </itemize>
-<tag/Availability/cc65
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c64dtv" name="detect_c64dtv">,
+<ref id="set_c64dtv_speed" name="set_c64dtv_speed">,
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>getenv<label id="getenv"><p>
+<sect1>get_c65_speed<label id="get_c65_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Return a value from the environment.
-<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
-<tag/Description/The function searches the environment for an entry that
-matches <tt/name/ and returns its value. The environment consists of a list
-of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
-returns <tt/NULL/.
+<tag/Function/Get the current speed of the C65/C64DX in C64 mode.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_c65_speed (void);/
+<tag/Description/The function returns the current speed of the C65/C64DX in C64 mode.
 <tag/Notes/<itemize>
-<item>What exactly is stored in the environment depends on the machine the
-program is running on.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of a C65/C64DX in C64 mode.
+<item>See the accelerator.h header for the speed definitions.
 </itemize>
-<tag/Availability/ISO 9899
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c65" name="detect_c65">,
+<ref id="set_c65_speed" name="set_c65_speed">,
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>getopt<label id="getopt"><p>
+<sect1>get_chameleon_speed<label id="get_chameleon_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Parse command line options.
-<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
-<tag/Declaration/<tt/int __fastcall__ getopt (int argc, char* const* argv,
+<tag/Function/Get the current speed of the C64 Chameleon cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_chameleon_speed (void);/
+<tag/Description/The function returns the current speed of the C64 Chameleon cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64 Chameleon cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_chameleon" name="detect_chameleon">,
+<ref id="set_chameleon_speed" name="set_chameleon_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>get_scpu_speed<label id="get_scpu_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the current speed of the C64/C128 SuperCPU cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_scpu_speed (void);/
+<tag/Description/The function returns the current speed of the SuperCPU cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C128 and C64.
+<item>The function does not check for the presence of the cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_scpu" name="detect_scpu">,
+<ref id="set_scpu_speed" name="set_scpu_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>get_turbomaster_speed<label id="get_turbomaster_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get the current speed of the C64 Turbo Master cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char get_turbomaster_speed (void);/
+<tag/Description/The function returns the current speed of the C64 Turbo Master cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64 Turbo Master cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_turbomaster" name="detect_turbomaster">,
+<ref id="set_turbomaster_speed" name="set_turbomaster_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+<sect1>getcpu<label id="getcpu"><p>
+
+<quote>
+<descrip>
+<tag/Function/Determine on which CPU the program is running.
+<tag/Header/<tt/<ref id="6502.h" name="6502.h">/
+<tag/Declaration/<tt/unsigned char getcpu (void);/
+<tag/Description/The function checks on which CPU the code is running. It
+returns one of the constants<itemize>
+<item><tt/CPU_6502/
+<item><tt/CPU_65C02/
+<item><tt/CPU_65816/
+<item><tt/CPU_4510/
+<item><tt/CPU_65SC02/
+<item><tt/CPU_65CE02/
+<item><tt/CPU_HUC6280/
+<item><tt/CPU_2A0x/
+</itemize>
+<tag/Notes/<itemize>
+<item>Other, more exotic CPU types are not disinguished.
+</itemize>
+<tag/Availability/cc65
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>getcurrentdevice<label id="getcurrentdevice"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get current device.
+<tag/Header/<tt/<ref id="device.h" name="device.h">/
+<tag/Declaration/<tt/unsigned char getcurrentdevice (void);/
+<tag/Description/The function returns the current device.
+It allows to access the current device with the <ref id="dio.h"
+name="Low-level disk I/O API"> or <ref id="cbm.h" name="cbm_* I/O
+functions"> requiring a 'device' parameter.
+<tag/Availability/cc65
+<tag/See also/
+<ref id="getdevicedir" name="getdevicedir">,
+<ref id="getfirstdevice" name="getfirstdevice">,
+<ref id="getnextdevice" name="getnextdevice">
+<tag/Example/<verb>
+dio_open (getcurrentdevice ());
+</verb>
+</descrip>
+</quote>
+
+
+<sect1>getcwd<label id="getcwd"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get current working directory.
+<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
+<tag/Declaration/<tt/char* __fastcall__ getcwd (char* buf, size_t size);/
+<tag/Description/The function will return the current working directory.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/POSIX 1003.1
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>getdevicedir<label id="getdevicedir"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get device directory.
+<tag/Header/<tt/<ref id="device.h" name="device.h">/
+<tag/Declaration/<tt/char* __fastcall__ getdevicedir (unsigned char device, char* buf, size_t size);/
+<tag/Description/The function returns the directory representing <tt/device/.
+It allows to access the device on filesystem level by calling chdir() with
+the directory returned.
+<tag/Notes/<itemize>
+<item>Calling getdevicedir() <em/does/ check for a (formatted) disk in a
+floppy-disk-type device and returns NULL if that check fails.
+<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="getcwd" name="getcwd">,
+<ref id="getcurrentdevice" name="getcurrentdevice">,
+<ref id="getfirstdevice" name="getfirstdevice">,
+<ref id="getnextdevice" name="getnextdevice">
+<tag/Example/<verb>
+chdir (getdevicedir (device, buf, sizeof buf));
+</verb>
+cf. <tt/samples/enumdevdir.c/
+</descrip>
+</quote>
+
+
+<sect1>getenv<label id="getenv"><p>
+
+<quote>
+<descrip>
+<tag/Function/Return a value from the environment.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
+<tag/Description/The function searches the environment for an entry that
+matches <tt/name/ and returns its value. The environment consists of a list
+of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
+returns <tt/NULL/.
+<tag/Notes/<itemize>
+<item>What exactly is stored in the environment depends on the machine the
+program is running on.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>getfirstdevice<label id="getfirstdevice"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get first device.
+<tag/Header/<tt/<ref id="device.h" name="device.h">/
+<tag/Declaration/<tt/unsigned char getfirstdevice (void);/
+<tag/Description/The function returns the first device.
+The constant <tt/INVALID_DEVICE/ indicates no device.
+<tag/Notes/<itemize>
+<item>Calling getfirstdevice() does <em/not/ turn on the motor of a
+drive-type device and does <em/not/ check for a disk in the drive.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="getcurrentdevice" name="getcurrentdevice">,
+<ref id="getdevicedir" name="getdevicedir">,
+<ref id="getnextdevice" name="getnextdevice">
+<tag/Example/<verb>
+unsigned char dev = getfirstdevice ();
+while (dev != INVALID_DEVICE) {
+        printf ("%d\n", dev);
+        dev = getnextdevice (dev);
+        }
+</verb>
+</descrip>
+</quote>
+
+
+<sect1>getnextdevice<label id="getnextdevice"><p>
+
+<quote>
+<descrip>
+<tag/Function/Get next device.
+<tag/Header/<tt/<ref id="device.h" name="device.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ getnextdevice (unsigned char device);/
+<tag/Description/The function returns the next device after <tt/device/.
+The constant <tt/INVALID_DEVICE/ indicates no further device.
+<tag/Notes/<itemize>
+<item>Calling getnextdevice() does <em/not/ turn on the motor of a
+drive-type device and does <em/not/ check for a disk in the drive.
+<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="getcurrentdevice" name="getcurrentdevice">,
+<ref id="getdevicedir" name="getdevicedir">,
+<ref id="getfirstdevice" name="getfirstdevice">
+<tag/Example/<verb>
+unsigned char dev = getfirstdevice ();
+while (dev != INVALID_DEVICE) {
+        printf ("%d\n", dev);
+        dev = getnextdevice (dev);
+        }
+</verb>
+</descrip>
+</quote>
+
+
+<sect1>getopt<label id="getopt"><p>
+
+<quote>
+<descrip>
+<tag/Function/Parse command line options.
+<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
+<tag/Declaration/<tt/int __fastcall__ getopt (int argc, char* const* argv,
 const char* optstring);/
 <tag/Description/The function parses command line arguments, <tt/argc/ and
 <tt/argv/ are the argument count and array passed to <tt/main/. <tt/optstring/
@@ -3484,6 +4398,27 @@ fastcall function, so it may only be used in presence of a prototype.
 </quote>
 
 
+<sect1>isfast<label id="isfast"><p>
+
+<quote>
+<descrip>
+<tag/Function/Check if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
+<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
+<tag/Declaration/<tt/unsigned char isfast (void);/
+<tag/Description/The function returns a 1 if the CPU is in fast mode (C128: 2MHz mode, C16/Plus4: double clock mode).
+<tag/Notes/<itemize>
+<item>The function is specific to the C128, C16 and Plus4.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="slow" name="slow">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>isgraph<label id="isgraph"><p>
 
 <quote>
@@ -3642,7 +4577,7 @@ fastcall function, so it may only be used in presence of a prototype.
 
 <quote>
 <descrip>
-<tag/Function/Check if a given character is a white-space character.
+<tag/Function/Check if a given character is a white-space character.
 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
 <tag/Description/The function returns a non zero value if the given argument
@@ -3949,6 +4884,28 @@ do), the function is rather useless.
 </quote>
 
 
+<sect1>kbrepeat<label id="kbrepeat"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the keyboard repeat mode.
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ kbrepeat (unsigned char mode);/
+<tag/Description/This function changes which keys have automatic repeat when
+being held down for a certain time. Possible values are <tt/KBREPEAT_CURSOR/
+(repeat only cursor-related keys), <tt/KBREPEAT_NONE/ (no repeat for any
+keys), and <tt/KBREPEAT_ALL/ (repeat all keys). The old mode is returned, so
+it can be restored later.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function; so, it may be used
+only in the presence of a prototype.
+</itemize>
+<tag/Availability/cc65
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>labs<label id="labs"><p>
 
 <quote>
@@ -5041,7 +5998,7 @@ if (rename (OLDNAME, NEWNAME) == 0) {
 before a call to <tt/set_brk/.
 <tag/Notes/<itemize>
 <item>The break vector is reset on program termination, so it's not strictly
-necessary to call this function as a part of your clean-up when exitting the program.
+necessary to call this function as a part of your clean-up when exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5063,7 +6020,7 @@ necessary to call this function as a part of your clean-up when exitting the pro
 <tag/Description/<tt/reset_irq/ resets the C level interrupt request vector.
 <tag/Notes/<itemize>
 <item>The interrupt vector is reset on program termination, so it's not strictly
-necessary to call this function as a part of your clean-up when exitting the program.
+necessary to call this function as a part of your clean-up when exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5424,7 +6381,7 @@ the continue with the interrupted code, you have to adjust <tt/brk_pc/,
 otherwise the <tt/BRK/ instruction will get executed over and over again.
 <item>The break vector is reset on program termination, so it's not strictly
 necessary to call <tt/<ref id="reset_brk" name="reset_brk">/ as a part of your
-clean-up when exitting the program.
+clean-up when exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5462,7 +6419,7 @@ enable stack checks for the handler function or any other function called from
 it.
 <item>The interrupt vector is reset on program termination, so it's not strictly
 necessary to call <tt/<ref id="reset_irq" name="reset_irq">/ as a part of your
-clean-up when exitting the program.
+clean-up when exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5474,6 +6431,138 @@ clean-up when exitting the program.
 </quote>
 
 
+<sect1>set_c128_speed<label id="set_c128_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of a C128 CPU.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_c128_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the C128 CPU.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64 and C128.
+<item>The function does not check if the C128 CPU is the current CPU.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c128" name="detect_c128">,
+<ref id="get_c128_speed" name="get_c128_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>set_c64dtv_speed<label id="set_c64dtv_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of the C64DTV.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_c64dtv_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the C64DTV.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64DTV.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c64dtv" name="detect_c64dtv">,
+<ref id="get_c64dtv_speed" name="get_c64dtv_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>set_c65_speed<label id="set_c65_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of the C65/C64DX in C64 mode.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_c65_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the C65/C64DX in C64 mode.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of a C65/C64DX in C64 mode.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_c65" name="detect_c65">,
+<ref id="get_c65_speed" name="get_c65_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>set_chameleon_speed<label id="set_chameleon_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of the C64 Chameleon cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_chameleon_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the C64 Chameleon cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64 Chameleon cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_chameleon" name="detect_chameleon">,
+<ref id="get_chameleon_speed" name="get_chameleon_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>set_scpu_speed<label id="set_scpu_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of the C64/C128 SuperCPU cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_scpu_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the SuperCPU cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C128 and C64.
+<item>The function does not check for the presence of the cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_scpu" name="detect_scpu">,
+<ref id="get_scpu_speed" name="get_scpu_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>set_turbomaster_speed<label id="set_turbomaster_speed"><p>
+
+<quote>
+<descrip>
+<tag/Function/Set the current speed of the C64 Turbo Master cartridge.
+<tag/Header/<tt/<ref id="accelerator.h" name="accelerator.h">/
+<tag/Declaration/<tt/unsigned char __fastcall__ set_turbomaster_speed (unsigned char speed);/
+<tag/Description/The function returns the speed after trying to set the speed of the C64 Turbo Master cartridge.
+<tag/Notes/<itemize>
+<item>The function is specific to the C64.
+<item>The function does not check for the presence of the C64 Turbo Master cartridge.
+<item>See the accelerator.h header for the speed definitions.
+</itemize>
+<tag/Availability/cc65 (not all platforms)
+<tag/See also/
+<ref id="detect_turbomaster" name="detect_turbomaster">,
+<ref id="get_turbomaster_speed" name="get_turbomaster_speed">,
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>setjmp<label id="setjmp"><p>
 
 <quote>
@@ -5570,19 +6659,20 @@ be used in presence of a prototype.
 
 <quote>
 <descrip>
-<tag/Function/Switch the C128 into 1MHz mode.
-<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Function/Switch the CPU into slow mode (C128: 1MHz mode, C16/Plus4: single clock mode).
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">,
+<ref id="c16.h" name="c16.h">, <ref id="plus4.h" name="plus4.h">/
 <tag/Declaration/<tt/void slow (void);/
-<tag/Description/The function will switch the clock of the C128 to 1MHz. This
-will halve the speed compared to fast mode.
+<tag/Description/The function will switch the clock of the CPU to slow mode. for the C128
+target it means switching the CPU into 1MHz mode. for the C16/Plus4 target it means
+switching the CPU into single clock mode.
 <tag/Notes/<itemize>
-<item>The function is specific to the C128.
+<item>The function is specific to the C128, C16 and Plus4.
 </itemize>
-<tag/Availability/C128
+<tag/Availability/cc65 (not all platforms)
 <tag/See also/
 <ref id="fast" name="fast">,
-<ref id="toggle_videomode" name="toggle_videomode">,
-<ref id="videomode" name="videomode">
+<ref id="isfast" name="isfast">,
 <tag/Example/None.
 </descrip>
 </quote>
@@ -5795,6 +6885,7 @@ be used in presence of a prototype.
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
+<ref id="strpbrk" name="strpbrk">,
 <ref id="strqtok" name="strqtok">,
 <ref id="strspn" name="strspn">,
 <ref id="strstr" name="strstr">,
@@ -5936,6 +7027,34 @@ See <tt/strlower/.
 </quote>
 
 
+<sect1>strncasecmp<label id="strncasecmp"><p>
+
+<quote>
+<descrip>
+<tag/Function/Compare two strings case insensitive.
+<tag/Header/<tt/<ref id="string.h" name="string.h">/
+<tag/Declaration/<tt/int __fastcall__ strncasecmp (const char* s1, const char* s2, size_t count);/
+<tag/Description/The <tt/strncasecmp/ function compares the two strings passed
+as parameters without case sensitivity. It returns a value that is less than
+zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
+and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>The function is not available in strict ANSI mode.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="strcmp" name="strcmp">,
+<ref id="strcoll" name="strcoll">,
+<ref id="stricmp" name="stricmp">,
+<ref id="strncmp" name="strncmp">,
+<ref id="strxfrm" name="strxfrm">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strncat<label id="strncat"><p>
 
 <quote>
@@ -6029,6 +7148,60 @@ strncpy (hello, "Hello world!\n", sizeof hello - 1)[5] = '\0';
 </quote>
 
 
+<sect1>strnicmp<label id="strnicmp"><p>
+
+<quote>
+<descrip>
+<tag/Function/Compare two strings case insensitive.
+<tag/Header/<tt/<ref id="string.h" name="string.h">/
+<tag/Declaration/<tt/int __fastcall__ strnicmp (const char* s1, const char* s2, size_t count);/
+<tag/Description/The <tt/strnicmp/ function compares the two strings passed as
+parameters without case sensitivity. It returns a value that is less than zero
+if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
+value greater than zero if <tt/s1/ is greater than <tt/s2/.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>The function is not available in strict ANSI mode.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="strcasecmp" name="strcasecmp">,
+<ref id="strcmp" name="strcmp">,
+<ref id="strcoll" name="strcoll">,
+<ref id="strncmp" name="strncmp">,
+<ref id="strxfrm" name="strxfrm">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>strpbrk<label id="strpbrk"><p>
+
+<quote>
+<descrip>
+<tag/Function/Find a character in a string, from a set of characters.
+<tag/Header/<tt/<ref id="string.h" name="string.h">/
+<tag/Declaration/<tt/char* __fastcall__ strpbrk (const char* str, const char* set);/
+<tag/Description/<tt/strpbrk()/ searches within <tt/str/ for the first
+occurance of any character from <tt/set/.  It returns a pointer to that
+character if found; otherwise, it returns <tt/NULL/.
+<tag/Notes/<itemize>
+<item>The function is available only as a fastcall function;
+so, it should be used only in the presence of a prototype.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="strchr" name="strchr">,
+<ref id="strcspn" name="strcspn">,
+<ref id="strqtok" name="strqtok">,
+<ref id="strspn" name="strspn">,
+<ref id="strtok" name="strtok">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strqtok<label id="strqtok"><p>
 
 <quote>
@@ -6053,7 +7226,7 @@ a second <tt/s1/ string before it finishes the first one.
 <tag/Availability/cc65
 <tag/See also/
 <ref id="strcspn" name="strcspn">,
-<!-- <ref id="strpbrk" name="strpbrk">, -->
+<ref id="strpbrk" name="strpbrk">,
 <ref id="strspn" name="strspn">,
 <ref id="strtok" name="strtok">
 <tag/Example/None.
@@ -6101,6 +7274,7 @@ be used in presence of a prototype.
 <tag/Availability/ISO 9899
 <tag/See also/
 <ref id="strcspn" name="strcspn">,
+<ref id="strpbrk" name="strpbrk">,
 <ref id="strstr" name="strstr">
 <tag/Example/None.
 </descrip>
@@ -6153,7 +7327,7 @@ a second <tt/s1/ string before it finishes the first one.
 <tag/Availability/ISO 9899
 <tag/See also/
 <ref id="strcspn" name="strcspn">,
-<!-- <ref id="strpbrk" name="strpbrk">, -->
+<ref id="strpbrk" name="strpbrk">,
 <ref id="strqtok" name="strqtok">,
 <ref id="strspn" name="strspn">
 <tag/Example/None.
@@ -6273,1224 +7447,272 @@ be used in presence of a prototype.
 </quote>
 
 
-<sect1>tgi_arc<label id="tgi_arc"><p>
+<sect1>time<label id="time"><p>
 
 <quote>
 <descrip>
-<tag/Function/Draw an elliptic arc in the current color.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_arc (int x, int y,
-unsigned char rx, unsigned char ry, unsigned sa, unsigned ea);/
-<tag/Description/The function draws an elliptic arc with center at x/y and
-radii rx/ry using the current drawing color. The arc covers the angle
-between sa and ea (startangle and endangle), which must be in the range
-0..360.
+<tag/Function/Get the time.
+<tag/Header/<tt/<ref id="time.h" name="time.h">/
+<tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
+<tag/Description/The function returns the time since the 1970-01-01 00:00:00
+measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
+result will also be stored there. If no time is available, <tt/(time_t)-1/ is
+returned and an error code is stored in <tt/errno/.
 <tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item>The function behaves unexpectedly or may crash if the angles are out
-of range.
+<item>The function is only available as fastcall function, so it may
+only be used in presence of a prototype.
+<item>Many platforms supported by cc65 do not have a realtime clock, so the
+returned value may not be valid.
 </itemize>
-<tag/Availability/cc65
+<tag/Availability/ISO 9899
 <tag/See also/
-<ref id="tgi_bar" name="tgi_bar">,
-<ref id="tgi_circle" name="tgi_circle">,
-<ref id="tgi_ellipse" name="tgi_ellipse">,
-<ref id="tgi_pieslice" name="tgi_pieslice">,
-<ref id="tgi_setcolor" name="tgi_setcolor">
-<tag/Example/<verb>
-/* Draw the upper half of an ellipse */
-tgi_setcolor(TGI_COLOR_BLUE);
-tgi_arc (50, 50, 40, 20, 0, 180);
-</verb>
+<ref id="clock" name="clock">,
+<ref id="clock_gettime" name="clock_gettime">
+<tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_bar<label id="tgi_bar"><p>
+<sect1>toggle_videomode<label id="toggle_videomode"><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/Function/Toggle between 40 and 80 column mode.
+<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/void toggle_videomode (void);/
+<tag/Description/Toggle between 40 and 80 column mode. The settings for the
+old mode (cursor position, color and so on) are saved and restored together
+with the mode.
 <tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<item>The function is specific to the C128.
+<item>This function is deprecated. Please use <ref id="videomode"
+name="videomode"> instead!
 </itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi function
-<tag/Example/<verb>
-tgi_setcolor(TGI_COLOR_GREEN);
-tgi_bar(10, 10, 100, 60);
-</verb>
+<tag/Availability/C128
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="isfast" name="isfast">,
+<ref id="slow" name="slow">,
+<ref id="videomode" name="videomode">
+<tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_circle<label id="tgi_circle"><p>
+<sect1>tolower<label id="tolower"><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/Function/Convert a character into its lower case representation.
+<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
+<tag/Declaration/<tt/int __fastcall__ tolower (int c);/
+<tag/Description/The function returns the given character converted to lower
+case. If the given character is not a letter, it is returned unchanged.
 <tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<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/ISO 9899
 <tag/See also/
-<ref id="tgi_arc" name="tgi_arc">,
-<ref id="tgi_bar" name="tgi_bar">,
-<ref id="tgi_ellipse" name="tgi_ellipse">,
-<ref id="tgi_pieslice" name="tgi_pieslice">,
-<ref id="tgi_setcolor" name="tgi_setcolor">
-<tag/Example/<verb>
-tgi_setcolor(TGI_COLOR_BLACK);
-tgi_circle(50, 40, 40);
-</verb>
+<ref id="islower" name="islower">,
+<ref id="isupper" name="isupper">,
+<ref id="toupper" name="toupper">
+<tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_clear<label id="tgi_clear"><p>
+<sect1>toupper<label id="toupper"><p>
 
 <quote>
 <descrip>
-<tag/Function/Clear the drawpage
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void tgi_clear (void);/
-<tag/Description/Clear the drawpage
-<tag/Availability/cc65
-<tag/See also/Other tgi functions
+<tag/Function/Convert a character into its upper case representation.
+<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
+<tag/Declaration/<tt/int __fastcall__ toupper (int c);/
+<tag/Description/The function returns the given character converted to upper
+case. If the given character is not a letter, it is returned unchanged.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may
+only be used in presence of a prototype.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="islower" name="islower">,
+<ref id="isupper" name="isupper">,
+<ref id="tolower" name="tolower">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_done<label id="tgi_done"><p>
+<sect1>ultoa<label id="ultoa"><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 tgi_done (void);/
-<tag/Description/End graphics mode, switch back to text mode.
-Will NOT uninstall or unload the driver!
+<tag/Function/Convert an unsigned long integer into a string.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
+<tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
+string using <tt/radix/ as the base.
+<tag/Notes/<itemize>
+<item>There are no provisions to prevent a buffer overflow.
+<item>The function is non standard, so it is not available in strict ANSI mode.
+You should probably use <tt/sprintf/ instead.
+<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/See also/
+<ref id="atoi" name="atoi">,
+<ref id="atol" name="atol">,
+<ref id="itoa" name="itoa">,
+<ref id="ltoa" name="ltoa">,
+<ref id="utoa" name="utoa">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_ellipse<label id="tgi_ellipse"><p>
+<sect1>unlink<label id="unlink"><p>
 
 <quote>
 <descrip>
-<tag/Function/The function draws an ellipse in the current color.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_ellipse (int x, int y, unsigned char rx, unsigned char ry);/
-<tag/Description/The function draws an ellipse at position x/y with radii
-rx and ry, using the current drawing color.
+<tag/Function/Delete a file.
+<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
+<tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
+<tag/Description/<tt/unlink/ deletes the file with the given name. On success,
+zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
+code describing the reason for the failure.
 <tag/Notes/<itemize>
+<item>The use of this function is discouraged. Please use <tt/<ref id="remove"
+name="remove">/ instead, which is a native ANSI C function and does the same.
+<item>This function is not available on all cc65 targets (depends on the
+availability of file I/O).
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
+<item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
+used, which has the same semantics, but is more portable, because it conforms
+to the ISO C standard.
 </itemize>
-<tag/Availability/cc65
+<tag/Availability/POSIX 1003.1
 <tag/See also/
-<ref id="tgi_arc" name="tgi_arc">,
-<ref id="tgi_bar" name="tgi_bar">,
-<ref id="tgi_circle" name="tgi_circle">,
-<ref id="tgi_pieslice" name="tgi_pieslice">,
-<ref id="tgi_setcolor" name="tgi_setcolor">
-<tag/Example/<verb>
-tgi_setcolor(TGI_COLOR_RED);
-tgi_ellipse (50, 40, 40, 20);
+<ref id="remove" name="remove">
+<tag/Example/
+<verb>
+#include &lt;stdio.h&gt;
+#include &lt;unistd.h&gt;
+
+#define FILENAME "helloworld"
+
+if (unlink (FILENAME) == 0) {
+    printf ("We deleted %s successfully\n", FILENAME);
+} else {
+    printf ("There was a problem deleting %s\n", FILENAME);
+}
 </verb>
 </descrip>
 </quote>
 
 
-<sect1>tgi_free_vectorfont<label id="tgi_free_vectorfont"><p>
+<sect1>utoa<label id="utoa"><p>
 
 <quote>
 <descrip>
-<tag/Function/Free a vector font that was previously loaded into memory.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_free_vectorfont (const tgi_vectorfont* font);/
-<tag/Description/Free a vector font that was previously loaded into memory.
+<tag/Function/Convert an unsigned integer into a string.
+<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
+<tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
+<tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
+using <tt/radix/ as the base.
 <tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<item>There are no provisions to prevent a buffer overflow.
+<item>The function is non standard, so it is not available in strict ANSI mode.
+You should probably use <tt/sprintf/ instead.
+<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_vectorfont" name="tgi_load_vectorfont">,
-<ref id="tgi_install_vectorfont" name="tgi_install_vectorfont">
+<ref id="atoi" name="atoi">,
+<ref id="atol" name="atol">,
+<ref id="itoa" name="itoa">,
+<ref id="ltoa" name="ltoa">,
+<ref id="ultoa" name="ultoa">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_getaspectratio<label id="tgi_getaspectratio"><p>
+<sect1>vcprintf<label id="vcprintf"><p>
 
-<quote> <descrip> <tag/Function/Return the pixel aspect ratio.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned tgi_getaspectratio (void);/
-<tag/Description/The function returns the pixel aspect ratio for the current
-driver and display as an 8.8 fixed point value. It may be used to correct
-geometric shapes so they look correct on the display. As an example, a circle
-with a radius of 100 pixels may look elliptic on some driver/display
-combinations if the aspect ratio is not 1.00.
+<quote>
+<descrip>
+<tag/Function/Formatted output to the console.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
+<tag/Description/The arguments specified as a <tt/va_list/ are converted to
+text where necessary and formatted according to the format string given. The
+resulting string is output to the console. <tt/vcprintf/ supports the same
+format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
 <tag/Notes/<itemize>
-<item>The aspect ratio is encoded in the TGI driver which assumes a "standard"
-monitor for the given platform. The aspect ratio may be wrong if another
-monitor is used.
-<item>No TGI function will use the aspect ratio. It is up to the programmer to
-make use of it.
-<item>The <ref id="tgi_setaspectratio" name="tgi_setaspectratio"> function can
-be used to change the aspect ratio for a loaded driver. The value is not reset
-by <ref id="tgi_init" name="tgi_init">, so if a driver is linked statically to
-an application, switching into and out of graphics mode will not restore the
-original aspect ratio.
+<item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
+between <tt/\r/ and <tt/\n/.
+<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_setaspectratio" name="tgi_setaspectratio">
+<ref id="cprintf" name="cprintf">,
+<ref id="cputc" name="cputc">,
+<ref id="cputcxy" name="cputcxy">,
+<ref id="cputs" name="cputs">,
+<ref id="cputsxy" name="cputsxy">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_getcolor<label id="tgi_getcolor"><p>
+<sect1>videomode<label id="videomode"><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 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 TGI_COLOR_BLACK and TGI_COLOR_WHITE. But some
-platforms have many more predefined colors. If you paint using TGI_COLOR_GREEN
-and then you change the green of the palette to blue using tgi_setpalette then
-after this painting in TGI_COLOR_GREEN will actually be blue.
-<tag/Availability/cc65
-<tag/See also/Other tgi functions
-<tag/Example/<verb>
-color = tgi_getcolor();
-</verb>
+<tag/Function/Switch to either 40 or 80 column mode.
+<tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">,
+<ref id="c128.h" name="c128.h">/
+<tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/
+<tag/Description/Switch to 40 or 80 column mode depending on the argument. If
+the requested mode is already active, nothing happens. The old mode is returned
+from the call.
+<tag/Notes/<itemize>
+<item>The function is specific to the C128 and enhanced Apple //e.
+<item>This function replaces <ref id="toggle_videomode"
+name="toggle_videomode">.
+<item>The function is only available as fastcall function, so it may only be
+used in presence of a prototype.
+</itemize>
+<tag/Availability/C128 and enhanced Apple //e
+<tag/See also/
+<ref id="fast" name="fast">,
+<ref id="isfast" name="isfast">,
+<ref id="slow" name="slow">,
+<ref id="toggle_videomode" name="toggle_videomode">
+<tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_getcolorcount<label id="tgi_getcolorcount"><p>
+<sect1>waitvsync<label id="waitvsync"><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 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/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* tgi_getdefpalette (void);/
-<tag/Description/The tgi driver has a default palette that is active at startup.
-The named colors TGI_COLOR_BLACK, TGI_COLOR_WHITE, TGI_COLOR_RED... need this
-palette to work correctly.
-<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 tgi_geterror (void);/
-<tag/Description/Return the error code for the last operation.
-This will also clear the error.
-<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/Notes/<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 tgi_getmaxcolor (void);/
-<tag/Description/Get the highest index of the palette.
-<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 tgi_getmaxx (void);/
-<tag/Description/Get the maximum x coordinate that can be used on this screen.
-<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 tgi_getmaxy (void);/
-<tag/Description/Get the maximum y coordinate that can be used on this screen.
-<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 tgi_getpagecount (void);/
-<tag/Description/Return the number of screen pages available.
-<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* tgi_getpalette (void);/
-<tag/Description/Get the palette installed.
-<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/Notes/<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 tgi_getxres (void);/
-<tag/Description/Get number of horisontal pixels on the screen.
-This is same as tgi_maxx()+1.
-<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 tgi_getyres (void);/
-<tag/Description/Get number of vertical pixels on the screen.
-This is same as tgi_maxy()+1.
-<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/Notes/<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 tgi_init (void);/
-<tag/Description/The tgi_init function will set the default palette to the
-hardware.
-<tag/Notes/<itemize>
-<item><tt/tgi_init/ will not clear the screen. This allows switching between
-text and graphics mode on platforms that have separate memory areas for the
-screens. If you want the screen cleared, call <tt/<ref id="tgi_clear"
-name="tgi_clear">/ after <tt/tgi_init/.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-tgi_install(tgi_static_stddrv); //Include the driver statically instead of loading it.
-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/Notes/<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>
-tgi_install(tgi_static_stddrv); //Include the driver statically instead of loading it.
-tgi_init(); //Set up the default palette and clear the screen.
-</verb>
-</descrip>
-</quote>
-
-
-<sect1>tgi_install_vectorfont<label id="tgi_install_vectorfont"><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/void __fastcall__ tgi_install_vectorfont (const tgi_vectorfont* font);/
-<tag/Description/
-Install a vector font for use. More than one vector font can be loaded,
-but only one can be active. This function is used to tell which one. Call
-with a NULL pointer to uninstall the currently installed font.
-<tag/Notes/<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_vectorfont" name="tgi_load_vectorfont">,
-<ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
-<tag/Example/None.
-</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, void* data);/
-<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/Notes/<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, (void*)(spr))
-#define tgi_flip() tgi_ioctl(1, (void*)0)
-#define tgi_setbgcolor(bgcol) tgi_ioctl(2, (void*)(bgcol))
-#define tgi_setframerate(rate) tgi_ioctl(3, (void*)(rate))
-#define tgi_busy() tgi_ioctl(4, (void*)0)
-#define tgi_updatedisplay() tgi_ioctl(4, (void*)1)
-if (!tgi_busy()) {
-  tgi_sprite(&amp;background);
-  tgi_setcolor(TGI_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/Notes/<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/Notes/<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.
-<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 successful.
-Will not switch to graphics mode.
-<tag/Notes/<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_vectorfont<label id="tgi_load_vectorfont"><p>
-
-<quote>
-<descrip>
-<tag/Function/Load the given vector font.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/const tgi_vectorfont* __fastcall__ tgi_load_vectorfont (const char* name);/
-<tag/Description/
-Load a vector font into memory and return it. In case of errors, NULL is
-returned and an error is set, which can be retrieved using tgi_geterror.
-To use the font, it has to be installed using tgi_install_vectorfont.
-<tag/Notes/<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_install_vectorfont" name="tgi_install_vectorfont">,
-<ref id="tgi_free_vectorfont" name="tgi_free_vectorfont">
-<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/Notes/<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/Notes/<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_pieslice<label id="tgi_pieslice"><p>
-
-<quote>
-<descrip>
-<tag/Function/Draw an elliptic pie slice in the current color.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_pie slice (int x, int y,
-unsigned char rx, unsigned char ry, unsigned sa, unsigned ea);/
-<tag/Description/The function draws an elliptic pie slice with center at x/y
-and radii rx/ry using the current drawing color. The pie slice covers the angle
-between sa and ea (startangle and endangle), which must be in the range
-0..360.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item>The function behaves unexpectedly or may crash if the angles are out
-of range.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_bar" name="tgi_arc">,
-<ref id="tgi_bar" name="tgi_bar">,
-<ref id="tgi_circle" name="tgi_circle">,
-<ref id="tgi_ellipse" name="tgi_ellipse">,
-<ref id="tgi_setcolor" name="tgi_setcolor">
-<tag/Example/<verb>
-/* Draw the closed upper half of an ellipse */
-tgi_setcolor(TGI_COLOR_BLUE);
-tgi_pieslice (50, 50, 40, 20, 0, 180);
-</verb>
-</descrip>
-</quote>
-
-
-<sect1>tgi_setaspectratio<label id="tgi_setaspectratio"><p>
-
-<quote> <descrip> <tag/Function/Set the pixel aspect ratio.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_setaspectratio (unsigned ratio);/
-<tag/Description/The function sets the pixel aspect ratio for the current
-driver and display. The argument is an 8.8 fixed point value. The aspect ratio
-may be used to correct geometric shapes so they look correct on a given
-display. As an example, a circle with a radius of 100 pixels may look elliptic
-on some driver/display combinations if the aspect ratio is not 1.00.
-<tag/Notes/<itemize>
-<item>The aspect ratio is encoded in the TGI driver which assumes a "standard"
-monitor for the given platform. The aspect ratio may be wrong if another
-monitor is used.
-<item>No TGI function will use the aspect ratio. It is up to the programmer to
-make use of it.
-<item>The <tt/tgi_setaspectratio/ function can be used to change the aspect
-ratio for a loaded driver. The value is not reset by <ref id="tgi_init"
-name="tgi_init">, so if a driver is linked statically to an application,
-switching into and out of graphics mode will not restore the original aspect
-ratio.
-<item>The function is available only as a fastcall function; so, it may be used
-only in the presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_getaspectratio" name="tgi_getaspectratio">
-<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/Notes/<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(TGI_COLOR_BLACK);
-tgi_bar(0,0,30,30);
-tgi_setcolor(TGI_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/Notes/<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/Notes/<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/Notes/<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/Notes/<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_gettextheight<label id="tgi_gettextheight"><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_gettextheight (const char* s);/
-<tag/Description/Calculate the height of the text in pixels according to
-the current text style.
-<tag/Notes/<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_settextscale<label id="tgi_settextscale"><p>
-
-<quote>
-<descrip>
-<tag/Function/Set the scaling for text output.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_settextscale (unsigned width, unsigned height);/
-<tag/Description/
-Set the scaling for text output. The scaling factors for width and height
-are 8.8 fixed point values. This means that $100 = 1 $200 = 2 etc.
-<tag/Notes/<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_settextstyle" name="tgi_settextstyle">
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_settextstyle<label id="tgi_settextstyle"><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_settextstyle (unsigned char magx, unsigned char magy, unsigned char dir, unsigned char font);/
-<tag/Description/Set the style for text output.
-<tag/Notes/<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_settextscale" name="tgi_settextscale">
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_gettextwidth<label id="tgi_gettextwidth"><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_gettextwidth (const char* s);/
-<tag/Description/Calculate the width of the text in pixels according to the current text style.
-<tag/Notes/<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 tgi_uninstall (void);/
-<tag/Description/Uninstall the currently loaded driver but do not unload it.
-Will call tgi_done if necessary.
-<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 tgi_unload (void);/
-<tag/Description/Uninstall, then unload the currently loaded driver.
-Will call tgi_done if necessary.
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>time<label id="time"><p>
-
-<quote>
-<descrip>
-<tag/Function/Get the time.
-<tag/Header/<tt/<ref id="time.h" name="time.h">/
-<tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
-<tag/Description/The function returns the time since the 1970-01-01 00:00:00
-measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
-result will also be stored there. If no time is available, <tt/(time_t)-1/ is
-returned and <tt/errno/ is set to <tt/ENOSYS/.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may
-only be used in presence of a prototype.
-<item>Many platforms supported by cc65 do not have a realtime clock, so the
-returned value may not be valid.
-</itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="clock" name="clock">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>toggle_videomode<label id="toggle_videomode"><p>
-
-<quote>
-<descrip>
-<tag/Function/Toggle between 40 and 80 column mode.
-<tag/Header/<tt/<ref id="c128.h" name="c128.h">/
-<tag/Declaration/<tt/void toggle_videomode (void);/
-<tag/Description/Toggle between 40 and 80 column mode. The settings for the
-old mode (cursor position, color and so on) are saved and restored together
-with the mode.
-<tag/Notes/<itemize>
-<item>The function is specific to the C128.
-<item>This function is deprecated. Please use <ref id="videomode"
-name="videomode"> instead!
-</itemize>
-<tag/Availability/C128
-<tag/See also/
-<ref id="fast" name="fast">,
-<ref id="slow" name="slow">,
-<ref id="videomode" name="videomode">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tolower<label id="tolower"><p>
-
-<quote>
-<descrip>
-<tag/Function/Convert a character into its lower case representation.
-<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
-<tag/Declaration/<tt/int __fastcall__ tolower (int c);/
-<tag/Description/The function returns the given character converted to lower
-case. If the given character is not a letter, it is returned unchanged.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may
-only be used in presence of a prototype.
-</itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="islower" name="islower">,
-<ref id="isupper" name="isupper">,
-<ref id="toupper" name="toupper">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>toupper<label id="toupper"><p>
-
-<quote>
-<descrip>
-<tag/Function/Convert a character into its upper case representation.
-<tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
-<tag/Declaration/<tt/int __fastcall__ toupper (int c);/
-<tag/Description/The function returns the given character converted to upper
-case. If the given character is not a letter, it is returned unchanged.
-<tag/Notes/<itemize>
-<item>The function is only available as fastcall function, so it may
-only be used in presence of a prototype.
-</itemize>
-<tag/Availability/ISO 9899
-<tag/See also/
-<ref id="islower" name="islower">,
-<ref id="isupper" name="isupper">,
-<ref id="tolower" name="tolower">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>ultoa<label id="ultoa"><p>
-
-<quote>
-<descrip>
-<tag/Function/Convert an unsigned long integer into a string.
-<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
-<tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
-string using <tt/radix/ as the base.
-<tag/Notes/<itemize>
-<item>There are no provisions to prevent a buffer overflow.
-<item>The function is non standard, so it is not available in strict ANSI mode.
-You should probably use <tt/sprintf/ instead.
-<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="atoi" name="atoi">,
-<ref id="atol" name="atol">,
-<ref id="itoa" name="itoa">,
-<ref id="ltoa" name="ltoa">,
-<ref id="utoa" name="utoa">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>unlink<label id="unlink"><p>
-
-<quote>
-<descrip>
-<tag/Function/Delete a file.
-<tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
-<tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
-<tag/Description/<tt/unlink/ deletes the file with the given name. On success,
-zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
-code describing the reason for the failure.
-<tag/Notes/<itemize>
-<item>The use of this function is discouraged. Please use <tt/<ref id="remove"
-name="remove">/ instead, which is a native ANSI C function and does the same.
-<item>This function is not available on all cc65 targets (depends on the
-availability of file I/O).
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
-used, which has the same semantics, but is more portable, because it conforms
-to the ISO C standard.
-</itemize>
-<tag/Availability/POSIX 1003.1
-<tag/See also/
-<ref id="remove" name="remove">
-<tag/Example/
-<verb>
-#include &lt;stdio.h&gt;
-#include &lt;unistd.h&gt;
-
-#define FILENAME "helloworld"
-
-if (unlink (FILENAME) == 0) {
-    printf ("We deleted %s successfully\n", FILENAME);
-} else {
-    printf ("There was a problem deleting %s\n", FILENAME);
-}
-</verb>
-</descrip>
-</quote>
-
-
-<sect1>utoa<label id="utoa"><p>
-
-<quote>
-<descrip>
-<tag/Function/Convert an unsigned integer into a string.
-<tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
-<tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
-using <tt/radix/ as the base.
-<tag/Notes/<itemize>
-<item>There are no provisions to prevent a buffer overflow.
-<item>The function is non standard, so it is not available in strict ANSI mode.
-You should probably use <tt/sprintf/ instead.
-<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="atoi" name="atoi">,
-<ref id="atol" name="atol">,
-<ref id="itoa" name="itoa">,
-<ref id="ltoa" name="ltoa">,
-<ref id="ultoa" name="ultoa">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>vcprintf<label id="vcprintf"><p>
-
-<quote>
-<descrip>
-<tag/Function/Formatted output to the console.
-<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
-<tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
-<tag/Description/The arguments specified as a <tt/va_list/ are converted to
-text where necessary and formatted according to the format string given. The
-resulting string is output to the console. <tt/vcprintf/ supports the same
-format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
-<tag/Notes/<itemize>
-<item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
-between <tt/\r/ and <tt/\n/.
-<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="cprintf" name="cprintf">,
-<ref id="cputc" name="cputc">,
-<ref id="cputcxy" name="cputcxy">,
-<ref id="cputs" name="cputs">,
-<ref id="cputsxy" name="cputsxy">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>videomode<label id="videomode"><p>
-
-<quote>
-<descrip>
-<tag/Function/Switch to either 40 or 80 column mode.
-<tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">,
-<ref id="c128.h" name="c128.h">/
-<tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/
-<tag/Description/Switch to 40 or 80 column mode depending on the argument. If
-the requested mode is already active, nothing happens. The old mode is returned
-from the call.
-<tag/Notes/<itemize>
-<item>The function is specific to the C128 and enhanced Apple //e.
-<item>This function replaces <ref id="toggle_videomode"
-name="toggle_videomode">.
-<item>The function is only available as fastcall function, so it may only be
-used in presence of a prototype.
-</itemize>
-<tag/Availability/C128 and enhanced Apple //e
-<tag/See also/
-<ref id="fast" name="fast">,
-<ref id="slow" name="slow">,
-<ref id="toggle_videomode" name="toggle_videomode">
+<tag/Function/Wait until the start of the next frame.
+<tag/Header/
+<tt/<ref id="cbm.h" name="cbm.h">/,
+<tt/<ref id="gamate.h" name="gamate.h">/,
+<tt/<ref id="nes.h" name="nes.h">/,
+<tt/<ref id="pce.h" name="pce.h">/
+<tag/Declaration/<tt/void waitvsync (void);/
+<tag/Description/Wait for vertical sync to reduce flickering.
+<tag/Availability/Platforms above
 <tag/Example/None.
 </descrip>
 </quote>