X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2Fatari.sgml;h=a005a79f4651f9f0f1c3ffcdb9b92be2b126afc4;hb=9ba5252a01703566565f817278c023fe2a4134f3;hp=c7243e3b7aaab7fb7d1113469f891e0f6e3cec62;hpb=9d7b1e9755e03eab64670684115d4726908a6443;p=cc65 diff --git a/doc/atari.sgml b/doc/atari.sgml index c7243e3b7..a005a79f4 100644 --- a/doc/atari.sgml +++ b/doc/atari.sgml @@ -7,7 +7,7 @@ url="mailto:shawnjefferson@24fightingchickens.com" name="shawnjefferson@24fightingchickens.com"> and Christian Groessler, -11-Aug-2005 +03-Jan-2006 An overview over the Atari runtime system as it is implemented for the cc65 C @@ -72,7 +72,7 @@ Special locations: @@ -225,10 +225,13 @@ platform. - + Supports up to four standard joysticks connected to the joystick ports of the Atari. + + Supports up to eight standard joysticks connected to a MultiJoy adapter. +

@@ -258,6 +261,12 @@ Therefore the DIO read and write functions transfer only 128 bytes for sectors 1 to 3, regardless of the type of diskette. +CONIO implementation

+ +The console I/O is speed optimized therefore support for XEP80 hardware +or f80.com software is missing. Of course you may use stdio.h functions. + + Other hints

Function keys

@@ -287,12 +296,13 @@ memory area from $4000 to $7FFF. The CODE segment of the program should go below $4000 and the DATA and RODATA segments should go above $7FFF.

-The main problem is that the EXE header generated by the cc65 runtine +The main problem is that the EXE header generated by the cc65 runtime lib is wrong. It defines a single load chunk with the sizes/addresses -of the CODE, RODATA, and DATA segments (the whole user program). +of the LOWCODE, INIT, CODE, RODATA, and DATA segments (the whole user +program).

The contents of the EXE header come from the EXEHDR segment, which is -defined in crt0.s. This cannot be changed w/o modifiying and +defined in crt0.s. This cannot be changed w/o modifying and recompiling the cc65 atari runtime lib. Therefore the original EXE header must be discarded. It will be replaced by a user created one. @@ -316,20 +326,23 @@ MEMORY { SECHDR: start = $0000, size = $4, file = %O; # second load chunk RAM: start = $8000, size = $3C20, file = %O; # $3C20: matches upper bound $BC1F + TRAILER: start = $0000, size = $0006, file = %O; } SEGMENTS { - EXEHDR: load = BANK, type = wprot; + EXEHDR: load = BANK, type = ro; - NEXEHDR: load = HEADER, type = wprot; # first load chunk - CODE: load = RAMLO, type = wprot, define = yes; + NEXEHDR: load = HEADER, type = ro; # first load chunk + LOWCODE: load = RAMLO, type = ro, define = yes, optional = yes; + INIT: load = RAMLO, type = ro, optional = yes; + CODE: load = RAMLO, type = ro, define = yes; - CHKHDR: load = SECHDR, type = wprot; # second load chunk - RODATA: load = RAM, type = wprot, define = yes; + CHKHDR: load = SECHDR, type = ro; # second load chunk + RODATA: load = RAM, type = ro, define = yes; DATA: load = RAM, type = rw, define = yes; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; - AUTOSTRT: load = RAM, type = wprot; # defines program entry point + AUTOSTRT: load = TRAILER, type = ro; # defines program entry point } FEATURES { CONDES: segment = RODATA, @@ -343,6 +356,7 @@ FEATURES { } SYMBOLS { __STACKSIZE__ = $800; # 2K stack + __RESERVED_MEMORY__: value = $0, weak = yes; }

@@ -363,13 +377,13 @@ memory area). The contents of the new NEXEHDR and CHKHDR segments come from this file (split.s): - .import __CODE_LOAD__, __BSS_LOAD__, __CODE_SIZE__ - .import __DATA_LOAD__, __RODATA_LOAD__ + .import __LOWCODE_LOAD__, __BSS_LOAD__, __CODE_SIZE__ + .import __CODE_LOAD__, __DATA_LOAD__, __RODATA_LOAD__ .segment "NEXEHDR" .word $FFFF ; EXE file magic number ; 1st load chunk - .word __CODE_LOAD__ + .word __LOWCODE_LOAD__ .word __CODE_LOAD__ + __CODE_SIZE__ - 1 .segment "CHKHDR" @@ -386,8 +400,8 @@ cl65 -t atari -C split.cfg -o prog.com prog.c split.s Low data and high code example

-Goal: Put RODATA and DATA into low memory and CODE with BSS into high -memory (split2.cfg): +Goal: Put RODATA and DATA into low memory and LOWCODE, INIT, CODE, BSS +into high memory (split2.cfg): MEMORY { @@ -400,20 +414,23 @@ MEMORY { SECHDR: start = $0000, size = $4, file = %O; # second load chunk RAM: start = $8000, size = $3C20, file = %O; # $3C20: matches upper bound $BC1F + TRAILER: start = $0000, size = $0006, file = %O; } SEGMENTS { - EXEHDR: load = BANK, type = wprot; # discarded old EXE header + EXEHDR: load = BANK, type = ro; # discarded old EXE header - NEXEHDR: load = HEADER, type = wprot; # first load chunk - RODATA: load = RAMLO, type = wprot, define = yes; + NEXEHDR: load = HEADER, type = ro; # first load chunk + RODATA: load = RAMLO, type = ro, define = yes; DATA: load = RAMLO, type = rw, define = yes; - CHKHDR: load = SECHDR, type = wprot; # second load chunk - CODE: load = RAM, type = wprot, define = yes; + CHKHDR: load = SECHDR, type = ro; # second load chunk + LOWCODE: load = RAM, type = ro, define = yes, optional = yes; + INIT: load = RAM, type = ro, optional = yes; + CODE: load = RAM, type = ro, define = yes; BSS: load = RAM, type = bss, define = yes; ZEROPAGE: load = ZP, type = zp; - AUTOSTRT: load = RAM, type = wprot; # defines program entry point + AUTOSTRT: load = TRAILER, type = ro; # defines program entry point } FEATURES { CONDES: segment = RODATA, @@ -427,12 +444,13 @@ FEATURES { } SYMBOLS { __STACKSIZE__ = $800; # 2K stack + __RESERVED_MEMORY__: value = $0, weak = yes; } New contents for NEXEHDR and CHKHDR are needed (split2.s): - .import __CODE_LOAD__, __BSS_LOAD__, __DATA_SIZE__ + .import __LOWCODE_LOAD__, __BSS_LOAD__, __DATA_SIZE__ .import __DATA_LOAD__, __RODATA_LOAD__ .segment "NEXEHDR" @@ -441,7 +459,7 @@ New contents for NEXEHDR and CHKHDR are needed (split2.s): .word __DATA_LOAD__ + __DATA_SIZE__ - 1 .segment "CHKHDR" - .word __CODE_LOAD__ + .word __LOWCODE_LOAD__ .word __BSS_LOAD__ - 1