]> git.sur5r.net Git - cc65/blobdiff - doc/funcref.sgml
Added '_' prefix to sin and cos.
[cc65] / doc / funcref.sgml
index adfeaf4b21bad4568bd004ee76737353821f2415..030c726cc46d16df10f1ebda16c64f3e277934f0 100644 (file)
@@ -2,8 +2,8 @@
 
 <article>
 <title>cc65 function reference
-<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
-<date>2014-04-10
+<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
@@ -26,7 +26,7 @@ For an overview about the available libraries, their purpose, and any
 differences to the ISO standard, please have a look at the <url
 url="library.html" name="cc65 Library Overview">.
 
-<bf/Note:/ Standard C functions are listed here, but not described in detail.
+<em/Note:/ Standard C functions are listed here, but not described in detail.
 Since these functions behave identical on all standard compliant systems, they
 are described in any book covering standard C.
 
@@ -39,7 +39,7 @@ Each entry for a function contains a detailed description
 <tag/Declaration/Describes the needed header files and declaration of the
 function.
 <tag/Description/Description of the function.
-<tag/Limits/Limits.
+<tag/Notes/Notes on the function.
 <tag/Availability/The availability of the function.
 <tag/See also/Other related functions.
 <tag/Example/A piece of actual code using the function.
@@ -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,8 +136,14 @@ 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_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>
 
 
@@ -123,6 +152,7 @@ function.
 <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">
@@ -131,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)
 
 
@@ -160,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"> -->
@@ -170,6 +212,9 @@ function.
 <!-- <item><ref id="cbm_readdir" name="cbm_readdir"> -->
 <!-- <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">
 </itemize>
 
 (incomplete)
@@ -197,17 +242,21 @@ function.
 
 <sect1><tt/cc65.h/<label id="cc65.h"><p>
 
-<!-- <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"> -->
-<!-- <item><ref id="cc65_imul8x8r16" name="cc65_imul8x8r16"> -->
-<!-- <item><ref id="cc65_sin" name="cc65_sin"> -->
-<!-- <item><ref id="cc65_udiv32by16r16" name="cc65_udiv32by16r16"> -->
-<!-- <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> -->
+<itemize>
+
+<!-- <item><ref id="_cos" name="_cos"> -->
+<!-- <item><ref id="idiv32by16r16" name="idiv32by16r16"> -->
+<!-- <item><ref id="imul16x16r32" name="imul16x16r32"> -->
+<!-- <item><ref id="imul8x8r16" name="imul8x8r16"> -->
+<!-- <item><ref id="_sin" name="_sin"> -->
+<!-- <item><ref id="udiv32by16r16" name="udiv32by16r16"> -->
+<!-- <item><ref id="umul16x16r32" name="umul16x16r32"> -->
+<!-- <item><ref id="umul16x8r32" name="umul16x8r32"> -->
+<!-- <item><ref id="umul8x8r16" name="umul8x8r16"> -->
+<item><ref id="doesclrscrafterexit" name="doesclrscrafterexit">
+<item><ref id="mul20" name="mul20">
+<item><ref id="mul40" name="mul40">
+</itemize>
 
 (incomplete)
 
@@ -223,6 +272,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">
@@ -274,6 +327,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">.
@@ -294,11 +357,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">
@@ -334,11 +398,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>
@@ -374,6 +448,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>
@@ -404,10 +485,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)
 
@@ -420,6 +501,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>
@@ -430,6 +521,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)
@@ -437,13 +538,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">
@@ -474,7 +581,6 @@ communication.
 <item><ref id="signal" name="signal">
 </itemize>
 
-
 <sect1><tt/stdarg.h/<label id="stdarg.h"><p>
 
 (incomplete)
@@ -605,9 +711,13 @@ 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">
 <item><ref id="strstr" name="strstr">
@@ -617,64 +727,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"> -->
@@ -691,7 +771,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"> -->
@@ -734,8 +814,7 @@ communication.
 <tag/Description/The function is called with the type of a directory entry
 taken from a <tt/struct dirent/ and returns true if the entry designates
 a directory.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 </itemize>
 <tag/Availability/cc65
@@ -758,8 +837,7 @@ a directory.
 <tag/Description/The function is called with the type of a directory entry
 taken from a <tt/struct dirent/ and returns true if the entry designates
 a disk label.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 </itemize>
 <tag/Availability/cc65
@@ -782,8 +860,7 @@ a disk label.
 <tag/Description/The function is called with the type of a directory entry
 taken from a <tt/struct dirent/ and returns true if the entry designates
 a link.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 </itemize>
 <tag/Availability/cc65
@@ -806,8 +883,7 @@ a link.
 <tag/Description/The function is called with the type of a directory entry
 taken from a <tt/struct dirent/ and returns true if the entry designates
 a regular file.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>A "regular file" means anything with data in it. This might still mean
 that special processing is needed, when accessing the file. Relative files of
@@ -831,10 +907,11 @@ the CBM systems are classified as being "regular" files, for example.
 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
 <tag/Description/The function adds a block of raw memory to the heap.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The minimum blocksize that can be added is 6 bytes; the function will
 ignore smaller blocks.
+<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/
@@ -860,10 +937,11 @@ ignore smaller blocks.
 <tag/Description/The function returns the size of a block that must have
 previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
 id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>Passing a pointer to a block that was is not the result of one of the
 allocation functions, or that has been free'd will give unpredicable results.
+<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/
@@ -908,11 +986,10 @@ be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
 <descrip>
 <tag/Function/Return the total available space on the heap.
 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
-<tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
+<tag/Declaration/<tt/size_t _heapmemavail (void);/
 <tag/Description/The function returns the total number of bytes available on
 the heap.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>This function is of less use than usually assumed, since the returned
 heap space may be available but not in one block. So even if this function
 says that several times more heap space is available than needed, <ref
@@ -932,6 +1009,19 @@ 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>
@@ -945,8 +1035,7 @@ a colon and a blank. Then the error message for the current contents of
 <tt/_oserror/ are printed followed by a newline. The message output is the
 same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
 argument of <tt/_oserror/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>Since operating system specific error code are - you guessed it -
 operating system specific, the value in <tt/_oserror/ and the message that is
 printed depends on the cc65 target.
@@ -972,7 +1061,7 @@ be used in presence of a prototype.
 <tag/Description/The function initializes the random number generator with
 a seed derived from fast changing hardware events, so the seed itself can be
 considered random to a certain degree.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The randomness of the seed depends on the machine hardware.
 </itemize>
 <tag/Availability/cc65
@@ -993,7 +1082,7 @@ considered random to a certain degree.
 <tag/Declaration/<tt/const char* __fastcall__ _stroserror (unsigned char errcode);/
 <tag/Description/<tt/_stroserror/ will return a string describing the given
 operating system specific error code.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Since operating system specific error code are - you guessed it -
 operating system specific, the parameter and the string returned depend on the
 cc65 target.
@@ -1018,7 +1107,7 @@ used in presence of a prototype.
 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
 <tt/size/ bytes in size.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The memory areas may not overlap, otherwise the results are undefined.
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
@@ -1044,7 +1133,7 @@ specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
 registers and the CPU flags are set to the values given in the <tt/regs/
 structure. On return from the subroutine, the new values of the registers and
 flags are stored back overwriting the old values.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
 when calling the subroutine (they are unchanged from their current values).
 <item>The function is only available as fastcall function, so it may only be
@@ -1065,7 +1154,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void BRK (void);/
 <tag/Description/The function will insert a 6502 BRK instruction into the code
 which may be used to trigger a debugger.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>The inserted instruction may lead to unexpected results if no debugger
 is present.
@@ -1089,7 +1178,7 @@ is present.
 <tag/Description/The function will insert a 6502 CLI instruction into the code,
 so interrupts are enabled. Enabling interrupts has no effects if they are
 already enabled (the default).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>Disabling interrupts may lead to unexpected results.
 </itemize>
@@ -1111,7 +1200,7 @@ already enabled (the default).
 <tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
 <tag/Description/The function will read the absolute memory given by <tt/addr/
 and return the value read.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>This function depends highly on the platform and environment.
 </itemize>
@@ -1134,7 +1223,7 @@ and return the value read.
 <tag/Description/The function will read the absolute memory given by <tt/addr/
 and return the value read. The byte read from the higher address is the high
 byte of the return value.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>This function depends highly on the platform and environment.
 <item>The order in which the two bytes are read is unspecified and may
@@ -1158,7 +1247,7 @@ depend of the address expression used.
 <tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
 <tag/Description/The function writes the value <tt/val/ to the absolute
 memory address given by <tt/addr/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>This function depends highly on the platform and environment.
 <item>Careless use will cause the program to act strange or may crash the
@@ -1183,7 +1272,7 @@ machine.
 <tag/Description/The function writes the value <tt/val/ to the absolute
 memory address given by <tt/addr/. The low byte of <tt/val/ is written to
 the <tt/addr/, the high byte is written to <tt/addr+1/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>This function depends highly on the platform and environment.
 <item>Careless use will cause the program to act strange or may crash the
@@ -1210,7 +1299,7 @@ depend of the address expression used.
 <tag/Description/The function will insert a 6502 SEI instruction into the code,
 so interrupts are disabled. Note that non maskable interrupts cannot be
 disabled.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 <item>Disabling interrupts may lead to unexpected results.
 </itemize>
