@V7 54 2 -5
@L2 GREE1247
80
@L3 COUK1247
80
@V9 0
@YCHAPTER 8 - MUSS USER MANUAL
@G@RCHAPTER 8 - GRAPHICS FACILITIES@G
@V10 1 9 116
@S28.1 CORE GRAPHICS FACILITIES
@T% 10
@BThis section describes the graphics facilities
provided in MUSS which conforms to the GSPC CORE System
Graphics Standard (It is abbreviated as "CORE" in the latter description).  A co
mplete description of the CORE
may be found in @GComputer Graphics@G 13 (3) Aug. 79 "Status report
of the Graphics Standard Planning Committee".
For the benefit of users unfamiliar with the CORE Standard,
there follows a brief outline of the concepts on which it is
based.
@BThe CORE communicates with devices through a KERNEL, which
contains a device independent part for
interpreting commands from CORE and translating them into calls
on any of several seperate device drivers.
Device types currently supported are:
@
@Q 5
@
@M1) Genisco display.
@N2) Benson Plotter.
@N3) MC68000 memory mapped display.
@N4) Hewlett Packard Plotter.
@BThe facility exists for driving workstations containing only
a KERNEL from a CORE/KERNEL running on another machine in the network.
This is achieved by providing a special device type in the KERNEL which
is driven in the same way as other devices.  However, for this device the
KERNEL merely passes the commands as MUSS messages to
the KERNEL in the workstation where it finally appears on a pre-selected
device.
@BA subset of the full CORE system, called SUBSET is also
provided.
It consists of a subset of all CORE commands.  It is
smaller and more efficient than the full CORE, and should be used
wherever possible for the production of 2D line drawings.
The full CORE system is available as two libraries UTIL:CORE and
UTIL:KERNEL and the SUBSET is part of the system library.
@S38.1.1 Core System Overview
@BThe CORE provides a suite of procedures for producing graphical
output, and receiving interactive input.  Facilities supported fall into six cat
egories as follows:
@
@Q 7
@
@M1  output primitives
@N2  viewing
@N3  picture segmentation and naming
@N4  attributes
@N5  control
@N6  input primitives
@BThe full CORE version as implemented has the following specification:
@
@Q 5
@T% 20
@
Output level 3C%- dynamic output with full image transformation@
Input level 1%- no input@
Dimension level 2%- three dimensional@
Hiddensurf level 1%- no hidden surface removal@
@BThe SUBSET has the following specification:
@
@Q 5
@T% 30
@
Output level 1%-  basic output@
Input level 1%-  no input@
Dimensional level 1%-  2D@
Hidden surface level 1%- no hidden surface removal@
@BThis implies that the facilities provided for the SUBSET are as follows:
@
@Q 7
@
@MFull set of 2D output primitives
@NMost of primitive attributes
@NTwo dimensional viewing
@NNo selective picture modification
@NFull view surface control
@NTemporary segments (no retained segment)
@BIn the CORE, the user constructs a picture by invoking "output
primitives", placed in a coordinate system called "world
coordinate space".  This is user-defined, and may be two or three-dimensional,
expressed in arbitrary units which the user might regard as metres, miles, inche
s etc.
This space must be eventually mapped to the physical display
device, or "view surface", and this mapping comes under the user's
control and is called the "viewing operation".
@BThe CORE must be initialised by first issuing INITIALISE.CORE.  Also before
a view surface can be used, it must be INITIALISED and then SELECTED.  When
it is no longer required, it is DESELECTED and TERMINATED.  More than
one device may be initialised at any one time.  An INITIALISED but
DESELECTED device may be SELECTED again
providing the current one is first DESELECTED.
@BThus a typical sequence of commands to use the CORE
for a general user is as follows:
@U 15
@
@
INITIALISE.CORE(OUTER.LEV, INNER.LEV, DIM, HIDDEN.SURFACE.LEV)
DEFINE.DEVICE(LOGICAL.DEV, DESTINATION, DEV.TYPE)
INITIALISE.VIEWSURFACE(LOGICAL.DEV)
SELECT.VIEWSURFACE(LOGICAL.DEV)
SET.WINDOW(XMIN, XMAX, YMIN, YMAX)
SET.NDCSPACE.2(XMAX, YMAX)
SET.VIEWPORT.2(XMIN, XMAX, YMIN, YMAX)
      1       (Attribute or
      1           Output commands)
      1
