You are on page 1of 1

10000 rem *****************************

10100 rem * joystick test


10200 rem * adapted from ray carlsen
10300 rem *
10400 rem
11000 printchr$(147):rem clear screen
11999 rem
12000 rem joystick port 1
12010 print"port 1"
12020 print"------"
13000 rem north = bit 0
13010 p1=peek(56321)
13110 ifp1and1thenprint"nrth":goto14000
13120 print"{rvon}nrth{rvof}"
13999 rem
14000 rem south = bit 1
14010 ifp1and2thenprint"sout":goto15000
14020 print"{rvon}sout{rvof}"
14999 rem
15000 rem west = bit 2
15010 ifp1and4thenprint"west":goto16000
15020 print"{rvon}west{rvof}"
15999 rem
16000 rem east = bit 3
16010 ifp1and8thenprint"east":goto17000
16020 print"{rvon}east{rvof}"
16999 rem
17000 rem fire = bit 4
17010 ifp1and16thenprint"fire":goto20000
17020 print"{rvon}fire{rvof}"
17999 rem
20000 rem joystick port 2
20010 print"{down}port 2"
20020 print"------"
20100 p2=peek(56320)
20999 rem
21000 rem north = bit 0
21010 ifp2and1thenprint"nrth":goto22000
21020 print"{rvon}nrth{rvof}"
21999 rem
22000 rem south = bit 1
22010 ifp2and2thenprint"sout":goto23000
22020 print"{rvon}sout{rvof}"
22999 rem
23000 rem west = bit 2
23010 ifp2and4thenprint"west":goto24000
23020 print"{rvon}west{rvof}"
23999 rem
24000 rem east = bit 3
24010 ifp2and8thenprint"east":goto25000
24020 print"{rvon}east{rvof}"
24999 rem
25000 rem fire = bit 4
25010 ifp2and16thenprint"fire":goto50000
25020 print"{rvon}fire{rvof}"
25999 rem
50000 printchr$(19):rem home cursor
50010 goto12000:rem next test cycle

You might also like