1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-17 16:29:32 +00:00

Update docs

This commit is contained in:
Karri Kaksonen 2022-03-04 20:21:20 +02:00
parent d679faaf22
commit cc9535e82f

View File

@ -3,7 +3,7 @@
<article> <article>
<title>Atari 7800 specific information for cc65 <title>Atari 7800 specific information for cc65
<author> <author>
<url url="mailto:contact@florentflament.com" name="Florent Flament"><newline> <url url="mailto:karri@sipo.fi" name="Karri Kaksonen"><newline>
<abstract> <abstract>
An overview over the Atari 7800 runtime system as it is implemented An overview over the Atari 7800 runtime system as it is implemented
@ -24,23 +24,31 @@ comes with the cc65 C compiler. It describes the memory layout, Atari
<sect>Binary format<p> <sect>Binary format<p>
The default binary output format generated by the linker for the Atari The default binary output format generated by the linker for the Atari
7800 target is a 4K cartridge image. 7800 target is a 32K cartridge image.
<sect>Memory layout<p> <sect>Memory layout<p>
cc65 generated programs with the default setup can use RAM from cc65 generated programs with the default setup can use RAM from
&dollar;0080 to &dollar;00FF - __STACKSIZE__, where __STACKSIZE__ is from &dollar;1800 to &dollar;203f.
the size of the system stack with a default value of 16 bytes. The The 4k RAM is then mapped to zero page area.
&dollar;2040 to &dollar;20ff is visible as zero page.
After that we have a vero small RAM area that is unused.
&dollar;2100 to &dollar;213f.
Then we mirror a second block from the RAM to become the hardware stack.
This would be from &dollar;2140 to &dollar;21ff.
The C-stack starts at &dollar;2800 and it can grow down to &dollar;2200.
size of the system stack can be customized by defining the size of the system stack can be customized by defining the
__STACKSIZE__ linker variable. __STACKSIZE__ linker variable.
Special locations: Special locations:
<descrip> <descrip>
<tag/Stack/ The C runtime stack is located at &dollar;00FF - <tag/Stack/ The C runtime stack is located at &dollar;2800 -
__STACKSIZE__ and growing downwards. __STACKSIZE__ and growing downwards.
<tag/Heap/ The C heap is located at &dollar;0080 and grows upwards. <tag/Heap/ The C heap is located at &dollar;2200 and grows upwards.
</descrip><p> </descrip><p>
@ -61,7 +69,7 @@ Programs containing Atari 7800 specific code may use the
<tt/atari7800.h/ header file. <tt/atari7800.h/ header file.
The following pseudo variables declared in the <tt/atari7800.h/ header The following pseudo variables declared in the <tt/atari7800.h/ header
file allow access to the Atari 7800 TIA & RIOT chips registers. file allow access to the Atari 7800 TIA, MARIA & RIOT chips registers.
<descrip> <descrip>
@ -78,6 +86,11 @@ file allow access to the Atari 7800 TIA & RIOT chips registers.
Guide by Steve Wright for a detailed description of the chip and its Guide by Steve Wright for a detailed description of the chip and its
registers. registers.
<tag><tt/MARIA/</tag> The <tt/MARIA/ structure allows read/write
access to the Atari 7800 MARIA chip registers. See the
<tt/_maria.h/ header file located in the include directory for the
declaration of the structure.
</descrip><p> </descrip><p>
@ -91,6 +104,12 @@ There are no drivers for the Atari 7800.
TBD TBD
<sect>Encryption<p>
In order to boot the game in a mode that supports atari7800 functions
the cart must be encrypted after the linking phase.
There is a program called sign7800 that can be used to sign the cart.
<sect>Other hints<p> <sect>Other hints<p>
One may write a custom linker configuration file to tune the memory One may write a custom linker configuration file to tune the memory