1 <!doctype linuxdoc system>
4 <title>cc65 function reference
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
9 cc65 is a C compiler for 6502 based systems. This function reference describes
10 the C functions available in the standard library.
13 <!-- Table of contents -->
16 <!-- Begin the document -->
20 cc65 is a C compiler for 6502 based systems. It implements a subset of the ISO
21 C standard plus additional functions specially crafted for 6502 systems or
22 just some of the supported machines. This function refrence describes the
23 available functions together with any limitations.
25 For an overview about the available libraries, their purpose, and any
26 differences to the ISO standard, please have a look at the <htmlurl
27 url="library.html" name="cc65 Library Overview">.
29 <bf/Note:/ Standard C functions are listed here, but not described in detail.
30 Since these functions behave identical on all standard compliant systems, they
31 are described in any book covering standard C.
33 Each entry for a function contains a detailed description
37 <tag/Function/Summary of what <bf/function/ does.
38 <tag/Header/The header file that contains the declaration.
39 <tag/Declaration/Describes the needed header files and declaration of the
41 <tag/Description/Description of the function.
43 <tag/Availability/The availability of the function.
44 <tag/See also/Other related functions.
45 <tag/Example/A piece of actual code using the function.
50 <sect>Functions by header file<p>
52 <sect1><tt/6502.h/<label id="6502.h"><p>
55 <item><ref id="BRK" name="BRK">
56 <item><ref id="CLI" name="CLI">
57 <item><ref id="SEI" name="SEI">
58 <item><ref id="_sys" name="_sys">
59 <item><ref id="getcpu" name="getcpu">
60 <item><ref id="reset_brk" name="reset_brk">
61 <item><ref id="set_brk" name="set_brk">
65 <sect1><tt/apple2.h/<label id="apple2.h"><p>
69 <item><ref id="get_ostype" name="get_ostype">
74 <sect1><tt/apple2enh.h/<label id="apple2enh.h"><p>
78 <item><ref id="get_ostype" name="get_ostype">
82 <item><ref id="videomode" name="videomode">
86 <sect1><tt/assert.h/<label id="assert.h"><p>
89 <item><ref id="assert" name="assert">
93 <sect1><tt/atari.h/<label id="atari.h"><p>
96 <item><ref id="get_ostype" name="get_ostype">
102 <sect1><tt/atmos.h/<label id="atmos.h"><p>
107 <sect1><tt/c128.h/<label id="c128.h"><p>
110 <item><ref id="c64mode" name="c64mode">
111 <item><ref id="fast" name="fast">
112 <item><ref id="slow" name="slow">
113 <item><ref id="toggle_videomode" name="toggle_videomode">
114 <item><ref id="videomode" name="videomode">
118 <sect1><tt/c16.h/<label id="c16.h"><p>
123 <sect1><tt/c64.h/<label id="c64.h"><p>
126 <item><ref id="get_ostype" name="get_ostype">
130 <sect1><tt/cbm510.h/<label id="cbm510.h"><p>
133 <item><ref id="peekbsys" name="peekbsys">
134 <item><ref id="peekwsys" name="peekwsys">
135 <item><ref id="pokebsys" name="pokebsys">
136 <item><ref id="pokewsys" name="pokewsys">
140 <sect1><tt/cbm610.h/<label id="cbm610.h"><p>
143 <item><ref id="peekbsys" name="peekbsys">
144 <item><ref id="peekwsys" name="peekwsys">
145 <item><ref id="pokebsys" name="pokebsys">
146 <item><ref id="pokewsys" name="pokewsys">
150 <sect1><tt/conio.h/<label id="conio.h"><p>
153 <item><ref id="bgcolor" name="bgcolor">
154 <item><ref id="bordercolor" name="bordercolor">
155 <item><ref id="cclear" name="cclear">
156 <item><ref id="cclearxy" name="cclearxy">
157 <item><ref id="cgetc" name="cgetc">
158 <item><ref id="chline" name="chline">
159 <item><ref id="chlinexy" name="chlinexy">
160 <item><ref id="clrscr" name="clrscr">
161 <item><ref id="cprintf" name="cprintf">
162 <item><ref id="cputc" name="cputc">
163 <item><ref id="cputcxy" name="cputcxy">
164 <item><ref id="cputs" name="cputs">
165 <item><ref id="cputsxy" name="cputsxy">
166 <item><ref id="cursor" name="cursor">
167 <item><ref id="cvline" name="cvline">
168 <item><ref id="cvlinexy" name="cvlinexy">
169 <item><ref id="gotox" name="gotox">
170 <item><ref id="gotoxy" name="gotoxy">
171 <item><ref id="gotoy" name="gotoy">
172 <item><ref id="kbhit" name="kbhit">
173 <item><ref id="revers" name="revers">
174 <item><ref id="screensize" name="screensize">
175 <item><ref id="textcolor" name="textcolor">
176 <item><ref id="vcprintf" name="vcprintf">
177 <item><ref id="wherex" name="wherex">
178 <item><ref id="wherey" name="wherey">
182 <sect1><tt/ctype.h/<label id="ctype.h"><p>
185 <item><ref id="isalnum" name="isalnum">
186 <item><ref id="isalpha" name="isalpha">
187 <item><ref id="isascii" name="isascii">
188 <item><ref id="isblank" name="isblank">
189 <item><ref id="iscntrl" name="iscntrl">
190 <item><ref id="isdigit" name="isdigit">
191 <item><ref id="isgraph" name="isgraph">
192 <item><ref id="islower" name="islower">
193 <item><ref id="isprint" name="isprint">
194 <item><ref id="ispunct" name="ispunct">
195 <item><ref id="isspace" name="isspace">
196 <item><ref id="isupper" name="isupper">
197 <item><ref id="isxdigit" name="isxdigit">
198 <item><ref id="tolower" name="tolower">
199 <item><ref id="toupper" name="toupper">
203 <sect1><tt/dbg.h/<label id="dbg.h"><p>
208 <sect1><tt/dio.h/<label id="dio.h"><p>
213 <sect1><tt/em.h/<label id="em.h"><p>
216 <item><ref id="em_commit" name="em_commit">
217 <item><ref id="em_copyfrom" name="em_copyfrom">
218 <item><ref id="em_copyto" name="em_copyto">
219 <item><ref id="em_install" name="em_install">
220 <item><ref id="em_load_driver" name="em_load_driver">
221 <item><ref id="em_map" name="em_map">
222 <item><ref id="em_pagecount" name="em_pagecount">
223 <item><ref id="em_uninstall" name="em_uninstall">
224 <item><ref id="em_unload" name="em_unload">
225 <item><ref id="em_use" name="em_use">
229 <sect1><tt/errno.h/<label id="errno.h"><p>
234 <sect1><tt/fcntl.h/<label id="fcntl.h"><p>
237 <item><ref id="close" name="close">
238 <item><ref id="creat" name="creat">
239 <item><ref id="open" name="open">
243 <sect1><tt/geos.h/<label id="geos.h"><p>
248 <sect1><tt/joystick.h/<label id="joystick.h"><p>
251 <item><ref id="joy_count" name="joy_count">
252 <item><ref id="joy_install" name="joy_install">
253 <item><ref id="joy_load_driver" name="joy_load_driver">
254 <item><ref id="joy_read" name="joy_read">
255 <item><ref id="joy_uninstall" name="joy_uninstall">
256 <item><ref id="joy_unload" name="joy_unload">
260 <sect1><tt/locale.h/<label id="locale.h"><p>
263 <item><ref id="localeconv" name="localeconv">
264 <item><ref id="setlocale" name="setlocale">
268 <sect1><tt/modload.h/<label id="modload.h"><p>
271 <item><ref id="mod_load" name="mod_load">
272 <item><ref id="mod_free" name="mod_free">
276 <sect1><tt/mouse.h/<label id="mouse.h"><p>
279 <item><ref id="mouse_load_driver" name="mouse_load_driver">
280 <item><ref id="mouse_unload" name="mouse_unload">
281 <item><ref id="mouse_install" name="mouse_install">
282 <item><ref id="mouse_uninstall" name="mouse_uninstall">
283 <item><ref id="mouse_hide" name="mouse_hide">
284 <item><ref id="mouse_show" name="mouse_show">
285 <item><ref id="mouse_box" name="mouse_box">
286 <item><ref id="mouse_move" name="mouse_move">
287 <item><ref id="mouse_buttons" name="mouse_buttons">
288 <item><ref id="mouse_pos" name="mouse_pos">
289 <item><ref id="mouse_info" name="mouse_info">
290 <item><ref id="mouse_ioctl" name="mouse_ioctl">
296 <sect1><tt/nes.h/<label id="nes.h"><p>
301 <sect1><tt/o65.h/<label id="o65.h"><p>
303 The <tt/o65.h/ header file contains structure and constant definitions that
304 may be used when dealing with files in <htmlurl
305 url="http://www.6502.org/users/andre/o65/fileformat.html" name="o65 format">.
306 It does not declare any functions.
309 <sect1><tt/peekpoke.h/<label id="peekpoke.h"><p>
312 <item><ref id="PEEK" name="PEEK">
313 <item><ref id="PEEKW" name="PEEKW">
314 <item><ref id="POKE" name="POKE">
315 <item><ref id="POKEW" name="POKEW">
319 <sect1><tt/pet.h/<label id="pet.h"><p>
324 <sect1><tt/plus4.h/<label id="plus4.h"><p>
329 <sect1><tt/serial.h/<label id="serial.h"><p>
333 <item><ref id="ser_load_driver" name="ser_load_driver">
334 <item><ref id="ser_unload" name="ser_unload">
335 <item><ref id="ser_install" name="ser_install">
336 <item><ref id="ser_uninstall" name="ser_uninstall">
337 <item><ref id="ser_open" name="ser_open">
338 <item><ref id="ser_close" name="ser_close">
339 <item><ref id="ser_get" name="ser_get">
340 <item><ref id="ser_put" name="ser_put">
341 <item><ref id="ser_status" name="ser_status">
342 <item><ref id="ser_ioctl" name="ser_ioctl">
349 <sect1><tt/setjmp.h/<label id="setjmp.h"><p>
352 <item><ref id="setjmp" name="setjmp">
353 <item><ref id="longjmp" name="longjmp">
357 <sect1><tt/signal.h/<label id="signal.h"><p>
360 <item><ref id="raise" name="raise">
361 <item><ref id="signal" name="signal">
365 <sect1><tt/stdarg.h/<label id="stdarg.h"><p>
370 <sect1><tt/stdbool.h/<label id="stdbool.h"><p>
375 <sect1><tt/stddef.h/<label id="stddef.h"><p>
378 <item><ref id="offsetof" name="offsetof">
382 <sect1><tt/stdio.h/<label id="stdio.h"><p>
385 <item><ref id="clearerr" name="clearerr">
386 <!-- <item><ref id="fclose" name="fclose"> -->
387 <!-- <item><ref id="fdopen" name="fdopen"> -->
388 <item><ref id="feof" name="feof">
389 <item><ref id="ferror" name="ferror">
390 <!-- <item><ref id="fflush" name="fflush"> -->
391 <!-- <item><ref id="fgetc" name="fgetc"> -->
392 <!-- <item><ref id="fgetpos" name="fgetpos"> -->
393 <!-- <item><ref id="fgets" name="fgets"> -->
394 <item><ref id="fileno" name="fileno">
395 <!-- <item><ref id="fopen" name="fopen"> -->
396 <!-- <item><ref id="fprintf" name="fprintf"> -->
397 <!-- <item><ref id="fputc" name="fputc"> -->
398 <!-- <item><ref id="fputs" name="fputs"> -->
399 <!-- <item><ref id="fread" name="fread"> -->
400 <!-- <item><ref id="freopen" name="freopen"> -->
401 <!-- <item><ref id="fscanf" name="fscanf"> -->
402 <!-- <item><ref id="fseek" name="fseek"> -->
403 <!-- <item><ref id="fsetpos" name="fsetpos"> -->
404 <!-- <item><ref id="ftell" name="ftell"> -->
405 <!-- <item><ref id="fwrite" name="fwrite"> -->
406 <!-- <item><ref id="getc" name="getc"> -->
407 <!-- <item><ref id="getchar" name="getchar"> -->
408 <!-- <item><ref id="gets" name="gets"> -->
409 <!-- <item><ref id="printf" name="printf"> -->
410 <!-- <item><ref id="putc" name="putc"> -->
411 <!-- <item><ref id="putchar" name="putchar"> -->
412 <!-- <item><ref id="puts" name="puts"> -->
413 <item><ref id="rename" name="rename">
414 <item><ref id="remove" name="remove">
415 <!-- <item><ref id="rewind" name="rewind"> -->
416 <!-- <item><ref id="scanf" name="scanf"> -->
417 <!-- <item><ref id="sprintf" name="sprintf"> -->
418 <!-- <item><ref id="sscanf" name="sscanf"> -->
419 <!-- <item><ref id="vfprintf" name="vfprintf"> -->
420 <!-- <item><ref id="vfscanf" name="vfscanf"> -->
421 <!-- <item><ref id="vprintf" name="vprintf"> -->
422 <!-- <item><ref id="vscanf" name="vscanf"> -->
423 <!-- <item><ref id="vsprintf" name="vsprintf"> -->
424 <!-- <item><ref id="vsscanf" name="vsscanf"> -->
430 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
433 <item><ref id="_heapadd" name="_heapadd">
434 <item><ref id="_heapblocksize" name="_heapblocksize">
435 <item><ref id="_heapmaxavail" name="_heapmaxavail">
436 <item><ref id="_heapmemavail" name="_heapmemavail">
437 <item><ref id="_poserror" name="_poserror">
438 <item><ref id="_randomize" name="_randomize">
439 <item><ref id="_swap" name="_swap">
440 <item><ref id="abort" name="abort">
441 <item><ref id="abs" name="abs">
442 <item><ref id="atexit" name="atexit">
443 <item><ref id="atoi" name="atoi">
444 <item><ref id="atol" name="atol">
445 <item><ref id="bsearch" name="bsearch">
446 <item><ref id="calloc" name="calloc">
447 <item><ref id="div" name="div">
448 <item><ref id="exit" name="exit">
449 <item><ref id="free" name="free">
450 <item><ref id="getenv" name="getenv">
451 <item><ref id="itoa" name="itoa">
452 <item><ref id="labs" name="labs">
453 <item><ref id="ltoa" name="ltoa">
454 <item><ref id="malloc" name="malloc">
455 <item><ref id="perror" name="perror">
456 <item><ref id="qsort" name="qsort">
457 <item><ref id="rand" name="rand">
458 <item><ref id="realloc" name="realloc">
459 <item><ref id="srand" name="srand">
460 <item><ref id="ultoa" name="ultoa">
461 <item><ref id="utoa" name="utoa">
465 <sect1><tt/string.h/<label id="string.h"><p>
468 <item><ref id="_stroserror" name="_stroserror">
469 <item><ref id="bzero" name="bzero">
470 <item><ref id="memchr" name="memchr">
471 <item><ref id="memcpy" name="memcpy">
472 <item><ref id="memmove" name="memmove">
473 <item><ref id="memset" name="memset">
474 <item><ref id="strcasecmp" name="strcasecmp">
475 <item><ref id="strcat" name="strcat">
476 <item><ref id="strchr" name="strchr">
477 <item><ref id="strcmp" name="strcmp">
478 <item><ref id="strcoll" name="strcoll">
479 <item><ref id="strcpy" name="strcpy">
480 <item><ref id="strcspn" name="strcspn">
481 <item><ref id="strdup" name="strdup">
482 <item><ref id="strerror" name="strerror">
483 <item><ref id="stricmp" name="stricmp">
484 <item><ref id="strlen" name="strlen">
485 <item><ref id="strlower" name="strlower">
486 <item><ref id="strlwr" name="strlwr">
487 <item><ref id="strncat" name="strncat">
488 <item><ref id="strncmp" name="strncmp">
489 <item><ref id="strncpy" name="strncpy">
490 <item><ref id="strrchr" name="strrchr">
491 <item><ref id="strspn" name="strspn">
492 <item><ref id="strstr" name="strstr">
493 <item><ref id="strtok" name="strtok">
494 <item><ref id="strxfrm" name="strxfrm">
495 <item><ref id="strupper" name="strupper">
496 <item><ref id="strupr" name="strupr">
502 <sect1><tt/tgi.h/<label id="tgi.h"><p>
507 <sect1><tt/time.h/<label id="time.h"><p>
510 <!-- <item><ref id="_systime" name="_systime"> -->
511 <!-- <item><ref id="asctime" name="asctime"> -->
512 <!-- <item><ref id="clock" name="clock"> -->
513 <!-- <item><ref id="ctime" name="ctime"> -->
514 <!-- <item><ref id="gmtime" name="gmtime"> -->
515 <!-- <item><ref id="localtime" name="localtime"> -->
516 <!-- <item><ref id="mktime" name="mktime"> -->
517 <!-- <item><ref id="strftime" name="strftime"> -->
518 <item><ref id="time" name="time">
524 <sect1><tt/unistd.h/<label id="unistd.h"><p>
527 <!-- <item><ref id="chdir" name="chdir"> -->
528 <!-- <item><ref id="getcwd" name="getcwd"> -->
529 <!-- <item><ref id="lseek" name="lseek"> -->
530 <!-- <item><ref id="mkdir" name="mkdir"> -->
531 <!-- <item><ref id="read" name="read"> -->
532 <!-- <item><ref id="rmdir" name="rmdir"> -->
533 <item><ref id="sleep" name="sleep">
534 <item><ref id="unlink" name="unlink">
535 <!-- <item><ref id="write" name="write"> -->
541 <sect1><tt/vic20.h/<label id="vic20.h"><p>
546 <sect1><tt/zlib.h/<label id="zlib.h"><p>
551 <sect>Alphabetical function reference<p>
553 <sect1>_heapadd<label id="_heapadd"><p>
557 <tag/Function/Add a block to the heap.
558 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
559 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
560 <tag/Description/The function adds a block of raw memory to the heap.
563 <item>The minimum blocksize that can be added is 6 bytes; the function will
564 ignore smaller blocks.
566 <tag/Availability/cc65
568 <ref id="_heapblocksize" name="_heapblocksize">,
569 <ref id="_heapmaxavail" name="_heapmaxavail">,
570 <ref id="_heapmemavail" name="_heapmemavail">,
571 <ref id="calloc" name="calloc">,
572 <ref id="free" name="free">,
573 <ref id="malloc" name="malloc">,
574 <ref id="realloc" name="realloc">
580 <sect1>_heapblocksize<label id="_heapblocksize"><p>
584 <tag/Function/Return the size of an allocated block.
585 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
586 <tag/Declaration/<tt/size_t __fastcall__ _heapblocksize (const void* block);/
587 <tag/Description/The function returns the size of a block that must have
588 previously been allocated by <tt/<ref id="malloc" name="malloc">/, <tt/<ref
589 id="calloc" name="calloc">/ or <tt/<ref id="realloc" name="realloc">/.
592 <item>Passing a pointer to a block that was is not the result of one of the
593 allocation functions, or that has been free'd will give unpredicable results.
595 <tag/Availability/cc65
597 <ref id="_heapadd" name="_heapadd">,
598 <ref id="_heapmaxavail" name="_heapmaxavail">,
599 <ref id="_heapmemavail" name="_heapmemavail">,
600 <ref id="calloc" name="calloc">,
601 <ref id="free" name="free">,
602 <ref id="malloc" name="malloc">,
603 <ref id="realloc" name="realloc">
609 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
613 <tag/Function/Return the largest block that is available on the heap.
614 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
615 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
616 <tag/Description/The function returns the size of the largest block that may
617 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
618 <tag/Availability/cc65
620 <ref id="_heapadd" name="_heapadd">,
621 <ref id="_heapblocksize" name="_heapblocksize">,
622 <ref id="_heapmemavail" name="_heapmemavail">,
623 <ref id="calloc" name="calloc">,
624 <ref id="free" name="free">,
625 <ref id="malloc" name="malloc">,
626 <ref id="realloc" name="realloc">
632 <sect1>_heapmemavail<label id="_heapmemavail"><p>
636 <tag/Function/Return the total available space on the heap.
637 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
638 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
639 <tag/Description/The function returns the total number of bytes available on
643 <item>This function is of less use than usually assumed, since the returned
644 heap space may be available but not in one block. So even if this function
645 says that several times more heap space is available than needed, <ref
646 id="malloc" name="malloc"> may still return <tt/NULL/.
648 <tag/Availability/cc65
650 <ref id="_heapadd" name="_heapadd">,
651 <ref id="_heapblocksize" name="_heapblocksize">,
652 <ref id="_heapmaxavail" name="_heapmaxavail">,
653 <ref id="calloc" name="calloc">,
654 <ref id="free" name="free">,
655 <ref id="malloc" name="malloc">,
656 <ref id="realloc" name="realloc">
662 <sect1>_poserror<label id="_poserror"><p>
666 <tag/Function/Print an error message for the error in <tt/_oserrno/.
667 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
668 <tag/Declaration/<tt/void __fastcall__ _poserror (const char* msg);/
669 <tag/Description/<tt/_poserror/ prints an error message to <tt/stderr/. If
670 <tt/msg/ is not <tt/NULL/ and not an empty string, it is printed followed by
671 a colon and a blank. Then the error message for the current contents of
672 <tt/_oserrno/ are printed followed by a newline. The message output is the
673 same as returned by <tt/<ref id="_stroserror" name="_stroserror">/ with an
674 argument of <tt/_oserrno/.
677 <item>Since operating system specific error code are - you guessed it -
678 operating system specific, the value in <tt/_oserror/ and the message that is
679 printed depend on the cc65 target.
680 <item>The function is only available as fastcall function, so it may only
681 be used in presence of a prototype.
683 <tag/Availability/cc65
685 <ref id="_stroserror" name="_stroserror">,
686 <ref id="perror" name="perror">
692 <sect1>_randomize<label id="_randomize"><p>
696 <tag/Function/Initialize the pseudo random number generator.
697 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
698 <tag/Declaration/<tt/void _randomize (void);/
699 <tag/Description/The function initializes the random number generator with
700 a seed derived from fast changing hardware events, so the seed itself can be
701 considered random to a certain degree.
702 <tag/Limits/<itemize>
703 <item>The randomness of the seed depends on the machine hardware.
705 <tag/Availability/cc65
707 <ref id="rand" name="rand">,
708 <ref id="srand" name="srand">
714 <sect1>_stroserror<label id="_stroserror"><p>
718 <tag/Function/Return a string describing an OS specific error code.
719 <tag/Header/<tt/<ref id="string.h" name="string.h">/
720 <tag/Declaration/<tt/const char* __fastcall__ _stroserror (unsigned char errcode);/
721 <tag/Description/<tt/_stroserror/ will return a string describing the given
722 operating system specific error code.
723 <tag/Limits/<itemize>
724 <item>Since operating system specific error code are - you guessed it -
725 operating system specific, the parameter and the string returned depend on the
727 <item>The function is only available as fastcall function, so it may only be
728 used in presence of a prototype.
730 <tag/Availability/cc65
732 <ref id="strerror" name="strerror">
738 <sect1>_swap<label id="_swap"><p>
742 <tag/Function/Swap the contents of memory areas.
743 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
744 <tag/Declaration/<tt/void __fastcall__ _swap (void* p, void* q, size_t size);/
745 <tag/Description/<tt/_swap/ will swap (exchange) the contents of the two memory
746 areas pointed to by <tt/p/ and <tt/q/. Both memory areas are assumed to be
747 <tt/size/ bytes in size.
748 <tag/Limits/<itemize>
749 <item>The memory areas may not overlap, otherwise the results are undefined.
750 <item>The function is only available as fastcall function, so it may only be
751 used in presence of a prototype.
753 <tag/Availability/cc65
755 <ref id="memcpy" name="memcpy">,
756 <ref id="memmove" name="memmove">
762 <sect1>_sys<label id="_sys"><p>
766 <tag/Function/Call a subroutine passing register values.
767 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
768 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
769 <tag/Description/The function will call the subroutine at the address
770 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
771 registers and the CPU flags are set to the values given in the <tt/regs/
772 structure. On return from the subroutine, the new values of the registers and
773 flags are stored back overwriting the old values.
774 <tag/Limits/<itemize>
775 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
776 when calling the subroutine (they are unchanged from their current values).
777 <item>The function is only available as fastcall function, so it may only be
778 used in presence of a prototype.
780 <tag/Availability/cc65
786 <sect1>BRK<label id="BRK"><p>
790 <tag/Function/Insert a 6502 BRK instrunction into the code.
791 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
792 <tag/Declaration/<tt/void BRK (void);/
793 <tag/Description/The function will insert a 6502 BRK instruction into the code
794 which may be used to trigger a debugger.
795 <tag/Limits/<itemize>
796 <item>The function is actually a macro.
797 <item>The inserted instruction may lead to unexpected results if no debugger
800 <tag/Availability/cc65
802 <ref id="CLI" name="CLI">,
803 <ref id="SEI" name="SEI">
809 <sect1>CLI<label id="CLI"><p>
813 <tag/Function/Insert a 6502 CLI instrunction into the code.
814 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
815 <tag/Declaration/<tt/void CLI (void);/
816 <tag/Description/The function will insert a 6502 CLI instruction into the code,
817 so interrupts are enabled. Enabling interrupts has no effects if they are
818 already enabled (the default).
819 <tag/Limits/<itemize>
820 <item>The function is actually a macro.
821 <item>Disabling interrupts may lead to unexpected results.
823 <tag/Availability/cc65
825 <ref id="BRK" name="BRK">,
826 <ref id="SEI" name="SEI">
832 <sect1>PEEK<label id="PEEK"><p>
836 <tag/Function/Read a byte from memory.
837 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
838 <tag/Declaration/<tt/unsigned char PEEK (unsigned addr);/
839 <tag/Description/The function will read the absolute memory given by <tt/addr/
840 and return the value read.
841 <tag/Limits/<itemize>
842 <item>The function is actually a macro.
843 <item>This function depends highly on the platform and environment.
845 <tag/Availability/cc65
847 <ref id="PEEKW" name="PEEKW">,
848 <ref id="POKE" name="POKE">
854 <sect1>PEEKW<label id="PEEKW"><p>
858 <tag/Function/Read a word (two bytes) from memory.
859 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
860 <tag/Declaration/<tt/unsigned PEEKW (unsigned addr);/
861 <tag/Description/The function will read the absolute memory given by <tt/addr/
862 and return the value read. The byte read from the higher address is the high
863 byte of the return value.
864 <tag/Limits/<itemize>
865 <item>The function is actually a macro.
866 <item>This function depends highly on the platform and environment.
867 <item>The order in which the two bytes are read is unspecified and may
868 depend of the address expression used.
870 <tag/Availability/cc65
872 <ref id="PEEK" name="PEEK">,
873 <ref id="POKE" name="POKE">
879 <sect1>POKE<label id="POKE"><p>
883 <tag/Function/Write a byte to memory.
884 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
885 <tag/Declaration/<tt/void POKE (unsigned addr, unsigned char val);/
886 <tag/Description/The function writes the value <tt/val/ to the absolute
887 memory address given by <tt/addr/.
888 <tag/Limits/<itemize>
889 <item>The function is actually a macro.
890 <item>This function depends highly on the platform and environment.
891 <item>Careless use will cause the program to act strange or may crash the
894 <tag/Availability/cc65
896 <ref id="PEEK" name="PEEK">,
897 <ref id="POKEW" name="POKEW">
903 <sect1>POKEW<label id="POKEW"><p>
907 <tag/Function/Write a word (two bytes) to memory.
908 <tag/Header/<tt/<ref id="peekpoke.h" name="peekpoke.h">/
909 <tag/Declaration/<tt/void POKEW (unsigned addr, unsigned val);/
910 <tag/Description/The function writes the value <tt/val/ to the absolute
911 memory address given by <tt/addr/. The low byte of <tt/val/ is written to
912 the <tt/addr/, the high byte is written to <tt/addr+1/.
913 <tag/Limits/<itemize>
914 <item>The function is actually a macro.
915 <item>This function depends highly on the platform and environment.
916 <item>Careless use will cause the program to act strange or may crash the
918 <item>The order in which the two bytes are written is unspecified and may
919 depend of the address expression used.
921 <tag/Availability/cc65
923 <ref id="PEEK" name="PEEK">,
924 <ref id="POKE" name="POKE">
930 <sect1>SEI<label id="SEI"><p>
934 <tag/Function/Insert a 6502 SEI instrunction into the code.
935 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
936 <tag/Declaration/<tt/void SEI (void);/
937 <tag/Description/The function will insert a 6502 SEI instruction into the code,
938 so interrupts are disabled. Note that non maskable interrupts cannot be
940 <tag/Limits/<itemize>
941 <item>The function is actually a macro.
942 <item>Disabling interrupts may lead to unexpected results.
944 <tag/Availability/cc65
946 <ref id="BRK" name="BRK">,
947 <ref id="CLI" name="CLI">
953 <sect1>abort<label id="abort"><p>
957 <tag/Function/Terminates a program abnormally.
958 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
959 <tag/Declaration/<tt/void abort (void);/
960 <tag/Description/<tt/abort/ raises <tt/SIGABRT/, writes a termination message
961 on stderr, then terminates the program with an exit code of 3.
962 <tag/Availability/ISO 9899
964 <ref id="assert" name="assert">,
965 <ref id="exit" name="exit">,
966 <ref id="raise" name="raise">
972 <sect1>abs<label id="abs"><p>
976 <tag/Function/Returns the absolute value of an integer.
977 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
978 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
979 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
981 <tag/Limits/<itemize>
982 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
983 <item>The function is only available as fastcall function, so it may only be
984 used in presence of a prototype.
986 <tag/Availability/ISO 9899
988 <ref id="labs" name="labs">
994 <sect1>assert<label id="assert"><p>
998 <tag/Function/Test a condition and possibly abort.
999 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
1000 <tag/Declaration/<tt/void assert (int cond);/
1001 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
1002 statement. If the condition evaluates t zero (false), assert prints a message
1003 on stderr and aborts the program.
1004 <tag/Limits/<itemize>
1005 <item>The function is actually a macro.
1007 <tag/Availability/ISO 9899
1009 <ref id="abort" name="abort">,
1010 <ref id="exit" name="exit">
1016 <sect1>atexit<label id="atexit"><p>
1020 <tag/Function/Register an exit function.
1021 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1022 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
1023 <tag/Description/<tt/atexit/ registers the function pointed to by
1024 <tt/exitfunc/ as an exit function. Exit functions are called when the program
1025 terminates, they are called in LIFO order (the last function registered is
1026 called first). <tt/atexit/ returns zero on success and a nonzero value on
1028 <tag/Limits/<itemize>
1029 <item>A maximum of 5 exit functions can be registered.
1030 <item>There is no way to unregister an exit function.
1031 <item>The function is only available as fastcall function, so it may only be
1032 used in presence of a prototype.
1034 <tag/Availability/ISO 9899
1036 <ref id="abort" name="abort">,
1037 <ref id="exit" name="exit">
1043 <sect1>atoi<label id="atoi"><p>
1047 <tag/Function/Convert a string to an integer.
1048 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1049 <tag/Declaration/<tt/int __fastcall__ atoi (const char* s);/
1050 <tag/Description/<tt/atoi/ converts the given string into an integer.
1051 Conversion stops as soon as any invalid character is encountered.
1052 <tag/Limits/<itemize>
1053 <item>There is no way to detect any conversion errors.
1054 <item>The function does not check for an numerical overflow when converting.
1055 <item>The function is only available as fastcall function, so it may only be
1056 used in presence of a prototype.
1058 <tag/Availability/ISO 9899
1060 <ref id="atol" name="atol">,
1061 <ref id="itoa" name="itoa">,
1062 <ref id="ltoa" name="ltoa">,
1063 <ref id="ultoa" name="ultoa">,
1064 <ref id="utoa" name="utoa">
1070 <sect1>atol<label id="atol"><p>
1074 <tag/Function/Convert a string to a long integer.
1075 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1076 <tag/Declaration/<tt/long __fastcall__ atol (const char* s);/
1077 <tag/Description/<tt/atol/ converts the given string into a long integer.
1078 Conversion stops as soon as any invalid character is encountered.
1079 <tag/Limits/<itemize>
1080 <item>There is no way to detect any conversion errors.
1081 <item>The function does not check for an numerical overflow when converting.
1082 <item>The function is only available as fastcall function, so it may only be
1083 used in presence of a prototype.
1085 <tag/Availability/ISO 9899
1087 <ref id="atoi" name="atoi">,
1088 <ref id="itoa" name="itoa">,
1089 <ref id="ltoa" name="ltoa">,
1090 <ref id="ultoa" name="ultoa">,
1091 <ref id="utoa" name="utoa">
1097 <sect1>bgcolor<label id="bgcolor"><p>
1101 <tag/Function/Set the background text color.
1102 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1103 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
1104 <tag/Description/The function will set a new background color and return the
1105 old (current) one. The background color is valid for the whole text output
1106 area of the screen, not just for new text.
1107 <tag/Limits/<itemize>
1108 <item>Background colors are system dependent. The function may have no effect
1109 on systems where the background color cannot be changed.
1110 <item>The function is only available as fastcall function, so it may only be
1111 used in presence of a prototype.
1113 <tag/Availability/cc65
1115 <ref id="bordercolor" name="bordercolor">,
1116 <ref id="textcolor" name="textcolor">
1122 <sect1>bordercolor<label id="bordercolor"><p>
1126 <tag/Function/Set the border (frame) color.
1127 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1128 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
1129 <tag/Description/The function will set a new border color. It returns the old
1130 (current) border color.
1131 <tag/Limits/<itemize>
1132 <item>Border colors are system dependent. The function may have no effect
1133 on systems where the border color cannot be changed.
1134 <item>The function is only available as fastcall function, so it may only
1135 be used in presence of a prototype.
1137 <tag/Availability/cc65
1139 <ref id="bgcolor" name="bgcolor">,
1140 <ref id="textcolor" name="textcolor">
1146 <sect1>bsearch<label id="bsearch"><p>
1150 <tag/Function/Do a binary search in a sorted array.
1151 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1152 <tag/Declaration/<tt/void* __fastcall__ bsearch (const void* key,
1153 const void* base, size_t n, size_t size,
1154 int (*cmp) (const void*, const void*));/
1155 <tag/Description/<tt/bsearch/ searches a sorted array for a member that
1156 matches the one pointed to by <tt/key/. <tt/base/ is the address of the array,
1157 <tt/n/ is the number of elements, <tt/size/ the size of an element and <tt/cmp/
1158 the function used to compare the members against the key. The function returns
1159 a pointer to the member found, or <tt/NULL/ if there was no match.
1162 <item>The contents of the array must be sorted in ascending order according to
1163 the compare function given.
1164 <item>If there are multiple members that match the key, the function will
1165 return one of the members.
1166 <item>The function is only available as fastcall function, so it may only
1167 be used in presence of a prototype.
1169 <tag/Availability/ISO 9899
1171 <ref id="qsort" name="qsort">
1177 <sect1>bzero<label id="bzero"><p>
1181 <tag/Function/Fill a memory area with zeroes.
1182 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1183 <tag/Declaration/<tt/void __fastcall__ bzero (void* p, size_t count);/
1184 <tag/Description/<tt/bzero/ fills the memory area pointed to by <tt/p/ with
1188 <item>The function is non standard and therefore only available in non ANSI
1189 mode. You should use <tt/<ref id="memset" name="memset">/ instead.
1190 <item>The function is only available as fastcall function, so it may only
1191 be used in presence of a prototype.
1193 <tag/Availability/cc65
1195 <ref id="_swap" name="_swap">,
1196 <ref id="memcpy" name="memcpy">,
1197 <ref id="memmove" name="memmove">,
1198 <ref id="memset" name="memset">,
1204 <sect1>c64mode<label id="c64mode"><p>
1208 <tag/Function/Switch the C128 into C64 compatible mode.
1209 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1210 <tag/Declaration/<tt/void c64mode (void);/
1211 <tag/Description/The function will cause the machine to reboot into C64 mode.
1212 <tag/Limits/<itemize>
1213 <item>The function is specific to the C128.
1214 <item>The function will not return to the caller.
1216 <tag/Availability/C128
1222 <sect1>calloc<label id="calloc"><p>
1226 <tag/Function/Allocate and clear memory.
1227 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1228 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
1229 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
1230 of size <tt/size/, clears the whole block with binary zeroes and returns a
1231 pointer to it. On error (not enough memory available), <tt/calloc/ returns
1235 <item>Clearing the memory may not have the expected effect on all platforms:
1236 pointers in the block may not be <tt/NULL/ and floating point variables may
1237 not be zero (0.0). In other words: The "clearing" effect of this function
1238 should be used with care for portable programs.
1239 <item>The function is only available as fastcall function, so it may only
1240 be used in presence of a prototype.
1242 <tag/Availability/ISO 9899
1244 <ref id="_heapadd" name="_heapadd">,
1245 <ref id="_heapblocksize" name="_heapblocksize">,
1246 <ref id="_heapmaxavail" name="_heapmaxavail">,
1247 <ref id="_heapmemavail" name="_heapmemavail">,
1248 <ref id="free" name="free">,
1249 <ref id="malloc" name="malloc">,
1250 <ref id="realloc" name="realloc">
1256 <sect1>cclear<label id="cclear"><p>
1260 <tag/Function/Clear part of a line (write a given number of spaces).
1261 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1262 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
1263 <tag/Description/The function clears part of a line by writing <tt/length/
1264 spaces in the current text color.
1265 <tag/Limits/<itemize>
1266 <item>The function is only available as fastcall function, so it may
1267 only be used in presence of a prototype.
1269 <tag/Availability/cc65
1271 <ref id="cclearxy" name="cclearxy">,
1272 <ref id="clrscr" name="clrscr">
1278 <sect1>cclearxy<label id="cclearxy"><p>
1282 <tag/Function/Clear part of a line (write a given number of spaces) starting
1283 at a specific screen position.
1284 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1285 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char x, unsigned char y, unsigned char length);/
1286 <tag/Description/The function moves the cursor to a specific position, and
1287 will then clear part of the line by writing <tt/length/ spaces in the current
1289 <tag/Limits/<itemize>
1290 <item>The function is only available as fastcall function, so it may
1291 only be used in presence of a prototype.
1293 <tag/Availability/cc65
1295 <ref id="cclear" name="cclear">,
1296 <ref id="clrscr" name="clrscr">
1302 <sect1>cgetc<label id="cgetc"><p>
1306 <tag/Function/Read a character from the keyboard.
1307 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1308 <tag/Declaration/<tt/char cgetc (void);/
1309 <tag/Description/The function reads a character from the keyboard. If there is
1310 no character available, <tt/cgetc/ waits until the user presses a key. If the
1311 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
1312 displayed while waiting.
1313 <tag/Limits/<itemize>
1314 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
1315 from this buffer and wait only if the buffer is empty.
1317 <tag/Availability/cc65
1319 <ref id="cursor" name="cursor">,
1320 <ref id="kbhit" name="kbhit">
1326 <sect1>chline<label id="chline"><p>
1330 <tag/Function/Output a horizontal line in text mode.
1331 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1332 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
1333 <tag/Description/The function outputs a horizontal line with the given length
1334 starting at the current cursor position.
1335 <tag/Limits/<itemize>
1336 <item>The character used to draw the horizontal line is system dependent.
1337 If available, a line drawing character is used. Drawing a line that is partially
1338 off screen leads to undefined behaviour.
1339 <item>The function is only available as fastcall function, so it may only be
1340 used in presence of a prototype.
1342 <tag/Availability/cc65
1344 <ref id="chlinexy" name="chlinexy">,
1345 <ref id="cvline" name="cvline">,
1346 <ref id="cvlinexy" name="cvlinexy">
1352 <sect1>chlinexy<label id="chlinexy"><p>
1356 <tag/Function/Output a horizontal line at a given position in text mode.
1357 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1358 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
1359 <tag/Description/The function outputs a horizontal line with the given length
1360 starting at a given position.
1361 <tag/Limits/<itemize>
1362 <item>The character used to draw the horizontal line is system dependent.
1363 If available, a line drawing character is used. Drawing a line that is partially
1364 off screen leads to undefined behaviour.
1365 <item>The function is only available as fastcall function, so it may only be
1366 used in presence of a prototype.
1368 <tag/Availability/cc65
1370 <ref id="chline" name="chline">,
1371 <ref id="cvline" name="cvline">,
1372 <ref id="cvlinexy" name="cvlinexy">
1378 <sect1>clearerr<label id="clearerr"><p>
1382 <tag/Function/Clear error and end-of-file status of a stream.
1383 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
1384 <tag/Declaration/<tt/void __fastcall__ clearerr (FILE* f);/
1385 <tag/Description/<tt/clearerr/ clears the error and end-of-file status
1386 indicators for the stream <tt/f/.
1387 <tag/Limits/<itemize>
1388 <item>The function is only available as fastcall function, so it may only be
1389 used in presence of a prototype.
1391 <tag/Availability/ISO 9899
1393 <ref id="feof" name="feof">,
1394 <ref id="ferror" name="ferror">
1400 <sect1>clrscr<label id="clrscr"><p>
1404 <tag/Function/Clear the text screen.
1405 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1406 <tag/Declaration/<tt/void clrscr (void);/
1407 <tag/Description/The function clears the text screen and moves the cursor to
1408 the upper left corner.
1409 <tag/Availability/cc65
1411 <ref id="cclear" name="cclear">,
1412 <ref id="cclearxy" name="cclearxy">
1418 <sect1>close<label id="close"><p>
1422 <tag/Function/Close a file descriptor.
1423 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1424 <tag/Declaration/<tt/int __fastcall__ close (int fd);/
1425 <tag/Description/The function closes the given file descriptor. It returns zero
1426 on success and -1 on error. If an error occurs, the cause can be determined by
1427 reading the <tt/errno/ variable.
1428 <tag/Limits/<itemize>
1429 <item>The function is only available as fastcall function, so it may only
1430 be used in presence of a prototype.
1432 <tag/Availability/POSIX 1003.1
1434 <ref id="creat" name="creat">,
1435 <ref id="open" name="open">
1441 <sect1>creat<label id="creat"><p>
1445 <tag/Function/Create a file.
1446 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
1447 <tag/Declaration/<tt/int __fastcall__ creat (const char* name, unsigned mode);/
1448 <tag/Description/<tt/creat/ creates a new file and returns the file descriptor
1449 associated with it. On error, -1 is returned and an error code is stored in
1451 <tag/Limits/<itemize>
1452 <item><tt/creat/ is identical to calling <tt/<ref id="open" name="open">/ with
1453 <tt/flags/ equal to <tt/O_WRONLY | O_CREAT | O_TRUNC/.
1454 <item>The function is only available as fastcall function, so it may only
1455 be used in presence of a prototype.
1457 <tag/Availability/POSIX 1003.1
1459 <ref id="close" name="close">,
1460 <ref id="open" name="open">
1466 <sect1>cprintf<label id="cprintf"><p>
1470 <tag/Function/Formatted output to the console.
1471 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1472 <tag/Declaration/<tt/int cprintf (const char* format, ...);/
1473 <tag/Description/The arguments are converted to text where necessary and
1474 formatted according to the format string given. The resulting string is output
1475 to the console. <tt/cprintf/ supports the same format specifiers as
1476 <tt/printf/. <!-- <tt/<ref id="printf" name="printf">/. -->
1477 <tag/Limits/<itemize>
1478 <item>Like all other <tt/conio/ output functions, <tt/cprintf/ distinguishes
1479 between <tt/\r/ and <tt/\n/.
1481 <tag/Availability/cc65
1483 <ref id="cputc" name="cputc">,
1484 <ref id="cputcxy" name="cputcxy">,
1485 <ref id="cputs" name="cputs">,
1486 <ref id="cputsxy" name="cputsxy">,
1487 <ref id="vcprintf" name="vcprintf">
1493 <sect1>cputc<label id="cputc"><p>
1497 <tag/Function/Output a character directly to the console.
1498 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1499 <tag/Declaration/<tt/void __fastcall__ cputc (char c);/
1500 <tag/Description/Output one character to the console at the current cursor
1502 <tag/Limits/<itemize>
1503 <item>Like all other <tt/conio/ output functions, <tt/cputc/ distinguishes
1504 between <tt/\r/ and <tt/\n/.
1505 <item>The function is only available as fastcall function, so it may only
1506 be used in presence of a prototype.
1508 <tag/Availability/cc65
1510 <ref id="cprintf" name="cprintf">,
1511 <ref id="cputcxy" name="cputcxy">,
1512 <ref id="cputs" name="cputs">,
1513 <ref id="cputsxy" name="cputsxy">,
1514 <ref id="vcprintf" name="vcprintf">
1520 <sect1>cputcxy<label id="cputcxy"><p>
1524 <tag/Function/Output a character at a specific screen position.
1525 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1526 <tag/Declaration/<tt/void __fastcall__ cputcxy (unsigned char x, unsigned char y, char c);/
1527 <tag/Description/<tt/cputcxy/ moves the cursor to the given x/y position on
1528 the screen and outputs one character.
1529 <tag/Limits/<itemize>
1530 <item>Like all other <tt/conio/ output functions, <tt/cputcxy/ distinguishes
1531 between <tt/\r/ and <tt/\n/.
1532 <item>The function is only available as fastcall function, so it may only
1533 be used in presence of a prototype.
1535 <tag/Availability/cc65
1537 <ref id="cprintf" name="cprintf">,
1538 <ref id="cputc" name="cputc">,
1539 <ref id="cputs" name="cputs">,
1540 <ref id="cputsxy" name="cputsxy">,
1541 <ref id="vcprintf" name="vcprintf">
1547 <sect1>cputs<label id="cputs"><p>
1551 <tag/Function/Output a string directly to the console.
1552 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1553 <tag/Declaration/<tt/void __fastcall__ cputs (const char* s);/
1554 <tag/Description/The function outputs the given string on the console at the
1555 current cursor position.
1556 <tag/Limits/<itemize>
1557 <item>Like all other <tt/conio/ output functions, <tt/cputs/ distinguishes
1558 between <tt/\r/ and <tt/\n/.
1559 <item>The function is only available as fastcall function, so it may only
1560 be used in presence of a prototype.
1562 <tag/Availability/cc65
1564 <ref id="cprintf" name="cprintf">,
1565 <ref id="cputc" name="cputc">,
1566 <ref id="cputcxy" name="cputcxy">,
1567 <ref id="cputsxy" name="cputsxy">,
1568 <ref id="vcprintf" name="vcprintf">
1574 <sect1>cputsxy<label id="cputsxy"><p>
1578 <tag/Function/Output a string to the console at a given position.
1579 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1580 <tag/Declaration/<tt/void __fastcall__ cputsxy (unsigned char x, unsigned char y, const char* s);/
1581 <tag/Description/<tt/cputsxy/ moves the cursor to the given x/y position,
1582 and outputs the string <tt/s/.
1583 <tag/Limits/<itemize>
1584 <item>Like all other <tt/conio/ output functions, <tt/cputsxy/ distinguishes
1585 between <tt/\r/ and <tt/\n/.
1586 <item>The function is only available as fastcall function, so it may only
1587 be used in presence of a prototype.
1589 <tag/Availability/cc65
1591 <ref id="cprintf" name="cprintf">,
1592 <ref id="cputc" name="cputc">,
1593 <ref id="cputcxy" name="cputcxy">,
1594 <ref id="cputs" name="cputs">,
1595 <ref id="vcprintf" name="vcprintf">
1601 <sect1>cursor<label id="cursor"><p>
1605 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
1606 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1607 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
1608 <tag/Description/If the argument to the function is non zero, a blinking cursor
1609 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
1610 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
1611 <tag/Limits/<itemize>
1612 <item>The function is only available as fastcall function, so it may only
1613 be used in presence of a prototype.
1615 <tag/Availability/cc65
1617 <ref id="cgetc" name="cgetc">,
1618 <ref id="kbhit" name="kbhit">
1624 <sect1>cvline<label id="cvline"><p>
1628 <tag/Function/Output a vertical line in text mode.
1629 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1630 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
1631 <tag/Description/The function outputs a vertical line with the given length
1632 starting at the current cursor position.
1633 <tag/Limits/<itemize>
1634 <item>The character used to draw the vertical line is system dependent.
1635 If available, a line drawing character is used. Drawing a line that is partially
1636 off screen leads to undefined behaviour.
1637 <item>The function is only available as fastcall function, so it may only be
1638 used in presence of a prototype.
1640 <tag/Availability/cc65
1642 <ref id="chline" name="chline">,
1643 <ref id="chlinexy" name="chlinexy">,
1644 <ref id="cvlinexy" name="cvlinexy">
1650 <sect1>cvlinexy<label id="cvlinexy"><p>
1654 <tag/Function/Output a vertical line at a given position in text mode.
1655 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1656 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
1657 <tag/Description/The function outputs a vertical line with the given length
1658 starting at a given position.
1659 <tag/Limits/<itemize>
1660 <item>The character used to draw the vertical line is system dependent.
1661 If available, a line drawing character is used. Drawing a line that is partially
1662 off screen leads to undefined behaviour.
1663 <item>The function is only available as fastcall function, so it may only be
1664 used in presence of a prototype.
1666 <tag/Availability/cc65
1668 <ref id="chline" name="chline">,
1669 <ref id="chlinexy" name="chlinexy">,
1670 <ref id="cvline" name="cvline">
1676 <sect1>div<label id="div"><p>
1680 <tag/Function/Divide two ints and return quotient and remainder.
1681 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1682 <tag/Declaration/<tt/div_t __fastcall__ div (int numer, int denom);/
1683 <tag/Description/<tt/div/ divides <tt/numer/ by <tt/denom/ and returns the
1684 quotient and remainder in a <tt/div_t/ structure.
1687 <item>The function is only available as fastcall function, so it may only
1688 be used in presence of a prototype.
1690 <tag/Availability/ISO 9899
1698 <sect1>em_commit<label id="em_commit"><p>
1702 <tag/Function/Commit changes into extended memory.
1703 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1704 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
1705 <tag/Description/Commit changes in the memory window to extended storage. If
1706 the contents of the memory window have been changed, these changes may be lost
1707 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
1708 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
1709 name="em_copyto">/ are called without calling <tt/em_commit/ first.
1710 <tag/Limits/<itemize>
1711 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
1712 memory window are discarded, it does just mean that the drivers is allowed
1714 <item>The function is only available as fastcall function, so it may only be
1715 used in presence of a prototype.
1716 <item>The function produces undefined results if no extended memory driver is
1719 <tag/Availability/cc65
1721 <ref id="em_load_driver" name="em_load_driver">,
1722 <ref id="em_map" name="em_map">,
1723 <ref id="em_use" name="em_use">
1729 <sect1>em_copyfrom<label id="em_copyfrom"><p>
1733 <tag/Function/Copy from extended into normal memory.
1734 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1735 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
1736 <tag/Description/Copy data from extended memory into linear memory. Source and
1737 target addresses as well as the number of bytes to transfer are specified in
1738 the <tt/em_copy/ structure that is passed as a parameter.
1739 <tag/Limits/<itemize>
1740 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
1741 made any changes to the data in the window, call <tt/<ref id="em_commit"
1742 name="em_commit">/ first, or the changes are lost.
1743 <item>The function is only available as fastcall function, so it may only be
1744 used in presence of a prototype.
1745 <item>The function produces undefined results if no extended memory driver is
1748 <tag/Availability/cc65
1750 <ref id="em_commit" name="em_commit">,
1751 <ref id="em_copyto" name="em_copyto">,
1752 <ref id="em_load_driver" name="em_load_driver">
1758 <sect1>em_copyto<label id="em_copyto"><p>
1762 <tag/Function/Copy from normal into extended memory.
1763 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1764 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
1765 <tag/Description/Copy data from linear into extended memory. Source and
1766 target addresses as well as the number of bytes to transfer are specified in
1767 the <tt/em_copy/ structure that is passed as a parameter.
1768 <tag/Limits/<itemize>
1769 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
1770 made any changes to the data in the window, call <tt/<ref id="em_commit"
1771 name="em_commit">/ first, or the changes are lost.
1772 <item>The function is only available as fastcall function, so it may only be
1773 used in presence of a prototype.
1774 <item>The function produces undefined results if no extended memory driver is
1777 <tag/Availability/cc65
1779 <ref id="em_commit" name="em_commit">,
1780 <ref id="em_copyfrom" name="em_copyfrom">,
1781 <ref id="em_load_driver" name="em_load_driver">
1787 <sect1>em_install<label id="em_install"><p>
1791 <tag/Function/Install an already loaded extended memory driver.
1792 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1793 <tag/Declaration/<tt/unsigned char _fastcall__ em_install (void* driver);/
1794 <tag/Description/The function installs an already loaded extended memory driver
1795 and returns an error code. The function may be used to install a driver linked
1796 statically to the program.
1797 <tag/Limits/<itemize>
1798 <item>Not all drivers are able to detect if the supported hardware is really
1800 <item>The function is only available as fastcall function, so it may only be
1801 used in presence of a prototype.
1803 <tag/Availability/cc65
1805 <ref id="em_load_driver" name="em_load_driver">,
1806 <ref id="em_uninstall" name="em_uninstall">,
1807 <ref id="em_unload" name="em_unload">
1813 <sect1>em_load_driver<label id="em_load_driver"><p>
1817 <tag/Function/Load and initialize an extended memory driver.
1818 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1819 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
1820 <tag/Description/Load an extended memory driver into memory and initialize
1821 it. The function returns an error code that tells if all this has been
1823 <tag/Limits/<itemize>
1824 <item>Not all drivers are able to detect if the supported hardware is really
1826 <item>The function is only available as fastcall function, so it may only be
1827 used in presence of a prototype.
1828 <item>The driver is loaded by name, so currently you must know the type of
1829 extended memory that should be supported. There is no autodetect capability.
1831 <tag/Availability/cc65
1833 <ref id="em_unload" name="em_unload">
1839 <sect1>em_map<label id="em_map"><p>
1843 <tag/Function/Make a page of extended memory accessible.
1844 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1845 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
1846 <tag/Description/The function maps one page of extended memory into linear
1847 memory and returns a pointer to the page frame. Depending on the hardware
1848 and driver, the data is either mapped into the address space or transfered
1849 into a buffer. If you don't need the actual contents of the page (for example
1850 because you're going to overwrite it completely, it is better to call
1851 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
1852 data if it is possible to avoid that.
1853 <tag/Limits/<itemize>
1854 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
1855 made any changes to the data in the window, call <tt/<ref id="em_commit"
1856 name="em_commit">/ first, or the changes are lost.
1857 <item>The function is only available as fastcall function, so it may only be
1858 used in presence of a prototype.
1859 <item>The function produces undefined results if no extended memory driver is
1862 <tag/Availability/cc65
1864 <ref id="em_commit" name="em_commit">,
1865 <ref id="em_load_driver" name="em_load_driver">,
1866 <ref id="em_use" name="em_use">
1872 <sect1>em_pagecount<label id="em_pagecount"><p>
1876 <tag/Function/Return the number of available extended memory pages.
1877 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1878 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
1879 <tag/Description/The function returns the size of the extended memory supported
1880 by the driver in 256 byte pages.
1881 <tag/Limits/<itemize>
1882 <item>The function returns zero if no extended memory driver is loaded.
1883 <item>The function may return zero if the supported hardware was not detected.
1885 <tag/Availability/cc65
1887 <ref id="em_load_driver" name="em_load_driver">
1893 <sect1>em_uninstall<label id="em_uninstall"><p>
1897 <tag/Function/Uninstall an already loaded extended memory driver.
1898 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1899 <tag/Declaration/<tt/unsigned char __fastcall__ em_install (void);/
1900 <tag/Description/The function uninstalls an already loaded extended memory
1901 driver but doesn't remove it from memory.
1902 <tag/Limits/<itemize>
1903 <item>If the driver has been loaded using <tt/<ref id="em_load_driver"
1904 name="em_load_driver">/, <tt/<ref id="em_unload" name="em_unload">/
1905 should be used instead of <tt/em_uninstall/ so the driver is also removed
1907 <item>The function is only available as fastcall function, so it may only be
1908 used in presence of a prototype.
1910 <tag/Availability/cc65
1912 <ref id="em_install" name="em_install">,
1913 <ref id="em_load_driver" name="em_load_driver">,
1914 <ref id="em_unload" name="em_unload">
1920 <sect1>em_unload<label id="em_unload"><p>
1924 <tag/Function/Unload an extended memory driver.
1925 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1926 <tag/Declaration/<tt/unsigned char __fastcall__ em_unload (void);/
1927 <tag/Description/The function unloads a loaded extended memory driver and
1928 frees all memory allocated for the driver.
1929 <tag/Limits/<itemize>
1930 <item>The function does nothing if no driver is loaded.
1932 <tag/Availability/cc65
1934 <ref id="em_load_driver" name="em_load_driver">
1940 <sect1>em_use<label id="em_use"><p>
1944 <tag/Function/Prepare an extended memory page for use.
1945 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1946 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1947 <tag/Description/The function maps one page of extended memory into linear
1948 memory and returns a pointer to the page frame. This function is similar to
1949 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1950 actual memory window in the assumption that the existing data is wrong or
1951 will get overwritten.
1952 <tag/Limits/<itemize>
1953 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1954 made any changes to the data in the window, call <tt/<ref id="em_commit"
1955 name="em_commit">/ first, or the changes are lost.
1956 <item>The function is only available as fastcall function, so it may only be
1957 used in presence of a prototype.
1958 <item>The function produces undefined results if no extended memory driver is
1961 <tag/Availability/cc65
1963 <ref id="em_commit" name="em_commit">,
1964 <ref id="em_load_driver" name="em_load_driver">,
1965 <ref id="em_map" name="em_map">
1971 <sect1>exit<label id="exit"><p>
1975 <tag/Function/Terminate the program.
1976 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1977 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1978 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1979 return code of the program. Before termination, all files are closed, buffered
1980 output is written and any functions registered with <tt/<ref id="atexit"
1981 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1982 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1984 <tag/Limits/<itemize>
1985 <item>The function is only available as fastcall function, so it may only
1986 be used in presence of a prototype.
1987 <item>It depends on the host machine if the program return code can be
1988 evaluated or is ignored.
1990 <tag/Availability/ISO 9899
1992 <ref id="abort" name="abort">,
1993 <ref id="exit" name="exit">
1999 <sect1>fast<label id="fast"><p>
2003 <tag/Function/Switch the C128 into 2MHz mode.
2004 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2005 <tag/Declaration/<tt/void fast (void);/
2006 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
2007 will nearly double the speed compared to slow mode.
2008 <tag/Limits/<itemize>
2009 <item>The function is specific to the C128.
2010 <item>2MHz clock will not work in 40 column mode.
2012 <tag/Availability/C128
2014 <ref id="slow" name="slow">,
2015 <ref id="toggle_videomode" name="toggle_videomode">,
2016 <ref id="videomode" name="videomode">
2022 <sect1>feof<label id="feof"><p>
2026 <tag/Function/Return the end-of-file indicator of a stream.
2027 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2028 <tag/Declaration/<tt/int __fastcall__ feof (FILE* f);/
2029 <tag/Description/<tt/feof/ tests the end-of-file indicator ofthe stream
2030 <tt/f/, and returns a non zero value if it is set.
2031 <tag/Limits/<itemize>
2032 <item>The indicator is set only after a read past the end of a file is
2034 <item>The function is only available as fastcall function, so it may only be
2035 used in presence of a prototype.
2037 <tag/Availability/ISO 9899
2039 <ref id="feof" name="clearerr">,
2040 <ref id="ferror" name="ferror">
2046 <sect1>ferror<label id="ferror"><p>
2050 <tag/Function/Return the error indicator of a stream.
2051 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2052 <tag/Declaration/<tt/int __fastcall__ ferror (FILE* f);/
2053 <tag/Description/<tt/ferror/ tests the error indicator of the stream
2054 <tt/f/, and returns a non zero value if it is set.
2055 <tag/Limits/<itemize>
2056 <item>The function is only available as fastcall function, so it may only be
2057 used in presence of a prototype.
2059 <tag/Availability/ISO 9899
2061 <ref id="feof" name="clearerr">,
2062 <ref id="ferror" name="feof">
2068 <sect1>fileno<label id="fileno"><p>
2072 <tag/Function/Return the file handle used by a stream.
2073 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
2074 <tag/Declaration/<tt/int __fastcall__ fileno (FILE* f);/
2075 <tag/Description/The <tt/fileno/ function returns the file handle used
2076 internally by a C stream. This file handle (an integer) can be used as a
2077 handle for the POSIX input/output functions.
2078 <tag/Limits/<itemize>
2079 <item>The function is only available as fastcall function, so it may only be
2080 used in presence of a prototype.
2081 <item>Mixing C file I/O functions and POSIX file I/O functions for the same
2082 file may have unpredictable results.
2084 <tag/Availability/POSIX 1003.1
2086 <ref id="creat" name="creat">,
2087 <ref id="open" name="open"> <!-- , -->
2088 <!-- <ref id="read" name="read">, -->
2089 <!-- <ref id="write" name="write"> -->
2095 <sect1>free<label id="free"><p>
2099 <tag/Function/Free a block of dynamic memory.
2100 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2101 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
2102 <tag/Description/Free a block of dynamic memory previously allocated with
2103 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
2104 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
2105 pointer is <tt/NULL/, no action is performed.
2108 <item>Passing an already free'd block to <tt/free/ again will cause undefined
2109 behaviour and may crash your program.
2110 <item>The function is only available as fastcall function, so it may only
2111 be used in presence of a prototype.
2113 <tag/Availability/ISO 9899
2115 <ref id="_heapadd" name="_heapadd">,
2116 <ref id="_heapblocksize" name="_heapblocksize">,
2117 <ref id="_heapmaxavail" name="_heapmaxavail">,
2118 <ref id="_heapmemavail" name="_heapmemavail">,
2119 <ref id="calloc" name="calloc">,
2120 <ref id="malloc" name="malloc">,
2121 <ref id="realloc" name="realloc">
2127 <sect1>get_ostype<label id="get_ostype"><p>
2131 <tag/Function/The function returns the operating system, the program runs on.
2132 <tag/Header/<tt/<ref id="apple2.h" name="apple2.h">,
2133 <ref id="atari.h" name="atari.h">, <ref id="c64.h" name="c64.h">/
2134 <tag/Declaration/<tt/unsigned char get_ostype (void);/
2135 <tag/Description/<tt/get_ostype/ is machine dependent and does not exist for
2136 all supported targets. If it exists, it returns a number that identifies the
2137 operating system or machine type, the program runs on. The machine dependent
2138 header files define constants that can be used to check the return code.
2139 <tag/Limits/<itemize>
2140 <item>The function does not exist on all platforms.
2141 <item>The return codes are platform dependent.
2143 <tag/Availability/cc65 (not all platforms)
2149 <sect1>getenv<label id="getenv"><p>
2153 <tag/Function/Return a value from the environment.
2154 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2155 <tag/Declaration/<tt/char* __fastcall__ getenv (const char* name);/
2156 <tag/Description/The function searches the environment for an entry that
2157 matches <tt/name/ and returns its value. The environment consists of a list
2158 of strings in the form <tt/name=value/. If there is no match, <tt/getenv/
2160 <tag/Limits/<itemize>
2161 <item>What exactly is stored in the environment depends on the machine the
2162 program is running on.
2163 <item>The function is only available as fastcall function, so it may only
2164 be used in presence of a prototype.
2166 <tag/Availability/ISO 9899
2172 <sect1>getcpu<label id="getcpu"><p>
2176 <tag/Function/Determine on which CPU the program is running.
2177 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
2178 <tag/Declaration/<tt/unsigned char getcpu (void);/
2179 <tag/Description/The function checks on which CPU the code is running. It
2180 returns one of the constants<itemize>
2182 <item><tt/CPU_65C02/
2183 <item><tt/CPU_65816/
2185 <tag/Limits/<itemize>
2186 <item>Other, more exotic CPU types are not disinguished.
2188 <tag/Availability/cc65
2194 <sect1>gotox<label id="gotox"><p>
2198 <tag/Function/Move the text mode cursor to a new X position.
2199 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2200 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
2201 <tag/Description/The function moves the text mode cursor to the specified X
2202 position while leaving the Y position untouched. The leftmost position on the
2203 screen has the coordinate 0.
2204 <tag/Limits/<itemize>
2205 <item>The function is only available as fastcall function, so it may
2206 only be used in presence of a prototype.
2207 <item>Invalid values for the X position (out of screen coordinates) may
2208 lead to undefined behaviour.
2210 <tag/Availability/cc65
2212 <ref id="gotoy" name="gotoy">,
2213 <ref id="gotoxy" name="gotoxy">,
2214 <ref id="wherex" name="wherex">,
2215 <ref id="wherey" name="wherey">
2221 <sect1>gotoxy<label id="gotoxy"><p>
2225 <tag/Function/Move the text mode cursor to a new position.
2226 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2227 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
2228 <tag/Description/The function moves the text mode cursor to the specified
2229 position. The leftmost position on the screen has the X coordinate 0, the
2230 topmost line has the Y coordinate 0.
2231 <tag/Limits/<itemize>
2232 <item>The function is only available as fastcall function, so it may only be
2233 used in presence of a prototype.
2234 <item>Invalid values for any of both coordinates (out of screen positions) may
2235 lead to undefined behaviour.
2237 <tag/Availability/cc65
2239 <ref id="gotox" name="gotox">,
2240 <ref id="gotoy" name="gotoy">,
2241 <ref id="wherex" name="wherex">,
2242 <ref id="wherey" name="wherey">
2248 <sect1>gotoy<label id="gotoy"><p>
2252 <tag/Function/Move the text mode cursor to a new Y position.
2253 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2254 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
2255 <tag/Description/The function moves the text mode cursor to the specified Y
2256 position while leaving the X position untouched. The uppermost position on the
2257 screen has the coordinate 0.
2258 <tag/Limits/<itemize>
2259 <item>The function is only available as fastcall function, so it may
2260 only be used in presence of a prototype.
2261 <item>Invalid values for the Y position (out of screen coordinates) may lead
2262 to undefined behaviour.
2264 <tag/Availability/cc65
2266 <ref id="gotox" name="gotox">,
2267 <ref id="gotoxy" name="gotoxy">,
2268 <ref id="wherex" name="wherex">,
2269 <ref id="wherey" name="wherey">
2275 <sect1>isalnum<label id="isalnum"><p>
2279 <tag/Function/Check if a given character is a letter or digit.
2280 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2281 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
2282 <tag/Description/The function returns a value of zero if the given argument
2283 is a letter or digit. The return value is non zero if the character
2285 <tag/Limits/<itemize>
2286 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2287 inline sequence generated by the macro will not work correctly for values
2288 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2289 this range. The non inline function may be accessed by <tt/#undef/'ing
2291 <item>When compiling without <tt/-Os/, the function is only available as
2292 fastcall function, so it may only be used in presence of a prototype.
2294 <tag/Availability/ISO 9899
2296 <ref id="isalpha" name="isalpha">,
2297 <ref id="isascii" name="isascii">,
2298 <ref id="isblank" name="isblank">,
2299 <ref id="iscntrl" name="iscntrl">,
2300 <ref id="isdigit" name="isdigit">,
2301 <ref id="isgraph" name="isgraph">,
2302 <ref id="islower" name="islower">,
2303 <ref id="isprint" name="isprint">,
2304 <ref id="ispunct" name="ispunct">,
2305 <ref id="isspace" name="isspace">,
2306 <ref id="isupper" name="isupper">,
2307 <ref id="isxdigit" name="isxdigit">
2313 <sect1>isalpha<label id="isalpha"><p>
2317 <tag/Function/Check if a given character is a letter.
2318 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2319 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
2320 <tag/Description/The function returns a value of zero if the given argument
2321 is a letter. The return value is non zero if the character is anything else.
2322 <tag/Limits/<itemize>
2323 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2324 inline sequence generated by the macro will not work correctly for values
2325 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2326 this range. The non inline function may be accessed by <tt/#undef/'ing the
2328 <item>When compiling without <tt/-Os/, the function is only available as
2329 fastcall function, so it may only be used in presence of a prototype.
2331 <tag/Availability/ISO 9899
2333 <ref id="isalnum" name="isalnum">,
2334 <ref id="isascii" name="isascii">,
2335 <ref id="isblank" name="isblank">,
2336 <ref id="iscntrl" name="iscntrl">,
2337 <ref id="isdigit" name="isdigit">,
2338 <ref id="isgraph" name="isgraph">,
2339 <ref id="islower" name="islower">,
2340 <ref id="isprint" name="isprint">,
2341 <ref id="ispunct" name="ispunct">,
2342 <ref id="isspace" name="isspace">,
2343 <ref id="isupper" name="isupper">,
2344 <ref id="isxdigit" name="isxdigit">
2350 <sect1>isascii<label id="isascii"><p>
2354 <tag/Function/Check if a given character is in the ASCII (0..127) range.
2355 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2356 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
2357 <tag/Description/The function returns a value of zero if the given argument
2358 is in the range 0..127 (the range of valid ASCII characters) and a non zero
2360 <tag/Limits/<itemize>
2361 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2362 inline sequence generated by the macro will not work correctly for values
2363 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2364 this range. The non inline function may be accessed by <tt/#undef/'ing the
2366 <item>When compiling without <tt/-Os/, the function is only available as
2367 fastcall function, so it may only be used in presence of a prototype.
2369 <tag/Availability/ISO 9899
2371 <ref id="isalnum" name="isalnum">,
2372 <ref id="isalpha" name="isalpha">,
2373 <ref id="isblank" name="isblank">,
2374 <ref id="iscntrl" name="iscntrl">,
2375 <ref id="isdigit" name="isdigit">,
2376 <ref id="isgraph" name="isgraph">,
2377 <ref id="islower" name="islower">,
2378 <ref id="isprint" name="isprint">,
2379 <ref id="ispunct" name="ispunct">,
2380 <ref id="isspace" name="isspace">,
2381 <ref id="isupper" name="isupper">,
2382 <ref id="isxdigit" name="isxdigit">
2388 <sect1>isblank<label id="isblank"><p>
2392 <tag/Function/Check if a given character is a space or tab.
2393 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2394 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
2395 <tag/Description/The function returns a value of zero if the given argument
2396 is a space or tab character. The return value is non zero if the character
2398 <tag/Limits/<itemize>
2399 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2400 inline sequence generated by the macro will not work correctly for values
2401 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2402 this range. The non inline function may be accessed by <tt/#undef/'ing the
2404 <item>When compiling without <tt/-Os/, the function is only available as
2405 fastcall function, so it may only be used in presence of a prototype.
2407 <tag/Availability/cc65
2409 <ref id="isalnum" name="isalnum">,
2410 <ref id="isalpha" name="isalpha">,
2411 <ref id="isascii" name="isascii">,
2412 <ref id="iscntrl" name="iscntrl">,
2413 <ref id="isdigit" name="isdigit">,
2414 <ref id="isgraph" name="isgraph">,
2415 <ref id="islower" name="islower">,
2416 <ref id="isprint" name="isprint">,
2417 <ref id="ispunct" name="ispunct">,
2418 <ref id="isspace" name="isspace">,
2419 <ref id="isupper" name="isupper">,
2420 <ref id="isxdigit" name="isxdigit">
2426 <sect1>iscntrl<label id="iscntrl"><p>
2430 <tag/Function/Check if a given character is a control character.
2431 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2432 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
2433 <tag/Description/The function returns a value of zero if the given argument
2434 is a control character. The return value is non zero if the character
2436 <tag/Limits/<itemize>
2437 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2438 inline sequence generated by the macro will not work correctly for values
2439 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2440 this range. The non inline function may be accessed by <tt/#undef/'ing the
2442 <item>When compiling without <tt/-Os/, the function is only available as
2443 fastcall function, so it may only be used in presence of a prototype.
2445 <tag/Availability/ISO 9899
2447 <ref id="isalnum" name="isalnum">,
2448 <ref id="isalpha" name="isalpha">,
2449 <ref id="isascii" name="isascii">,
2450 <ref id="isblank" name="isblank">,
2451 <ref id="isdigit" name="isdigit">,
2452 <ref id="isgraph" name="isgraph">,
2453 <ref id="islower" name="islower">,
2454 <ref id="isprint" name="isprint">,
2455 <ref id="ispunct" name="ispunct">,
2456 <ref id="isspace" name="isspace">,
2457 <ref id="isupper" name="isupper">,
2458 <ref id="isxdigit" name="isxdigit">
2464 <sect1>isdigit<label id="isdigit"><p>
2468 <tag/Function/Check if a given character is a digit.
2469 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2470 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
2471 <tag/Description/The function returns a value of zero if the given argument
2472 is a digit. The return value is non zero if the character is anything else.
2473 <tag/Limits/<itemize>
2474 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2475 inline sequence generated by the macro will not work correctly for values
2476 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2477 this range. The non inline function may be accessed by <tt/#undef/'ing the
2479 <item>When compiling without <tt/-Os/, the function is only available as
2480 fastcall function, so it may only be used in presence of a prototype.
2482 <tag/Availability/ISO 9899
2484 <ref id="isalnum" name="isalnum">,
2485 <ref id="isalpha" name="isalpha">,
2486 <ref id="isascii" name="isascii">,
2487 <ref id="isblank" name="isblank">,
2488 <ref id="iscntrl" name="iscntrl">,
2489 <ref id="isgraph" name="isgraph">,
2490 <ref id="islower" name="islower">,
2491 <ref id="isprint" name="isprint">,
2492 <ref id="ispunct" name="ispunct">,
2493 <ref id="isspace" name="isspace">,
2494 <ref id="isupper" name="isupper">,
2495 <ref id="isxdigit" name="isxdigit">
2501 <sect1>isgraph<label id="isgraph"><p>
2505 <tag/Function/Check if a given character is a printable character (except
2507 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2508 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
2509 <tag/Description/The function returns a value of zero if the given argument
2510 is a printable character with the exception of space. The return value is non
2511 zero if the character is anything else.
2512 <tag/Limits/<itemize>
2513 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2514 inline sequence generated by the macro will not work correctly for values
2515 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2516 this range. The non inline function may be accessed by <tt/#undef/'ing the
2518 <item>When compiling without <tt/-Os/, the function is only available as
2519 fastcall function, so it may only be used in presence of a prototype.
2521 <tag/Availability/ISO 9899
2523 <ref id="isalnum" name="isalnum">,
2524 <ref id="isalpha" name="isalpha">,
2525 <ref id="isascii" name="isascii">,
2526 <ref id="isblank" name="isblank">,
2527 <ref id="iscntrl" name="iscntrl">,
2528 <ref id="isdigit" name="isdigit">,
2529 <ref id="islower" name="islower">,
2530 <ref id="isprint" name="isprint">,
2531 <ref id="ispunct" name="ispunct">,
2532 <ref id="isspace" name="isspace">,
2533 <ref id="isupper" name="isupper">,
2534 <ref id="isxdigit" name="isxdigit">
2540 <sect1>islower<label id="islower"><p>
2544 <tag/Function/Check if a given character is a lower case letter.
2545 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2546 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
2547 <tag/Description/The function returns a value of zero if the given argument
2548 is a lower case letter. The return value is non zero if the character is
2550 <tag/Limits/<itemize>
2551 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2552 inline sequence generated by the macro will not work correctly for values
2553 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2554 this range. The non inline function may be accessed by <tt/#undef/'ing the
2556 <item>When compiling without <tt/-Os/, the function is only available as
2557 fastcall function, so it may only be used in presence of a prototype.
2559 <tag/Availability/ISO 9899
2561 <ref id="isalnum" name="isalnum">,
2562 <ref id="isalpha" name="isalpha">,
2563 <ref id="isascii" name="isascii">,
2564 <ref id="isblank" name="isblank">,
2565 <ref id="iscntrl" name="iscntrl">,
2566 <ref id="isdigit" name="isdigit">,
2567 <ref id="isgraph" name="isgraph">,
2568 <ref id="isprint" name="isprint">,
2569 <ref id="ispunct" name="ispunct">,
2570 <ref id="isspace" name="isspace">,
2571 <ref id="isupper" name="isupper">,
2572 <ref id="isxdigit" name="isxdigit">
2578 <sect1>isprint<label id="isprint"><p>
2582 <tag/Function/Check if a given character is a printable character.
2583 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2584 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
2585 <tag/Description/The function returns a value of zero if the given argument
2586 is a printable character (this includes the space character). The return value
2587 is non zero if the character is anything else.
2588 <tag/Limits/<itemize>
2589 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2590 inline sequence generated by the macro will not work correctly for values
2591 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2592 this range. The non inline function may be accessed by <tt/#undef/'ing the
2594 <item>When compiling without <tt/-Os/, the function is only available as
2595 fastcall function, so it may only be used in presence of a prototype.
2597 <tag/Availability/ISO 9899
2599 <ref id="isalnum" name="isalnum">,
2600 <ref id="isalpha" name="isalpha">,
2601 <ref id="isascii" name="isascii">,
2602 <ref id="isblank" name="isblank">,
2603 <ref id="iscntrl" name="iscntrl">,
2604 <ref id="isdigit" name="isdigit">,
2605 <ref id="isgraph" name="isgraph">,
2606 <ref id="islower" name="islower">,
2607 <ref id="ispunct" name="ispunct">,
2608 <ref id="isspace" name="isspace">,
2609 <ref id="isupper" name="isupper">,
2610 <ref id="isxdigit" name="isxdigit">
2616 <sect1>ispunct<label id="ispunct"><p>
2620 <tag/Function/Check if a given character is a printable character but not a
2621 space or an alphanumeric character.
2622 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2623 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
2624 <tag/Description/The function returns a value of zero if the given argument
2625 is a printable character, but not a space or anything alphanumeric. The return
2626 value is non zero if the character is anything else.
2627 <tag/Limits/<itemize>
2628 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2629 inline sequence generated by the macro will not work correctly for values
2630 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2631 this range. The non inline function may be accessed by <tt/#undef/'ing the
2633 <item>When compiling without <tt/-Os/, the function is only available as
2634 fastcall function, so it may only be used in presence of a prototype.
2636 <tag/Availability/ISO 9899
2638 <ref id="isalnum" name="isalnum">,
2639 <ref id="isalpha" name="isalpha">,
2640 <ref id="isascii" name="isascii">,
2641 <ref id="isblank" name="isblank">,
2642 <ref id="iscntrl" name="iscntrl">,
2643 <ref id="isdigit" name="isdigit">,
2644 <ref id="isgraph" name="isgraph">,
2645 <ref id="islower" name="islower">,
2646 <ref id="isprint" name="isprint">,
2647 <ref id="isspace" name="isspace">,
2648 <ref id="isupper" name="isupper">,
2649 <ref id="isxdigit" name="isxdigit">
2655 <sect1>isspace<label id="isspace"><p>
2659 <tag/Function/Check if a given character is a a white-space character.
2660 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2661 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
2662 <tag/Description/The function returns a value of zero if the given argument
2663 is a white space character. The return value is non zero if the character is
2664 anything else. The standard white space characters are: space, formfeed ('\f'),
2665 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
2667 <tag/Limits/<itemize>
2668 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2669 inline sequence generated by the macro will not work correctly for values
2670 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2671 this range. The non inline function may be accessed by <tt/#undef/'ing the
2673 <item>When compiling without <tt/-Os/, the function is only available as
2674 fastcall function, so it may only be used in presence of a prototype.
2676 <tag/Availability/ISO 9899
2678 <ref id="isalnum" name="isalnum">,
2679 <ref id="isalpha" name="isalpha">,
2680 <ref id="isascii" name="isascii">,
2681 <ref id="isblank" name="isblank">,
2682 <ref id="iscntrl" name="iscntrl">,
2683 <ref id="isdigit" name="isdigit">,
2684 <ref id="isgraph" name="isgraph">,
2685 <ref id="islower" name="islower">,
2686 <ref id="isprint" name="isprint">,
2687 <ref id="ispunct" name="ispunct">,
2688 <ref id="isupper" name="isupper">,
2689 <ref id="isxdigit" name="isxdigit">
2695 <sect1>isupper<label id="isupper"><p>
2699 <tag/Function/Check if a given character is an upper case letter.
2700 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2701 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
2702 <tag/Description/The function returns a value of zero if the given argument
2703 is an upper case letter. The return value is non zero if the character is
2705 <tag/Limits/<itemize>
2706 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2707 inline sequence generated by the macro will not work correctly for values
2708 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2709 this range. The non inline function may be accessed by <tt/#undef/'ing the
2711 <item>When compiling without <tt/-Os/, the function is only available as
2712 fastcall function, so it may only be used in presence of a prototype.
2714 <tag/Availability/ISO 9899
2716 <ref id="isalnum" name="isalnum">,
2717 <ref id="isalpha" name="isalpha">,
2718 <ref id="isascii" name="isascii">,
2719 <ref id="isblank" name="isblank">,
2720 <ref id="iscntrl" name="iscntrl">,
2721 <ref id="isdigit" name="isdigit">,
2722 <ref id="isgraph" name="isgraph">,
2723 <ref id="islower" name="islower">,
2724 <ref id="isprint" name="isprint">,
2725 <ref id="ispunct" name="ispunct">,
2726 <ref id="isspace" name="isspace">,
2727 <ref id="isxdigit" name="isxdigit">
2733 <sect1>isxdigit<label id="isxdigit"><p>
2737 <tag/Function/Check if a given character is a hexadecimal digit.
2738 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2739 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
2740 <tag/Description/The function returns a value of zero if the given argument
2741 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
2742 if the character is anything else.
2743 <tag/Limits/<itemize>
2744 <item>When compiling with <tt/-Os/ the function is actually a macro. The
2745 inline sequence generated by the macro will not work correctly for values
2746 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
2747 this range. The non inline function may be accessed by <tt/#undef/'ing the
2749 <item>When compiling without <tt/-Os/, the function is only available as
2750 fastcall function, so it may only be used in presence of a prototype.
2752 <tag/Availability/ISO 9899
2754 <ref id="isalnum" name="isalnum">,
2755 <ref id="isalpha" name="isalpha">,
2756 <ref id="isascii" name="isascii">,
2757 <ref id="isblank" name="isblank">,
2758 <ref id="iscntrl" name="iscntrl">,
2759 <ref id="isdigit" name="isdigit">,
2760 <ref id="isgraph" name="isgraph">,
2761 <ref id="islower" name="islower">,
2762 <ref id="isprint" name="isprint">,
2763 <ref id="ispunct" name="ispunct">,
2764 <ref id="isspace" name="isspace">,
2765 <ref id="isupper" name="isupper">
2771 <sect1>itoa<label id="itoa"><p>
2775 <tag/Function/Convert an integer into a string.
2776 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2777 <tag/Declaration/<tt/char* __fastcall__ itoa (int val, char* buf, int radix);/
2778 <tag/Description/<tt/itoa/ converts the integer <tt/val/ into a string using
2779 <tt/radix/ as the base.
2780 <tag/Limits/<itemize>
2781 <item>There are no provisions to prevent a buffer overflow.
2782 <item>If <tt/val/ contains <tt/INT_MIN/, the behaviour is undefined.
2783 <item>The function is non standard, so it is not available in strict ANSI mode.
2784 You should probably use <tt/sprintf/ instead.
2785 <item>The function is only available as fastcall function, so it may only be
2786 used in presence of a prototype.
2788 <tag/Availability/cc65
2790 <ref id="atoi" name="atoi">,
2791 <ref id="atol" name="atol">,
2792 <ref id="ltoa" name="ltoa">,
2793 <ref id="ultoa" name="ultoa">,
2794 <ref id="utoa" name="utoa">
2800 <sect1>joy_count<label id="joy_count"><p>
2804 <tag/Function/Return the number of joysticks supported by the current driver.
2805 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2806 <tag/Declaration/<tt/unsigned char __fastcall__ joy_count (void);/
2807 <tag/Description/The function returns a the number of joysticks supported
2808 by the current joystick driver.
2809 <tag/Limits/<itemize>
2810 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2811 name="joy_load_driver"> before calling this function.
2812 <item>The function returns the number of joysticks supported by the driver.
2813 There's no way to check for the number of actually connected joysticks.
2814 <item>The function is only available as fastcall function, so it may only be
2815 used in presence of a prototype.
2817 <tag/Availability/cc65
2819 <ref id="joy_load_driver" name="joy_load_driver">,
2820 <ref id="joy_read" name="joy_read">
2826 <sect1>joy_install<label id="joy_install"><p>
2830 <tag/Function/Install an already loaded driver and return an error code.
2831 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2832 <tag/Declaration/<tt/unsigned char __fastcall__ joy_install (void* driver);/
2833 <tag/Description/The function installs a driver that was already loaded into
2834 memory (or linked statically to the program). It returns an error code
2835 (<tt/JOY_ERR_OK/ in case of success).
2836 <tag/Limits/<itemize>
2837 <item>The function is only available as fastcall function, so it may only be
2838 used in presence of a prototype.
2840 <tag/Availability/cc65
2842 <ref id="joy_load_driver" name="joy_load_driver">,
2843 <ref id="joy_uninstall" name="joy_uninstall">,
2844 <ref id="joy_unload" name="joy_unload">
2850 <sect1>joy_load_driver<label id="joy_load_driver"><p>
2854 <tag/Function/Load a driver from disk and install it.
2855 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2856 <tag/Declaration/<tt/unsigned char __fastcall__ joy_load_driver (const char* driver);/
2857 <tag/Description/The function loads a driver with the given name from disk
2858 and installs it. An error code is returned, which is <tt/JOY_ERR_OK/ if the
2859 driver was successfully loaded and installed.
2860 <tag/Limits/<itemize>
2861 <item>The function is only available as fastcall function, so it may only be
2862 used in presence of a prototype.
2864 <tag/Availability/cc65
2866 <ref id="joy_install" name="joy_install">,
2867 <ref id="joy_uninstall" name="joy_uninstall">,
2868 <ref id="joy_unload" name="joy_unload">
2874 <sect1>joy_read<label id="joy_read"><p>
2878 <tag/Function/Read the status of a joystick.
2879 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2880 <tag/Declaration/<tt/unsigned char __fastcall__ joy_read (unsigned char joystick);/
2881 <tag/Description/The function reads the status bits for a joystick. The number
2882 of the joystick is passed as parameter. The result may be examined by using one
2883 of the <tt/JOY_xxx/ macros from <ref id="joystick.h" name="joystick.h">.
2884 <tag/Limits/<itemize>
2885 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2886 name="joy_load_driver"> before calling this function.
2887 <item>The function is only available as fastcall function, so it may only be
2888 used in presence of a prototype.
2890 <tag/Availability/cc65
2892 <ref id="joy_count" name="joy_count">,
2893 <ref id="joy_load_driver" name="joy_load_driver">,
2894 <ref id="joy_unload" name="joy_unload">
2900 <sect1>joy_uninstall<label id="joy_uninstall"><p>
2904 <tag/Function/Uninstall the current joystick driver.
2905 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2906 <tag/Declaration/<tt/unsigned char __fastcall__ joy_uninstall (void);/
2907 <tag/Description/The function uninstalls the currently installed joystick
2908 driver. It does not remove the driver from memory. The function returns an
2909 error code, which is <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2910 <tag/Limits/<itemize>
2911 <item>A joystick driver must be installed using <ref id="joy_install"
2912 name="joy_install"> before calling this function.
2913 <item>The function is only available as fastcall function, so it may only be
2914 used in presence of a prototype.
2916 <tag/Availability/cc65
2918 <ref id="joy_install" name="joy_install">,
2919 <ref id="joy_load_driver" name="joy_load_driver">,
2920 <ref id="joy_unload" name="joy_unload">
2926 <sect1>joy_unload<label id="joy_unload"><p>
2930 <tag/Function/Uninstall, then unload the current joystick driver.
2931 <tag/Header/<tt/<ref id="joystick.h" name="joystick.h">/
2932 <tag/Declaration/<tt/unsigned char __fastcall__ joy_unload (void);/
2933 <tag/Description/The function uninstalls the currently installed joystick
2934 driver and removes it from memory. An error code is returned, which is
2935 <tt/JOY_ERR_OK/ if the driver was successfully uninstalled.
2936 <tag/Limits/<itemize>
2937 <item>A joystick driver must be loaded using <ref id="joy_load_driver"
2938 name="joy_load_driver"> before calling this function.
2939 <item>The function is only available as fastcall function, so it may only be
2940 used in presence of a prototype.
2942 <tag/Availability/cc65
2944 <ref id="joy_load_driver" name="joy_load_driver">
2950 <sect1>kbhit<label id="kbhit"><p>
2954 <tag/Function/Check if there's a key waiting in the keyboard buffer.
2955 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2956 <tag/Declaration/<tt/unsigned char kbhit (void);/
2957 <tag/Description/The function returns a value of zero if there is no character
2958 waiting to be read from the keyboard. It returns non zero otherwise.
2959 <tag/Limits/<itemize>
2960 <item>If the system does not support a keyboard buffer (most systems
2961 do), the function is rather useless.
2963 <tag/Availability/cc65
2965 <ref id="cgetc" name="cgetc">,
2966 <ref id="cursor" name="cursor">
2972 <sect1>labs<label id="labs"><p>
2976 <tag/Function/Returns the absolute value of a long integer.
2977 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
2978 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
2979 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
2981 <tag/Limits/<itemize>
2982 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
2983 <item>The function is only available as fastcall function, so it may only be
2984 used in presence of a prototype.
2986 <tag/Availability/ISO 9899
2988 <ref id="abs" name="abs">
2994 <sect1>ltoa<label id="ltoa"><p>
2998 <tag/Function/Convert a long integer into a string.
2999 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3000 <tag/Declaration/<tt/char* __fastcall__ ltoa (long val, char* buf, int radix);/
3001 <tag/Description/<tt/itoa/ converts the long integer <tt/val/ into a string
3002 using <tt/radix/ as the base.
3003 <tag/Limits/<itemize>
3004 <item>There are no provisions to prevent a buffer overflow.
3005 <item>If <tt/val/ contains <tt/LONG_MIN/, the behaviour is undefined.
3006 <item>The function is non standard, so it is not available in strict ANSI mode.
3007 You should probably use <tt/sprintf/ instead.
3008 <item>The function is only available as fastcall function, so it may only be
3009 used in presence of a prototype.
3011 <tag/Availability/cc65
3013 <ref id="atoi" name="atoi">,
3014 <ref id="atol" name="atol">,
3015 <ref id="itoa" name="itoa">,
3016 <ref id="ultoa" name="ultoa">,
3017 <ref id="utoa" name="utoa">
3023 <sect1>localeconv<label id="localeconv"><p>
3027 <tag/Function/Returns a pointer to the current locale structure.
3028 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
3029 <tag/Declaration/<tt/struct lconv* localeconv (void);/
3030 <tag/Description/<tt/localeconv/ returns a pointer to the current locale
3032 <tag/Limits/<itemize>
3033 <item>cc65 supports only the "C" locale, so even after setting a new locale
3034 using <tt/<ref id="setlocale" name="setlocale">/, the structure returned will
3037 <tag/Availability/ISO 9899
3039 <ref id="setlocale" name="setlocale">
3045 <sect1>longjmp<label id="longjmp"><p>
3049 <tag/Function/Non local goto.
3050 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
3051 <tag/Declaration/<tt/void __fastcall__ longjmp (jmp_buf buf, int retval);/
3052 <tag/Description/The <tt/longjmp/ function restores a program context from the
3053 data in <tt/buf/, which must have been set by a preceeding call to
3054 <tt/<ref id="setjmp" name="setjmp">/. Program execution continues as if the
3055 call to <tt/<ref id="setjmp" name="setjmp">/ has just returned the value
3059 <item>If the parameter <tt/retval/ is zero, the function will behave as if it
3060 was called with a value of one.
3061 <item>The function is only available as fastcall function, so it may only
3062 be used in presence of a prototype.
3064 <tag/Availability/ISO 9899
3066 <ref id="setjmp" name="setjmp">
3072 <sect1>malloc<label id="malloc"><p>
3076 <tag/Function/Allocate dynamic memory.
3077 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3078 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
3079 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
3080 pointer to the allocated memory block. On error (not enough memory available),
3081 <tt/malloc/ returns <tt/NULL/.
3084 <item>The function is only available as fastcall function, so it may only
3085 be used in presence of a prototype.
3087 <tag/Availability/ISO 9899
3089 <ref id="_heapadd" name="_heapadd">,
3090 <ref id="_heapblocksize" name="_heapblocksize">,
3091 <ref id="_heapmaxavail" name="_heapmaxavail">,
3092 <ref id="_heapmemavail" name="_heapmemavail">,
3093 <ref id="calloc" name="calloc">,
3094 <ref id="free" name="free">,
3095 <ref id="realloc" name="realloc">,
3096 <ref id="strdup" name="strdup">
3102 <sect1>memchr<label id="memchr"><p>
3106 <tag/Function/Search for a character in a block of raw memory.
3107 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3108 <tag/Declaration/<tt/void* __fastcall__ strchr (const void* mem, int c, size_t count);/
3109 <tag/Description/The <tt/memchr/ function locates the first occurrence of <tt/c/
3110 (converted to a char) in the block of raw memory string pointed to by <tt/mem/
3111 that is of size <tt/count/. Upon completion, the function returns a pointer to
3112 the character found, or a null pointer if the character was not found.
3113 <tag/Limits/<itemize>
3114 <item>The function is only available as fastcall function, so it may only
3115 be used in presence of a prototype.
3117 <tag/Availability/ISO 9899
3119 <ref id="strchr" name="strchr">
3125 <sect1>memcpy<label id="memcpy"><p>
3129 <tag/Function/Copy a memory area.
3130 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3131 <tag/Declaration/<tt/void* __fastcall__ memcpy (void* dest, const void* src, size_t count);/
3132 <tag/Description/<tt/memcpy/ copies <tt/count/ bytes from the memory area
3133 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3137 <item>The result is undefined if the memory areas do overlap. Use
3138 <tt/<ref id="memmove" name="memmove">/ to copy overlapping memory areas.
3139 <item>The function is only available as fastcall function, so it may only
3140 be used in presence of a prototype.
3142 <tag/Availability/ISO 9899
3144 <ref id="_swap" name="_swap">,
3145 <ref id="memmove" name="memmove">,
3146 <ref id="memset" name="memset">
3152 <sect1>memmove<label id="memmove"><p>
3156 <tag/Function/Copy a memory area.
3157 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3158 <tag/Declaration/<tt/void* __fastcall__ memmove (void* dest, const void* src, size_t count);/
3159 <tag/Description/<tt/memmove/ copies <tt/count/ bytes from the memory area
3160 pointed to by <tt/src/ into the memory area pointed to by <tt/dest/. It returns
3164 <item>While <tt/memmove/ allows the memory areas to overlap, it has some
3165 additional overhead compared to <tt/<ref id="memcpy" name="memcpy">/.
3166 <item>The function is only available as fastcall function, so it may only
3167 be used in presence of a prototype.
3169 <tag/Availability/ISO 9899
3171 <ref id="_swap" name="_swap">,
3172 <ref id="memcpy" name="memcpy">,
3173 <ref id="memset" name="memset">
3179 <sect1>memset<label id="memset"><p>
3183 <tag/Function/Fill a memory area.
3184 <tag/Header/<tt/<ref id="string.h" name="string.h">/
3185 <tag/Declaration/<tt/void* __fastcall__ memset (void* p, int val, size_t count);/
3186 <tag/Description/<tt/memset/ fills the memory area pointed to by <tt/p/ with
3187 the value <tt/val/. The function returns <tt/p/.
3190 <item>The function is only available as fastcall function, so it may only
3191 be used in presence of a prototype.
3193 <tag/Availability/ISO 9899
3195 <ref id="_swap" name="_swap">,
3196 <ref id="bzero" name="bzero">,
3197 <ref id="memcpy" name="memcpy">,
3198 <ref id="memmove" name="memmove">
3204 <sect1>mod_free<label id="mod_free"><p>
3208 <tag/Function/Free a relocatable module.
3209 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3210 <tag/Declaration/<tt/void __fastcall__ mod_free (void* module);/
3211 <tag/Description/The function will free a module loaded into memory by use of
3212 the <tt/<ref id="mod_load" name="mod_load">/ function.
3213 <tag/Limits/<itemize>
3214 <item>The pointer passed as parameter is the pointer to the module memory,
3215 not the pointer to the control structure.
3217 <tag/Availability/cc65
3219 <ref id="mod_load" name="mod_load">
3225 <sect1>mod_load<label id="mod_load"><p>
3229 <tag/Function/Load a relocatable module.
3230 <tag/Header/<tt/<ref id="modload.h" name="modload.h">/
3231 <tag/Declaration/<tt/unsigned char mod_load (struct mod_ctrl* ctrl);/
3232 <tag/Description/The function will load a code module into memory and relocate
3233 it. The function will return an error code. If <tt/MLOAD_OK/ is returned, the
3234 outgoing fields in the passed <tt/mod_ctrl/ struct contain information about
3235 the module just loaded. Possible error codes are:
3237 <item><tt/MLOAD_OK/ - Module load successful
3238 <item><tt/MLOAD_ERR_READ/ - Read error
3239 <item><tt/MLOAD_ERR_HDR/ - Header error
3240 <item><tt/MLOAD_ERR_OS/ - Wrong operating system
3241 <item><tt/MLOAD_ERR_FMT/ - Data format error
3242 <item><tt/MLOAD_ERR_MEM/ - Not enough memory
3244 <tag/Limits/<itemize>
3245 <item>The <htmlurl url="ld65.html" name="ld65"> linker is needed to create
3246 relocatable o65 modules for use with this function.
3248 <tag/Availability/cc65
3250 <ref id="mod_free" name="mod_free">
3256 <sect1>mouse_box<label id="mouse_box"><p>
3260 <tag/Function/Specify a bounding box for the mouse cursor.
3261 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3262 <tag/Declaration/<tt/void __fastcall__ mouse_box (int minx, int miny,
3263 int maxx, int maxy);/
3264 <tag/Description/The function allows to set a bounding box for mouse movement.
3265 <tag/Limits/<itemize>
3266 <item>The function does not check if the mouse cursor is currently within the
3267 given rectangle. Placing the mouse cursor within the bounding box is the
3268 responsibility of the programmer.
3269 <item>While the bounding box may be larger than the actual screen size, the
3270 standard mouse cursor draw routines may fail to set the cursor to coordinates
3271 outside of the screen area. Depending on the platform, you may have to supply
3272 your own mouse cursor routines.
3273 <item>The function is only available as fastcall function, so it may only be
3274 used in presence of a prototype.
3276 <tag/Availability/cc65
3278 <ref id="mouse_move" name="mouse_move">
3284 <sect1>mouse_buttons<label id="mouse_buttons"><p>
3288 <tag/Function/Return a bit mask encoding the state of the mouse buttons.
3289 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3290 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_buttons (void);/
3291 <tag/Description/The function returns a bit mask that encodes the state of the
3292 mouse buttons. You may use the <tt/MOUSE_BTN_XXX/ flags to decode the function
3294 <tag/Limits/<itemize>
3295 <item>The function is only available as fastcall function, so it may only be
3296 used in presence of a prototype.
3298 <tag/Availability/cc65
3300 <ref id="mouse_info" name="mouse_info">,
3301 <ref id="mouse_pos" name="mouse_pos">
3307 <sect1>mouse_geterrormsg<label id="mouse_geterrormsg"><p>
3311 <tag/Function/Return a readable error message for an error code.
3312 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3313 <tag/Declaration/<tt/const char* __fastcall__ mouse_geterrormsg (unsigned char
3315 <tag/Description/The function returns an error message (in english) for the
3316 error code passed parameter.
3317 <tag/Limits/<itemize>
3318 <item>The function will return "Unknown error" for invalid error codes.
3319 <item>The function is only available as fastcall function, so it may only be
3320 used in presence of a prototype.
3322 <tag/Availability/cc65
3324 <ref id="mouse_load_driver" name="mouse_load_driver">,
3325 <ref id="mouse_uninstall" name="mouse_uninstall">,
3326 <ref id="mouse_unload" name="mouse_unload">
3332 <sect1>mouse_hide<label id="mouse_hide"><p>
3336 <tag/Function/Hide the mouse pointer.
3337 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3338 <tag/Declaration/<tt/void __fastcall__ mouse_hide (void);/
3339 <tag/Description/The function hides the mouse pointer. It manages a counter
3340 that is shared between <tt/<ref id="mouse_show" name="mouse_show">/ and
3341 <tt/mouse_hide/ so that every call call to <tt/mouse_hide/ must be followed by
3342 a call to <tt/<ref id="mouse_show" name="mouse_show">/ to make the mouse cursor
3344 <tag/Limits/<itemize>
3345 <item>The function is only available as fastcall function, so it may only be
3346 used in presence of a prototype.
3348 <tag/Availability/cc65
3350 <ref id="mouse_show" name="mouse_show">
3356 <sect1>mouse_info<label id="mouse_info"><p>
3360 <tag/Function/Return the state of the mouse buttons and the position of the
3362 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3363 <tag/Declaration/<tt/void __fastcall__ mouse_info (struct mouse_info* info);/
3364 <tag/Description/The function returns the state of the mouse buttons and the
3365 position of the mouse in the <tt/mouse_info/ structure passed as parameter.
3366 <tag/Limits/<itemize>
3367 <item>The <tt/mouse_info/ struct is a superset of the <tt/mouse_pos/ struct,
3368 so if you just need the mouse position, call <tt/<ref id="mouse_pos"
3369 name="mouse_pos">/ instead.
3370 <item>The function is only available as fastcall function, so it may only be
3371 used in presence of a prototype.
3373 <tag/Availability/cc65
3375 <ref id="mouse_buttons" name="mouse_buttons">,
3376 <ref id="mouse_pos" name="mouse_pos">
3382 <sect1>mouse_install<label id="mouse_install"><p>
3386 <tag/Function/Install an already loaded mouse driver.
3387 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3388 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (const struct
3389 mouse_callbacks* c, void* driver);/
3390 <tag/Description/The function installs an already loaded mouse driver and
3391 returns an error code. The <tt/mouse_callbacks/ structure passed as first
3392 parameter contains pointers to routines needed to move or hide/show the mouse
3393 pointer. Defaults for these routines are supplied by the library, so if you
3394 can live with these defaults (which are platform specific), just pass a
3395 pointer to <tt/mouse_def_callbacks/. The function may be used to install a
3396 driver linked statically to the program.
3397 <tag/Limits/<itemize>
3398 <item>Not all drivers are able to detect if the supported hardware is really
3400 <item>After installing a driver, the mouse cursor is hidden.
3401 <item>The function is only available as fastcall function, so it may only be
3402 used in presence of a prototype.
3404 <tag/Availability/cc65
3406 <ref id="mouse_load_driver" name="mouse_load_driver">,
3407 <ref id="mouse_uninstall" name="mouse_uninstall">,
3408 <ref id="mouse_unload" name="mouse_unload">
3414 <sect1>mouse_ioctl<label id="mouse_ioctl"><p>
3418 <tag/Function/Call the driver specific ioctl function.
3419 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3420 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data);/
3421 <tag/Description/The function calls the IOCTL entry in the mouse driver,
3422 which is driver specific. The <tt/code/ parameter will choose between
3423 different IOCTL functions, and the <tt/data/ depends on code. The
3424 function returns an error code. The purpose of this function is to allow
3425 for driver specific extensions. See the documentation for a specific mouse
3426 driver for supported ioctl calls.
3427 <tag/Limits/<itemize>
3428 <item>Calling this function is non portable, because each driver may
3429 implement different ioctl calls (or none at all).
3430 <item>The function is only available as fastcall function, so it may only be
3431 used in presence of a prototype.
3433 <tag/Availability/cc65
3439 <sect1>mouse_load_driver<label id="mouse_load_driver"><p>
3443 <tag/Function/Load and initialize a mouse driver.
3444 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3445 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_load_driver (const struct
3446 mouse_callbacks* c, const char* driver);/
3447 <tag/Description/Load a mouse driver into memory and initialize it. The
3448 function returns an error code that tells if the call has been successful. The
3449 <tt/mouse_callbacks/ structure passed as first parameter contains pointers to
3450 routines needed to move or hide/show the mouse pointer. Defaults for these
3451 routines are supplied by the library, so if you can live with these defaults
3452 (which are platform specific), just pass a pointer to <tt/mouse_def_callbacks/.
3453 <tag/Limits/<itemize>
3454 <item>The driver is loaded by name, so currently you must know the type of
3455 mouse that should be supported. There is no autodetect capability.
3456 <item>Not all drivers are able to detect if the supported hardware is really
3458 <item>After installing a driver, the mouse cursor is hidden.
3459 <item>The function is only available as fastcall function, so it may only be
3460 used in presence of a prototype.
3462 <tag/Availability/cc65
3464 <ref id="mouse_install" name="mouse_install">,
3465 <ref id="mouse_uninstall" name="mouse_uninstall">,
3466 <ref id="mouse_unload" name="mouse_unload">
3472 <sect1>mouse_move<label id="mouse_move"><p>
3476 <tag/Function/Move the mouse cursor to a specific position.
3477 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3478 <tag/Declaration/<tt/void __fastcall__ mouse_move (int x, int y);/
3479 <tag/Description/The function updates the mouse position. If the mouse cursor
3480 is visible, it is shown at the new position.
3481 <tag/Limits/<itemize>
3482 <item>The function does not check if the new position is within the bounding
3483 box specified with <tt/<ref id="mouse_box" name="mouse_box">/.
3484 <item>The function is only available as fastcall function, so it may only be
3485 used in presence of a prototype.
3487 <tag/Availability/cc65
3489 <ref id="mouse_box" name="mouse_box">
3495 <sect1>mouse_pos<label id="mouse_pos"><p>
3499 <tag/Function/Return the position of the mouse.
3500 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3501 <tag/Declaration/<tt/void __fastcall__ mouse_pos (struct mouse_pos* pos);/
3502 <tag/Description/The function returns the position of the mouse in the
3503 <tt/mouse_pos/ structure passed as parameter.
3504 <tag/Limits/<itemize>
3505 <item>The <tt/mouse_pos/ struct is a subset of the <tt/mouse_info/ struct,
3506 so if you do also need the mouse buttons, call <tt/<ref id="mouse_info"
3507 name="mouse_info">/ instead.
3508 <item>The function is only available as fastcall function, so it may only be
3509 used in presence of a prototype.
3511 <tag/Availability/cc65
3513 <ref id="mouse_buttons" name="mouse_buttons">,
3514 <ref id="mouse_info" name="mouse_info">
3520 <sect1>mouse_show<label id="mouse_show"><p>
3524 <tag/Function/Show the mouse pointer.
3525 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3526 <tag/Declaration/<tt/void __fastcall__ mouse_show (void);/
3527 <tag/Description/The function shows the mouse pointer. It manages a counter
3528 that is shared between <tt/<ref id="mouse_hide" name="mouse_hide">/ and
3529 <tt/mouse_show/. The mouse cursor is visible if there was one more call to
3530 <tt/mouse_show/ than to <tt/<ref id="mouse_hide" name="mouse_hide">/.
3531 <tag/Limits/<itemize>
3532 <item>The function is only available as fastcall function, so it may only be
3533 used in presence of a prototype.
3535 <tag/Availability/cc65
3537 <ref id="mouse_hide" name="mouse_hide">
3543 <sect1>mouse_uninstall<label id="mouse_uninstall"><p>
3547 <tag/Function/Uninstall an already loaded mouse driver.
3548 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3549 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_install (void);/
3550 <tag/Description/The function uninstalls an already loaded mouse driver but
3551 don't removes it from memory.
3552 <tag/Limits/<itemize>
3553 <item>If the driver has been loaded using <tt/<ref id="mouse_load_driver"
3554 name="mouse_load_driver">/, <tt/<ref id="mouse_unload" name="mouse_unload">/
3555 should be used instead of <tt/mouse_uninstall/ so the driver is also removed
3557 <item>The function is only available as fastcall function, so it may only be
3558 used in presence of a prototype.
3560 <tag/Availability/cc65
3562 <ref id="mouse_install" name="mouse_install">,
3563 <ref id="mouse_load_driver" name="mouse_load_driver">,
3564 <ref id="mouse_unload" name="mouse_unload">
3570 <sect1>mouse_unload<label id="mouse_unload"><p>
3574 <tag/Function/Unload a mouse driver.
3575 <tag/Header/<tt/<ref id="mouse.h" name="mouse.h">/
3576 <tag/Declaration/<tt/unsigned char __fastcall__ mouse_unload (void);/
3577 <tag/Description/The function unloads a loaded mouse driver and frees all
3578 memory allocated for the driver.
3579 <tag/Limits/<itemize>
3580 <item>The function does nothing if no driver is loaded.
3582 <tag/Availability/cc65
3584 <ref id="mouse_install" name="mouse_install">,
3585 <ref id="mouse_load_driver" name="mouse_load_driver">,
3586 <ref id="mouse_uninstall" name="mouse_uninstall">
3592 <sect1>offsetof<label id="offsetof"><p>
3596 <tag/Function/Calculate the offset of a struct or union member.
3597 <tag/Header/<tt/<ref id="stddef.h" name="stddef.h">/
3598 <tag/Declaration/<tt/size_t offsetof (type, member);/
3599 <tag/Description/<tt/offsetof/ calculates the address offset of a <tt/struct/
3600 or <tt/union/ member.
3601 <tag/Limits/<itemize>
3602 <item>The function is actually a macro.
3604 <tag/Availability/ISO 9899
3610 <sect1>open<label id="open"><p>
3614 <tag/Function/Open and possibly create a file.
3615 <tag/Header/<tt/<ref id="fcntl.h" name="fcntl.h">/
3616 <tag/Declaration/<tt/int open (const char* name, int flags, ...);/
3617 <tag/Description/<tt/open/ opens a file and returns the file descriptor
3618 associated with it. On error, -1 is returned and an error code is stored in
3619 <tt/errno/. Several flags may be passed to <tt/open/ that change the behaviour.
3620 <tag/Limits/<itemize>
3621 <item>POSIX specifies an additional <tt/mode/ argument that may be passed to
3622 open, which is used as the permission mask when a new file is created. While
3623 cc65 allows to pass this argument, it is ignored.
3625 <tag/Availability/POSIX 1003.1
3627 <ref id="close" name="close">,
3628 <ref id="creat" name="creat">
3634 <sect1>peekbsys<label id="peekbsys"><p>
3638 <tag/Function/Read one byte from a location in the system bank.
3639 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3640 <tt/<ref id="cbm510.h" name="cbm510.h">/
3641 <tag/Declaration/<tt/unsigned char __fastcall__ peekbsys (unsigned addr);/
3642 <tag/Description/<tt/peekbsys/ reads one byte from the given address in the
3643 system bank (bank 15) of the CBM PET-II machines and returns it.
3646 <item>The function is only available as fastcall function, so it may only
3647 be used in presence of a prototype.
3648 <item>This function may be a macro depending on the compiler options. The
3649 actual function is accessible by #undef'ing the macro.
3651 <tag/Availability/cc65
3653 <ref id="PEEK" name="PEEK">,
3654 <ref id="PEEKW" name="PEEKW">,
3655 <ref id="peekwsys" name="peekwsys">,
3656 <ref id="pokebsys" name="pokebsys">,
3657 <ref id="pokewsys" name="pokewsys">
3663 <sect1>peekwsys<label id="peekwsys"><p>
3667 <tag/Function/Read one word from a location in the system bank.
3668 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3669 <tt/<ref id="cbm510.h" name="cbm510.h">/
3670 <tag/Declaration/<tt/unsigned __fastcall__ peekwsys (unsigned addr);/
3671 <tag/Description/<tt/peekwsys/ reads one word from the given address in the
3672 system bank (bank 15) of the CBM PET-II machines and returns it. Following
3673 the usual 6502 conventions, the low byte is read from <tt/addr/, and the
3674 high byte is read from <tt/addr+1/.
3677 <item>The function is only available as fastcall function, so it may only
3678 be used in presence of a prototype.
3679 <item>The order in which the two bytes are read is undefined.
3681 <tag/Availability/cc65
3683 <ref id="PEEK" name="PEEK">,
3684 <ref id="PEEKW" name="PEEKW">,
3685 <ref id="peekbsys" name="peekbsys">,
3686 <ref id="pokebsys" name="pokebsys">,
3687 <ref id="pokewsys" name="pokewsys">
3693 <sect1>perror<label id="perror"><p>
3697 <tag/Function/Print an error message for the error in <tt/errno/.
3698 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3699 <tag/Declaration/<tt/void __fastcall__ perror (const char* s);/
3700 <tag/Description/<tt/perror/ prints an error message to <tt/stderr/. If <tt/s/
3701 is not <tt/NULL/ and not an empty string, it is printed followed by a colon and
3702 a blank. Then the error message for the current contents of <tt/errno/ is
3703 printed followed by a newline. The message output is the same as returned by
3704 <tt/<ref id="strerror" name="strerror">/ with an argument of <tt/errno/.
3707 <item>The function is only available as fastcall function, so it may only
3708 be used in presence of a prototype.
3710 <tag/Availability/ISO 9899
3712 <ref id="_poserror" name="_poserror">,
3713 <ref id="strerror" name="strerror">
3719 <sect1>pokebsys<label id="pokebsys"><p>
3723 <tag/Function/Write one byte to a location in the system bank.
3724 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3725 <tt/<ref id="cbm510.h" name="cbm510.h">/
3726 <tag/Declaration/<tt/void __fastcall__ pokebsys (unsigned addr, unsigned char val);/
3727 <tag/Description/<tt/pokebsys/ writes one byte to the given address in the
3728 system bank (bank 15) of the CBM PET-II machines.
3731 <item>The function is only available as fastcall function, so it may only
3732 be used in presence of a prototype.
3734 <tag/Availability/cc65
3736 <ref id="POKE" name="POKE">,
3737 <ref id="POKEW" name="POKEW">,
3738 <ref id="peekbsys" name="peekbsys">,
3739 <ref id="peekwsys" name="peekwsys">,
3740 <ref id="pokewsys" name="pokewsys">
3746 <sect1>pokewsys<label id="pokewsys"><p>
3750 <tag/Function/Write one word to a location in the system bank.
3751 <tag/Header/<tt/<ref id="cbm610.h" name="cbm610.h">/,
3752 <tt/<ref id="cbm510.h" name="cbm510.h">/
3753 <tag/Declaration/<tt/void __fastcall__ pokewsys (unsigned addr, unsigned val);/
3754 <tag/Description/<tt/pokewsys/ writes one word to the given address in the
3755 system bank (bank 15) of the CBM PET-II machines. Following the usual 6502
3756 conventions, the low byte of <tt/val/ is written to <tt/addr/, and the
3757 high byte is written to <tt/addr+1/.
3760 <item>The function is only available as fastcall function, so it may only
3761 be used in presence of a prototype.
3762 <item>The order in which the two bytes are written is undefined.
3764 <tag/Availability/cc65
3766 <ref id="POKE" name="POKE">,
3767 <ref id="POKEW" name="POKEW">,
3768 <ref id="peekbsys" name="peekbsys">,
3769 <ref id="peekwsys" name="peekwsys">,
3770 <ref id="pokebsys" name="pokebsys">
3776 <sect1>qsort<label id="qsort"><p>
3780 <tag/Function/Sort an array.
3781 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3782 <tag/Declaration/<tt/void __fastcall__ qsort (void* base, size_t count,
3783 size_t size, int (*compare) (const void*, const void*));/
3784 <tag/Description/<tt/qsort/ sorts an array according to a given compare
3785 function <tt/compare/. <tt/base/ is the address of the array, <tt/count/
3786 is the number of elements, <tt/size/ the size of an element and <tt/compare/
3787 the function used to compare the members.
3790 <item>If there are multiple members with the same key, the order after calling
3791 the function is undefined.
3792 <item>The function is only available as fastcall function, so it may only
3793 be used in presence of a prototype.
3795 <tag/Availability/ISO 9899
3797 <ref id="bsearch" name="bsearch">
3803 <sect1>raise<label id="raise"><p>
3807 <tag/Function/Send a signal to the executing program.
3808 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
3809 <tag/Declaration/<tt/int __fastcall__ raise (int sig);/
3810 <tag/Description/<tt/raise/ sends the given signal to the program. If the
3811 program has installed a signal handler for the signal, this signal handler
3812 will be executed. If no handler has been installed, the default action for
3813 the raised signal will be taken. The function returns zero on success,
3815 <tag/Limits/<itemize>
3816 <item>The function is only available as fastcall function, so it may only
3817 be used in presence of a prototype.
3819 <tag/Availability/ISO 9899
3821 <ref id="abort" name="abort">,
3822 <ref id="signal" name="signal">
3828 <sect1>rand<label id="rand"><p>
3832 <tag/Function/Return a pseudo random number.
3833 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3834 <tag/Declaration/<tt/int rand (void);/
3835 <tag/Description/The function returns a pseudo random number
3836 between 0 and <tt/RAND_MAX/ (exclusive).
3837 <tag/Limits/<itemize>
3838 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
3839 flow of numbers is generated.
3840 <item>On startup, the function behaves as if <ref id="srand" name="srand">
3841 had been used with an argument of 1.
3843 <tag/Availability/ISO 9899
3845 <ref id="_randomize" name="_randomize">,
3846 <ref id="srand" name="srand">
3852 <sect1>realloc<label id="realloc"><p>
3856 <tag/Function/Change the size of an allocated memory block.
3857 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
3858 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
3859 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
3860 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
3861 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
3862 behaves as if <tt/free/ had been called. On error (not enough memory
3863 available), <tt/realloc/ returns <tt/NULL/.
3866 <item>The part of the memory block that is returned will have its contents
3868 <item>This function is somewhat dangerous to use. Be careful to save the
3869 pointer you're passing somewhere else, otherwise
3871 ptr = realloc (ptr, size);
3873 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
3874 <item>The function is only available as fastcall function, so it may only
3875 be used in presence of a prototype.
3877 <tag/Availability/ISO 9899
3879 <ref id="_heapadd" name="_heapadd">,
3880 <ref id="_heapblocksize" name="_heapblocksize">,
3881 <ref id="_heapmaxavail" name="_heapmaxavail">,
3882 <ref id="_heapmemavail" name="_heapmemavail">,
3883 <ref id="calloc" name="calloc">,
3884 <ref id="free" name="free">,
3885 <ref id="realloc" name="realloc">
3891 <sect1>remove<label id="remove"><p>
3895 <tag/Function/Delete a file.
3896 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3897 <tag/Declaration/<tt/int __fastcall__ remove (const char* name);/
3898 <tag/Description/<tt/remove/ deletes the file with the given name. On success,
3899 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
3900 code describing the reason for the failure.
3903 <item>This function is not available on all cc65 targets (depends on the
3904 availability of file I/O).
3905 <item>The function is only available as fastcall function, so it may only
3906 be used in presence of a prototype.
3908 <tag/Availability/ISO 9899
3910 <ref id="rename" name="rename">,
3911 <ref id="unlink" name="unlink">
3914 #include <stdio.h>
3916 #define FILENAME "helloworld"
3918 if (remove (FILENAME) == 0) {
3919 printf ("We deleted %s successfully\n", FILENAME);
3921 printf ("There was a problem deleting %s\n", FILENAME);
3928 <sect1>rename<label id="rename"><p>
3932 <tag/Function/Rename a file.
3933 <tag/Header/<tt/<ref id="stdio.h" name="stdio.h">/
3934 <tag/Declaration/<tt/int __fastcall__ rename (const char* oldname, const char* newname);/
3935 <tag/Description/<tt/rename/ renames a file (gives it a new name). On success,
3936 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
3937 code describing the reason for the failure.
3940 <item>This function is not available on all cc65 targets (depends on the
3941 capabilities of the storage devices).
3942 <item>The function is only available as fastcall function, so it may only
3943 be used in presence of a prototype.
3945 <tag/Availability/ISO 9899
3947 <ref id="remove" name="remove">
3950 #include <stdio.h>
3952 #define OLDNAME "textfile.txt"
3953 #define NEWNAME "textfile.bak"
3955 if (rename (OLDNAME, NEWNAME) == 0) {
3956 printf ("Renamed %s to %s\n", OLDNAME, NEWNAME);
3958 printf ("Error renaming %s to %s\n", OLDNAME, NEWNAME);
3965 <sect1>reset_brk<label id="reset_brk"><p>
3969 <tag/Function/Resets the break vector to its original value.
3970 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
3971 <tag/Declaration/<tt/void __fastcall__ reset_brk (void);/
3972 <tag/Description/<tt/reset_brk/ resets the break vector to the value it had
3973 before a call to <tt/set_brk/.
3976 <item>Since <tt/<ref id="set_brk" name="set_brk">/ installs an exit handler,
3977 it is not strictly necessary to call this function as part of the cleanup when
3980 <tag/Availability/cc65
3982 <ref id="set_brk" name="set_brk">
3988 <sect1>revers<label id="revers"><p>
3992 <tag/Function/Control revers character display.
3993 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
3994 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
3995 <tag/Description/If the argument is non zero, the function enables reverse
3996 character display. If the argument is zero, reverse character display is
3997 switched off. The old value of the setting is returned.
3998 <tag/Limits/<itemize>
3999 <item>The function may not be supported by the hardware, in which case
4000 the call is ignored.
4001 <item>The function is only available as fastcall function, so it may only
4002 be used in presence of a prototype.
4004 <tag/Availability/cc65
4006 <ref id="textcolor" name="textcolor">
4012 <sect1>screensize<label id="screensize"><p>
4016 <tag/Function/Return the dimensions of the text mode screen.
4017 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4018 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
4019 <tag/Description/The function returns the dimensions of the text mode screen.
4020 <tag/Limits/<itemize>
4021 <item>The function is only available as fastcall function, so it may only
4022 be used in presence of a prototype.
4024 <tag/Availability/cc65
4026 <ref id="gotox" name="gotox">,
4027 <ref id="gotoxy" name="gotoxy">,
4028 <ref id="gotoy" name="gotoy">,
4029 <ref id="wherex" name="wherex">,
4030 <ref id="wherey" name="wherey">
4036 <sect1>set_brk<label id="set_brk"><p>
4040 <tag/Function/Set the break vector to a user function.
4041 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
4042 <tag/Declaration/<tt/void __fastcall__ set_brk (brk_handler func);/
4043 <tag/Description/<tt/set_brk/ allows a user program to handle breaks within the
4044 program code by letting the vector point to a user written C function. The
4045 runtime library installs a small stub that saves the registers into global
4046 variables that may be accessed (and changed) by the break handler.
4049 <item>The function is only available as fastcall function, so it may only
4050 be used in presence of a prototype.
4051 <item>The stub saves the zero page registers used by the C runtime and switches
4052 to a small break handler stack. This means that it is safe to execute C code,
4053 even if C code was interrupted. Be careful however not to use too many local
4054 variables, and do not enable stack checks for the handler function or any other
4055 function called from it.
4056 <item>The <tt/brk_pc/ variable points to the <tt/BRK/ instruction. If you want
4057 the continue with the interrupted code, you have to adjust <tt/brk_pc/,
4058 otherwise the <tt/BRK/ instruction will get executed over and over again.
4059 <item>Since <tt/set_brk/ installs an exit handler, it is not strictly necessary
4060 to call <tt/<ref id="reset_brk" name="reset_brk">/ as part of the cleanup when
4061 the program terminates.
4063 <tag/Availability/cc65
4065 <ref id="reset_brk" name="reset_brk">
4071 <sect1>setjmp<label id="setjmp"><p>
4075 <tag/Function/Save the context for use with <tt/longjmp/.
4076 <tag/Header/<tt/<ref id="setjmp.h" name="setjmp.h">/
4077 <tag/Declaration/<tt/int __fastcall__ setjmp (jmp_buf buf);/
4078 <tag/Description/The <tt/setjmp/ function saves the current context in <tt/buf/
4079 for subsequent use by the <tt/<ref id="longjmp" name="longjmp">/ function and
4083 <item>The function is only available as fastcall function, so it may only
4084 be used in presence of a prototype.
4085 <item><tt/setjmp/ is actually a macro as required by the ISO standard.
4086 <item><tt/setjmp/ will not save the signal context.
4088 <tag/Availability/ISO 9899
4090 <ref id="longjmp" name="longjmp">
4096 <sect1>setlocale<label id="setlocale"><p>
4100 <tag/Function/Selects a locale.
4101 <tag/Header/<tt/<ref id="locale.h" name="locale.h">/
4102 <tag/Declaration/<tt/char* __fastcall__ setlocale (int category, const char* locale);/
4103 <tag/Description/<tt/setlocale/ sets or queries the program's locale.
4106 <item>The function is only available as fastcall function, so it may only
4107 be used in presence of a prototype.
4108 <item>cc65 supports only the "C" locale, so calling this function to set a
4109 different locale has no effect.
4111 <tag/Availability/ISO 9899
4113 <ref id="localeconv" name="localeconv">,
4114 <ref id="strcoll" name="strcoll">
4115 <ref id="strxfrm" name="strxfrm">
4121 <sect1>signal<label id="signal"><p>
4125 <tag/Function/Install a signal handler.
4126 <tag/Header/<tt/<ref id="signal.h" name="signal.h">/
4127 <tag/Declaration/<tt/__sigfunc __fastcall__ signal (int sig, __sigfunc func);/
4128 <tag/Description/<tt/signal/ installs a handler for the given signal. The
4129 handler may either be a user supplied function, or one of the predefined
4130 signal handlers <tt/SIG_IGN/ or <tt/SIG_DFL/. The function returns the
4131 previous value if the signal , or the special function vector SIG_ERR in
4133 <tag/Limits/<itemize>
4134 <item>The function is only available as fastcall function, so it may only
4135 be used in presence of a prototype.
4137 <tag/Availability/ISO 9899
4139 <ref id="abort" name="abort">,
4140 <ref id="raise" name="raise">
4146 <sect1>sleep<label id="sleep"><p>
4150 <tag/Function/Sleep for a specified amount of time.
4151 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4152 <tag/Declaration/<tt/void __fastcall__ sleep (unsigned seconds);/
4153 <tag/Description/The function will return after the specified number of
4154 seconds have elapsed.
4155 <tag/Limits/<itemize>
4156 <item>The function is only available as fastcall function, so it may only
4157 be used in presence of a prototype.
4159 <tag/Availability/POSIX 1003.1
4165 <sect1>slow<label id="slow"><p>
4169 <tag/Function/Switch the C128 into 1MHz mode.
4170 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4171 <tag/Declaration/<tt/void slow (void);/
4172 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
4173 will halve the speed compared to fast mode.
4174 <tag/Limits/<itemize>
4175 <item>The function is specific to the C128.
4177 <tag/Availability/C128
4179 <ref id="fast" name="fast">,
4180 <ref id="toggle_videomode" name="toggle_videomode">,
4181 <ref id="videomode" name="videomode">
4187 <sect1>srand<label id="srand"><p>
4191 <tag/Function/Initialize the pseudo random number generator.
4192 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4193 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
4194 <tag/Description/The function initializes the random number generator using
4195 the given seed. On program startup, the generator behaves as if <tt/srand/ has
4196 been called with an argument of 1.
4197 <tag/Limits/<itemize>
4198 <item>The function is only available as fastcall function, so it may only
4199 be used in presence of a prototype.
4201 <tag/Availability/ISO 9899
4203 <ref id="_randomize" name="_randomize">,
4204 <ref id="rand" name="rand">
4210 <sect1>strcasecmp<label id="strcasecmp"><p>
4214 <tag/Function/Compare two strings case insensitive.
4215 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4216 <tag/Declaration/<tt/int __fastcall__ strcasecmp (const char* s1, const char* s2);/
4217 <tag/Description/The <tt/strcasecmp/ function compares the two strings passed
4218 as parameters without case sensitivity. It returns a value that is less than
4219 zero if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/,
4220 and a value greater than zero if <tt/s1/ is greater than <tt/s2/.
4221 <tag/Limits/<itemize>
4222 <item>The function is only available as fastcall function, so it may only
4223 be used in presence of a prototype.
4224 <item>The function is not available in strict ANSI mode.
4226 <tag/Availability/cc65
4228 <ref id="strcmp" name="strcmp">,
4229 <ref id="strcoll" name="strcoll">,
4230 <ref id="stricmp" name="stricmp">,
4231 <ref id="strncmp" name="strncmp">
4232 <ref id="strxfrm" name="strxfrm">
4238 <sect1>strcat<label id="strcat"><p>
4242 <tag/Function/Concatentate two strings.
4243 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4244 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
4245 <tag/Description/The <tt/strcat/ function appends a copy of the string
4246 pointed to by s2 (including the terminating null byte) to the end of the
4247 string pointed to by s1. The initial byte of s2 overwrites the null byte at
4249 <tag/Limits/<itemize>
4250 <item>The function is only available as fastcall function, so it may only
4251 be used in presence of a prototype.
4252 <item>If copying takes place between objects that overlap, the behaviour
4255 <tag/Availability/ISO 9899
4257 <ref id="strcpy" name="strcpy">,
4258 <ref id="strncat" name="strncat">,
4259 <ref id="strncpy" name="strncpy">
4265 <sect1>strchr<label id="strchr"><p>
4269 <tag/Function/Search for a character in a string.
4270 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4271 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
4272 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
4273 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4274 byte is considered to be part of the string. Upon completion, the function
4275 returns a pointer to the byte, or a null pointer if the byte was not found.
4276 <tag/Limits/<itemize>
4277 <item>The function is only available as fastcall function, so it may only
4278 be used in presence of a prototype.
4280 <tag/Availability/ISO 9899
4282 <ref id="memchr" name="memchr">,
4283 <ref id="strrchr" name="strrchr">
4289 <sect1>strcmp<label id="strcmp"><p>
4293 <tag/Function/Compare two strings.
4294 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4295 <tag/Declaration/<tt/int __fastcall__ strcmp (const char* s1, const char* s2);/
4296 <tag/Description/The <tt/strcmp/ function compares the two strings passed as
4297 parameters. It returns a value that is less than zero if <tt/s1/ is less than
4298 <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater than zero
4299 if <tt/s1/ is greater than <tt/s2/.
4300 <tag/Limits/<itemize>
4301 <item>The function is only available as fastcall function, so it may only
4302 be used in presence of a prototype.
4304 <tag/Availability/ISO 9899
4306 <ref id="strcasecmp" name="strcasecmp">,
4307 <ref id="strcoll" name="strcoll">,
4308 <ref id="stricmp" name="stricmp">,
4309 <ref id="strncmp" name="strncmp">
4310 <ref id="strxfrm" name="strxfrm">
4316 <sect1>strcoll<label id="strcoll"><p>
4320 <tag/Function/Compare two strings.
4321 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4322 <tag/Declaration/<tt/int __fastcall__ strcoll (const char* s1, const char* s2);/
4323 <tag/Description/The <tt/strcoll/ function compares the two strings passed as
4324 parameters, according to the collating sequence set by <tt/<ref id="setlocale"
4325 name="setlocale">/. It returns a value that is less than zero if <tt/s1/ is
4326 less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a value greater
4327 than zero if <tt/s1/ is greater than <tt/s2/.
4328 <tag/Limits/<itemize>
4329 <item>The function is only available as fastcall function, so it may only
4330 be used in presence of a prototype.
4332 <tag/Availability/ISO 9899
4334 <ref id="setlocale" name="setlocale">,
4335 <ref id="strcasecmp" name="strcasecmp">,
4336 <ref id="strcmp" name="strcmp">,
4337 <ref id="stricmp" name="stricmp">,
4338 <ref id="strncmp" name="strncmp">
4339 <ref id="strxfrm" name="strxfrm">
4345 <sect1>strcpy<label id="strcpy"><p>
4349 <tag/Function/Copy a string.
4350 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4351 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
4352 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
4353 <tt/s2/ (including the terminating null byte) into the array pointed to by
4354 <tt/s1/. The function will always return <tt/s1/.
4355 <tag/Limits/<itemize>
4356 <item>The function is only available as fastcall function, so it may only
4357 be used in presence of a prototype.
4358 <item>If copying takes place between objects that overlap, the behaviour
4361 <tag/Availability/ISO 9899
4363 <ref id="strcat" name="strcat">,
4364 <ref id="strncat" name="strncat">,
4365 <ref id="strncpy" name="strncpy">
4368 #include <string.h>
4370 static char hello[14];
4372 strcpy (hello, "Hello world!\n");
4378 <sect1>strcspn<label id="strcspn"><p>
4382 <tag/Function/Compute the length of a substring.
4383 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4384 <tag/Declaration/<tt/size_t __fastcall__ strcspn (const char* s, const char* set);/
4385 <tag/Description/The <tt/strcspn/ function computes and returns the length of
4386 the substring pointed to by <tt/s/ which does <em>not</em> consist of
4387 characters contained in the string <tt/set/.
4388 <tag/Limits/<itemize>
4389 <item>The function is only available as fastcall function, so it may only
4390 be used in presence of a prototype.
4392 <tag/Availability/ISO 9899
4394 <ref id="strspn" name="strspn">,
4395 <ref id="strstr" name="strstr">,
4396 <ref id="strtok" name="strtok">
4402 <sect1>strdup<label id="strdup"><p>
4406 <tag/Function/Allocate a copy of a string on the heap.
4407 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4408 <tag/Declaration/<tt/char* __fastcall__ strdup (const char* s);/
4409 <tag/Description/<tt/strdup/ allocates a memory block on the heap, big enough
4410 to hold a copy of <tt/s/ including the terminating zero. If the allocation
4411 fails, <tt/NULL/ is returned, otherwise <tt/s/ is copied into the allocated
4412 memory block, and a pointer to the block is returned.
4413 <tag/Limits/<itemize>
4414 <item>The function is only available as fastcall function, so it may only
4415 be used in presence of a prototype.
4416 <item>It is up to the caller to free the allocated memory block.
4418 <tag/Availability/ISO 9899
4420 <ref id="free" name="free">,
4421 <ref id="malloc" name="malloc">
4427 <sect1>strerror<label id="strerror"><p>
4431 <tag/Function/Return a string describing an error code.
4432 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4433 <tag/Declaration/<tt/char* __fastcall__ strerror (int errcode);/
4434 <tag/Description/The <tt/strerror/ function returns a string describing the
4435 given error code. If an invalid error code is passed, the string "Unknown
4436 error" is returned, and <tt/errno/ is set to <tt/EINVAL/. In all other cases,
4437 <tt/errno/ is left untouched.
4438 <tag/Limits/<itemize>
4439 <item>The function is only available as fastcall function, so it may only
4440 be used in presence of a prototype.
4441 <item>While the return type of the function is a <tt/char*/, the returned
4442 string must not be modified by the caller!
4444 <tag/Availability/ISO 9899
4446 <ref id="_stroserror" name="_stroserror">
4452 <sect1>stricmp<label id="stricmp"><p>
4456 <tag/Function/Compare two strings case insensitive.
4457 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4458 <tag/Declaration/<tt/int __fastcall__ stricmp (const char* s1, const char* s2);/
4459 <tag/Description/The <tt/stricmp/ function compares the two strings passed as
4460 parameters without case sensitivity. It returns a value that is less than zero
4461 if <tt/s1/ is less than <tt/s2/, zero if <tt/s1/ is the same as <tt/s2/, and a
4462 value greater than zero if <tt/s1/ is greater than <tt/s2/.
4463 <tag/Limits/<itemize>
4464 <item>The function is only available as fastcall function, so it may only
4465 be used in presence of a prototype.
4466 <item>The function is not available in strict ANSI mode.
4468 <tag/Availability/cc65
4470 <ref id="strcasecmp" name="strcasecmp">,
4471 <ref id="strcmp" name="strcmp">,
4472 <ref id="strcoll" name="strcoll">,
4473 <ref id="strncmp" name="strncmp">
4474 <ref id="strxfrm" name="strxfrm">
4480 <sect1>strlen<label id="strlen"><p>
4484 <tag/Function/Return the length of a string.
4485 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4486 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
4487 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
4488 string to which s points, not including the terminating null byte.
4489 <tag/Limits/<itemize>
4490 <item>The function is only available as fastcall function, so it may only
4491 be used in presence of a prototype.
4492 <item>When compiling with <tt/-Os/ (inline known standard functions), the
4493 function does not work correctly for strings with more than 255 characters.
4495 <tag/Availability/ISO 9899
4497 <ref id="strcpy" name="strcpy">
4503 <sect1>strlower<label id="strlower"><p>
4507 <tag/Function/Make a string lower case.
4508 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4509 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
4510 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
4511 function to each character of a string. The function will always return <tt/s/.
4512 <tag/Limits/<itemize>
4513 <item>The function is only available as fastcall function, so it may only
4514 be used in presence of a prototype.
4515 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4516 <item>An alias name for this function is <tt/strlwr/.
4518 <tag/Availability/cc65
4520 <ref id="strupper" name="strupper">,
4521 <ref id="tolower" name="tolower">
4527 <sect1>strlwr<label id="strlwr"><p>
4534 <sect1>strncat<label id="strncat"><p>
4538 <tag/Function/Concatentate two strings.
4539 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4540 <tag/Declaration/<tt/char* __fastcall__ strncat (char* s1, const char* s2, size_t n);/
4541 <tag/Description/The <tt/strncat/ function appends not more than n characters
4542 of the string pointed to by s2 to the end of the string pointed to by s1. The
4543 terminating null character at the end of s1 is overwritten. A terminating null
4544 character is appended to the result, even if not all of s2 is appended to s1.
4545 <tag/Limits/<itemize>
4546 <item>The function is only available as fastcall function, so it may only
4547 be used in presence of a prototype.
4548 <item>If copying takes place between objects that overlap, the behaviour
4551 <tag/Availability/ISO 9899
4553 <ref id="strcpy" name="strcpy">,
4554 <ref id="strncat" name="strncat">,
4555 <ref id="strncpy" name="strncpy">
4561 <sect1>strncmp<label id="strncmp"><p>
4565 <tag/Function/Compare two strings.
4566 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4567 <tag/Declaration/<tt/int __fastcall__ strncmp (const char* s1, const char* s2, size_t count);/
4568 <tag/Description/The <tt/strncmp/ function compares not more than <tt/count/
4569 characters of the two strings passed as parameters. It returns a value that is
4570 less than zero if the first <tt/count/ characters of <tt/s1/ are less than
4571 <tt/s2/, zero if they are identical, and a value greater than zero they are
4573 <tag/Limits/<itemize>
4574 <item>The function is only available as fastcall function, so it may only
4575 be used in presence of a prototype.
4577 <tag/Availability/ISO 9899
4579 <ref id="strcasecmp" name="strcasecmp">,
4580 <ref id="strcmp" name="strcmp">,
4581 <ref id="strcoll" name="strcoll">,
4582 <ref id="stricmp" name="stricmp">
4583 <ref id="strxfrm" name="strxfrm">
4589 <sect1>strncpy<label id="strncpy"><p>
4593 <tag/Function/Copy part of a string.
4594 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4595 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
4596 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
4597 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
4598 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
4599 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
4600 written. The function will always return <tt/s1/.
4601 <tag/Limits/<itemize>
4602 <item>The function is only available as fastcall function, so it may only
4603 be used in presence of a prototype. If there is no null byte in the first <tt/n/
4604 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
4605 <item>If copying takes place between objects that overlap, the behaviour is
4608 <tag/Availability/ISO 9899
4610 <ref id="strcat" name="strcat">,
4611 <ref id="strcpy" name="strcpy">,
4612 <ref id="strncat" name="strncat">
4617 static char hello[6];
4619 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
4626 <sect1>strrchr<label id="strrchr"><p>
4630 <tag/Function/Search for a character in a string.
4631 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4632 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
4633 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
4634 (converted to a char) in the string pointed to by <tt/s/. The terminating null
4635 byte is considered to be part of the string. Upon completion, the function
4636 returns a pointer to the byte, or a null pointer if the byte was not found.
4637 <tag/Limits/<itemize>
4638 <item>The function is only available as fastcall function, so it may only
4639 be used in presence of a prototype.
4641 <tag/Availability/ISO 9899
4643 <ref id="strchr" name="strchr">
4649 <sect1>strspn<label id="strspn"><p>
4653 <tag/Function/Compute the length of a substring.
4654 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4655 <tag/Declaration/<tt/size_t __fastcall__ strspn (const char* s, const char* set);/
4656 <tag/Description/The <tt/strspn/ function computes and returns the length of
4657 the substring pointed to by <tt/s/ which does consist only of characters
4658 contained in the string <tt/set/.
4659 <tag/Limits/<itemize>
4660 <item>The function is only available as fastcall function, so it may only
4661 be used in presence of a prototype.
4663 <tag/Availability/ISO 9899
4665 <ref id="strcspn" name="strcspn">,
4666 <ref id="strstr" name="strstr">
4672 <sect1>strstr<label id="strstr"><p>
4676 <tag/Function/Find a substring.
4677 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4678 <tag/Declaration/<tt/char* __fastcall__ strstr (const char* str, const char* substr);/
4679 <tag/Description/<tt/strstr/ searches for the first occurance of the string
4680 <tt/substr/ within <tt/str/. If found, it returns a pointer to the copy,
4681 otherwise it returns <tt/NULL/.
4682 <tag/Limits/<itemize>
4683 <item>The function is only available as fastcall function, so it may only
4684 be used in presence of a prototype.
4686 <tag/Availability/ISO 9899
4688 <ref id="strcspn" name="strcspn">,
4689 <ref id="strspn" name="strspn">
4695 <sect1>strtok<label id="strtok"><p>
4699 <tag/Function/Break a string into tokens.
4700 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4701 <tag/Declaration/<tt/char* __fastcall__ strtok (char* s1, const char* s2);/
4702 <tag/Description/<tt/strtok/ will break the string s1 into a sequence of
4703 tokens, which are delimited by characters from the string s2. The first call
4704 to <tt/strtok/ will return a pointer to the first token in the string s1.
4705 Following calls must pass a <tt/NULL/ pointer as s1 in order to get the next
4706 token in the string. Different sets of delimiters may be used for the
4707 subsequent calls to <tt/strtok/.
4708 <tag/Limits/<itemize>
4709 <item>The function is only available as fastcall function, so it may only
4710 be used in presence of a prototype.
4711 <item><tt/strtok/ will modify the string s1.
4713 <tag/Availability/ISO 9899
4715 <ref id="strcspn" name="strcspn">,
4716 <!-- <ref id="strpbrk" name="strpbrk"> -->
4722 <sect1>strxfrm<label id="strxfrm"><p>
4726 <tag/Function/Transform a string.
4727 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4728 <tag/Declaration/<tt/size_t __fastcall__ strxfrm (char* s1, const char* s2, size_t n);/
4729 <tag/Description/The <tt/strxfrm/ function transforms the string pointed to by
4730 s2 and places the resulting string into the string pointed to by s1. The
4731 transformation is such that if the <tt/strcmp/ function is applied to two
4732 transformed strings, it returns a value greater than, equal to, or less than
4733 zero, corresponding to the result of the <tt/strcoll/ function applied to the
4734 same two original strings. No more than n characters are placed into the
4735 resulting array pointed to by s1, including the terminating null character.
4736 <tag/Limits/<itemize>
4737 <item><tt/s1/ and <tt/s2/ must not point to the same memory area, otherwise
4738 the behaviour is undefined.
4739 <item>If <tt/n/ is zero, <tt/s1/ may be a NULL pointer.
4740 <item>The function is only available as fastcall function, so it may only
4741 be used in presence of a prototype.
4742 <item>Since cc65 doesn't support different charcter sets, <tt/strxfrm/ will
4743 just copy s2 to s1 using <tt><ref id="strncpy" name="strncpy"></tt>.
4745 <tag/Availability/ISO 9899
4747 <ref id="strcmp" name="strcmp">,
4748 <ref id="strcoll" name="strcoll">,
4749 <ref id="strncpy" name="strncpy">,
4755 <sect1>strupper<label id="strupper"><p>
4759 <tag/Function/Make a string upper case.
4760 <tag/Header/<tt/<ref id="string.h" name="string.h">/
4761 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
4762 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
4763 function to each character of a string. The function will always return <tt/s/.
4764 <tag/Limits/<itemize>
4765 <item>The function is only available as fastcall function, so it may only
4766 be used in presence of a prototype.
4767 <item>The function prototype is unavailable when compiling in strict ANSI mode.
4768 <item>An alias name for this function is <tt/strupr/.
4770 <tag/Availability/cc65
4772 <ref id="strlower" name="strlower">
4773 <ref id="toupper" name="toupper">
4779 <sect1>strupr<label id="strupr"><p>
4786 <sect1>textcolor<label id="textcolor"><p>
4790 <tag/Function/Set the text color.
4791 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
4792 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
4793 <tag/Description/The function will set a new text color. It returns the old
4794 (current) text color. Text output using any <tt/conio.h/ function will use
4795 the color set by this function.
4796 <tag/Limits/<itemize>
4797 <item>Text colors are system dependent. The function may have no effect
4798 on systems where the text color cannot be changed.
4799 <item>The function is only available as fastcall function, so it may only
4800 be used in presence of a prototype.
4802 <tag/Availability/cc65
4804 <ref id="bgcolor" name="bgcolor">,
4805 <ref id="bordercolor" name="bordercolor">
4811 <sect1>time<label id="time"><p>
4815 <tag/Function/Get the time.
4816 <tag/Header/<tt/<ref id="time.h" name="time.h">/
4817 <tag/Declaration/<tt/time_t __fastcall__ time (time_t* t);/
4818 <tag/Description/The function returns the time since the 1970-01-01 00:00:00
4819 measured in seconds. If the pointer <tt/t/ is not <tt/NULL/, the function
4820 result will also be stored there. If no time is available, <tt/(time_t)-1/ is
4821 returned and <tt/errno/ is set to <tt/ENOSYS/.
4822 <tag/Limits/<itemize>
4823 <item>The function is only available as fastcall function, so it may
4824 only be used in presence of a prototype.
4825 <item>Many platforms supported by cc65 do not have a realtime clock, so the
4826 returned value may not be valid.
4828 <tag/Availability/ISO 9899
4834 <sect1>toggle_videomode<label id="toggle_videomode"><p>
4838 <tag/Function/Toggle between 40 and 80 column mode.
4839 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
4840 <tag/Declaration/<tt/void toggle_videomode (void);/
4841 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
4842 old mode (cursor position, color and so on) are saved and restored together
4844 <tag/Limits/<itemize>
4845 <item>The function is specific to the C128.
4846 <item>This function is deprecated. Please use <ref id="videomode"
4847 name="videomode"> instead!
4849 <tag/Availability/C128
4851 <ref id="fast" name="fast">,
4852 <ref id="slow" name="slow">,
4853 <ref id="videomode" name="videomode">
4859 <sect1>tolower<label id="tolower"><p>
4863 <tag/Function/Convert a character into its lower case representation.
4864 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4865 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
4866 <tag/Description/The function returns the given character converted to lower
4867 case. If the given character is not a letter, it is returned unchanged.
4868 <tag/Limits/<itemize>
4869 <item>The function is only available as fastcall function, so it may
4870 only be used in presence of a prototype.
4872 <tag/Availability/ISO 9899
4874 <ref id="islower" name="islower">,
4875 <ref id="isupper" name="isupper">,
4876 <ref id="toupper" name="toupper">
4882 <sect1>toupper<label id="toupper"><p>
4886 <tag/Function/Convert a character into its upper case representation.
4887 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
4888 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
4889 <tag/Description/The function returns the given character converted to upper
4890 case. If the given character is not a letter, it is returned unchanged.
4891 <tag/Limits/<itemize>
4892 <item>The function is only available as fastcall function, so it may
4893 only be used in presence of a prototype.
4895 <tag/Availability/ISO 9899
4897 <ref id="islower" name="islower">,
4898 <ref id="isupper" name="isupper">,
4899 <ref id="tolower" name="tolower">
4905 <sect1>ultoa<label id="ultoa"><p>
4909 <tag/Function/Convert an unsigned long integer into a string.
4910 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4911 <tag/Declaration/<tt/char* __fastcall__ ultoa (unsigned long val, char* buf, int radix);/
4912 <tag/Description/<tt/itoa/ converts the unsigned long integer <tt/val/ into a
4913 string using <tt/radix/ as the base.
4914 <tag/Limits/<itemize>
4915 <item>There are no provisions to prevent a buffer overflow.
4916 <item>The function is non standard, so it is not available in strict ANSI mode.
4917 You should probably use <tt/sprintf/ instead.
4918 <item>The function is only available as fastcall function, so it may only be
4919 used in presence of a prototype.
4921 <tag/Availability/cc65
4923 <ref id="atoi" name="atoi">,
4924 <ref id="atol" name="atol">,
4925 <ref id="itoa" name="itoa">,
4926 <ref id="ltoa" name="ltoa">,
4927 <ref id="utoa" name="utoa">
4933 <sect1>unlink<label id="unlink"><p>
4937 <tag/Function/Delete a file.
4938 <tag/Header/<tt/<ref id="unistd.h" name="unistd.h">/
4939 <tag/Declaration/<tt/int __fastcall__ unlink (const char* name);/
4940 <tag/Description/<tt/unlink/ deletes the file with the given name. On success,
4941 zero is returned. On error, -1 is returned and <tt/errno/ is set to an error
4942 code describing the reason for the failure.
4945 <item>The use of this function is discouraged. Please use <tt/<ref id="remove"
4946 name="remove">/ instead, which is a native ANSI C function and does the same.
4947 <item>This function is not available on all cc65 targets (depends on the
4948 availability of file I/O).
4949 <item>The function is only available as fastcall function, so it may only
4950 be used in presence of a prototype.
4951 <item>Instead of <tt/unlink/, <tt/<ref id="remove" name="remove">/ should be
4952 used, which has the same semantics, but is more portable, because it conforms
4953 to the ISO C standard.
4955 <tag/Availability/POSIX 1003.1
4957 <ref id="remove" name="remove">
4960 #include <stdio.h>
4961 #include <unistd.h>
4963 #define FILENAME "helloworld"
4965 if (unlink (FILENAME) == 0) {
4966 printf ("We deleted %s successfully\n", FILENAME);
4968 printf ("There was a problem deleting %s\n", FILENAME);
4975 <sect1>utoa<label id="utoa"><p>
4979 <tag/Function/Convert an unsigned integer into a string.
4980 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
4981 <tag/Declaration/<tt/char* __fastcall__ utoa (unsigned val, char* buf, int radix);/
4982 <tag/Description/<tt/itoa/ converts the unsigned integer <tt/val/ into a string
4983 using <tt/radix/ as the base.
4984 <tag/Limits/<itemize>
4985 <item>There are no provisions to prevent a buffer overflow.
4986 <item>The function is non standard, so it is not available in strict ANSI mode.
4987 You should probably use <tt/sprintf/ instead.
4988 <item>The function is only available as fastcall function, so it may only be
4989 used in presence of a prototype.
4991 <tag/Availability/cc65
4993 <ref id="atoi" name="atoi">,
4994 <ref id="atol" name="atol">,
4995 <ref id="itoa" name="itoa">,
4996 <ref id="ltoa" name="ltoa">,
4997 <ref id="ultoa" name="ultoa">
5003 <sect1>vcprintf<label id="vcprintf"><p>
5007 <tag/Function/Formatted output to the console.
5008 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5009 <tag/Declaration/<tt/int __fastcall__ vcprintf (const char* format, va_list ap);/
5010 <tag/Description/The arguments specified as a <tt/va_list/ are converted to
5011 text where necessary and formatted according to the format string given. The
5012 resulting string is output to the console. <tt/vcprintf/ supports the same
5013 format specifiers as <tt/vprintf/. <!-- <tt/<ref id="vprintf" name="vprintf">/. -->
5014 <tag/Limits/<itemize>
5015 <item>Like all other <tt/conio/ output functions, <tt/vcprintf/ distinguishes
5016 between <tt/\r/ and <tt/\n/.
5017 <item>The function is only available as fastcall function, so it may only be
5018 used in presence of a prototype.
5020 <tag/Availability/cc65
5022 <ref id="cprintf" name="cprintf">,
5023 <ref id="cputc" name="cputc">,
5024 <ref id="cputcxy" name="cputcxy">,
5025 <ref id="cputs" name="cputs">,
5026 <ref id="cputsxy" name="cputsxy">
5032 <sect1>videomode<label id="videomode"><p>
5036 <tag/Function/Switch to either 40 or 80 column mode.
5037 <tag/Header/<tt/<ref id="apple2enh.h" name="apple2enh.h">,
5038 <ref id="c128.h" name="c128.h">/
5039 <tag/Declaration/<tt/unsigned __fastcall__ videomode (unsigned Mode);/
5040 <tag/Description/Switch to 40 or 80 column mode depending on the argument. If
5041 the requested mode is already active, nothing happens. The old mode is returned
5043 <tag/Limits/<itemize>
5044 <item>The function is specific to the C128 and enhanced Apple //e.
5045 <item>This function replaces <ref id="toggle_videomode"
5046 name="toggle_videomode">.
5047 <item>The function is only available as fastcall function, so it may only be
5048 used in presence of a prototype.
5050 <tag/Availability/C128 and enhanced Apple //e
5052 <ref id="fast" name="fast">,
5053 <ref id="slow" name="slow">,
5054 <ref id="toggle_videomode" name="toggle_videomode">
5060 <sect1>wherex<label id="wherex"><p>
5064 <tag/Function/Return the current X position of the text mode cursor.
5065 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5066 <tag/Declaration/<tt/unsigned char wherex (void);/
5067 <tag/Description/The function returns the current X position of the text mode
5068 cursor. Zero is returned for the leftmost screen position.
5069 <tag/Availability/cc65
5071 <ref id="gotox" name="gotox">,
5072 <ref id="gotoy" name="gotoy">,
5073 <ref id="gotoxy" name="gotoxy">,
5074 <ref id="wherey" name="wherey">
5080 <sect1>wherey<label id="wherey"><p>
5084 <tag/Function/Return the current Y position of the text mode cursor.
5085 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
5086 <tag/Declaration/<tt/unsigned char wherey (void);/
5087 <tag/Description/The function returns the current Y position of the text mode
5088 cursor. Zero is returned for the uppermost screen position.
5089 <tag/Availability/cc65
5091 <ref id="gotox" name="gotox">,
5092 <ref id="gotoy" name="gotoy">,
5093 <ref id="gotoxy" name="gotoxy">,
5094 <ref id="wherex" name="wherex">