ZCPR3 Z3TCAP (MYTERM.Z3T) file to source code (MYTERM.Z80) generator. Program Name: TCSRC Author: Terry Hazen Version: 1.3 Date: 07 May 90 Since it is difficult to extensively customize an existing Z3TCAP.Z3T file by patching alone, TCSRC was written to help the user customize his Z3TCAP by creating a commented source code file (MYTERM.Z80) from an existing MYTERM.Z3T file for his terminal, such as one extracted from Z3TCAP.TCP by TCSEL, or from the current Z3TCAP located in memory in the ZCPR3 environment. TCSRC also allows you to create a blank commented Z3TCAP source code file when you want to start from scratch. The new source code file can then be edited as desired, assembled to MYTERM.COM and renamed to MYTERM.Z3T. It can then be loaded to your environment using LDR.COM, NZCOM.COM, JETLDR.COM, etc. TCSRC generates Z3TCAP commented source code based on the Z3TCAP definition contained in VLIB4D. VLIB4D modifies the sequence of control strings in the extended Z3TCAP over that specified by earlier VLIB4 beta releases to bring all the terminal control strings into a common area located prior to the graphics area, reduces the length of the terminal name to 13 bytes and adds a byte defining the offset of the graphics area from the start of the Z3TCAP. TCSRC expects input files to be subsets of the VLIB4D standard, such as standard Z3TCAP files. Consult the current VLIB4 help files for explanations of each of the defined terminal functions and consult your terminal manual for information on the terminal control strings required to implement the terminal functions for your terminal. Source code generated by TCSRC from earlier extended Z3TCAP files with different extended formats will begin to be incorrect when the sequence of control strings begins to differ from the new VLIB4D standard and will have to be corrected with a text editor. Lines of source code defining terminal control strings may simply be moved into the correct order, ignoring both comments and labels (except for GOELD, which is used to define the graphics area offset), as the corrected source code file can be assembled to a COM file and TCSRC can then be used again to quickly generate a new, correctly commented source code file. Syntax ------ TCSRC [dir:]infile[.z3t] [[dir:]outfile[.z80]] Special infile names: 'Z3ENV' creates source code file from the Z3TCAP in the environment. 'BLANK' creates blank commented source code file. Default outfile is infile.Z80 on default directory. Any existing R/W file of the same name will be overwritten. Graphics TCAP Offset -------------------- VLIB4D defines a graphics offset byte at GOFF (Z3TCAP+12), which contains the offset from the start of the Z3TCAP to the start of the graphics area at GEOLD, to allow the future addition of terminal control strings in the terminal control string area without requiring rewritting of the VLIB graphics routines using the graphics data. To compensate for the addition of the graphics offset byte, the length of the terminal name area has been reduced to 13 bytes. Terminal Configuration Bytes ---------------------------- VLIB4D defines two terminal configuration bytes at B14 (Z3TCAP+14) and B15 (Z3TCAP+15) to allow an application program access to terminal characteristics not otherwise specified in the Z3TCAP. Application programs such as WordStar and SCAN now have access to information not only about terminal control strings, but about how users have configured their terminals. Users can set configuration bits indicating, for example, whether or not their terminals are set to auto-wrap at the end of a line or auto-scroll at the end of a screen, whether their terminals use ANSI or ASCII control sequences, and whether they use reverse video or non-reverse (usually dim) video for their standout mode. Not all application aprograms will check the terminal configuration bytes, but their presence allows the user some control over how application programs configure his screen display. SCAN, for example, checks the auto-wrap and auto-scroll bits to see whether it can put characters in the last display column on the screen without causing additional blank lines to be inserted into the display. If both bits are 0, the last column is considered safe, and the whole screen can be used for the display. If either bit is set, the last column is considered reserved and the next-to-last column will be the final column used. So if your terminal is configured to not automatically wrap or scroll, you can set the bits accordingly and SCAN will use the whole screen. Joe Wright's WSPAT for WordStar4 uses the configuration bytes in a similar way, along with the set attribute string to create WS4 display screens. Screen Display Configuration ---------------------------- When you start looking at how many ways a given terminal can be configured by a user and how that configuration can affect screen displays, it quickly becomes clear that a standard Z3TCAP for a given terminal type is not adequate to convey more than basic standard information for that terminal. It may make a difference to a screen display intensive applications program, for example, whether a screen is configured as dark letters on a light screen or light letters on a dark screen and whether reverse video or a non-reverse video mode, such as dim or bold is used as standout. For example, if dim is used as standout mode on a dark screen, spaces in standout mode won't show up, but if reverse video is used, they will, creating quite a different display. If the Z3TCAP for a particular terminal specifies dim as the standout mode, but the user prefers to use bold, reserving dim for standard mode, but then wishes to exit to a normal video command line, he must customize his Z3TCAP to use SO (Start Standout), SE (End Standout), TI (Terminal Initialization) and TE (Terminal Deinitialization) to set his terminal according to his preferences. In this example, SO would set dim, SE would set normal, TI would set dim, and TE would set normal video. Still another user of the same terminal type might prefer half intensity for standout, and would need to customize his Z3TCAP accordingly. So many terminal characteristics may be user configured, in fact, that it is really the user's responsibility to create a customized Z3TCAP for his system that reflects his own preferences. TCSRC attempts to facilitate this process by providing the user a handy tool to quickly create Z3TCAP source code files that may be easily edited and used to create his working customized Z3TCAP. Extended Z3TCAP Terminal Control Sequences ------------------------------------------ The source code created by TCSRC includes the LD (delete line at cursor position) and LI (insert line at cursor position) sequences added in the extended Z3TCAP defined by VLIB4B. Applications such as WordStar and SCAN can use these control sequences to produce better displays. For screen display intensive applications such as WordStar 4.0 patch WSPAT, Joe Wright added a macro to the Z3TCAP and a routine in VLIB4C to set terminal display attributes. The source code created by TCSRC includes the SA (set Attributes) macro and AT (the attribute string). The source code created by TCSRC also includes a CD (clear screen from cursor to end-of-screen) sequence. While sequence is, in some cases, a duplication of part of the CL (Home Cursor and Clear Screen) sequence, it is now available as a separate control sequence. Other New VLIB4D Terminal Control Sequences ------------------------------------------- For use with windowing routines used in pull-down menus, the extended Z3TCAP includes a new RC sequence that reads the character at the current cursor position and a RL sequence that reads the entire line up until the cursor position into a buffer. Consult V4LIBD.HLP for more information. Graphics Extensions ------------------- VLIB4D adds a new standardized character graphics area beginning at GOELD (graphics on/off delay). Graphics extensions include GO/GE (graphics mode on and off), and CDO/GDE (turn the cursor off and on). Graphics Characters ------------------- Graphics characters used by VLIB4D are one-byte characters that produce lines, intersections and corners as well as full and hashed blocks. For terminals without graphics capability, very good results can be obtained using the characters '-' and '|' for horizontal (GHL) and vertical (GVL) line characters. The characters '*' and '#' can be used for full (GFB) and hashed (GHB) blocks, the characters '+' or '*' can be used for corners and the character '+' for intersections. Use TCSRC to add graphics characters to your own Z3TCAP and try BOX.COM from VLIB4D for a demonstration of the new line graphics as used in a box drawing routine.