10000 REM ********************* tt routine 19/04/95 *******************
10010 REM           MKII/MKIII/MKIV Teletype Operation Routine
10020 REM
10030 REM
10040 REM *************************************************************
11000 '
11001 ' *** Setup ***
11002 '
11010 DATA tt
11020 MK=95:PRINT CL$
11030 LOCATE ,SP:PRINT "Do you wish a hard copy (y/n)"
11040 S$=INKEY$:IF S$="" THEN 11040
11050 IF S$="y" OR S$="Y" THEN GOSUB 9250:REM set to 30 cps
11060 LOCATE ,SP:PRINT "Ready to transmit to Brewer"
11070 LOCATE ,SP:PRINT "Press CTRL-X to retype command"
11080 LOCATE ,SP:PRINT "Press HOME when done"
11090 ON COM(CP%) GOSUB 30000:COM(CP%) ON
12000 '
12001 ' *** Main Loop ***
12002 '
12010 CH$=INKEY$:IF CH$="" THEN 12000
12020 IF CH$=Q2$ THEN 13000
12030 IF CH$=Q1$ THEN GOSUB 20000:GOTO 12000
12040 IF ASC(CH$) > MK THEN CH$=CHR$(ASC(CH$) AND MK)
12050 PRINT#7,CH$;:PRINT CH$;:IF S$="y" OR S$="Y" THEN PRINT#4,CH$;
12060 GOTO 12000
13000 '
13001 ' *** Clean Up and Exit ***
13002 '
13010 GOSUB 20000:COM(CP%) OFF
13020 IF S$="y" OR S$="Y" THEN GOSUB 9270:REM set to 120 cps
13030 RETURN
20000 '
20001 ' *** 0.5 Second Break ***
20002 '
20010 COM(CP%) OFF
20020 BV=INP(AD):OUT AD,(BV OR 64)
20030 X=0.5:GOSUB 7220
20040 BV=INP(AD):OUT AD,(BV AND 191)
20050 ON COM(CP%) GOSUB 30000:COM(CP%) ON
20060 PRINT#7,CR$;:X=0.2:GOSUB 7220
20070 RETURN
30000 '
30001 ' *** Communications Routine ***
30002 '
30010 I1$="":BC=1:ON ERROR GOTO 30200
30020 WHILE BC<>0
30030   BC=LOC(7):I2$=INPUT$(BC,7)
30040   I1$=I1$+I2$:I2$=""
30050 WEND
30060 PRINT I1$;:IF S$="y" THEN PRINT#4,I1$;
30070 ON ERROR GOTO 3100:RETURN
30200 RESUME 30060
65529 REM proper last line