home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d1xx
/
d108
/
tek
/
tek.doc
< prev
next >
Wrap
Text File
|
1987-10-31
|
27KB
|
744 lines
This is a terminal emulation/communications program which has been
put together by Nick Giordano (9-87). It does vt100 and tek4014/4010
emulation. The majority of the code is the vt100(v2.6) public domain program
by Dave Wecker, and his documentation comes at the end of this file.
The tek emulation is based on the tek4010 program by T. Whelan which I
obtained from one of the Fish disks. My
only contributions have been relatively minor. Some the changes I have made
are the following.
(1) The original tek4010 program was built on top of vt100(v2.0). This
version is built on what is now the latest version of vt100.
It is also now relatively easy to put the tek emulation on top
of new versions of vt100.
(2) The original tek4010 program had most of the options (such as
graphics screen depth) hard coded in. These are now options which
can be selected via menus, or set on startup from data in the
vt100.init file in the same manner as other vt100 options.
(3) Various error conditions (such as insufficient memory for the
tek screen) are now handled more gracefully, without visits
from the guru.
(4) The current version now compiles under Manx 3.4a (patch level 3)
with 16 bit integers, and should also compile under Lattice
(but I have not tried this yet).
This program normally behaves exactly like vt100(v2.6) until you
open the tek screen. This is a custom screen which can be opened either
on start-up, or via menu selection. The depth and resolution of the
tek screen are user selectable. When the tek screen is open it normally
sits behind the vt100 screen. However, when a graphics command is
received, the tek screen is automatically brought to the front and the
graphics commands are executed. When the command to go back to text mode
is received, the tek screen is then pushed to the back, but the graphics
are still there. One can then, if one wants, bring the tek screen back
to the front via menu selection, etc. The graphics stays on that screen
until it is explicitly cleared, which can be via menu selection or
a command from the host computer.
According to T. Whelan, the tek emulation should also do color
graphics, but I am not able to test this mode. I have not made any
changes in the way colors are handled, so this part should work as
well as it did in the original tek4010 program.
As in T. Whelan's version, this emulator is also compatible with the
Selanar command codes, to mimic the behavior of a Selanar Hi-Rez 100
terminal.
I usually don't open the tek screen unless I plan to use the graphics mode,
since this screen eats up some memory. I have found that the program
works reliably, ALTHOUGH IT IS INCOMPATIBLE WITH THE CLOCK PROGRAM
of M. Meyer. I haven't tracked this bug down yet, but plan to work on
it in the near future. In any case, this may indicate incompatibilities
with other programs of that type, so user beware. The problem may be with
having a high priority running in the backround, but the tek program does
coexist with popcliII without any problems.
I had not planned on releasing this program so soon, so a good bit of
debugging code and unnecessary code are still present. I apologize for
the code, but it works for me and I make no guarantees. However I would
greatly appreciate hearing about any bugs which you discover, and I will try
to fix them when I can.
Finally, let me say again that I have, in the spirit of public domain
programming, written relatively little of this code. The credit should
really go to D. Wecker and T. Whelan.
This version has several tek options which can be set from the
initialization file (vt100.init). These are listed below.
int t_scale = 0; /* 0->1024x780 1->640x400 resolution */
int t_on = 0; /* 0 = no 1 = yes come up with tek screen on */
int t_depth = 1; /* depth of tek screen */
int t_interlace = 1; /* interlace tek screen 0=no 1=yes */
KNOWN BUGS:
1) Does not work when M. Meyers clock program is running in the backround.
In this case, some graphics commands are lost, resulting in garbage.
2) Any problems in vt100(v2.6) will also be found here. I have not made
any of the patches which have been suggested.
CHANGES in VT100(v2.6):
1) I have changed some of the menu selection keys
(i.e., left Amiga - something). These are noted in the vt100
documentation below.
2) There is now a quit menu selection (left Amiga - Q) which will terminate
the program.
PLANS FOR THE FUTURE:
1) Add a new smaller font so as to be more compatible with the fonts found
on the 4014.
2) Make the colors user selectable.
3) Fix any bugs which are reported.
I would greatly appreciate any suggestions for changes/improvements, as
well as bug reports.
Nick Giordano
Physics Department
Purdue University
West Lafayette, IN 47907
(9-1-87)
***********************************************************************
***********************************************************************
The following are comments from T. Whelan's original version.
***********************************************************************
***********************************************************************
/* This module is a minimum extenal hooks tek 4010 emulation, the
* function InitTek() must be called before any of the others, it
* assumes that gfx, intuition are open. Tek() returns true if it
* uses the input stream else false. It must be called before any
* character parsing or you could get into trouble. CloseTek() Frees
* up all resources used by this module */
/* I had to invent a few commands for area fill reset screen, and
* color setting. Any one who knows the correct commands please let me
* know the line drawing and color index selection are standard commands.
* I have vax software to drive the 640x400 mode, and it works really well.
* the 1024x780 mode is not quite as clear, but works ok.
* The author of this software can be contacted as:
* T.Whelan
* Dept. of Physics & Astronomy
* University of Iowa
* Iowa City
* IA 52244
* and on span at IOWA::WHELAN
* on the "to do" list, are graphic input mode and run time selection
* of the screen resolution. */
**********************************************************************
**********************************************************************
The following is D. Wecker's original documentation.
**********************************************************************
**********************************************************************
This is the documentation file for the VT100 terminal emulator by Dave
Wecker (V2.6 DBW 870227). Comments/suggestions/bugs/problems/praise
should be sent to:
Dave Wecker at ENET: COOKIE::WECKER
ARPA: wecker%cookie.dec.com@decwrl.dec.com
USENET: {decvax|decwrl}!cookie.dec.com!wecker
SNAIL: Dave Wecker
115 Palm Springs Drive
Colorado Springs, CO 80908
MANY pieces of code/suggestions have been sent in..
thanks to all!
Program startup:
----------------
1> vt100 [initfile]
- At startup, the program will search for an initialization
file to execute. It will first look for the specified
"initfile", then VT100.INIT (in the current directory)
and finally S:VT100.INIT. The format for the init file
is described later in this document.
- The init file controls the setting of initial defaults
and screen and macro definitions.
- If none of the files (listed above) are found, the
built-in defaults (defined in VT100.C as variables,
beginning with "p_") are used.
- All commands are either menu or script based. Scripts
are described below.
Menus (Commands in parenthesis are keyboard bindings: Right-Amiga-chr):
-----------------------------------------------------------------------
File - file transfers
Ascii Capture - Begin/end a script of the current session
Ascii Send - Type a file to the host
Xmodem Receive (A-V) - Receive a file using XMODEM protocol
(this is now A-< N.G.)
Xmodem Send (A-^) - Send a file using XMODEM protocol
(this is now A-> N.G.)
Kermit Get (A-G) - Receive files from a host KERMIT SERVER
Kermit Receive (A-R) - Receive files from a host KERMIT
Kermit Send (A-S) - Send files to a host KERMIT [SERVER]
Kermit Bye (A-B) - Terminate a host KERMIT SERVER
Comm Setup - Setup communications
Baud Rate - Set the terminal baud rate
300,
1200, (A-L)
2400, (A-H)
4800,
9600
Parity - Type of parity
NONE, (A-X)
MARK,
SPACE,
EVEN, (A-E) (this is now A-+ N.G.)
ODD (A-O) (this is now A-- N.G.)
Xfer Mode
Image (A-I) - Send files verbatim (for UNIX hosts or
binary files)
Text (A-T) - Send CR LF as line terminator and strip
CR on received files (VMS text).
(this is now A-7 N.G.)
Convert - Should KERMIT convert fnames to lower case
Script - Script commands
Execute file - Start up an asynchronous script file
Abort Execution - Terminate a script file
Utility - Utility commands
Send Break (A-.) - send a break to the host
Hang Up - close line (not implemented yet)
Change Dir (A-D) - change the local directory (for transfers)
Clear Scrn - clear the screen (initial state)
Echo - turn on/off half duplex mode
Wrap (A-W) - turn on/off long line wrapping mode
Num Key (A-K) - turn on/off numeric keypad mode
App Cur (A-C) - turn on/off application cursor mode
BS<->DEL (A-Z) - swap backspace and delete keys
Keypad mapping (in application keypad mode):
--------------------------------------------
AMIGA VT100 comments
------- ------- ---------------------------
0-9 == 0-9
. == .
ENTER == ENTER (basically, flip the bottom
- == , 2 keys up to get a VT100)
HELP == - (only free key around)
f1-f4 == PF1-PF4 (or any rebinding you do)
arrows == arrows
Note: Right AMIGA key in conjunction with a period (".")
will send a break to the host.
CTRL in conjunction with an at-sign ("@") a two ("2") or a
space (" ") will send a NULL to the host.
CTRL in conjunction with a six ("6") will send a CTRL-^
CTRL in conjunction with a dash ("-") or question mark ("?")
will send a CTRL-_ to the host.
Multi file Xfers:
-----------------
The VT100 emulator supports multiple file transfers. This is
specified by using a comma (",") between file names when using XMODEM
or KERMIT. (NOTE: host XMODEM's normally CANNOT support multiple file
transfers).
When specifying a file name to recieve by default the directory path
is stripped off of the filename when sent to the host but is kept for the
local file spec. eg:
receive file: ram:file.txt,df1:newfile.bin,$
will ask the server for file.txt and put it in ram:, and get
newfile.bin and put it on df1: (see explanation of "$" below). If you
do a single file transfer you will get another prompt for the remote
name e.g.:
receive file: ram:file.txt
remote file name [file.txt]: userdisk1:wantfile.txt
The same rules apply to sending multiple files therefore if you are
doing multi file transfers make sure the host server is connected to
the desired directory.
In addition KERMIT supports wildcards:
* = any number of characters
? = any single character
Examples:
send: *.c,*.h,*.doc
get: *.c,*.h,$
KERMIT receive is now smart enough to use the host filename so no
filename needs to be specified on the AMIGA's side (see the CONVERT option).
Initialization and Script file operation:
-----------------------------------------
An initialization file (as described in the "Program Startup" section)
may contain any of the commands shown below that have the word INIT in
their description below. Commands that are available from scripts have
the word SCRIPT in the descriptions below. All commands may be abbreviated
to 3 letters and are case insensitive.
The script file can be invoked by selecting 'execute file' from the
script menu. At any time you can abort the script file by selecting
'Abort Execution'. You may also invoke a script from a function key if
the first character of the function key definition is the KEYSCRIPT
character (e.g., define F5 as "~df1:foo.script").
During the time script file is running the terminal emulation is still
active and you may type simulataneous to the script file. This may be
desired if your script file is WAITing for a string or is DELAYing for
a period of time etc.
Initialization and Script file Commands:
----------------------------------------
# Commented line (INIT,SCRIPT)
Format:
# This line is a comment
------------------------------------------------------------
APPCUR Set the application cursor mode (INIT,SCRIPT)
Format:
APPCUR ON/OFF or YES/NO
------------------------------------------------------------
ASCII_SEND Send an ascii file to the host. (SCRIPT)
Format:
(same format as CAPTURE)
------------------------------------------------------------
BACKGROUND Define a background color (INIT)
Format:
BACKGROUND hex three digit hex number
Example:
BACKGROUND F00 bright red background
------------------------------------------------------------
BAUD Set baud rate (INIT,SCRIPT)
Format:
BAUD rate Sets the baud rate for send/receive
Example:
BAUD 2400 Sets the baud rate at 2400 baud
------------------------------------------------------------
BEEP Beep at the console (SCRIPT)
Format:
BEEP
------------------------------------------------------------
BOLD Define a color for bold (INIT)
Format:
(same as BACKGROUND)
------------------------------------------------------------
BREAK Set the break time (for an SB command) (INIT,SCRIPT)
Format:
BREAK value Value is in micro-seconds
Example:
BREAK 750000
------------------------------------------------------------
BUFFER Set transmission buffer size (INIT)
Format:
BUFFER n Number of bytes to buffer
Example:
BUFFER 512
------------------------------------------------------------
CAPTURE To start/stop ascii file capture. (SCRIPT)
Format:
CAPTURE file Start ascii capturing
CAPTURE End ascii capturing
------------------------------------------------------------
CD To change the local directory (SCRIPT)
Format:
CD newdir set a new directory for file transfers
Example:
CD DF1:foo/bar set the directory as specified
------------------------------------------------------------
CONVERT Tell KERMIT whether or not to convert filenames (INIT,SCRIPT)
Format:
CONVERT ON/OFF or YES/NO
Example:
CONVERT ON Filenames will be down cased
------------------------------------------------------------
CURSOR Define a color for the cursor (INIT)
Format:
(same as BACKGROUND)
------------------------------------------------------------
DELAY Suspends script file for a specified time (SCRIPT)
Format:
DELAY n Suspends execution for n seconds
Example:
DELAY 2 Suspends for 2 seconds
------------------------------------------------------------
DEPTH Define the depth of the window/screen (INIT)
Format:
DEPTH n Number of planes in window/screen
Example:
DEPTH 1 Minimum depth
DEPTH 2 Same as Workbench
------------------------------------------------------------
ECHO Turn on/off local echo (INIT,SCRIPT)
Format:
ECHO ON/OFF or YES/NO
Example:
ECHO ON Half duplex mode
------------------------------------------------------------
EXIT Ends execution of the current script file. (INIT,SCRIPT)
Format:
EXIT Exit the current script/init file
EXIT VT100 Exit vt100 program (from SCRIPT only)
EXIT newscript Exit this file and start up newscript
Example:
EXIT DF1:FOO.BAR Exit the current file and start FOO.BAR
------------------------------------------------------------
F Define a function key (INIT,SCRIPT)
Format:
F n string Define Function key n to be string
Example: (see SEND for string format)
F 1 "dir^M" Define F1 is the string dir<cr>
F 11 "help" Define Shifted F1 as the string help
F 20 ^C Define Shifted F10 as a control-C
------------------------------------------------------------
FOREGROUND Define a color for the foreground (INIT)
Format:
(same as BACKGROUND)
------------------------------------------------------------
GOTO Jumps to a different part of the script file. (SCRIPT)
Format:
GOTO label Jumps to a line beginning with label:
Jumps may be forward or backward.
Example:
FOO: Sets up a label
...
GOTO FOO Jumps to FOO
------------------------------------------------------------
INTERLACE Turn on/off interlace (INIT)
Format:
INTERLACE ON/OFF or YES/NO
Example:
INTERLACE ON Use interlacing
------------------------------------------------------------
KB Send a BYE packet to a host KERMIT server. (SCRIPT)
Format:
KB Shut down server.
------------------------------------------------------------
KEYSCRIPT Define a new keyscript character (INIT,SCRIPT)
Format:
KEYSCRIPT hex New character in hex
Example:
KEYSCRIPT 7E Use "~" as the new character
------------------------------------------------------------
KG Gets files from host. (SCRIPT)
Format:
(same format as KS) Get from server
------------------------------------------------------------
KR Receives a file from kermit host. (SCRIPT)
Format:
(same format as KS) Not from a server
------------------------------------------------------------
KS Sends files via kermit to the host. (SCRIPT)
Format:
KS file Send one file
KS file1,file2,... Send multiple files
KS file1,file2,...,$ Send multiple files and shut down server
Example:
KS foo.bar sends foo.bar (note no quoting is used)
KS foo1,foo2,foo3 sends three files
KS foo1,foo2,foo3,$ sends three files and shuts down server
------------------------------------------------------------
LINES Define number of lines in the window (INIT)
Format:
LINES n
Example:
LINES 24 Maximum for non-interlace
LINES 48 Maximum for interlaced
------------------------------------------------------------
MODE Set a transfer mode for KERMIT to use (INIT,SCRIPT)
Format:
MODE type type of transfers to perform
Example:
MODE IMAGE image mode transfers
MODE CRLF <CR><LF> text transfers (VMS Kermit).
------------------------------------------------------------
NUMKEY Numeric keypad mode (INIT,SCRIPT)
Format:
NUMKEY ON/OFF or YES/NO
Example:
NUMKEY ON Keypad is pure numbers
------------------------------------------------------------
ON Peforms a command every time string is received (SCRIPT)
Format:
ON "string" cmd Execute cmd when string is received.
Only one ON string may be installed at a
time.
If cmd is a GOTO and we were previously
WAITing for a string the WAIT is aborted and
execution resumes at the new label.
If cmd is not SEND and we were previously
DELAYing, then the DELAY is aborted and the
cmd is executed, followed by the next command
after the DELAY.
If cmd is a SEND and we were previously
DELAYing, then the DELAY is continued.
Example:
ON "LOSS CARRIER" GOTO RESTART
If modem drops carrier, try to redial
ON "--more--" SEND " "
Send a space every time --more-- is received
------------------------------------------------------------
PARITY Sets the parity (INIT,SCRIPT)
Format:
PARITY type Set the parity type
Example:
PARITY NONE no parity
PARITY MARK mark parity
PARITY SPACE space parity
PARITY ODD odd parity
PARITY EVEN even parity
------------------------------------------------------------
SB Sends a break character to the host (SCRIPT)
Format: Note that any pending character to send
SB is aborted by this call
------------------------------------------------------------
SCREEN Define the screen type (INIT)
Format:
SCREEN type type of screen to use
Example:
SCREEN WORKBENCH use the workbench screen
SCREEN CUSTOM use a custom screen
------------------------------------------------------------
SEND Sends a string or character to the host. (SCRIPT)
Format:
SEND "string" Sends a string to the host. Beginning and
ending double quotes (") are required. A
carat (^) may be used to send control chars.
Two carats transmits a carat character.
SEND chr Sends a single character.
SEND ^chr Sends a single control character. The chr
is NOT case sensitve
Example:
SEND "mail" Send the string mail
SEND "dir^M" Send the string dir followed by a <CR>
SEND a Send the letter a
SEND ^C Send a control C
SEND "abc^^def" Send the string abc^def
SEND ^^ Send a control-uparrow
SEND " Send the '"' character
------------------------------------------------------------
SWAP Swap the meanings of backspace and delete keys (INIT,SCRIPT)
Format:
SWAP ON/OFF or YES/NO
Example:
SWAP NO Use standard definitions
------------------------------------------------------------
VOLUME Set the BELL volume (INIT)
Format:
VOLUME n
Example:
VOLUME 0 Use a visual bell
VOLUME 64 Use a loud audible bell
------------------------------------------------------------
WAIT Suspends until a certain string is received. (SCRIPT)
Format:
WAIT "string" Same rules for string as SEND
WAIT Enter an endless wait. Usually used after
some "ON" commands have been set up. Can
still be aborted via the script menu.
Example:
WAIT "User:" Waits for the string User:
------------------------------------------------------------
WBCOLORS Force usage of workbench colors (INIT)
Format:
WBCOLORS ON/OFF or YES/NO
Example:
WBCOLORS YES Workbebch colors will be used for all
------------------------------------------------------------
WRAP Set long line wrapping (INIT,SCRIPT)
Format:
WRAP ON/OFF or YES/NO
Example:
WRAP ON Long lines will wrap
------------------------------------------------------------
XR Receives a file via XMODEM. (SCRIPT)
Format:
(same format as KS)
------------------------------------------------------------
XS Sends a file via XMODEM. (SCRIPT)
Format:
(same format as KS)
------------------------------------------------------------
----------------------------
Initialization file example:
----------------------------
#####################################################################
#
# VT100 sample initialization file
# v2.6 870222 DBW - Dave Wecker standard defaults
#
# Hash mark at the beginning of a line denotes a comment.
# White space (space(s) or tab(s)) delimit fields.
# Case ignored except for function key bindings.
#
# All items in this file overide variables of the same name in VT100.C
# (all variables in vt100.c have a "p_" prepended to them)
#
#####################################################################
#
APPCUR ON # Application keypad mode is being used
BACKGROUND 000 # Colors are in hex RGB from 000 to FFF
BAUD 2400 # Anything after required fields is ignored
BOLD a00 # Color for bold highlighting (in custom)
BREAK 750000 # Break time in micro-seconds
BUFFER 512 # 512 <= Input buffer size <= 2048
CONVERT ON # KERMIT should downcase host names
CURSOR 00a # Color for cursor (in custom screen)
DEPTH 1 # number of bit planes to use (1 or 2)
ECHO OFF # Full duplex mode in use
FOREGROUND 950 # Colors are only used on the custom screen
INTERLACE ON # ON for CUSTOM or interlaced workbench
KEYSCRIPT 7E # Hex value for script introducer
LINES 48 # normal <= 24 interlaced <= 48
MODE CRLF # IMAGE or CRLF (for KERMIT transfers)
NUMKEY ON # The keypad should be numeric
PARITY NONE # NONE (= 8 bit), MARK, SPACE, ODD or EVEN
SCREEN CUSTOM # may be CUSTOM or WORKBENCH
SWAP OFF # Don't Swap the Back-space and Delete keys
VOLUME 64 # Beep Volume (0 = Visual Beep)
WBCOLORS YES # ignore custom colors and use defaults
WRAP OFF # Auto wrap ON or OFF
#
# Function bindings (strings to type when any of F1 - F10 are pressed)
# f <num> = function key
# f <num>+10 = shifted function key
#
# The string specified must be the same format as the SEND command:
# ^ = control next character
# ^^ = up arrow
#
# Sample control characters:
# ^[ = escape ^M = carriage return
# ^J = line feed ^L = form feed
#
# If the first character of the string is a script introducer
# (KEYSCRIPT) then the string is interpreted as a script filename
# to be executed when the key is pressed.
#
# Examples of bindings:
#
f 1 "^[OP" # f1-f4 = PF1 - PF4 on a VT100
f 2 "^[OQ"
f 3 "^[OR"
f 4 "^[OS"
#
# f5,6,7 = scripts to execute (assuming that KEYSCRIPT = '~' = 0x7E)
#
f 5 "~df1:vt100_source/dialwork.script"
f 6 "~df1:vt100_source/sendvt100.script"
f 7 "~df1:vt100_source/getpics.script"
#
f 8 "MAIL^M" # Reads my mail (note embedded <CR>)
f 9 "NOTE^M" # Reads conferences
f 11 "$2400!" # dials the phone to work
f 12 "$bbs1!" # dials the phone to billboard 1
f 13 "$bbs2!" # dials the phone to billboard 2
f 14 "$bbs3!" # dials the phone to billboard 3
#
# all done with init, now execute script as startup sequence
#
exit df1:vt100_source/dialwork.script
--------------------
Script file example:
--------------------
###################################################################
# Script to dial work (dialwork.script)
# v2.6 870222 DBW
###################################################################
#
# Make sure that we have all the parameters we want
#
DELAY 2
BAUD 2400
PARITY NONE
MODE CRLF
BREAK 750000
SB
#
# First get the modem's attention:
#
Start:
DELAY 1
ON "Ready" GOTO Dial
SEND ^B
DELAY 2
GOTO Start
#
# Now dial the 2400 baud line to work:
#
Dial:
ON "Attached" GOTO Login
SEND "$2400!"
DELAY 30
GOTO Start
#
# We got attached, so keep hitting return until the Gandalf terminal
# handler wakes up:
#
Login:
ON "enter" GOTO Gandalf
DELAY 1
SEND ^M
GOTO Login
#
# Now connect from the Gandalf to the terminal server (ts2):
# (when it asks for a password I need to type the password
# manually here)
#
Gandalf:
DELAY 2
SEND "ts2^M"
WAIT "class start"
#
# Keep sending <CR>'s until the LAT prompts for a username:
#
WaitLat:
DELAY 2
ON "username>" GOTO Lat
SEND ^M
GOTO WaitLat
#
# Tell the LAT that it's me, and connect to the "cookie cluster"
# (my host systems). Tell the cluster my user name.
# (when it asks for a password I need to type the password
# manually here)
#
Lat:
SEND "wecker^M"
DELAY 1
SEND "connect cookie^M"
WAIT "Username:"
SEND "WECKER^M"
WAIT "at home"
SEND "^M^Mn^M"
#
# Got through all the LOGIN garbage, so let's do some work.
#
WAIT "$ "
#
# All done so stop:
#
EXIT