X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2Fapple2.sgml;h=1abcf3edab3e17f79cf88bdde675d863e8812636;hb=beef3a3d853a11bf85b9b6535712edd89cecad88;hp=908503f66a40743984a2584569ae43795cdf833c;hpb=94cc96a79d49fb474ab9c3dae3f186918e98b526;p=cc65 diff --git a/doc/apple2.sgml b/doc/apple2.sgml index 908503f66..1abcf3eda 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -30,46 +30,86 @@ 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. +3.3 header containing the load address and load size. The standard load address +is $803. -The DOS header is in its own segment named - HEADER: start = $0000, size = $4, file = %O; + HEADER: start = $0000, size = $0004, file = %O; to - HEADER: start = $0000, size = $4, file = ""; + HEADER: start = $0000, size = $0004, file = ""; in the linker configuration to have the linker remove it. +) includes an option 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. +$803 to $95FF, so 35.5KB of RAM are available. While running +

+Enabling the Language Card allows to use it as additional memory for executable +code. Actually doing so requires either to compile code with the option + + LC: start = $D400, size = $0C00, define = yes; + + +to + + + LC: start = $D000, size = $3000, define = yes; + + +in the linker configuration to define the whole 12KB Language Card address +space as memory area for executable code. + Platform specific header files

@@ -85,11 +125,12 @@ the for declaration and usage. +_dos_type get_ostype +rebootafterexit - Hardware access

There's currently no support for direct hardware access. This does not mean @@ -99,40 +140,25 @@ 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 high resolution 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 was written by Stefan Haubenthal. It features a resolution of - 40×40 with 16 colors. At the bottom of the screen, 4 additional text lines - are available. - - - This driver was written by Stefan Haubenthal. It features a resolution of - 280×192 with 6 colors. + + This driver features a resolution of 40×48 with 16 colors. + + + This driver features a resolution of 280×192 with 8 colors and two + hires pages. Note that programs using this driver will have to be linked + with

@@ -141,87 +167,169 @@ how to use it. - - Gives access to 12KB RAM (48 pages of 256 bytes each) on the - Apple ][ language card. The driver was contributed by - Stefan Haubenthal. + + Gives access to 47,5 KB RAM (190 pages of 256 bytes each) on an Extended + 80-Column Text Card. + + Note that this driver doesn't check for the actual existence of the memory + and that it doesn't check for ProDOS 8 RAM disk content!

- Joystick drivers

- + Supports up to two standard analog joysticks connected to the game port of the Apple ][.

- Mouse drivers

-Currently no drivers available (in fact, the API for loadable mouse drivers -does not exist). + + + + Driver for the AppleMouse II Card. Searches all Apple II slots + for an AppleMouse II Card compatible firmware. The default bounding + box is [0..279,0..191]. + + Programs using this driver will have to be linked with

RS232 device drivers

-No serial drivers are currently available for the Apple ][. + + + + Driver for the Apple II Super Serial Card. Supports up to 19200 baud, + hardware flow control (RTS/CTS) and interrupt driven receives. Note + that because of the peculiarities of the 6551 chip transmits are not + interrupt driven, and the transceiver blocks if the receiver asserts + flow control because of a full buffer. + The driver defaults to slot 2. Call

-Limitations

-Disk I/O

-The existing library for the Apple ][ doesn't implement C file -I/O. There are two hacks for the Limitations

-To be more concrete, this limitation means that you cannot use any of the -following functions (and a few others): - -fclose -fopen -fread -fprintf -fputc -fscanf -fwrite -... - +DOS 3.3

+ +Although the standard binaries generated by the linker for the Apple ][ +generally run both on DOS 3.3 (with Applesoft BASIC) and on ProDOS 8 (with +BASIC.SYSTEM) there are some limitations for DOS 3.3: + + + + Disk File I/O + There's no disk file I/O support. Any attempt to use it yields an error with + Interrupts + There's no

+ + +DIO

+ +Although generally works with all ProDOS 8 +devices, the function +simply always return 280 (which is only correct for a 140KB disk). + + +Direct console I/O

+ + + + Color + The Apple ][ has no color text mode. Therefore the functions + , + and + have no effect. + + Cursor + The Apple ][ has no hardware cursor. Therefore the function + has no effect. + +

+ Other hints

+ Passing arguments to the program

-Command line arguments can be passed to - RUN:REM,ARG1," ARG2", ARG 3,, ARG5, ... +]CALL2051:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5 -Arguments are separated by commas. -There must be a comma after the first Leading spaces are ignored; trailing spaces are included unless the - argument was quoted. +Arguments are separated by spaces. +Arguments may be quoted. +Leading and trailing spaces around an argument are ignored. Spaces within + a quoted argument are allowed. The first argument passed to A maximum number of 10 arguments (including the program name) are + supported. -Function keys

+Interrupts

+ +The runtime for the Apple ][ uses routines marked as . + + +DIO

-These are defined to be OpenApple + number key. +The function has the single parameter + + drive_id = (slot * 2) + (drive - 1) + + +so that for example slot 6 drive 1 is mapped to succeeds only if a +formatted disk is present in the drive. However intentionally no check is +performed on the presence of a ProDOS 8 disk. Therefore access to all standard +16-sector disks (as for instance DOS 3.3) is possible. @@ -237,7 +345,7 @@ name="uz@cc65.org">). License

This software is provided 'as-is', without any expressed or implied -warranty. In no event will the authors be held liable for any damages +warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, @@ -256,6 +364,3 @@ freely, subject to the following restrictions: - - -