;
; TERMINAL PROGRAM ---- Version 2.1a
;
; 1.0 Program began, May 11th 1989.
; The aim of this program is to provide a replacement terminal
; mode to the one supplied in the terminal rom, by Amsoft.
; It is intended to be a RSX, in a similar manner to the Amsoft
; ones, but called |TERM. The user will be allowed to turn on
; and off things like Remote and Local Echo, and to mask out
; certain unwanted characters, and the BEL character.
; It is hoped just to provide a much easier terminal program to
; work with, and also allow me to learn some assembly language
; programming.
; At this stage all the options are set up at the time of
; assembly. The program can handle expanding function key
; macros, which is something that is sorely lacking from the
; Amsoft terminal mode.
; The present revision has no RSXs yet, as they make testing
; the code harder. Some defaults are set up by the terminal
; program as it is entered, and it also prints up a message
; announcing itself, and its writer.
; The options supported are-
; BELL FILTERING, LOCAL ECHO, REMOTE ECHO,
; COMPUTER PHONE (mask top bit),
; DELETE TRANSLATION (translate 127 to 8),
; ADD LF TO CR (send a LF out after every CR).
;
; 1.1 Run time options have been added. This is done by using
; register C to hold a bit dependant list of options.
; Register C is set up at the start of the run from a status
; byte, and is then tested in the appropriate places with the
; BIT command. This makes changing the configuration much faster.
;
; 1.2 Added in RSX's properly. |TERM for terminal mode, and |INIT
; to set up the configuration byte, by asking questions of the
; user. Y,y,N,n are accecpted. Return leaves the option the
; same.
;
; 1.3a Added in proper mainline code, so that subroutines are
; jumped to for doing things like reading in keys, and reading
; from the modem. This makes the code a little easier to follow.
;
; 1.3b Made the filter for characters going to the screen much faster
; by automatically letting through everything that is 32 or
; above, instead of making them sit through the whole cycle.
;
; 1.3c Added in |STATUS to allow the user to check the current
; configuration. Added in direct writing of the source
; to a binary file, to make saving it much easier.
; Added to more run-time options - Destructive delete (8 32 8)
; when just (8) is sent. And a tab expander, that expands to
; the nearest column that is a multiple of 8.
;
; 1.3d Added in direct key test for ESC (66) so that an escape
; can be guarenteed, even if the next character cannot be
; sent (thus is not read).
;
; 1.3e Made the system expand the macros, by calling KM_READ_CHAR
; instead of KM_READ_KEY which makes the programming simpler.
;
; 1.4a Minor tidy ups in source code. Partial fix for the ESC problem
; caused by BASIC. Change of STATUS name to STATS, to avoid the
; problem with name conflict with UTOPIA. Abandon from INIT
; added to allow fast escape.
;
; 1.4b More minor bugs tackled. ESC is redefined to allow the user
; to press just ESC to send CHR(27) and to press CONTROL/SHIFT
; ESC to leave the program. Macros expanded by the program now
; to allow masking out the ones that aren't wanted.
; Direct call to |CDUMP added.
;
; 2.0a Major re-write. Totally rewritten for speed, to allow
; the use of 2400 modems. Added Word Wrap.
;
; 2.0b Minor rewrite -- made it a little faster in places.
;
; 2.0c Jumpblocks removed for non-altering conditions.
; Buffering added.
; Connect/Carrier Lost messages added
; Clear screen routine improved.
;
; 2.0d Ansi support, interupt driven buffering (Sio input)
; CONNECT/NO CARRIER messages remove - intelligent modem.
;
; 2.0e Jumpblocks rewritten, so faster. Buffering of modem output.
; Subroutine added to tell user when buffer is ready for more
; input if the user is intersted.
;
; 2.1a Screen output re-written to include Ansi graphics characters
; in a much faster layout. Added *MUCH* faster serial access.
; IBM lower characters included. Colour tracing added (hopefully
; working now). Altered return data from buffering.
;
; 2.2a Direct screen writes added, for speed. Screen restricted to
; 24x80 size, using software scrolling. Added in a screening
; buffer as well as the translation one. Lots of work done on
; Ansi stuff.
;
; 2.2b Changed translation buffers back to the original setup --
; it works just as well, and takes 512 bytes less space.
; Fixed bug with ESC [ K - didn't clear shadow screen.
; Fixed bug with ESC [ J - corrupted character set sometimes.
; Fixed bug with ESC [ H - didn't eliminate zeros, causing
; some really weird problems!
; Removed the last of the reliance on Amstrad control characters.
; Added in support for CSI (&9B).
; Changed code for ESC [ K so that it produces underline on
; screen when necessary.
; Changed code that produces the underline on screen.
; Removed the silly RMEMs which saved over 1K of zeros into
; into the file - the in and out buffers don't need to
; be preinitialised.