@@ -1251,7 +1340,7 @@ on stderr, then terminates the program with an exit code of 3.
 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
 the function.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
@@ -1274,7 +1363,7 @@ used in presence of a prototype.
 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
 statement. If the condition evaluates t zero (false), assert prints a message
 on stderr and aborts the program.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 </itemize>
 <tag/Availability/ISO 9899
@@ -1298,7 +1387,7 @@ on stderr and aborts the program.
 terminates, they are called in LIFO order (the last function registered is
 called first). <tt/atexit/ returns zero on success and a nonzero value on
 failure.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>A maximum of 5 exit functions can be registered.
 <item>There is no way to unregister an exit function.
 <item>The function is only available as fastcall function, so it may only be
@@ -1313,6 +1402,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>
@@ -1321,6 +1434,10 @@ used in presence of a prototype.
 <tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
 <tag/Declaration/<tt/void __fastcall__ atmos_load(const char* name);/
 <tag/Description/<tt/atmos_load/ reads a memory block from tape.
+<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_save" name="atmos_save">
@@ -1329,6 +1446,30 @@ used in 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>
@@ -1337,6 +1478,10 @@ used in presence of a prototype.
 <tag/Header/<tt/<ref id="atmos.h" name="atmos.h">/
 <tag/Declaration/<tt/void __fastcall__ atmos_save(const char* name, const void* start, const void* end);/
 <tag/Description/<tt/atmos_save/ writes a memory block to tape.
+<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_load" name="atmos_load">
@@ -1347,6 +1492,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>
@@ -1356,7 +1597,7 @@ atmos_save("hires", 0xa000, 0xc000);
 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
 <tag/Description/<tt/atoi/ converts the given string into an integer.
 Conversion stops as soon as any invalid character is encountered.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>There is no way to detect any conversion errors.
 <item>The function does not check for an numerical overflow when converting.
 <item>The function is only available as fastcall function, so it may only be
@@ -1383,7 +1624,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
 <tag/Description/<tt/atol/ converts the given string into a long integer.
 Conversion stops as soon as any invalid character is encountered.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>There is no way to detect any conversion errors.
 <item>The function does not check for an numerical overflow when converting.
 <item>The function is only available as fastcall function, so it may only be
@@ -1411,7 +1652,7 @@ used in presence of a prototype.
 <tag/Description/The function will set a new background color and return the
 old (current) one. The background color is valid for the whole text output
 area of the screen, not just for new text.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Background colors are system dependent. The function may have no effect
 on systems where the background color cannot be changed.
 <item>The function is only available as fastcall function, so it may only be
@@ -1435,7 +1676,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
 <tag/Description/The function will set a new border color. It returns the old
 (current) border color.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Border colors are system dependent. The function may have no effect
 on systems where the border color cannot be changed.
 <item>The function is only available as fastcall function, so it may only
@@ -1458,20 +1699,21 @@ be used in presence of a prototype.
 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
 <tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
 const void* base, size_t n, size_t size,
-int (*cmp) (const void*, const void*));/
+int __fastcall__ (* cmp) (const void*, const void*));/
 <tag/Description/<tt/bsearch/ searches a sorted array for a member that
 matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
 <tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
 the function used to compare the members against the key. The function returns
 a pointer to the member found, or <tt/NULL/ if there was no match.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The contents of the array must be sorted in ascending order according to
 the compare function given.
 <item>If there are multiple members that match the key, the function will
 return one of the members.
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
+<item>The function to which <tt/cmp/ points must have the <tt/fastcall/ calling
+convention.
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
@@ -1490,8 +1732,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
 zero.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is non standard and therefore only available in non ANSI
 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
 <item>The function is only available as fastcall function, so it may only
@@ -1516,7 +1757,7 @@ be used in presence of a prototype.
 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
 <tag/Declaration/<tt/void c64mode (void);/
 <tag/Description/The function will cause the machine to reboot into C64 mode.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is specific to the C128.
 <item>The function will not return to the caller.
 </itemize>
@@ -1537,8 +1778,7 @@ be used in presence of a prototype.
 of size <tt/size/, clears the whole block with binary zeroes and returns a
 pointer to it. On error (not enough memory available), <tt/calloc/ returns
 <tt/NULL/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>Clearing the memory may not have the expected effect on all platforms:
 pointers in the block may not be <tt/NULL/ and floating point variables may
 not be zero (0.0). In other words: The "clearing" effect of this function
@@ -1571,7 +1811,7 @@ be used in presence of a prototype.
 gets from the current TALKer on the serial bus.
 In order to receive the data, the device must have previously been
 sent a command to TALK and a secondary address if it needs one.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1593,7 +1833,7 @@ sent a command to TALK and a secondary address if it needs one.
 Device must first have been OPENed and then designated as the input channel by the CHKIN routine.
 When this function is called, the next byte of data available from the device is returned.
 Exception is the routine for the keyboard device (which is the default input device).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1619,7 +1859,7 @@ printed to the screen, which is the default output device.  If the
 cassette is the current device, outputting a byte will only add it to
 the buffer. No actual transmission of data will occur until the
 192-byte buffer is full.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1649,7 +1889,7 @@ address as the current secondary address.  If the device on the
 channel is a serial device, which requires a TALK command and
 sometimes a secondary address, function will send them over the
 serial bus.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1677,7 +1917,7 @@ secondary address if necessary.  This routine always buffers the
 current character, and defers sending it until the next byte is
 buffered.  When the UNLISTEN command is sent, the last byte will be
 sent with an End or Identify (EOI).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1706,7 +1946,7 @@ file, its device as the current device, and its secondary address as
 the current secondary address.  If the device on the channel uses the
 serial bus, and therefore requires a LISTEN command and possibly a
 secondary address, this information will be sent on the bus.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1729,7 +1969,7 @@ only be used in presence of a prototype.
 <tag/Description/It closes all
 open files, by resetting the index into open files to
 zero and restores the default I/O devices.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1751,7 +1991,7 @@ zero and restores the default I/O devices.
 <tag/Description/It is used to
 close a logical file after all I/O operations involving that file have
 been completed.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1777,7 +2017,7 @@ the screen.  Also, if the current input device was formerly a serial
 device, the routine sends it an UNTALK command on the serial bus, and
 if a serial device was formerly the current output device, the routine
 sends it an UNLISTEN command.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1797,7 +2037,7 @@ sends it an UNLISTEN command.
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
 <tag/Declaration/<tt/unsigned char cbm_k_getin (void);/
 <tag/Description/Function gets a character from the current input device.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1825,7 +2065,7 @@ VIC-20, and future models of the Commodore 64. If the I/O locations for
 a program are set by a call to this function, they should
 still remain compatible with future versions of the Commodore 64, the
 KERNAL and BASIC.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1848,13 +2088,13 @@ receive data. The KERNAL routine will OR the supplied device number bit by bit
 to convert it to a listen address, then transmits this data as a command on
 the serial bus. The specified device will then go into listen mode, and
 be ready to accept information.
-<tag/Limits/<itemize>
+<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="cbm_k_unlsn" name="cbm_k_unlsn">,
+<ref id="cbm_k_unlsn" name="cbm_k_unlsn">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -1878,7 +2118,7 @@ loaded into memory starting at the location specified by the header.
 Function returns the address of the highest RAM location loaded.
 Before this function can be called, the KERNAL SETLFS, and SETNAM
 routines must be called.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1904,7 +2144,7 @@ Input/Output operations. In order to specify the logical file number,
 the device number, and the secondary address if any, the cbm_k_setlfs() function must first be called.
 Likewise, in order to designate the filename, the cbm_k_setnam() function must be used first.  After these two
 functions are called, cbm_k_open() is then called.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1925,7 +2165,7 @@ functions are called, cbm_k_open() is then called.
 <tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
 <tag/Declaration/<tt/unsigned char cbm_k_readst (void);/
 <tag/Description/This function returns the current status of the I/O devices. It is usually called after new communication to an I/O device and gives information about device status, or errors that have occurred during the I/O operation.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>
 </itemize>
 <tag/Availability/cc65
@@ -1947,7 +2187,7 @@ functions are called, cbm_k_open() is then called.
 used before calling this function. However, a file name is not required to
 SAVE to device 1 (the Datassette(TM) recorder). Any attempt to save to
 other devices without using a file name results in an error. NOTE: Device 0 (the keyboard), device 2 (RS-232), and device 3 (the screen) cannot be SAVEd to. If the attempt is made, an error occurs, and the SAVE is stopped.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1961,6 +2201,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>
@@ -1970,7 +2260,7 @@ only be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cbm_k_setlfs (unsigned char LFN, unsigned char DEV, unsigned char SA);/
 <tag/Description/This functions sets up the logical file by setting its number, device address,
 and secondary address.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -1991,7 +2281,7 @@ only be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cbm_k_setnam (const char* Name);/
 <tag/Description/This function is used to set up the file name for the OPEN,
 SAVE, or LOAD operations.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -2014,7 +2304,7 @@ only be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cbm_k_talk (unsigned char dev);/
 <tag/Description/When called, it ORs the device number with the TALK code (64, $40) and sends it on the serial
 bus. This commands the device to TALK.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -2026,6 +2316,49 @@ only be used in presence of a prototype.
 </quote>
 
 
