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 / TERMS / QT41D128.LZH / QT-128.PAT < prev    next >
Text File  |  1989-04-06  |  13KB  |  325 lines

  1. Patching QTERM for your system.
  2.  
  3. Hex code for the C-128 added 04/13/89 CPM.C128
  4.  
  5. The first thing to do is to back QTERM up, and then invoke DDT, SID, ZSID,
  6. or whatever your local patch utility is, in the following way:
  7.  
  8. A>DDT QTERM.COM
  9.  
  10. DDT (etc.) will read in QTERM, and then prompt. The following is a list of
  11. patch areas where QTERM should be changed to reflect your system. Some of
  12. these are mandatory (i.e. QTERM won't work without them), whereas others
  13. can be changed to null subroutines or empty data without preventing QTERM
  14. from working, it just won't have all the features available.
  15.  
  16.  
  17. 1. Modem input status: 0110 - 011F
  18.  
  19. QTERM calls here to check modem input status. Return with the zero flag
  20. set if no character is available, or with the zero flag clear if a char
  21. is available. Generally this can be an input from the usart / sio / dart
  22. status port followed by an 'and'.
  23.  
  24. C-128 Code
  25. 0110: 3A 4F FD E6 01 C9 00 00 00 00 00 00 00 00 00 00
  26.  
  27. 2. Read modem character: 0120 - 012F
  28.  
  29. This gets a character from the modem input port once the input status has
  30. decided it's there. Return the character in the a register. Generally this
  31. can be an input from the usart / sio / dart data port.
  32.  
  33. C-128 Code
  34. 0120: 3A 51 FD 21 4F FD CB 86 C9 00 00 00 00 00 00 00
  35.  
  36. 3. Modem output status: 0130 - 013F
  37.  
  38. Check if the modem output port can accept another character. Return with the
  39. zero flag set if the output port can't receive a character, or with the zero
  40. flag clear if the output port is ready. Generally this can be an input from
  41. the usart / sio / dart status port followed by an 'and'.
  42.  
  43. C128 Code
  44. 0130: 3A 4F FD 2F E6 80 C9 00 00 00 00 00 00 00 00 00
  45.  
  46. 4. Write modem character: 0140 - 014F
  47.  
  48. Send the character in the a register to the modem output port. This will only
  49. be called after the output status routine has returned a non-zero status.
  50. Generally this can be an output to the usart / sio / dart data port.
  51.  
  52. C-128 Code:
  53. 0140: 32 50 FD 21 4F FD CB FE C9 00 00 00 00 00 00 00
  54.  
  55. These first four patches are all necessary for QTERM to work. The next few
  56. are not necessary, but they will be useful.
  57.  
  58. 5. Start break: 0150 - 015F
  59.    End break: 0160 - 016F
  60.  
  61. C-128 Code:
  62. 0150: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  63. 0160: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  64.  
  65. The start break subroutine at 0150 should initiate a break condition on
  66. the modem output line, and 0160 should clear the break condition. If these
  67. are to be omitted, then just put return (C9) instructions at 0150 and 0160.
  68.  
  69. 6. Drop DTR: 0170 - 017F
  70.    Restore DTR: 0180 - 018F
  71.  
  72. The drop DTR subroutine causes DTR to be made inactive, and restore DTR
  73. returns DTR to an active state. If your modem does not respond to DTR, but
  74. can be made to hang up by sending a string, then put a return (C9) at 0170.
  75. Use the space from 0171 to 018F to contain the string, with the following
  76. notes: at 0171 should be the length of the string, to transmit a break,
  77. use an 0FFH byte, to cause a two second delay use an 0FEH byte. Hence the
  78. following could be used to hang up a Hayes compatible:
  79.  
  80. 0A FE 2B 2B 2B FE 41 54 48 30 0D
  81.  
  82. 0A - length: 10 bytes follow
  83. FE - delay
  84. 2B - '+' sent three times
  85. FE - delay
  86. 41 54 48 30 0D - ATH0 <return>
  87.  
  88. If neither DTR nor a string is to be used, then place a return (C9) at
  89. 0180 and 0171, and a nop (00) at 0170. The string is used only if a C9
  90. is found at 0170, so by placing the C9 at 0171 the string print is
  91. inhibited.
  92.  
  93. C-128 Code:
  94. 0170: C9 0A FE 2B 2B 2B FE 41 54 48 30 0D 00 00 00 00
  95. 0180: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  96.  
  97. 7. Baud rate setting: 0190 - 019F
  98.    Baud rate table: 01A0 - 01AF
  99.  
  100. These two patch areas work together to allow QTERM to change the baud rate
  101. of the modem port. The baud rate table holds pairs of bytes for setting the
  102. baud rate to eight different values: 38400, 19200, 9600, 4800, 2400, 1200,
  103. 600 and 300, in that order. In these pairs, the first byte will be passed
  104. to the subroutine at 0190, and the second byte is used to enable that baud
  105. rate: an 0FFH in the second byte enables the rate, and a zero disables.
  106. So if your system only went up to 9600, (using a value of 1 to get 9600)
  107. the first six bytes in the table would be:
  108.  
  109.     00 00        no value for 38400: disable by the 00
  110.     00 00        no value for 19200: disable by the 00
  111.     01 FF        01 is the value for 9600: enable by the FF
  112.  
  113. In all cases of enabled baud rates, the subroutine at 0190 gets the
  114. appropriate value in the a register and should use it to set the baud rate.
  115. If this is to be omitted, then just put a return (C9) instruction at 0190,
  116. and fill the table from 01A0 to 01AF with 00's.
  117.  
  118. C-128 Code:
  119. 0190: C3 7D 02 00 00 00 00 00 00 00 00 00 00 00 00 00
  120. 01A0: 00 00 00 00 00 00 00 00 00 00 08 FF 00 00 06 FF
  121.  
  122. 8. Communication mode setting: 01B0 - 01BF
  123.    Communication mode table: 01C0 - 01CB
  124.  
  125. These two patch areas work together to allow QTERM to change the
  126. communications format of the modem port. The mode table holds bytes for
  127. setting 12 different formats, selecting number of data bits (7 or 8)
  128. parity (odd, even, or none) and number of stop bits (1 or 2). In order
  129. the 12 values are for 7n1, 8n1, 7n2, 8n2, 7e1, 8e1, 7e2, 8e2, 7o1, 8o1,
  130. 7o2, and 8o2. The subroutine at 01B0 gets one of these values in the a
  131. register and should use it to set the communications mode. If this is to
  132. be omitted, then just put a return (C9) instruction at 01B0.
  133.  
  134. C-128 Code:
  135. 01B0: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  136. 01C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 02 0F
  137.  
  138. Note: For use with a 1541, change byte 01CD from '04' to '02' 
  139.       For use with a 1581 or REU, change byte 01CD from '04' to '08'
  140.       Byte 01CD is the Protocol Transfer size in kilobytes
  141.  
  142. 9. Reserved for later use: 01CC
  143.  
  144. This byte is reserved for later expansion, and should not be used.
  145.  
  146. 10. Protocol transfer size: 01CD
  147.  
  148. During protocol transfers, disk reads and writes take place every 8K. This
  149. is normally possible without causing a timeout, and reduces disk access to
  150. a minimum. However if your disk is slow, you can drop this to 4, 2 or even
  151. 1 to reduce the size of transfer, and hence prevent timeouts.
  152.  
  153. C-128 Code: See Part 8 above
  154.  
  155. 11. Processor speed: 01CE
  156.  
  157. This is the speed in Mhz that your Z80 runs at: 4, 6 or whatever. For
  158. a 2.5Mhz cpu, use 3.
  159.  
  160. C-128 Code: See also Part 8 above. '02' = 2Mhz. Processor speed.
  161.  
  162. 12. Escape character: 01CF
  163.  
  164. All special functions of QTERM are activated by the use of escape sequences.
  165. At 01CF is the byte used for the escape character (the default is ^\). Any
  166. byte can be used, but a little used value is best selected, also using a
  167. printable character (' ' thru '~') may have undesirable results. Note that to
  168. transmit the escape value itself, just type it twice.
  169.  
  170. These previous three are necessary.
  171.  
  172. C-128 Code: See Part 8 above. '0F' = ^O Escape character
  173.  
  174. 13. Signon message: 01D0 - 01EF
  175.  
  176. This must be a string that identifies your system / terminal. It must be
  177. present, and is printed when QTERM first starts. It should be composed of
  178. printable characters, and terminated by a zero byte.
  179.  
  180. C-128 Code:
  181. 01D0: 43 6F 6D 6D 6F 64 6F 72 65 20 31 32 38 20 2F 20
  182. 01E0: 31 36 37 30 20 4D 6F 64 65 6D 00 00 00 00 00 00
  183.  
  184. Message: Commodore128 / 1670 Modem
  185.  
  186. Note: if you have the 'new' 1670, flip the DTR switch to the 'off' position
  187.  
  188. 14. Clear screen: 01F0 - 01FF
  189.  
  190. This must be a string that clears the terminal screen, and leaves the
  191. cursor in the top left hand corner. This should also be terminated by a
  192. zero byte.
  193.  
  194. C-128 Code:
  195. 01F0: 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  196.  
  197. 15. Moveto: 0200 - 022E
  198.  
  199. QTERM requires the ability to move the cursor around the screen. It calls
  200. this subroutine with the required coordinates in hl: where h is the row,
  201. and l the column to move to. The top left hand corner of the screen is 0,0;
  202. and the bottom right corner is 23,79. This subroutine will have to do
  203. terminal output: at 0109H is a routine that prints a character in the c
  204. register, and at 010CH is a routine to print a decimal number in hl (mainly
  205. for the use of vt100 and vt220 compatibles). Note that the above two
  206. subroutines will destroy all registers, and that this subroutine can also
  207. destroy all registers.
  208.  
  209. C-128:
  210. 0200: E5 0E 1B CD 09 01 0E 3D CD 09 01 E1 E5 7C CD 13
  211. 0210: 02 E1 7D C6 20 4F C3 09 01 00 00 00 00 00 00 00
  212. 0220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF
  213.  
  214. 16. Teminal capability bit map: 022F
  215.  
  216. This byte contains one bit set for each of the following terminal
  217. capabilities:
  218.  
  219.                                                  C-128 Codes (Note Case!
  220. bit 0: (01H)    bright (end highlight)                     ESC (
  221. bit 1: (02H)    dim (start highlight)                      ESC )
  222. bit 2: (04H)    delete line                                ESC R
  223. bit 3: (08H)    insert line                                ESC E
  224. bit 4: (10H)    delete character                           ESC W
  225. bit 5: (20H)    insert character                           ESC Q
  226. bit 6: (40H)    clear to end of line                       ESC T
  227. bit 7: (80H)    clear to end of screen                     ESC Y
  228.  
  229.                                                     All characters after the
  230.                                                     ESC Key are in CAPS!
  231.  
  232.   C-128 Code:   022F: FF
  233.  
  234. 17. Terminal capability strings: 0230 - 026F
  235.  
  236. In this area are eight strings, each of which can be at most eight characters
  237. long. They are the strings to be printed to perform the terminal capabilities
  238. mentioned above. Each one of them should be terminated by a zero byte. Hence
  239. at 0230 is the string for dim (start highlight), at 0238 is the string for
  240. bright (end highlight), etc.; with 0268 being the string for clear to end of
  241. screen. Programs that use these will check the terminal capability bitmap at
  242. 022F before using them, to determine if they are available.
  243.  
  244. C-128 Code:
  245. 0230: 1B 28 00 00 00 00 00 00 1B 29 00 00 00 00 00 00
  246. 0240: 1B 52 00 00 00 00 00 00 1B 45 00 00 00 00 00 00
  247. 0250: 1B 57 00 00 00 00 00 00 1B 51 00 00 00 00 00 00
  248. 0260: 1B 54 00 00 00 00 00 00 1B 59 00 00 00 00 00 00
  249.  
  250. 18. Entry subroutine: 0270 - 0272
  251.  
  252. Upon entry to QTERM, this subroutine will be called. If it is not needed
  253. then a return instruction (0C9H) should be placed at 0270, otherwise there
  254. is enough space to put in a jump to code that is to be executed when QTERM
  255. starts. This can be used for several purposes: if custom initialisation is
  256. needed to enable communications, or select a particular baud rate, or
  257. whatever, this can be done here. In addition, if all chat scripts and disk
  258. access is to be done on a specific drive, then by using the CP/M BDOS
  259. functions to set drive (and set user if desired), QTERM can be made to
  260. automatically be in the correct place to find scripts, etc.
  261.  
  262. C-128 Code:
  263. 0270: C3 76 02
  264.  
  265. 19. Exit subroutine: 0273 - 0275
  266.  
  267. After an <Escape> Q has been issued to exit QTERM, this subroutine will
  268. be called immediately before exiting back to CP/M. As with the entry
  269. subroutine, if not needed, a return instruction (0C9H) should be placed at
  270. 0273H, otherwise any termination code can be added.
  271.  
  272. C-128 Code:
  273. 0273 C9 00 00
  274.  
  275. 20. Patch area: 0276 - 02FF
  276.  
  277. Since the area provided for the above patches is limited, it may be necessary
  278. to use more space. The block of memory from 0276 to 02FF is set aside for
  279. custom patches, this can be used if the individual spaces are not big enough.
  280.  
  281. C-128 Code:
  282. 0276: 3E 01 32 4E FD 3E 08 F5 2A 01
  283. 0280: 00 2E 3C CD 93 02 11 37 00 19 F1 77 2A 01 00 2E
  284. 0290: 3F 0E 06 E9 00 00 00 00 00 00 00 00 00 00 00 00
  285. 02A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  286. 02B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  287. 02C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  288. 02D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  289. 02E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  290. 02F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  291.  
  292. Once all the patches have been made, exit the patch program (usually by
  293. typing ^C), and finish up by saving a new copy of QTERM:
  294.  
  295. A>SAVE 54 QTERMNEW.COM
  296.  
  297. In addition, the patch area only can be saved as follows:
  298.  
  299. A>SAVE 2 QTERMPAT.XXX
  300.  
  301. Which will create a 1/2K file containing all the patches needed to make this
  302. particular version of QTERM work. By doing this, when a new release of QTERM
  303. needs to be patched, all that is necessary is to read in the new unpatched
  304. version with DDT or whatever, then overlay the patch area. This is typically
  305. done by typing:
  306.  
  307. IQTERMPAT.XXX
  308.  
  309. to DDT, SID, ZSID etc. to set up the command line to read QTERMPAT.XXX, then
  310. follow this with a:
  311.  
  312. R
  313.  
  314. to read it. This should overlay the saved patch area on the new version,
  315. hence doing all the patches at once. Then exit DDT with ^C, and do the
  316. first save shown above to save the new working version.
  317.  
  318.  
  319. NOTE: this "overlaying" of patches will NOT work with versions 2.8 and
  320. earlier. In addition, three things have been added to the 3.3 patch
  321. area:
  322. 1. changing the DTR manipulation area to include a hangup string.
  323. 2. adding the transfer read / write size at 01CD.
  324. 3. adding the entry and exit subroutine hooks.
  325.