modes 0 and 1, the screen is cleared to nominal black, in
mode 2 it is cleared to the background color.
Carriage Return - 0D
This moves the to the first character position in the
active field that is on the character path.
Home - 1E
This moves the cursor to the upper left character
position on the display.
Shift-Out - 0E
This invokes the G1 set into the GL which makes it
available as ASCII codes 20 through 7F.
Shift-In - 0F
This invokes the G0 set into the GL which makes it
available as ASCII codes 20 through 7F.
Single-Shift-2 - 19
This invokes the G2 set into the GL which makes it
available as ASCII codes 20 through 7F. This shift only
affects the byte immediately following the 19 code after
which the GL is restored to its former contents.
Single-Shift-3 - 1D
This invokes the G3 set into the GL which makes it
available as ASCII codes 20 through 7F. This shift only
affects the byte immediately following the 19 code after
which the GL is restored to its former contents.
Escape - 1B
This code is used to start various escape sequences
which are documented elsewhere.
Transmission Control
The codes SOH(01), STX(02), ETX(03), EOT(04), ENQ(05),
ACK(06), DLE(10), NAK(15), SYN(16), and ETB(17) are reserved
for use at other layers of the OSI model. If they do make it
through to the presentation layer, then they are ignored and
have no effect whatsoever. In the OSI model, these codes
would be used in lower layers to implement error-free
transmission of data packets with some type of network
handshaking protocol.
Device Control
The codes DC1(11), DC2(12), DC3(13), and DC4(14) are
also reserved for use of other layers of the OSI model. They
are ignored if they appear in the NAPLPS data stream.
Null - 00
This code is used at other layers of the OSI model. It
is ignored if encountered in the NAPLPS data stream.
Bell - 07
This code is used to beep or make some other audible
sound which is implementation dependent.
Cancel - 18
This code is used to terminate the processing of all
currently executing macros. Execution resumes at the next
code following the terminated macro call. The CAN code is
not queued, it has an immediate effect even if there are
other NAPLPS codes in a buffer which have not yet been
processed.
Service Delimiter - 1A
This code is discarded if encountered in the NAPLPS
data stream. It is intended to act as a delimiter for the
transmission of unprotected field contents back to the host
system. The full format is as follows:
NSR - begins the transmission
DOMAIN - only required if the domain settings are
different from the default.
FIELD - marks the beginning of the field contents. The
field coordinates are used to identify the
field.
TEXT - only required if the text size is different
from the default
POINT SET - only if required to locate the first
character position in the field.
SELECT COLOR - only when the text color changes. If
mode 0, then use SET COLOR.
Character codes including code set changes to use
supplementary, mosaics, DRCS. May also include control
codes for cursor positioning and repeat codes.
END - marks the end of each field.
The sequence between FIELD and END is repeated for
each unprotected field being transmitted.
POINT SET - tell the host where the current drawing
point is.
Service Delimiter - marks the end of transmission
This facility is akin to a dialog box. The host uses
NAPLPS to draw the screen and define unprotected fields. The
host can also transmit text into the unprotected fields and
the terminal program should store that text and allow the
user to edit it. Then upon receiving some keystroke or mouse
click, the terminal program will transmit the edited
contents of all unprotected fields back to the host. The
only characters guaranteed to be transmitted are those in
the ASCII, supplementary, mosaic and DRCS sets. This
facility is modeled upon that provided by block-mode
terminals.
If the terminal program allows arbitrary NAPLPS
sequences to be entered into unprotected fields, then that
facility can be used to implement graphical e-mail. The user
uses a mouse to draw images in the unprotected field along
with any text they type. The entire sequence of NAPLPS codes
required to redraw the same image on another person's screen
is recorded and transmitted back to the host system when the
user requests the fields to be sent by pressing a key or
clicking somewhere. If the user has a pen input device such
as a graphics tablet, they could even create handwritten
messages using the NAPLPS scribble PDI (INCREMENTAL LINE).
Unprotected fields which have NOT been changed, need
not be transmitted back to the host. If no fields are
changed and the transmission is initiated, then the minimum
transmission consists of the NSR, DOMAIN, POINT SET, and
Service Delimiter. Users can only edit unprotected fields
when the text cursor is on (visible).
NSR - 1F
Non-Selective Reset is used to reset most of the
environment settings to their default state as follows:
The G0, G1, G2, G3, C0 and C1 sets are reset to have
their default initial contents and the GL and GR are also
reset to their initial state.
The DOMAIN parameters are set to the default as
specified earlier in this document.
Any text settings from the TEXT PDI or from the C1 set
are reset to the default. In addition the active field is
set to the default of the unit screen.
Any TEXTURE parameters are set to the default, but the
programmable fill patterns are NO cleared.
The color mode is set to mode 0 and the current drawing
color is set to nominal white, however the color palette is
NOT cleared
If the two bytes immediately after 1F are between 40
and 7F, then the cursor is repositioned. The row number is
taken from bits 6 through 1 of the first byte, the column
address is from bits 6 through 1 of the second byte. Row 0,
column 0 is the upper left corner of the display. The actual
character position is constrained to be within the display
area even if the row column address extends beyond this
area.
NOTE: cursor positioning by the NSR code is NOT THE
SAME as cursor positioning via the CURSOR POSITION code 1C.
They use a different origin, and the NSR positioning takes
place AFTER the text parameters are reset to the default.
Because of this it is usually NOT POSSIBLE for NSR character
positioning to register properly with that of code 1C.
C1 Control Set
These are additional control codes which are used for
NAPLPS specific operations. There is a bit of complexity
involving the use of the C1 set in 7-bit mode. Because of
the need to ensure that the normal ASCII control characters
are still available (some are used outside of NAPLPS), it is
not possible to replace the C0 set with the C1 set.
Therefore, in 7 bit mode, the C1 set is placed in the middle
of the GL area from 40 through 5F and a C1 code is invoked
by preceding it with an ESC (1B) code. This means that the
GL area can still be used as normal for PDI's, ASCII text or
whatever, since C1 codes must be escaped. In 8 bit mode,
there is no conflict as the C1 set is always available at
the beginning of the upper 128 character codes from 80
through 9F. There is no shifting or escaping required in 8
bit mode.
In this section, the eight bit codes are given for the
C1 set. They can be converted to 7 bit codes by swapping
bits 8 and 7.
DEF MACRO - 80
This code is used to begin macro definition. The byte
following the DEF MACRO must be between 20 and 7F. It is the
macro number which is being defined or replaced. If the
second byte is not within this range, then the two bytes are
discarded and decoding begins with the next byte.
All characters after the macro number are recorded but
not executed up to the macro termination. The termination is
indicated by receipt of another DEF MACRO or one of DEFP
MACRO, DEFT MACRO, DEF DRCS, DEF TEXTURE, or END. The
terminating control character is NOT stored and neither is
the preceding ESC which is transmitted on a 7-bit link.
If a macro reference is encountered during macro
definition, then the reference is stored as is. It is NOT
expanded at definition time. If the macro definition is
null, i.e. no definition bytes before the terminator, then
any existing macro with that number is deleted. All macros
are deleted by the RESET PDI.
It is NOT necessary to have the macro G-set currently
invoked in order to define a macro.
These macros (and DEFP macros) may be associated with a
keystroke or mouse click to be initiated by the user, but if
so, they are only available to be activated when the cursor
is on. Because the execution of these macros could place the
terminal program in an undetermined state, it is the
responsibility of the host system to restore the state of
the terminal program to a known state after the cursor is
turned off. The terminal program must ensure that any such
macro is executed to completion without being interleaved
with any incoming NAPLPS codes.
DEFP MACRO - 81
This command is the same as DEF MACRO except that the
stream of characters making up the macro definition are
executed as well as recorded. If a DEFP MACRO contains a
reference to the macro number that is being recorded, then
that reference should be treated as an undefined macro. This
also applies to nested references, i.e. while defining macro
1 with the DEFP MACRO, a reference to macro 2 is
encountered. Upon expanding macro 2 a reference to macro 1
is encountered. Because the definition of macro 1 is not yet
complete, macro 1 is treated as an undefined macro.
DEFT MACRO - 82
This command defines a transmit macro. This is a string
of bytes which is intended to be transmitted back to the
host computer. The data bytes in a DEFT MACRO are not
executed and are not necessarily NAPLPS data. They are only
useful if the terminal program provides some means of
causing the macro to be transmitted back to the host when a
function key or mouse click event occurs. This is similar to
defining a programmable function key except that the NAPLPS
spec doesn't deal directly with the keys. It would be up to
the terminal program to allow the user to associate a given
macro with a given key combination. The transmit macros must
always be available to the user for transmission, even when
the cursor is off.
The transmit macros use the same pool of 96 macro
numbers as do other macros. There is only 1 macro set.
Macros linked to keystrokes should be defined starting
with code 20 and macros that are not linked should be
defined in reverse order starting with code 7F. The terminal
program should provide at least 8 macros associated to
keystrokes. In my opinion, 12 is a better number for PC's as
there are 12 function keys available. In fact, the cluster
of INS,DEL,HOME,END,PGUP,PGDN and the 4 arrow keys should
also be associated with transmit macros.
DEF DRCS - 83
This command is used to define a DRCS character shape
in a manner similar to macro definition. If the byte
following DEF DRCS is between 20 and 7F it is used as the
code for the DRCS character to define or redefine. If the
code is not within the range then the DEF DRCS code and the
incorrect code are discarded.
Next comes a stream of NAPLPS data which is used to
define the shape of the DRCS character. This stream is
terminated by one of END, DEF MACRO, DEFP MACRO, DEFT MACRO,
DEF TEXTURE, or another DEF DRCS. The standard states that
the NAPLPS stream defining the character should be executed
as it is received, but is NOT displayed on the screen. It is
instead used to modify an in-memory bitmap which is used
later to display the DRCS character. It should also be
possible to store the NAPLPS stream as is done with macros,
and execute the stream at the time the DRCS character is to
be displayed. This would provide far better scalability of
the characters. You could also convert the NAPLPS stream
into a scalable format that is native to the graphical
environment you are using. This would allow somewhat faster
display when the DRCS is used. Note that you can use macros
and other DRCS characters as part of the definition
sequence.
All NAPLPS code received during DRCS definition will
have its usual effect on the state of the terminal program,
except that any drawing operations do NOT affect the display
area. However, things like palette changes WILL still be
visible as they are part of the global state. All these
state changes will remain in effect after DRCS definition is
finished.
When rendering the NAPLPS code into the in-memory
bitmap, the aspect ratio of the bitmap will be the same as
the character field dimensions in effect at the time the DEF
DRCS was received. The lower left corner of the bitmap will
correspond to the lower left corner of the unit screen. The
larger of the X and Y dimensions of the bitmap will be
considered to be equal to 1 unit (the full extent of the
unit screen in that dimension). Any changes to the character
field dimensions within a DRCS definition will not affect
this sizing but will effect the next DEF DRCS command. The
in-memory bitmap is a monochrome bitmap that is initially
all black. All drawing commands will be drawn in white on
the bitmap unless they are drawn with a nominal black color.
The actual resolution of this bitmap is implementation
independent. Although the standard does not suggest this, I
would think that on today's computer equipment, this
rendering should be delayed until the DRCS characters are
actually used, at which point the bitmap size should be
equal to the current character field size, and bitmap
characters should be cached for reuse.
Once the DRCS definition is completed, the unit screen
once again corresponds to the physical screen and the
current drawing point is set to (0,0).
If the DRCS definition is terminated by another DEF
DRCS command, then the character code to be defined is NOT
transmitted. It is calculated by incrementing the previous
character code and wrapping around so that 7F increments to
20. If a DEF DRCS command is terminated with no character
definition, then the character definition for that code is
reset to the default <space> character. The entire DRCS can
be cleared with the RESET PDI.
When a DRCS character is displayed, the rendered bitmap
is scaled to the current character filed dimensions and the
white portions of the bitmap are to be displayed in the
current drawing color. In color mode 2, the black portions
of the bitmap will also be displayed but in the current
background color. DRCS characters are subject to all the
attributes of text just as the ASCII set and supplementary
set.
I have gone a little further than the standard in
suggesting that the scaled bitmap method of displaying DRCS
characters is really not appropriate on today's computer
equipment. Since the ordinary text character shapes for the
ASCII and supplementary sets are not specified, most systems
will provide fully scalable fonts for those characters. If
the DRCS characters are not also handled in an equivalent
scalable manner, then they will not look very good.
DEF TEXTURE - 84
This defines or redefines one of the four programmable
pattern fills. The pattern mask A, B, C, or D is selected by
the byte following the DEF TEXTURE which must be one of 41,
42, 43 or 44. If the code is not one of these four, then the
2 bytes are discarded.
Next comes a stream of NAPLPS data which defines the
pattern mask in the same way as the DEF DRCS except that the
mask size defined in the TEXTURE PDI is used instead of the
character field size. The command is terminated by END, DEF
MACRO, DEFP MACRO, DEFT MACRO, DEF DRCS, or another DEF
TEXTURE.
If the INCREMENTAL POINT command is used in defining
the pattern, then be aware that the active field may be
rescaled as specified under the INCREMENTAL POINT PDI. This
rescaling will cause the actual area drawn by INCREMENTAL
POINT to be smaller than that specified.
If there is no data after the mask number, then the
specified mask is reset to its default state. At the end of
the DEF TEXTURE command, the unit screen is set back to the
physical display and the current drawing point is set back
to (0,0).
While the standard assumes that these pattern masks
will be stored as bitmaps and scaled as needed, I think it
would be useful to record them in the same scalealble manner
as I have suggested for the DRCS characters.
END - 85
This command terminates a DEF MACRO, DEFP MACRO, DEFT
MACRO, DEF DRCS or DEF TEXTURE. It is also used in
transmitting protected field data back to the host system.
UNPROTECT - 9F
This command turns the current active field into an
unprotected field. This makes the field area available for
the user to enter and edit data for transmission back to the
host system. The actual methods/keystrokes for entering and
editing data is implementation dependent. The default state
of the unit screen is protected, so no entry of data may
occur until an UNPROTECT is issued. If the UNPROTECT command
is received when the active field overlaps an already
unprotected field, then the unprotected field is changed to
protected before the active field is unprotected. This
ensures that unprotected fields never overlap. Changes in
the protection status do not affect the visible display.
The number of unprotected fields that may be defined is
implementation dependent but should be at least 40.
If the host transmits data into an unprotected field
that data will be recorded by the terminal program and will
be made available for the user to edit. Editing can only
take place if the unprotected field is also the active
field. The user can transmit the edited data back to the
host system by an implementation dependent keystroke or
mouse click. Details of the transmission format are defined
under "Service Delimiter" in the C0 set. When more than one
unprotected field is transmitted, they are transmitted from
left to right, top to bottom, using the field origin
coordinates to determine which is leftmost or topmost. The
transmission of data is to be handled independently of the
receiving of data, including any state changes made by the
user to text colors, character set, etc.
It is allowed to have other methods of user input that
are independent of the unprotected fields and that do not
affect the state of unprotected fields.
PROTECT - 90
This command causes any unprotected fields that overlap
the active field to be changed to a protected state. The
RESET PDI can be used to protect all unprotected fields.
REPEAT - 86
This command gets a repeat count from bits 6 through 1
of the byte following the REPEAT code and repeats the byte
preceding the REPEAT code, by that number of times. This
code can only be used to repeat <space> characters and any
spacing characters from the ASCII, supplementary, DRCS or
mosaic sets. This means that the non-spacing accents in the
supplementary set cannot be repeated. If the preceding
character is not one of those allowed, then the REPEAT code
and the count byte are discarded. If bits 7 through 1 of the
repeat count fall outside the range from 40 through 7F, then
the REPEAT code is discarded and the count byte is
interpreted as a normal NAPLPS code.
REPEAT TO EOL - 87
This command repeats the preceding byte as many times
as is required to reach the end of the current character
path if it is one of the allowed characters as for REPEAT.
Otherwise, the REPEAT TO EOL is discarded. If the character
field position lies wholly within the active field when this
command is received, then the character path will be
considered to end when it reaches (but does not pass) the
active field boundary.
REVERSE VIDEO - 88
This causes any following text from the ASCII,
supplementary, DRCS and mosaic sets to be drawn reversed. In
color modes 0 and 1, the pixels of the character shape are
not draw, only the background pixels are drawn using the
current drawing color. In color mode 2, the foreground and
background colors used are swapped. This will require
special handling to ensure that composite characters are
displayed correctly. Composite characters are composed of a
non-spacing accent followed by another character from the
ASCII set. The composite character codes must always be
transmitted in that order, accent first, then ASCII
character.
NORMAL VIDEO - 89
This terminates reverse video mode and returns to the
default.
Text Sizes
Text sizes can be set by the following commands or by
the TEXT PDI. The following commands effect only the
character field dimensions. All other text attributes remain
constant. The screen sizes quoted assume the default
rotation and character path is in effect.
SMALL TEXT - 8A
This sets the dimensions of the character field to 1/80
in the X dimension and 5/128 in the Y dimension. This
corresponds to an 80 by 19 screen when accounting for the
fact that only 3/4 of the Y dimension is visible.
MEDIUM TEXT - 8B
This sets the dimensions of the character field to 1/32
in the X dimension and 3/64 in the Y dimension. This
corresponds to a 32 by 15 screen when accounting for the
fact that only 3/4 of the Y dimension is visible.
NORMAL TEXT - 8C
This sets the dimensions of the character field to 1/40
in the X dimension and 5/128 in the Y dimension. This
corresponds to a 40 by 19 screen when accounting for the
fact that only 3/4 of the Y dimension is visible.
DOUBLE HEIGHT - 8D
This sets the dimensions of the character field to 1/40
in the X dimension and 5/64 in the Y dimension. This
corresponds to a 40 by 9 screen when accounting for the fact
that only 3/4 of the Y dimension is visible.
DOUBLE SIZE - 8F
This sets the dimensions of the character field to 1/20
in the X dimension and 5/64 in the Y dimension. This
corresponds to a 20 by 9 screen when accounting for the fact
that only 3/4 of the Y dimension is visible.
WORD WRAP ON - 95
Any text received after this code is word wrapped when
the line reaches the end of the character path. If the text
is being displayed in the active field, then word wrapping
takes place when the character path meets the active field
boundary. If a <space> character is the last character on
the line and the <space> character does not fit, then it is
simply discarded. A word is defined as a string of
characters between <space> characters. If one of the
following list of special characters is embedded within the
word (i.e. not at the beginning or end) then the word may be
broken AFTER the special character in order to fill the line
as much as possible.
! " $ % ( ) [ ] < > { } ^ * + - / , . : ; = ? _ ~
A word is also terminated when a mosaic character is
encountered or when any C set character (except SI, SO, SS2
, SS3) is encountered. If the word fills the line with no
spaces or special characters, then it is broken at the end
of the line anyway.
WORD WRAP OFF - 96
This turns off word wrap and text now breaks between
characters. This is the default.
SCROLL ON - 97
This turns on scroll mode. In this mode any <linefeed>
or <vertical tab> that would otherwise cause the character
field to move partially or wholly outside the display area,
triggers scrolling. The display scrolls in a direction
--
Michael Dillon Internet: mpdillon@halcyon.halcyon.com
C-4 Powerhouse Fidonet: 1:353/350
RR #2 Armstrong, BC V0E 1B0 Voice: +1-604-546-8022
Canada BBS: +1-604-546-2705