+<sect1>cbm_k_tksa<label id="cbm_k_tksa"><p>
+
+<quote>
+<descrip>
+<tag/Function/Send TALK secondary address to serial bus
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<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>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_talk" name="cbm_k_talk">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>cbm_k_udtim<label id="cbm_k_udtim"><p>
+
+<quote>
+<descrip>
+<tag/Function/Update the Jiffy clock.
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<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="cbm_k_scnkey" name="cbm_k_scnkey">,
+<ref id="clock" name="clock">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>cbm_k_unlsn<label id="cbm_k_unlsn"><p>
 
 <quote>
@@ -2040,9 +2373,6 @@ 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/Limits/<itemize>
-<item>
-</itemize>
 <tag/Availability/cc65
 <tag/See also/
 <ref id="cbm_k_listen" name="cbm_k_listen">
@@ -2051,6 +2381,28 @@ to get off the serial bus so it can be used for other purposes.
 </quote>
 
 
+<sect1>cbm_k_untlk<label id="cbm_k_untlk"><p>
+
+<quote>
+<descrip>
+<tag/Function/Send an UNTALK command
+<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
+<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="cbm_k_talk" name="cbm_k_talk">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>cclear<label id="cclear"><p>
 
 <quote>
@@ -2060,7 +2412,7 @@ to get off the serial bus so it can be used for other purposes.
 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
 <tag/Description/The function clears part of a line by writing <tt/length/
 spaces in the current text color.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -2084,7 +2436,7 @@ at a specific screen position.
 <tag/Description/The function moves the cursor to a specific position, and
 will then clear part of the line by writing <tt/length/ spaces in the current
 text color.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 </itemize>
@@ -2105,15 +2457,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/Limits/<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.
+<tag/Notes/<itemize>
+<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.
@@ -2130,7 +2485,7 @@ from this buffer and wait only if the buffer is empty.
 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
 <tag/Description/The function outputs a horizontal line with the given length
 starting at the current cursor position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The character used to draw the horizontal line is system dependent.
 If available, a line drawing character is used. Drawing a line that is partially
 off screen leads to undefined behaviour.
@@ -2156,7 +2511,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
 <tag/Description/The function outputs a horizontal line with the given length
 starting at a given position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The character used to draw the horizontal line is system dependent.
 If available, a line drawing character is used. Drawing a line that is partially
 off screen leads to undefined behaviour.
@@ -2182,7 +2537,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ clearerr (FILE* f);/
 <tag/Description/<tt/clearerr/ clears the error and end-of-file status
 indicators for the stream <tt/f/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -2203,58 +2558,144 @@ 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/Limits/<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.
+<tag/Notes/<itemize>
+<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/tp/ 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/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.
-<tag/Limits/<itemize>
+<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="creat" name="creat">,
-<ref id="open" name="open">
+<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/Set the time on 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.
+<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/See also/
+<ref id="creat" name="creat">,
+<ref id="open" name="open">
 <tag/Example/None.
 </descrip>
 </quote>
@@ -2270,7 +2711,7 @@ be used in presence of a prototype.
 <tag/Description/The function closes the given directory 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.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -2283,6 +2724,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>
@@ -2293,7 +2849,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
 associated with it. On error, -1 is returned and an error code is stored in
 <tt/errno/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
 <item>The function is only available as fastcall function, so it may only
@@ -2319,7 +2875,7 @@ be used in presence of a prototype.
 formatted according to the format string given. The resulting string is output
 to the console. <tt/cprintf/ supports the same format specifiers as
 <tt/printf/. <!-- <tt/<ref id="printf" name="printf">/. -->
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Like all other <tt/conio/ output functions, <tt/cprintf/ distinguishes
 between <tt/\r/ and <tt/\n/.
 </itemize>
@@ -2344,7 +2900,7 @@ between <tt/\r/ and <tt/\n/.
 <tag/Declaration/<tt/void __fastcall__ cputc (char c);/
 <tag/Description/Output one character to the console at the current cursor
 position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Like all other <tt/conio/ output functions, <tt/cputc/ distinguishes
 between <tt/\r/ and <tt/\n/.
 <item>The function is only available as fastcall function, so it may only
@@ -2371,7 +2927,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);/
 <tag/Description/<tt/cputcxy/ moves the cursor to the given x/y position on
 the screen and outputs one character.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Like all other <tt/conio/ output functions, <tt/cputcxy/ distinguishes
 between <tt/\r/ and <tt/\n/.
 <item>The function is only available as fastcall function, so it may only
@@ -2398,7 +2954,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cputs (const char* s);/
 <tag/Description/The function outputs the given string on the console at the
 current cursor position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Like all other <tt/conio/ output functions, <tt/cputs/ distinguishes
 between <tt/\r/ and <tt/\n/.
 <item>The function is only available as fastcall function, so it may only
@@ -2425,7 +2981,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);/
 <tag/Description/<tt/cputsxy/ moves the cursor to the given x/y position,
 and outputs the string <tt/s/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Like all other <tt/conio/ output functions, <tt/cputsxy/ distinguishes
 between <tt/\r/ and <tt/\n/.
 <item>The function is only available as fastcall function, so it may only
@@ -2453,7 +3009,7 @@ be used in presence of a prototype.
 <tag/Description/If the argument to the function is non zero, a blinking cursor
 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -2475,7 +3031,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
 <tag/Description/The function outputs a vertical line with the given length
 starting at the current cursor position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The character used to draw the vertical line is system dependent.
 If available, a line drawing character is used. Drawing a line that is partially
 off screen leads to undefined behaviour.
@@ -2501,7 +3057,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
 <tag/Description/The function outputs a vertical line with the given length
 starting at a given position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The character used to draw the vertical line is system dependent.
 If available, a line drawing character is used. Drawing a line that is partially
 off screen leads to undefined behaviour.
@@ -2518,6 +3074,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>
@@ -2527,8 +3220,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
 <tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
 quotient and remainder in a <tt/div_t/ structure.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -2540,6 +3232,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>
@@ -2552,7 +3278,7 @@ the contents of the memory window have been changed, these changes may be lost
 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
 name="em_copyto">/ are called without calling <tt/em_commit/ first.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
 memory window are discarded, it does just mean that the drivers is allowed
 to discard it.
@@ -2581,7 +3307,7 @@ loaded.
 <tag/Description/Copy data from extended memory into linear memory. Source and
 target addresses as well as the number of bytes to transfer are specified in
 the <tt/em_copy/ structure that is passed as a parameter.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
 made any changes to the data in the window, call <tt/<ref id="em_commit"
 name="em_commit">/ first, or the changes are lost.
@@ -2610,7 +3336,7 @@ loaded.
 <tag/Description/Copy data from linear into extended memory. Source and
 target addresses as well as the number of bytes to transfer are specified in
 the <tt/em_copy/ structure that is passed as a parameter.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
 made any changes to the data in the window, call <tt/<ref id="em_commit"
 name="em_commit">/ first, or the changes are lost.
@@ -2639,7 +3365,7 @@ loaded.
 <tag/Description/The function installs an already loaded extended memory driver
 and returns an error code. The function may be used to install a driver linked
 statically to the program.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Not all drivers are able to detect if the supported hardware is really
 present.
 <item>The function is only available as fastcall function, so it may only be
@@ -2661,11 +3387,11 @@ used in presence of a prototype.
 <descrip>
 <tag/Function/Load and initialize an extended memory driver.
 <tag/Header/<tt/<ref id="em.h" name="em.h">/
-<tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
+<tag/Declaration/<tt/unsigned char __fastcall__ em_load_driver (const char* name);/
 <tag/Description/Load an extended memory driver into memory and initialize
 it. The function returns an error code that tells if all this has been
 successful.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Not all drivers are able to detect if the supported hardware is really
 present.
 <item>The function is only available as fastcall function, so it may only be
@@ -2695,7 +3421,7 @@ into a buffer. If you don't need the actual contents of the page (for example
 because you're going to overwrite it completely), it is better to call
 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
 data if it is possible to avoid that.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
 made any changes to the data in the window, call <tt/<ref id="em_commit"
 name="em_commit">/ first, or the changes are lost.
@@ -2723,7 +3449,7 @@ loaded.
 <tag/Declaration/<tt/unsigned em_pagecount (void);/
 <tag/Description/The function returns the size of the extended memory supported
 by the driver in 256 byte pages.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function returns zero if no extended memory driver is loaded.
 <item>The function may return zero if the supported hardware was not detected.
 </itemize>
@@ -2744,7 +3470,7 @@ by the driver in 256 byte pages.
 <tag/Declaration/<tt/unsigned char em_uninstall (void);/
 <tag/Description/The function uninstalls an already loaded extended memory
 driver but doesn't remove it from memory.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>If the driver has been loaded using <tt/<ref id="em_load_driver"
 name="em_load_driver">/, <tt/<ref id="em_unload" name="em_unload">/
 should be used instead of <tt/em_uninstall/ so the driver is also removed
@@ -2769,7 +3495,7 @@ from memory.
 <tag/Declaration/<tt/unsigned char em_unload (void);/
 <tag/Description/The function unloads a loaded extended memory driver and
 frees all memory allocated for the driver.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function does nothing if no driver is loaded.
 </itemize>
 <tag/Availability/cc65
