home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / ftp.demon.co.uk-pub-cpm / rogue17.pma / QTERM.PAT next >
Text File  |  1979-12-31  |  8KB  |  196 lines

  1. Patching QTERM for your system.
  2.  
  3. The first thing to do is to back QTERM up, and then invoke DDT, SID, ZSID,
  4. or whatever your local patch utility is, in the following way:
  5.  
  6. A>DDT QTERM.COM
  7.  
  8. DDT (etc.) will read in QTERM, and then prompt. The following is a list of
  9. patch areas where QTERM should be changed to reflect your system. Some of
  10. these are mandatory (i.e. QTERM won't work without them), whereas others
  11. can be changed to null subroutines or empty data without preventing QTERM
  12. from working, it just won't have all the features available.
  13.  
  14.  
  15. 1. Modem input status: 0110 - 011F
  16.  
  17. QTERM calls here to check RDR: status. Return with the zero flag set if
  18. no character is available, or with the zero flag clear if a char is
  19. available. Generally this can be an input from the usart / sio / dart
  20. status port followed by an 'and'.
  21.  
  22. 2. Read modem character: 0120 - 012F
  23.  
  24. This gets a character from the RDR: port once the input status has decided
  25. it's there. Return the character in the a register. Generally this can be
  26. an input from the usart / sio / dart data port.
  27.  
  28. 3. Modem output status: 0130 - 013F
  29.  
  30. Check if the PUN: port can accept another character. Return with the zero
  31. flag set if the PUN: port can't receive a character, or with the zero flag
  32. clear if the PUN: port is ready. Generally this can be an input from the
  33. usart / sio / dart status port followed by an 'and'.
  34.  
  35. 4. Write modem character: 0140 - 014F
  36.  
  37. Send the character in the a register to the PUN: port. This will only be
  38. called after the output status routine has returned a non-zero status.
  39. Generally this can be an output to the usart / sio / dart data port.
  40.  
  41. These first four patches are all necessary for QTERM to work. The next few
  42. are not necessary, but they will be useful.
  43.  
  44. 5. Start break: 0150 - 015F
  45.    End break: 0160 - 016F
  46.  
  47. The start break subroutine at 0150 should initiate a break condition on
  48. the modem output line, and 0160 should clear the break condition. If these
  49. are to be omitted, then just put return (C9) instructions at 0150 and 0160.
  50.  
  51. 6. Drop DTR: 0170 - 017F
  52.    Restore DTR: 0180 - 018F
  53.  
  54. The drop DTR subroutine causes DTR to be made inactive, and restore DTR
  55. returns DTR to an active state. If these are to be omitted, then just put
  56. return (C9) instructions at 0170 and 0180.
  57.  
  58. 7. Baud rate setting: 0190 - 019F
  59.    Baud rate table: 01A0 - 01AF
  60.  
  61. These two patch areas work together to allow QTERM to change the baud rate
  62. of the modem port. The baud rate table holds pairs of bytes for setting the
  63. baud rate to eight different values: 38400, 19200, 9600, 4800, 2400, 1200,
  64. 600 and 300, in that order. In these pairs, the first byte will be passed
  65. to the subroutine at 0190, and the second byte is used to enable that baud
  66. rate: an 0FFH in the second byte enables the rate, and a zero disables.
  67. So if your system only went up to 9600, (using a value of 1 to get 9600)
  68. the first six bytes in the table would be:
  69.  
  70.     00 00        no value for 38400: disable by the 00
  71.     00 00        no value for 19200: disable by the 00
  72.     01 FF        01 is the value for 9600: enable by the FF
  73.  
  74. In all cases of enabled baud rates, the subroutine at 0190 gets the
  75. appropriate value in the a register and should use it to set the baud rate.
  76. If this is to be omitted, then just put a return (C9) instruction at 0190,
  77. and fill the table from 01A0 to 01AF with 00's.
  78.  
  79. 8. Communication mode setting: 01B0 - 01BF
  80.    Communication mode table: 01C0 - 01CB
  81.  
  82. These two patch areas work together to allow QTERM to change the
  83. communications format of the modem port. The mode table holds bytes for
  84. setting 12 different formats, selecting number of data bits (7 or 8)
  85. parity (odd, even, or none) and number of stop bits (1 or 2). In order
  86. the 12 values are for 7n1, 8n1, 7n2, 8n2, 7e1, 8e1, 7e2, 8e2, 7o1, 8o1,
  87. 7o2, and 8o2. The subroutine at 01A0 gets one of these values in the a
  88. register and should use it to set the communications mode. If this is to
  89. be omitted, then just put a return (C9) instruction at 01A0.
  90.  
  91. 9. Processor speed: 01CE
  92.  
  93. This is the speed in Mhz that your Z80 runs at: 4, 6 or whatever. For
  94. a 2.5Mhz cpu, use 2.
  95.  
  96. 10. Escape character: 01CF
  97.  
  98. All special functions of QTERM are activated by the use of escape sequences.
  99. At 01CF is the byte used for the escape character (the default is ^\). Any
  100. byte can be used, but a little used value is best selected, also using a
  101. printable character (' ' thru '~') may have undesirable results. Note that to
  102. transmit the escape value itself, just type it twice.
  103.  
  104. These previous two are necessary.
  105.  
  106. 11. Signon message: 01D0 - 01EF
  107.  
  108. This must be a string that identifies your system / terminal. It must be
  109. present, and is printed when QTERM first starts. As with the previous
  110. strings it must be terminated by a zero byte.
  111.  
  112. 12. Clear screen: 01F0 - 01FF
  113.  
  114. This must be a string that clears the terminal screen, and leaves the
  115. cursor in the top left hand corner.
  116.  
  117. 13. Moveto: 0200 - 022E
  118.  
  119. QTERM requires the ability to move the cursor around the screen. It calls
  120. this subroutine with the required coordinates in hl: where h is the row,
  121. and l the column to move to. The top left hand corner of the screen is 0,0;
  122. and the bottom right corner is 23,79. This subroutine will have to do
  123. terminal output: at 0109H is a routine that prints a character in the c
  124. register, and at 010CH is a routine to print a decimal number in hl (mainly
  125. for the use of vt100 and vt220 compatibles). Note that the above two
  126. subroutines will destroy all registers, and that this subroutine can also
  127. destroy all registers.
  128.  
  129. 14. Teminal capability bit map: 022F
  130.  
  131. This byte contains one bit set for each of the following terminal
  132. capabilities:
  133.  
  134. bit 0: (01H)    bright (end highlight)
  135. bit 1: (02H)    dim (start highlight)
  136. bit 2: (04H)    delete line
  137. bit 3: (08H)    insert line
  138. bit 4: (10H)    delete character
  139. bit 5: (20H)    insert character
  140. bit 6: (40H)    clear to end of line
  141. bit 7: (80H)    clear to end of screen
  142.  
  143. 15. Terminal capability strings: 0230H - 026FH
  144.  
  145. In this area are eight strings, each of which can be at most eight characters
  146. long. They are the strings to be printed to perform the terminal capabilities
  147. mentioned above. Each one of them should be terminated by a zero byte. Hence
  148. at 0230H is the string for dim (start highlight), at 0238H is the string for
  149. bright (end highlight), etc.; with 0268H being the string for clear to end of
  150. screen. Programs that use these will check the terminal capability bitmap at
  151. 022FH before using them, to determine if they are available.
  152.  
  153. 16. Patch area: 0270H - 02FFH
  154.  
  155. Since the area provided for the above patches is limited, it may be necessary
  156. to use more space. The block of memory from 0270H to 02FFH is set aside for
  157. custom patches, this can be used if the individual spaces are not big enough.
  158.  
  159.  
  160. Once all the patches have been made, exit the patch program (usually by
  161. typing ^C), and finish up by saving a new copy of QTERM:
  162.  
  163. A>SAVE 45 QTERMNEW.COM
  164.  
  165. In addition, the patch area only can be saved as follows:
  166.  
  167. A>SAVE 2 QTERMPAT.XXX
  168.  
  169. Which will create a 1/2K file containing all the patches needed to make this
  170. particular version of QTERM work. By doing this, when a new release of QTERM
  171. needs to be patched, all that is necessary is to read in the new unpatched
  172. version with DDT or whatever, then overlay the patch area. This is typically
  173. done by typing:
  174.  
  175. IQTERMPAT.XXX
  176.  
  177. to DDT, SID, ZSID etc. to set up the command line to read QTERMPAT.XXX, then
  178. follow this with a:
  179.  
  180. R
  181.  
  182. to read it. This should overlay the saved patch area on the new version,
  183. hence doing all the patches at once. Then exit DDT with ^C, and do the
  184. first save shown above to save the new working version.
  185.  
  186.  
  187. NOTE: this "overlaying" of patches will NOT work with versions 2.8 and
  188. earlier, however from 3.0 onwards the patch area is guaranteed not to
  189. change. To aid in patching from earlier versions, the main changes are:
  190. 1. modification of the baud rate table (expansion from the 4 byte table
  191.    with 300 1200 2400 & 9600 only) to the 16 byte table that covers up
  192.    to 38400, with selective rate enable;
  193. 2. moving the processor speed and escape values;
  194. 3. addition of the terminal capability patch area;
  195. 4. addition of the patch area at 0270 to 02FF;
  196.