80 R1$=CHR$($12):R0$=CHR$($92)
90 PRINTCHR$($93)

95 PRINTCHR$($13);
97 FORI=0TO4
100 J=JOY(I):POKE$30C,I:SYS$FF56:J1=PEEK($30C):J2=PEEK($30D):J3=PEEK($30E)
105 X1=255-J1:X2=255-J2

110 A=JAND2048
120 X=JAND1024
130 L=JAND512
140 R=JAND256
150 B=JAND128
160 Y=JAND64
170 SL=JAND32
180 SR=JAND16
190 UP=JAND8
200 DN=JAND4
210 LT=JAND2
220 RT=JAND1

230 PRINT"PORT";I;"- ";BIN$(J1),BIN$(J2),BIN$(J3),J;CHR$($9D);"     "

240 IFJ=-1THENPRINT"  NOT CONNECTED";:GOTO800

300 PRINTR0$;" ";:IFATHENPRINTR1$;
310 PRINT" A ";
320 PRINTR0$;" ";:IFBTHENPRINTR1$;
330 PRINT" B ";

400 PRINTR0$;" ";:IFXTHENPRINTR1$;
410 PRINT" X ";
420 PRINTR0$;" ";:IFYTHENPRINTR1$;
430 PRINT" Y ";

450 PRINTR0$;" ";:IFLTHENPRINTR1$;
460 PRINT" L ";
470 PRINTR0$;" ";:IFRTHENPRINTR1$;
480 PRINT" R ";

500 PRINTR0$;" ";:IFSLTHENPRINTR1$;
510 PRINT" SELECT ";
520 PRINTR0$;" ";:IFSRTHENPRINTR1$;
530 PRINT" START ";

600 PRINTR0$;" ";:IFDNTHENPRINTR1$;
610 PRINT" DOWN ";
620 PRINTR0$;" ";:IFUPTHENPRINTR1$;
630 PRINT" UP ";
640 PRINTR0$;" ";:IFLTTHENPRINTR1$;
650 PRINT" LEFT ";
660 PRINTR0$;" ";:IFRTTHENPRINTR1$;
670 PRINT" RIGHT ";

800 PRINT:PRINT:NEXT
999 GOTO95