@@ -2792,7 +3518,7 @@ memory and returns a pointer to the page frame. This function is similar to
 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
 actual memory window in the assumption that the existing data is wrong or
 will get overwritten.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
 made any changes to the data in the window, call <tt/<ref id="em_commit"
 name="em_commit">/ first, or the changes are lost.
@@ -2824,7 +3550,7 @@ output is written and any functions registered with <tt/<ref id="atexit"
 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
 name="stdlib.h">/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>It depends on the host machine if the program return code can be
@@ -2853,7 +3579,7 @@ the command line specified as second argument. Instead of an empty string,
 a <tt/NULL/ pointer may be passed as second parameter.
 On success, the function does not return. On failure, -1 is returned and
 <tt/errno/ contains an error code.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>On most platforms, the function needs to copy a small stub loader to
@@ -2878,20 +3604,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/Limits/<itemize>
-<item>The function is specific to the C128.
-<item>2MHz clock will not work in 40 column 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, 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>
@@ -2906,7 +3633,7 @@ will nearly double the speed compared to slow mode.
 <tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
 <tag/Description/<tt/feof/ tests the end-of-file indicator ofthe stream
 <tt/f/, and returns a non zero value if it is set.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The indicator is set only after a read past the end of a file is
 attempted.
 <item>The function is only available as fastcall function, so it may only be
@@ -2930,7 +3657,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/int __fastcall__ ferror (FILE* f);/
 <tag/Description/<tt/ferror/ tests the error indicator of the stream
 <tt/f/, and returns a non zero value if it is set.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -2953,7 +3680,7 @@ used in presence of a prototype.
 <tag/Description/The <tt/fileno/ function returns the file handle used
 internally by a C stream. This file handle (an integer) can be used as a
 handle for the POSIX input/output functions.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 <item>Mixing C file I/O functions and POSIX file I/O functions for the same
@@ -2981,8 +3708,7 @@ file may have unpredictable results.
 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
 pointer is <tt/NULL/, no action is performed.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>Passing an already free'd block to <tt/free/ again will cause undefined
 behaviour and may crash your program.
 <item>The function is only available as fastcall function, so it may only
@@ -3014,7 +3740,7 @@ be used in presence of a prototype.
 all supported targets. If it exists, it returns a number that identifies the
 operating system or machine type, the program runs on. The machine dependent
 header files define constants that can be used to check the return code.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function does not exist on all platforms.
 <item>The return codes are platform dependent.
 </itemize>
@@ -3024,93 +3750,360 @@ 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/
-</itemize>
-<tag/Limits/<itemize>
-<item>Other, more exotic CPU types are not disinguished.
+<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
+<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>getenv<label id="getenv"><p>
+<sect1>get_c64dtv_speed<label id="get_c64dtv_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/Limits/<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.
+<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>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/ISO 9899
+<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>getopt<label id="getopt"><p>
+<sect1>get_c65_speed<label id="get_c65_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,
-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/
-is a string that contains command line option characters. If a character in
-<tt/optstring/ is followed by a colon, the option requires an argument. An
-option on the command line is recognized if it is one of the option characters
-preceeded by a '-'.
-<tt/getopt/ must be called repeatedly. It will return each option character
-found on the command line and <tt/EOF/ (-1) if there is no other option. An
-option argument is placed in <tt/optarg/, the index of the next element on the
-command line to be processed is placed in <tt/optind/.
-<tag/Limits/<itemize>
-<item>The implementation will not reorder options. A non option on the command
-line will terminate option processing. All remaining arguments are not
-recognized as options, even if the start with a '-' character.
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<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>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/POSIX.2
+<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>gotox<label id="gotox"><p>
+<sect1>get_chameleon_speed<label id="get_chameleon_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Move the text mode cursor to a new X position.
-<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
-<tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
+<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/
+is a string that contains command line option characters. If a character in
+<tt/optstring/ is followed by a colon, the option requires an argument. An
+option on the command line is recognized if it is one of the option characters
+preceeded by a '-'.
+<tt/getopt/ must be called repeatedly. It will return each option character
+found on the command line and <tt/EOF/ (-1) if there is no other option. An
+option argument is placed in <tt/optarg/, the index of the next element on the
+command line to be processed is placed in <tt/optind/.
+<tag/Notes/<itemize>
+<item>The implementation will not reorder options. A non option on the command
+line will terminate option processing. All remaining arguments are not
+recognized as options, even if the start with a '-' character.
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+</itemize>
+<tag/Availability/POSIX.2
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>gotox<label id="gotox"><p>
+
+<quote>
+<descrip>
+<tag/Function/Move the text mode cursor to a new X position.
+<tag/Header/<tt/<ref id="conio.h" name="conio.h">/
+<tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
 <tag/Description/The function moves the text mode cursor to the specified X
 position while leaving the Y position untouched. The leftmost position on the
 screen has the coordinate 0.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 <item>Invalid values for the X position (out of screen coordinates) may
@@ -3137,7 +4130,7 @@ lead to undefined behaviour.
 <tag/Description/The function moves the text mode cursor to the specified
 position. The leftmost position on the screen has the X coordinate 0, the
 topmost line has the Y coordinate 0.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 <item>Invalid values for any of both coordinates (out of screen positions) may
@@ -3164,7 +4157,7 @@ lead to undefined behaviour.
 <tag/Description/The function moves the text mode cursor to the specified Y
 position while leaving the X position untouched. The uppermost position on the
 screen has the coordinate 0.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may
 only be used in presence of a prototype.
 <item>Invalid values for the Y position (out of screen coordinates) may lead
@@ -3191,10 +4184,10 @@ to undefined behaviour.
 <tag/Description/The function returns a non zero value if the given argument
 is a letter or digit. The return value is zero if the character is anything
 else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing
 the macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3228,10 +4221,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
 <tag/Description/The function returns a non zero value if the given argument
 is a letter. The return value is zero if the character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3265,10 +4258,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
 <tag/Description/The function returns a non zero value if the given argument
 is in the range 0..127 (the range of valid ASCII characters) and zero if not.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3303,16 +4296,16 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is a space or tab character. The return value is zero if the character is
 anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, 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="isalnum" name="isalnum">,
 <ref id="isalpha" name="isalpha">,
@@ -3341,10 +4334,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is a control character. The return value is zero if the character is anything
 else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3378,10 +4371,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
 <tag/Description/The function returns a non zero value if the given argument
 is a digit. The return value is zero if the character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3406,6 +4399,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>
@@ -3417,10 +4431,10 @@ space).
 <tag/Description/The function returns a non zero value if the given argument
 is a printable character with the exception of space. The return value is zero
 if the character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3455,10 +4469,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is a lower case letter. The return value is zero if the character is anything
 else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3493,10 +4507,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is a printable character (this includes the space character). The return value
 is zero if the character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3532,10 +4546,10 @@ space or an alphanumeric character.
 <tag/Description/The function returns a non zero value if the given argument
 is a printable character, but not a space or anything alphanumeric. The return
 value is zero if the character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3564,7 +4578,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
@@ -3572,10 +4586,10 @@ is a white space character. The return value is zero if the character is
 anything else. The standard white space characters are: space, formfeed ('\f'),
 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
 ('\v').
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3610,10 +4624,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is an upper case letter. The return value is zero if the character is anything
 else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3648,10 +4662,10 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Description/The function returns a non zero value if the given argument
 is a hexadecimal digit (0..9, a..f and A..F). The return value is zero if the
 character is anything else.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>When compiling with <tt/-Os/ the function is actually a macro. The
 inline sequence generated by the macro will not work correctly for values
-outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
+outside the range 0..255. <em/Note:/ The constant <tt/EOF/ is not part of
 this range. The non inline function may be accessed by <tt/#undef/'ing the
 macro.
 <item>When compiling without <tt/-Os/, the function is only available as
@@ -3685,7 +4699,7 @@ fastcall function, so it may only be used in presence of a prototype.
 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
 <tt/radix/ as the base.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>There are no provisions to prevent a buffer overflow.
 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
 <item>The function is non standard, so it is not available in strict ANSI mode.
@@ -3714,7 +4728,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/unsigned char joy_count (void);/
 <tag/Description/The function returns a the number of joysticks supported
 by the current joystick driver.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
 name="joy_load_driver"> before calling this function.
 <item>The function returns the number of joysticks supported by the driver.
@@ -3739,7 +4753,7 @@ There's no way to check for the number of actually connected joysticks.
 <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/JOY_ERR_OK/ in case of success).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -3763,7 +4777,7 @@ used in presence of a prototype.
 <tag/Description/The function loads a driver with the given name from disk
 and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
 driver was successfully loaded and installed.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -3787,7 +4801,7 @@ used in presence of a prototype.
 <tag/Description/The function reads the status bits for a joystick. The number
 of the joystick is passed as parameter. The result may be examined by using one
 of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
 name="joy_load_driver"> before calling this function.
 <item>The function is only available as fastcall function, so it may only be