DESELECT.VIEWSURFACE(LOGICAL.DEV)
TERMINATE.VIEWSURFACE(LOGICAL.DEV)
TERMINATE.CORE()
@BHere the command DEFINE.DEVICE is an additional command
which is added into the CORE for creating a correspondence
between a logical device number of the CORE and
an actual device on the MUSS system.
@BAs many users only require to produce 2D drawings on A4 size
paper, some other commands are added into CORE ( & SUBSET )
which combine several of those used above.
Thus, a user
who is producing 2D drawing on A4 paper may use a sequence of
commands such as:
@U 10
@
@
    INIT.CORE.STR (DESTINATION, DEV.TYPE)
    A4.FRAME (WORLD.X.MAX, WORLD.Y.MAX)
          1
          1
          1      (Drawing pictures by using
          1          SUBSET  commands  )
          1
    TERM.STR ()
@SOutput Primitives
@BThe CORE provides four primitives for graphical output,
as follows
@
@Q 5
@
@Mline
@Ntext
@Nmarker
@Npolygon
@BThe CORE maintains a conceptual "current drawing position" (CP)
measured in the world coordinate system.  CP is changed when some output
commands, e.g. drawing line,marker etc. are executed.  The appearance of
the output, produced by the output primitives is determined by global "output pr
imitive attributes",
each of which may take one of a number of standard values.  The
attributes are:
@
@Q 8
@
@Mline style
@Nline width
@Ncolour
@Nintensity
@Ncharacter string attributes
@Nmarker symbol
@Npen
@SThe Viewing Operation
@BIt is convenient to consider two dimensional (2D) and three-dimensional
(3D) viewing separately.
@BThe user places output primitives in a 2D world coordinate system.
To specify @Gwhat@G part of the complete picture is to be displayed,
a rectangular "window" over the world coordinate space may be defined.
Only primitives appearing within this window are considered for
mapping onto the view surface.  To specify @Gwhere@G on the view surface
the contents of the window are to be displayed, the user defines
a "viewport" on the view surface.
@B3D viewing is inherently more complex than the 2D case, due to the
fact that the user is specifying 3D objects, and the display device
is only 2D.  This solution to this mismatch is to use a "projection",
which transforms a 3D object onto a 2D projection plane.
@BCorresponding to the 2D viewing window, is a 3D view volume.  Only
primitives appearing within this volume are considered further.  The
user next specifies a projection, which may be parallel or perspective,
onto a projection plane.  Next a window over the projection plane may be
specified, and contents of this window are mapped to a viewport
specified over the view surface.
@BThe foregoing description of the viewing operation is intended as a
brief synopsis.  For a more complete specification relating to the
CORE commands described later the user is referred to the CORE
Standard.
@SPicture Segmentation and Naming
@BThe user introduces structure into the picture by grouping
together output primitives into named picture segments, called
"retained segments".  Retained segments have attributes, as follows:
@
@Q 5
@
@Mvisibility
@Nhigh lighting
@Ndetectability
@Nimage transformation.
@BThe image of a retained segment may be scaled, shifted and rotated
using an "image transformation".
@SAttributes
@BCommands are provided to enquire and modify the current values
of all the attributes mentioned above.
@SControl
@BThe user has control over the selection of view surfaces, and
the changing of displayed pictures.  CORE system errors are reported
to the user, with an indication of their severity.
@SInput Primitives
@BThe CORE considers input devices as falling into "logical"
categories, as follows:
@Q 8
@T% 20 30
@
@
%Pick%e.g. lightpen@
%Keyboard@
%Button@
%Stroke%e.g. tablet stylus@
%Locator%e.g. tablet or joystick@
%Valuator%e.g. control dial@
@S38.1.2 Commands
@BOnly the commands for the SUBSET
are described in this section. They are categorised in 5 classes:
@
@
@Q 6
@
@M1. CONTROL COMMANDS
@N2. GRAPHICAL OUTPUT COMMANDS
@N3. VIEWING COMMANDS
@N4. ATTRIBUTE COMMANDS
@N5. PICTURE SEGMENTATION AND NAMING COMMANDS
@SControl Commands
@
@
1) @JDEFINE.DEVICE (I, [C], C)I
@BThis command creates a correspondence between a viewsurface number
and a specific physical device.  P1 specifies the viewsurface number
which is defined by the user.
P2 specifies the destination for the output in the case of
devices which are connected as terminals or when device type is a
memory mapped device it specifies a particular device while more than
one device of the same device type are available.  P3 specifies the device type.
5 device types which have been defined are:@
@Q 6
@T% 10 20
@
@
%KER%denotes the virtual device KERNEL@
%GEN%denotes the raster color device GENISCO@
%BEN%denotes the BENSON plotter@
%MOT%denotes the memory mapped MOTOROLA monitor@
%HPP%denotes the HEWLETT PACKARD plotter@
@BP3
specifies the destination for the output in the case of
devices which are connected as terminals or @Kfor@K
memory mapped @Kdevices@K it specifies
a particular device @Kif@K more than one of the same
device type are available.
@B@KDevices which are driven by a batch or online output
stream (i.e. pen plotters and some colour displays) have the
stream number monitored as the result.  This stream is
automatically selected/deselected by the
SELECT.VIEW.SURFACE/DESELECT.VIEW.SURFACE commands and so is
only made available for stream switching for monitoring
purposes.  Devices not requiring an output stream have a
positive value for the result.  A negative result is set to
indicate command failure.@K
@
@
@
2) @JINIT.CORE.STR ([C], C)I
@BThis command @Kcalls DEFINE.DEVICE to define a viewsurface@K as the destinatio
n for the
graphics output @Kof@K the type specified by P2.
It initialises the CORE(SUBSET) and the viewsurface, and selects the viewsurface
.
@BP1 specifies the destination to which the graphics output is sent.
@BP2 specifies the device type.
@B@KThe result is the output stream number (if required) and
is given only for monitoring purposes.  A negative result
indicates command failures.@K
@
@
@
3) @JTERM.STR ()
@BThis command deselects the selected viewsurface, terminates the
viewsurface and terminates the CORE(SUBSET).
@
@
@
4) @JA4.FRAME (I, I)
@BThis command sets the mapping from the world coordinate space on to
the physical coordinate space of A4 page size.
@BP1, P2 specify the XMAX and YMAX respectively in the
world coordinate system, i.e. the window is set to (0.0, P1, 0.0, P2).
@
@
@
5) @JINITIALISE.CORE (I, I, I, I)
@BThis command initialises the CORE(SUBSET) and sets all default parameters.  P1
through P4 respectively specify Output, Input, Dimension and
Hiddensurface Levels.  For the SUBSET, P1 through P4 may only have values = 1.
@
@
@
6) @JTERMINATE.CORE ()
@BThis command terminates the CORE(SUBSET) and releases all graphics devices.
@
@
@
7) @JINITIALISE.VIEW.SURFACE (I)
@BThis command initialises the view surface specified by P1 ready for use
by the CORE(SUBSET).  The encoding of P1 in this and following commands is
defined by the command DEFINE.DEVICE.
@
@
@
8) @JTERMINATE.VIEW.SURFACE (I)
@BThis command terminates the view surface specified by P1.
@
@
@
9) @JSELECT.VIEW.SURFACE (I)
@BThis command selects the view surface specified by P1 for use.
@KFor devices requiring an output stream it is selected here
and is assumed to remain selected until DESELECT.VIEW.SURFACE
is called.@K
@
@
@
10) @JDESELECT.VIEW.SURFACE (I)
@BThis command deselects the view surface specified by P1,
@Kand selects the output stream in use prior to using CORE (SUBSET).@K
@
@
@
11) @JNEW.FRAME ()
@BThis command causes a 'new frame' action on the currently selected
view surface.  In the case of CRT devices the screen is cleared.  For a
plotter or printer device, the drawing surface is moved on to a clean area.
@SGraphical Output Primitive Commands
@BNote.  In this chapter 'R' in a parameter list signifies a REAL value.
@BMost of graphical output PRIMITIVE commands affect the
current position (CP), a USER -
maintained value that defines the current
drawing position IN WORLD COORDINATES.  The CP is used to determine
the starting point for LINE, POLYLINE and TEXT.
The CP is initialised to (0,0) when the Graphics
System is initialised.
@
@
@
1) @JMOVE.ABS.2(R, R)
@BThis command sets CP to the position
(x,y) as specified by P1 and P2 respectively.
@
@
@
2) @JMOVE.REL.2(R, R)
@BThis command is used to increment the CP by
(x,y) specified by P1 and P2 respectively.
@
@
@
3) @JLINE.ABS.2(R, R)
@BThis command describes a line
drawn from CP to the
(x,y) position specified by P1 and P2
respectively.  The final position
becomes the new CP.
@
@
@
4) @JLINE.REL.2(R, R)
@BThis command describes a line
from CP to
(CP+x,CP+y) where x and y are specified
by P1 and P2 respectively.  The final position
becomes the new CP.
@BThe following two commands may not be issued from an
interactive terminal since they involve
vector parameters.
@
@
@
5) @JPOLYLINE.ABS.2([R],[R],I)
@BThis command describes a connected
sequence of lines.
P1 and P2 respectively specify arrays of x and y
coordinates, each of length n specified by P3.  The
sequence starts at CP and runs next to (x.array [1],
y.array [1]) and ends at (x.array [n], y.array [n]).  The
final position becomes the new CP.
@
@
@
6) @JPOLYLINE.REL.2([R],[R],I)
@BThis command is similar to POLYLINE.ABS.2
except that P1 and P2 respectively specify
arrays of x and y relative coordinates, each
of length n specified by P3.
@
@
@
7) @JMARKER.ABS.2(R, R)
@BThis command sets CP to the point (x,y) given by
P1 and P2 respectively, and displays the current
marker symbol.
@
@
@
8) @JMARKER.REL.2(R, R)
@BThis command is similar to MARKER.ABS.2
except that the CP is incremented by (x,y)
as specified by P1 and P2 respectively
before the marker is drawn.
@BThe following two commands may not be
issued from an interactive terminal since they
involve vector parameters.
@
@
@
9) @JPOLYMARKER.ABS.2([R],[R],I)
@BThis command describes a sequence of
marker symbols to be drawn.  As with POLYLINE,
P1 and P2 respectively specify arrays of x and y
coordinates, each of length n given by
P3.  The current marker is drawn
at (x.array [1], y.array [1])
through (x.array [n], y.array [n]).  The CP
is updated to (x.array [n], y.array [n]).
@
@
@
10) @JPOLYMARKER.REL.2([R],[R],I)
@BThis command is similar to POLYMARKER.ABS.2
except that P1 and P2 respctively specify
arrays of x and y relative coordinates, each of
length n given by P3.
@
@
@
11) @JTEXT([C], I)
@BThis command displays the text string specified
by P1, of length given by P2, at CP, which remains
unaffected by the command.  Spaces within the string
to be drawn should be indicated in an interactive
mode by !20!.
@SViewing Commands
@BThe following commands are used to control the 2D viewing operation.
@
@
@
1) @JSET.WINDOW(R,R,R,R)
@BThis command allows the user to specify a rectangular window
over his world coordinate space.  P1 through P4 specify XMIN, XMAX,
YMIN and YMAX of the sides of the rectangle respectively in world
coordinates. The
default window is (0,1,0,1).
@
@
@
2) @JSET.CLIP.W (I)
@BThis command controls window clipping.  P1 = 0 sets clipping off
and P2 = 1 sets clipping on.  Window clipping is on by default.
@
@
@
3) @JSET.NDC.SPACE.2(R, R)
@BThis command defines the size of the 2D normalised device coordinate
space for all view surfaces used by the CORE(SUBSET).  P1 and P2 specify width
and height respectively, and must both lie in the range 0 to 1.  At
least one parameter must have a value of 1.  The default NDC space has
width=1 and height=1
and is mapped onto a square area of the view surface.  By
defining a rectangular NDC space it is possible to utilise the
entire view surface.
Specifically
@
@Q 4
@T% 10 30
@
%GENISCO%: x = 1.0, y = 0.8@
%MOTOROLA%: x = 1.0, y = 0.73@
%HEWLETT PACKARD%: x = 0.722, y = 1.0@
@
@
If this command is not issued,
default NDC space is assumed.
@
@
@
4) @JSET.VIEWPORT.2(R, R, R, R)
@BThis command defines the extent of the current viewport rectangle.
P1 through P4 specify XMIN, XMAX, YMIN, YMAX of the rectangle
respectively, expressed in normalised device coordinates.  The
default is the entire NDC space.
@
@
@
5) @JMAP.NDC.TO.WORLD.2(R, R, ^R, ^R)
@BThis command is used to determine the world coordinate position
corresponding to a NDC position.  P1 and P2 respectively define
the point (x,y) in NDC space.  The corresponding position in world
coordinates, (x1,y1) is returned in P3 and P4.
@
@
@
6) @JMAP.WORLD.TO.NDC.2(R, R, ^R, ^R)
@BThis command does the inverse of the previous command.  The
world position (x,y) defined by P1 and P2 is mapped to the NDC
position (x1,y1) which is returned in P3 and P4.
@BThe following enquiry commands are supported.  In each command,
the value of the specified viewing parameters are copied into
the specified parameters.
@
@
@
7) @JINQ.WINDOW(^R, ^R, ^R, ^R)
@BThe parameters are:
@
@Q 5
@
@MP1  XMIN
@NP2  XMAX
@NP3  YMIN
@NP4  YMAX
@
@
@
8) @JINQ.CLIP.W(^I)
@BThe parameters are:
@
@
@MP1  clipping status: 0 = off, 1 = on.
@
@
@
9) @JINQ.NDC.SPACE.2(^R, ^R)
@BThe parameters are:
@
@Q 3
@
@MP1  width
@NP2  height
@
@
@
10) @JINQ.VIEWPORT.2(^R, ^R, ^R, ^R)
@BThe parameters are:
@
@Q 5
@
@MP1  XMIN
@NP2  XMAX
@NP3  YMIN
@NP4  YMAX
@SAttribute Commands
@BThe following commands are concerned with
modifying Graphics System attributes.  No
graphical output is produced directly.
@BIn the CORE System, colour is specified by an
"index" value into a table of available colours.
The relationship of index value to
real colour is device dependent.  Specifically,
@
@Q 12
@
(a) GENISCO
@
@
@
@T% 10 30
%@OINDEX@O%@OCOLOUR@O@
%  0%White@
%  1%Red@
%  2%Black@
%  3%Blue@
%  4%Yellow@
%  5%Purple@
@
@
@U 11
(b) MOTOROLA - the colour index is bit encoded as follows:
@
@3
          @O                        @O
          @O|      |   |   |   |   |@O
                   |   |   |   |
                   |   |   |    ------ Red
                   |   |    ---------- Blue
                   |    -------------- Green
                    ------------------ Tint
