Skip to main content

Commands

Commands to draw an object always have counterparts which erase the same object. On a bit matrix terminal, erasure and drawing are almost identical operations. On a display list terminal, erasure involves searching the display list for an object with the specified characteristics and deleting it from the list. It is assumed that any terminal whose %TOERS bit is set can erase graphic objects.

The commands to draw objects run from 100 to 137, while those to erase run in a parallel sequence from 140 to 177. Other sorts of operations have command codes below 100. Meanwhile, the 20 bit in the command code says which type of addresses are used as arguments: if the 20 bit is set, absolute addresses are used. Graphics commands are given names starting with "%GO".

Graphics often uses characters. The %GODCH command is followed by a string of characters to be output, terminated by a zero. The characters must be single-position printing characters. On most terminals, this limits them to ASCII graphic characters. Terminals with %TOSAI set in the TTYOPT variable allow all characters 0-177. The characters are output at the current graphics cursor position (the lower left hand corner of the first character's rectangle being placed there), which is moved as the characters are drawn. The normal type-out cursor is not relevant and its position is not changed. The cursor position at which the characters are drawn may be in between the lines and columns used for normal type-out. The %GOECH command is similar to %GODCH but erases the characters specified in it. To clear out a row of character positions on a bit matrix terminal without having to respecify the text, a rectangle command may be used.

Example:

The way to send a simple line drawing is this:

%TDRST                 ;Reset all graphics modes.
%TDGRF ;Enter graphics.
%GOCLR ;Clear the screen.
%GOMVA xx yy ;Set cursor.
%GODLA xx yy ;Draw line from there.
<< repeat last two commands for each line >>
%TDNOP ;Exit graphics.