.TITLE GTTEK .PSECT GT .ENABL LC ; ; Subroutine GTTEK packs the X,Y coordinate addresses into the ; TEK 40xx series fashion. These packed coordinates are then ; shipped off to the GT graphics terminal handler/buffer. ; ; FORTRAN calling sequence: ; ; CALL GTTEK(IX,IY) ; ; where IX is an integer 0-1023 ; and IY is an integer 0-779 ; ; ; Subroutine GTTEKI is for either graphics or alpha cursor input. ; The GT buffer is flushed, and the crosshair cursor is displayed for ; graphics cursor input. When a key is typed, the key and the X,Y ; coordinates of the cursor will be returned. For alpha cursor input, ; the cursor position is returned, without displaying graphics cursor. ; ; FORTRAN calling sequence: ; ; CALL GTTEKI(IX,IY,CHAR,GRAF) ; ; where IX is the X coordinate of the cursor ; IY is the Y coordinate of the cursor ; CHAR is the terminating character ; GRAF is a flag for graphics/alpha input ; = 1 ==> graphics input, else alpha ; ; h gregg 2/83 ; ;-------------------------------------------------------------------------- ; .MCALL QIOW$,DIR$ O.X = 2 O.Y = 4 O.CHAR= 6 O.GRAF= 10 BUFFER: .BLKB 10 RPR: QIOW$ IO.RPR!TF.BIN,,1,,,, GRAF: .BYTE 35,33,32 GRAFL= . - GRAF ALPHA: .BYTE 33,5 ALPHAL= . - ALPHA .EVEN .PAGE ; ; Subroutine GTTEK ; ; initialize; get Y value ; GTTEK:: MOV #BUFFER,R1 ; get our buffer's address MOV @O.Y(R5),R0 ; get the Y value CALL 10$ ; set the high byte MOV @O.Y(R5),R0 ; get the low byte of Y ... BIC #177740,R0 ; cleaning up any high stuff BIS #140,R0 ; and setting the Y byte flag. MOVB R0,(R1)+ ; and put it in our buffer. ; ; Now for the X value ; MOV @O.X(R5),R0 ; get the X value CALL 10$ ; and set the high byte MOV @O.X(R5),R0 ; get it again for the low byte BIC #177740,R0 ; clear out the trash BIS #100,R0 ; set the low X flags MOVB R0,(R1)+ ; and buffer it ; ; Now ship the buffer to the GT handler ; MOV #4,R0 ; 4 byte buffer MOV #BUFFER,R1 ; buffer starts here CALL GTA ; and ship it out RETURN ; all done - just leave. ; ; Subroutine for setting the high byte of X or Y. ; 10$: .REPT 3 ASL R0 ; shift all 5 bits to high byte .ENDM SWAB R0 ; make it easier to use BIC #177740,R0 ; clear out the unnecessary stuff BIS #40,R0 ; tell us it's a high byte MOVB R0,(R1)+ ; and move it to our buffer RETURN ; all done here - go back .PAGE ; ; Subroutine GTTEKI ; ; flush buffer, prompt and read ; GTTEKI::CALL GTF ; clear out any stuff in the buffer MOV GTLUN,RPR+Q.IOLU ; make sure we've got the LOON CMP #1,@O.GRAF(R5) ; check for alpha or graphics input BNE 10$ ; not a 1, must be for alpha MOV #GRAF,RPR+Q.IOPL+6 ; set the graphics prompt MOV #GRAFL,RPR+Q.IOPL+10 ; and its length BR 20$ ; and go get the position 10$: MOV #ALPHA,RPR+Q.IOPL+6 ; set the alpha prompt MOV #ALPHAL,RPR+Q.IOPL+10 ; and its length 20$: DIR$ #RPR ; read with prompt MOV #BUFFER,R0 ; get a pointer to the buffer ; ; now get and return the information ; MOVB (R0)+,@O.CHAR(R5) ; get the character typed CALL 30$ ; retrieve the X coordinate MOV R1,@O.X(R5) ; and return it CALL 30$ ; retrieve the Y coordinate MOV R1,@O.Y(R5) ; and return it also RETURN ; and now go on home ; ; subroutine to unpack X,Y coordinates ; 30$: MOVB (R0)+,R1 ; get the high byte .REPT 5 ASL R1 ; and shift it to proper position .ENDM BIC #176037,R1 ; clear out any unwanted trash MOVB (R0)+,R2 ; get the low byte BIC #177740,R2 ; clean it up ADD R2,R1 ; combine the low and high bytes RETURN ; and return the coordinate .END