@0
@
@
The effect of setting Bit 3 is to darken the colour
selected by Bits 0 - 2.
@
@
(c) BENSON
@BThree pens are available, and are selected using SET.PEN (qv).  It is
the responsibility of the user to ensure that the desired pens are loaded.
@
@
@
(d) VIP
@B@K4K colours are available but only sixteen can be used at one time.
Sixteen colour indices exist each of which can be associated with
a particular shade.@K
@
@
@
1) @JDEFINE.COLOUR.INDEX(DEVICE,INDEX,RED,BLUE,GREEN)
@B@KThis applies only to the VIP and defines the colour combination of
RED, BLUE and GREEN (range 0-15) to be associated with the
specified colour INDEX (0-15).@K
@
@
@
2) @JSET.LINE.INDEX(I)
@BThis command @Kselects@K the colour to be used when
drawing lines or markers.  P1 specifies the colour
index.  The default index is 1.
@
@
@
3) @JSET.TEXT.INDEX(I)
@BThis command defines the colour to be used when drawing text.  P1
specifies the colour index.  The default index is 1.
@
@
@
4) @JSET.PEN (I)
@BThis command applies only to the Benson plotter and is used to select
one of three pens (P1 = 0, 1 or 2).  Pen 0 is selected by default.
@
@
@
5) @JINQ.LINE.INDEX(^I)
@BThis command returns the current value of the line index in P1.
@
@
@
6) @JINQ.TEXT.INDEX(^I)
@BThis command returns the current value of the text index in P1.
@
@
@
7) @JINQ.PEN (^I)
@BThis command returns the number of the currently selected pen in P1.
@
@
@
8) @JSET.MARKER.SYMBOL(I)
@BThis command enables the user to
select a marker symbol from the standard
symbol table to become the current marker
symbol.  P1 specifies the index into this
table.  The Graphics System marker table
contains the following markers:
@Q 12
@
@
@T% 10 30
%@OTable Index@O%@OMarker Symbol@O@
@T% 15 35
%1%.@
%2%+@
%3%*@
%4%0@
%5%X@
%6%>@
%7%_@
%8%^@
%9%@2#@0@
@
@
The Graphics System default marker symbol is ".".
@
@
@
9) @JINQ.MARKER.SYMBOL(^I)
@BThis command returns the index value of the
currently selected marker symbol in P1.
@
@
@
10) @JINQ.TEXT.EXTENT.2([C], I, ^R, ^R)
@BThis command is used to discover the extent of the character
string specified by P1, if drawn at the CP on view surface P2.  The extent in th
e
x direction is returned in P3, and in the y direction in P4.
@
@
@
11) @JSET.LINE.STYLE(I)
@BThis command enables the user to specify in which style lines
and polygons are drawn.  P1=1 specifies solid lines, P2=2 specifies
dashed lines.  Solid lines are assumed by default.
@
@
@
12) @JINQ.LINE.STYLE(^I)
@BThis command returns the value of the currently selected linestyle in P1.  See
SET.LINESTYLE for a description of the "linestyle" attribute.
@
@
@
13) @JSET.CHAR.SIZE (R, R)
@BThis command specifies the character size to be used when drawing text.
P1 gives the width and P2 the height of each character in world coordinates.
This command has effect only on the Benson and Hewlett Packard plotters.  The Ge
nisco and Motorola
displays do not have sufficient screen resolution.
@
@
@
14) @JSET.CHAR.PATH (I)
@BThis command specifies the direction in which text strings are to be drawn.
Meaningful values of P1 are as follows :
@
@Q 5
@
@MP1 = 0 : right. This is the default.
@NP1 = 1 : up
@NP1 = 2 : left
@NP1 = 3 : down
@
This command is only meaningful for the Gensico, Benson
and Hewlett Packard plotters.
@
@
@
15) @JINQ.CHAR.SIZE (^R, ^R)
@BThe height of a character in world coordinates is returned in P1, the
width in P2.
@
@
@
16) @JINQ.CHAR.PATH (^I)
@BThe currently set character path attribute is copied into P1. See SET.CHAR.PAT
H
for a description of meaningful values.
@SPicture Segmentation Commands
@BFor the SUBSET, only temporary, nameless, segments are provided.
These commands are provided for completeness only, and need not be invoked
if the user does not wish to adhere rigourously to the CORE Standard.
@
@
@
1) @JCREATE.TEMPORARY.SEGMENT ()
@BThis command creates a new temporary segment into which subsequent output
primitives will be placed.
@
@
@
2) @JCLOSE.TEMPORARY.SEGMENT ()
@BThis command closes the currently open temporary segment.
@
@
@
3) @JINQ.OPEN.TEMPORARY.SEGMENT (^I)
@BThis command is used to check whether there is currently a temporary
segment open. If a segment is open, the command returns the value 1
in P1 otherwise 0.
@S28.2 GKS GRAPHICS
@P
@S28.3 DIRECT ACCESS GRAPHICS
@BSeveral of the machines supporting MUSS have special graphics
hardware which can be accessed directly.
@S38.3.1 ATV Graphics
@BThe ATV systems have a low resolution colour graphics raster
scan monitor which is directly driven through a pixel store.  This
store can be accessed from user level as common segment 62 and no
protection is provided for simultaneous usage by more than one process
as the ATV systems are regarded as single-user workstations.
@BThe monitor has 360 x 264 4-bit pixels addressed consecutively
from the start of the common segment with 2 pixels in each byte.
The most significant 4 bits of each byte correspond to the left hand
pixel of the pair.  There is a space at the end of the segment which
is used as a pseudo V-store for controlling the effect of the pen
and tablet associated with the display.  The user can write to
some of these pseudo-control words to control
scaling between @Kthe tablet@K and @Kthe display@K,
@Kto select a display cursor or 'paintspot' option and the
colour of the cursor or 'paintspot' displayed.  When the
cursor option is selected a cursor will be moved around the screen
which represents pen position.  The paint option allows the user
to add or remove colour to or from individual pixels, by means of the
pen.  The image created in this way can then be processed or recorded
from the pixel store.@K  The remainder of this area
is used by the system and should not be written to by the user.
@BThe resolution of the tablet is in general much higher than that
of the display so the display is used as a window into the space
described by the tablet.  The origin of this window on the tablet
(the upper left hand corner) can be set in the V-lines X0, Y0 and the
viewing area magnified or reduced by scaling factors XS, YS.  The current
pen position is available X, Y and a STATUS word controls
the display at this point on the screen and indicates when the user
is required to take some action.  When the START bit in the STATUS
word is unset, the position of the pen on the surface of the tablet
is constantly monitored by the values X and Y and may be displayed
on the screen by a cursor in the form of an '+'.  The dimensions of
the cursor are controlled by the setting of the V-lines CURSOR.LENGTH
and HEIGHT, and it may be switched off by resetting the 'cursor display'
bit in STATUS.  When the pen (or similar device) next issues a function
request, (when the pen is depressed for example) the cursor is removed,
the START bit set and no further monitoring occurs until it is reset
by the user.  This allows the user process to alter the display at
X, Y before handing control back to the pen.
@SPseudo V-lines for control of the Tablet
@BThe following table indicates the layout of the V-lines, at
addresses in common segment 62.@
@X % *
@3
@
@M@OAddress@O    @O<------16------>@O@
@N %FFE0    |@O       X        @O|@
@N %FFE2    |@O       Y        @O|@
@N %FFE4    |@O       X0       @O|@
@N %FFE6    |@O       Y0       @O|@
@N %FFE8    |@O       XS       @O|@
@N %FFEA    |@O       YS       @O|@
@N %FFEC    |@O  CURS.LENGTH   @O|@
@N %FFEE    |@O  CURS.HEIGHT   @O|@
@N %FFF0    |@O  PEN FUNCTION  @O|@
@N %FFF2    |@O     STATUS     @O|@
@N %FFF4    |@O   @KPCL | PCR@K    @O|@
@N %FFF6    |@O   @KSCL | SCR@K    @O|@
@N          |@O                @O|@
@X %%
@0
@T% 30
@
@
X@IThe X coordinate value of the current pen position on the tablet.@
@
Y@IThe Y coordinate value of the current pen position
on the tablet.@
@
X0@IThe X coordinate value of the origin (upper left hand corner)
of the current display area on the tablet.@
@
Y0@IThe Y coordinate value of the origin above.@
@
XS@IThe scaling value in the X-plane required to scale the
tablet coordinates down to pixels.@
@
YS@IThe scaling value in the Y-plane.@
@
CURS.LENGTH@IThe length of the horizontal cursor line in pixels.@
@
CURS.HEIGHT@IThe height of the vertical cursor line in pixels.@
@
@KPCL@Ipaint colour for lefthand pixel.@
@
PCR@Ipaint colour for righthand pixel.@
@
SCL@Ishade colour for lefthand pixel (i.e. these colour
bits are removed).@
@
SCR@Ishade colour for righthand pixel.@K@
@
FUNCTION@IThe number of the function currently issued by the
pen/puck/digital handset.@
@3
@Q 8
@T% 22
@
@K%STATUS   @O        16        @O@
%        |@O |          | | | @O|@
%         |            | | |@
%         |            | | |@
%         |            | |  ---CURSOR DISPLAY@
%          ---START    |  -----CURSOR ON SCREEN@
%                       ------PAINT@K@
@0
@SPen/Tablet Communication Interface
@BWhen the START bit is reset, characters are received from
the pen in the following format:@
@
@M<@@><FUNCTION><SIGN><XXXX><SIGN><YYYY><cr>
@
@
where@
@T% 30
@
<FUNCTION>@Iis the pen function where@
@I0 - Touching the Tablet surface@
@I1 - Depressed@
@
<SIGN>@Iis '+' or '-' where '-' values are ignored.@
@
<X> and <Y>@Iare bytes representing 4 bit hexadecimal numbers such that
the number 0 -> 9 represents the values 0 - 9 and A -> F represent the
values 10 - 15.@
@
<cr>@Iis the carriage return character.@
@
To deal with this interface a mode word is maintained to indicate the
current position in the format when a character is received.  It has
the following significance:@
@
@
@M0 - OUT OF SYNC (Waiting for an '@@')
@N1 - AWAITING FUNCTION
@N2 - AWAITING SIGN
@N3 - FORMING X
@N3 - AWAITING SIGN
@N5 - FORMING Y
@N6 - AWAITING <cr>.
@F
