Download Print this page

Atari CX70 Operator's Manual page 50

Light pen

Advertisement

ATARI Light Pen Operator's Manual
For each position on the screen< there is a specific memory location
assigned in the RAM that controls uihat is displayed at that location.
If you could freeze time>
you could look at a counter inside the
machine to determine exactly which horizontal and vertical memory
location is currently being accessed.
This is where the ATARI Light Pen is useful. Let's take the original
picture and add the pen to it.
Figure A.2
Television Screen Plus Light Pen
If the pen is pressed to the surface of the screen/ it will let in
very little outside light. By looking at the scan method shown in
Figure A. 2 — left to right/ retrace/ and so forth — you will notice
that the light pen can cover very few of the lines at one time. Since
the screen surface remains lit for only a short time after the beam
passes by/ the light pen will only see a light pulse for a very small
part of the total screen scan time.
When the light pulse is seen by the pen/ the computer accesses the
memory location that controls the specific area over which the pen
happens to be resting.
The computer console contains special hardware that is Connected to
the light pen through the controller ports. This hardware allows the
pen to capture the horizontal and vertical scan addresses when (and
if) a light-present pulse is received from the pen. These captured
addresses are stored in registers located at decimal 54284
(horizontal-hex *D40C) and 54285 (vertical-hex 4D40D>. These same
values can also be accessed at two other memory locations. These are
564 and 565 (horizontal and vertical hex $234 and $235).
By peeking at these locations during program operation/ you can
determine exactly where the pen is resting on the screen. These values
are changed 60 times each second if and when the pen is sitting on
Basics of Light Pen Operation - 46

Advertisement

loading