home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / misc / tektroni.cod / tek.mss
Encoding:
Text File  |  1993-07-14  |  11.8 KB  |  260 lines

  1. @device(postscript)
  2.  
  3. @center<Tektronix 4010/4014 Graphics Terminal Functions>
  4.  
  5. @begin<table>
  6. @bar()
  7. @blankspace(1)
  8. @begin<format>
  9. @tabclear()
  10. @case[device,file="@tabset(1.6inch,3.0inch,3.75inch)",
  11.         else="@tabset(1.5inch,3.0inch,3.75inch)"
  12. ]
  13. @ux<Control Code>@\@\@ux<Action>
  14. @q<FS, > Control-@q<\>@\Backslash@\draw dots
  15. @q<GS, > Control-@q<]>@\Right square bracket@\draw lines
  16. @q<RS, > Control-@q<^>@\Caret@\Draw dots incrementally
  17. @q<US, > Control-@q<_>@\Underscore@\Display text
  18. @q<BEL,> Control-@q<G>@\@\Beep, make a noise
  19. @q<BS, > Control-@q<H>@\@\Backspace, non-destructive
  20. @q<HT, > Control-@q<I>@\@\Tab, convert to single space
  21. @q<LF, > Control-@q<J>@\@\Line feed, go down one line
  22. @q<VT, > Control-@q<K>@\@\Move up one text line
  23. @q<FF, > Control-@q<L>@\@\Clears the screen
  24. @q<CR, > Control-@q<M>@\@\Carriage return, start of line
  25. @q<CAN,> Control-@q<X>@\@\Exit Tek sub-mode, or ignore
  26. DEL, RUBOUT@\@\Delete code, same as BS
  27.  
  28. @ux<Escape Sequence>@\@\@ux<Action>
  29. @q<ESC >Control-@q<E>@\@\Send a status report, turn on Bypass mode
  30. @q<ESC >Control-@q<L>@\@\Clear the screen (enter sub-mode from VT102)
  31. @q<ESC >Control-@q<X>@\@\Turn on Bypass mode
  32. @q<ESC >Control-@q<Z>@\@\Activate crosshairs (GIN mode) and Bypass mode
  33. @q<ESC Z>@\@\Send terminal identification
  34. @q<ESC `> (accent grave)@\@\Use solid lines in drawing
  35. @q<ESC a> through @q<ESC e>@\@\Use dashed line patterns:
  36. @\@\@ a=fine dots, b=short dashes
  37. @\@\@ c=dash dot,  d=long dash dot
  38. @\@\@ e=dash dot dot.
  39. @q<ESC [ Pn ; Pn m>@\@\Set ANSI colors. Same as for VT102.
  40. @q<ESC [ ? 3 8 l>@\@\Exit Tek mode (become text terminal, VT102 etc)
  41. @q<ESC [ ? 3 8 h>@\@\Enter Tek mode (from VT102 mode)
  42. @end<format>
  43. @caption<Response of Tektronix Emulator to Received Characters>
  44. @bar()
  45. @end(table)
  46.  
  47. In the table, US is the name for the ASCII character Control-Underscore, 31
  48. decimal.  Text is written starting with the last drawn point being the lower
  49. left corner of the first 8 by 8 character cell.  The drawing position is
  50. updated by 8 dots to the right for each character, and lines wrap at column 80
  51. (column 90 for Hercules boards).  If text extends "below the screen" the sign
  52. "@q(More >)" is shown at the bottom right corner and the user needs to press a
  53. key to continue.  Then the screen will be cleared and the new text will start
  54. at the top of the screen (no scrolling is done in graphics mode).  A real Tek
  55. 4010 begins new text at column 40 and will overwrite dots from older material.
  56. Text mode is interrupted by the drawing commands discussed
  57. below.
  58.  
  59. @subu<Bypass Mode>:
  60.  
  61. Certain Tektronix commands turn on or off "Bypass" mode whereby incoming
  62. text is not displayed on the screen. Removal of echos of the GIN mode,
  63. discussed below, is the major use of Bypass. Bypass mode is turned on by
  64. receipt of
  65.         ESC Control-E, ESC Control-X, and ESC Control-Z
  66. and it is turned off upon receipt of
  67.         BEL, LF, CR, US, other escape sequences, and resetting the terminal.
  68.  
  69. @subu<Drawing commands GS, FS, RS>:
  70.  
  71. 1. Draw a line or move to a point: GS <@i(xy) @i(xy) @value<ellips> @i(xy)>
  72.  
  73. GS is the name for ASCII character Control-@q<]> (right square bracket),
  74. decimal 29.  <@i(xy)> stands for an encoded x,y coordinate as explained below.
  75. One or more x,y coordinates may follow GS and line segments are drawn from
  76. point to point.  The first point is reached without drawing so that GS and the
  77. initial <@i(xy)> is a simple "move-to" command rather than a "draw-to" command.XLines may be constructed from six dash patterns described in Table
  78. @ref(-mstekrc).  <@i(xy)> coordinates are encoded by separating the 10 bit
  79. value of x and of y into 5 bit components and then adding two high bits to eachXto identify which component is being represented: high-y, low-y, high-x, or
  80. low-x. They are transmitted in that order, with the low-x byte always sent
  81. last.  In fact, bytes may be omitted if they do not change from point to point,Xprovided that low-x is always sent.  These bytes range from ASCII space (32
  82. decimal) to ASCII DEL (127 decimal).  Details are given below, and summarized
  83. in Table @ref(-mstekxy).  This mode completes when a new command or a CR LF
  84. (carriage return, line feed) arrives; escape sequences are processed
  85. transparently but other control codes are ignored.  The interrupting character
  86. is accepted and processed next.
  87.  
  88. 2. Draw dots at given locations: FS <@i(xy) @i(xy) @value<ellips> @i(xy)>
  89.  
  90. FS is the name for the ASCII character Control-\ (backslash), decimal 28.
  91. <@i(xy)> is in the same form as above.  A dot is drawn at each x,y point.  ThisXmode completes when a new command or a CRLF character arrives; escape sequencesXare processed transparently but other control codes are ignored.  The
  92. interrupting character is accepted and processed next.
  93.  
  94. 3. Draw dots from the current location: RS @i(<pen> <direction> <direction>
  95. @value<ellips> <direction>)
  96.  
  97. RS is the name for the ASCII character Control-@q(^) (caret), decimal 30.
  98. @i<pen> is the character Space (32 decimal) to move without drawing or P (80
  99. decimal) to draw while moving.  @i(<direction>) is one of the letters A, E, D,
  100. F, B, J, H, I as shown in Table @ref<-mstekdd>.
  101.  
  102. @begin<table>
  103. @bar()
  104. @blankspace(1)
  105. @begin<format>
  106. @tabclear()@tabset(0.5inch,1.25inch,3.50inch)
  107. @ux(@i[<direction>])@\@ux<Move One Tek Dot This Way>
  108. @\A@\East (right)
  109. @\E@\East and North@\@q< F   D   E>
  110. @\D@\North (up)
  111. @\F@\North and West@\@q< B   *   A>     (@q<*> is current location)
  112. @\B@\West
  113. @\J@\South and West@\@q< J   H   I>
  114. @\H@\South
  115. @\I@\South and East
  116. @end<format>
  117. @caption<Tektronix Dot-Drawing Commands>
  118. @bar()
  119. @end(table)
  120.  
  121. Example: @q<RS P J J J> (no spaces here, naturally) means draw three dots in
  122. the southwest direction, stepping to each in turn.  This mode completes when a
  123. new command or a non-@i(<pen>) or non-@i(<direction>) character arrives; the
  124. interrupting character is accepted and processed next.
  125.  
  126. @subu[Graphics INput (GIN) mode]:
  127.  
  128. Graphics input mode is entered when ESC Control-Z is received.  A crosshair is
  129. drawn on the screen and may be moved by the numeric keypad arrows (fine scale
  130. motion) or the Shift key and these arrows (coarse scale motion).  Pressing an
  131. ASCII-producing key sends the position of the crosshairs to the host as the
  132. sequence of: pressed key, X coordinate, Y coordinate, carriage return, then
  133. removes the crosshairs, and then returns to text mode.  The coordinates are
  134. encoded by splitting them into five bit fields, adding an ascii space (20H)
  135. to each, and are sent as high-y, low-y, high-x and low-x bytes. Bypass mode
  136. is active while the report is sent to supress echos of the report.
  137. One may prematurely exit GIN mode by typing Control-C or Control-Break.
  138. Shift-PrtSc (DOS screen dump) remains active, however.
  139.  
  140. @subu(Status or Position Report):
  141.  
  142. ESCAPE Control-E requests a status report from the emulator.  Tek terminals
  143. have many sub-fields.  Kermit-MS sends a byte of 24 hex for being in text mode
  144. or 20 hex otherwise, followed by the encoded X then Y coordinates and a
  145. carriage return.  Coordinates are encoded 5 bits at a time similar to the GIN
  146. report.
  147.  
  148. @subu(Identification Report):
  149.  
  150. ESCAPE Z requests terminal identification, as for VT52 and VT102.  Currently
  151. this report is the 10 character sequence @w(@q<IBM_TEK ESCAPE / Z>) (no
  152. spaces).
  153.  
  154. @subu(Coordinate Encoding):
  155.  
  156. Coordinate 0,0 is the lower left corner and the X axis is horizontal. TektronixXpositions are mapped into the typically 640 dots wide by 200 or 350 dots high
  157. PC screen and thus adjacent Tek positions may yield the same PC screen dot.
  158.  
  159. 4010-like devices use positions from 0 to 1023 for both X and Y, although only
  160. 0 to 779 are visible for Y due to screen geometry.  The Tek screen is 10.24 by
  161. 7.80 inches and coordinates are sent as 1-4 characters.
  162.  
  163. 4014-like devices use positions 0 to 4095, but each movement is a multiple of 4Xpositions unless the high-resolution LSBXY are sent.  This makes it compatible
  164. with the 4010 in that a full sized plot fills the screen.  The emulator acceptsXthe LSBXY components but does not use them.
  165.  
  166. The various modes are summarized in Table @ref<-mstekxy>, in which the
  167. following notation is used:
  168. @begin(display)
  169. HIX, HIY = High order 5 bits of a 10 or 12 bit position.
  170. LOX, LOY = Middle order 5 bits of position (low order of Tek 4010).
  171. LSBXY = Low order 2 bits of X + low order 2 bits of Y (4014 mode),
  172.    recognized by the Tek emulator but not used to calculate position.
  173. @end(display)
  174.  
  175. @begin<table>
  176. @bar()
  177. @blankspace(1)
  178. @begin<format>
  179. @tabclear()
  180. @tabset(0.75inch,1.5inch,2.25inch,3.0inch,3.6inch,4.1inch,4.7inch,
  181.         5.3inch,5.95inch)
  182. @ux<Hi Y>@\@ux<Lo Y>@\@ux<Hi X>@\@ux<LSBXY>@\@ux<Characters Sent @~
  183. (Lo-X Always Sent)>
  184. Same@\Same@\Same@\Same@\@\@\@\@\Lo-X
  185. Same@\Same@\Same@\Diff@\@\LSB,@\Lo-Y,@\@\Lo-X@\4014
  186. Same@\Same@\Diff@\Same@\@\@\Lo-Y,@\Hi-X,@\Lo-X
  187. Same@\Same@\Diff@\Diff@\@\LSB,@\Lo-Y,@\Hi-X,@\Lo-X@\4014
  188. Same@\Diff@\Same@\Same@\@\@\Lo-Y,@\@\Lo-X
  189. Same@\Diff@\Same@\Diff@\@\LSB,@\Lo-Y,@\@\Lo-X@\4014
  190. Same@\Diff@\Diff@\Same@\@\@\Lo-Y,@\Hi-X,@\Lo-X
  191. Same@\Diff@\Diff@\Diff@\@\LSB,@\Lo-Y,@\Hi-X,@\Lo-X@\4014
  192. Diff@\Same@\Same@\Same@\Hi-Y,@\@\@\@\Lo-X
  193. Diff@\Same@\Same@\Diff@\Hi-Y,@\LSB,@\Lo-Y,@\@\Lo-X@\4014
  194. Diff@\Same@\Diff@\Same@\Hi-Y,@\@\Lo-Y,@\Hi-X,@\Lo-X
  195. Diff@\Same@\Diff@\Diff@\Hi-Y,@\LSB,@\Lo-Y,@\Hi-X,@\Lo-X@\4014
  196. Diff@\Diff@\Same@\Same@\Hi-Y,@\@\Lo-Y,@\@\Lo-X
  197. Diff@\Diff@\Same@\Diff@\Hi-Y,@\LSB,@\Lo-Y,@\@\Lo-X@\4014
  198. Diff@\Diff@\Diff@\Same@\Hi-y,@\@\Lo-Y,@\Hi-X,@\Lo-X
  199. Diff@\Diff@\Diff@\Diff@\Hi-y,@\LSB,@\Lo-Y,@\Hi-X,@\Lo-X@\4014
  200. @end<format>
  201. @begin<format>
  202. @tabclear()
  203. @tabset(3.0inch,3.6inch,4.1inch,4.7inch,5.3inch,5.95inch)
  204. Kind code for byte:@\20h@\60h@\60h@\20h@\40h
  205. @\(transmitted left to right)
  206. @end<format>
  207. @caption<Tektronix Coordinate Interpretation>
  208. @bar()
  209. @end(table)
  210.  
  211. Note that LO-Y must be sent if HI-X has changed so that the Tektronix knows theXHI-X byte (in the range of 20h-3Fh) is HI-X and not HI-Y.  LO-Y must also be
  212. sent if LSBXY has changed, so that the 4010 will ignore LSBXY and accept LO-Y.
  213. The LSBXY byte is
  214. @MD<60h + (MARGIN * 10h) + (LSBY * 4) + LSBX>
  215. MARGIN is 0 here and refers to splitting the screen left and right for text
  216. rollover, which the Kermit Tek emulator does not do.
  217.  
  218. @subu<Tek 4010 Example>:
  219.  
  220. Suppose <@i(xy)> is point y = 300, x = 500 in Tektronix coordinates.  Split
  221. each 10-bit coordinate into 5-bit groups, add add the Kind code to each. Send
  222. the X part last.
  223. @begin<example>
  224.                 HI-Y     LO-Y                   HI-X     LO-X
  225. Y=300d=012Ch=  01001    01100   X=500d=01F4h=  01111    10100
  226.   +Kind code +@u<100000> +@u<1100000>     +kind code +@u<100000> +@u<1000000>
  227. Binary        101001 01101100                 101111  1000100
  228. ASCII            )       l                       /       D
  229. @end<example>
  230. So <@i(xy)> = (500,300) is sent or received in a GS command as @qq<)l/D>.  An
  231. example in C (program fragments):
  232. @begin<example,leftmargin 0,group,blanklines hinge>
  233. #define ESC  27
  234. #define GS   29
  235. #define US   31
  236. FILE *fp;                      /* File descriptor for terminal */
  237.  . . .
  238.  
  239.     fputc( GS, fp); coord( 75, 65);       /* Move to 75,65      */
  240.     fputc( ESC, fp); fputs("[31m", fp);   /* Set foreground to red */
  241.     fputc( US, fp); fputs("A House", fp); /* Annotate at 75,65  */
  242.     fputc( ESC, fp); fputs("[33m", fp);   /* Set foreground to yellow */
  243.     fputc( GS, fp);                       /* Now draw lines...  */
  244.     coord( 50, 50); coord(300, 50);       /* Bottom side        */
  245.     coord(300,200); coord( 50,200);       /* Right wall, top    */
  246.     coord(175,250); coord(300,200);       /* Roof               */
  247.     fputc( GS, fp);                       /* Start a new line   */
  248.     coord( 50, 50); coord( 50,200);       /* Left wall at 50,50 */
  249.     fputc( ESC, fp); fputs("[37m", fp);   /* Set foreground to white */
  250.     . . .
  251.  
  252. coord(x, y) int x, y; {        /* Send x,y coordinates to Tek 4010 */
  253.     fputc((y / 32) + 32, fp);             /* High y */
  254.     fputc((y % 32) + 96, fp);             /* Low  y */
  255.     fputc((x / 32) + 32, fp);             /* High x */
  256.     fputc((x % 32) + 64, fp);             /* Low  x */
  257. }
  258. @end<example>
  259.  
  260.