Listing of file='JOYPLT.BAS;01' on disk='vmedia/joystick_sound-sector.ccvf'
1 REM **************************************** 2 REM JOYSTICK PLOTTING TEST PROGRAM 3 REM **************************************** 4 REM 5 REM THE OUTPUT FROM ONE OF THE FOUR JOYSTICKS IS 6 REM DISPLAYED ON THE SCREEN, WITH OR WITHOUT A 7 REM TRAIL OF WHERE IT HAS BEEN. THE ONLY "MASSAGING" 8 REM OF THE RAW INPUT IS TO DIVIDE BY 2. DEPENDING 9 REM ON THE JOYSTICK POTS, OTHER FIXES MAY BE NEEDED. 10 PLOT 6,6,12,27,24:PRINT "X-Y JOYSTICK TEST":PRINT 15 REM PAGE MODE USED TO AVOID PROBLEM AT BOTTOM RIGHT OF SCREEN 20 PRINT "HOLD DOWN THE PUSH-BUTTON TO LEAVE A TRAIL" 25 PRINT "CHANGE COLOR USING THE COLOR KEYS" 30 INPUT "SMALL OR LARGE DOT (S OR L) ";S$ 40 INPUT "JOYSTICK NUMBER (0-3): ";JN 45 PB = 8* 2^ JN:REM MASK FOR PUSH-BUTTON 50 IF JN < 0 OR JN > 3 GOTO 40 55 REM INITIALISE VALUES THEN ENTER INFINITE LOOP 57 SA= 176:SC= 177:REM FOR INTECOLOR 3650 (USE 48,49 FOR CCII) 60 JN= 160+ JN* 2:REM FOR INTECOLOR (USE 32 FOR CCII) 65 REM #### NOTE #### DO NOT USE I/O PORT 48 ON A 3650 ! 70 CC = 1 80 PLOT 12,29,17 90 LX = 0:LY = 0 100 REM *** MAIN LOOP *** 105 REM CHECK THE PUSH BUTTON 110 GOSUB 1000 115 REM INITIATE A CONVERSION (ANY DATA WILL DO FOR OUTPUT) 120 OUT JN,1 125 REM READ THE X-COORD (ANY "CHANNEL" WILL DO) 130 X = INP (JN) 135 REM START ANOTHER CONVERSION ("CHANNEL" NO. IS IMPORTANT) 140 OUT JN+ 1,1 145 REM READ THE Y-COORD 150 Y = INP (JN+ 1) 155 REM "MASSAGE" THE INPUT DATA - DIVIDE BY 2 160 X = INT (X/ 2):Y = INT (Y/ 2) 165 REM THESE CHECKS ARE UNNECESSARY, BUT SHOW HOW ITS DONE 170 IF X < 0 THEN X = 0 180 IF X > 127 THEN X = 127 190 IF Y < 0 THEN Y = 0 200 IF Y > 127 THEN Y = 127 210 IF S$ = "S" GOTO 300 215 REM PLOT LARGE DOT (CONVERT TO CHARACTER COORDS FIRST) 220 X = INT (X/ 2):Y = 31- INT (Y/ 4) 225 IF T$ = "Y" GOTO 240 230 PLOT 3,LX,LY,32 240 PLOT 3,X,Y,96 250 LX = X:LY = Y 260 GOTO 100 295 REM PLOT SMALL DOT. RUB OUT OLD DOT IF NO TRAIL. 300 IF T$ = "Y" GOTO 310 305 PLOT 6,0,2,LX,LY,255 310 C = PEEK (33278):IF C> 16 AND C< 24 THEN CC= C- 16 315 PLOT 6,CC,2,X,Y,255 320 LX = X:LY = Y 330 GOTO 100 1000 REM *** CHECK FOR A PUSH-BUTTON *** 1010 REM 1020 OUT SA,14 1030 T= INP (SA) 1040 T$ = "Y" 1050 IF T AND PB THEN T$ = "N" 1060 RETURN