JOYST Subprogram
CALL JOYST (key-unit,x-return,y-return)
The
JOYST
subprogram
allow::;
you tu input information to the
computer
based
on
the
position
of
the lever
on
the Wired
Remote
Controllers accessory (available separately).
The
key-unit is a
numeric
expression
which, when evaluated, has a
value of 1 through 4.
• 1
=controller
1
• 2 = controller 2
.3,4,
and
5 = specific modes for console
keyboard
Specifying a
key-unit
of
3,
4,
or
~
maps
the console
keyboard
to a
particular
mode
of
operation, as explained in the
"KEY
subprogram" section.
If
key·unit
has
a value
of
3. 4,
or
5, the
computer
will
not
properly
detect
input from the remote
controllers_
Numeric
variables
must
be
used
for
x-return
and
yrcturn.
The
subprogram
assigns
an
integer value of
-4,
+4,
or 0 to
each
of
these variables,
based
on
the position
of
the joystick
at
that
time,
as
shown
below.
The
first value in
parentheses
is
x-return
and
the
second
value
is y-return.
;.>Nl:.W
>100
CALL
CLEAR
>110
CALL
CHARC42,"FFFFFFFFFF
FFFFFF
OO
)
>120
INPUT
"SCREEN COLOR?":S
>130
INPUT
"BLOCK
COLOR?": F
>140
CALL
CLEAR
>150
CAll
SCREEN(S)
>160
CALL
cDLDR(2,F,1)
>170
CALL
JOVST(2,X,V)
>180
A=X*2.2+16.6
>1906;Y·1.6+12.2
>200
CALL
HCHARCB,A,42)
>210
GOTO
170
>
RU
N
--screen
clears
SCREEN
COLDR?14
BLOCK
COlOR?9
--sc
reen
clears
--00
Lor
block
wi
II
mOve
around
screen
as
joystick
controller
;s
moved
(-4,0)
(OA)
(0,0)
•
(0,-4)
(4,0)
(Press
CLEAR
to
3tOP
the
program)
You
may then use
these
valut:'-s
in
your
program
by
referring to the
variable names.
You
will find more
detailed
instructions in
the
manual
enclosed with
the optional remote controls.
11·90
User's Reference Guide