Compucolor.org – Virtual Media

Listing of file='JOYSTK.BAS;01' on disk='vmedia/chip_128-sector.ccvf'

100 REM  ROUTINE TO READ A JOYSTICK AND RETURN A VALUE OF 0-9
110 REM
20000 FOR TM= 1TO 100:NEXT
20010 T= 0
20020 OUT 7,13:I= INP (1):IF I> 251AND I< 255THEN T= T- 3
20030 OUT 7,11:I= INP (1):IF I> 251AND I< 255THEN T= T+ 5
20040 OUT 7,9:I= INP (1):IF I> 251AND I< 255THEN T= T+ 7
20050 OUT 7,7:I= INP (1):IF I> 251AND I< 255THEN T= T+ 9
20060 IF T> 12THEN T= T- 6
20070 T= ABS (T)- 1
20080 IF T= - 1THEN T= 0
20090 OUT 8,255:RETURN