]> git.sur5r.net Git - cc65/blob - doc/atari5200.sgml
cbddbd928d7f84cd76754e3139a4e8d423a26870
[cc65] / doc / atari5200.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4
5 <title>Atari 5200 specific information for cc65
6 <author>
7 <url url="mailto:chris@groessler.org" name="Christian Groessler"><newline>
8 <date>2014-05-27
9
10 <abstract>
11 An overview over the Atari 5200 runtime system as it is implemented for the
12 cc65 C compiler.
13 </abstract>
14
15 <!-- Table of contents -->
16 <toc>
17
18 <!-- Begin the document -->
19
20 <sect>Overview<p>
21
22 This file contains an overview of the Atari 5200 runtime system as it comes
23 with the cc65 C compiler. It describes the memory layout, Atari 5200 specific header
24 files, available drivers, and any pitfalls specific to that platform.
25
26 Please note that Atari 5200 specific functions are just mentioned here, they are
27 described in detail in the separate <url url="funcref.html" name="function
28 reference">. Even functions marked as "platform dependent" may be available on
29 more than one platform. Please see the function reference for more
30 information.
31
32
33 <sect>Binary format<p>
34
35 The standard binary output format generated by the linker for the Atari 5200 target
36 is a cartridge image. It is of course
37 possible to change this behaviour by using a modified startup file and linker
38 config.
39
40 <sect>Memory layout<p>
41
42 cc65 generated programs with the default setup use the RAM space from &dollar;021C to
43 &dollar;3FFF. If you want to reserve memory for the display list and screen buffer
44 you should define the __RESERVED_MEMORY__ linker variable. The number
45 of bytes specified by __RESERVED_MEMORY__ are lowering the top of
46 memory, therefore the available
47 RAM memory for the program is &dollar;021C to &dollar;3FFF-__RESERVED_MEMORY__.
48 The default linker config file sets __RESERVED_MEMORY__ to &dollar;1E0
49 to reserve space for an optional CONIO text screen.
50
51 Special locations:
52
53 <descrip>
54   <tag/Text screen/
55   The text screen is only enabled if any of the CONIO output routines
56   is used in the program. Its size is 20x24 characters (Antic mode 6,
57   BASIC mode 1). The text screen is located at &dollar;3E00. The
58   address of the screen memory is available at runtime in the variable
59   SAVMSC (&dollar;001B).<p>
60   If the program doesn't use any CONIO output functions it needs to setup its own
61   display list.
62
63   <tag/Stack/
64   The C runtime stack is located at &dollar;3FFF-__RESERVED_MEMORY__ and growing downwards.
65
66   <tag/Heap/
67   The C heap is located at the end of the program and grows towards the C
68   runtime stack.
69
70 </descrip><p>
71
72
73
74 <sect>Platform specific header files<p>
75
76 Programs containing Atari 5200 specific code may use the <tt/atari5200.h/ header file.
77
78
79 <sect1>Atari 5200 specific functions<p>
80
81 <itemize>
82 <item>TBD.
83 </itemize>
84
85
86
87 <sect1>Hardware access<p>
88
89 The following pseudo variables declared in the <tt/atari5200.h/ header
90 file do allow access to hardware located in the address space. Some
91 variables are structures, accessing the struct fields will access the
92 chip registers.
93
94 <descrip>
95
96   <tag><tt/GTIA_READ/ and <tt/GTIA_WRITE/</tag>
97   The <tt/GTIA_READ/ structure allows read access to the GTIA. The
98   <tt/GTIA_WRITE/ structure allows write access to the GTIA.
99   See the <tt/_gtia.h/ header file located in the include directory
100   for the declaration of the structure.
101
102   <tag><tt/POKEY_READ/ and <tt/POKEY_WRITE/</tag>
103   The <tt/POKEY_READ/ structure allows read access to the POKEY. The
104   <tt/POKEY_WRITE/ structure allows write access to the POKEY.
105   See the <tt/_pokey.h/ header file located in the include directory
106   for the declaration of the structure.
107
108   <tag><tt/ANTIC/</tag>
109   The <tt/ANTIC/ structure allows read access to the ANTIC.
110   See the <tt/_antic.h/ header file located in the include directory
111   for the declaration of the structure.
112
113 </descrip><p>
114
115
116 <sect>Loadable drivers<p>
117
118 All drivers must be statically linked because no disk I/O is available.
119 The names in the parentheses denote the symbols to be used for static linking of the drivers.
120
121
122 <sect1>Graphics drivers<p>
123
124 <descrip>
125
126 No graphics drivers are currently available for the Atari 5200.
127
128 </descrip><p>
129
130
131 <sect1>Extended memory drivers<p>
132
133 No extended memory drivers are available for the Atari 5200.
134
135
136 <sect1>Joystick drivers<p>
137
138 <descrip>
139
140   <tag><tt/atr5200std.joy (atr5200std_joy)/</tag>
141   A joystick driver for the standard Atari 5200 joystick is available. Up to four joysticks can be attached.
142
143 </descrip><p>
144
145
146 <sect1>Mouse drivers<p>
147
148 No mouse drivers are available for the Atari 5200.
149
150
151 <sect1>RS232 device drivers<p>
152
153 No serial drivers are available for the Atari 5200.
154
155
156
157 <sect>Limitations<p>
158
159 <sect1>Disk I/O<p>
160
161 Disk I/O is not supported by the <tt/atari5200/ target. This means that
162 you cannot use any of the following functions (and a few others):
163
164 <itemize>
165 <item>fclose
166 <item>fopen
167 <item>fread
168 <item>fprintf
169 <item>fputc
170 <item>fscanf
171 <item>fwrite
172 <item>...
173 </itemize>
174
175
176
177 <sect>Other hints<p>
178
179
180
181 <sect>License<p>
182
183 This software is provided 'as-is', without any expressed or implied
184 warranty.  In no event will the authors be held liable for any damages
185 arising from the use of this software.
186
187 Permission is granted to anyone to use this software for any purpose,
188 including commercial applications, and to alter it and redistribute it
189 freely, subject to the following restrictions:
190
191 <enum>
192 <item>  The origin of this software must not be misrepresented; you must not
193         claim that you wrote the original software. If you use this software
194         in a product, an acknowledgment in the product documentation would be
195         appreciated but is not required.
196 <item>  Altered source versions must be plainly marked as such, and must not
197         be misrepresented as being the original software.
198 <item>  This notice may not be removed or altered from any source
199         distribution.
200 </enum>
201
202 </article>