# # VT100 VIDEO DISPLAY COMMAND PROGRAM. CALLING SEQUENCE IS # CALL UVT100(CMD,N1,N2), WHERE CMD IS ONE OF THE COMMANDS IN # THE PARAMETER LIST BELOW, AND N1 AND N2 ARE OPTIONAL PARAMETERS # DEPENDING UPON CMD. SEE THE UVT100 USER'S MANUAL FOR MORE DETAILS. # # AUTHOR: GLEN HOFFING # DATE: 24-FEB-81 # SUBROUTINE UVT100(CMD,N1,N2) IMPLICIT INTEGER (A-Z) DIMENSION PRL(6) PARAMETER CUP = 1, #CURSOR POSITION REPORT CUU = 2, #CURSOR UP CUD = 3, #CURSOR DOWN CUF = 4, #CURSOR FORWARD CUB = 5, #CURSOR BACK DECDWL = 6, #DOUBLE WIDTH LINE DECDHL = 7, #DOUBLE HEIGHT LINE DECRC = 8, #RESTORE CURSOR DECSC = 9, #SAVE CURSOR DECSWL = 10, #SINGLE HEIGHT, SINGLE WIDTH LINE ED = 11, #ERASE IN DISPLAY EL = 12, #ERASE IN LINE SGR = 13, #SELECT GRAPHIC RENDITION NEL = 14, #NEXT LINE SCS = 15, #SELECT CHARACTER SET SM = 16, #SET MODE RM = 17, #RESET MODE ANSI = 18 #SET TERMINAL TO VT100 MODE (VT52 CMD) BYTE OUTBUF(10) OUTBUF(1) = 27 #SET FIRST CHARACTER TO 'ESCAPE' CODE DO I = 2,10 OUTBUF(I) = 0 IF (CMD == CUP) [ #CURSOR POSITION OUTBUF(2) = "[" IF (N1 > 0 .AND. N1 < 25) ENCODE(2,10,OUTBUF(3)) N1 #...ROW N1 OUTBUF(5) = ";" IF (N2 > 0 .AND. N2 < 81) ENCODE(2,10,OUTBUF(6)) N2 #...COLUMN N2 OUTBUF(8) = "H" LEN = 8 ] ELSE IF (CMD == CUB) [ #CURSOR BACK OUTBUF(2) = "[" IF (N1 > 0 .AND. N1 < 81) ENCODE(2,10,OUTBUF(3)) N1 #...N1 COLUMNS OUTBUF(5) = "D" LEN = 5 ] ELSE IF (CMD == CUD) [ #CURSOR DOWN OUTBUF(2) = "[" IF (N1 > 0 .AND. N1 <25) ENCODE(2,10,OUTBUF(3)) N1 #...N1 ROWS OUTBUF(5) = "B" LEN = 5 ] ELSE IF (CMD == CUF) [ #CURSOR FORWARD OUTBUF(2) = "[" IF (N1 > 0 .AND. N1 < 81) ENCODE(2,10,OUTBUF(3)) N1 #...N1 COLUMNS OUTBUF(5) = "C" LEN = 5 ] ELSE IF (CMD == CUU) [ #CURSOR UP OUTBUF(2) = "[" IF (N1 > 0 .AND. N1 < 25) ENCODE(2,10,OUTBUF(3)) N1 #...N1 ROWS OUTBUF(5) = "A" LEN = 5 ] ELSE IF (CMD == DECDHL) [ #DOUBLE-HEIGHT LINE OUTBUF(2) = "#" IF (N1 == 1) OUTBUF(3) = "4" #...BOTTOM HALF ELSE OUTBUF(3) = "3" #...TOP HALF LEN = 3 ] ELSE IF (CMD == DECDWL) [ #DOUBLE-WIDTH LINE OUTBUF(2) = "#" OUTBUF(3) = "6" LEN = 3 ] ELSE IF (CMD == DECRC) [ #RESTORE CURSOR OUTBUF(2) = "8" LEN = 2 ] ELSE IF (CMD == DECSC) [ #SAVE CURSOR OUTBUF(2) = "7" LEN = 2 ] ELSE IF (CMD == DECSWL) [ #SINGLE-WIDTH,SINGLE-HEIGHT LINE OUTBUF(2) = "#" OUTBUF(3) = "5" LEN = 3 ] ELSE IF (CMD == ED) [ #ERASE DISPLAY OUTBUF(2) = "[" IF (N1 == 0) #...CURSOR POSITION TO END OF SCREEN OUTBUF(3) = "0" ELSE IF (N1 == 1) #...START OF SCREEN TO CURSOR POSITION OUTBUF(3) = "1" ELSE OUTBUF(3) = "2" #...ENTIRE SCREEN OUTBUF(4) = "J" LEN = 4 ] ELSE IF (CMD == EL) [ #ERASE LINE OUTBUF(2) = "[" IF (N1 == 0) #...CURSOR POSITION TO END OF LINE OUTBUF(3) = "0" ELSE IF (N1 == 2) #...ENTIRE LINE OUTBUF(3) = "2" ELSE #...START OF LINE TO CURSOR POSITION OUTBUF(3) = "1" OUTBUF(4) = "K" LEN = 4 ] ELSE IF (CMD == SGR) [ #SELECT GRAPHIC RENDITION OUTBUF(2) = "[" IF (N1 == 7) #...REVERSE FIELD ON OUTBUF(3) = "7" ELSE OUTBUF(3) = "0" #...REVERSE FIELD OFF OUTBUF(4) = "m" OUTBUF(5) = 8 LEN = 5 ] ELSE IF (CMD == NEL) [ #CURSOR TO NEW LINE OUTBUF(2) = "E" LEN = 2 ] ELSE IF (CMD == SCS) [ #SELECT CHARACTER SET IF (N1 == 0) #...G0 CHARACTER SET OUTBUF(2) = "(" ELSE #...G1 CHARACTER SET OUTBUF(2) = ")" IF (N2 == 0) #...UNITED KINGDOM CHARACTER SET OUTBUF(3) = "A" ELSE IF (N2 == 1) #...ASCII CHARACTER SET OUTBUF(3) = "B" ELSE #...SPECIAL GRAPHICS SET OUTBUF(3) = "0" LEN = 3 ] ELSE IF (CMD == SM) [ #SET MODE OUTBUF(2) = "[" OUTBUF(3) = "?" IF (N1 > 0 .AND. N1 < 10) #...MODE TO SET ENCODE(1,5,OUTBUF(4)) N1 OUTBUF(5) = "h" LEN = 5 ] ELSE IF (CMD == RM) [ #RESET MODE OUTBUF(2) = "[" OUTBUF(3) = "?" IF (N1 > 0 .AND. N1 < 10) #...MODE TO RESET ENCODE(1,5,OUTBUF(4)) N1 OUTBUF(5) = "l" LEN = 5 ] ELSE IF (CMD == ANSI) [ #ANSI MODE OUTBUF(2) = "<" LEN = 2 ] DO I = 1,LEN #CONVERT ANY BLANKS TO ZEROES IF (OUTBUF(I) == " ") OUTBUF(I) = 0 CALL GETADR(PRL,OUTBUF) PRL(2) = LEN CALL WTQIO(4608,5,20,,,PRL) 5 FORMAT (I1) 10 FORMAT (I2) RETURN END