LOGICAL FUNCTION LTORPB (IX,IY,NAMR,PB,IWICH) where IX,IY,NAMR,IWICH are integer variables. PB must be a six-element LOGICAL array.
The function LTORPB is used to determine whether a lightpen or pushbutton hit has occurred. If the result of the function is .TRUE, it indicates that a lightpen or pushbutton hit has occurred; if the result is .FALSE, it indicates no lightpen hit has occurred.
IX,IY are the coordinates at the end of the vector that caused the lightpen hit. The variable NAMR will contain the value of the name register at the time of the lightpen hit. Each element of the six-element LOGICAL array PB will contain either the logical .TRUE, or .FALSE, corresponding to ON or OFF for each of the six pushbuttons. IWICH will be either 1 or 2 depending on if a lightpen hit has occurred (IWICH = 1) or if a pushbutton hit has occurred (IWICH = 2).
LTORPB issues a .READ on lightpen or pushbutton interrupt to the display device handler. It returns if no interrupts have occurred, otherwise it reads the appropriate display registers and returns with appropriate output variables. Each interrupt from either lightpen or pushbuttons requires at least a pair of LTORPB's to be issued. The first LTORPB acts as an initialisation, telling VTA that interrupts are to be accepted, This first LTORPB can only return a .FALSE value. Interrupts that may have occurred prior to the first LTORPB have been ignored. The first LTORPB that occurs after an interrupt returns the lightpen and pushbutton conditions at the time of the last interrupt and instructs the handler to ignore further interrupts.
LTORPB is designed to wait for something to happen. One mode of use. is as follows:
100 IF(.NOT.LTORPB(IX,IY,NAMR,PB,IWICH)) GO TO 100
This obviously prevents anything else happening until a lightpen or pushbutton hit has occurred.
The call is:
CALL LINIT (IX,IY,IOPT,PB) where IX,IY,IOPT are integer expressions. PB is a LOGICAL six-element array
Subroutine LINIT unblanks XCROSS, the tracking cross display file. XCROSS must be declared EXTERNAL by the user's program and a call to subroutine DRAW must be made to link the tracking cross display file to the user's display files:
EXTERNAL XCROSS ............. CALL DRAW (0,XCROSS)
The tracking cross is initially displayed at the position (IX,IY). IOPT specifies the allowable tracking directions and can have the following values:
IOPT Allowable tracking directions 0 ALL AXIS DIRECTIONS 1 +X -X 2 +Y -Y 3 +X +Y -Y 4 +X -X +Y 5 -X +Y -Y 6 +X -X -Y
The LOGICAL array PB is used to hold the pushbutton values, .TRUE, or .FALSE, corresponding to ON or OFF for each of the six pushbuttons.
LOGICAL FUNCTION LREAD (IX,IY) where IX,IY are integer variables
The logical function LREAD tracks the cross for 2 raster positions and returns the VT15 coordinate position of the cross. (IX,IY) on return contain the new coordinates of the cross. The result of the function is .TRUE, if a hit on the cross occurred and (IX,IY) have been changed since the last call. LREAD is .FALSE, if a pushbutton hit occurred.
LREAD issues a .READ to VTA (the device handler for the VT15) asking for lightpen or pushbutton interrupts. If neither occur, control hangs up in a wait loop in LREAD. If a pushbutton interrupt occurs, the PB array is updated. To effectively track the cross, one must call LREAD in a loop.
The call is:
CALL LCLOSE
Subroutine LCLOSE clears the allowed tracking direction word (IOPT) and blanks off the tracking cross.
The PDP15 writing tablet (VW01) is a flat square inscribed gloss plate, with two sides raised. An ON-OFF switch is in the top left-hand corner. A LEFT-RIGHT switch may be found inside the VT04 cabinet. A pen is attached by a wire to the top right-hand corner of the tablet. Sparks appear at the pen tip and the two raised sides of the tablet are microphones which pick up the sound of the spark. If the pen is outside the writing area of the tablet no interrupts are generated. Also, if the path of the sound is blocked no interrupts are generated. To remove one source of blockage the tablet may be used in Left-hand or Right-hand mode (LEFT/RIGHTswitch). With the switch set to RIGHT, the tablet has its raised sides to NORTH and WEST and with the switch to LEFT, to NORTH and EAST.
The pen may be used in two modes, point and continuous:
The call is:
CALL TINIT (I) where I is an integer expression
Subroutine TINIT initialises the PDP15 writing tablet and sets the mode of use to single point (I=0) or to continuous mode (I=1).
LOGICAL FUNCTION TREAD (IA(I),N) where IA(I) is an element of an integer array N is an integer expression
Logical function TREAD reads the coordinates of the pen. The array starting at element IA(I), is a data buffer for TREAD to store the coordinates in. N defines the number of words in the area to be loaded by TREAD and is related to n, the number of coordinates required by:
N = 2 (n+1)
thus if n = 1; N = 4 (the first two words of IA are the header pair used by the .READ; the FORTRAN program can ignore their contents).
The result of the function has the value .FALSE, while waiting for data and the value .TRUE, when data is available. The X-coordinate is negated while the pen is depressed in continuous mode.
The call is:
CALL TCLOSE
Subroutine TCLOSE switches the interface off.