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 / ZCNFG21.LBR / ZCNFGHLP.LBR / ZCNFGMDL.ZZ0 / ZCNFGMDL.Z80
Text File  |  1991-10-24  |  10KB  |  293 lines

  1.  
  2. ; Module:    ZCNFGMDL - Model ZCNFG configuration file
  3. ; Author:    Carson Wilson
  4. ; Date:        4 Nov 89
  5. ; Version:    1.3
  6. ; Notes:    Use this "template" file to build the source for 
  7. ;         a .CFG file of your own.
  8. ; Version 1.4, 24 Oct 91, by Al Hawley
  9. ; Revised to include new and modified ZCNFG21 capabilities
  10.  
  11. ; This file contains only data structures, and is used by ZCNFG to tell 
  12. ; what to display while patching a file, where to alter the file, and 
  13. ; what sort of values to request from and display to the user.
  14. ;
  15. ; See ZCNFG.HLP for a full explanation of .CFG file format.
  16.  
  17. ; EQUATES
  18.  
  19. ; Sample zero-based offsets of patch locations in the file to be 
  20. ;  altered by ZCNFG.  Modify labels, locations, and descriptions
  21. ;  for your particular application of ZCNFG.  (Used in CASE TABLES, 
  22. ;  below).
  23.  
  24. ;Labels        Locations      Descriptions
  25. Patch1    equ    00Bh        ; Patch location 1
  26. Patch2    equ    00Ch        ; Patch location 2
  27. Patch3    equ    00Dh        ; Patch location 3
  28. Patch4    equ    010h        ; Patch location 4
  29. Patch5    equ    015h        ; Patch location 5
  30. Patch6    equ    016h        ; Patch location 6
  31. Patch7    equ    017h        ; Patch location 7
  32.  
  33. ; ZCNFG function definitions, used in CASE TABLES below.  Do not modify.
  34.  
  35. Switch    equ    0    ; Toggle bit n in a byte (n is specified in BDATA)
  36. Text    equ    1    ; Edit text with UC conversion
  37. DUSpec    equ    2    ; Replace a ZCPR style DU specification (NOT DIR:!)
  38. HexRad    equ    3    ; Edit byte/word using HEX radix
  39. DecRad    equ    4    ; Edit byte/word using DECIMAL radix
  40. TextLC    equ    5    ; Edit text, both UC and LC
  41. FileSp    equ    6    ; Edit a Z3 filespec or filespec fragment
  42. Togl3    equ    7    ; Toggle to one of n options defined by mask in BDATA
  43. ToglTF    equ    8    ; Toggle a byte between 0ffh and 0
  44. ASCIIC    equ    9    ; Replace any ASCII byte with a keystroke
  45.  
  46. ; Sample ASCII definitions, used in SCREEN sections below.
  47.  
  48. tab    equ    9        ;horizontal tab
  49. lf    equ    10        ;line feed
  50. cr    equ    13        ;carriage return
  51. dim    equ    1        ;highlight on
  52. hon    equ    dim
  53. bright    equ    2        ;highlight off
  54. hof    equ    bright
  55.  
  56. ; =======================================
  57. ;
  58. ;    C O D E   B E G I N S
  59. ;
  60. ; =======================================
  61. ;
  62. ; NOTE: the next 13 bytes (up to BMenu, below) MUST remain in 
  63. ;  the following locations:
  64.  
  65.     rst    0    ; For safety, so .CFG file won't execute
  66.  
  67.     dw    AMenu    ; For relocation of addresses, this
  68.             ; ..points to the NEXT location.
  69.  
  70. ; ---------------------------------------------------------
  71. ;
  72. ;    MENU LIST SECTION
  73. ;
  74. ; You will probably need to modify the following menu list to give the
  75. ;  desired number of menus (now configured for TWO, menus A and B).
  76. ;
  77. ; Each entry is a doubly linked node, pointing to the next entry
  78. ;  in the list, the previous entry in the list, and a menu screen, 
  79. ;  case table, and help screen.  If only one menu is to be used,
  80. ;  it points only to itself.  See ZCNFG.WS for help.
  81.  
  82. AMenu:    dw    BMenu, BMenu, AScrn, ACase, AHelp    ; Entry for menu A
  83. BMenu:    dw    AMenu, AMenu, BScrn, BCase, BHelp    ; Entry for menu B
  84.  
  85. ; -------------------------------------
  86. ;
  87. ;    CASE TABLE SECTION
  88. ;
  89. ; You should modify the records in the case table(s) below to specify
  90. ;  which functions (see EQUATES, above) ZCNFG is to perform for each
  91. ;  menu selection, and the locations ZCNFG is to patch.  You can use as
  92. ;  many menu selections as you can devise unique selectors for (case doesn't
  93. ;  count), though as a practical matter you will probably want to use more
  94. ;  than one Case Table to implement large numbers of selections.
  95.  
  96. ; Sample case table for Menu A.  The first two bytes give the number of
  97. ;  records followed by the length of each record.  The rest of the table
  98. ;  consists of up to 255 identical records.
  99.  
  100. ACase:    db    (ACaseX-ACase1)/(ACase2-ACase1)    ; Number of cases
  101.     db    ACase2-ACase1            ; Length of each record
  102.  
  103. ACase1:
  104.     db    '1'    ; Unique ASCII selector from SCREEN IMAGE
  105.     dw    DecRad    ; ZCNFG function number
  106.     dw    Patch1    ; Location in file to be patched by ZCNFG
  107.     db    1    ; BDATA - Number of bytes for ZCNFG to change
  108.     dw    AScrnM    ; Location to change in SCREEN IMAGE
  109.     dw    AC1MM    ; 0 or address of min/max data words or strings
  110.  
  111. ACase2:
  112.     db    '2'    ; Unique ASCII selector from SCREEN IMAGE
  113.     dw    ToglTF    ; ZCNFG function number
  114.     dw    Patch2    ; Location in file to be patched by ZCNFG
  115.     db    1    ; BDATA - Number of bytes for ZCNFG to change
  116.     dw    AScrnT    ; Location to change in SCREEN IMAGE
  117.     dw    YNData    ; 0 or address of min/max data words or strings
  118.  
  119. ACase3:
  120.     db    '3'    ; Unique ASCII selector from SCREEN IMAGE
  121.     dw    ToglTF    ; ZCNFG function number
  122.     dw    Patch3    ; Location in file to be patched by ZCNFG
  123.     db    1    ; BDATA - Number of bytes for ZCNFG to change
  124.     dw    AScrnC    ; Location to change in SCREEN IMAGE
  125.     dw    YNData    ; 0 or address of min/max data words or strings
  126. ACaseX:            ; Label for calculation of list length
  127.  
  128.  
  129. ; Sample case table for Menu B.  This has the same form as the case table
  130. ;  for menu A, above. 
  131.  
  132. BCase:    db    (BCaseX-BCase1)/(BCase2-BCase1)    ; Number of cases
  133.     db    BCase2-BCase1            ; Length of each record
  134.  
  135. BCase1:
  136.     db    'A'    ; Unique ASCII selector from SCREEN IMAGE
  137.     dw    Text    ; ZCNFG function number
  138.     dw    Patch4    ; Location in file to be patched by ZCNFG
  139.     db    3    ; BDATA - Number of bytes for ZCNFG to change
  140.     dw    BScrnA    ; Location to change in SCREEN IMAGE
  141.     dw    0    ; 0 or address of min/max data words or strings
  142.  
  143. BCase2:
  144.     db    'B'    ; Unique ASCII selector from SCREEN IMAGE
  145.     dw    Text    ; ZCNFG function selector
  146.     dw    Patch5    ; Location in file to be patched by ZCNFG
  147.     db    3    ; BDATA - Number of bytes for ZCNFG to change
  148.     dw    BScrnB    ; Location to change in SCREEN IMAGE
  149.     dw    0    ; 0 or address of min/max data words or strings
  150.  
  151. BCase3:
  152.     db    'C'
  153.     dw    Text
  154.     dw    Patch6
  155.     db    3
  156.     dw    BScrnC
  157.     dw    0
  158.  
  159.     db    'D'
  160.     dw    Text
  161.     dw    Patch7
  162.     db    3
  163.     dw    BScrnD
  164.     dw    0
  165. BCaseX:            ; Label for calculation of list length
  166.  
  167. ; Sample case table support data structures.  These may be pointed to by the
  168. ;  last element of a case table record if the ZCNFG function specified in
  169. ;  the case table entry requires additional parameters.  For example, AC1MM 
  170. ;  (stands for "ACase1, Min/Max") is pointed to by the last two bytes of 
  171. ;  ACase record ACase1 above, and gives the minimum and maximum values to 
  172. ;  be accepted by the ZCNFG function DecRad, also specified in ACase1.
  173. ;  YNData (stands for "YES/NO Data") is pointed to by the last two bytes of 
  174. ;  ACase2 and ACase3 above, and gives the strings to be printed by the 
  175. ;  ZCNFG function ToglTF also specified in ACase2 and ACase3.
  176.  
  177. AC1MM:            ; Min/Max for ACase1, above
  178.     dw    0    ; Min
  179.     dw    255    ; Max
  180.  
  181. YNData:            ; Null-terminated data pair for ZCNFG's ToglTF function
  182.     db    'YES',0    ; First entry is displayed if current value is 0FFh
  183.     db    ' NO',0    ; Second entry is displayed if current value is 000h
  184.  
  185. ; ------------------------------------------
  186. ;
  187. ;    SCREEN IMAGE SECTION
  188.  
  189. ; Sample screen image for Menu A.  This is what appears on the screen
  190. ;  when the user initially invokes ZCNFG with this .CFG file.  This screen
  191. ;  data is pointed to by its MENU LIST entry (above).  Before displaying
  192. ;  the following ASCII information, ZCNFG substitutes the current values
  193. ;  for the file being altered for the blank spaces at the secondary labels
  194. ;  below.  For example, at label AScrnM ("Menu A, Screen location M") below, 
  195. ;  ZCNFG substitutes the current ASCII value for the byte at location Patch1 
  196. ;  in the file being patched before displaying the screen.  When the value
  197. ;  at Patch1 is changed, ZCNFG updates the screen data before redisplaying
  198. ;  the screen.
  199.  
  200. ; Note that the display is ENTIRELY UP TO YOU.  You should, however, be sure to
  201. ;  indicate the letter or number corresponding to the "ASCII selector" in
  202. ;  the case table entry for that option; otherwise the user will not know
  203. ;  how to select the option!
  204.  
  205. AScrn:
  206.     db    cr,lf,lf,tab,tab,tab,'Sample Installation Menu One'
  207.     db    cr,lf,lf
  208.  
  209.     db    tab,'1) Set a value at this location .............. '
  210. AScrnM:    db    '   '            ; Display current value here
  211.     db    cr,lf
  212.  
  213.     db    tab,'2) Toggle a byte (000h/0FFh) at this location  '
  214. AScrnT:    db    '   '            ; Display current value here
  215.     db    cr,lf
  216.  
  217.     db    tab,'3) Toggle a byte (000h/0FFh) at this location  '
  218. AScrnC:    db    '   '            ; Display current value here
  219.     db    cr,lf
  220.  
  221.     db    lf,lf,lf,lf,lf,lf,lf    ; Fill rest of screen
  222.  
  223.     db    0            ; Terminator
  224.  
  225. ; Sample screen image for Menu B.  This screen is printed when the user
  226. ;  selects the second patch menu by using ZCNFG's "." or ">" command.
  227. ; Menu B is an example of a "split screen" with more than one menu selection
  228. ;  per line.  This technique is normally used only when large numbers of
  229. ;  options (over 20 or so) must be displayed on a single screen.
  230.  
  231. BScrn:
  232.     db    cr,lf,lf,tab,tab,tab,'Sample Installation Menu Two'
  233.     db    cr,lf,lf
  234.  
  235.     db    ' A) Set three characters ... '
  236. BScrnA:    db    '   '            ; Display current value here
  237.     db    tab
  238.     db    ' B) Set three characters ... '
  239. BScrnB:    db    '   '            ; Display current value here
  240.     db    cr,lf
  241.  
  242.     db    ' C) Set three characters ... '
  243. BScrnC:    db    '   '            ; Display current value here
  244.     db    tab
  245.     db    ' D) Set three characters ... '
  246. BScrnD:    db    '   '            ; Display current value here
  247.     db    cr,lf
  248.  
  249.     db    lf,lf,lf,lf,lf,lf,lf,lf    ; Fill rest of screen
  250.  
  251.     db    0            ; Terminator
  252.  
  253. ; ---------------------------------------------------
  254. ;
  255. ;    HELP SCREEN SECTION
  256. ;
  257.  
  258. ; Sample help screen for Menu A.  The following, up to the terminating
  259. ;  binary 00, appears as-is when the user types "?" or "/" for help while
  260. ;  ZCNFG is displaying the initial patch menu.
  261.  
  262. AHelp:
  263.     db    cr,lf,lf,tab,tab,tab,'Sample Installation Menu One Help'
  264.     db    cr,lf,lf
  265.  
  266.     db    'The options in this menu simply adjust whatever is at'
  267.     db    cr,lf
  268.     db    'the locations in an arbitrary file.  The "set a value" '
  269.     db    'command'
  270.     db    cr,lf
  271.     db    'will set the byte to any value, and the "toggle" commands'
  272.     db    cr,lf
  273.     db    'will switch the byte between 0FFh ("YES") and 000h ("NO").'
  274.     db    cr,lf,lf
  275.  
  276.     db 0        ; Terminator
  277.  
  278. ; Sample help screen for Menu B.  The following, up to the terminating
  279. ;  binary 00, appears as-is when the user types "?" or "/" for help while
  280. ;  ZCNFG is displaying the second patch menu.
  281.  
  282. BHelp:
  283.     db    cr,lf,lf,tab,tab,tab,'Sample Installation Menu Two Help'
  284.     db    cr,lf,lf,lf
  285.  
  286.     db 'The items in this menu are a little different.  They adjust a'
  287.     db cr,lf
  288.     db '3-character string at the patch locations specified by the'
  289.     db ' .CFG file.'
  290.     db    cr,lf
  291.  
  292.     db    0    ; Terminator
  293.