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 / QTPATCH.ARC / QT-ALPSA.Z < prev    next >
Text File  |  1989-09-08  |  5KB  |  278 lines

  1. ; QTERM patch source file for Alspa ACI-2DS (Z80, 64K, 2-8" DSDD drives)
  2.  
  3. ; Recreated By David Goodenough from the working overlay provided by
  4. ; Bill Swan
  5.  
  6. .var    scrout    0x0109
  7. .var    decout    0x010c
  8.  
  9. .var    modc    5        ; modem control
  10. .var    modd    4        ; modem data
  11. .var    rxrdy    2        ; receiver ready
  12. .var    txrdy    1        ; transmitter ready
  13.  
  14. .var    yes    -1
  15. .var    no    0
  16.  
  17. .var    dtr    yes        ; set no if your modem doesn't hang up when
  18.                 ; dtr goes away
  19.  
  20. .var    hayes    no        ; set yes if dtr is no, and your modem knows
  21.                 ; about '+++' and Hayes AT commands
  22.  
  23. ; modem input status
  24.  
  25. .org    0x0110
  26. modist:
  27.     in    a,(modc)
  28.     and    rxrdy
  29.     ret
  30.  
  31. ; read modem character
  32.  
  33. .org    0x0120
  34. modin:
  35.     in    a,(modd)
  36.     ret
  37.  
  38. ; modem output status
  39.  
  40. .org    0x0130
  41. modost:
  42.     in    a,(modc)
  43.     and    txrdy
  44.     ret
  45.  
  46. ; modem output
  47.  
  48. .org    0x0140
  49. modout:
  50.     out    (modd),a
  51.     ret
  52.  
  53. ; start break
  54.  
  55. .org    0x0150
  56. sbreak:
  57.     ld    a,0x2f
  58.     out    (modc),a
  59.     ret
  60.  
  61. ; end break
  62.  
  63. .org    0x0160
  64. ebreak:
  65.     ld    a,0x27
  66.     out    (modc),a
  67.     ret
  68.  
  69. ; turn off dtr
  70.  
  71. .if    dtr
  72. .org    0x0170
  73. dtroff:
  74.     ld    a,0x25
  75.     out    (modc),a
  76.     ret
  77.  
  78. ; turn dtr back on
  79.  
  80. .org    0x0180
  81. dtron:
  82.     ld    a,0x27
  83.     out    (modc),a
  84.     ret
  85. .elif    hayes
  86. .org    0x0170
  87. dtroff:
  88.     ret            ; no code, but we can handle it
  89.  
  90.     db    10        ; 10 chars to send
  91.     db    0xfe        ; send a delay
  92.     db    '+++'        ; the +++ to get to command mode
  93.     db    0xfe        ; another delay
  94.     db    'ATH0\r'    ; and finally a string to hang up
  95.  
  96. .org    0x0180
  97. dtron:
  98.     ret            ; don't need this, but here it is
  99. .else                ; neither dtr nor hayes - not much we can do
  100. .org    0x0170
  101. dtroff:
  102.     nop            ; don't put the return at 0x0170
  103.     ret
  104.  
  105. .org    0x0180
  106. dtron:
  107.     ret
  108. .endif
  109.  
  110. .org    0x0190            ; set baud (not possible)
  111.     ret
  112.  
  113. .org    0x01a0            ; baud table
  114.     db    0,no
  115.     db    0,no
  116.     db    0,no
  117.     db    0,no
  118.     db    0,no
  119.     db    0,no
  120.     db    0,no
  121.     db    0,no
  122.  
  123. ;.org    0x01b0            ; set comm mode
  124.     push    af
  125.     ld    a,0xa6
  126.     out    (modc),a
  127.     ld    a,0x40
  128.     out    (modc),a
  129.     pop    af
  130.     out    (modc),a
  131.     ret
  132.  
  133. .org    0x01c0            ; comm mode table
  134. n17:    db    0b01001010
  135. n18:    db    0b01001110
  136. n27:    db    0b11001010
  137. n28:    db    0b11001110
  138. e17:    db    0b01111010
  139. e18:    db    0b01111110
  140. e27:    db    0b11111010
  141. e28:    db    0b11111110
  142. o17:    db    0b01011010
  143. o18:    db    0b01011110
  144. o27:    db    0b11011010
  145. o28:    db    0b11011110
  146.  
  147. ;.org 0x01cc
  148. resrvd:
  149.     db    0        ; reserved for later use
  150.  
  151. ;.org    0x01cd
  152. xfersz
  153.     db    8        ; protocol I/O in 8K chunks
  154.  
  155. ;.org    0x01ce
  156. speed:
  157.     db    4        ; speed
  158.  
  159. ;.org    0x01cf
  160. escchr:
  161.     db    '\\' & 0x1f    ; escape char
  162.  
  163. ;.org    0x01d0            ; signon message
  164.     db    'Alspa ACI-2DS\0'
  165.  
  166. ; From here on down, the stuff is terminal dependant. I've made three .vars
  167. ; one each for Televideo, VT52 and ANSI (i.e. VT100 / VT220 etc)
  168. ; set _EXACTLY_ one to be true, this will provide a bare bones overlay.
  169. ; If the spirit moves, feel free to alter the terminal capabilities at the
  170. ; bottom to suit your terminal
  171.  
  172. .var    tvi    yes        ; Televideo: also C128, Kaypro, ADM 3A
  173.                 ; ADM 31, Wyse (all models), Liberty
  174.                 ; Freedom (all models)
  175. .var    vt52    no        ; Heath / Zenith 19 / 89 / 90, Intertec
  176.                 ; Superbrain
  177. .var    vt100    no        ; Any ansi compatible tube
  178.  
  179. .org    0x01f0
  180. clrs:
  181. .if    tvi
  182.     db    'z' & 0x1f, 0    ;clear screen string (Control-Z)
  183. .elif    vt52
  184.     db    '\eE\0'
  185. .elif    vt100
  186.     db    '\e[H\e[2J\0'
  187. .endif
  188.  
  189. .org    0x0200
  190. .if    tvi | vt52
  191. moveto:    push    hl    ;move cursor to position in HL (Row,Col)
  192.     ld    c,'\e'    ; lead-in with Esc (the ASCII one; not QTERM's)
  193.     call    scrout
  194.     ld    c,[ tvi ? '=' : 'Y' ]    ; 2nd lead-in is '=' or 'Y'
  195.     call    scrout
  196.     pop    hl
  197.     push    hl
  198.     ld    a,h    ; row value (top row is 0.)
  199.     call    poff    ; add offset and send it to screen
  200.     pop    hl
  201.     ld    a,l    ; col value (leftmost col is 0.)
  202. poff:    add    a,' '    ; (adds 20h)
  203.     ld    c,a
  204.     jp    scrout    ; (scrout returns from 'moveto's call)
  205. .elif    vt100
  206.     push    hl
  207.     ld    c,'\e'
  208.     call    scrout
  209.     ld    c,'['
  210.     call    scrout
  211.     pop    hl
  212.     push    hl
  213.     ld    h,0
  214.     inc    l
  215.     call    decout
  216.     ld    c,';'
  217.     call    scrout
  218.     pop    hl
  219.     ld    l,h
  220.     ld    h,0
  221.     inc    l
  222.     call    decout
  223.     ld    c,'H'
  224.     jp    scrout
  225. .endif
  226.  
  227. .org    0x22f
  228. tcbits:
  229.     db    0b00000000        ; must be zero for "generic" overlay
  230. ;          ||||||||
  231. ;          |||||||+------ bright (end highlight)
  232. ;          ||||||+------- dim (start highlight)
  233. ;          |||||+-------- delete line
  234. ;          ||||+--------- insert line
  235. ;          |||+---------- delete character
  236. ;          ||+----------- insert character
  237. ;          |+------------ clear to end of line
  238. ;          +------------- clear to end of screen
  239. ;
  240. ;
  241. ;.org    0x0230
  242. brites:    db    0    ;bright string
  243.  
  244. .org    0x0238
  245. dims:    db    0    ;dim string
  246.  
  247. .org    0x0240
  248. dlstr:    db    0    ;delete line
  249.  
  250. .org    0x0248
  251. ilstr:    db    0    ;insert line
  252.  
  253. .org    0x0250
  254. dcstr:    db    0    ;delete character
  255.  
  256. .org    0x0258
  257. icstr:    db    0    ;insert character
  258.  
  259. .org    0x0260
  260. ceol:    db    0    ;clear to end of line
  261.  
  262. .org    0x0268
  263. ceos:    db    0    ;clear to end-of-screen
  264.  
  265. ; Entry and Exit hooks.  These are provided to perform custom initialisation
  266. ; on startup and on exit from QTERM.
  267.  
  268. .org    0x0270
  269. entry:    ret            ; entry hook (270h .. 272h)
  270.  
  271. .org    0x0273            ; exit hook  (273h .. 275h)    
  272. exit:    ret            ; don't need anything.
  273.  
  274. ; Extra patch area if needed.  276h .. 2ffh
  275.  
  276. .org    0x0276
  277. patcha: 
  278.