; CPDCF.Z80 ; ; ZCNFG configuration module for CPD.COM. The assembled version of ; this file must be named CPDxx.CFG, where xx is the version number ; of CPD, to be automatically recognized by ZCNFG. ; ; Version 1.0 -- August 10, 1991 -- Gene Pizzetta ; For CPD 1.0. ; ; Patch locations . . . ; SysFlg equ 015h ; system files BthFlg equ 016h ; duplicated files MisFlg equ 017h ; missing files ArcFlg equ 018h ; archiving PagFlg equ 019h ; screen paging FFFlag equ 01Ah ; form feed ; ; ZCNFG function definitions . . . ; Switch equ 0 ; toggle bit n in a byte (n is specified) Text equ 1 ; edit text with UC conversion DUSpec equ 2 ; replace a ZCPR style DU spec (NOT DIR:!) HexRad equ 3 ; edit byte/word using HEX radix DecRad equ 4 ; edit byte/word using DECIMAL radix TextLC equ 5 ; edit text, both UC and LC FileSp equ 6 ; edit a Z3 filespec or filespec fragment Togl3 equ 7 ; toggle one of three options: 001B, 010B, 100B ToglTF equ 8 ; toggle a byte between 0ffh and 0 ; ; ASCII characters . . . ; HON equ 1 ; highlight on HOF equ 2 ; highlight off TAB equ 9 ; tab LF equ 10 ; linefeed CR equ 13 ; carriage return ; ; Macro definitions ; C = character to identify menu item ; OFFSET = offset in program's configuration block ; FUNC = ZCNFG function ; SCRN = screen location for data ; DATA = function data address (if required) ; CASE macro c,func,offset,bytes,scrn,data db '&C' dw func, offset db bytes dw scrn, data endm ; ; Code . . . ; rst 0 ; for safety, so .CFG file won't execute ; dw MenuA ; for relocation of addresses, this ; ..points to the NEXT location. ; ; Menu list section . . . ; ; You will probably need to modify the following menu list to give the ; desired number of menus (now configured for TWO, menus A and B). ; Each entry is a doubly linked node, pointing to the next entry ; in the list, the previous entry in the list, and a menu screen, ; case table, and help screen. If only one menu is to be used, ; it points only to itself. See ZCNFG.WS for help. ; MenuA: dw MenuA, MenuA, ScrnA, CaseA, HelpA ; single menu ; ; Case table section . . . ; ; You should modify the records in the case table(s) below to specify ; which functions (see EQUATES, above) ZCNFG is to perform for each ; menu selection, and the locations ZCNFG is to patch. You can use as ; many menu selections as you can devise unique selectors for (case doesn't ; count), though as a practical matter you will probably want to use more ; than one Case Table to implement large numbers of selections. ; Sample case table for Menu A. The first two bytes give the number of ; records followed by the length of each record. The rest of the table ; consists of up to 255 identical records. ; CaseA: db (CaseAX-CaseA1)/(CaseA2-CaseA1) ; number of cases db CaseA2-CaseA1 ; length of each record ; ; Macro name ; | Single char menu selector ; | | Function (see above) ; | | | Offset in config block ; | | | | Number of bytes ; | | | | | Screen location ; | | | | | | ;Case1: CASE 0, ToglTF, Loc1, 1, ScrnA1, NoYes ; | ; Address of data used by function ; ; The first two entries in table are labeled for calculation at CaseA:. ; CaseA1: CASE B, ToglTF, BthFlg, 1, ScrnA1, YesNo CaseA2: CASE M, ToglTF, MisFlg, 1, ScrnA2, YesNo CASE A, ToglTF, ArcFlg, 1, ScrnA3, YesNo CASE S, ToglTF, SysFlg, 1, ScrnA4, YesNo CASE P, ToglTF, PagFlg, 1, ScrnA5, NoYes CASE F, ToglTF, FFFlag, 1, ScrnA6, YesNo CaseAX: ; for calculation of list length ; ; Case table support . . . ; ; Sample case table support data structures. These may be pointed to by the ; last element of a case table record if the ZCNFG function specified in ; the case table entry requires additional parameters. For example, AC1MM ; (stands for "ACase1, Min/Max") is pointed to by the last two bytes of ; ACase record ACase1 above, and gives the minimum and maximum values to ; be accepted by the ZCNFG function DecRad, also specified in ACase1. ; YNData (stands for "YES/NO Data") is pointed to by the last two bytes of ; ACase2 and ACase3 above, and gives the strings to be printed by the ; ZCNFG function ToglTF also specified in ACase2 and ACase3. ; YesNo: db 'YES',0 ; displayed if value is FFh (ToglTF) NoYes: db ' NO',0 ; displayed if value is 00h (ToglTF) db 'YES',0 ; ; Screen image section . . . ; ; Sample screen image for Menu A. This is what appears on the screen ; when the user initially invokes ZCNFG with this .CFG file. This screen ; data is pointed to by its MENU LIST entry (above). Before displaying ; the following ASCII information, ZCNFG substitutes the current values ; for the file being altered for the blank spaces at the secondary labels ; below. For example, at label AScrnM ("Menu A, Screen location M") below, ; ZCNFG substitutes the current ASCII value for the byte at location Patch1 ; in the file being patched before displaying the screen. When the value ; at Patch1 is changed, ZCNFG updates the screen data before redisplaying ; the screen. ; Note that the display is ENTIRELY UP TO YOU. You should, however, be sure to ; indicate the letter or number corresponding to the "ASCII selector" in ; the case table entry for that option; otherwise the user will not know ; how to select the option! ; ScrnA: db cr,lf,lf,tab,tab,tab,' CPD Installation Menu' db cr,lf,lf,lf ; db tab,tab,'(B) ',1,'Show only duplicated files by default? .',2 ScrnA1: db ' ' ; current value db cr,lf,lf ; db tab,tab,'(M) ',1,'Show only missing files by default? . .',2 ScrnA2: db ' ' ; current value db cr,lf,lf ; db tab,tab,'(A) ',1,'Archive duplicated files by default? . .',2 ScrnA3: db ' ' ; current value db cr,lf,lf ; db tab,tab,'(S) ',1,'Include system files by default? . . . .',2 ScrnA4: db ' ' ; current value db cr,lf,lf ; db tab,tab,'(P) ',1,'Page screen by default? . . . . . . . .',2 ScrnA5: db ' ' ; current value db cr,lf,lf ; db tab,tab,'(F) ',1,'Send final form feed by default? . . . .',2 ScrnA6: db ' ' ; current value ; db cr,lf,lf,lf ; fill rest of screen ; db 0 ; terminator ; ; Help screen section . . . ; ; Sample help screen for Menu A. The following, up to the terminating ; binary 00, appears as-is when the user types "?" or "/" for help while ; ZCNFG is displaying the initial patch menu. ; HelpA: db CR,LF ; db HON,'Option (B)',HOF,' -- Setting this option "YES" causes ' db 'CPD to default to displaying',CR,LF db 'only files which exist in both directories. The default ' db 'may be toggled',CR,LF db 'with the command line "B" option. If this option is "YES", ' db 'make sure the M',CR,LF db 'option is "NO"; otherwise, you will not like the result.' db CR,LF,LF ; db HON,'Option (M)',HOF,' -- If this option is "YES", CPD will ' db 'default to displaying only',CR,LF db 'files in the first directory which do not exist in the ' db 'second directory.',CR,LF db 'The default may be toggled by using the command line "M" ' db 'option. If this',CR,LF db 'option is "YES", make sure option B is "NO". Take my word ' db 'for it.' db CR,LF,LF ; db HON,'Option (A)',HOF,' -- "YES" here makes CPD set the archive ' db 'attributes of files in',CR,LF db 'the first directory by default that are duplicated in the ' db 'second directory.',CR,LF db 'I can''t imagine anyone wanting to make this the default mode ' db ' of operation,',CR,LF db 'but here it is if you have a need for it. The configured ' db 'default can be',CR,LF db 'toggled with the command line "A" option.' db CR,LF,LF,LF,LF,LF,LF,LF,LF ; db HON,'Option (S)',HOF,' -- As distributed CPD defaults ' db ' to finding only non-system',CR,LF db '(directory) files in the first directory. A "YES" allows ' db ' CPD to always',CR,LF db 'find all files, including system (hidden) files. The default ' db 'set here can',CR,LF db 'be toggled with the command line "S" option. This option ' db 'does not affect',CR,LF db 'the second directory, where any matching files are always ' db ' found without',CR,LF db 'regard for their attributes.' db CR,LF,LF ; db HON,'Option (P)',HOF,' -- CPD pauses, waiting for a keypress, ' db 'each time the screen',CR,LF db 'fills, if "YES" is selected here. "NO" defaults to continuous ' db 'scrolling,',CR,LF db 'which can be paused with Control-S. The number of lines ' db 'on the console',CR,LF db 'screen is obtained from the environment. The chosen default ' db 'can be toggled',CR,LF db 'with the command line "P" option.' db CR,LF,LF ; db HON,'Option (F)',HOF,' -- Choose here whether you want CPD ' db 'to send a form feed to the',CR,LF db 'printer after it prints the file display. The option has ' db 'no effect unless',CR,LF db 'the command line "L" (echo to printer) option is used. ' db ' The form feed',CR,LF db 'default can be toggled with the command line "F" option.' db CR,LF ; db 0 ; Terminator ; end