Updated the cx16 library to the ROM's prerelease 36.
This commit is contained in:
@@ -46,9 +46,9 @@ file and linker config.
|
||||
<sect>Memory layout<p>
|
||||
|
||||
cc65-generated programs with the default setup run with the I/O area, RAM bank
|
||||
zero, and the Kernal ROM visible. That means that Kernal entry points can be
|
||||
called directly. The usable memory ranges are $0800 - $9EFF and
|
||||
$A000 - $BFFF.
|
||||
one, and the Kernal ROM being visible. That means that Kernal entry points
|
||||
can be called directly. The usable memory ranges are $0800 -
|
||||
$9EFF, $0400 - $07FF, and $A000 - $BFFF.
|
||||
|
||||
Special locations:
|
||||
|
||||
@@ -77,7 +77,7 @@ The ld65 linker comes with a default config. file for the Commander X16, which
|
||||
is used via <tt/-t cx16/. The cx16 package comes with additional secondary
|
||||
linker config. files which are used via <tt/-t cx16 -C <configfile>/.
|
||||
|
||||
Those files use 126 bytes in the zero page. (The rest of page zero is reserved
|
||||
Those files use 94 bytes in the zero page. (The rest of page zero is reserved
|
||||
for Kernal and BASIC.)
|
||||
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ the C functions available in the standard library.
|
||||
|
||||
<sect>Introduction<p>
|
||||
|
||||
cc65 is a C compiler for 6502 based systems. It implements a subset of the ISO
|
||||
cc65 is a C compiler for 6502-based systems. It implements a subset of the ISO
|
||||
C standard plus additional functions specially crafted for 6502 systems or
|
||||
just some of the supported machines. This function refrence describes the
|
||||
just some of the supported machines. This function reference describes the
|
||||
available functions together with any limitations.
|
||||
|
||||
For an overview about the available libraries, their purpose, and any
|
||||
@@ -27,8 +27,8 @@ differences to the ISO standard, please have a look at the <url
|
||||
url="library.html" name="cc65 Library Overview">.
|
||||
|
||||
<em/Note:/ Standard C functions are listed here, but not described in detail.
|
||||
Since these functions behave identical on all standard compliant systems, they
|
||||
are described in any book covering standard C.
|
||||
Because those functions behave identically on all standard-compliant systems,
|
||||
they are described in any book covering standard C.
|
||||
|
||||
Each entry for a function contains a detailed description
|
||||
|
||||
@@ -200,6 +200,7 @@ function.
|
||||
<item><ref id="cbm_k_second" name="cbm_k_second">
|
||||
<item><ref id="cbm_k_setlfs" name="cbm_k_setlfs">
|
||||
<item><ref id="cbm_k_setnam" name="cbm_k_setnam">
|
||||
<item><ref id="cbm_k_settim" name="cbm_k_settim">
|
||||
<item><ref id="cbm_k_talk" name="cbm_k_talk">
|
||||
<item><ref id="cbm_k_tksa" name="cbm_k_tksa">
|
||||
<item><ref id="cbm_k_udtim" name="cbm_k_udtim">
|
||||
@@ -321,6 +322,7 @@ function.
|
||||
<sect1><tt/cx16.h/<label id="cx16.h"><p>
|
||||
|
||||
<itemize>
|
||||
<!-- <item><ref id="get_numbanks" name="get_numbanks"> -->
|
||||
<!-- <item><ref id="get_ostype" name="get_ostype"> -->
|
||||
<!-- <item><ref id="get_tv" name="get_tv"> -->
|
||||
<!-- <item><ref id="set_tv" name="set_tv"> -->
|
||||
@@ -2281,6 +2283,9 @@ only be used in presence of a prototype.
|
||||
</itemize>
|
||||
<tag/Availability/cc65
|
||||
<tag/See also/
|
||||
<ref id="cbm_k_load" name="cbm_k_load">,
|
||||
<ref id="cbm_k_open" name="cbm_k_open">,
|
||||
<ref id="cbm_k_save" name="cbm_k_save">,
|
||||
<ref id="cbm_k_setnam" name="cbm_k_setnam">
|
||||
<tag/Example/None.
|
||||
</descrip>
|
||||
@@ -2302,9 +2307,34 @@ only be used in presence of a prototype.
|
||||
</itemize>
|
||||
<tag/Availability/cc65
|
||||
<tag/See also/
|
||||
<ref id="cbm_k_open" name="cbm_k_open">,
|
||||
<ref id="cbm_k_load" name="cbm_k_load">,
|
||||
<ref id="cbm_k_save" name="cbm_k_save">
|
||||
<ref id="cbm_k_open" name="cbm_k_open">,
|
||||
<ref id="cbm_k_save" name="cbm_k_save">,
|
||||
<ref id="cbm_k_setlfs" name="cbm_k_setlfs">
|
||||
<tag/Example/None.
|
||||
</descrip>
|
||||
</quote>
|
||||
|
||||
|
||||
<sect1>cbm_k_settim<label id="cbm_k_settim"><p>
|
||||
|
||||
<quote>
|
||||
<descrip>
|
||||
<tag/Function/Set the Jiffy clock.
|
||||
<tag/Header/<tt/<ref id="cbm.h" name="cbm.h">/
|
||||
<tag/Declaration/<tt/void __fastcall__ cbm_k_settim (unsigned long timer);/
|
||||
<tag/Description/This function changes the Jiffy clock to a different value.
|
||||
That clock counts sixtieths of a second. It is used by the library's
|
||||
<tt/clock()/ function. The Jiffy clock is updated by the Kernal's Interrupt
|
||||
Service Routine.
|
||||
<tag/Notes/<itemize>
|
||||
<item>The function is available only as a fastcall function; therefore, it may
|
||||
be used only in the presence of a prototype.
|
||||
</itemize>
|
||||
<tag/Availability/cc65
|
||||
<tag/See also/
|
||||
<ref id="cbm_k_udtim" name="cbm_k_udtim">,
|
||||
<ref id="clock" name="clock">
|
||||
<tag/Example/None.
|
||||
</descrip>
|
||||
</quote>
|
||||
@@ -2368,6 +2398,7 @@ then that ISR must call this function, in order to keep the clock valid.
|
||||
<tag/Availability/cc65
|
||||
<tag/See also/
|
||||
<ref id="cbm_k_scnkey" name="cbm_k_scnkey">,
|
||||
<ref id="cbm_k_settim" name="cbm_k_settim">,
|
||||
<ref id="clock" name="clock">
|
||||
<tag/Example/None.
|
||||
</descrip>
|
||||
@@ -2585,6 +2616,7 @@ changing values. (See the description of <tt/cbm_k_udtim()/.)
|
||||
</itemize>
|
||||
<tag/Availability/ISO 9899
|
||||
<tag/See also/
|
||||
<ref id="cbm_k_settim" name="cbm_k_settim">,
|
||||
<ref id="cbm_k_udtim" name="cbm_k_udtim">,
|
||||
<ref id="time" name="time">
|
||||
<tag/Example/None.
|
||||
|
||||
118
doc/library.sgml
118
doc/library.sgml
@@ -18,22 +18,22 @@ including a discussion of the differences to the ISO standard.
|
||||
|
||||
This file contains a short overview of the libraries available for the cc65 C
|
||||
compiler. Please have a look at the <url url="funcref.html" name="function
|
||||
reference"> for a list function by function. Since the function reference is
|
||||
not complete (I'm working on that) it may happen that you don't find a
|
||||
specific function. In this case, have a look into the header files. All
|
||||
functions, that are not defined by the ISO C standard have a short comment in
|
||||
reference"> for a function-by-function list. Because the function reference is
|
||||
not complete (we're working on that), it may happen that you don't find a
|
||||
specific function. In that case, have a look into the header files. All
|
||||
functions, that are not defined by the ISO C standard, have a short comment in
|
||||
the headers, explaining their use.
|
||||
|
||||
|
||||
|
||||
<sect>ISO C compatible library<p>
|
||||
|
||||
The C library contains a large subset of the ISO C library. Functions are
|
||||
usually missing in areas, where there is no support on typical 6502 systems.
|
||||
Wide character sets are an example for this.
|
||||
The C library contains a large subset of the ISO C library. Functions usually
|
||||
are missing in areas where there are no support on typical 6502 systems.
|
||||
Wide-character sets are an example for that.
|
||||
|
||||
I will not go into detail about the ISO functions. If a function is not
|
||||
mentioned here explicitly, expect it to be available and to behave as defined
|
||||
mentioned here explicitly, expect it to be available, and to behave as defined
|
||||
in the C standard.
|
||||
|
||||
Functions that are <em/not/ available:
|
||||
@@ -45,13 +45,13 @@ Functions that are <em/not/ available:
|
||||
<p>
|
||||
<item>All functions that handle floating point numbers in some manner.
|
||||
<p>
|
||||
<item>The <tt/ldiv/ function (cc65 is currently not able to return structs
|
||||
with a size not equal to 1, 2 or 4 bytes by value).
|
||||
<item>The <tt/ldiv/ function (cc65 currently is not able to return structs,
|
||||
by value, with a size not equal to 1, 2, or 4 bytes).
|
||||
<p>
|
||||
<item>All functions handling wide character strings.
|
||||
<item>All functions handling wide-character strings.
|
||||
<p>
|
||||
<item>Signals and all related functions (having <tt/SIGSEGV/ would be
|
||||
cool:-)
|
||||
cool. :-)
|
||||
<p>
|
||||
<item><tt>setbuf/setvbuf</tt>
|
||||
</itemize>
|
||||
@@ -60,7 +60,7 @@ Functions not available on all supported systems:
|
||||
|
||||
<itemize>
|
||||
<item><tt>fopen/fread/fwrite/fclose/fputs/fgets/fscanf</tt>: The functions
|
||||
are built on open/read/write/close. These latter functions are not available
|
||||
are built on open/read/write/close. Those latter functions are not available
|
||||
on all systems.
|
||||
<p>
|
||||
<item><tt>ftell/fseek/fgetpos/fsetpos</tt>: Support depends on the
|
||||
@@ -69,94 +69,95 @@ Functions not available on all supported systems:
|
||||
<item><tt>rename/remove/rewind</tt>: Support depends on the capabilities of
|
||||
the target machine.
|
||||
<p>
|
||||
<item><tt>time</tt>: Since many of the supported systems do not have a real
|
||||
time clock, which means that the <tt/time/ function is not available. Please
|
||||
note that the other functions from <tt/time.h/ <em/are/ available.
|
||||
<item><tt>time</tt>: Many of the supported systems don't have a real-time
|
||||
clock, which means that the <tt/time/ function is not available. Please note
|
||||
that the other functions from <tt/time.h/ <em/are/ available.
|
||||
</itemize>
|
||||
|
||||
|
||||
Functions that are limited in any way:
|
||||
|
||||
<itemize>
|
||||
<item><tt>strcspn/strpbrk/strspn</tt>: These functions have a length
|
||||
limitation of 256 for the second string argument. Since this string gives a
|
||||
character set, and there are only 256 distinct characters, this shouldn't be
|
||||
<item><tt>strcspn/strpbrk/strspn</tt>: Those functions have a length
|
||||
limitation of 256 for the second string argument. Since that string gives a
|
||||
character set, and there are only 256 distinct characters, that shouldn't be
|
||||
a problem.
|
||||
<p>
|
||||
<item><tt>getenv</tt>: Since there is no such thing as an environment on all
|
||||
supported systems, the <tt/getenv/ function will always return a <tt/NULL/
|
||||
supported systems, the <tt/getenv/ function always will return a <tt/NULL/
|
||||
pointer.
|
||||
<p>
|
||||
<item><tt>locale</tt>: There is no other locale than the "C" locale. The
|
||||
<item><tt>locale</tt>: There is no locale other than the "C" locale. The
|
||||
native locale is identical to the "C" locale.
|
||||
</itemize>
|
||||
|
||||
|
||||
In addition to these limitations, some more functions are limited if inlined
|
||||
versions are requested by using -Os:
|
||||
In addition to those limitations, some more functions are limited if inlined
|
||||
versions are requested by using the <tt/-Os/ command-line option:
|
||||
|
||||
<itemize>
|
||||
<item>The <tt/strlen/ function only works for strings with a maximum length
|
||||
<item>The <tt/strlen/ function works for only strings with a maximum length
|
||||
of 255 characters.
|
||||
<p>
|
||||
<item>The <tt/isxxx/ character classification functions from
|
||||
<item>The <tt/isXXX/ character classification functions from
|
||||
<tt/<ctype.h>/ will give unpredictable results if the argument is not
|
||||
in character range (0..255). This limitation may be removed by #undef'ing
|
||||
in character range (0..255). That limitation may be removed by #undef'ing
|
||||
the function name (when using <tt/-Os/, the functions are actually macros
|
||||
that expand to inline assembler code, but the real functions are still
|
||||
that expand to inline assembly code, but the real functions still are
|
||||
available if the macro definition is removed).
|
||||
</itemize>
|
||||
|
||||
|
||||
|
||||
<sect>CPU specific stuff - 6502.h<p>
|
||||
<sect>CPU-specific stuff - 6502.h<p>
|
||||
|
||||
The header file 6502.h contains some functions that make only sense with the
|
||||
The header file 6502.h contains some functions that make sense only with the
|
||||
6502 CPU. Examples are macros to insert more or less useful instructions into
|
||||
your C code, or a function to call arbitrary machine language subroutines,
|
||||
passing registers in and out.
|
||||
|
||||
|
||||
|
||||
<sect>Target specific stuff<p>
|
||||
<sect>Target-specific stuff<p>
|
||||
|
||||
For each supported system there's a header file that contains calls or defines
|
||||
specific for this system. So, when programming for the C64, include c64.h, for
|
||||
the C128, include c128.h and so on. To make the task for the Commodore systems
|
||||
easier, there is also a header file named cbm.h that will define stuff common
|
||||
for all CBM systems, and include the header file for the specific target
|
||||
system.
|
||||
For each supported system, there's a header file that contains calls or
|
||||
defines specific for that system. So, when programming for the C64, include
|
||||
<tt/<c64.h>/, for the C128, include <tt/<c128.h>/, and so on.
|
||||
To make the task for the Commodore systems easier, there is also a header file
|
||||
named <tt/<cbm.h>/ that will define stuff common for all CBM systems,
|
||||
and include the header file for the specific target system.
|
||||
|
||||
The header files contain
|
||||
|
||||
<itemize>
|
||||
|
||||
<item>Defines for special keys (like function keys)
|
||||
<item>Defines for special keys (such as function keys)
|
||||
|
||||
<item>Defines for special characters (like the graphics characters)
|
||||
<item>Defines for special characters (such as the graphics characters)
|
||||
|
||||
<item>Variables with a fixed address in memory that may be used to access
|
||||
special hardware. For the C64 and C128 there is a variable struct named
|
||||
<tt/SID/. Writing to the fields of this struct will write to the SID device
|
||||
instead. Using these variables will make your program more readable and more
|
||||
portable. Don't fear ineffective code when using these variables, the
|
||||
compiler will translate reads and writes to these structs into direct memory
|
||||
special hardware. For the C64 and C128, there is a variable struct named
|
||||
<tt/SID/. Writing to the fields of that struct will write to the SID device
|
||||
instead. Using those variables will make your program more readable and more
|
||||
portable. Don't fear ineffective code when using those variables, the
|
||||
compiler will translate reads and writes to those structs into direct memory
|
||||
accesses.
|
||||
|
||||
<item>Other routines that make only sense for a specific system. One example
|
||||
are routines to write memory locations in the system bank for the CBM PET-II
|
||||
<item>Other routines that make sense for only a specific system. One example
|
||||
is routines to write memory locations in the system bank for the CBM-II
|
||||
family.
|
||||
|
||||
</itemize>
|
||||
|
||||
|
||||
|
||||
<sect>Direct console I/O - <tt/conio.h/<p>
|
||||
|
||||
The <tt/conio.h/ header file contains a large set of functions that do screen
|
||||
and keyboard I/O. The functions will write directly to the screen or poll the
|
||||
keyboard directly with no more help from the operating system than needed.
|
||||
This has some disadvantages, but on the other side it's fast and reasonably
|
||||
portable. conio implementations exist for the following targets:
|
||||
portable. Conio implementations exist for the following targets:
|
||||
|
||||
<itemize>
|
||||
<item>apple2
|
||||
@@ -165,13 +166,13 @@ portable. conio implementations exist for the following targets:
|
||||
<item>atari5200
|
||||
<item>atarixl
|
||||
<item>atmos
|
||||
<item>c128
|
||||
<item>c16 (works also for the c116 with up to 32K memory)
|
||||
<item>c64
|
||||
<item>c128
|
||||
<item>plus4 (or expanded c16/c116)
|
||||
<item>cbm510 (40 column video)
|
||||
<item>cbm610 (all CBM series-II computers with 80 column video)
|
||||
<item>cbm510 (40-column video)
|
||||
<item>cbm610 (all CBM series-II computers with 80-column video)
|
||||
<item>creativision
|
||||
<item>cx16
|
||||
<item>gamate
|
||||
<item>geos-apple
|
||||
<item>geos-cbm
|
||||
@@ -179,11 +180,12 @@ portable. conio implementations exist for the following targets:
|
||||
<item>osic1p
|
||||
<item>pce
|
||||
<item>pet (all CBM PET systems except the 2001)
|
||||
<item>plus4 (or expanded c16/c116)
|
||||
<item>telestrat
|
||||
<item>vic20
|
||||
</itemize>
|
||||
|
||||
The conio.h header file does also include the system specific header files
|
||||
The <tt/conio.h/ header file does include the system-specific header files also,
|
||||
which define constants for special characters and keys.
|
||||
|
||||
|
||||
@@ -191,14 +193,14 @@ which define constants for special characters and keys.
|
||||
<sect>Using the joystick - <tt/joystick.h/<p>
|
||||
|
||||
For systems that have a joystick, <tt/joystick.h/ will define a subroutine to
|
||||
read the current value, including constants to evaluate the result of this
|
||||
read the current value, including constants to evaluate the result of that
|
||||
function.
|
||||
|
||||
|
||||
|
||||
<sect>Using a mouse - <tt/mouse.h/<p>
|
||||
|
||||
Some target machines support a mouse. Mouse support is currently available for
|
||||
Some target machines support a mouse. Mouse support currently is available for
|
||||
the following targets:
|
||||
|
||||
<itemize>
|
||||
@@ -206,19 +208,21 @@ the following targets:
|
||||
<item>apple2enh
|
||||
<item>atari
|
||||
<item>atarixl
|
||||
<item>c64
|
||||
<item>c128
|
||||
<item>c64
|
||||
<item>cbm510
|
||||
<item>cx16
|
||||
</itemize>
|
||||
|
||||
The available functions are declared in <tt/mouse.h/.
|
||||
|
||||
|
||||
|
||||
<sect>Copyright<p>
|
||||
|
||||
This C runtime library implementation for the cc65 compiler is (C)
|
||||
Copyright 1998-2002 Ullrich von Bassewitz. For usage of the binaries
|
||||
and/or sources the following conditions do apply:
|
||||
and/or sources, the following conditions do apply:
|
||||
|
||||
This software is provided 'as-is', without any expressed or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -232,8 +236,8 @@ freely, subject to the following restrictions:
|
||||
<item> The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
<item> Altered source versions must be plainly marked as such, and must not
|
||||
appreciated, but is not required.
|
||||
<item> Altered source versions must be marked plainly as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
<item> This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
Reference in New Issue
Block a user