home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ccdos / ccgibm.dat < prev    next >
Text File  |  2020-01-01  |  13KB  |  219 lines

  1.  
  2.         public  tekemu,tekini,tekrint,tekend,tekgraf    ; Terminal emulation
  3.         public  tekcls, tekesc, tekflg                  ;  used by msz file
  4.  
  5.         include ccsdef.h
  6.  
  7. ENQ     equ     05h                     ; ^E ENQ for TEK enquiries
  8. CAN     equ     18h                     ; ^X to return to ANSI mode
  9. ESCZ    equ     1Ah                     ; SUB, ESC-^Z triggers crosshairs
  10. VT      equ     0bh                     ; ^K go up one line
  11. FS      equ     1ch                     ; ^\ for point plot mode
  12. GS      equ     1Dh                     ; ^] draw line (1st move is invisible)
  13. RS      equ     1Eh                     ; ^^ for incremental line plot mode
  14. US      equ     1Fh                     ; ^_ (underscore) returns to text mode
  15. accent  equ     60h                     ; accent grave
  16.  
  17. txtmode equ     4                       ; text mode for TEKTRONIX status
  18. maxtekx equ     1024                    ; horizontal and
  19. maxteky equ     780                     ; vertical resolution of TEK 4010
  20.  
  21. screen  equ     10h                     ; IBM Bios screen call
  22.  
  23. uparr   equ     72                      ; DOS scan codes for arrow keys
  24. dnarr   equ     80
  25. lftarr  equ     75
  26. rgtarr  equ     77
  27. homscn  equ     71                      ; DOS home screen scan code
  28. shuparr equ     '8'                     ; ascii codes for shifted arrows
  29. shdnarr equ     '2'
  30. shlftarr equ    '4'
  31. shrgtarr equ    '6'
  32.  
  33.                                         ; Graph_mode for different systems:
  34. cga     equ     6                       ; highest resolution mode for CGA
  35. mono    equ     7                       ; real monochrome display adapter
  36. colorega equ    14                      ; Low-res mode, color EGA
  37. monoega equ     15                      ; mono ega needs mode 15
  38. ega     equ     16                      ; Hi-res mode - EGA
  39. olivetti equ    72                      ; Olivetti's Hi-res - 50 lines text
  40. toshiba equ     74h                     ; Toshiba T3100, like Olivetti
  41. vaxmate equ     0D0h                    ; DEC VAXmate II, like Olivetti
  42. hercules equ    255                     ; pseudo mode for Hercules graphics
  43. ; Note: IBM VGA modes 17 & 18, 640 by 480, can be used by setting "ega" above
  44. ; to 17 or 18 and modifying ybot to be 479 and ymult to be 48 at label tekin5.
  45. ; The code will scale everything appropriately for the new screen size, but
  46. ; there will be insufficient memory to retain the entire graphics image.
  47. ; Manual override SET TERMINAL GRAPHICS VGA accomplishes these two steps.
  48.  
  49. segega  equ     0a000h                  ; segments of display memory, EGA,VGA
  50. segcga  equ     0b800h                  ; CGA, AT&T/Olivetti and relatives
  51. seghga  equ     0b000h                  ; HGA
  52. segmono equ     0b000h                  ; Monochrome
  53.  
  54.                                         ; Hercules equates:
  55. index   equ     03b4h                   ; 6845 index register
  56. cntrl   equ     03b8h                   ; Display mode control port
  57. hstatus equ     03bah                   ; status port
  58. scrn_on equ     8                       ; bit to turn screen on
  59. grph    equ     2                       ; graphics mode
  60. text    equ     20h                     ; text mode
  61. config  equ     03bfh                   ; configuration port
  62. genable equ     1+2                     ; enable graphics (1) on two pages (2)
  63.  
  64. hiy     equ     1                       ; codes for Tek graphics components
  65. loy     equ     2
  66. hix     equ     4
  67. lox     equ     3
  68.  
  69. datas   segment public 'datas'
  70.         extrn   flags:byte, portval:word, rxtable:byte, vtemu:byte
  71.         extrn   tv_mode:byte
  72.         extrn   isccdos:byte    ; Jun 25,1990
  73.  
  74. xmult   dw      ?                       ; scaling factor for x is
  75. xdiv    dw      ?                       ;     xmult/xdiv
  76. ymult   dw      ?                       ; scaling factor for y is
  77. ydiv    dw      ?                       ;     ymult/ydiv
  78. xmax    dw      ?                       ;
  79. ybot    dw      ?                       ;
  80.  
  81. ; required for Hercules screen handling
  82.  
  83. gtable  db      35h,2dh,2eh,7           ; bytes for 6845 controller
  84.         db      5bh,2,57h,57h           ; - graphics mode
  85.         db      2,3,0,0
  86.  
  87. ttable  db      61h,50h,52h,0fh         ; bytes for 6845 controller
  88.         db      19h,6,19h,19h           ; - text mode
  89.         db      2,0dh,0bh,0ch
  90.  
  91. attlogo db      'OLIVETTI'              ; Olivetti M24/28, AT&T 6300 rom id
  92. attlen  equ     $-attlogo               ; length
  93. toshlogo db     '  TT33110000  TTOOSSHHIIBBAA' ; Toshiba T3100 logo
  94. toshlen equ     $-toshlogo              ; length
  95. declogo db      'Copyright Digital Equipment Corp' ; DEC VAXmate
  96. declen  equ     $-declogo
  97. ttstate dw      tektxt                  ; state machine control pointer
  98. prestate dw     0                       ; previous state, across interruptions
  99. visible db      0                       ; 0 to move, 1 to draw a line
  100. tek_hiy dw      0                       ; Y coordinate in Tektronix mode
  101. tek_loy db      0
  102. tek_hix dw      0                       ; X coordinate in Tektronix mode
  103. tek_lox db      0
  104. tek_lsb db      0                       ; Low-order 2 bits of X + low Y
  105.                                         ;       (4014 mode)
  106. status  db      0
  107. lastc   db      0                       ; last x/y coord fragment seen
  108. masktab db      80h,40h,20h,10h,8,4,2,1 ; quicker than calculations!
  109.                                         ; dashed line patterns
  110. linetab dw      0ffffh                  ; ESC accent    11111111 11111111
  111.         dw      0aaaah                  ; ESC a         10101010 10101010
  112.         dw      0f0f0h                  ; ESC b         11110000 11110000
  113.         dw      0fafah                  ; ESC c         11111010 11111010
  114.         dw      0ffcch                  ; ESC d         11111111 11001100
  115.         dw      0fc92h                  ; ESC e         11111100 10010010
  116.  
  117. linepat dw      0ffffh                  ; active line pattern, from above
  118.  
  119. ;End of init data
  120. IDSEQ   dw      tekem                   ; address of response to terminal
  121. CTLTAB  dw      0                       ; .. inquiry
  122. tekem   db      'IBM_TEK'               ; .. and the response
  123.         db      escape,'/Z',0
  124. x_coord dw      0                       ; Tek text char X coordinate
  125. y_coord dw      8                       ; Tek text char Y coordinate
  126. xcross  dw      0                       ; cross hairs to start at centre
  127. ycross  dw      0
  128. oldx    dw      0                       ; Tek coordinates of last point
  129. oldy    dw      767                     ;  initially top left
  130. scalex  dw      0                       ; PC coord for scaled x value
  131. scaley  dw      0                       ;  for scaled y value
  132. curmode db      0                       ; screen mode before graphics
  133. tekgraf db      0               ; Tek graphics board selection (def=auto)
  134.                                 ; local variables for LINE plotting routine
  135. graph_mode db   0                       ; graphics video mode, default is none
  136. cursor  dw      0                       ; saved text cursor
  137. inited  db      0                       ; non-zero if inited (retains page)
  138. tekflg  db      0                       ; Tek mode active flag
  139. yflags  db      0                       ; flags byte from msy
  140. flow    dw      0                       ; flow control word
  141. gpage   db      0                       ; display adapter graphics page
  142. gfcol   db      15                      ; graphics foreground colour
  143. gbcol   db      0                       ; graphics background color
  144. tfcol   db      0                       ; temp foreground color
  145. tbcol   db      0                       ; temp background color
  146. lastd   db      0,0                     ; worker for ESC [ Pn ; Pn m scanner
  147. colortb db      0,4,2,6,1,5,3,7         ; color reversed-bit setting bytes
  148. moremsg db      ' More >'
  149. mormsglen equ   $-moremsg               ; length of message
  150. ccode   db      0                       ; temp for holding plot color code
  151. linelen dw      0                       ; offset increment between scan lines
  152. putc    dw      mputc                   ; ptr to plot a character routine
  153. psetup  dw      psetupm                 ; ptr to plot setup routine
  154. pincy   dw      pincym                  ; ptr to inc y routine
  155. plotptr dw      pltmon                  ; ptr to dot plot routine
  156. gcplot  dw      gcgen                   ; ptr to char plot routine
  157. segscn  dw      0b800h                  ; actual screen segment to use
  158.                                         ; ANSI Escape sequence to exit Tek mode
  159. tkoff   db      escape,'[?38l'          ; Exit Tek mode escape sequence
  160. tkofflen equ    $-tkoff                 ; length of sequence
  161. tkoffs  db      6 dup (0)               ; received chars in rcv'd sequence
  162. tkcnt   dw      0                       ; counter of matched char in tkoffs
  163. bypass  db      0                       ; GIN mode bypass condition (0=off)
  164. temp    dw      0
  165.  
  166. ; 8*8 font for Hercules and such, CGA, and EGA
  167. ; - allows 43 lines, and 80 (90 for Hercules) chars per line.
  168. ; all printing (?) characters from <space> to <del> - two characters per line
  169. ; 8 bits per scan line, given top line first, 8 scan lines.
  170. font    db      0,0,0,0,0,0,0,0,               18h,18h,18h,18h,18h,0,18h,0
  171.         db      6ch,6ch,6ch,0,0,0,0,0,         36h,36h,7fh,36h,7fh,36h,36h,0
  172.         db      0ch,3fh,68h,3eh,0bh,7eh,18h,0, 60h,66h,0ch,18h,30h,66h,06h,0
  173.         db      38h,6ch,6ch,38h,6dh,66h,3bh,0, 0ch,18h,30h,0,0,0,0,0
  174.         db      0ch,18h,30h,30h,30h,18h,0ch,0, 30h,18h,0ch,0ch,0ch,18h,30h,0
  175.         db      0,18h,7eh,3ch,7eh,18h,0,0,     0,18h,18h,7eh,18h,18h,0,0
  176.         db      0,0,0,0,0,18h,18h,30h,         0,0,0,7eh,0,0,0,0
  177.         db      0,0,0,0,0,18h,18h,0,           0,06h,0ch,18h,30h,60h,0,0
  178.         db      3ch,66h,6eh,7eh,76h,66h,3ch,0, 18h,38h,18h,18h,18h,18h,7eh,0
  179.         db      3ch,66h,06h,0ch,18h,30h,7eh,0, 3ch,66h,06h,1ch,06h,66h,3ch,0
  180.         db      0ch,1ch,3ch,6ch,7eh,0ch,0ch,0, 7eh,60h,7ch,06h,06h,66h,3ch,0
  181.         db      1ch,30h,60h,7ch,66h,66h,3ch,0, 7eh,06h,0ch,18h,30h,30h,30h,0
  182.         db      3ch,66h,66h,3ch,66h,66h,3ch,0, 3ch,66h,66h,3eh,06h,0ch,38h,0
  183.         db      0,0,18h,18h,0,18h,18h,0,       0,0,18h,18h,0,18h,18h,30h
  184.         db      0ch,18h,30h,60h,30h,18h,0ch,   0,0,0,7eh,0,7eh,0,0,0
  185.         db      30h,18h,0ch,06h,0ch,18h,30h,   0,3ch,66h,0ch,18h,18h,0,18h,0
  186.         db      3ch,66h,6eh,6ah,6eh,60h,3ch,   0,3ch,66h,66h,7eh,66h,66h,66h,0
  187.         db      7ch,66h,66h,7ch,66h,66h,7ch,   0,3ch,66h,60h,60h,60h,66h,3ch,0
  188.         db      78h,6ch,66h,66h,66h,6ch,78h,   0,7eh,60h,60h,7ch,60h,60h,7eh,0
  189.         db      7eh,60h,60h,7ch,60h,60h,60h,   0,3ch,66h,60h,6eh,66h,66h,3ch,0
  190.         db      66h,66h,66h,7eh,66h,66h,66h,   0,7eh,18h,18h,18h,18h,18h,7eh,0
  191.         db      3eh,0ch,0ch,0ch,0ch,6ch,38h,   0,66h,6ch,78h,70h,78h,6ch,66h,0
  192.         db      60h,60h,60h,60h,60h,60h,7eh,   0,63h,77h,7fh,6bh,6bh,63h,63h,0
  193.         db      66h,66h,76h,7eh,6eh,66h,66h,   0,3ch,66h,66h,66h,66h,66h,3ch,0
  194.         db      7ch,66h,66h,7ch,60h,60h,60h,   0,3ch,66h,66h,66h,6ah,6ch,36h,0
  195.         db      7ch,66h,66h,7ch,6ch,66h,66h,   0,3ch,66h,60h,3ch,06h,66h,3ch,0
  196.         db      7eh,18h,18h,18h,18h,18h,18h,   0,66h,66h,66h,66h,66h,66h,3ch,0
  197.         db      66h,66h,66h,66h,66h,3ch,18h,   0,63h,63h,6bh,6bh,7fh,77h,63h,0
  198.         db      66h,66h,3ch,18h,3ch,66h,66h,   0,66h,66h,66h,3ch,18h,18h,18h,0
  199.         db      7eh,06h,0ch,18h,30h,60h,7eh,   0,7ch,60h,60h,60h,60h,60h,7ch,0
  200.         db      0,60h,30h,18h,0ch,06h,0,0,     3eh,06h,06h,06h,06h,06h,3eh,0
  201.         db      18h,3ch,66h,42h,0,0,0,0,       0,0,0,0,0,0,0,0ffh
  202.         db      30h,18h,0ch,0,0,0,0,0,         0,0,3ch,06h,3eh,66h,3eh,0
  203.         db      60h,60h,7ch,66h,66h,66h,7ch,0, 0,0,3ch,66h,60h,66h,3ch,0
  204.         db      06h,06h,3eh,66h,66h,66h,3eh,0, 0,0,3ch,66h,7eh,60h,3ch,0
  205.         db      0eh,18h,18h,3ch,18h,18h,18h,0, 0,0,3eh,66h,66h,3eh,06h,3ch
  206.         db      60h,60h,7ch,66h,66h,66h,66h,0, 18h,0,38h,18h,18h,18h,3ch,0
  207.         db      18h,0,38h,18h,18h,18h,18h,70h, 60h,60h,66h,6ch,78h,6ch,66h,0
  208.         db      38h,18h,18h,18h,18h,18h,3ch,0, 0,0,76h,7fh,6bh,6bh,63h,0
  209.         db      0,0,7ch,66h,66h,66h,66h,0,     0,0,3ch,66h,66h,66h,3ch,0
  210.         db      0,0,7ch,66h,66h,7ch,60h,60h,0, 0,3eh,66h,66h,3eh,06h,07h
  211.         db      0,0,6ch,76h,60h,60h,60h,0,     0,0,3eh,60h,3ch,06h,7ch,0
  212.         db      30h,30h,7ch,30h,30h,30h,1ch,0, 0,0,66h,66h,66h,66h,3eh,0
  213.         db      0,0,66h,66h,66h,3ch,18h,0,     0,0,63h,6bh,6bh,7fh,36h,0
  214.         db      0,0,66h,3ch,18h,3ch,66h,0,     0,0,66h,66h,66h,3eh,06h,3ch
  215.         db      0,0,7eh,0ch,18h,30h,7eh,0,     0ch,18h,18h,70h,18h,18h,0ch,0
  216.         db      18h,18h,18h,0,18h,18h,18h,0,   30h,18h,18h,0eh,18h,18h,30h,0
  217.         db      31h,6bh,46h,0,0,0,0,0,         8 dup (0ffh)
  218. datas   ends
  219.