@@ -3813,7 +4827,7 @@ used in presence of a prototype.
 <tag/Description/The function uninstalls the currently installed joystick
 driver. It does not remove the driver from memory. The function returns an
 error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>A joystick driver must be installed using <ref id="joy_install"
 name="joy_install"> before calling this function.
 </itemize>
@@ -3837,7 +4851,7 @@ name="joy_install"> before calling this function.
 <tag/Description/The function uninstalls the currently installed joystick
 driver and removes it from memory. An error code is returned, which is
 <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
 name="joy_load_driver"> before calling this function.
 </itemize>
@@ -3858,7 +4872,7 @@ name="joy_load_driver"> before calling this function.
 <tag/Declaration/<tt/unsigned char kbhit (void);/
 <tag/Description/The function returns a value of zero if there is no character
 waiting to be read from the keyboard. It returns non zero otherwise.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>If the system does not support a keyboard buffer (most systems
 do), the function is rather useless.
 </itemize>
@@ -3871,6 +4885,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>
@@ -3880,7 +4916,7 @@ do), the function is rather useless.
 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
 the function.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
@@ -3902,7 +4938,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
 using <tt/radix/ as the base.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>There are no provisions to prevent a buffer overflow.
 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
 <item>The function is non standard, so it is not available in strict ANSI mode.
@@ -3931,7 +4967,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/struct lconv* localeconv (void);/
 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
 structure.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>cc65 supports only the "C" locale, so even after setting a new locale
 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
 always be the same.
@@ -3956,8 +4992,7 @@ data in <tt/buf/, which must have been set by a preceeding call to
 <tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
 call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
 <tt/retval/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>If the parameter <tt/retval/ is zero, the function will behave as if it
 was called with a value of one.
 <item>The function is only available as fastcall function, so it may only
@@ -3981,8 +5016,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
 pointer to the allocated memory block. On error (not enough memory available),
 <tt/malloc/ returns <tt/NULL/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4012,7 +5046,7 @@ be used in presence of a prototype.
 (converted to a char) in the block of raw memory string pointed to by <tt/mem/
 that is of size <tt/count/. Upon completion, the function returns a pointer to
 the character found, or a null pointer if the character was not found.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4035,8 +5069,7 @@ be used in presence of a prototype.
 pointed to by <tt/p1/ into the memory area pointed to by <tt/p2/. It returns a value that is less than
 zero if <tt/p1/ is less than <tt/p2/, zero if <tt/p1/ is the same as <tt/p2/,
 and a value greater than zero if <tt/p1/ is greater than <tt/p2/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4060,8 +5093,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
 <tt/dest/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The result is undefined if the memory areas do overlap. Use
 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
 <item>The function is only available as fastcall function, so it may only
@@ -4087,8 +5119,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
 <tt/dest/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
 <item>The function is only available as fastcall function, so it may only
@@ -4113,8 +5144,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
 the value <tt/val/. The function returns <tt/p/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4138,9 +5168,11 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
 <tag/Description/The function will free a module loaded into memory by use of
 the <tt/<ref id="mod_load" name="mod_load">/ function.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The pointer passed as parameter is the pointer to the module memory,
 not the pointer to the control structure.
+<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/
@@ -4156,7 +5188,7 @@ not the pointer to the control structure.
 <descrip>
 <tag/Function/Load a relocatable module.
 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
-<tag/Declaration/<tt/unsigned char mod_load (struct mod_ctrl* ctrl);/
+<tag/Declaration/<tt/unsigned char __fastcall__ mod_load (struct mod_ctrl* ctrl);/
 <tag/Description/The function will load a code module into memory and relocate
 it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
 outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
@@ -4169,9 +5201,11 @@ the module just loaded. Possible error codes are:
 <item><tt/MLOAD_ERR_FMT/ - Data format error
 <item><tt/MLOAD_ERR_MEM/ - Not enough memory
 </itemize>
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
 relocatable o65 modules for use with this function.
+<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/
@@ -4189,7 +5223,7 @@ relocatable o65 modules for use with this function.
 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
 <tag/Declaration/<tt/void __fastcall__ mouse_setbox (const struct mouse_box* box);/
 <tag/Description/The function allows to set a bounding box for mouse movement.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function does not check if the mouse cursor is currently within the
 given rectangle. Placing the mouse cursor within the bounding box is the
 responsibility of the programmer.
@@ -4218,7 +5252,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ mouse_getbox (struct mouse_box* box);/
 <tag/Description/The function queries the current bounding box for mouse
 movement.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -4260,7 +5294,7 @@ return value.
 code);/
 <tag/Description/The function returns an error message (in english) for the
 error code passed parameter.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function will return "Unknown error" for invalid error codes.
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
@@ -4305,7 +5339,7 @@ mouse.
 <tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
 <tag/Description/The function returns the state of the mouse buttons and the
 position of the mouse in the <tt/mouse_info/ structure passed as parameter.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
 so if you just need the mouse position, call <tt/<ref id="mouse_pos"
 name="mouse_pos">/ instead.
@@ -4336,7 +5370,7 @@ pointer. Defaults for these routines are supplied by the library, so if you
 can live with these defaults (which are platform specific), just pass a
 pointer to <tt/mouse_def_callbacks/. The function may be used to install a
 driver linked statically to the program.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Not all drivers are able to detect if the supported hardware is really
 present.
 <item>After installing a driver, the mouse cursor is hidden.
@@ -4366,7 +5400,7 @@ different IOCTL functions, and the <tt/data/ depends on code. The
 function returns an error code. The purpose of this function is to allow
 for driver specific extensions. See the documentation for a specific mouse
 driver for supported ioctl calls.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Calling this function is non portable, because each driver may
 implement different ioctl calls (or none at all).
 <item>The function is only available as fastcall function, so it may only be
@@ -4392,7 +5426,7 @@ function returns an error code that tells if the call has been successful. The
 routines needed to move or hide/show the mouse pointer. Defaults for these
 routines are supplied by the library, so if you can live with these defaults
 (which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The driver is loaded by name, so currently you must know the type of
 mouse that should be supported. There is no autodetect capability.
 <item>Not all drivers are able to detect if the supported hardware is really
@@ -4420,7 +5454,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
 <tag/Description/The function updates the mouse position. If the mouse cursor
 is visible, it is shown at the new position.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function does not check if the new position is within the bounding
 box specified with <tt/<ref id="mouse_setbox" name="mouse_setbox">/.
 <item>The function is only available as fastcall function, so it may only be
@@ -4444,7 +5478,7 @@ used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
 <tag/Description/The function returns the position of the mouse in the
 <tt/mouse_pos/ structure passed as parameter.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
 so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
 name="mouse_info">/ instead.
@@ -4488,7 +5522,7 @@ that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
 <tag/Declaration/<tt/unsigned char mouse_uninstall (void);/
 <tag/Description/The function uninstalls an already loaded mouse driver but
 don't removes it from memory.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
 name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
 should be used instead of <tt/mouse_uninstall/ so the driver is also removed
@@ -4510,10 +5544,10 @@ from memory.
 <descrip>
 <tag/Function/Unload a mouse driver.
 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
-<tag/Declaration/<tt/unsigned char __fastcall__ mouse_unload (void);/
+<tag/Declaration/<tt/unsigned char mouse_unload (void);/
 <tag/Description/The function unloads a loaded mouse driver and frees all
 memory allocated for the driver.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function does nothing if no driver is loaded.
 </itemize>
 <tag/Availability/cc65
@@ -4525,6 +5559,29 @@ memory allocated for the driver.
 </descrip>
 </quote>
 
+<sect1>mul20<label id="mul20"><p>
+
+<quote>
+<descrip>
+<tag/Function/Multiplies argument by 20.
+<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
+<tag/Declaration/<tt/unsigned int __fastcall__ mul20 (unsigned char value);/
+<tag/Description/Speed optimized function to multiply an 8 bit unsigned value by 20 to get a 16 bit result.
+<tag/Availability/cc65
+</descrip>
+</quote>
+
+<sect1>mul40<label id="mul40"><p>
+
+<quote>
+<descrip>
+<tag/Function/Multiplies argument by 40.
+<tag/Header/<tt/<ref id="cc65.h" name="cc65.h">/
+<tag/Declaration/<tt/unsigned int __fastcall__ mul40 (unsigned char value);/
+<tag/Description/Speed optimized function to multiply an 8 bit unsigned value by 40 to get a 16 bit result.
+<tag/Availability/cc65
+</descrip>
+</quote>
 
 <sect1>offsetof<label id="offsetof"><p>
 
@@ -4535,7 +5592,7 @@ memory allocated for the driver.
 <tag/Declaration/<tt/size_t offsetof (type, member);/
 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
 or <tt/union/ member.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is actually a macro.
 </itemize>
 <tag/Availability/ISO 9899
@@ -4554,7 +5611,7 @@ or <tt/union/ member.
 <tag/Description/<tt/open/ opens a file and returns the file descriptor
 associated with it. On error, -1 is returned and an error code is stored in
 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
 open, which is used as the permission mask when a new file is created. While
 cc65 allows to pass this argument, it is ignored.
@@ -4578,7 +5635,7 @@ cc65 allows to pass this argument, it is ignored.
 <tag/Description/<tt/opendir/ opens a directory and returns the direcory
 descriptor associated with it. On error, NULL is returned and an error code is
 stored in <tt/errno/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4601,8 +5658,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
 <tag/Description/<tt/peekbsys/ reads one byte from the given address in the
 system bank (bank 15) of the CBM PET-II machines and returns it.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>This function may be a macro depending on the compiler options. The
@@ -4632,8 +5688,7 @@ actual function is accessible by #undef'ing the macro.
 system bank (bank 15) of the CBM PET-II machines and returns it. Following
 the usual 6502 conventions, the low byte is read from <tt/addr/, and the
 high byte is read from <tt/addr+1/.
-<tag/Limits/
-<itemize>
+<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 order in which the two bytes are read is undefined.
@@ -4662,8 +5717,7 @@ is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
 a blank. Then the error message for the current contents of <tt/errno/ is
 printed followed by a newline. The message output is the same as returned by
 <tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4686,8 +5740,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
 <tag/Description/<tt/pokebsys/ writes one byte to the given address in the
 system bank (bank 15) of the CBM PET-II machines.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4715,8 +5768,7 @@ be used in presence of a prototype.
 system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
 conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
 high byte is written to <tt/addr+1/.
-<tag/Limits/
-<itemize>
+<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 order in which the two bytes are written is undefined.
@@ -4740,17 +5792,18 @@ be used in presence of a prototype.
 <tag/Function/Sort an array.
 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
-size_t size, int (*compare) (const void*, const void*));/
+size_t size, int __fastcall__ (* compare) (const void*, const void*));/
 <tag/Description/<tt/qsort/ sorts an array according to a given compare
 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
 is the number of elements, <tt/size/ the size of an element and <tt/compare/
 the function used to compare the members.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>If there are multiple members with the same key, the order after calling
 the function is undefined.
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
+<item>The function to which <tt/compare/ points must have the <tt/fastcall/
+calling convention.
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
@@ -4772,7 +5825,7 @@ program has installed a signal handler for the signal, this signal handler
 will be executed. If no handler has been installed, the default action for
 the raised signal will be taken. The function returns zero on success,
 nonzero otherwise.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -4794,7 +5847,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/int rand (void);/
 <tag/Description/The function returns a pseudo random number
 between 0 and <tt/RAND_MAX/ (exclusive).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
 flow of numbers is generated.
 <item>On startup, the function behaves as if <ref id="srand" name="srand">
