Updated cx16 to match the Commander X16 ROMs and emulator, release 34.

This commit is contained in:
Greg King
2019-11-16 13:11:40 -05:00
parent 4dda5d2173
commit d78133e1f0
37 changed files with 607 additions and 182 deletions

View File

@@ -17,14 +17,14 @@ compiler.
<sect>Overview<p>
The Commander X16 is a modern small computer with firmware that is based on
the ROMs in Commodore's VIC-20 and 64C. It has a couple of the I/O chips that
are in the VIC-20.
the ROMs in Commodore's VIC-20 and 64C. It has a couple of I/O chips
(WDC65C22 VIA) that are like the ones in the VIC-20.
This file contains an overview of the CX16 run-time system as it comes with the
cc65 C compiler. It describes the memory layout, CX16-specific header files,
cc65 C compiler. It describes the memory layout, CX16-specific header files,
available drivers, and any pitfalls specific to that platform.
Please note that CX16-specific functions just are mentioned here; they are
Please note that CX16-specific functions just are mentioned here; they might be
described in detail in the separate <url url="funcref.html" name="function
reference">. Even functions marked as "platform dependent" may be available on
more than one platform. Please see the function reference for more
@@ -35,19 +35,20 @@ information.
<sect>Binary format<p>
The standard binary output format generated by the linker for the CX16 target
is a machine language program with a one-line BASIC stub which calls the
machine language part via SYS. That means that a program can be loaded as a
BASIC program, and started with RUN. It is, of course, possible to change that
behaviour by using a modified start-up file and linker config.
is a machine language program that's prepended with a 16-bit load address and a
one-line BASIC stub which calls the machine language part via SYS. That means
that a program can be loaded as a BASIC program, and started with RUN. It is,
of course, possible to change that behaviour by using a modified program-header
file and linker config.
<sect>Memory layout<p>
cc65-generated programs with the default setup run with the I/O area and the
Kernal ROM visible. That means that Kernal entry points can be called directly.
The usable memory ranges are &dollar;0800 - &dollar;9EFF and &dollar;A000 -
&dollar;BFFF.
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 &dollar;0800 - &dollar;9EFF and
&dollar;A000 - &dollar;BFFF.
Special locations:
@@ -76,6 +77,9 @@ 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 &lt;configfile&gt;/.
Those files use 126 bytes in the zero page. (The rest of page zero is reserved
for Kernal and BASIC.)
<sect1>Default config. file (<tt/cx16.cfg/)<p>
@@ -138,6 +142,8 @@ url="funcref.html" name="function reference"> for declarations and usage.
<item>get_ostype()
<item>set_tv()
<item>videomode()
<item>vpeek()
<item>vpoke()
<item>waitvsync()
</itemize>
@@ -157,6 +163,7 @@ declarations and usage.
<item>cbm_k_ckout()
<item>cbm_k_close()
<item>cbm_k_clrch()
<item>cbm_k_getin()
<item>cbm_k_load()
<item>cbm_k_open()
<item>cbm_k_readst()
@@ -217,13 +224,13 @@ No extended memory drivers are available currently for the CX16.
<sect1>Joystick drivers<p>
The default drivers, <tt/joy_stddrv (joy_static_stddrv)/,
point to <tt/cX16-stdjoy.joy (cx16_stdjoy_joy)/.
point to <tt/cX16-std.joy (cx16_std_joy)/.
<descrip>
<tag><tt/cX16-stdjoy.joy (cX16_stdjoy_joy)/</tag>
Supports up to two NES and SNES controllers connected to the joystick ports
<tag><tt/cX16-std.joy (cX16_std_joy)/</tag>
Supports up to two NES (and SNES) controllers connected to the joystick ports
of the CX16. It reads the four directions, and the A, B, Select, and Start
buttons. Button A is the primary fire button.
buttons. Buttons A and B are the primary and secondary fire buttons.
</descrip><p>
@@ -248,9 +255,16 @@ any time. Some changes could make old programs fail to work.
<sect>Other hints<p>
<sect1>STOP and RUN codes<p>
The <tt/Esc/ key acts as Commodore's <tt/STOP/ key -- or, you can press the
<tt/Ctrl/ key and the <tt/C/ key together. Pressing the <tt/Shift/ and the
<tt/Esc/ keys together will type Commodore's <tt/RUN/ key.
<sect1>Escape code<p>
For an Esc, press <tt/Ctrl/ and the <tt/[/ key.
For an <tt/Esc/, press the <tt/Ctrl/ key and the <tt/[/ key together.
<sect1>Passing arguments to the program<p>
@@ -274,7 +288,7 @@ supported directly by BASIC, the following syntax was chosen:
<sect1>Program return code<p>
The program return code (low byte) is passed back to BASIC by use of the
The program return code (low byte) is passed back to BASIC by the use of its
<tt/ST/ variable.