Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-12 - 43,50547/pltlib/v12a/unimpl/pltard.mac
There is 1 other file named pltard.mac in the archive. Click here to see a list.
SUBTTL	ARD driver -- PPDATA macro expansion

PRINTX	%PLTARD not fully implemented

	PPDATA	(ARD)

ARDNAM:	DEC	2	;Data for subroutine WHERE
	ASCII /ARDS/
	DEC	611	;Model 611

SUBTTL	ARD driver -- ARDS graphics terminal


;	  The ARDS is an Advanced Remote Display Station with a
;	Tektronix 611 Storage Display Unit.  It uses one 5-byte command to
;	set graphics mode at a particular coordinate, then uses 2-byte
;	commands thereafter for delta movement.
;
;	The one CSM has is no longer functional.


COMMENT &

^B STX	Enables FROM COMPUTER section
^C ETX	Disables FROM COMPUTER section
^E ENQ	Triggers answerback option
^G BEL	Rings bell
^H BS	Back up one character position
^I TAB	Move to next tab stop (optional)
^J LF	Move down one line
^L FF	Erase screen (X=-525, Y=+690) (Cursor at top left of screen)
^M CR	Move to left margin (X=-525)
^R DC2	Turn off local copy
^T DC4	Turn on local copy
^] GS	Set point mode
^^ RS	Long Vector
^_ US	Short vector

All plotting data has the MSB on, Alphabetic characters 100 to 177
Any Control character other than GS, RS, or US will turn off Plot Mode.

SET POINT MODE - Four characters to set absolute position.
Two characters for the X position, the last 2 for the Y position.
Each pair has the LSB of the first char as the sign bit.  The next
5 bits for the low order position.  The second char has the 5
high order bits of the position, the next-to-MSB ignored.

LONG VECTOR MODE - Four characters to specify relative movement
This uses the same format as SET POINT Mode, but the next-to-MSB
has meaning.  In the second character, (hi order X), this bit turns
on the beam if it is a 1.  In the last char, (hi order Y), this bit
being on will make the beam dotted.

SHORT VECTOR MODE - Two characters to specify relative movement.
The first char is the low order X, the second is the low order Y.
The LSB is the sign bit.
&  ;End of COMMENT
SUBTTL	ARD driver -- ARDMOV

ARDNAM:	DEC	2	;Data for PLOTS - IPLT=2 for subroutine WHERE
	ASCII	/ARDS/
ARDLEN==.-ARDNAM

	PPDATA	(ARD)		;Expand data area

;  Subroutine ARDMOV - move the pen with the pen up (down), uses T1

;  Calling sequence:
;	DMOVE	X,(the delta X of the movement)
;	PUSHJ	P,ARDMOV		;For up (or  PUSHJ P,ARDDWN  ;For down)
;	 *return*

ARDMOV:	TDZA	T1,T1		;Set up for an invisible beam
1RDDWN:	MOVEI	T1,40		;Set up for a visible beam
	TRC	T1,40		;40 is beam off, 0 is beam on
	HRRM	T1,VISIBL	;Store for later (self modifying code)
	MOVM	T2,X		;Get the absolute value of X
	MOVM	T3,Y		;Get the absolute value of Y
	CAIG	T2,^D1023	;Skip if extra long mode should be used
	CAILE	T3,^D1023	;Skip if long mode will work
	 JRST	ARDELN		;Go do the extra long mode plot
	CAIE	T1,0		;Skip if the line is to be visible
	 PJRST	ARDLNG		;Go do the long mode plot

ARDSHT:	CAIG	T2,^D31		;Skip if to big for long mode
	CAILE	T3,^D31		;Skip if small enough for short mode
	 PJRST	ARDLNG		;Go plot the line in long mode
	CAIN	T2,0		;Skip if X doesn't equal zero
	 JUMPE	T3,ARDPNT	;Jump if Y equals zero, go plot a point
	TXZE	P4,P4.LON	;Skip if in short mode already
	 OUTCHR	[SHTMOD]	;Tell the ARDS we are in short mode
	PJRST	XYOUT		;Go plot the segment and return

ARDPNT:	TXZN	P4,P4.LON	;Skip if in long mode already
	 OUTCHR	[LNGMOD]	;Tell the ARDS we are in long mode
	OUTSTR	[BYTE (7)100,140,103,100,SHTMOD,100,102,0]	;Up 1 dot, down 1
	POPJ	P,		;Return

ARDLNG:	TXON	P4,P4.LON	;Skip if we are in long mode
	 OUTCHR	[LNGMOD]	;Tell the ARDS we are in long mode
	PJRST	XYOUT		;Go plot the segment and return

;** Still in the FTARD conditional **
SUBTTL	ARD driver -- XYOUT
ARDELN:	TXON	P4,P4.LON	;Skip we are in long mode
	 OUTCHR	[LNGMOD]	;Tell the ARDS we are in long mode
	MOVE	T1,X		;Get X
	ASH	T1,-1		;Divide X by 2
	MOVEM	T1,X.NEWP	;Save for later
	SUB	X,T1		;Get half of X in X
	MOVE	T1,Y		;Get Y
	ASH	T1,-1		;Divide Y by 2
	MOVEM	T1,Y.NEWP	;Save for later
	SUB	Y,T1		;Get half of Y in Y
	PUSHJ	P,XYOUT		;Go plot the segment
	DMOVE	X,X.NEWP	;Get the second half to the line


;  Subroutine XYOUT -  this routine plots the line

;  Calling sequence:
;	DMOVE	X,[the delta X of the movement]
;	PUSHJ	P,XYOUT
;	*return*

XYOUT:	SETZ	T3,		;Set up to send DX to the ARDS
	PUSHJ	P,XYOUT0	;Send DX to the ARDS
	MOVEI	T3,1		;Set up to send DY to the ARDS, then
				; fall into XYOUT0 and return

XYOUT0:	MOVM	T1,X(T3)	;Get the X or Y value to use
	IDIVI	T1,^D32		;Divide into two 5-bit quanties
	ASH	T2,1		;Set up for the ARDS
	ADDI	T1,ARDOFF	; ...
	ADDI	T2,ARDOFF	; ...
	SKIPGE	X(T3)		;Skip if the input value was positive
	ORI	T2,1		;Inform the ARDS the number was negative
	JUMPN	T3,XYOUT1	;Jump if outputting DY
VISIBL:	ORI	T1,MODIFY	;Inform the ARDS if the line is visible
				; (0 - visible, 40 - not visible) (self modifying code)
XYOUT1:	OUTCHR	T2		;Output the low order bits
	TXNE	P4,P4.LON	;Skip if in short vector mode
	 OUTCHR	T1		;Output the high order bits
	POPJ	P,		;Return

CLRSCN:	BYTE (7)FF,0	;Formfeed
ORIGIN:	BYTE (7)LNGMOD,100,140,175,125,100,140,175,125,0
		;At sign, left accent, left brace, cap U
BEEP:	BYTE (7)7,0	;Control-G


LITARD:	LIT		;End of PLTARD.MAC