home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
SCAN22.LBR
/
SCAN22.PZT
/
SCAN22.PAT
Wrap
Text File
|
1990-05-15
|
21KB
|
502 lines
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
; * *
; * S C A N *
; * *
; * A ZCPR3-Compatible Buffered Bi-directional *
; * Video-oriented Text File Display Utility *
; * For Text and Library Member Files *
; * *
; * Copyright (c) 1988-90 *
; * by *
; * Terry Hazen *
; * 21460 Bear Creek Road *
; * Los Gatos, CA 95030 *
; * *
; * Voice.......... (408) 354-7188 *
; * Zee-Machine.... (408) 245-1420 *
; * Ladera Znode... (213) 670-9465 *
; * *
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;
;
; Latest Revision
; ---------------
;
; Version 2.2 - 05/18/90 See SCAN22.HIS for revision details.
;
;================================================================
;
; Equates
;
OFF EQU 0
ON EQU 0FFh
BS EQU 8 ; Backspace character
TAB EQU 9 ; Tab character
CR EQU 13 ; Carriage return character
ESC EQU 27 ; Escape character
SPACE EQU 32 ; Space character
;
HELP EQU 13B5h ; Start of help screen overlay
ORG 010Bh ; Start of patch area
;=================================================================
;
; SCAN has several locations near the beginning of the program
; that can be patched using DDT, DDTZ, PATCH, ZPATCH, etc, to
; alter the operation of the program to suit the user. The
; following tables list these patch locations and their
; distribution defaults.
;
; There are also several other ways to configure SCAN. Some of
; SCAN.COM's more common user-configurable settings may be
; changed by using ZCNFG14.COM and the configuration file
; SCAN.CFG. The syntax is:
;
; ZCNFG comfile[.COM]] [configfile[.CFG]]
;
; This file, SCAN.PAT, is also the source code for an overlay
; file. It may be renamed to OVERLAY.Z80, for example, edited to
; configure your copy of SCAN22.COM the way you want it,
; assembled to OVERLAY.HEX and then overlaid on SCAN22.COM using
; MLOAD or MYLOAD:
;
; A0>MLOAD SCAN.COM=SCAN22.COM,OVERLAY.HEX
;
; See the 'Extended Z3TCAP' section, below, for information on
; the structure of the new VLIB4D extended Z3TCAP. TCSRC13.DOC
; contains information on using TCSRC13.COM, a utility that
; allows you to quickly and easily create commented VLIB4D
; extended Z3TCAP source code files from existing TERMNAME.Z3T
; files or from the Z3TCAP in your environment. Such a source
; code file may then be edited to add the extended features for
; your terminal, and assembled to a COM file (renamed to a Z3T
; file.) It may then be installed into SCAN or into your
; environment.
;
;================================================================
;
; Terminal Lines and Columns
; --------------------------
;
; SCAN provides internal locations for the number of lines and
; columns your terminal displays. In ZCPR3 environments, SCAN
; will look first for the value in the internal location and if
; a non-zero value is found, SCAN will take that value. If the
; internal value is zero, SCAN will take the value from the ZCPR3
; environment. For use in non-ZCPR3 environments or to override
; the values in your ZCPR3 environment, patch these values to
; match your terminal.
;
; Since terminals and terminal setups vary widely, the new
; VLIB4D extended Z3TCAP also includes two terminal configuration
; bytes that define such things as whether the terminal is set to
; automatically wrap lines when a character is displayed in the
; last column and whether the terminal is set to automatically
; scroll the display up one line when a character is displayed in
; the last column of the last line. The value of these bytes
; will depend not only on your type of terminal, but on how you
; have it set up.
;
; To help avoid problems with terminals doing autowrap and
; creating unwanted extra lines in the SCAN display, SCAN checks
; the second terminal configuration byte and won't place
; characters in the last column position in its displays if it
; finds that the terminal either automatically wraps or scrolls.
;
; If you use a standard Z3TCAP, for example, and it has a space
; (20h) character in the last terminal name byte (in other words,
; no terminal configuration byte), SCAN will assume that your
; terminal is set to automatically wrap and scroll, and won't use
; the last display column. If you do want your SCAN display to
; use the last column, you can either patch the proper
; configuration byte for your terminal and setup into your Z3TCAP
; or you can just patch the internal columns byte to the number
; of your terminal columns + 1 and SCAN will use that value - 1
; as the last column in its display.
;
; Default Location Purpose
;================================================================
DB 0 ; 010Bh ; Number of display lines.
DB 0 ; 010Ch ; Number of display columns.
;
; Screen Overlap
; --------------
;
; You may specify the overlap, the number of lines from a
; previous screen displayed on a new screen when paging the
; display by screens. The overlap helps you orient yourself when
; you move to a new display screen. WordStar 3.0, for example,
; uses an overlap of 5 lines and WordStar 4.0 uses an overlap of
; 3 lines.
;
; Default Location Purpose
;================================================================
DB 3 ; 010Dh ; The number of lines from previous
; screen displayed on new screen.
;
; Display Modes
; -------------
;
; You may select the default display mode by setting either the
; WordStar or the ZCPR3 byte to ON (FFH). Only one mode should
; be selected as the default. If both modes are set to ON, the
; default will be the WordStar display mode. Patch both bytes to
; OFF (00h) to select the basic vanilla display mode as the
; default.
;
; Default Location Purpose
;================================================================
DB ON ; 010Eh ; Default to WordStar display mode.
DB OFF ; 010Fh ; Default to ZCPR3 display mode.
;
; Found String Display Line
; -------------------------
;
; You may specify the line on which SCAN displays the search
; string when it is found. SCAN is distributed with the WordStar
; 3.0 and 4.0 default of line 13.
;
; Default Location Purpose
;================================================================
DB 13 ; 0110h ; Found string displayed on line 13 (0Dh)
;
; Wildcard String Search Character
; --------------------------------
;
; Like WordStar, SCAN recognizes a wildcard character in the
; search string, matching any single character in the text. The
; default wildcard character is WordStar's wildcard character ^A
; (01h). This means that you can't search for the ^A (01H)
; character in the text, which is used in some ZCPR3 files to
; turn on video highlighting. You may patch a different wildcard
; character in the location below. Pick a character not usually
; found in the text you normally search. The tilde (~) character
; is one suggestion.
;
; Default Location Purpose
;================================================================
DB 'A'-40h ; 0111h ; Default is WordStar character (^A=01h)
;
; Processor Speed
; ---------------
;
; To use terminals requiring terminal control sequence delays in
; non-ZCPR3 environments, you may patch the clock speed of your
; processor, in megahertz, in the location below. If the value
; is left at 0, the default speed is assumed to be 4 MHZ. This
; value affects only the delay timing loops.
;
; Default Location Purpose
;================================================================
DB 0 ; 0112h ; Processor speed (4 MHZ default).
;
; Printer Initialization String
; -----------------------------
;
; If you wish to set your printer to a specific type face or mode
; whenever you send it text from SCAN, you may patch in a printer
; initialization sequence (6 bytes maximum). Note that this
; sequence is sent to the printer each time printer output is
; selected.
;
; Default Location Purpose
;================================================================
DB 0,0,0,0,0,0 ; 0113h ; Printer initialization sequence,
; 6 bytes maximum.
DB 0 ; 0119h ; - Termination.
;
; Library Fence Character
; -----------------------
;
; Although not usually patched, you may also customize the
; library file display fence character.
;
; Default Location Purpose
;================================================================
DB ' ' ; 01AFh ; Leading space.
DB '| ' ; 0120h ; Library display fence character
; and trailing space.
;
; Extended Z3TCAP
; ---------------
;
; SCAN takes the terminal control sequences it needs from a
; Z3TCAP (Zcpr3 Terminal CAPabilities) area, located either
; internally or in the ZCPR3 environment. SCAN first looks to
; see if the internal Z3TCAP contains a terminal definition (the
; first byte of the Z3TCAP must be a non-space (20h) character.)
; If no terminal definition is found internally, and if SCAN is
; running in a ZCPR3 environment, it looks for a terminal
; definition in the ZCPR3 Z3TCAP. If no terminal definition is
; found, SCAN can't operate properly and will quit with an error
; message.
;
; The new VLIB4D extended ZCPR3 Z3TCAP includes provisions for
; delete line and insert line sequences as well as several other
; new terminal functions. SCAN uses delete line and insert line
; terminal control sequences, if they are present in the current
; Z3TCAP, to help speed up screen redisplay when scrolling the
; display forward or backward one line. If no sequences are
; found, SCAN will create the new display by refreshing the whole
; screen, which takes slightly longer. It is not absolutely
; necessary to use an extended Z3TCAP that contains delete and
; insert line sequences, but you will get faster and more
; WordStar-like screen displays if you do.
;
; To allow SCAN to run in a non-ZCPR3 environment, the user must
; patch a Z3TCAP file (TERMNAME.Z3T) containing the control
; sequences for his terminal into SCAN at the location below.
; The utility SCANINST is provided to install a Z3TCAP from the
; menu of available terminal definitions contained in the
; standard ZCPR3 file, Z3TCAP.TCP, into SCAN's internal Z3TCAP or
; to install a specified TERMNAME.Z3T Z3TCAP file into SCAN. See
; SCANINST.DOC for more information.
;
; If you patch all required Z3TCAP control sequences and
; parameters internally, you can use the same copy of SCAN in
; both CP/M and ZCPR3 environments, as, for example, when
; switching among a variety of different NZCOM systems, including
; a vanilla CP/M base system.
;
ORG 200h ; Start of internal Z3TCAP
;
; The first character in the terminal name must not be a space.
;
TERMNAME:
DB ' ' ; Name of terminal (13 chars)
;
GOFF: DB GOELD-TERMNAME ; Graphics offset from Z3TCAP start
;
; Terminal configuration bytes B14 and B15 are defined and bits assigned
; as follows. The remaining bits are not currently assigned. Set these
; bits according to your terminal configuration. SCAN only checks the
; bits marked '*', below:
;
; * B14 b7: Z3TCAP Type.... 0 = Standard TCAP 1 = Extended TCAP
;
; bit: 76543210
B14: DB 10000000B ; Configuration byte B14
;
; B15 b0: Standout....... 0 = Half-Intensity 1 = Reverse Video
; B15 b1: Power Up Delay. 0 = None 1 = Ten-second delay
; * B15 b2: No Auto Wrap... 0 = Auto Wrap 1 = No Auto Wrap
; * B15 b3: No Auto Scroll. 0 = Auto Scroll 1 = No Auto Scroll
; B15 b4: ANSI........... 0 = ASCII 1 = ANSI
;
; bit: 76543210
B15: DB 00000000B ; Configuration byte B15
;
; Single character arrow keys or WordStar diamond. SCAN doesn't use
; these arrow keys.
;
DB 0 ; Cursor up
DB 0 ; Cursor down
DB 0 ; Cursor right
DB 0 ; Cursor left
;
; Delays (in ms) after sending terminal control strings
;
DB 0 ; CL delay
DB 0 ; CM delay
DB 0 ; CE delay
;
; Strings start here
;
CL: DB 0 ; Home cursor and clear screen
CM: DB 0 ; Cursor motion macro
CE: DB 0 ; Erase from cursor to end-of-line
SO: DB 0 ; Start standout mode
SE: DB 0 ; End standout mode
TI: DB 0 ; Terminal initialization
TE: DB 0 ; Terminal deinitialization
;
; Extensions to standard Z3TCAP
;
LD: DB 0 ; Delete line at cursor position
LI: DB 0 ; Insert line at cursor position
;--------------------------------------------------------------------
;
; NOTE: SCAN doesn't use any of the remaining strings or characters
; in the Z3TCAP. They are included here for reference only.
;
CD: DB 0 ; Erase from cursor to end-of-screen
;
; The attribute string contains the four command characters to set
; the following four attributes for this terminal in the following
; order: Normal, Blink, Reverse, Underscore
;
SA: DB 0 ; Set screen attributes macro
AT: DB 0 ; Attribute string
RC: DB 0 ; Read current cursor position
RL: DB 0 ; Read line until cursor
;
; Graphics TCAP area
;
GOELD: DB 0 ; Graphics On/Off delay in ms
;
; Graphics strings
;
GO: DB 0 ; Graphics mode On
GE: DB 0 ; Graphics mode Off
CDO: DB 0 ; Cursor Off
CDE: DB 0 ; Cursor On
;
; Graphics characters
;
GULC: DB 0 ; Upper left corner
GURC: DB 0 ; Upper right corner
GLLC: DB 0 ; Lower left corner
GLRC: DB 0 ; Lower right corner
GHL: DB 0 ; Horizontal line
GVL: DB 0 ; Vertical line
GFB: DB 0 ; Full block
GHB: DB 0 ; Hashed block
GUI: DB 0 ; Upper intersect
GLI: DB 0 ; Lower intersect
GIS: DB 0 ; Mid intersect
GRTI: DB 0 ; Right intersect
GLTI: DB 0 ; Left intersect
;
; Fill remaining space with zeros
;
REPT 128-($-TERMNAME)
DB 0
ENDM
;
; Command Customization
; ---------------------
;
; SCAN supports the ZPATCH commands 'T'=top of file, 'B'=bottom
; of file, '>'=forward one page and '<'=back one page, as
; well as the extensions '.'=forward one line and ','=back one
; line as an alternate command set.
;
; For users prefering the BGii TYPE command set, the library
; SCAN22BG.LBR contains SCAN22BG.COM and SCAN22BG.Z80 (an overlay
; file) that modify SCAN to make SCAN's alternate commands more
; BGii-compatible.
;
; For those users who hate WordStar commands and want to use a
; different command set, a limited degree of command
; customization is provided. Many WordStar commands are two-
; character commands and not easily changed to one-character
; commands, so command customization patching is limited to
; several of the one-character commands. For example, SCAN uses
; <RET> to move the display ahead one line and SPACE to move the
; display ahead one page (for easier 'tapping' when casually
; viewing files.) Some users, however, may prefer to reverse
; these commands and use <RET> to move ahead one page and SPACE
; to move ahead one line.
;
; SCAN automatically capitalizes command characters when they are
; entered. If entered commands are characters between A and Z,
; they are also made into control characters by subtracting 40h
; from them ('A'-40h = 01h, 'Z'-40h = 1Ah.) Therefore, all
; letter commands patched at the locations below must be patched
; as the capital letter - 40h. All other command characters are
; used exactly as entered.
;
; When SCAN gets a command, it tries to match it with the command
; list starting at 280h. If you change a command to one that
; appears later in the list, the later use of the command will be
; automatically preempted, as the command search will end with
; the first match. For example, using TAB to back up one page
; (at 284h) will automatically preempt its original use to scroll
; the screen right (at 28Ah). Since a command letter may be
; entered with or without the control key being pressed, patching
; a command to 'E'-40h (^E or 05h) means, for example, that
; entering e, E or ^E gives the same result.
;
; To keep the size of SCAN.COM below 6k, the commands below
; marked '(alternate)' do not appear in the HELP screen command
; summary. Note that any changed commands will not be
; automatically reflected in the SCAN HELP screen. However, the
; HELP screen may also be patched to match your new configuration
; (see the section on the HELP screen, below.)
;
; Default Location Purpose
;================================================================
DB 'U'-40h ; 0280 ; Cancel commands
DB 'T'-40h ; 0281h ; Top of file (alternate)
DB 'B'-40h ; 0282h ; Bottom of file (alternate)
DB 'R'-40h ; 0283h ; Up (back) one page
DB '<' ; 0284h ; Up (back) one page (alternate)
DB ',' ; 0285h ; Up (back) one line (alternate)
DB 'W'-40h ; 0286h ; Up (back) one line
DB 'E'-40h ; 0287h ; Up (back) one line (alternate)
DB 'S'-40h ; 0288h ; Scroll display left
DB BS ; 0289h ; Scroll display left (alternate)
DB 'D'-40h ; 028Ah ; Scroll display right
DB TAB ; 028Bh ; Scroll display right (alternate)
DB 'Z'-40h ; 028Ch ; Down (forward) one line
DB 'X'-40h ; 028Dh ; Down (forward) one line (alternate)
DB CR ; 028Eh ; Down (forward) one line (alternate)
DB '.' ; 028Fh ; Down (forward) one line (alternate)
DB '>' ; 0290h ; Down (forward) one page (alternate
DB 'C'-40h ; 0291h ; Down (forward) one page
DB SPACE ; 0292h ; Down (forward) one page (alternate)
DB ESC ; 0293h ; Exit
DB 'F'-40h ; 0294h ; Find string (alternate)
DB 'L'-40h ; 0295h ; Find again (alternate)
DB 'P'-40h ; 0296h ; Printer toggle
DB 'V'-40h ; 0297h ; Video mode toggle (alternate)
ORG HELP
;
; Excerpt from Command Menu Help Screen
; -------------------------------------
;
; Due to the order of display, the screen segments below may not
; seem to be in the order you may expect to see them. When
; modifying the HELP screen, you must not add or subtract any
; characters. Work within the given quotes only.
;
DB '^QR -- Start of File',0,7,41
DB '^QF -- Find String',0,8,10
DB '^R -- Up One Screen',0,8,42
DB '^L -- Find Again',0,9,10
DB '^W -- Up One Line',0,9,42
DB '^U -- Cancel Find',0,11,10
DB '^S <--L Display R--> ^D',0
ORG HELP+0B3h
DB '^Z -- Down One Line',0,13,42
DB '^P -- Printer',0,14,10
DB '^C -- Down One Screen',0,14,41
DB '^KW -- File Output',0,15,9
DB '^QC -- End of File',0,15,41
DB '^OD -- Video Mode',0,16,43
DB '/ -- Help/Text',0
ORG HELP+0140h
DB '^KR -- Read New File',0,19,8
DB '^K0-9 - Set Marker',0,19,41
DB '^KD,^KQ -- EXIT',0,20,8
DB '^Q0-9 - Go to Marker',0,20,41
DB 'ESC,^KX -- EXIT',0
;================================================================
END ; Patch area