home *** CD-ROM | disk | FTP | other *** search
- CVT100, A Simple VT100 Emulator in Turbo C 2.0
- By Jerry Joplin CIS [70441,2627]
- VT220 Modifications by Bob Bonomo CIS [76314,2200]
-
-
- OPERATION
-
- The terminal emulator is menu driven. The top line of the
- terminal screen is reserved as a status line. When the ALT key
- is pressed, a list of choices is displayed on the status line
- for setting the various parameters concerning the different
- aspects of the programs operation.
-
- ALT Function Key F1: This activates the DOS shell.
-
- ALT Function Key F4: This activates the Transfer menu setup.
- It can be set up to initiate the host
- and/or the PC XMODEM protocol transfer.
-
- ALT Function Key F5: This activates the Communications menu
- setup. Here the COM port is
- established along with its associated
- baud rate, parity, data bits
- and stop bits.
-
- ALT Function Key F6: This key will activate the Video setup
- menu. Here the screen colors can be
- set and the "snow" inhibit mode can be
- set.
-
- ALT Function Key F7: This key when pressed enters the
- keyboard setup menu. Here the
- program's interpretation of the
- backspace key can be set. The
- keyboard can be programmed to produce a
- 'key-click' and the state of the
- keypad can be defined.
-
- ALT Function Key F8: An Emulation menu becomes active when
- ALT F8 is pressed. Here the many mode
- settings for the emulator may be set.
- These include origin mode,
- insert/replace mode, auto wrap mode,
- new line mode, cursor visibility,
- background video attributes and the
- logical screen width.
-
- ALT Function Key F9: Function key ALT F9 brings up a File
- menu. The current settings for the
- terminal can be saved in an setup file
- that is read when the program is
- started. Also a log of incoming
- characters can be controlled.
-
- ALT Function Key F10: This is used as the exit key. When
- pressed this will close any open log
- files and exit.
-
- KEYBOARD keypad
-
- The most controversial part of any terminal emulator will
- usually be the setup of the IBM PC keyboard to try and match
- the Digital Equipment Corporation VT keypad. Not an easy task.
- This program tries to map as closely as possible the keypad for
- an IBM PC to a DEC VT keypad. The results are often better if
- NUM LOCK is left on through out the entire session.
-
- If the keyboard is a PC, it does these keypad mappings:
- keypad DASH (-) to comma (,)
- keypad PLUS (+) to enter
- keypad STAR (*) to minus (-)
-
- If the keyboard is the AT style it does these mappings:
- keypad STAR (*) to star (*)
- keypad MINUS (-) to minus (-)
- keypad PLUS (+) to comma (,)
- keypad ENTER to keypad enter
-
-
-
- PROTOCOL TRANSFER
-
- For automatic mode, press ALT F4, then using the different
- function keys fill in the PC filename and host file name.
- Select Upload or Download using the appropriate function key,
- fill in the host command and parameters, and hit ENTER. These
- host commands can be saved to the setup file using the ALT F9
- setup screen. This automatic mode might not work with all
- systems. I tested it using SCO-XENIX (tm) and the XMODEM
- program supplied.
-
- If using a multi-port card such as Computone InteliPort it will
- be necessary to put the port in raw mode first and then reset
- it after the transfer. File XFER is such a script file.
- Replace XMODEM below with XFER. WARNING: The program presumes
- you know what you are doing.
-
- HOST Command: XMODEM { -r | -s } [-t] filename
- -r for receive
- -s for send
- -t for text files
-
-
- In manual mode you setup the host by issuing the appropriate
- command for Upload or Download, then press ALT F4, fill in the
- PC filename, press the function key for either upload or
- download and hit ENTER. The data field for upload or download
- MUST be left blank. A non blank field indicates automatic mode.
-
- HOST Command: XMODEM
-
-
-
- DATA ENTRY
-
- While entering data on the protocol transfer screen, the active
- keys are ESC, HOME, END, RIGHT arrow, LEFT arrow, BACKSPACE,
- DEL, INS, ENTER, and CTRL-END. They perform their instinctive
- functions. CTRL-END deletes from the cursor position to end of
- line.
-
-
- EMULATION
-
- This program can best be described as a compromise between the
- desire to make the code as simple and straight forward as
- possible and the complexities and intricacies of a real life
- DEC VT100. So many things were left out of the terminal
- emulation.
-
- Of the things left out of the emulation most notable will be
- printer output commands and double high/width character lines.
- Local echo is also absent.
-
- The emulator can not change the video from 80 to 132 columns
- and vice-versa when these commands are received from the host.
- The commands are received and recognized but it only changes
- the logical width of the screen held by the emulation software.
- It seems as if every video board manufacturer that has a board
- capable of switching to 132 column mode has a different method
- of changing into this mode. However this mode can be utilized
- by setting the screen to 132 columns *before* executing the
- program. Then the video system of the emulator will properly
- use all of the columns.
-
- The BREAK key is CTRL-END.
-
- The only part that was added to the VT220 emulation is different
- keys like HOME, INS, PGUP, ShiftF1-F10, etc.
-
-
- FILE SYSTEM
-
- The setup information can be saved to a disk file when a
- satisfactory setting has been reached. When the program is
- executed it looks in the current directory for a file named
- 'CVT220.SET' from which to load the setup parameters. If this
- file is not found it then looks in the directory where CVT220
- was loaded from. Default values are provided if this file is
- not found.
-
- Incoming characters can be logged to disk. When logging is
- selected, all incoming characters are saved in a disk file
- named 'CVT220.LOG'. If a file by that name exists at the time
- when logging is selected then output is appended to this file
- otherwise a file will be created in the current directory.
- Note that *NO interpretation* is performed on the characters
- placed in the disk file.
-
-
- PROGRAM TERMINATION
-
- Any time the program is exited the communications port will be
- closed to prevent incoming characters generating interrupts to
- ISR's which don't exist in memory any longer. Additionally the
- log file will be closed if it is open on program exit.
-
- There are several errors which may cause the emulator to force
- itself to exit. If memory can not be allocated from the DOS
- heap for the screen save buffer then the program will be
- terminated with an error message. Also the file IO functions
- may terminate the program if a system error has occurred on a
- read or write of a disk file. This could be caused by a disk
- full error or fault media. *CAREFUL* because the program does
- not currently trap the fatal error interrupt and disk errors
- will produce the not-too-kind error message:
-
- Not ready error writing drive A:
- Abort, Retry, Ignore?
-
- Choosing Abort will cause the terminal to exit without having
- turned off communications interrupts. This will cause a quick
- system lockup if a character is received by the COM port.
-
-
-
- ACKNOWLEDGMENTS
-
- The VT100 emulation is based heavily on two versions of Kermit.
- The most notable version of Kermit was MSKermit version 2.30
- written in Microsoft Macro Assembler 3.0. CKermit for Unix was
- also used for program design and nomenclature. Therefore this
- Copyright appears as required.
-
- Copyright (c) 1981, 1988
- Trustees of Columbia University in the City of New York
-
- Permission is granted to any individual or institution
- to use, copy, or redistribute this program and
- documentation as long as it is not sold for profit and
- as long as the Columbia copyright notice is retained.
-
-
- Most of the code for XMODEM was taken from Al Stevens' Smallcom
- project in Dr. Dobbs Journal and was adapted to CVT220. The
- data entry part is also from DDJ. The Unix XMODEM program was
- written by Jim Demchuk and modified for batch mode by Bob
- Bonomo.
-