<s>
The	O
Television	B-General_Concept
Interface	I-General_Concept
Adaptor	I-General_Concept
(	O
TIA	O
)	O
is	O
the	O
custom	O
computer	O
chip	O
,	O
along	O
with	O
a	O
variant	O
of	O
the	O
MOS	B-General_Concept
Technology	I-General_Concept
6502	I-General_Concept
constituting	O
the	O
heart	O
of	O
the	O
1977	O
Atari	B-General_Concept
Video	I-General_Concept
Computer	I-General_Concept
System	I-General_Concept
game	O
console	O
.	O
</s>
<s>
At	O
the	O
time	O
the	O
Atari	B-General_Concept
VCS	I-General_Concept
was	O
designed	O
,	O
even	O
small	O
amounts	O
of	O
RAM	B-Architecture
were	O
expensive	O
.	O
</s>
<s>
The	O
chip	O
was	O
designed	O
around	O
not	O
having	O
a	O
frame	B-Algorithm
buffer	I-Algorithm
,	O
instead	O
requiring	O
detailed	O
programming	O
to	O
create	O
even	O
a	O
simple	O
display	O
.	O
</s>
<s>
Development	O
of	O
the	O
CO10444/CO11903	O
TIA	O
was	O
led	O
by	O
Jay	O
Miner	O
who	O
continued	O
at	O
Atari	O
expanding	O
on	O
the	O
design	O
of	O
the	O
TIA	O
for	O
the	O
Atari	B-Device
400/800	I-Device
computers	O
with	O
the	O
ANTIC	B-General_Concept
and	O
CTIA/GTIA	B-General_Concept
chips	O
.	O
</s>
<s>
Jay	O
Miner	O
later	O
led	O
the	O
design	O
of	O
the	O
custom	O
chips	O
for	O
the	O
Amiga	B-Device
computer	I-Device
.	O
</s>
<s>
Programmable	O
microprocessors	B-Architecture
had	O
reached	O
the	O
market	O
,	O
but	O
Atari	O
considered	O
them	O
too	O
expensive	O
for	O
a	O
home	O
application	O
.	O
</s>
<s>
At	O
this	O
point	O
in	O
time	O
,	O
most	O
computer	O
graphics	O
were	O
generated	O
by	O
using	O
sprites	O
drawn	O
atop	O
a	O
playfield	O
,	O
which	O
then	O
were	O
translated	O
into	O
an	O
analog	O
signal	O
for	O
display	O
on	O
a	O
CRT	B-Device
video	B-Device
monitor	I-Device
.	O
</s>
<s>
Sprites	O
would	O
be	O
held	O
as	O
a	O
bitmap	O
in	O
a	O
framebuffer	B-Algorithm
,	O
requiring	O
random-access	B-Architecture
memory	I-Architecture
(	O
RAM	B-Architecture
)	O
.	O
</s>
<s>
RAM	B-Architecture
was	O
still	O
expensive	O
,	O
costing	O
tens	O
of	O
thousands	O
of	O
dollars	O
per	O
megabyte.	O
,	O
and	O
to	O
display	O
a	O
two-color	O
playfield	O
on	O
a	O
80×48	O
display	O
would	O
have	O
cost	O
thousands	O
of	O
dollars	O
in	O
memory	O
.	O
</s>
<s>
In	O
September	O
1975	O
,	O
MOS	B-Architecture
Technology	I-Architecture
introduced	O
the	O
6502	B-General_Concept
microprocessor	I-General_Concept
,	O
one	O
of	O
the	O
first	O
low-cost	O
microprocessors	B-Architecture
on	O
the	O
market	O
.	O
</s>
<s>
Mayer	O
and	O
Milner	O
arranged	O
to	O
speak	O
to	O
the	O
chip	O
's	O
designer	O
,	O
Chuck	O
Peddle	O
,	O
on	O
using	O
the	O
6502	B-General_Concept
as	O
the	O
basis	O
for	O
their	O
programmable	O
video	O
game	O
console	O
.	O
</s>
<s>
Over	O
the	O
course	O
of	O
a	O
couple	O
of	O
days	O
,	O
the	O
basic	O
design	O
of	O
the	O
Atari	B-General_Concept
VCS	I-General_Concept
was	O
laid	O
out	O
,	O
with	O
Peddle	O
offering	O
Atari	O
the	O
use	O
of	O
the	O
lower-cost	O
MOS	B-General_Concept
Technology	I-General_Concept
6507	I-General_Concept
processor	O
and	O
the	O
MOS	B-Device
Technology	I-Device
6532	I-Device
RAM-I/O	O
-Timer	O
(	O
RIOT	O
)	O
as	O
the	O
core	O
of	O
the	O
design	O
.	O
</s>
<s>
Using	O
a	O
breadboard	O
prototype	O
for	O
the	O
display	O
adapter	O
atop	O
a	O
6502	B-General_Concept
testbed	O
system	O
,	O
Milner	O
was	O
able	O
to	O
demonstrate	O
the	O
ability	O
to	O
program	O
a	O
simple	O
version	O
of	O
their	O
Tank	B-Application
game	O
.	O
</s>
<s>
Early	O
on	O
,	O
the	O
ASIC	O
display	O
adapter	O
was	O
named	O
the	O
Television	B-General_Concept
Interface	I-General_Concept
Adapter	I-General_Concept
(	O
TIA	O
)	O
.	O
</s>
<s>
The	O
cost	O
of	O
RAM	B-Architecture
remained	O
high	O
as	O
the	O
team	O
began	O
its	O
design	O
,	O
and	O
thus	O
the	O
option	O
to	O
use	O
memory-based	O
framebuffers	B-Algorithm
was	O
dropped	O
from	O
the	O
TIA	O
's	O
design	O
.	O
</s>
<s>
Due	O
to	O
the	O
lack	O
of	O
RAM	B-Architecture
,	O
the	O
TIA	O
differs	O
from	O
the	O
conventional	O
framebuffer	B-Algorithm
approach	O
on	O
the	O
screen	O
is	O
composed	O
by	O
manipulating	O
five	O
movable	O
graphic	O
objects	O
(	O
2	O
players	O
,	O
2	O
missiles	O
and	O
1	O
ball	O
)	O
and	O
a	O
static	O
playfield	O
object	O
.	O
</s>
<s>
These	O
are	O
all	O
generated	O
on	O
every	O
scan	O
line	O
from	O
their	O
respective	O
registers	O
,	O
unlike	O
the	O
technique	O
used	O
in	O
a	O
framebuffer-mapped	O
model	O
,	O
requiring	O
the	O
program	O
to	O
update	O
these	O
on	O
every	O
scan	O
line	O
.	O
</s>
<s>
Without	O
RAM-based	O
framebuffers	B-Algorithm
,	O
collision	O
detection	O
is	O
also	O
complicated	O
.	O
</s>
<s>
The	O
TIA	O
has	O
hardware	O
collision	O
detection	O
for	O
all	O
of	O
these	O
objects	O
through	O
the	O
use	O
of	O
15	O
set/reset	O
flip-flops	B-General_Concept
and	O
stores	O
a	O
bitmap	O
of	O
collisions	O
,	O
that	O
are	O
typically	O
read	O
during	O
the	O
VBLANK	O
period	O
.	O
</s>
<s>
Lastly	O
,	O
the	O
TIA	O
has	O
inputs	O
for	O
reading	O
up	O
to	O
four	O
analog	O
paddle	O
controllers	O
using	O
potentiometers	B-Device
and	O
for	O
two	O
joystick	O
triggers	O
.	O
</s>
<s>
To	O
start	O
the	O
process	O
,	O
the	O
game	O
program	O
running	O
on	O
the	O
MOS	O
Technology	O
6502-based	O
CPU	B-Device
loads	O
the	O
TIA	O
's	O
registers	O
with	O
the	O
data	O
needed	O
to	O
draw	O
the	O
first	O
line	O
of	O
the	O
display	O
.	O
</s>
<s>
During	O
the	O
horizontal	O
blanking	O
period	O
between	O
lines	O
,	O
the	O
6502	B-General_Concept
quickly	O
changes	O
the	O
TIA	O
's	O
registers	O
as	O
needed	O
for	O
the	O
next	O
line	O
.	O
</s>
<s>
This	O
is	O
made	O
more	O
difficult	O
because	O
the	O
MOS	B-General_Concept
Technology	I-General_Concept
6507	I-General_Concept
in	O
the	O
2600	O
is	O
a	O
pin-reduced	O
version	O
of	O
the	O
6502	B-General_Concept
with	O
no	O
support	O
for	O
hardware	O
interrupts	B-Application
.	O
</s>
<s>
Generally	O
the	O
analog	O
side	O
of	O
the	O
display	O
system	O
generates	O
an	O
interrupt	B-Application
when	O
it	O
finishes	O
drawing	O
a	O
raster	O
line	O
and	O
is	O
getting	O
ready	O
for	O
the	O
next	O
one	O
.	O
</s>
<s>
The	O
interrupt	B-Application
triggers	O
the	O
code	O
needed	O
to	O
update	O
the	O
screen	O
,	O
and	O
then	O
returns	O
to	O
the	O
"	O
main	O
"	O
program	O
.	O
</s>
<s>
The	O
6507	B-General_Concept
left	O
these	O
pins	O
off	O
of	O
the	O
CPU	B-Device
to	O
save	O
money	O
,	O
however	O
it	O
does	O
have	O
a	O
"	O
RDY	O
"	O
pin	O
to	O
insert	O
wait	O
states	O
into	O
CPU	B-Device
bus	O
cycles	O
.	O
</s>
<s>
The	O
TIA	O
was	O
specifically	O
designed	O
to	O
use	O
the	O
RDY	O
pin	O
to	O
synchronize	O
the	O
CPU	B-Device
with	O
the	O
raster	O
line	O
timing	O
of	O
the	O
video	O
generated	O
by	O
the	O
TIA	O
:	O
when	O
the	O
CPU	B-Device
writes	O
to	O
a	O
certain	O
register	O
address	O
of	O
the	O
TIA	O
,	O
the	O
TIA	O
lowers	O
its	O
RDY	O
output	O
signal	O
until	O
the	O
beginning	O
of	O
the	O
next	O
line	O
,	O
a	O
"	O
wait	O
for	O
sync	O
"	O
command	O
.	O
</s>
<s>
This	O
suspends	O
the	O
operation	O
of	O
the	O
CPU	B-Device
until	O
the	O
start	O
(	O
color	O
clock	O
cycle	O
0	O
)	O
of	O
the	O
next	O
line	O
,	O
providing	O
a	O
measure	O
of	O
automatic	O
synchronization	O
.	O
</s>
<s>
The	O
intended	O
use	O
of	O
this	O
mechanism	O
is	O
for	O
the	O
CPU	B-Device
to	O
set	O
up	O
the	O
TIA	O
registers	O
for	O
the	O
following	O
line	O
before	O
the	O
TIA	O
reaches	O
the	O
end	O
of	O
the	O
current	O
line	O
,	O
then	O
write	O
to	O
the	O
register	O
that	O
triggers	O
the	O
synchronization	O
delay	O
via	O
RDY	O
,	O
throwing	O
away	O
a	O
variable	O
amount	O
of	O
CPU	B-Device
time	O
for	O
the	O
benefit	O
of	O
easier	O
video	O
timing	O
synchronization	O
.	O
</s>
<s>
Instead	O
,	O
it	O
is	O
left	O
to	O
the	O
CPU	B-Device
program	O
to	O
trigger	O
vertical	O
sync	O
signals	O
and	O
to	O
count	O
the	O
lines	O
in	O
each	O
frame	O
to	O
determine	O
when	O
a	O
vertical	O
sync	O
signal	O
should	O
be	O
generated	O
.	O
</s>
<s>
Like	O
for	O
the	O
RDY-wait	O
hardware	O
,	O
the	O
vertical	O
sync	O
signal	O
is	O
triggered	O
by	O
the	O
CPU	B-Device
writing	O
to	O
a	O
specific	O
TIA	O
register	O
address	O
.	O
</s>
<s>
Most	O
published	O
games	O
for	O
the	O
Atari	B-General_Concept
2600	I-General_Concept
generated	O
vertical	O
sync	O
after	O
either	O
every	O
262	O
or	O
every	O
263	O
lines	O
(	O
but	O
nothing	O
about	O
the	O
TIA	O
prevents	O
it	O
from	O
generating	O
frames	O
of	O
any	O
length	O
,	O
shorter	O
or	O
longer	O
,	O
though	O
the	O
resulting	O
video	O
displays	O
would	O
roll	O
vertically	O
on	O
normal	O
TVs	O
)	O
.	O
</s>
<s>
This	O
was	O
the	O
original	O
intention	O
of	O
the	O
system	O
:	O
to	O
run	O
the	O
handful	O
of	O
arcade	O
games	O
Atari	O
had	O
already	O
produced	O
like	O
Tank	B-Application
and	O
Pong	B-Application
.	O
</s>
<s>
In	O
these	O
cases	O
the	O
playfield	O
data	O
was	O
typically	O
laid	O
out	O
in	O
the	O
2	O
kB	O
ROM	B-Device
memory	I-Device
in	O
the	O
game	B-Protocol
cartridge	I-Protocol
.	O
</s>
<s>
As	O
each	O
line	O
used	O
20	O
bits	O
of	O
data	O
,	O
and	O
there	O
were	O
192	O
lines	O
on	O
an	O
NTSC	O
display	O
,	O
a	O
display	O
with	O
a	O
different	O
layout	O
on	O
every	O
line	O
needed	O
only	O
480	O
bytes	O
(	O
192	O
x	O
20	O
/	O
8	O
)	O
of	O
the	O
cartridge	B-Protocol
's	O
4	O
kB	O
to	O
hold	O
a	O
single	O
hard-coded	O
display	O
.	O
</s>
<s>
In	O
this	O
case	O
the	O
kernel	O
simply	O
advanced	O
20	O
bits	O
through	O
ROM	B-Device
for	O
every	O
line	O
as	O
the	O
TIA	O
advanced	O
down	O
the	O
screen	O
,	O
a	O
task	O
that	O
took	O
only	O
a	O
few	O
cycles	O
of	O
CPU	B-Device
time	O
.	O
</s>
<s>
A	O
key	O
advance	O
was	O
the	O
licensing	O
of	O
Space	B-Application
Invaders	I-Application
for	O
the	O
platform	O
,	O
which	O
required	O
many	O
more	O
player	O
graphics	O
to	O
draw	O
the	O
enemy	O
aliens	O
.	O
</s>
<s>
Another	O
advance	O
was	O
made	O
by	O
(	O
partially	O
)	O
coding	O
the	O
display	O
as	O
CPU	B-Device
instructions	O
instead	O
of	O
storing	O
it	O
as	O
fixed	O
data	O
in	O
ROM	B-Device
.	O
</s>
<s>
Adventure	B-Application
uses	O
this	O
concept	O
to	O
produce	O
a	O
wide	O
variety	O
of	O
maps	O
by	O
combining	O
different	O
portions	O
of	O
the	O
data	O
in	O
ROM	B-Device
,	O
jumping	O
back	O
and	O
forth	O
through	O
it	O
during	O
the	O
screen	O
drawing	O
.	O
</s>
<s>
This	O
allowed	O
the	O
game	O
to	O
have	O
30	O
rooms	O
,	O
which	O
would	O
have	O
otherwise	O
required	O
14	O
kB	O
of	O
ROM	B-Device
.	O
</s>
<s>
For	O
NTSC	O
format	O
(	O
part	O
number	O
CO10444	O
)	O
,	O
a	O
128-color	O
palette	O
is	O
provided	O
,	O
while	O
only	O
104	O
colors	O
are	O
available	O
for	O
PAL	B-Language
(	O
part	O
number	O
CO11903	O
)	O
.	O
</s>
