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 available C functions supplied by the 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/assert.h/<label id="assert.h"><p>
68 <item><ref id="assert" name="assert">
72 <sect1><tt/c128.h/<label id="c128.h"><p>
75 <item><ref id="c64mode" name="c64mode">
76 <item><ref id="fast" name="fast">
77 <item><ref id="toggle_videomode" name="toggle_videomode">
78 <item><ref id="slow" name="slow">
82 <sect1><tt/conio.h/<label id="conio.h"><p>
85 <item><ref id="bgcolor" name="bgcolor">
86 <item><ref id="bordercolor" name="bordercolor">
87 <item><ref id="cclear" name="cclear">
88 <item><ref id="cclearxy" name="cclearxy">
89 <item><ref id="cgetc" name="cgetc">
90 <item><ref id="chline" name="chline">
91 <item><ref id="chlinexy" name="chlinexy">
92 <item><ref id="clrscr" name="clrscr">
93 <!-- <item><ref id="cprintf" name="cprintf"> -->
94 <!-- <item><ref id="cputc" name="cputc"> -->
95 <!-- <item><ref id="cputcxy" name="cputcxy"> -->
96 <!-- <item><ref id="cputs" name="cputs"> -->
97 <!-- <item><ref id="cputsxy" name="cputsxy"> -->
98 <item><ref id="cursor" name="cursor">
99 <item><ref id="cvline" name="cvline">
100 <item><ref id="cvlinexy" name="cvlinexy">
101 <item><ref id="gotox" name="gotox">
102 <item><ref id="gotoxy" name="gotoxy">
103 <item><ref id="gotoy" name="gotoy">
104 <item><ref id="kbhit" name="kbhit">
105 <item><ref id="revers" name="revers">
106 <item><ref id="screensize" name="screensize">
107 <item><ref id="textcolor" name="textcolor">
108 <!-- <item><ref id="vcprintf" name="vcprintf"> -->
109 <item><ref id="wherex" name="wherex">
110 <item><ref id="wherey" name="wherey">
114 <sect1><tt/ctype.h/<label id="ctype.h"><p>
117 <item><ref id="isalnum" name="isalnum">
118 <item><ref id="isalpha" name="isalpha">
119 <item><ref id="isascii" name="isascii">
120 <item><ref id="isblank" name="isblank">
121 <item><ref id="iscntrl" name="iscntrl">
122 <item><ref id="isdigit" name="isdigit">
123 <item><ref id="isgraph" name="isgraph">
124 <item><ref id="islower" name="islower">
125 <item><ref id="isprint" name="isprint">
126 <item><ref id="ispunct" name="ispunct">
127 <item><ref id="isspace" name="isspace">
128 <item><ref id="isupper" name="isupper">
129 <item><ref id="isxdigit" name="isxdigit">
130 <item><ref id="tolower" name="tolower">
131 <item><ref id="toupper" name="toupper">
135 <sect1><tt/em.h/<label id="em.h"><p>
138 <item><ref id="em_commit" name="em_commit">
139 <item><ref id="em_copyfrom" name="em_copyfrom">
140 <item><ref id="em_copyto" name="em_copyto">
141 <item><ref id="em_load_driver" name="em_load_driver">
142 <item><ref id="em_map" name="em_map">
143 <item><ref id="em_pagecount" name="em_pagecount">
144 <item><ref id="em_unload" name="em_unload">
145 <item><ref id="em_use" name="em_use">
149 <sect1><tt/stdlib.h/<label id="stdlib.h"><p>
152 <item><ref id="_heapadd" name="_heapadd">
153 <item><ref id="_heapmaxavail" name="_heapmaxavail">
154 <item><ref id="_heapmemavail" name="_heapmemavail">
155 <item><ref id="_randomize" name="_randomize">
156 <!-- <item><ref id="_swap" name="_swap"> -->
157 <item><ref id="abort" name="abort">
158 <item><ref id="abs" name="abs">
159 <item><ref id="atexit" name="atexit">
160 <!-- <item><ref id="atoi" name="atoi"> -->
161 <!-- <item><ref id="atol" name="atol"> -->
162 <!-- <item><ref id="bsearch" name="bsearch"> -->
163 <item><ref id="calloc" name="calloc">
164 <!-- <item><ref id="div" name="div"> -->
165 <item><ref id="exit" name="exit">
166 <item><ref id="free" name="free">
167 <!-- <item><ref id="getenv" name="getenv"> -->
168 <!-- <item><ref id="itoa" name="itoa"> -->
169 <item><ref id="labs" name="labs">
170 <!-- <item><ref id="ltoa" name="ltoa"> -->
171 <item><ref id="malloc" name="malloc">
172 <!-- <item><ref id="qsort" name="qsort"> -->
173 <item><ref id="rand" name="rand">
174 <item><ref id="realloc" name="realloc">
175 <item><ref id="srand" name="srand">
176 <!-- <item><ref id="ultoa" name="ultoa"> -->
177 <!-- <item><ref id="utoa" name="utoa"> -->
181 <sect1><tt/string.h/<label id="string.h"><p>
184 <!-- <item><ref id="_stroserror" name="_stroserror"> -->
185 <!-- <item><ref id="bzero" name="bzero"> -->
186 <!-- <item><ref id="memchr" name="memchr"> -->
187 <!-- <item><ref id="memcpy" name="memcpy"> -->
188 <!-- <item><ref id="memmove" name="memmove"> -->
189 <!-- <item><ref id="memset" name="memset"> -->
190 <!-- <item><ref id="strcasecmp" name="strcasecmp"> -->
191 <item><ref id="strcat" name="strcat">
192 <item><ref id="strchr" name="strchr">
193 <!-- <item><ref id="strcmp" name="strcmp"> -->
194 <!-- <item><ref id="strcoll" name="strcoll"> -->
195 <item><ref id="strcpy" name="strcpy">
196 <!-- <item><ref id="strcspn" name="strcspn"> -->
197 <!-- <item><ref id="strdup" name="strdup"> -->
198 <!-- <item><ref id="strerror" name="strerror"> -->
199 <!-- <item><ref id="stricmp" name="stricmp"> -->
200 <item><ref id="strlen" name="strlen">
201 <item><ref id="strlower" name="strlower">
202 <item><ref id="strlwr" name="strlwr">
203 <!-- <item><ref id="strncat" name="strncat"> -->
204 <!-- <item><ref id="strncmp" name="strncmp"> -->
205 <item><ref id="strncpy" name="strncpy">
206 <item><ref id="strrchr" name="strrchr">
207 <!-- <item><ref id="strspn" name="strspn"> -->
208 <!-- <item><ref id="strstr" name="strstr"> -->
209 <!-- <item><ref id="strtok" name="strtok"> -->
210 <!-- <item><ref id="strxfrm" name="strxfrm"> -->
211 <item><ref id="strupper" name="strupper">
212 <item><ref id="strupr" name="strupr">
218 <sect>Alphabetical function reference<p>
220 <sect1>_heapadd<label id="_heapadd"><p>
224 <tag/Function/Add a block to the heap.
225 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
226 <tag/Declaration/<tt/void __fastcall__ _heapadd (void* mem, size_t size);/
227 <tag/Description/The function adds a block of raw memory to the heap.
230 <item>The minimum blocksize that can be added is 6 bytes; the function will
231 ignore blocks with smaller sizes.
233 <tag/Availability/cc65
235 <ref id="_heapmaxavail" name="_heapmaxavail">,
236 <ref id="_heapmemavail" name="_heapmemavail">,
237 <ref id="calloc" name="calloc">,
238 <ref id="free" name="free">,
239 <ref id="malloc" name="malloc">,
240 <ref id="realloc" name="realloc">
246 <sect1>_heapmaxavail<label id="_heapmaxavail"><p>
250 <tag/Function/Return the largest block that is available on the heap.
251 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
252 <tag/Declaration/<tt/size_t __fastcall__ _heapmaxavail (void);/
253 <tag/Description/The function returns the size of the largest block that may
254 be allocated from the heap using <tt/<ref id="malloc" name="malloc">/.
255 <tag/Availability/cc65
257 <ref id="_heapadd" name="_heapadd">,
258 <ref id="_heapmemavail" name="_heapmemavail">,
259 <ref id="calloc" name="calloc">,
260 <ref id="free" name="free">,
261 <ref id="malloc" name="malloc">,
262 <ref id="realloc" name="realloc">
268 <sect1>_heapmemavail<label id="_heapmemavail"><p>
272 <tag/Function/Return the total available space on the heap.
273 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
274 <tag/Declaration/<tt/size_t __fastcall__ _heapmemavail (void);/
275 <tag/Description/The function returns the total number of bytes available on
279 <item>This function is of less use than usually assumed, since the returned
280 heap space may be available but not in one block. So even if this function
281 says that several times more heap space is available than needed, <ref
282 id="malloc" name="malloc"> may still return <tt/NULL/.
284 <tag/Availability/cc65
286 <ref id="_heapadd" name="_heapadd">,
287 <ref id="_heapmaxavail" name="_heapmaxavail">,
288 <ref id="calloc" name="calloc">,
289 <ref id="free" name="free">,
290 <ref id="malloc" name="malloc">,
291 <ref id="realloc" name="realloc">
297 <sect1>_randomize<label id="_randomize"><p>
301 <tag/Function/Initialize the pseudo random number generator.
302 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
303 <tag/Declaration/<tt/void _randomize (void);/
304 <tag/Description/The function initializes the random number generator with
305 a seed derived from fast changing hardware events, so the seed itself can be
306 considered random to a certain degree.
307 <tag/Limits/<itemize>
308 <item>The randomness of the seed depends on the machine hardware.
310 <tag/Availability/cc65
312 <ref id="rand" name="rand">,
313 <ref id="srand" name="srand">
319 <sect1>_sys<label id="_sys"><p>
323 <tag/Function/Call a subroutine passing register values.
324 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
325 <tag/Declaration/<tt/void __fastcall__ _sys (struct regs* r);/
326 <tag/Description/The function will call the subroutine at the address
327 specified in the <tt/pc/ member of the passed <tt/regs/ structure. All
328 registers and the CPU flags are set to the values given in the <tt/regs/
329 structure. On return from the subroutine, the new values of the registers and
330 flags are stored back overwriting the old values.
331 <tag/Limits/<itemize>
332 <item>Bits 4 and 5 of the flags value in the <tt/regs/ structure are ignored
333 when calling the subroutine (they are unchanged from their current values).
334 <item>The function is only available as fastcall function, so it may only be
335 used in presence of a prototype.
337 <tag/Availability/cc65
343 <sect1>BRK<label id="BRK"><p>
347 <tag/Function/Insert a 6502 BRK instrunction into the code.
348 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
349 <tag/Declaration/<tt/void BRK (void);/
350 <tag/Description/The function will insert a 6502 BRK instruction into the code
351 which may be used to trigger a debugger.
352 <tag/Limits/<itemize>
353 <item>The function is actually a macro.
354 <item>The inserted instruction may lead to unexpected results if no debugger
357 <tag/Availability/cc65
359 <ref id="CLI" name="CLI">,
360 <ref id="SEI" name="SEI">
366 <sect1>CLI<label id="CLI"><p>
370 <tag/Function/Insert a 6502 CLI instrunction into the code.
371 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
372 <tag/Declaration/<tt/void CLI (void);/
373 <tag/Description/The function will insert a 6502 CLI instruction into the code,
374 so interrupts are disabled. Note that non maskable interrupts cannot be
376 <tag/Limits/<itemize>
377 <item>The function is actually a macro.
378 <item>Disabling interrupts may lead to unexpected results.
380 <tag/Availability/cc65
382 <ref id="BRK" name="BRK">,
383 <ref id="SEI" name="SEI">
389 <sect1>SEI<label id="SEI"><p>
393 <tag/Function/Insert a 6502 SEI instrunction into the code.
394 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
395 <tag/Declaration/<tt/void SEI (void);/
396 <tag/Description/The function will insert a 6502 SEI instruction into the code,
397 so interrupts are enabled. Enabling interrupts has no effects if they are
398 already enabled (the default).
399 <tag/Limits/<itemize>
400 <item>The function is actually a macro.
402 <tag/Availability/cc65
404 <ref id="BRK" name="BRK">,
405 <ref id="CLI" name="CLI">
411 <sect1>abort<label id="abort"><p>
415 <tag/Function/Terminates a program abnormally.
416 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
417 <tag/Declaration/<tt/void abort (void);/
418 <tag/Description/<tt/abort/ writes a termination message on stderr, then
419 terminates the program with an exit code of 3.
420 <tag/Availability/ISO 9899
422 <ref id="assert" name="assert">,
423 <ref id="exit" name="exit">
429 <sect1>abs<label id="abs"><p>
433 <tag/Function/Returns the absolute value of an integer.
434 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
435 <tag/Declaration/<tt/int __fastcall__ abs (int v);/
436 <tag/Description/<tt/abs/ returns the absolute value of the argument passed to
438 <tag/Limits/<itemize>
439 <item>The return value is undefined if <tt/INT_MIN/ is passed to the function.
440 <item>The function is only available as fastcall function, so it may only be
441 used in presence of a prototype.
443 <tag/Availability/ISO 9899
445 <ref id="labs" name="labs">
451 <sect1>assert<label id="assert"><p>
455 <tag/Function/Test a condition and possibly abort.
456 <tag/Header/<tt/<ref id="assert.h" name="assert.h">/
457 <tag/Declaration/<tt/void assert (int cond);/
458 <tag/Description/<tt/assert/ is a macro that expands to a <tt/id/
459 statement. If the condition evaluates t zero (false), assert prints a message
460 on stderr and aborts the program.
461 <tag/Limits/<itemize>
462 <item>The function is actually a macro.
464 <tag/Availability/ISO 9899
466 <ref id="abort" name="abort">,
467 <ref id="exit" name="exit">
473 <sect1>atexit<label id="atexit"><p>
477 <tag/Function/Register an exit function.
478 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
479 <tag/Declaration/<tt/int __fastcall__ atexit (void (*exitfunc) (void));/
480 <tag/Description/<tt/atexit/ registers the function pointed to by
481 <tt/exitfunc/ as an exit function. Exit functions are called when the program
482 terminates, they are called in LIFO order (the last function registered is
483 called first). <tt/atexit/ returns zero on success and a nonzero value on
485 <tag/Limits/<itemize>
486 <item>A maximum of 5 exit functions can be registered.
487 <item>There is no way to unregister an exit function.
488 <item>The function is only available as fastcall function, so it may only be
489 used in presence of a prototype.
491 <tag/Availability/ISO 9899
493 <ref id="abort" name="abort">,
494 <ref id="exit" name="exit">
500 <sect1>bgcolor<label id="bgcolor"><p>
504 <tag/Function/Set the background text color.
505 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
506 <tag/Declaration/<tt/unsigned char __fastcall__ bgcolor (unsigned char color);/
507 <tag/Description/The function will set a new background text color. It returns
508 the old (current) background color.
509 <tag/Limits/<itemize>
510 <item>Background colors are system dependent. The function may have no effect
511 on systems where the background color cannot be changed.
512 <item>The function is only available as fastcall function, so it may only be
513 used in presence of a prototype.
515 <tag/Availability/cc65
517 <ref id="bordercolor" name="bordercolor">,
518 <ref id="textcolor" name="textcolor">
524 <sect1>bordercolor<label id="bordercolor"><p>
528 <tag/Function/Set the border (frame) color.
529 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
530 <tag/Declaration/<tt/unsigned char __fastcall__ bordercolor (unsigned char color);/
531 <tag/Description/The function will set a new border color. It returns the old
532 (current) border color.
533 <tag/Limits/<itemize>
534 <item>Border colors are system dependent. The function may have no effect
535 on systems where the border color cannot be changed.
536 <item>The function is only available as fastcall function, so it may only
537 be used in presence of a prototype.
539 <tag/Availability/cc65
541 <ref id="bgcolor" name="bgcolor">,
542 <ref id="textcolor" name="textcolor">
548 <sect1>c64mode<label id="c64mode"><p>
552 <tag/Function/Switch the C128 into C64 compatible mode.
553 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
554 <tag/Declaration/<tt/void c64mode (void);/
555 <tag/Description/The function will cause the machine to reboot into C64 mode.
556 <tag/Limits/<itemize>
557 <item>The function is specific to the C128.
558 <item>The function will not return to the caller.
560 <tag/Availability/C128
566 <sect1>calloc<label id="calloc"><p>
570 <tag/Function/Allocate and clear memory.
571 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
572 <tag/Declaration/<tt/void* __fastcall__ calloc (size_t n, size_t size);/
573 <tag/Description/<tt/calloc/ allocates memory for an array of <tt/n/ elements
574 of size <tt/size/, clears the whole block with binary zeroes and returns a
575 pointer to it. On error (not enough memory available), <tt/calloc/ returns
579 <item>Clearing the memory may not have the expected effect on all platforms:
580 pointers in the block may not be <tt/NULL/ and floating point variables may
581 not be zero (0.0). In other words: The "clearing" effect of this function
582 should be used with care for portable programs.
583 <item>The function is only available as fastcall function, so it may only
584 be used in presence of a prototype.
586 <tag/Availability/ISO 9899
588 <ref id="_heapadd" name="_heapadd">,
589 <ref id="_heapmaxavail" name="_heapmaxavail">,
590 <ref id="_heapmemavail" name="_heapmemavail">,
591 <ref id="free" name="free">,
592 <ref id="malloc" name="malloc">,
593 <ref id="realloc" name="realloc">
599 <sect1>cclear<label id="cclear"><p>
603 <tag/Function/Clear part of a line (write a given amount of spaces).
604 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
605 <tag/Declaration/<tt/void __fastcall__ cclear (unsigned char length);/
606 <tag/Description/The function clears part of a line by writing <tt/length/
607 spaces in the current text color.
608 <tag/Limits/<itemize>
609 <item>The function is only available as fastcall function, so it may
610 only be used in presence of a prototype.
612 <tag/Availability/cc65
614 <ref id="cclearxy" name="cclearxy">,
615 <ref id="clrscr" name="clrscr">
621 <sect1>cclearxy<label id="cclearxy"><p>
625 <tag/Function/Clear part of a line (write a given amount of spaces) starting
626 at a specific screen position.
627 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
628 <tag/Declaration/<tt/void __fastcall__ cclearxy (unsigned char length);/
629 <tag/Description/The function moves the cursor to a specific position, and
630 will then clear part of the line by writing <tt/length/ spaces in the current
632 <tag/Limits/<itemize>
633 <item>The function is only available as fastcall function, so it may
634 only be used in presence of a prototype.
636 <tag/Availability/cc65
638 <ref id="cclear" name="cclear">,
639 <ref id="clrscr" name="clrscr">
645 <sect1>cgetc<label id="cgetc"><p>
649 <tag/Function/Read a character from the keyboard.
650 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
651 <tag/Declaration/<tt/char cgetc (void);/
652 <tag/Description/The function reads a character from the keyboard. If there is
653 no character available, <tt/cgetc/ waits until the user presses a key. If the
654 cursor is enabled by use of the <tt/cursor/ function, a blinking cursor is
655 displayed while waiting.
656 <tag/Limits/<itemize>
657 <item>If the system supports a keyboard buffer, <tt/cgetc/ will fetch a key
658 from this buffer and wait only if the buffer is empty.
660 <tag/Availability/cc65
662 <ref id="cursor" name="cursor">,
663 <ref id="kbhit" name="kbhit">
669 <sect1>chline<label id="chline"><p>
673 <tag/Function/Output a horizontal line in text mode.
674 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
675 <tag/Declaration/<tt/void __fastcall__ chline (unsigned char length);/
676 <tag/Description/The function outputs a horizontal line with the given length
677 starting at the current cursor position.
678 <tag/Limits/<itemize>
679 <item>The character used to draw the horizontal line is system dependent.
680 If available, a line drawing character is used. Drawing a line that is partially
681 off screen leads to undefined behaviour.
682 <item>The function is only available as fastcall function, so it may only be
683 used in presence of a prototype.
685 <tag/Availability/cc65
687 <ref id="chlinexy" name="chlinexy">,
688 <ref id="cvline" name="cvline">,
689 <ref id="cvlinexy" name="cvlinexy">
695 <sect1>chlinexy<label id="chlinexy"><p>
699 <tag/Function/Output a horizontal line at a given position in text mode.
700 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
701 <tag/Declaration/<tt/void __fastcall__ chlinexy (unsigned char x, unsigned char y, unsigned char length);/
702 <tag/Description/The function outputs a horizontal line with the given length
703 starting at a given position.
704 <tag/Limits/<itemize>
705 <item>The character used to draw the horizontal line is system dependent.
706 If available, a line drawing character is used. Drawing a line that is partially
707 off screen leads to undefined behaviour.
708 <item>The function is only available as fastcall function, so it may only be
709 used in presence of a prototype.
711 <tag/Availability/cc65
713 <ref id="chline" name="chline">,
714 <ref id="cvline" name="cvline">,
715 <ref id="cvlinexy" name="cvlinexy">
721 <sect1>clrscr<label id="clrscr"><p>
725 <tag/Function/Clear the text screen.
726 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
727 <tag/Declaration/<tt/void clrscr (void);/
728 <tag/Description/The function clears the text screen and moves the cursor to
729 the upper left corner.
730 <tag/Availability/cc65
732 <ref id="cclear" name="cclear">,
733 <ref id="cclearxy" name="cclearxy">
739 <sect1>cursor<label id="cursor"><p>
743 <tag/Function/Enable/disable a blinking cursor when waiting for keyboard input.
744 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
745 <tag/Declaration/<tt/unsigned char __fastcall__ cursor (unsigned char onoff);/
746 <tag/Description/If the argument to the function is non zero, a blinking cursor
747 will be enabled when the <tt/cgetc/ function waits for input from the keyboard.
748 If the argument is zero, <tt/cgetc/ will wait without a blinking cursor.
749 <tag/Limits/<itemize>
750 <item>The function is only available as fastcall function, so it may only
751 be used in presence of a prototype.
753 <tag/Availability/cc65
755 <ref id="cgetc" name="cgetc">,
756 <ref id="kbhit" name="kbhit">
762 <sect1>cvline<label id="cvline"><p>
766 <tag/Function/Output a vertical line in text mode.
767 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
768 <tag/Declaration/<tt/void __fastcall__ cvline (unsigned char length);/
769 <tag/Description/The function outputs a vertical line with the given length
770 starting at the current cursor position.
771 <tag/Limits/<itemize>
772 <item>The character used to draw the vertical line is system dependent.
773 If available, a line drawing character is used. Drawing a line that is partially
774 off screen leads to undefined behaviour.
775 <item>The function is only available as fastcall function, so it may only be
776 used in presence of a prototype.
778 <tag/Availability/cc65
780 <ref id="chline" name="chline">,
781 <ref id="chlinexy" name="chlinexy">,
782 <ref id="cvlinexy" name="cvlinexy">
788 <sect1>cvlinexy<label id="cvlinexy"><p>
792 <tag/Function/Output a vertical line at a given position in text mode.
793 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
794 <tag/Declaration/<tt/void __fastcall__ cvlinexy (unsigned char x, unsigned char y, unsigned char length);/
795 <tag/Description/The function outputs a vertical line with the given length
796 starting at a given position.
797 <tag/Limits/<itemize>
798 <item>The character used to draw the vertical line is system dependent.
799 If available, a line drawing character is used. Drawing a line that is partially
800 off screen leads to undefined behaviour.
801 <item>The function is only available as fastcall function, so it may only be
802 used in presence of a prototype.
804 <tag/Availability/cc65
806 <ref id="chline" name="chline">,
807 <ref id="chlinexy" name="chlinexy">,
808 <ref id="cvline" name="cvline">
814 <sect1>em_commit<label id="em_commit"><p>
818 <tag/Function/Commit changes into extended memory.
819 <tag/Header/<tt/<ref id="em.h" name="em.h">/
820 <tag/Declaration/<tt/void __fastcall__ em_commit (void);/
821 <tag/Description/Commit changes in the memory window to extended storage. If
822 the contents of the memory window have been changed, these changes may be lost
823 if <tt/<ref id="em_map" name="em_map">/, <tt/<ref id="em_use" name="em_use">/,
824 <tt/<ref id="em_copyfrom" name="em_copyfrom">/ or <tt/<ref id="em_copyto"
825 name="em_copyto">/ are called without calling <tt/em_commit/ first.
826 <tag/Limits/<itemize>
827 <item>Calling <tt/em_commit/ does not necessarily mean that changes to the
828 memory window are discarded, it does just mean that the drivers is allowed
830 <item>The function is only available as fastcall function, so it may only be
831 used in presence of a prototype.
832 <item>The function produces undefined results if no extended memory driver is
835 <tag/Availability/cc65
837 <ref id="em_load_driver" name="em_load_driver">,
838 <ref id="em_map" name="em_map">,
839 <ref id="em_use" name="em_use">
845 <sect1>em_copyfrom<label id="em_copyfrom"><p>
849 <tag/Function/Copy from extended into normal memory.
850 <tag/Header/<tt/<ref id="em.h" name="em.h">/
851 <tag/Declaration/<tt/void __fastcall__ em_copyfrom (const struct em_copy* copy_data);/
852 <tag/Description/Copy data from extended memory into linear memory. Source and
853 target addresses as well as the number of bytes to transfer are specified in
854 the <tt/em_copy/ structure that is passed as a parameter.
855 <tag/Limits/<itemize>
856 <item>Calling <tt/em_copyfrom/ will invalidate the memory window, so if you
857 made any changes to the data in the window, call <tt/<ref id="em_commit"
858 name="em_commit">/ first, or the changes are lost.
859 <item>The function is only available as fastcall function, so it may only be
860 used in presence of a prototype.
861 <item>The function produces undefined results if no extended memory driver is
864 <tag/Availability/cc65
866 <ref id="em_commit" name="em_commit">,
867 <ref id="em_copyto" name="em_copyto">,
868 <ref id="em_load_driver" name="em_load_driver">
874 <sect1>em_copyto<label id="em_copyto"><p>
878 <tag/Function/Copy from normal into extended memory.
879 <tag/Header/<tt/<ref id="em.h" name="em.h">/
880 <tag/Declaration/<tt/void __fastcall__ em_copyto (const struct em_copy* copy_data);/
881 <tag/Description/Copy data from linear into extended memory. Source and
882 target addresses as well as the number of bytes to transfer are specified in
883 the <tt/em_copy/ structure that is passed as a parameter.
884 <tag/Limits/<itemize>
885 <item>Calling <tt/em_copyto/ will invalidate the memory window, so if you
886 made any changes to the data in the window, call <tt/<ref id="em_commit"
887 name="em_commit">/ first, or the changes are lost.
888 <item>The function is only available as fastcall function, so it may only be
889 used in presence of a prototype.
890 <item>The function produces undefined results if no extended memory driver is
893 <tag/Availability/cc65
895 <ref id="em_commit" name="em_commit">,
896 <ref id="em_copyfrom" name="em_copyfrom">,
897 <ref id="em_load_driver" name="em_load_driver">
903 <sect1>em_load_driver<label id="em_load_driver"><p>
907 <tag/Function/Load and initialize an extended memory driver.
908 <tag/Header/<tt/<ref id="em.h" name="em.h">/
909 <tag/Declaration/<tt/void __fastcall__ em_load_driver (const char* name);/
910 <tag/Description/Load an extended memory driver into memory and initialize
911 it. The function returns an error code that tells if all this has been
913 <tag/Limits/<itemize>
914 <item>Not all drivers are able to detect if the supported hardware is really
916 <item>The function is only available as fastcall function, so it may only be
917 used in presence of a prototype.
918 <item>The driver is loaded by name, so currently you must know the type of
919 extended memory that should be supported. There is no autodetect capability.
921 <tag/Availability/cc65
923 <ref id="em_unload" name="em_unload">
929 <sect1>em_map<label id="em_map"><p>
933 <tag/Function/Make a page of extended memory accessible.
934 <tag/Header/<tt/<ref id="em.h" name="em.h">/
935 <tag/Declaration/<tt/void* __fastcall__ em_map (unsigned page);/
936 <tag/Description/The function maps one page of extended memory into linear
937 memory and returns a pointer to the page frame. Depending on the hardware
938 and driver, the data is either mapped into the address space or transfered
939 into a buffer. If you don't need the actual contents of the page (for example
940 because you're going to overwrite it completely, it is better to call
941 <tt/<ref id="em_use" name="em_use">/ instead. <tt/em_use/ will not transfer the
942 data if it is possible to avoid that.
943 <tag/Limits/<itemize>
944 <item>Calling <tt/em_map/ will invalidate the memory window, so if you
945 made any changes to the data in the window, call <tt/<ref id="em_commit"
946 name="em_commit">/ first, or the changes are lost.
947 <item>The function is only available as fastcall function, so it may only be
948 used in presence of a prototype.
949 <item>The function produces undefined results if no extended memory driver is
952 <tag/Availability/cc65
954 <ref id="em_commit" name="em_commit">,
955 <ref id="em_load_driver" name="em_load_driver">,
956 <ref id="em_use" name="em_use">
962 <sect1>em_pagecount<label id="em_pagecount"><p>
966 <tag/Function/Return the number of available extended memory pages.
967 <tag/Header/<tt/<ref id="em.h" name="em.h">/
968 <tag/Declaration/<tt/unsigned __fastcall__ em_pagecount (void);/
969 <tag/Description/The function returns the size of the extended memory supported
970 by the driver in 256 byte pages.
971 <tag/Limits/<itemize>
972 <item>The function returns zero if no extended memory driver is loaded.
973 <item>The function may return zero if the supported hardware was not detected.
975 <tag/Availability/cc65
977 <ref id="em_load_driver" name="em_load_driver">
983 <sect1>em_unload<label id="em_unload"><p>
987 <tag/Function/Unload an extended memory driver.
988 <tag/Header/<tt/<ref id="em.h" name="em.h">/
989 <tag/Declaration/<tt/void __fastcall__ em_unload (void);/
990 <tag/Description/The function unloads a loaded extended memory driver and
991 frees all memory allocated for the driver.
992 <tag/Limits/<itemize>
993 <item>The function does nothing if no driver is loaded.
995 <tag/Availability/cc65
997 <ref id="em_load_driver" name="em_load_driver">
1003 <sect1>em_use<label id="em_use"><p>
1007 <tag/Function/Prepare an extended memory page for use.
1008 <tag/Header/<tt/<ref id="em.h" name="em.h">/
1009 <tag/Declaration/<tt/void* __fastcall__ em_use (unsigned page);/
1010 <tag/Description/The function maps one page of extended memory into linear
1011 memory and returns a pointer to the page frame. This function is similar to
1012 <tt/<ref id="em_map" name="em_map">/, but will not transfer data into the
1013 actual memory window in the assumption that the existing data is wrong or
1014 will get overwritten.
1015 <tag/Limits/<itemize>
1016 <item>Calling <tt/em_use/ will invalidate the memory window, so if you
1017 made any changes to the data in the window, call <tt/<ref id="em_commit"
1018 name="em_commit">/ first, or the changes are lost.
1019 <item>The function is only available as fastcall function, so it may only be
1020 used in presence of a prototype.
1021 <item>The function produces undefined results if no extended memory driver is
1024 <tag/Availability/cc65
1026 <ref id="em_commit" name="em_commit">,
1027 <ref id="em_load_driver" name="em_load_driver">,
1028 <ref id="em_map" name="em_map">
1034 <sect1>exit<label id="exit"><p>
1038 <tag/Function/Terminate the program.
1039 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1040 <tag/Declaration/<tt/void __fastcall__ exit (int status);/
1041 <tag/Description/<tt/exit/ terminates the program. The argument specifies the
1042 return code of the program. Before termination, all files are closed, buffered
1043 output is written and any functions registered with <tt/<ref id="atexit"
1044 name="atexit">/ are called. Common values for status are <tt/EXIT_SUCCESS/ and
1045 <tt/EXIT_FAILURE/ which are also defined in <tt/<ref id="stdlib.h"
1047 <tag/Limits/<itemize>
1048 <item>The function is only available as fastcall function, so it may only
1049 be used in presence of a prototype.
1050 <item>It depends on the host machine if the program return code can be
1051 evaluated or is ignored.
1053 <tag/Availability/ISO 9899
1055 <ref id="abort" name="abort">,
1056 <ref id="exit" name="exit">
1062 <sect1>fast<label id="fast"><p>
1066 <tag/Function/Switch the C128 into 2MHz mode.
1067 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1068 <tag/Declaration/<tt/void fast (void);/
1069 <tag/Description/The function will switch the clock of the C128 to 2MHz. This
1070 will nearly double the speed compared to slow mode.
1071 <tag/Limits/<itemize>
1072 <item>The function is specific to the C128.
1073 <item>2MHz clock will not work in 40 column mode.
1075 <tag/Availability/C128
1077 <ref id="slow" name="slow">,
1078 <ref id="toggle_videomode" name="toggle_videomode">
1084 <sect1>free<label id="free"><p>
1088 <tag/Function/Free a block of dynamic memory.
1089 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1090 <tag/Declaration/<tt/void __fastcall__ free (void* block);/
1091 <tag/Description/Free a block of dynamic memory previously allocated with
1092 <tt/<ref id="malloc" name="malloc">/, <tt/<ref id="calloc" name="calloc">/
1093 or <tt/<ref id="realloc" name="realloc">/. As an exception, if the passed
1094 pointer is <tt/NULL/, no action is performed.
1097 <item>Passing an already free'd block to <tt/free/ again will cause undefined
1098 behaviour and may crash your program.
1099 <item>The function is only available as fastcall function, so it may only
1100 be used in presence of a prototype.
1102 <tag/Availability/ISO 9899
1104 <ref id="_heapadd" name="_heapadd">,
1105 <ref id="_heapmaxavail" name="_heapmaxavail">,
1106 <ref id="_heapmemavail" name="_heapmemavail">,
1107 <ref id="calloc" name="calloc">,
1108 <ref id="malloc" name="malloc">,
1109 <ref id="realloc" name="realloc">
1115 <sect1>getcpu<label id="getcpu"><p>
1119 <tag/Function/Determine on which CPU the program is running.
1120 <tag/Header/<tt/<ref id="6502.h" name="6502.h">/
1121 <tag/Declaration/<tt/unsigned char getcpu (void);/
1122 <tag/Description/The function checks on which CPU the code is running. It
1123 returns one of the constants<itemize>
1125 <item><tt/CPU_65C02/
1126 <item><tt/CPU_65816/
1128 <tag/Limits/<itemize>
1129 <item>Other, more exotic CPU types are not disinguished.
1131 <tag/Availability/cc65
1137 <sect1>gotox<label id="gotox"><p>
1141 <tag/Function/Move the text mode cursor to a new X position.
1142 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1143 <tag/Declaration/<tt/void __fastcall__ gotox (unsigned char x);/
1144 <tag/Description/The function moves the text mode cursor to the specified X
1145 position while leaving the Y position untouched. The leftmost position on the
1146 screen has the coordinate 0.
1147 <tag/Limits/<itemize>
1148 <item>The function is only available as fastcall function, so it may
1149 only be used in presence of a prototype.
1150 <item>Invalid values for the X position (out of screen coordinates) may
1151 lead to undefined behaviour.
1153 <tag/Availability/cc65
1155 <ref id="gotoy" name="gotoy">,
1156 <ref id="gotoxy" name="gotoxy">,
1157 <ref id="wherex" name="wherex">,
1158 <ref id="wherey" name="wherey">
1164 <sect1>gotoxy<label id="gotoxy"><p>
1168 <tag/Function/Move the text mode cursor to a new position.
1169 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1170 <tag/Declaration/<tt/void __fastcall__ gotoxy (unsigned char x, unsigned char y);/
1171 <tag/Description/The function moves the text mode cursor to the specified
1172 position. The leftmost position on the screen has the X coordinate 0, the
1173 topmost line has the Y coordinate 0.
1174 <tag/Limits/<itemize>
1175 <item>The function is only available as fastcall function, so it may only be
1176 used in presence of a prototype.
1177 <item>Invalid values for any of both coordinates (out of screen positions) may
1178 lead to undefined behaviour.
1180 <tag/Availability/cc65
1182 <ref id="gotox" name="gotox">,
1183 <ref id="gotoy" name="gotoy">,
1184 <ref id="wherex" name="wherex">,
1185 <ref id="wherey" name="wherey">
1191 <sect1>gotoy<label id="gotoy"><p>
1195 <tag/Function/Move the text mode cursor to a new Y position.
1196 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1197 <tag/Declaration/<tt/void __fastcall__ gotoy (unsigned char x);/
1198 <tag/Description/The function moves the text mode cursor to the specified Y
1199 position while leaving the X position untouched. The uppermost position on the
1200 screen has the coordinate 0.
1201 <tag/Limits/<itemize>
1202 <item>The function is only available as fastcall function, so it may
1203 only be used in presence of a prototype.
1204 <item>Invalid values for the Y position (out of screen coordinates) may lead
1205 to undefined behaviour.
1207 <tag/Availability/cc65
1209 <ref id="gotox" name="gotox">,
1210 <ref id="gotoxy" name="gotoxy">,
1211 <ref id="wherex" name="wherex">,
1212 <ref id="wherey" name="wherey">
1218 <sect1>isalnum<label id="isalnum"><p>
1222 <tag/Function/Check if a given character is a letter or digit.
1223 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1224 <tag/Declaration/<tt/int __fastcall__ isalnum (int c);/
1225 <tag/Description/The function returns a value of zero if the given argument
1226 is a letter or digit. The return value is non zero if the character
1228 <tag/Limits/<itemize>
1229 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1230 inline sequence generated by the macro will not work correctly for values
1231 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1232 this range. The non inline function may be accessed by <tt/#undef/'ing
1234 <item>When compiling without <tt/-Os/, the function is only available as
1235 fastcall function, so it may only be used in presence of a prototype.
1237 <tag/Availability/ISO 9899
1239 <ref id="isalpha" name="isalpha">,
1240 <ref id="isascii" name="isascii">,
1241 <ref id="isblank" name="isblank">,
1242 <ref id="iscntrl" name="iscntrl">,
1243 <ref id="isdigit" name="isdigit">,
1244 <ref id="isgraph" name="isgraph">,
1245 <ref id="islower" name="islower">,
1246 <ref id="isprint" name="isprint">,
1247 <ref id="ispunct" name="ispunct">,
1248 <ref id="isspace" name="isspace">,
1249 <ref id="isupper" name="isupper">,
1250 <ref id="isxdigit" name="isxdigit">
1256 <sect1>isalpha<label id="isalpha"><p>
1260 <tag/Function/Check if a given character is a letter.
1261 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1262 <tag/Declaration/<tt/int __fastcall__ isalpha (int c);/
1263 <tag/Description/The function returns a value of zero if the given argument
1264 is a letter. The return value is non zero if the character is anything else.
1265 <tag/Limits/<itemize>
1266 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1267 inline sequence generated by the macro will not work correctly for values
1268 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1269 this range. The non inline function may be accessed by <tt/#undef/'ing the
1271 <item>When compiling without <tt/-Os/, the function is only available as
1272 fastcall function, so it may only be used in presence of a prototype.
1274 <tag/Availability/ISO 9899
1276 <ref id="isalnum" name="isalnum">,
1277 <ref id="isascii" name="isascii">,
1278 <ref id="isblank" name="isblank">,
1279 <ref id="iscntrl" name="iscntrl">,
1280 <ref id="isdigit" name="isdigit">,
1281 <ref id="isgraph" name="isgraph">,
1282 <ref id="islower" name="islower">,
1283 <ref id="isprint" name="isprint">,
1284 <ref id="ispunct" name="ispunct">,
1285 <ref id="isspace" name="isspace">,
1286 <ref id="isupper" name="isupper">,
1287 <ref id="isxdigit" name="isxdigit">
1293 <sect1>isascii<label id="isascii"><p>
1297 <tag/Function/Check if a given character is in the ASCII (0..127) range.
1298 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1299 <tag/Declaration/<tt/int __fastcall__ isascii (int c);/
1300 <tag/Description/The function returns a value of zero if the given argument
1301 is in the range 0..127 (the range of valid ASCII characters) and a non zero
1303 <tag/Limits/<itemize>
1304 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1305 inline sequence generated by the macro will not work correctly for values
1306 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1307 this range. The non inline function may be accessed by <tt/#undef/'ing the
1309 <item>When compiling without <tt/-Os/, the function is only available as
1310 fastcall function, so it may only be used in presence of a prototype.
1312 <tag/Availability/ISO 9899
1314 <ref id="isalnum" name="isalnum">,
1315 <ref id="isalpha" name="isalpha">,
1316 <ref id="isblank" name="isblank">,
1317 <ref id="iscntrl" name="iscntrl">,
1318 <ref id="isdigit" name="isdigit">,
1319 <ref id="isgraph" name="isgraph">,
1320 <ref id="islower" name="islower">,
1321 <ref id="isprint" name="isprint">,
1322 <ref id="ispunct" name="ispunct">,
1323 <ref id="isspace" name="isspace">,
1324 <ref id="isupper" name="isupper">,
1325 <ref id="isxdigit" name="isxdigit">
1331 <sect1>isblank<label id="isblank"><p>
1335 <tag/Function/Check if a given character is a space or tab.
1336 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1337 <tag/Declaration/<tt/int __fastcall__ isblank (int c);/
1338 <tag/Description/The function returns a value of zero if the given argument
1339 is a blank or space character. The return value is non zero if the character
1341 <tag/Limits/<itemize>
1342 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1343 inline sequence generated by the macro will not work correctly for values
1344 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1345 this range. The non inline function may be accessed by <tt/#undef/'ing the
1347 <item>When compiling without <tt/-Os/, the function is only available as
1348 fastcall function, so it may only be used in presence of a prototype.
1350 <tag/Availability/cc65
1352 <ref id="isalnum" name="isalnum">,
1353 <ref id="isalpha" name="isalpha">,
1354 <ref id="isascii" name="isascii">,
1355 <ref id="iscntrl" name="iscntrl">,
1356 <ref id="isdigit" name="isdigit">,
1357 <ref id="isgraph" name="isgraph">,
1358 <ref id="islower" name="islower">,
1359 <ref id="isprint" name="isprint">,
1360 <ref id="ispunct" name="ispunct">,
1361 <ref id="isspace" name="isspace">,
1362 <ref id="isupper" name="isupper">,
1363 <ref id="isxdigit" name="isxdigit">
1369 <sect1>iscntrl<label id="iscntrl"><p>
1373 <tag/Function/Check if a given character is a control character.
1374 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1375 <tag/Declaration/<tt/int __fastcall__ iscntrl (int c);/
1376 <tag/Description/The function returns a value of zero if the given argument
1377 is a control character. The return value is non zero if the character
1379 <tag/Limits/<itemize>
1380 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1381 inline sequence generated by the macro will not work correctly for values
1382 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1383 this range. The non inline function may be accessed by <tt/#undef/'ing the
1385 <item>When compiling without <tt/-Os/, the function is only available as
1386 fastcall function, so it may only be used in presence of a prototype.
1388 <tag/Availability/ISO 9899
1390 <ref id="isalnum" name="isalnum">,
1391 <ref id="isalpha" name="isalpha">,
1392 <ref id="isascii" name="isascii">,
1393 <ref id="isblank" name="isblank">,
1394 <ref id="isdigit" name="isdigit">,
1395 <ref id="isgraph" name="isgraph">,
1396 <ref id="islower" name="islower">,
1397 <ref id="isprint" name="isprint">,
1398 <ref id="ispunct" name="ispunct">,
1399 <ref id="isspace" name="isspace">,
1400 <ref id="isupper" name="isupper">,
1401 <ref id="isxdigit" name="isxdigit">
1407 <sect1>isdigit<label id="isdigit"><p>
1411 <tag/Function/Check if a given character is a digit.
1412 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1413 <tag/Declaration/<tt/int __fastcall__ isdigit (int c);/
1414 <tag/Description/The function returns a value of zero if the given argument
1415 is a digit. The return value is non zero if the character is anything else.
1416 <tag/Limits/<itemize>
1417 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1418 inline sequence generated by the macro will not work correctly for values
1419 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1420 this range. The non inline function may be accessed by <tt/#undef/'ing the
1422 <item>When compiling without <tt/-Os/, the function is only available as
1423 fastcall function, so it may only be used in presence of a prototype.
1425 <tag/Availability/ISO 9899
1427 <ref id="isalnum" name="isalnum">,
1428 <ref id="isalpha" name="isalpha">,
1429 <ref id="isascii" name="isascii">,
1430 <ref id="isblank" name="isblank">,
1431 <ref id="iscntrl" name="iscntrl">,
1432 <ref id="isgraph" name="isgraph">,
1433 <ref id="islower" name="islower">,
1434 <ref id="isprint" name="isprint">,
1435 <ref id="ispunct" name="ispunct">,
1436 <ref id="isspace" name="isspace">,
1437 <ref id="isupper" name="isupper">,
1438 <ref id="isxdigit" name="isxdigit">
1444 <sect1>isgraph<label id="isgraph"><p>
1448 <tag/Function/Check if a given character is a printable character (except
1450 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1451 <tag/Declaration/<tt/int __fastcall__ isgraph (int c);/
1452 <tag/Description/The function returns a value of zero if the given argument
1453 is a printable character with the exception of space. The return value is non
1454 zero if the character is anything else.
1455 <tag/Limits/<itemize>
1456 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1457 inline sequence generated by the macro will not work correctly for values
1458 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1459 this range. The non inline function may be accessed by <tt/#undef/'ing the
1461 <item>When compiling without <tt/-Os/, the function is only available as
1462 fastcall function, so it may only be used in presence of a prototype.
1464 <tag/Availability/ISO 9899
1466 <ref id="isalnum" name="isalnum">,
1467 <ref id="isalpha" name="isalpha">,
1468 <ref id="isascii" name="isascii">,
1469 <ref id="isblank" name="isblank">,
1470 <ref id="iscntrl" name="iscntrl">,
1471 <ref id="isdigit" name="isdigit">,
1472 <ref id="islower" name="islower">,
1473 <ref id="isprint" name="isprint">,
1474 <ref id="ispunct" name="ispunct">,
1475 <ref id="isspace" name="isspace">,
1476 <ref id="isupper" name="isupper">,
1477 <ref id="isxdigit" name="isxdigit">
1483 <sect1>islower<label id="islower"><p>
1487 <tag/Function/Check if a given character is a lower case letter.
1488 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1489 <tag/Declaration/<tt/int __fastcall__ islower (int c);/
1490 <tag/Description/The function returns a value of zero if the given argument
1491 is a lower case letter. The return value is non zero if the character is
1493 <tag/Limits/<itemize>
1494 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1495 inline sequence generated by the macro will not work correctly for values
1496 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1497 this range. The non inline function may be accessed by <tt/#undef/'ing the
1499 <item>When compiling without <tt/-Os/, the function is only available as
1500 fastcall function, so it may only be used in presence of a prototype.
1502 <tag/Availability/ISO 9899
1504 <ref id="isalnum" name="isalnum">,
1505 <ref id="isalpha" name="isalpha">,
1506 <ref id="isascii" name="isascii">,
1507 <ref id="isblank" name="isblank">,
1508 <ref id="iscntrl" name="iscntrl">,
1509 <ref id="isdigit" name="isdigit">,
1510 <ref id="isgraph" name="isgraph">,
1511 <ref id="isprint" name="isprint">,
1512 <ref id="ispunct" name="ispunct">,
1513 <ref id="isspace" name="isspace">,
1514 <ref id="isupper" name="isupper">,
1515 <ref id="isxdigit" name="isxdigit">
1521 <sect1>isprint<label id="isprint"><p>
1525 <tag/Function/Check if a given character is a printable character.
1526 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1527 <tag/Declaration/<tt/int __fastcall__ isprint (int c);/
1528 <tag/Description/The function returns a value of zero if the given argument
1529 is a printable character (this includes the space character). The return value
1530 is non zero if the character is anything else.
1531 <tag/Limits/<itemize>
1532 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1533 inline sequence generated by the macro will not work correctly for values
1534 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1535 this range. The non inline function may be accessed by <tt/#undef/'ing the
1537 <item>When compiling without <tt/-Os/, the function is only available as
1538 fastcall function, so it may only be used in presence of a prototype.
1540 <tag/Availability/ISO 9899
1542 <ref id="isalnum" name="isalnum">,
1543 <ref id="isalpha" name="isalpha">,
1544 <ref id="isascii" name="isascii">,
1545 <ref id="isblank" name="isblank">,
1546 <ref id="iscntrl" name="iscntrl">,
1547 <ref id="isdigit" name="isdigit">,
1548 <ref id="isgraph" name="isgraph">,
1549 <ref id="islower" name="islower">,
1550 <ref id="ispunct" name="ispunct">,
1551 <ref id="isspace" name="isspace">,
1552 <ref id="isupper" name="isupper">,
1553 <ref id="isxdigit" name="isxdigit">
1559 <sect1>ispunct<label id="ispunct"><p>
1563 <tag/Function/Check if a given character is a printable character but not a
1564 space or an alphanumeric character.
1565 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1566 <tag/Declaration/<tt/int __fastcall__ ispunct (int c);/
1567 <tag/Description/The function returns a value of zero if the given argument
1568 is a printable character, but not a space or anything alphanumeric. The return
1569 value is non zero if the character is anything else.
1570 <tag/Limits/<itemize>
1571 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1572 inline sequence generated by the macro will not work correctly for values
1573 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1574 this range. The non inline function may be accessed by <tt/#undef/'ing the
1576 <item>When compiling without <tt/-Os/, the function is only available as
1577 fastcall function, so it may only be used in presence of a prototype.
1579 <tag/Availability/ISO 9899
1581 <ref id="isalnum" name="isalnum">,
1582 <ref id="isalpha" name="isalpha">,
1583 <ref id="isascii" name="isascii">,
1584 <ref id="isblank" name="isblank">,
1585 <ref id="iscntrl" name="iscntrl">,
1586 <ref id="isdigit" name="isdigit">,
1587 <ref id="isgraph" name="isgraph">,
1588 <ref id="islower" name="islower">,
1589 <ref id="isprint" name="isprint">,
1590 <ref id="isspace" name="isspace">,
1591 <ref id="isupper" name="isupper">,
1592 <ref id="isxdigit" name="isxdigit">
1598 <sect1>isspace<label id="isspace"><p>
1602 <tag/Function/Check if a given character is a a white-space character.
1603 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1604 <tag/Declaration/<tt/int __fastcall__ isspace (int c);/
1605 <tag/Description/The function returns a value of zero if the given argument
1606 is a white space character. The return value is non zero if the character is
1607 anything else. The standard white space characters are: space, formfeed ('\f'),
1608 newline ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab
1610 <tag/Limits/<itemize>
1611 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1612 inline sequence generated by the macro will not work correctly for values
1613 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1614 this range. The non inline function may be accessed by <tt/#undef/'ing the
1616 <item>When compiling without <tt/-Os/, the function is only available as
1617 fastcall function, so it may only be used in presence of a prototype.
1619 <tag/Availability/ISO 9899
1621 <ref id="isalnum" name="isalnum">,
1622 <ref id="isalpha" name="isalpha">,
1623 <ref id="isascii" name="isascii">,
1624 <ref id="isblank" name="isblank">,
1625 <ref id="iscntrl" name="iscntrl">,
1626 <ref id="isdigit" name="isdigit">,
1627 <ref id="isgraph" name="isgraph">,
1628 <ref id="islower" name="islower">,
1629 <ref id="isprint" name="isprint">,
1630 <ref id="ispunct" name="ispunct">,
1631 <ref id="isupper" name="isupper">,
1632 <ref id="isxdigit" name="isxdigit">
1638 <sect1>isupper<label id="isupper"><p>
1642 <tag/Function/Check if a given character is an upper case letter.
1643 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1644 <tag/Declaration/<tt/int __fastcall__ isupper (int c);/
1645 <tag/Description/The function returns a value of zero if the given argument
1646 is an upper case letter. The return value is non zero if the character is
1648 <tag/Limits/<itemize>
1649 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1650 inline sequence generated by the macro will not work correctly for values
1651 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1652 this range. The non inline function may be accessed by <tt/#undef/'ing the
1654 <item>When compiling without <tt/-Os/, the function is only available as
1655 fastcall function, so it may only be used in presence of a prototype.
1657 <tag/Availability/ISO 9899
1659 <ref id="isalnum" name="isalnum">,
1660 <ref id="isalpha" name="isalpha">,
1661 <ref id="isascii" name="isascii">,
1662 <ref id="isblank" name="isblank">,
1663 <ref id="iscntrl" name="iscntrl">,
1664 <ref id="isdigit" name="isdigit">,
1665 <ref id="isgraph" name="isgraph">,
1666 <ref id="islower" name="islower">,
1667 <ref id="isprint" name="isprint">,
1668 <ref id="ispunct" name="ispunct">,
1669 <ref id="isspace" name="isspace">,
1670 <ref id="isxdigit" name="isxdigit">
1676 <sect1>isxdigit<label id="isxdigit"><p>
1680 <tag/Function/Check if a given character is a hexadecimal digit.
1681 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
1682 <tag/Declaration/<tt/int __fastcall__ isxdigit (int c);/
1683 <tag/Description/The function returns a value of zero if the given argument
1684 is a hexadecimal digit (0..9, a..f and A..F). The return value is non zero
1685 if the character is anything else.
1686 <tag/Limits/<itemize>
1687 <item>When compiling with <tt/-Os/ the function is actually a macro. The
1688 inline sequence generated by the macro will not work correctly for values
1689 outside the range 0..255. <bf/Note:/ The constant <tt/EOF/ is not part of
1690 this range. The non inline function may be accessed by <tt/#undef/'ing the
1692 <item>When compiling without <tt/-Os/, the function is only available as
1693 fastcall function, so it may only be used in presence of a prototype.
1695 <tag/Availability/ISO 9899
1697 <ref id="isalnum" name="isalnum">,
1698 <ref id="isalpha" name="isalpha">,
1699 <ref id="isascii" name="isascii">,
1700 <ref id="isblank" name="isblank">,
1701 <ref id="iscntrl" name="iscntrl">,
1702 <ref id="isdigit" name="isdigit">,
1703 <ref id="isgraph" name="isgraph">,
1704 <ref id="islower" name="islower">,
1705 <ref id="isprint" name="isprint">,
1706 <ref id="ispunct" name="ispunct">,
1707 <ref id="isspace" name="isspace">,
1708 <ref id="isupper" name="isupper">
1714 <sect1>kbhit<label id="kbhit"><p>
1718 <tag/Function/Check if there's a key waiting in the keyboard buffer.
1719 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1720 <tag/Declaration/<tt/unsigned char kbhit (void);/
1721 <tag/Description/The function returns a value of zero if there is no character
1722 waiting to be read from the keyboard. It returns non zero otherwise.
1723 <tag/Limits/<itemize>
1724 <item>If the system does not support a keyboard buffer (most systems
1725 do), the function is rather useless.
1727 <tag/Availability/cc65
1729 <ref id="cgetc" name="cgetc">,
1730 <ref id="cursor" name="cursor">
1736 <sect1>labs<label id="labs"><p>
1740 <tag/Function/Returns the absolute value of a long integer.
1741 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1742 <tag/Declaration/<tt/long __fastcall__ labs (long v);/
1743 <tag/Description/<tt/labs/ returns the absolute value of the argument passed to
1745 <tag/Limits/<itemize>
1746 <item>The return value is undefined if <tt/LONG_MIN/ is passed to the function.
1747 <item>The function is only available as fastcall function, so it may only be
1748 used in presence of a prototype.
1750 <tag/Availability/ISO 9899
1752 <ref id="abs" name="abs">
1758 <sect1>malloc<label id="malloc"><p>
1762 <tag/Function/Allocate dynamic memory.
1763 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1764 <tag/Declaration/<tt/void* __fastcall__ malloc (size_t size);/
1765 <tag/Description/<tt/malloc/ allocates size bytes on the heap and returns a
1766 pointer to the allocated memory block. On error (not enough memory available),
1767 <tt/malloc/ returns <tt/NULL/.
1770 <item>The function is only available as fastcall function, so it may only
1771 be used in presence of a prototype.
1773 <tag/Availability/ISO 9899
1775 <ref id="_heapadd" name="_heapadd">,
1776 <ref id="_heapmaxavail" name="_heapmaxavail">,
1777 <ref id="_heapmemavail" name="_heapmemavail">,
1778 <ref id="calloc" name="calloc">,
1779 <ref id="free" name="free">,
1780 <ref id="realloc" name="realloc">
1786 <sect1>rand<label id="rand"><p>
1790 <tag/Function/Return a pseudo random number.
1791 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1792 <tag/Declaration/<tt/int rand (void);/
1793 <tag/Description/The function returns a pseudo random number
1794 between 0 and <tt/RAND_MAX/ (exclusive).
1795 <tag/Limits/<itemize>
1796 <item>Without using <tt><ref id="srand" name="srand"></tt>, always the same
1797 flow of numbers is generated.
1798 <item>On startup, the function behaves as if <ref id="srand" name="srand">
1799 had been used with an argument of 1.
1801 <tag/Availability/ISO 9899
1803 <ref id="_randomize" name="_randomize">,
1804 <ref id="srand" name="srand">
1810 <sect1>realloc<label id="realloc"><p>
1814 <tag/Function/Change the size of an allocated memory block.
1815 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1816 <tag/Declaration/<tt/void* __fastcall__ realloc (void* block, size_t size);/
1817 <tag/Description/<tt/realloc/ changes the size of the memory block pointed to
1818 by <tt/block/ to <tt/size/ bytes. If <tt/block/ is <tt/NULL/, <tt/realloc/
1819 behaves as if <tt/malloc/ had been called. If <tt/size/ is zero, <tt/realloc/
1820 behaves as if <tt/free/ had been called. On error (not enough memory
1821 available), <tt/realloc/ returns <tt/NULL/.
1824 <item>The part of the memory block that is returned will have its contents
1826 <item>This function is somewhat dangerous to use. Be careful to save the
1827 pointer you're passing somewhere else, otherwise
1829 ptr = realloc (ptr, size);
1831 will loose your only copy of <tt/ptr/ if <tt/realloc/ returns <tt/NULL/.
1832 <item>The function is only available as fastcall function, so it may only
1833 be used in presence of a prototype.
1835 <tag/Availability/ISO 9899
1837 <ref id="_heapadd" name="_heapadd">,
1838 <ref id="_heapmaxavail" name="_heapmaxavail">,
1839 <ref id="_heapmemavail" name="_heapmemavail">,
1840 <ref id="calloc" name="calloc">,
1841 <ref id="free" name="free">,
1842 <ref id="realloc" name="realloc">
1848 <sect1>revers<label id="revers"><p>
1852 <tag/Function/Control revers character display.
1853 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1854 <tag/Declaration/<tt/unsigned char __fastcall__ revers (unsigned char onoff);/
1855 <tag/Description/If the argument is non zero, the function enables reverse
1856 character display. If the argument is zero, reverse character display is
1857 switched off. The old value of the setting is returned.
1858 <tag/Limits/<itemize>
1859 <item>The function may not be supported by the hardware, in which case
1860 the call is ignored.
1861 <item>The function is only available as fastcall function, so it may only
1862 be used in presence of a prototype.
1864 <tag/Availability/cc65
1866 <ref id="textcolor" name="textcolor">
1872 <sect1>screensize<label id="screensize"><p>
1876 <tag/Function/Return the dimensions of the text mode screen.
1877 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
1878 <tag/Declaration/<tt/void __fastcall__ screensize (unsigned char* x, unsigned char* y);/
1879 <tag/Description/The function returns the dimensions of the text mode screen.
1880 <tag/Limits/<itemize>
1881 <item>The function is only available as fastcall function, so it may only
1882 be used in presence of a prototype.
1884 <tag/Availability/cc65
1886 <ref id="gotox" name="gotox">,
1887 <ref id="gotoxy" name="gotoxy">,
1888 <ref id="gotoy" name="gotoy">,
1889 <ref id="wherex" name="wherex">,
1890 <ref id="wherey" name="wherey">
1896 <sect1>slow<label id="slow"><p>
1900 <tag/Function/Switch the C128 into 1MHz mode.
1901 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
1902 <tag/Declaration/<tt/void slow (void);/
1903 <tag/Description/The function will switch the clock of the C128 to 1MHz. This
1904 will halve the speed compared to fast mode.
1905 <tag/Limits/<itemize>
1906 <item>The function is specific to the C128.
1908 <tag/Availability/C128
1910 <ref id="fast" name="fast">,
1911 <ref id="toggle_videomode" name="toggle_videomode">
1917 <sect1>srand<label id="srand"><p>
1921 <tag/Function/Initialize the pseudo random number generator.
1922 <tag/Header/<tt/<ref id="stdlib.h" name="stdlib.h">/
1923 <tag/Declaration/<tt/void __fastcall__ srand (unsigned seed);/
1924 <tag/Description/The function initializes the random number generator using
1925 the given seed. On program startup, the generator behaves as if <tt/srand/ has
1926 been called with an argument of 1.
1927 <tag/Limits/<itemize>
1928 <item>The function is only available as fastcall function, so it may only
1929 be used in presence of a prototype.
1931 <tag/Availability/ISO 9899
1933 <ref id="_randomize" name="_randomize">,
1934 <ref id="rand" name="rand">
1940 <sect1>strcat<label id="strcat"><p>
1944 <tag/Function/Concatentate two strings.
1945 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1946 <tag/Declaration/<tt/char* __fastcall__ strcat (char* s1, const char* s2);/
1947 <tag/Description/The <tt/strcat/ function appends a copy of the string
1948 pointed to by s2 (including the terminating null byte) to the end of the
1949 string pointed to by s1. The initial byte of s2 overwrites the null byte at
1951 <tag/Limits/<itemize>
1952 <item>The function is only available as fastcall function, so it may only
1953 be used in presence of a prototype.
1954 <item>If copying takes place between objects that overlap, the behavior
1957 <tag/Availability/ISO 9899
1959 <ref id="strcpy" name="strcpy">
1960 <ref id="strncpy" name="strncpy">
1966 <sect1>strchr<label id="strchr"><p>
1970 <tag/Function/Search for a character in a string.
1971 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1972 <tag/Declaration/<tt/char* __fastcall__ strchr (const char* s, int c);/
1973 <tag/Description/The <tt/strchr/ function locates the first occurrence of <tt/c/
1974 (converted to a char) in the string pointed to by <tt/s/. The terminating null
1975 byte is considered to be part of the string. Upon completion, the function
1976 returns a pointer to the byte, or a null pointer if the byte was not found.
1977 <tag/Limits/<itemize>
1978 <item>The function is only available as fastcall function, so it may only
1979 be used in presence of a prototype.
1981 <tag/Availability/ISO 9899
1983 <ref id="strrchr" name="strrchr">
1989 <sect1>strcpy<label id="strcpy"><p>
1993 <tag/Function/Copy a string.
1994 <tag/Header/<tt/<ref id="string.h" name="string.h">/
1995 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2);/
1996 <tag/Description/The <tt/strcpy/ function copies the string pointed to by
1997 <tt/s2/ (including the terminating null byte) into the array pointed to by
1998 <tt/s1/. The function will always return <tt/s1/.
1999 <tag/Limits/<itemize>
2000 <item>The function is only available as fastcall function, so it may only
2001 be used in presence of a prototype.
2002 <item>If copying takes place between objects that overlap, the behavior
2005 <tag/Availability/ISO 9899
2007 <ref id="strcat" name="strcat">
2008 <ref id="strncpy" name="strncpy">
2013 static char hello[14];
2015 strcpy (hello, "Hello world!\n");
2021 <sect1>strlen<label id="strlen"><p>
2025 <tag/Function/Return the length of a string.
2026 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2027 <tag/Declaration/<tt/size_t __fastcall__ strlen (const char* s);/
2028 <tag/Description/The <tt/strlen/ function computes the number of bytes in the
2029 string to which s points, not including the terminating null byte.
2030 <tag/Limits/<itemize>
2031 <item>The function is only available as fastcall function, so it may only
2032 be used in presence of a prototype.
2033 <item>When compiling with <tt/-Os/ (inline known standard functions), the
2034 function does not work correctly for strings with more than 255 characters.
2036 <tag/Availability/ISO 9899
2038 <ref id="strcpy" name="strcpy">
2044 <sect1>strlower<label id="strlower"><p>
2048 <tag/Function/Make a string lower case.
2049 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2050 <tag/Declaration/<tt/char* __fastcall__ strlower (char* s);/
2051 <tag/Description/The <tt/strlower/ function will apply the <tt/tolower/
2052 function to each character of a string. The function will always return <tt/s/.
2053 <tag/Limits/<itemize>
2054 <item>The function is only available as fastcall function, so it may only
2055 be used in presence of a prototype.
2056 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2057 <item>An alias name for this function is <tt/strlwr/.
2059 <tag/Availability/cc65
2061 <ref id="strupper" name="strupper">
2062 <ref id="tolower" name="tolower">
2068 <sect1>strlwr<label id="strlwr"><p>
2075 <sect1>strncpy<label id="strncpy"><p>
2079 <tag/Function/Copy part of a string.
2080 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2081 <tag/Declaration/<tt/char* __fastcall__ strcpy (char* s1, const char* s2, size_t n);/
2082 <tag/Description/The <tt/strncpy/ function copies not more than n bytes from
2083 the array pointed to by <tt/s2/ to the array pointed to by <tt/s1/. If the array
2084 pointed to by <tt/s2/ is a string that is shorter than n bytes, null bytes are
2085 appended to the copy in the array pointed to by <tt/s1/, until <tt/n/ bytes are
2086 written. The function will always return <tt/s1/.
2087 <tag/Limits/<itemize>
2088 <item>The function is only available as fastcall function, so it may only
2089 be used in presence of a prototype. If there is no null byte in the first <tt/n/
2090 bytes of the array pointed to by <tt/s2/, the result is not null-terminated.
2091 <item>If copying takes place between objects that overlap, the behavior is
2094 <tag/Availability/ISO 9899
2096 <ref id="strcat" name="strcat">
2097 <ref id="strcpy" name="strcpy">
2102 static char hello[6];
2104 strcpy (hello, "Hello world!\n", sizeof (hello) - 1);
2111 <sect1>strrchr<label id="strrchr"><p>
2115 <tag/Function/Search for a character in a string.
2116 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2117 <tag/Declaration/<tt/char* __fastcall__ strrchr (const char* s, int c);/
2118 <tag/Description/The <tt/strrchr/ function locates the last occurrence of <tt/c/
2119 (converted to a char) in the string pointed to by <tt/s/. The terminating null
2120 byte is considered to be part of the string. Upon completion, the function
2121 returns a pointer to the byte, or a null pointer if the byte was not found.
2122 <tag/Limits/<itemize>
2123 <item>The function is only available as fastcall function, so it may only
2124 be used in presence of a prototype.
2126 <tag/Availability/ISO 9899
2128 <ref id="strchr" name="strchr">
2134 <sect1>strupper<label id="strupper"><p>
2138 <tag/Function/Make a string upper case.
2139 <tag/Header/<tt/<ref id="string.h" name="string.h">/
2140 <tag/Declaration/<tt/char* __fastcall__ strupper (char* s);/
2141 <tag/Description/The <tt/strupper/ function will apply the <tt/toupper/
2142 function to each character of a string. The function will always return <tt/s/.
2143 <tag/Limits/<itemize>
2144 <item>The function is only available as fastcall function, so it may only
2145 be used in presence of a prototype.
2146 <item>The function prototype is unavailable when compiling in strict ANSI mode.
2147 <item>An alias name for this function is <tt/strupr/.
2149 <tag/Availability/cc65
2151 <ref id="strlower" name="strlower">
2152 <ref id="toupper" name="toupper">
2158 <sect1>strupr<label id="strupr"><p>
2165 <sect1>textcolor<label id="textcolor"><p>
2169 <tag/Function/Set the text color.
2170 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2171 <tag/Declaration/<tt/unsigned char __fastcall__ textcolor (unsigned char color);/
2172 <tag/Description/The function will set a new text color. It returns the old
2173 (current) text color. Text output using any <tt/conio.h/ function will use
2174 the color set by this function.
2175 <tag/Limits/<itemize>
2176 <item>Text colors are system dependent. The function may have no effect
2177 on systems where the text color cannot be changed.
2178 <item>The function is only available as fastcall function, so it may only
2179 be used in presence of a prototype.
2181 <tag/Availability/cc65
2183 <ref id="bgcolor" name="bgcolor">,
2184 <ref id="bordercolor" name="bordercolor">
2190 <sect1>toggle_videomode<label id="toggle_videomode"><p>
2194 <tag/Function/Toggle between 40 and 80 column mode.
2195 <tag/Header/<tt/<ref id="c128.h" name="c128.h">/
2196 <tag/Declaration/<tt/void toggle_videomode (void);/
2197 <tag/Description/Toggle between 40 and 80 column mode. The settings for the
2198 old mode (cursor position, color and so on) are saved and restored together
2200 <tag/Limits/<itemize>
2201 <item>The function is specific to the C128.
2203 <tag/Availability/C128
2205 <ref id="fast" name="fast">,
2206 <ref id="slow" name="slow">
2212 <sect1>tolower<label id="tolower"><p>
2216 <tag/Function/Convert a character into its lower case representation.
2217 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2218 <tag/Declaration/<tt/int __fastcall__ tolower (int c);/
2219 <tag/Description/The function returns the given character converted to lower
2220 case. If the given character is not a letter, it is returned unchanged.
2221 <tag/Limits/<itemize>
2222 <item>The function is only available as fastcall function, so it may
2223 only be used in presence of a prototype.
2225 <tag/Availability/ISO 9899
2227 <ref id="islower" name="islower">,
2228 <ref id="isupper" name="isupper">,
2229 <ref id="toupper" name="toupper">
2235 <sect1>toupper<label id="toupper"><p>
2239 <tag/Function/Convert a character into its upper case representation.
2240 <tag/Header/<tt/<ref id="ctype.h" name="ctype.h">/
2241 <tag/Declaration/<tt/int __fastcall__ toupper (int c);/
2242 <tag/Description/The function returns the given character converted to upper
2243 case. If the given character is not a letter, it is returned unchanged.
2244 <tag/Limits/<itemize>
2245 <item>The function is only available as fastcall function, so it may
2246 only be used in presence of a prototype.
2248 <tag/Availability/ISO 9899
2250 <ref id="islower" name="islower">,
2251 <ref id="isupper" name="isupper">,
2252 <ref id="tolower" name="tolower">
2258 <sect1>wherex<label id="wherex"><p>
2262 <tag/Function/Return the current X position of the text mode cursor.
2263 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2264 <tag/Declaration/<tt/unsigned char wherex (void);/
2265 <tag/Description/The function returns the current X position of the text mode
2266 cursor. Zero is returned for the leftmost screen position.
2267 <tag/Availability/cc65
2269 <ref id="gotox" name="gotox">,
2270 <ref id="gotoy" name="gotoy">,
2271 <ref id="gotoxy" name="gotoxy">,
2272 <ref id="wherey" name="wherey">
2278 <sect1>wherey<label id="wherey"><p>
2282 <tag/Function/Return the current Y position of the text mode cursor.
2283 <tag/Header/<tt/<ref id="conio.h" name="conio.h">/
2284 <tag/Declaration/<tt/unsigned char wherey (void);/
2285 <tag/Description/The function returns the current Y position of the text mode
2286 cursor. Zero is returned for the uppermost screen position.
2287 <tag/Availability/cc65
2289 <ref id="gotox" name="gotox">,
2290 <ref id="gotoy" name="gotoy">,
2291 <ref id="gotoxy" name="gotoxy">,
2292 <ref id="wherex" name="wherex">