Atari XL Handbook page 151

Table of Contents

Advertisement

Graphics
141
program uses mode 10, which is a nine-colour
mode. Mode 10 is explained later in the chapter.
10
REM ABSTRACT XIO
20
GRAPHICS 10
30
XMAX=79: YMAX=191
40
POKE 704, 56
50
POKE 705, 24
60
POKE 706, 168
70
POKE 707, 88
80
SETCOLOR 0, 4, 10
90
SETCOLOR 1, 10, 8
100
SETCOLOR 2, 12, 4
110
SETCOLOR 3, 13, 14
120
SETCOLOR 4, 14, 6
200
X
=
RND(O)
*
XMAX
210
Y
=
RND(O)
*
YMAX
220
X2 = X+RND(O)
*
(XMAX - X)
230
Y2 = Y+RND(O)
*
(YMAX - Y)
240
C
=
RND(O)
*
8
250
COLOR C
260
PLOT X2, Y2
270
DRAWTO X2, Y
280
DRAWTO X, Y
290
POSITION X, Y2
300
POKE 765, C
310
XIO 18, #6, 0, 0,
"5:"
320
GOTO 200
The final graphics command is LOCATE. This
command moves the invisible graphics cursor to a
point on the screen and reads the colour of the pixel
at that point into a variable.
LOCATE X, Y, C
stores the colour (the colour register number) at X,
Y into C. The next program plots a point in a

Advertisement

Table of Contents
loading

Table of Contents