File: atari2600.sgml

package info (click to toggle)
cc65 2.19-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 20,268 kB
  • sloc: ansic: 117,151; asm: 66,339; pascal: 4,248; makefile: 1,009; perl: 607
file content (122 lines) | stat: -rw-r--r-- 3,898 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!doctype linuxdoc system>

<article>
<title>Atari 2600 specific information for cc65
<author>
<url url="mailto:contact@florentflament.com" name="Florent Flament"><newline>

<abstract>
An overview over the Atari 2600 runtime system as it is implemented
for the cc65 C compiler.
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Overview<p>

This file contains an overview of the Atari 2600 runtime system as it
comes with the cc65 C compiler. It describes the memory layout, Atari
2600 specific header files and any pitfalls specific to that platform.

<sect>Binary format<p>

The default binary output format generated by the linker for the Atari
2600 target is a 4K cartridge image.

<sect>Memory layout<p>

cc65 generated programs with the default setup can use RAM from
&dollar;0080 to &dollar;00FF - __STACKSIZE__, where __STACKSIZE__ is
the size of the system stack with a default value of 16 bytes. The
size of the system stack can be customized by defining the
__STACKSIZE__ linker variable.

Special locations:

<descrip>
  <tag/Stack/ The C runtime stack is located at &dollar;00FF -
    __STACKSIZE__ and growing downwards.

  <tag/Heap/ The C heap is located at &dollar;0080 and grows upwards.

</descrip><p>

<sect>Start-up condition<p>

When powered-up, the Atari 2600 TIA registers contain random
values. During the initialization phase, the start-up code needs to
initialize the TIA registers to sound values (or else the console has
an unpredictable behavior). In this implementation, zeros are written
to all of TIA registers during the start-up phase.

Note that RIOT registers (mostly timers) are left uninitialized, as
they don't have any consequence on the console behavior.

<sect>Platform specific header files<p>

Programs containing Atari 2600 specific code may use the
<tt/atari2600.h/ header file.

The following pseudo variables declared in the <tt/atari2600.h/ header
file allow access to the Atari 2600 TIA & RIOT chips registers.

<descrip>

  <tag><tt/TIA/</tag> The <tt/TIA/ structure allows read/write access
  to the Atari 2600 TIA chip registers. See the <tt/_tia.h/ header
  file located in the include directory for the declaration of the
  structure. Also refer to the Stella Programmer's Guide by Steve
  Wright for a detailed description of the chip and its registers.

  <tag><tt/RIOT/</tag> The <tt/RIOT/ structure allows read/write
  access to the Atari 2600 RIOT chip registers. See the
  <tt/_riot.h/ header file located in the include directory for the
  declaration of the structure. Also refer to the Stella Programmer's
  Guide by Steve Wright for a detailed description of the chip and its
  registers.

</descrip><p>


<sect>Loadable drivers<p>

There are no drivers for the Atari 2600.


<sect>Limitations<p>

TBD


<sect>Other hints<p>

One may write a custom linker configuration file to tune the memory
layout of a program. See the <tt/atari2600.cfg/ file in the cfg
directory as a starting point.


<sect>License<p>

This software is provided 'as-is', without any expressed or implied
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,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

<enum>
<item>  The origin of this software must not be misrepresented; you must not
        claim that you wrote the original software. If you use this software
        in a product, an acknowledgment in the product documentation would be
        appreciated but is not required.
<item>  Altered source versions must be plainly marked as such, and must not
        be misrepresented as being the original software.
<item>  This notice may not be removed or altered from any source
        distribution.
</enum>

</article>