Download Print this page

Atari CX70 Operator's Manual page 51

Light pen

Advertisement

ATARI Light Pen Operator's Manual
an area of the screen bright enough to produce a light-pulse-present
output from the pen.
Different light pens have different levels of sensitivity. As you go
through the examples given in this manuali you may wish to experiment
to determine the minimum level of sensitivity of your pen by varying
the hue and luminance, levels in certain of the statements.
The values obtained from locations 564 and 565 are taken directly from
the scan counter inside the computer. Because of this/ they do not
match the desired physical screen positions for plotting and drawing
or for sensing the position of a specific block on the screen. To use
these values accurately/ they must be adjusted to match the normal
coordinate system; that is/ values from zero to some maximum value in
both the X and Y directions to relate to the graphics mode being used.
Location 564 will be found to contain values ranging from 74 to 227 or
from 0 to 5 because of the scanning memory used for the screen.
Location 565 will contain values between 16 and 111 for the same
reason. To adjust these values to begin at zero and continue to a
desired maximum/ the following sequence can be used:
X » (PEEK(564))+154
IF
(PEEK(564)<10 THEN X=X-128
Y = <PEEK(565))-16
This gives X values from 0-159 and Y values from 0-95. If you examine
Table 9. 1 of the ATARI BASIC Reference Manual/ you will notice that
these values correspond exactly to the block positions for GRAPHICS
mode 23 . This same number range will also be compatible with GRAPHICS
mode 0 if you just divide each number by 4 (GRAPHICS 0 has a 40 by 24
display rather than 160 by 96/ so division by 4 for any number
obtained will relate to the same physical segment of the screen).
Basics of Light Pen Operation - 47

Advertisement

loading