MTerm script (part A)
The example image above is a screenshot of MTermRX on-line to my BBS.
The script was used to overlay the "News & Information" over a
regular ANSI frame. It looks much better than the ANSI version.
As you would expect, it will only work on MTerm terminals.
This is an example of what you might see with vanilla-flavoured terminals:
¤!MDRAW COLOUR 8
¤!MDRAW RECT 5, 15, 1260, 750
¤!MDRAW RECT 7, 17, 1260, 750
¤!MFONT LOAD 5 100 100
¤!MFONT DRAW 220 550 0 NEWS
¤!MFONT LOAD 5 120 120
¤!MFONT DRAW 480 450 10 &
¤!MFONT LOAD 5 80 80
¤!MFONT DRAW 75 410 9 Information
¤!MFONT LOSE
|
As you can see, the script is quite straight-forward.
MTerm script [part A]
(revision 5)
(doc: r5 10-10-97)
MTerm script comes in three principal parts:
- Part A
- Is the purpose of this document. It allows an extended version of
ANSI with support for outline fonts and drawing primatives in the
terminal window. I'm going to push this a little as it is a simple
protocol yet nice for callers. It offers a little more than ANSI
without being horribly complex.
- Part B
- Has yet to be defined, but is expected to be a Mmodem protocol and
support for a GUI interface using RiscOS template (which is incidently
the main purpose of the MTerm project).
- Part C
- Hasn't really been thought about. Part C is reserved for an eclectic
mix of support for downloadable resources such as sprites, drawfiles,
HTML, PDF... whatever...
MTerm script commands may be in upper, lower or mixed case.
Note that "newline" refers to either &10 or &13
MTerm commands are introduced by the sequence "¤!M".
If any part of the sequence is incorrect, print it to the terminal as normal
text, otherwise...
Read in up to the newline. Commands are limited to a length of 80 characters.
As most BBSs send <cr><lf>, junk the next byte.
Commands must terminated by newlines.
The following list of MTerm commands, with the ¤!M stripped off for
clarity. Changes to previous versions are in bold.
- ¤
- Print the "¤!M" sequence to the terminal. May be
required in on-line examples of MTerm. :-)
- ID
- Returns an "M" if MTerm compatible.
- SL
- Will return a list of recognised MTerm script parts followed by a
newline.
Upper case letters means a complete implementation. Lower case letters
means a partial implementation.
If you understand part A only, return "A". If understand all three
parts, return "ABC".
Upper case letters mean a complete implementation. Lower case letters
mean a partial implementation.
- FULLID
- Will return the program name and version, newline terminated.
The protocol is "<progname> v<major>.<minor>".
You cannot have spaces in the name, use an underscore.
For example "MTermRX v3.11"
- MMODEM_START [<type>]
[ name deprecated ]
- As for FTP_START below.
- FTP_START [<type>]
[ use in preference ]
- Initialise a file receive. If no parameter is given, an Mmodem receive
will be initiated.
1 - Xmodem; 2 - Xmodem-1K; 3 - Ymodem; 4 - Ymodem-G; 5 - Mmodem
Mmodem has not yet been implemented.
- RES_FETCH [<type>]
- Initialise a resource file receive. File will be placed in the
transient resources area, and a WIMP message will be broadcast
upon completion.
1 - Xmodem; 2 - Xmodem-1K; 3 - Ymodem; 4 - Ymodem-G
- DRAW MOVE <x> <y>
[ shorthand "D M" ]
- Move the graphics point to the given position.
- DRAW COLOUR <colour>
[ shorthand "D C" ]
- Set the colour for drawing. Please be aware that the colours are taken
from the Wimp palette, they are not BBC type colours.
0 - White
: - Shades of grey (1 lightest, 6 darkest)
7 - Black
8 - Blue
9 - Yellow
10 - Green
11 - Red
12 - Cream
13 - Dark green
14 - Orange (or magenta with ANSI palette loaded)
15 - Cyan
Add 128 for background colours or use new command (below).
Note - the user CAN redefine the WIMP palette.
- DRAW BACKGROUND <colour>
[ shorthand "D B" ]
- Set the background colour for drawing. Also clears the screen (to this
colour). Colours the same as above.
- DRAW LINE <x> <y>
[ shorthand "D L" ]
- Draws a line to the given position (from the last moved position).
- DRAW RECT <x> <y> <w> <h>
[ shorthand "D R" ]
- Draws a rectangle at the given position, with the given width and height.
- DRAW RECTFILL <x> <y> <w> <h>
[ shorthand "D RF" ]
- As "DRAW RECT", but plots a filled rectangle.
- DRAW CIRC <x> <y> <r>
[ shorthand "D C" ]
- Draws a circle at the given position, with the given radius.
- DRAW CIRCFILL <x> <y> <r>
[ shorthand "D CF" ]
- As "DRAW CIRC", but plots a filled circle.
- DRAW PLOT <type> <x> <y>
- Perform the given plot command. This may be a pain to require you to do
system-level plotting commands, but it opens up a wide range of actions
such as triangles, parallelograms, arcs, segments, sectors and
ellipses.
By way of example, how to draw a triangle:
- DRAW MOVE to first vertex.
- DRAW MOVE to second vertex.
- DRAW PLOT to third vertex.
- FONT LOAD <number> <xsize> <ysize>
[ shorthand "F L" ]
- Will load the font specified, in the given size. The size is in points,
so 14ish would be a reasonable replacement to ANSI text.
Only one font definition is available at any one time.
The font numbers are:
0 - Corpus.Bold
1 - Corpus.Bold.Oblique
2 - Corpus.Medium
3 - Corpus.Medium.Oblique
4 - Homerton.Bold
5 - Homerton.Bold.Oblique
6 - Homerton.Medium
7 - Homerton.Medium.Oblique
8 - Keys1000 (PD font - to be included)
9 - MDA1.Bold (PD font - to be included)
10 - MDA1.Medium (PD font - to be included)
11 - Trinity.Bold
12 - Trinity.Bold.Italic
13 - <not mapped> (falls through to entry #14)
14 - Trinity.Medium
15 - Trinity.Medium.Italic
You should not use special fonts as they are not guaranteed to be
available on every system. I plan to soon add support for Paladin,
Vogue, ANSI, Sassoon and System with fallbacks to standard fonts if not
available.
If even a 'standard' font is unavailable, you should fall back to
Trinity.Medium. If that is not present, let all hell break lose (or
simply refuse to print anything).
Only one font definition is available at any one time.
- FONT DRAW <x> <y> <colour> <text>
[ shorthand "F D" ]
- Plots the text given at the specified co-ordinates, in the specified
colour. If nothing happens, it is possible that the font is being used
before being loaded. Note that the maximum total command length is 80
characters.
- FONT LOSE
[ shorthand "F S" (not "F L")]
- Forgets the current font definition.
If you plan to load another font immediately after, you can drop this as
loading a font implicitly loses the previous font.
However, if you are done with fonts then you must call this.
- FONT QUALITY
[ shorthand "F Q" ]
- This determines the required value of 'FontMax' to set.
MTerm default is now to provide the following:
Scale from bitmaps up to 16 point.
Scale anti-aliased up to 60 point.
Retain bitmaps up to 16 point in the cache.
Use horizontal subpixel anti-aliasing up to 16 point.
Use vertical subpixel anti-aliasing up to 16 point.
Special values:
- 0 - Use the defaults configured in RiscOS.
- 1 - Configure to 'old' style (full anti-aliasing and caching up
to 60 point, and subpixel anti-aliasing to 28 point!).
- 2 - Crude: anti-alias up to 8 point, subpixel anti-alias disabled.
- 3 - 7 Reserved.
- 8+ Set anti-alias limits to given size. Bitmaps retained up to
maximum of 24 point. Sub-pixel anti-alias up to 24 point. This
last part has not been tested.
It is recommended you use the default or value '0' for regular text, and
switch to '1' for titles.
The value resets when a new BBS is dialled, but NOT when a new MTerm
script is fetched.
- ; or REM
- A comment line, will be ignored.
The success of MTerm depends upon you.
If you are a BBS SysOp, please support MTerm.
If you are a comms program coder, please support MTerm.
I'm not looking for support of the fully blown GUI - just the simple script
language. As you can see it is indeed simple.
If you would like to support MTerm, or are interested, then please contact
me.
Download a copy of MTermRX and call an MTerm friendly BBS for an example.
Back to the MTerm index
Copyright © 1999 Richard Murray