[ALT]-[X] Transfer Files The "Transfer Files" section allows you to transmit or receive files using three different methods. Ultimaterm also allows files to be sent from the text buffer or right from disk (or ramdisk if 512K is present). When you select [ALT]-[X] the following window will appear: Transfer Files T Transmit Buffer R Receive Buffer S Xmodem Send U Ymodem Send X Xmodem Receive Y Ymodem Receive D File Transfers to DISK "Transmit Buffer" simply sends the contents of the buffer across the modem in a straight ASCII dump. If a CAN (^X) is received from across the modem or you press [SHIFT]-[BREAK] (ESC), the transmission will be aborted. "Receive Buffer" simply waits for an ASCII transmission from across the modem and then opens the buffer and captures all incoming text. If no text is received within one minute of selecting "Receive Buffer" then the message "Timed out on Remote" will be displayed. If, after the transmission is started, no text is received within two seconds, then Ultimaterm will assume a successful transmission and close the buffer. If "Auto-Clear" is enabled, Ultimaterm will not clear the buffer until the first character is received. This allows you to abort the transmission with [SHIFT]-[BREAK] and not loose any contents in the buffer. Pressing [D] allows you to perform Xmodem or Ymodem transfers to/from disk. When disk is selected, the choice on the menu will change from "File Transfers to DISK" to "File Transfers to BUFFER". Press [B] and Xmodem or Ymodem transfers will be performed to/from buffer. The status of the disk/buffer flag is saved with the default options. If transfers to disk are selected and you choose Xmodem or Ymodem Receive then the top five lines are scanned for a filename. First it looks for the word "File" in any case. Then it looks for a ":" within ten characters from the word "File". Finally it skips over any spaces (up to ten) to the filename which it reads in and converts to uppercase. Correct formats which Sysops might want to implement in their file sections could be as follows: File : Ultimate.bin or FILENAME: ULTIMATE.BIN or File: Ultimate.BIN I'm sure you get the idea. 21 "Xmodem Send" allows you to transmit a file from either disk or buffer using Ward Christensen's original protocol or the CRC option as explained by John Byrns in "XMODEM/YMODEM PROTOCOL REFERENCE" edited by Chuck Forsberg. "Ymodem Send" allows you to transmit a file from either disk or buffer using the Ymodem protocol explained by John Byrns in the aforementioned document. "Xmodem Receive" allows you to receive a file to disk or buffer using either the original Xmodem checksum protocol designed by Ward Christensen or the Xmodem CRC protocol explained by John Byrns. "Ymodem Receive" allows you to receive a file to disk or buffer using the Ymodem protocol explained by John Byrns. If you are receiving to disk, you will be asked for the filename, extension and drive to receive to (select drive 4 to receive to ramdrive) and then you will be asked for the file type (ASCII, BASIC binary, etc.). If you are transmitting from disk, you will be asked for the filename, extension and drive of the file you wish to send. The X/Ymodem window will pop up and transmission will start. First thing that happens is the CRC option is attempted. A "C" is sent across the line signaling the transmitter that Ultimaterm will accept the transmission using CRC protocol. If the receiver doesn't work with CRC, it will ignore the three attempts Ultimaterm makes at CRC and should catch when Ultimaterm switches over to checksum. If, after ten attempts at checksum, no response is received from the transmitter, Ultimaterm will print the window "Timed Out" and ask if you would like to try again. If you select yes, Ultimaterm will restart the transmission making three attempts at CRC and ten attempts at checksum. If you say no, you will be returned to terminal mode. While the transmission is coming across, you will get to watch it through a 20 byte window along the bottom of the Xmodem Receive window. At any time during ANY transmission (be it Xmodem or Ymodem) you can abort the transfer by pressing [SHIFT]-[BREAK] (ESC). If you're receiving a file, Ultimaterm will wait until the transmitter stops sending the current block and then let the sender know the transmission is aborted. If you are receiving a file to disk, and the disk becomes full to capacity, the transmission will be aborted to save you any further charges on long distance transmissions. 22 CRC Option The formal definition of the CRC calculation is "The message polynomial is first multiplied by X^16 and then divided by the generator polynomial (X^16 + X^12 + X^5 + 1) using modulo two arithmetic. The remainder left after the division is the desired CRC" (XMODEM/YMODEM PROTOCOL REFERENCE, Edited by Chuck Forsberg, 5.1.1 Formal Definition (CRC Calculation)). A sample calculation under 'C' (right from the above source) is /* This function calculates the CRC used by the XMODEM/CRC Protocol. * The first argument is a pointer to the message block. * The second argument is the number of bytes in the message block. * The function returns an integer which contains the CRC. * The low order 16 bits are the coefficients of the CRC. */ int calcrc (ptr, count) char *ptr; int count; { int crc, i; crc = 0; while(--count >= 0) { crc = crc ^ (int)*ptr++ << 8; for (i=0; i < 8; ++i) if(crc & 0x8000) crc = crc << 1 ^ 0x1021; else crc - crc << 1; } return (crc & 0xFFFF); } Since I don't understand 'C' yet, and the formal definition went above my head, CRC seemed an impossibility until Rex Hebert sent me the OS9 assembled source under the 6809 which he in turn got from Delphi. In Ultimaterm V3.0 I waited until the block was received and then calculated the CRC on the block. In Ymodem transmissions, block lengths of 1024 characters caused a noticeable delay while the CRC was being calculated and I realized that this delay would be costing users of DELPHI and CIS a bit extra money. I rewrote my CRC calculation subroutine so that as each character was received, it would be added to the 16 bit CRC which would be started at zero. 23 Because the original CRC calculator was not written by me, I would like to offer the subroutine used in Ultimaterm to public consumption. It is as follows: * * CRC Calculator for X/Ymodem * * enter with (A) holding the byte to add * to the CRC. Exit with the two-byte * variable 'CRC' holding the updated CRC * calculation. * CRC FDB $0000 Variable to hold the CRC CRCVAR FCB $00 Variable to count the SHIFTs * CALCRC PSHS D Preserve registers used LDB #8 Get ready for the 8 bit shift STB CRCVAR Hold it for later EORA CRC XOR byte to the CRC LDB CRC+1 Make (D) the entire CRC value CRC1 ASLB Rotate the (D) register to get the ROLA dropped bit (X^16) in the carry flag BCC CRC2 Branch if not X^16 EORA #$10 Otherwise XOR with the rest of EORB #$21 the polynomial (X^12 + X^5 + 1) CRC2 DEC CRCVAR All 8 bits shifted through? BNE CRC1 Not yet STD CRC Else save the new CRC PULS D,PC and return * With the CoCo 3 running at double speed, the above CRC routine doesn't seem to slow down any running 2400 baud through the serial port. To save a few extra cycles, I have the CRC variables in direct page ram. 24 Ultimaterm Clock files One thing Ultimaterm had that many people liked was the ability to support a hardware or software clock. To add the clock display to Ultimaterm, one had to run a program called "ADDCLOCK.BAS" which appended the ML clock to Ultimaterm so they would both be loaded at the same time. Unfortunately, in the course of it's travel to Delphi, Ultimaterm ended up some 512 bytes shorter than when it left me, and the appending of the clock didn't work. All you have to do for Ultimaterm V4.0 is rename the clock file you wish loaded to "ULTCLOCK.BIN" and when you LOADM Ultimaterm, it will load that file automatically. I have included three sample clock files with Ultimaterm for some of the more common real time clocks that are available for the CoCo. The first of these files is called "MC146818.CLK" and allows the displaying of time using that particular clock chip. The Speech Systems RTC will work with that clock file as will most home-made clocks. The second file is called "DISTO.CLK" and will work with the Disto clock or any other clock that uses the MSM5832 chip. The third clock file that comes with Ultimaterm is a software clock. If the software clock is selected and loaded into memory by Ultimaterm, then the time can be set from the terminal mode with [ALT]-[Z]. The software clock is by no means reliable, but will give you a general impression of just how long you've been using a system. The clock speed will vary with what baud rate you have and whether you use the serial port or the RS232 pak. 25 Ultimaterm's Keyboard Another area of Ultimaterm not left untouched was the keyboard driver. I wrote a new one that allows much better control over the speed and delay of the key repeat. Besides all the regular keys (like [A], [S], [D] and [F]) I have assigned a few unique values to a few keys or key combinations (some you know of course). They are as follows: To generate Press -------------------- ------------------ Up arrow pic [^@] Caret ^ [SHIFT]-[@] Underscore _ [SHIFT]-[up arrow] Left Brace [ [SHIFT]-[dn arrow] Right Brace ] [SHIFT]-[rt arrow] DELETE ($7F) [SHIFT]-[lf arrow] Right parenthesis { [F1] Pipe | [F2] Left parenthesis } [SHIFT]-[F1] Tilde ~ [SHIFT]-[F2] ^C ($03) [BREAK] BS ($08) [lf arrow] TAB ($09) [rt arrow] LF ($0A) [dn arrow] VT ($0B) [up arrow] FF ($0C) [CLEAR] CR ($0D) [ENTER] ESC ($1B) [SHIFT]-[BREAK] -------------------- ------------------ All [CTRL] key combinations are also enabled. Screen Control Certain characters or combinations of characters will perform various controls over the screen. The following lists the characters and what they do no matter what terminal emulation is set: Character rcvd What it does -------------- ---------------------------------------- BEL ($07) Rings Ultimaterm's bell BS ($08) Backs the cursor up one column HT ($09) Moves the cursor to the next 10's column LF ($0A) Moves the cursor down one row VT ($0B) Moves the cursor up one row FF ($0C) Clears the screen, homes the cursor CR ($0D) Moves cursor to column 0 of the same row -------------- ---------------------------------------- 26 DEC VT-52 Control Codes The following is a list of the supported VT-52 control codes that are received or transmitted when Terminal Type is set to VT52: A Move cursor up B Move cursor down C Move cursor right D Move cursor left E Erase screen H Home cursor I Reverse LF with scroll J Erase from cursor to end of screen K Erase from cursor to end of line Yrc Move cursor to row (r-32), column (c-32) Z Identify /Z Response to Identify b Erase from cursor to start of screen j Save cursor position k Restore cursor position l Erase line o Erase from cursor to start of line p Light background q Dark background x2 Key click off x5 Cursor invisible y2 Key click on y5 Cursor visible < Use VT-100 escape sequences 27 The following is a list of the supported VT-52 functions and the keys they are assigned to when Terminal Type is set to VT52 and the VT Keypad is on (ALT-Q): Ultimaterm keys DEC VT-52 FUNCTION TRANSMITTED CODES (hex) ----------------------------------------------------------------- Control-I ......... Horizontal Tab ........................... 09 Shift Left Arrow .. Character Delete ......................... 7F Shift @ ........... Home Cursor ............................ 1B48 Up Arrow .......... Cursor Up .............................. 1B41 Down Arrow ........ Cursor Down ............................ 1B42 Right Arrow ....... Cursor Right ........................... 1B43 Left Arrow ........ Cursor Left ............................ 1B44 CLEAR ............. Clear Screen ....................... 1B481B4A Shift ENTER ....... Erase end of line ...................... 1B4B ALT 0 ............. Keypad Application mode 0 ............ 1B3F70 ALT 1 ............. Keypad Application mode 1 ............ 1B3F71 ALT 2 ............. Keypad Application mode 2 ............ 1B3F72 ALT 3 ............. Keypad Application mode 3 ............ 1B3F73 ALT 4 ............. Keypad Application mode 4 ............ 1B3F74 ALT 5 ............. Keypad Application mode 5 ............ 1B3F75 ALT 6 ............. Keypad Application mode 6 ............ 1B3F76 ALT 7 ............. Keypad Application mode 7 ............ 1B3F77 ALT 8 ............. Keypad Application mode 8 ............ 1B3F78 ALT 9 ............. Keypad Application mode 9 ............ 1B3F79 ALT - (dash) ...... Keypad Application mode - (dash) ..... 1B3F6D ALT , (comma) ..... Keypad Application mode , (comma) .... 1B3F6C ALT . (period) .... Keypad Application mode . (period) ... 1B3F6E ALT ENTER ......... Keypad Application mode ENTER ........ 1B3F4D ALT F1 ............ Program Function 1 (PF1) ............... 1B50 ALT F2 ............ Program Function 2 (PF2) ............... 1B51 ALT F3 ............ Program Function 3 (PF3) ............... 1B52 ALT F4 ............ Program Function 4 (PF4) ............... 1B52 28 DEC VT-100 Control Codes The following is a list of the supported VT-100 control codes that are received or transmitted when Terminal Type is set to VT100: 7 Store cursor location and attributes 8 Get cursor location and attributes D Index (same as linefeed) E New line (go to first column of next line) M Reverse linefeed Z Identify (not recommended.. see ESC [c) < Sets terminal for ANSI escape sequences > Sets auxiliary keypad to numeric = Sets auxiliary keypad to escape sequences [xA Move cursor up x lines [xB Move cursor down x lines [xC Move cursor right x lines [xD Move cursor left x lines [r;cH Move cursor to row r, column c [0J Erase from cursor to end of screen [1J Erase from cursor to start of screen [2J Erase entire screen [0K Erase from cursor to end of line [1K Erase from cursor to start of line [2K Erase entire line [0c Identify [?1;0c Response to Identify [r;cf Move cursor to row r, column c [?1h Cursor keys generate application control functions [?2h Use VT-52 escape sequences [?5h White screen background [>4h Home and Clear on FF [>14h Half duplex [?1l Cursor keys generate ANSI cursor control sequences [?5l Black screen background [>4l LF on FF [>14l Full duplex [m Default attributes (white on black, no attributes) [0m Default attributes (white on black, no attributes) [4m Turn underline attribute on [7m Inverse letters [5n Device Status Report [0n Term OK (echoed back for DSR) [6n Cursor Position Report [r;cR Cursor is at row r, column c (echoed back for CPR) [t;br Set top and bottom margins (for scroll) [h;m;st Set time to h:m:s [0v Visible cursor [1v Invisible cursor [2v Cursor is underline [3v Cursor is block 29 The following is a list of the supported VT-100 functions and the keys they are assigned to when Terminal Type is set to VT100 and the VT Keypad is on (ALT-Q): Ultimaterm keys DEC VT-100 FUNCTION TRANSMITTED CODES (hex) ----------------------------------------------------------------- Control-I ......... Horizontal Tab ........................... 09 Shift Left Arrow .. Character Delete ......................... 7F Shift @ ........... Home Cursor .......................... 1B5B48 Up Arrow .......... Cursor Up ............................ 1B5B41 Down Arrow ........ Cursor Down .......................... 1B5B42 Right Arrow ....... Cursor Right ......................... 1B5B43 Left Arrow ........ Cursor Left .......................... 1B5B44 CLEAR ............. Clear Screen ................. 1B5B481B5B324A Shift ENTER ....... Erase end of line .................... 1B5B4B ALT 0 ............. Keypad Application mode 0 ............ 1B4F70 ALT 1 ............. Keypad Application mode 1 ............ 1B4F71 ALT 2 ............. Keypad Application mode 2 ............ 1B4F72 ALT 3 ............. Keypad Application mode 3 ............ 1B4F73 ALT 4 ............. Keypad Application mode 4 ............ 1B4F74 ALT 5 ............. Keypad Application mode 5 ............ 1B4F75 ALT 6 ............. Keypad Application mode 6 ............ 1B4F76 ALT 7 ............. Keypad Application mode 7 ............ 1B4F77 ALT 8 ............. Keypad Application mode 8 ............ 1B4F78 ALT 9 ............. Keypad Application mode 9 ............ 1B4F79 ALT - (dash) ...... Keypad Application mode - (dash) ..... 1B4F6D ALT , (comma) ..... Keypad Application mode , (comma) .... 1B4F6C ALT . (period) .... Keypad Application mode . (period) ... 1B4F6E ALT ENTER ......... Keypad Application mode ENTER ........ 1B4F4D ALT F1 ............ Program Function 1 (PF1) ............. 1B4F50 ALT F2 ............ Program Function 2 (PF2) ............. 1B4F51 ALT F3 ............ Program Function 3 (PF3) ............. 1B4F52 ALT F4 ............ Program Function 4 (PF4) ............. 1B4F52 30 ANSI-BBS Control Codes The following is a list of the supported ANSI-BBS control codes that are received or transmitted when Terminal Type is set to ANSI: [xA Move cursor up x lines [xB Move cursor down x lines [xC Move cursor right x lines [xD Move cursor left x lines [r;cH Move cursor to row r, column c [0J Erase from cursor to end of screen [1J Erase from cursor to start of screen [2J Erase entire screen [0K Erase from cursor to end of line [1K Erase from cursor to start of line [2K Erase entire line [xL Inserts x blank lines at cursor line [xM Deletes x lines including cursor line [x@ Inserts x blank characters at cursor [xP Deletes x characters including cursor character [r;cf Same as [r;cH (not recommended) [6n Cursor Position Report [r;cR Cursor is at row r, column c (echoed back for CPR) [s Save cursor position [u Restore cursor position [m Default attributes (white on black) [4m Set underline attribute [5m Set flashing attribute [7m Invert colors [3xm Set foreground color to 'x' [4xm Set background color to 'x' For foreground and background colors, when 'x' is '0', color selected is black when 'x' is '1', color selected is red when 'x' is '2', color selected is green when 'x' is '3', color selected is yellow when 'x' is '4', color selected is blue when 'x' is '5', color selected is magenta when 'x' is '6', color selected is cyan when 'x' is '7', color selected is white NOTE: In a default save, the current attribute is saved, so you can select a color display you like and save it for each time you use Ultimaterm. 31 Vidtex Control Codes These are taken from the manual to "Greg-E-Term" with only three differences to GETERM.. Ultimaterm responds with "ULTIMATERM 4.0" for the Interrogate command.. Ultimaterm will always reset to it's default palettes and not those according to Extended Color Basic.. and Ultimaterm will not allow it's screen to be altered from the 80x28 display it is at. It returns a NAK for the screen mode command. The following is a list of supported Vidtex control codes that are received or transmitted when Terminal Type is set to Vidtex: A Move cursor up B Move cursor down C Move cursor right D Move cursor left H Home cursor I Interrogate: Ultimaterm responds "ULTIMATERM 4.0" J Clear to end of screen K Clear to end of line Yrc Move cursor to row (r-32), column (c-32) j Clear screen, home cursor Ax Set attribute to 'x' Bx Set border color to 'x' C Returns $FF for CoCo 3 D Forces Ultimaterm to 8n1 I Interrogate: Ultimaterm responds with $07 for CoCo III 80x24 screen Ppc Set palette 'p' to color 'c' Rx Set palettes to default; ignores x Sx Ignores this command, returns NAK ($15) 32