@@ -4821,7 +5874,7 @@ stream pointed to by <tt/dir/. It stores the data in a <tt/dirent/ structure
 and returns a pointer to it. If the end of directory is reached, or an error
 occurs, NULL is returned. In case of errors, an error code is stored into
 <tt/errno/.
-<tag/Limits/<itemize>
+<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 returned pointer may point to a statically allocated instance of
@@ -4860,8 +5913,7 @@ by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
 behaves as if <tt/free/ had been called. On error (not enough memory
 available), <tt/realloc/ returns <tt/NULL/.
-<tag/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>The part of the memory block that is returned will have its contents
 unchanged.
 <item>This function is somewhat dangerous to use. Be careful to save the
@@ -4897,8 +5949,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/remove/ 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/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <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
@@ -4934,8 +5985,7 @@ if (remove (FILENAME) == 0) {
 <tag/Description/<tt/rename/ renames a file (gives it a new 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/Limits/
-<itemize>
+<tag/Notes/<itemize>
 <item>This function is not available on all cc65 targets (depends on the
 capabilities of the storage devices).
 <item>The function is only available as fastcall function, so it may only
@@ -4970,11 +6020,9 @@ if (rename (OLDNAME, NEWNAME) == 0) {
 <tag/Declaration/<tt/void reset_brk (void);/
 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
 before a call to <tt/set_brk/.
-<tag/Limits/
-<itemize>
-<item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
-it is not strictly necessary to call this function as part of the cleanup when
-the program ends.
+<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 exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -4994,10 +6042,9 @@ the program ends.
 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
 <tag/Declaration/<tt/void reset_irq (void);/
 <tag/Description/<tt/reset_irq/ resets the C level interrupt request vector.
-<tag/Limits/
-<itemize>
-<item>The original IRQ vector is restored on program termination even without
-calling this function.
+<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 exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5019,7 +6066,7 @@ calling this function.
 <tag/Description/If the argument is non zero, the function enables reverse
 character display. If the argument is zero, reverse character display is
 switched off. The old value of the setting is returned.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function may not be supported by the hardware, in which case
 the call is ignored.
 <item>The function is only available as fastcall function, so it may only
@@ -5042,7 +6089,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ rewinddir (DIR* dir);/
 <tag/Description/<tt/rewinddir/ sets the position of the directory stream
 pointed to by <tt/dir/ to the start of the directory.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5063,7 +6110,7 @@ be used in presence of a prototype.
 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
 <tag/Description/The function returns the dimensions of the text mode screen.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5089,7 +6136,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/seekdir/ sets the position of the directory stream
 pointed to by <tt/dir/ to the value given in <tt/offset/, which should be a
 value returned by <tt/<ref id="telldir" name="telldir">/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5143,7 +6190,7 @@ static void initialize(){
 <tag/Description/Get a character from the serial port. If no characters are
 available, the function will return SER_ERR_NO_DATA, so this is not a fatal
 error.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5170,7 +6217,7 @@ while (ser_get(&amp;ch) == SER_ERR_NO_DATA)
 <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/SER_ERR_OK/ in case of success).
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only be
 used in presence of a prototype.
 </itemize>
@@ -5196,7 +6243,7 @@ ser_install(lynx_comlynx); //Include the driver statically instead of loading it
 <tag/Description/Some platforms have extra serial functions that are not
 supported by standard serial driver functions. You can extend the driver to support
 this extra functionality bt using ser_ioctl functions.
-<tag/Limits/<itemize>
+<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.
@@ -5216,7 +6263,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/unsigned char __fastcall__ ser_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.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5235,7 +6282,7 @@ be used in presence of a prototype.
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
 <tag/Declaration/<tt/unsigned char __fastcall__ ser_open (const struct ser_params* params);/
 <tag/Description/Open the port by setting the port parameters and enable interrupts.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5272,7 +6319,7 @@ static void initialize(){
 <tag/Description/Send a character via the serial port. There is a transmit
 buffer, but transmitting is not done via interrupt. The function returns
 SER_ERR_OVERFLOW if there is no space left in the transmit buffer.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5294,7 +6341,7 @@ ser_put('A');
 <tag/Header/<tt/<ref id="serial.h" name="serial.h">/
 <tag/Declaration/<tt/unsigned char __fastcall__ ser_status (unsigned char* status);/
 <tag/Description/Return the serial port status.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5345,8 +6392,7 @@ be used in presence of a prototype.
 program code by letting the vector point to a user written C function. The
 runtime library installs a small stub that saves the registers into global
 variables that may be accessed (and changed) by the break handler.
-<tag/Limits/
-<itemize>
+<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 stub saves the zero page registers used by the C runtime and switches
@@ -5357,9 +6403,9 @@ function called from it.
 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
 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>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
-to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
-the program terminates.
+<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 exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5386,8 +6432,7 @@ was set up to handle a "private", "exclusive" interrupt request source it must
 return the value <tt/IRQ_HANDLED/ if and only if it has verified that the current
 interrupt request actually stems from that source. In all other cases it must return
 the value <tt/IRQ_NOT_HANDLED/.
-<tag/Limits/
-<itemize>
+<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 stub saves the registers and zero page locations used by the C runtime
@@ -5396,9 +6441,9 @@ runtime overhead, but it it is safe to execute C code, even if other C code
 was interrupted. Be careful however not to call C library functions, and do not
 enable stack checks for the handler function or any other function called from
 it.
-<item>The interrupt vector is reset on function termination, so it's not
-strictly necessary to call <tt/<ref id="reset_irq" name="reset_irq">/ as part
-of the cleanup when the program terminates.
+<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 exiting the program.
 </itemize>
 <tag/Availability/cc65
 <tag/See also/
@@ -5410,45 +6455,175 @@ of the cleanup when the program terminates.
 </quote>
 
 
-<sect1>setjmp<label id="setjmp"><p>
+<sect1>set_c128_speed<label id="set_c128_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Save the context for use with <tt/longjmp/.
-<tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
-<tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
-<tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
-for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
-returns zero.
-<tag/Limits/
-<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item><tt/setjmp/ is actually a macro as required by the ISO standard.
-<item><tt/setjmp/ will not save the signal context.
+<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/ISO 9899
+<tag/Availability/cc65 (not all platforms)
 <tag/See also/
-<ref id="longjmp" name="longjmp">
+<ref id="detect_c128" name="detect_c128">,
+<ref id="get_c128_speed" name="get_c128_speed">,
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>setlocale<label id="setlocale"><p>
+<sect1>set_c64dtv_speed<label id="set_c64dtv_speed"><p>
 
 <quote>
 <descrip>
-<tag/Function/Selects a locale.
-<tag/Header/<tt/<ref id="locale.h" name="locale.h">/
-<tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
-<tag/Description/<tt/setlocale/ sets or queries the program's locale.
-<tag/Limits/
-<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item>cc65 supports only the "C" locale, so calling this function to set a
-different locale has no effect.
+<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>
+<descrip>
+<tag/Function/Save the context for use with <tt/longjmp/.
+<tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
+<tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
+<tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
+for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
+returns zero.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item><tt/setjmp/ is actually a macro as required by the ISO standard.
+<item><tt/setjmp/ will not save the signal context.
+</itemize>
+<tag/Availability/ISO 9899
+<tag/See also/
+<ref id="longjmp" name="longjmp">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
+<sect1>setlocale<label id="setlocale"><p>
+
+<quote>
+<descrip>
+<tag/Function/Selects a locale.
+<tag/Header/<tt/<ref id="locale.h" name="locale.h">/
+<tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
+<tag/Description/<tt/setlocale/ sets or queries the program's locale.
+<tag/Notes/<itemize>
+<item>The function is only available as fastcall function, so it may only
+be used in presence of a prototype.
+<item>cc65 supports only the "C" locale, so calling this function to set a
+different locale has no effect.
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
@@ -5472,7 +6647,7 @@ handler may either be a user supplied function, or one of the predefined
 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
 previous value if the signal , or the special function vector SIG_ERR in
 case of an error.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5494,7 +6669,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
 <tag/Description/The function will return after the specified number of
 seconds have elapsed.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5508,19 +6683,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/Limits/<itemize>
-<item>The function is specific to the C128.
+<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, 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>
@@ -5536,7 +6712,7 @@ will halve the speed compared to fast mode.
 <tag/Description/The function initializes the random number generator using
 the given seed. On program startup, the generator behaves as if <tt/srand/ has
 been called with an argument of 1.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5560,7 +6736,7 @@ be used in presence of a prototype.
 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/Limits/<itemize>
+<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.
@@ -5588,7 +6764,7 @@ be used in presence of a prototype.
 pointed to by s2 (including the terminating null byte) to the end of the
 string pointed to by s1. The initial byte of s2 overwrites the null byte at
 the end of s1.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>If copying takes place between objects that overlap, the behaviour
@@ -5615,7 +6791,7 @@ is undefined.
 (converted to a char) in the string pointed to by <tt/s/. The terminating null
 byte is considered to be part of the string. Upon completion, the function
 returns a pointer to the byte, or a null pointer if the byte was not found.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5639,7 +6815,7 @@ be used in presence of a prototype.
 parameters. 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/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5667,7 +6843,7 @@ parameters, according to the collating sequence set by <tt/<ref id="setlocale"
 name="setlocale">/. 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/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5694,7 +6870,7 @@ be used in presence of a prototype.
 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
 <tt/s2/ (including the terminating null byte) into the array pointed to by
 <tt/s1/. The function will always return <tt/s1/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>If copying takes place between objects that overlap, the behaviour
@@ -5727,12 +6903,14 @@ strcpy (hello, "Hello world!\n");
 <tag/Description/The <tt/strcspn/ function computes and returns the length of
 the substring pointed to by <tt/s/ which does <em>not</em> consist of
 characters contained in the string <tt/set/.
-<tag/Limits/<itemize>
+<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="strpbrk" name="strpbrk">,
+<ref id="strqtok" name="strqtok">,
 <ref id="strspn" name="strspn">,
 <ref id="strstr" name="strstr">,
 <ref id="strtok" name="strtok">
@@ -5752,7 +6930,7 @@ be used in presence of a prototype.
 to hold a copy of <tt/s/ including the terminating zero. If the allocation
 fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
 memory block, and a pointer to the block is returned.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>It is up to the caller to free the allocated memory block.
@@ -5777,7 +6955,7 @@ be used in presence of a prototype.
 given error code. If an invalid error code is passed, the string "Unknown
 error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
 <tt/errno/ is left untouched.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>While the return type of the function is a <tt/char*/, the returned
@@ -5802,7 +6980,7 @@ string must not be modified by the caller!
 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/Limits/<itemize>
+<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.
@@ -5828,7 +7006,7 @@ be used in presence of a prototype.
 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
 string to which s points, not including the terminating null byte.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>When compiling with <tt/-Os/ (inline known standard functions), the
@@ -5851,7 +7029,7 @@ function does not work correctly for strings with more than 255 characters.
 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
 function to each character of a string. The function will always return <tt/s/.
-<tag/Limits/<itemize>
+<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 prototype is unavailable when compiling in strict ANSI mode.
@@ -5873,6 +7051,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>
@@ -5884,7 +7090,7 @@ See <tt/strlower/.
 of the string pointed to by s2 to the end of the string pointed to by s1. The
 terminating null character at the end of s1 is overwritten. A terminating null
 character is appended to the result, even if not all of s2 is appended to s1.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 <item>If copying takes place between objects that overlap, the behaviour
@@ -5912,7 +7118,7 @@ characters of the two strings passed as parameters. It returns a value that is
 less than zero if the first <tt/count/ characters of <tt/s1/ are less than
 <tt/s2/, zero if they are identical, and a value greater than zero they are
 greater.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5934,21 +7140,23 @@ be used in presence of a prototype.
 <descrip>
 <tag/Function/Copy part of a string.
 <tag/Header/<tt/<ref id="string.h" name="string.h">/
-<tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
-<tag/Description/The <tt/strncpy/ function copies not more than n bytes from
+<tag/Declaration/<tt/char* __fastcall__ strncpy (char* s1, const char* s2, size_t n);/
+<tag/Description/The <tt/strncpy/ function copies not more than <tt/n/ bytes from
 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
-pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
+pointed to by <tt/s2/ is a string that is shorter than <tt/n/ bytes, null bytes are
 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
-written. The function will always return <tt/s1/.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype. If there is no null byte in the first <tt/n/
-bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
+written. The function always will return <tt/s1/.
+<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.
+<item>If there is no null byte in the first <tt/n/ bytes of the array pointed
+to by <tt/s2/, the result is <em/not/ null-terminated!
 <item>If copying takes place between objects that overlap, the behaviour is
 undefined.
 </itemize>
 <tag/Availability/ISO 9899
 <tag/See also/
+<ref id="memcpy" name="memcpy">,
 <ref id="strcat" name="strcat">,
 <ref id="strcpy" name="strcpy">,
 <ref id="strncat" name="strncat">
@@ -5958,13 +7166,98 @@ undefined.
 
 static char hello[6];
 
-strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
-hello[5] = '\0';
+strncpy (hello, "Hello world!\n", sizeof hello - 1)[5] = '\0';
 </verb>
 </descrip>
 </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>
+<descrip>
+<tag/Function/Break a string into tokens.
+<tag/Header/<tt/<ref id="string.h" name="string.h">/
+<tag/Declaration/<tt/char* __fastcall__ strqtok (char* s1, const char* s2);/
+<tag/Description/<tt/strqtok()/ will break the string <tt/s1/ into a sequence of
+tokens, which are delimited by either quotation marks or characters from the
+string <tt/s2/. Tokens inside quotation marks may contain characters from <tt/s2/
+(they aren't delimiters there). The first call to <tt/strqtok()/ will return a
+pointer to the first token in the string <tt/s1/. The following calls must pass
+a <tt/NULL/ pointer as <tt/s1/, in order to get the next token in the string.
+Different sets of delimiters may be used for the subsequent calls to <tt/strqtok()/.
+<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.
+<item><tt/strqtok()/ will modify the string <tt/s1/.
+<item>The function will forget where it is in the <tt/s1/ string if it is given
+a second <tt/s1/ string before it finishes the first one.
+</itemize>
+<tag/Availability/cc65
+<tag/See also/
+<ref id="strcspn" name="strcspn">,
+<ref id="strpbrk" name="strpbrk">,
+<ref id="strspn" name="strspn">,
+<ref id="strtok" name="strtok">
+<tag/Example/None.
+</descrip>
+</quote>
+
+
 <sect1>strrchr<label id="strrchr"><p>
 
 <quote>
@@ -5976,7 +7269,7 @@ hello[5] = '\0';
 (converted to a char) in the string pointed to by <tt/s/. The terminating null
 byte is considered to be part of the string. Upon completion, the function
 returns a pointer to the byte, or a null pointer if the byte was not found.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -5998,13 +7291,14 @@ be used in presence of a prototype.
 <tag/Description/The <tt/strspn/ function computes and returns the length of
 the substring pointed to by <tt/s/ which does consist only of characters
 contained in the string <tt/set/.
-<tag/Limits/<itemize>
+<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="strcspn" name="strcspn">,
+<ref id="strpbrk" name="strpbrk">,
 <ref id="strstr" name="strstr">
 <tag/Example/None.
 </descrip>
@@ -6021,7 +7315,7 @@ be used in presence of a prototype.
 <tag/Description/<tt/strstr/ searches for the first occurance of the string
 <tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
 otherwise it returns <tt/NULL/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -6041,21 +7335,25 @@ be used in presence of a prototype.
 <tag/Function/Break a string into tokens.
 <tag/Header/<tt/<ref id="string.h" name="string.h">/
 <tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
-<tag/Description/<tt/strtok/ will break the string s1 into a sequence of
-tokens, which are delimited by characters from the string s2. The first call
-to <tt/strtok/ will return a pointer to the first token in the string s1.
-Following calls must pass a <tt/NULL/ pointer as s1 in order to get the next
-token in the string. Different sets of delimiters may be used for the
-subsequent calls to <tt/strtok/.
-<tag/Limits/<itemize>
+<tag/Description/<tt/strtok()/ will break the string <tt/s1/ into a sequence of
+tokens, which are delimited by characters from the string <tt/s2/. The first call
+to <tt/strtok()/ will return a pointer to the first token in the string <tt/s1/.
+The following calls must pass a <tt/NULL/ pointer as <tt/s1/, in order to get
+the next token in the string. Different sets of delimiters may be used for the
+subsequent calls to <tt/strtok()/.
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
-<item><tt/strtok/ will modify the string s1.
+<item><tt/strtok()/ will modify the string <tt/s1/.
+<item>The function will forget where it is in the <tt/s1/ string if it is given
+a second <tt/s1/ string before it finishes the first one.
 </itemize>
 <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.
 </descrip>
 </quote>
@@ -6075,7 +7373,7 @@ transformed strings, it returns a value greater than, equal to, or less than
 zero, corresponding to the result of the <tt/strcoll/ function applied to the
 same two original strings. No more than n characters are placed into the
 resulting array pointed to by s1, including the terminating null character.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item><tt/s1/ and <tt/s2/ must not point to the same memory area, otherwise
 the behaviour is undefined.
 <item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
@@ -6103,7 +7401,7 @@ just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
 function to each character of a string. The function will always return <tt/s/.
-<tag/Limits/<itemize>
+<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 prototype is unavailable when compiling in strict ANSI mode.
@@ -6135,7 +7433,7 @@ See <tt/strupper/.
 <tag/Description/<tt/telldir/ returns the current position of a directory
 stream. The return value may be used in subsequent calls to
 <tt/<ref id="seekdir" name="seekdir">/.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>The function is only available as fastcall function, so it may only
 be used in presence of a prototype.
 </itemize>
@@ -6158,7 +7456,7 @@ be used in presence of a prototype.
 <tag/Description/The function will set a new text color. It returns the old
 (current) text color. Text output using any <tt/conio.h/ function will use
 the color set by this function.
-<tag/Limits/<itemize>
+<tag/Notes/<itemize>
 <item>Text colors are system dependent. The function may have no effect
 on systems where the text color cannot be changed.
 <item>The function is only available as fastcall function, so it may only
@@ -6173,1074 +7471,105 @@ 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/Limits/<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.
+<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>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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<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/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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
+<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/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>
-</descrip>
-</quote>
-
-
-<sect1>tgi_clear<label id="tgi_clear"><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
+<ref id="islower" name="islower">,
+<ref id="isupper" name="isupper">,
+<ref id="toupper" name="toupper">
 <tag/Example/None.
 </descrip>
 </quote>
 
 
-<sect1>tgi_done<label id="tgi_done"><p>
+<sect1>toupper<label id="toupper"><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/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_ellipse<label id="tgi_ellipse"><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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_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);
-</verb>
-</descrip>
-</quote>
-
-
-<sect1>tgi_free_vectorfont<label id="tgi_free_vectorfont"><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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_load_vectorfont" name="tgi_load_vectorfont">,
-<ref id="tgi_install_vectorfont" name="tgi_install_vectorfont">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_getaspectratio<label id="tgi_getaspectratio"><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.
-<tag/Limits/<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.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_setaspectratio" name="tgi_setaspectratio">
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_getcolor<label id="tgi_getcolor"><p>
-
-<quote>
-<descrip>
-<tag/Function/Return the current drawing color.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned char 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>
-</descrip>
-</quote>
-
-
-<sect1>tgi_getcolorcount<label id="tgi_getcolorcount"><p>
-
-<quote>
-<descrip>
-<tag/Function/Get the number of available colors.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned char 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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_getmaxcolor<label id="tgi_getmaxcolor"><p>
-
-<quote>
-<descrip>
-<tag/Function/Get the highest index of the palette.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned char 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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_getxres<label id="tgi_getxres"><p>
-
-<quote>
-<descrip>
-<tag/Function/Get number of horisontal pixels on the screen.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/unsigned 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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_init<label id="tgi_init"><p>
-
-<quote>
-<descrip>
-<tag/Function/Initialize the already loaded graphics driver.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void tgi_init (void);/
-<tag/Description/The tgi_init function will set the default palette to the
-hardware.
-<tag/Limits/<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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only be
-used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_load_driver" name="tgi_load_driver">,
-<ref id="tgi_uninstall" name="tgi_uninstall">,
-<ref id="tgi_unload" name="tgi_unload">
-<tag/Example/<verb>
-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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only be
-used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_load_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-<item>These functions are not easily portable to other cc65 platforms.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-#define tgi_sprite(spr) tgi_ioctl(0, (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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_lineto<label id="tgi_lineto"><p>
-
-<quote>
-<descrip>
-<tag/Function/Draw a line in the current drawing color from the graphics
-cursor to the new end point. The graphics cursor will be updated to x2/y2.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_lineto (int x2, int y2);/
-<tag/Description/Draw a line in the current drawing color from the graphics
-cursor to the new end point. The graphics cursor will be updated to x2/y2.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_load_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_load_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_outtextxy<label id="tgi_outtextxy"><p>
-
-<quote>
-<descrip>
-<tag/Function/Output text at the given cursor position.
-The graphics cursor is moved to the end of the text.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_outtextxy (int x, int y, const char* s);/
-<tag/Description/Output text at the given cursor position.
-The graphics cursor is moved to the end of the text.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-
-<sect1>tgi_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/Limits/<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/Limits/<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.
-</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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-tgi_setcolor(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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-tgi_setdrawpage(1);
-tgi_outtextxy(10, 10, "Hello World");
-tgi_setviewpage(1); // Show page 1
-tgi_setdrawpage(0);
-tgi_outtextxy(10, 10, "Creating next frame");
-...
-tgi_setviewpage(0); // Show page 0
-</verb>
-</descrip>
-</quote>
-
-<sect1>tgi_setpalette<label id="tgi_setpalette"><p>
-
-<quote>
-<descrip>
-<tag/Function/Set the palette (not available with all drivers/hardware).
-Palette is a pointer to as many entries as there are colors.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_setpalette (const unsigned char* palette);/
-<tag/Description/Set the palette (not available with all drivers/hardware).
-Palette is a pointer to as many entries as there are colors.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_setpixel<label id="tgi_setpixel"><p>
-
-<quote>
-<descrip>
-<tag/Function/Plot a pixel on the drawpage with the current color.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_setpixel (int x, int y);/
-<tag/Description/Plot a pixel on the drawpage with the current color.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_setviewpage<label id="tgi_setviewpage"><p>
-
-<quote>
-<descrip>
-<tag/Function/Set page to be visible on screen.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void __fastcall__ tgi_setviewpage (unsigned char page);/
-<tag/Description/If the drawpage and the viewpage are the same then all drawing
-is seen immediately as it is drawn. For double buffered games you can set the
-drawpage to a different page than the viewpage. This lets you draw the next
-screen in the background and when the screen is ready you display it.
-<tag/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/<verb>
-tgi_setdrawpage(1);
-tgi_outtextxy(10, 10, "Hello World");
-tgi_setviewpage(1); // Show page 1
-tgi_setdrawpage(0);
-tgi_outtextxy(10, 10, "Creating next frame");
-...
-tgi_setviewpage(0); // Show page 0
-</verb>
-</descrip>
-</quote>
-
-<sect1>tgi_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/
-<ref id="tgi_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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may only
-be used in presence of a prototype.
-</itemize>
-<tag/Availability/cc65
-<tag/See also/Other tgi functions.
-<tag/Example/None.
-</descrip>
-</quote>
-
-<sect1>tgi_uninstall<label id="tgi_uninstall"><p>
-
-<quote>
-<descrip>
-<tag/Function/Uninstall the currently loaded driver but do not unload it.
-Will call tgi_done if necessary.
-<tag/Header/<tt/<ref id="tgi.h" name="tgi.h">/
-<tag/Declaration/<tt/void 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/Limits/<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/Limits/<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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may
-only be used in presence of a prototype.
-</itemize>
-<tag/Availability/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/Limits/<itemize>
-<item>The function is only available as fastcall function, so it may
-only be used in presence of a prototype.
-</itemize>
-<tag/Availability/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>
+<sect1>ultoa<label id="ultoa"><p>
 
 <quote>
 <descrip>
@@ -7249,7 +7578,7 @@ only be used in presence of a prototype.
 <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/Limits/<itemize>
+<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.
@@ -7278,8 +7607,7 @@ used in presence of a prototype.
 <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/Limits/
-<itemize>
+<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
@@ -7319,7 +7647,7 @@ if (unlink (FILENAME) == 0) {
 <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/Limits/<itemize>
+<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.
@@ -7349,7 +7677,7 @@ used in presence of a prototype.
 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/Limits/<itemize>
+<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
@@ -7378,7 +7706,7 @@ used in presence of a prototype.
 <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/Limits/<itemize>
+<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">.
@@ -7388,6 +7716,7 @@ used in presence of a prototype.
 <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.
@@ -7395,6 +7724,24 @@ used in presence of a prototype.
 </quote>
 
 
+<sect1>waitvsync<label id="waitvsync"><p>
+
+<quote>
+<descrip>
+<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>
+
+
 <sect1>wherex<label id="wherex"><p>
 
 <quote>