diff --git a/doc/Makefile b/doc/Makefile
index 8994aea83..a57dd12a0 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -5,7 +5,8 @@
# Default for the compiler lib search path as compiler define
-SGML = ar65.sgml \
+SGML = apple2.sgml \
+ ar65.sgml \
atari.sgml \
c128.sgml \
c16.sgml \
@@ -51,9 +52,6 @@ TEX = $(SGML:.sgml=.tex)
%.tex: %.sgml
sgml2latex --output=tex $<
-funcref.html: funcref.sgml
- sgml2html --split=2 $<
-
# ------------------------------------------------------------------------------
# Targets
@@ -85,6 +83,15 @@ clean:
zap: clean
rm -f $(TXT) $(HTML) $(INFO) $(DVI) $(TEX) *.html *.info-* *.man
+# ------------------------------------------------------------------------------
+# Special target rules
+
+coding.html: coding.sgml
+ sgml2html --split=0 $<
+
+funcref.html: funcref.sgml
+ sgml2html --split=2 $<
+
# ------------------------------------------------------------------------------
# Make the dependencies
diff --git a/doc/apple2.sgml b/doc/apple2.sgml
new file mode 100644
index 000000000..359793077
--- /dev/null
+++ b/doc/apple2.sgml
@@ -0,0 +1,236 @@
+
+
+
+
+Apple ][ specific information for cc65
+Ullrich von Bassewitz,
+2003-12-16
+
+
+An overview over the Apple ][ runtime system as it is
+implemented for the cc65 C compiler.
+
+
+
+
+
+
+
+Overview
+
+This file contains an overview of the Apple ][ runtime system
+as it comes with the cc65 C compiler. It describes the memory layout,
+Apple ][ specific header files, available drivers, and any
+pitfalls specific to that platform.
+
+Please note that Apple ][ specific functions are just mentioned
+here, they are described in detail in the separate . Even functions marked as "platform dependent" may
+be available on more than one platform. Please see the function reference for
+more information.
+
+
+Binary format
+
+The standard binary output format generated by the linker for the
+Apple ][ target is a machine language program with a 4 byte DOS
+3.3 header. The standard load address is $800.
+
+The DOS header is in it's own segment named
+ HEADER: start = $0000, size = $4, file = %O;
+
+
+to
+
+
+ HEADER: start = $0000, size = $4, file = "";
+
+
+in the linker configuration to have the linker remove it.
+
+
+
+Memory layout
+
+In the standard setup, cc65 generated programs use the memory from
+$800 to $8E00, so 33.5K of memory (including the stack) is
+available. ROM calls are possible without further precautions.
+
+Special locations:
+
+
+
+
+
+
+Platform specific header files
+
+Programs containing Apple ][ specific code may use the
+Apple ][ specific functions
+
+The functions listed below are special for the Apple ][. See
+the for declaration and
+usage.
+
+
+get_ostype
+
+
+
+
+Hardware access
+
+There's currently no support for direct hardware access. This does not mean
+you cannot do it, it just means that there's no help.
+
+
+
+Loadable drivers
+
+Note: Since the Apple ][ doesn't have working disk I/O
+(see ), the
+available drivers cannot be loaded at runtime (so the term "loadable drivers"
+is somewhat misleading). Instead, the drivers have to be converted using the
+ and statically linked. While
+this may seem overhead, it has two advantages:
+
+
+The interface is identical to the one used for other platforms
+ and to the one for the Apple ][ once it has disk I/O.
+Once disk I/O is available, existing code can be changed to load drivers
+ at runtime with almost no effort.
+
+
+
+
+Graphics drivers
+
+Note: Since memory for the graphics has to be allocated, programs
+using graphics drivers will have to be linked using a special linker
+configuration. See the on
+how to use it.
+
+
+
+
+ This driver features a resolution of 40x40 with 16 colors. At the bottom of
+ the screen, 4 additional text lines are available.
+
+
+ This driver features a resolution of 280x192 with 6 colors.
+
+
+
+
+Extended memory drivers
+
+No extended memory drivers are currently available for the
+Apple ][.
+
+
+
+Joystick drivers
+
+
+
+
+ Supports up to two standard joysticks connected to the joysticks port of
+ the Apple ][.
+
+
+
+
+
+Mouse drivers
+
+Currently no drivers available (in fact, the API for loadable mouse drivers
+does not exist).
+
+
+RS232 device drivers
+
+No serial drivers are currently available for the Apple ][.
+
+
+
+Limitations
+
+
+
diff --git a/doc/index.sgml b/doc/index.sgml
index 08888bd27..6a3528028 100644
--- a/doc/index.sgml
+++ b/doc/index.sgml
@@ -84,6 +84,9 @@ Main documentation page, contains links to other available stuff.
+
+ Topics specific to the Apple2 ][.
+
Topics specific to the Atari 8 bit machines.