10 'SAVE"B:JOYSTEST.BAS",A
20 'SAVE"B:JOYSTEST.BAK"
30 REM Program to watch the joystick ports
40 REM Will Fastie - 23 Dec 81
50 REM David Reussow - Mar 8,1983
60 KEY OFF: SCREEN 1 :CLS :STRIG ON
70 F$=" ###  ### (##) (##) (##) (##)  "
80 CL$ = "S4;U6;D12;U6;L6;R12;L6"
90 A$ = "S04;BH4;L2;D2;U3;E1;R1;F1;D3;U2;L2"
100 B$ = "S04;BE4;BR1;L2;D2;L1;R3;E1;H1;E1;H1;L3;R1;D2;R2"
110 DR$ = "S04;D1;G5;L2;H1;U1;E1;R2;F3;R3;E2;U4;H2;L2;G2;D1;F2;R3;E5;R3;F2;D1;G2;L3;F3;BH3;E1;U1;D1;G1;D1;G2"
120 HEART$ = "S04;H6;U3;E2;R2;F2;R1;E2;R2;F2;D3;G6;L1"
130 CHERRY$ = "S04;C1;D1;R2;F1;D3;G2;L6;H1;U1;H1;U4;E2;R4;D1;F1;C1;E5;R1"
140 BELL$ = ""
150 LEMON$ = ""
160 DIAMOND$ = ""
170 BAR$ = ""
180 DRAW "BM0,0;M0,199;M319,199;M319,0;M0,0"
190 LOCATE 6,14: PRINT             "Joystick A"
200 LOCATE 8,8 : PRINT     "X    Y   S0   S1   S4   S5    "
210 AX2=AXX:AY2=AYY
220 AX=STICK(0):AY=STICK(1):AS1=STRIG(0):AS2=STRIG(1):AS3=STRIG(4):AS4=STRIG(5)
230 'AX=0:AY=0
240 LOCATE 9,6: PRINT USING F$;AX,AY,AS1,AS2,AS3,AS4
250 IF AX=0 AND AY=0 THEN AXX=40 :AYY=180 :GOTO 280
260 AXX=AX*319/255:AYY=AY*199/255
270 PRESET (AX2,AY2) :DRAW CL$+A$
280 PSET (AXX,AYY) : DRAW CL$+A$
290 DRAW "BM160,100"+CL$
300 LOCATE 16,14: PRINT            "Joystick B"
310 LOCATE 18,8: PRINT     "X    Y   S2   S3   S6   S7    "
320 BX2=BXX:BY2=BYY
330 BX=STICK(2):BY=STICK(3):BS1=STRIG(2):BS2=STRIG(3):BS3=STRIG(6):BS4=STRIG(7)
340 LOCATE 19,6: PRINT USING F$;BX,BY,BS1,BS2,BS3,BS4
350 IF BX=0 AND BY=0 THEN BXX=280 :BYY=180 :GOTO 380
360 BXX=BX*319/255:BYY=BY*199/255
370 PRESET (BX2,BY2) :DRAW CL$+B$
380 PSET (BXX,BYY) : DRAW CL$+B$
390 DRAW "BM160,185"+HEART$
400 DRAW "BM250,025"+DR$
410 GOTO 180