home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / kermit23.zip / MSVIBM.TEK < prev    next >
Text File  |  1990-02-06  |  35KB  |  687 lines

  1. File TEKEMU.TXT                                                20 January 1990
  2.  
  3.                               DESCRIPTION OF THE
  4.           TEKTRONIX GRAPHICS TERMINAL EMULATOR IN MS-DOS KERMIT V3.0
  5.                                  FOR IBM PCs
  6.  
  7. INTRODUCTION
  8.  
  9.         The MS-DOS Kermit Tektronix terminal emulator has characteristics of
  10. the real Tektronix 4010 and 4014 terminals plus extensive additions from the
  11. DEC VT340 and Human Data Systems 2000/3000 series terminals.  Please note that
  12. the DEC VT340 can mix text and graphics on the same display but the hardware
  13. design of IBM PC display adapters forbids this.  Instead a best effort scaling
  14. is done to simulate text and graphics together.  Real Tektronix 401x terminals
  15. use storage tube technology which forbids erasure and colors; the MS-DOS
  16. Kermit emulator bends these rules in favor of raster display technology and
  17. the DEC VT340.  The real Tektronix terminals display text by overwriting dots;
  18. MS-DOS Kermit does this via command SET TERMINAL GRAPHICS CHARACTER-WRITING
  19. TRANSPARENT.  Raster display devices fill each character cell with new dots;
  20. use option OPAQUE in the above command to achieve the same effect.  A real Tek
  21. terminal writes two screens of text by overwriting the second screen on the
  22. right half of the first; MS-DOS Kermit sounds a beep and waits for a keystroke
  23. and then starts on a fresh screen.  VT340 Sixel graphics is supported, but
  24. ReGis graphics is not.
  25.  
  26.         The kind of display adpater is normally sensed automatically.  But the
  27. user can specify a type with command SET TERMINAL GRAPHICS; if the type is not
  28. present a fall back to CGA or ordinary monochrome text is performed.
  29.  
  30.         Graphics screens are saved in display memory if the adapter has
  31. sufficient quantity.  CGA screens cannot be saved, and VGA (640x480) cannot
  32. save the last 131 scan lines.  Hercules adapters need graphics page 1 to save
  33. an image; some clones do not seem to do this.  The Wyse 700 display and
  34. special adapter do not allow screen saving.  MS-DOS Kermit attempts to save
  35. the graphics screens whenever possible, even though this differs from DEC
  36. VT340 practice (DEC merges text and graphics modes, IBM-PCs cannot).  Use ALT
  37. = or keyboard verb \Kreset to do a full screen clear and terminal reset, or
  38. echo ^L to just clear the screen.
  39.  
  40.         The VT320 main text terminal emulator is designed to switch to
  41. Tektronix emulation whenever three commands are received:
  42.  
  43.         1. ESC ^L       Tektronix screen clear command
  44.         2. ESC ╒ ? 38 h   VT340 command to enter Tek mode
  45.         3. DCS Pn q     start of Sixel command string
  46.  
  47. The third case results in the VT320 emulator feeding a ^L (screen clear)
  48. command to the Tek emulator, replaying the DCS lead-in characters, and then
  49. placing the Tek emulator temporairly in charge to read subsequent characters.
  50. Tek sub-mode persists until either:
  51.  
  52.         1. the user toggles terminal types manually (ALT white minus, or
  53.            keyboard verb \Ktermtype)
  54.         2. ESC ╒ ? 38 l  is read, VT340 command to exit Tek mode
  55.         3. ESC ^X        is read
  56.  
  57. Entering Tek mode by the third method forces character-writing to be opaque,
  58. the other two methods do not.
  59.  
  60.  
  61. ACTIONS TO RECEIVED CHARACTERS
  62.  
  63.  Characters of 80h and above (those with their high bit on) are converted
  64.  as follows:
  65.  80h..9fh converted to pair ESC <value - 40h>.  These are C1 control codes.
  66.  0a0h..0ffh converted to <value - 80h> and become printable characters.
  67.  
  68.  Control codes in C0 (no high bit) area
  69.  Name   ASCII    value
  70.         chart   hex keyboard    operation
  71.  NUL    0/0     00h   ^@        Ignored
  72.  ENQ    0/5     05h   ^E
  73.  BEL    0/7     07h   ^G        Sound DEC style beep
  74.  BS     0/8     08h   ^H        Backspace, move cursor left one character,
  75.                                 8 dots, can be destructive
  76.  HT     0/9     09h   ^I        Treated as a single space
  77.  LF     0/10    0ah   ^J        Linefeed, move cursor down one line, 8 dots
  78.  VT     0/11    0bh   ^K        Vertical Tab, treated as a line feed
  79.  FF     0/12    0ch   ^L        Formfeed, erase screen, Home cursor
  80.  CR     0/13    0dh   ^M        Carriage return, move cursor to col 1
  81.  DC1    1/1     11h   ^Q        XON flow control, resume communication
  82.  DC3    1/3     13h   ^S        XOFF flow control, suspend communication
  83.  CAN    1/8     18h   ^X        Return to text terminal, only if in sub-Tek
  84.                                 mode, else ignored if regular Tek terminal
  85.  SUB    1/10    1ah   ^Z        Treated as a CAN
  86.  ESC    1/11    1bh   ^╒        Escape, start escape seq, cancel any others
  87.  FS     1/12    1ch   ^\        Enter point plotting mode
  88.  GS     1/13    1dh   ^σ        Enter line drawing mode
  89.  RS     1/14    1eh   ^^        Enter incremental line drawing mode
  90.  US     1/15    1fh   ^_        Enter Tek text mode (leave line/point drawing)
  91.  All others are ignored
  92.  
  93.  Control codes in C1 (high bit set, 80h - 9fh) area
  94.  Name   ASCII    value
  95.         chart   hex             operation
  96.  DCS    9/0     90h             Expand to be ESC P  Device Control String
  97.  ST     9/12    9ch             Expand to be ESC \  String Terminator for DCS
  98.  CSI    9/13    9dh             Expand to be ESC ╒  Control Seq Introducer
  99.  All others are expanded to be ESC <value-40h> and are generally ignored.
  100.  
  101.  
  102.  Tektronix Coordinate system (the PC screen is scaled to fit a Tek screen):
  103.  
  104.  The plot commands are characters which specify the absolute position to move
  105.  the beam.  All moves except the one immediately after the GS character
  106.  (Control-σ) are with a visible trace.
  107.  
  108.  For 4010-like devices - The positions are from 0 to 1023 for both X and Y,
  109.  although only 0 to 780 are visible for Y due to screen geometry.  The screen
  110.  is 10.23 by 7.80 inches, and coordinates are sent as 1 to 4 characters.
  111.  
  112.  For 4014-like devices - The positions are from 0 to 4096, but each movement
  113.  is a multiple of 4 positions unless the high-resolution LSBXY are sent.  This
  114.  makes it compatible with the 4010 in that a full sized plot fills the screen.
  115.  
  116.  HIX,HIY = High-order 5 bits of position
  117.  LOX,LOY = Middle-order 5 bits of position
  118.  LSBXY   = Low-order 2 bits of X + low-order 2 bits of Y (4014 mode)
  119.  
  120.  Hi Y     Lo Y    Hi X    LSBXY   Characters sent (Lo-X always sent)
  121.  ----     ----    ----    -----   ----------------------------------
  122.  Same     Same    Same    Same                           Lo-X
  123.  Same     Same    Same    Diff          LSB, Lo-Y,       Lo-X   4014
  124.  Same     Same    Diff    Same               Lo-Y, Hi-X, Lo-X
  125.  Same     Same    Diff    Diff          LSB, Lo-Y, Hi-X, Lo-X   4014
  126.  Same     Diff    Same    Same               Lo-Y,       Lo-X
  127.  Same     Diff    Same    Diff          LSB, Lo-Y,       Lo-X   4014
  128.  Same     Diff    Diff    Same               Lo-Y, Hi-X, Lo-X
  129.  Same     Diff    Diff    Diff          LSB, Lo-Y, Hi-X, Lo-X   4014
  130.  Diff     Same    Same    Same    Hi-Y,                  Lo-X
  131.  Diff     Same    Same    Diff    Hi-Y, LSB, Lo-Y,       Lo-X   4014
  132.  Diff     Same    Diff    Same    Hi-Y,      Lo-Y, Hi-X, Lo-X
  133.  Diff     Same    Diff    Diff    Hi-Y, LSB, Lo-Y, Hi-X, Lo-X   4014
  134.  Diff     Diff    Same    Same    Hi-Y,      Lo-Y,       Lo-X
  135.  Diff     Diff    Same    Diff    Hi-Y, LSB, Lo-Y,       Lo-X   4014
  136.  Diff     Diff    Diff    Same    Hi-y,      Lo-Y, Hi-X, Lo-X
  137.  Diff     Diff    Diff    Diff    Hi-y, LSB, Lo-Y, Hi-X, Lo-X   4014
  138.  Offset for byte:                 20h   60h  60h   20h   40h
  139.  
  140.  Note that LO-Y must be sent if HI-X has changed so that the TEKTRONIX knows
  141.  the HI-X byte (in the range of 20h-3fh) is HI-X and not HI-Y.   LO-Y must
  142.  also be sent if LSBXY has changed, so that the 4010 will ignore LSBXY and
  143.  accept LO-Y.   The LSBXY byte is 60h + MARGIN*10h + LSBY*4 + LSBX. (MARGIN=0)
  144.  
  145.  Control-σ (GS) Tek coordinates.  Enter Tek line plot mode.
  146.         The first move will be with beam off (a moveto command), subsequent
  147.         coordinates will be reached with the beam on (a drawto command).
  148.         Note: this is also Kermit's Connect mode escape character so beware
  149.         if typing GS by hand; SET ESCAPE to something else before the test.
  150.         Exit drawing upon reception of CR,LF,RS,US,FS,CAN.
  151.  
  152.  Control-caret (^, RS) Tek coordinates.  Enter Tek line incremental plot mode.
  153.         RS space        move with pen up (invisible)
  154.         RS P            move with pen down (write dots)
  155.         RS <letter>
  156.         letter  motion                  letter  motion
  157.           A     right (East)              B     left (West)
  158.           B     right and up (NE)         J     left and down (SW)
  159.           D     up (North)                H     down (South)
  160.           F     left and up (NW)          I     right and down (SE)
  161.         Exit drawing upon reception of CR,LF,RS,US,FS,CAN.
  162.   Example: RS <space> J J J  means move three Tek positions left and down
  163.         (three south west steps) with the pen up (move invisibly).
  164.  
  165.  Control-\ (FS) Tek coordinates.  Draw a dot at the coordinate.  Point plotting
  166.         mode.  Like GS but does not join end points with lines.
  167.         Exit drawing upon reception of CR,LF,RS,US,FS,CAN.
  168.  
  169.  Control-underline (_, US)   Exit Tek line plot mode and return to text mode.
  170.  
  171.  
  172.  Escape sequences (ESC intermediates Final)
  173.  
  174.  Escape Seq     Mnemonic        Description of Action
  175.  ESC ^E                         Request Tek status report
  176.                 Report is
  177.                 20h Tek-X Tek-Y 0dh   for non-text mode
  178.                 24h Tek-X Tek-Y 0dh   for text mode
  179.                                 Tek-X Tek-Y is Tek style cursor position
  180.  
  181.  ESC ^L                         Enter Tektronix sub-mode, clear Tek screen
  182.  ESC ^X                         Turn on Bypass mode (no screen chars)
  183.  ESC ^Z                         Turn on GIN crosshairs
  184.  ESC ?                          Substitute for DEL, for 7-bit systems
  185.  ESC P                          Device Control Sequence introducer (DCS)
  186.                                  See below.
  187.  ESC Z                          Report terminal type (as a VT320/VT340)
  188.         Response is
  189.         ESC ╒ ? 63; 1; 2; 4; 8; 9; 15 c   a VT300 series, level 3, etc
  190.  
  191.  ESC @ .. ESC M                 (@,A,B,C,D,E,F,G,H,I,J,K,L,M) Select
  192.                                 rectangular fill pattern 1..14. See ESC /..y
  193.  
  194.  ESC \                          String Terminator (ST, of DCS items)
  195.  
  196.  ESC ` .. ESC e, ESC x, .. ESC z         (accent grave,a,b,c,d,e,x,y,z)
  197.                                  Select line drawing pattern
  198.       ESC letter        line type, bits, least significant bit plotted first
  199.         accent          11111111 11111111
  200.         a               10101010 10101010
  201.         b               11110000 11110000
  202.         c               11111010 11111010
  203.         d               11111111 11001100
  204.         e               11111100 10010010
  205.         x               user defined (by ESC / Pn a)
  206.         y               user defined (by ESC / Pn b)
  207.         z               user defined (by ESC / Pn c)
  208.  
  209.  
  210.  Control sequences (ESC /  or  ESC ╒  or  CSI)
  211.  (ESC / is an HDS 2000/3000 sequence, ESC ╒ is ANSI form)
  212.  
  213.  Control Seq    Mnemonic        Description of Action
  214.  
  215.  ESC / P1; P2;...; P8 C         Define user fill pattern.  Use low 8-bits of
  216.                                 each Pn.  P1 is top of fill, plotted lsb first.
  217.                                 pattern is 8x8 dots.  Omitted Pn are 0's.
  218.  
  219.  ESC / P1; P2;...; P8 D         Define second user fill pattern, as above
  220.  
  221.  ESC / Pn a                     Set user definable line drawing bit pattern
  222.  ESC / Pn b                     Ditto, lsb drawn first, 16 bits overall
  223.  ESC / Pn c                     Ditto
  224.  
  225.  ESC / Pd d             Set pixel operation code
  226.         Pd      pixel operation
  227.         0       draw 1's in foreground color, skip 0's
  228.         1       draw 1's in background color, skip 0's
  229.         2       XOR 1's with foreground color, skip 0's
  230.         3       write absolute, 1's in foreground and 0's in background color
  231.  
  232.  ESC / Pn h             Set, see table below
  233.  ESC / Pn l             Reset, set table below
  234.         Pn      item
  235.         2       destructive space (writes all dots in 8x8 character cell)
  236.         9       destructive backspace (clears all dots in 8x8 character cell)
  237.  
  238.         Note: both are default off.  If Tek mode is entered by receiving a
  239.         Sixel DCS while in text mode then both are turned on.  If SET TERMINAL
  240.         GRAPHICS CHARACTER-WRITING OPAQUE is stated then both are turned on.
  241.  
  242.  ESC / Px; Py; Ph; Pw x         Draw rectangle, Px,Py is lower left corner
  243.                                 line is drawn as foreground dots only.
  244.  
  245.  ESC / Px; Py; Ph; Pw; Pp y     Fill a rectangle, Px,Py is lower left corner
  246.                                 Ph is height, Pw is width, Pp is fill pattern
  247.                                 number (1..14), all in Tek coordinates.
  248.         Pp      pattern                 Pp      pattern
  249.         0       use default
  250.         1       solid                   8       vertical cross-hatch
  251.         2       grey (50% dots)         9       checkerboard
  252.         3       left to right slant     10      dotted, sparse
  253.         4       right to left slant     11      horizontal herringbone
  254.         5       horizontal lines        12      vertical herringbone
  255.         6       vertical lines          13      user defined (by ESC / Pn C)
  256.         7       slanted cross-hatch     14      user defined (by ESC / Pn D)
  257.         All are 8x8 tiling pixel patterns locked to the top left of the screen
  258.         and are drawn using the current pixel operation code (ESC / Pd d).
  259.  
  260.  ESC / Px; Py; Ph; Pw; Pp z     Fill a rectangle, as for ESC / ...y and then
  261.                                 add a line border as for ESC / ...x.
  262.  Each rectangle command, ESC /...(x, y, z) does not change the "text" cursor.
  263.  
  264.  ESC ╒ Pn @     ICH             Insert Pn spaces at and after cursor (8 dots)
  265.  ESC ╒ Pn A     CUU*            Cursor up Pn lines, does not scroll
  266.  ESC ╒ Pn B     CUD*            Cursor down Pn lines, does not scroll
  267.  ESC ╒ Pn C     CUF             Cursor forward, stays on same line (8 dots)
  268.  ESC ╒ Pn D     CUB             Cursor backward, stays on same line (8 dots)
  269.  ESC ╒ Pn E     CNL*            Next-line (same as cr/lf), do Pn times
  270.  ESC ╒ Pn F     CPL*            Previous-line (reverse index), do Pn times
  271.  ESC ╒ Pc G     CHA*            ANSI Cursor to absolute column Pc
  272.  ESC ╒ Pr; Pc H CUP*            Set cursor to row, column (same as HVP)
  273.  ESC ╒ Ps J     ED*             Erase in display:
  274.                                 0 = cursor to end of screen, inclusive
  275.                                 1 = start of screen to cursor, inclusive
  276.                                 2 = entire screen, cursor does not move
  277.  ESC ╒ Ps K     EL*             Erase in line:
  278.                                 0 = cursor to end of line, inclusive
  279.                                 1 = start of line to cursor, inclusive
  280.                                 2 = entire line, cursor does not move
  281.  ESC ╒ Pn P     DCH*            Delete Pn chars from cursor to left, incl.
  282.  ESC ╒ Pn X     ECH*            Erase Pn chars at and to right of cursor
  283.  ESC ╒ Pn a     CUF*            ANSI Cursor forward Pn columns
  284.  ESC ╒ Pr d     CVA*            ANSI Cursor to row Pr, absolute
  285.  ESC ╒ Pn e     CUD*            ANSI Cursor down Pn rows
  286.  ESC ╒ Pr; Pc f HVP*            Set cursor to row, column (same as CUP)
  287.         * means the row and column are scaled by assuming the screen has the
  288.         row and column dimensions of the text terminal emulator.  Since the
  289.         two screens generally do not share common divisors some
  290.         mis-registration will occur.  Successive cursor steering commands,
  291.         mixed with CR and LF's, will cause further mis-registration.
  292.         Tek emulator characters use an 8x8 dot bit mapped pattern.
  293.  
  294.  ESC ╒ Pn; Pn m                 Set screen colors
  295.         Pn      operation
  296.         0       set dim (normal) intensity
  297.         1       set high intensity
  298.         30-37   set foreground colors to Pn minus 30
  299.         40-47   set background colors to Pn minus 40
  300.                 Colors are red=1, green=2, blue=4 and summations for others.
  301.                 Note: this stores new values in palette 0 (background) and
  302.                 palette 7 (foreground).
  303.  
  304.  ESC ╒ 2; 2 $ u                 Request VT340 color palette report
  305.         Report is
  306.         ESC P 2 $ s <palette 0>/<palette 1>/...<palette 15> ESC \
  307.         where <palette n> is the palette color in the RBG system -
  308.                 Pr; Pg; Pb      for red, green, and blue percentages, resp.
  309.                 black is 0; 0; 0
  310.                 bold black is 20; 20; 20
  311.                 dim (regular) hue is 40, bold hue is 80.
  312.     NOTE: this report is a very long string and may not be acceptable to
  313.           some communications channels (for example, Telnet).  Further, the
  314.           host may request a report in the HLS system; MS-DOS Kermit always
  315.           reports in the RBG system.
  316.  
  317.     Default VT340 color palettes are -
  318.      palette    b/w     color           palette  b/w     color
  319.      0 backgnd  black   black           8       dim grey dim grey (bold black)
  320.      1          white   bold blue       9       grey     blue
  321.      2          white   bold red        10      grey     red
  322.      3          white   bold green      11      grey     green
  323.      4          white   bold magenta    12      grey     magenta
  324.      5          white   bold cyan       13      grey     cyan
  325.      6          white   bold yellow     14      grey     yellow/brown
  326.      7 foregnd  grey    grey            15      white    white (bold)
  327.  
  328.  
  329.  ESC ╒ ? 34 h                   Invoke macro TerminalS, if defined, exits
  330.                                         connect mode.
  331.  ESC ╒ ? 34 l                   Invoke macro TerminalR, as above
  332.  
  333.  ESC ╒ ? 38 l                   Exit Tek mode to text terminal emulator, only
  334.                                 if Tek mode were invoked from text emulator
  335.                                 by ESC ╒ ? 38 h or by a Sixel DCS.
  336.  
  337.  ESC ╒ ? 256 n                  Request screen size report, MS-DOS Kermit only
  338.         Report is ESC ╒ ? 256; Ph; Pw; Pc n     for graphics systems
  339.         where   Ph is screen height in dots
  340.                 Pw is screen width in dots
  341.                 Pc is number of colors (0, 1 or 16, for none, b/w, ega/vga)
  342.         Report is ESC ╒ ? 24; 80; 0 n  for pure text mono systems.
  343.  
  344.  
  345.  Device Control Strings (ESC P or DCS)
  346.  
  347.  DCS P1; P2; P3 q string ST   or in 7-bit form
  348.  ESC P P1; P2; P3 q string ESC \                a Sixel Graphics command
  349.  
  350.    P1 and P3 are ignored.
  351.    P1 = 1 means draw 0 bits in background, else skip them.
  352.    string is a Sixel command string, containing mixtures of -
  353.  
  354.      Sixel characters (3fh..7eh, lower 6 bits+3fh, displayed as six dots
  355.         vertically, least significant bit at the top after subtracting 3fh).
  356.         "?" is all zeros, "@" is top line only, "~" is all 6 bits on.
  357.         The initial Sixel char is placed at the top left of the current 8x8
  358.         text cell, subsequent chars work to the right without wrapping.
  359.         Writing below the screen bottom results in overwriting the bottom
  360.         strip.
  361.  
  362.      ! Pn sixel char            Draw Sixel char Pn times (Pn is repeat count)
  363.  
  364.      " Pc; Pad; Ph; Pv          Raster attributes (all ignored)
  365.  
  366.      $  (dollar sign )          Go to left margin
  367.  
  368.      -  (minus)                 Go to left margin and 6 dots down
  369.  
  370.      Control characters         Perform the function, stay in Sixel mode.  Note
  371.                                 that LF increments by 8 dots (text cell size)
  372.  
  373.      Escape sequences are permitted within string and occur without disruption
  374.  
  375.      # Pc; Pu; Px; Py; Pz       Set palette color, as follows,
  376.         Pc is color palette, 0..15  (0 is background, 7 is normal foreground)
  377.         Pu is color system, 1 = HLS, 2 = RGB
  378.         For Hue Lightness Saturation:
  379.                 Px = Hue angle, 0-360 degrees.  The colors are mapped around
  380.                 the color wheel in 60 degree segments as Hues:
  381.                 0-29 deg = blue, 30-89 = magenta (blue + red), 90-149 = red,
  382.                 150-209 = yellow (red + green), 210-269 = green,
  383.                 270-329 = cyan (green + blue),  330-359 = blue.
  384.  
  385.                 Py = Lightness, 0-100%, Pz = Saturation, 0-100%
  386.                   Lightness     Sat = 51-100    Sat = 11-50      Sat = 0-10
  387.                   86-100        bold white      bold white       bold white
  388.                   71-85         bold hue        bold white       bold white
  389.                   57-70         bold hue        grey (dim white) grey
  390.                   43-56         bold hue        dim hue          black
  391.                   29-42         dim hue         grey             grey
  392.                   14-28         dim hue         black            black
  393.                    0-13         black           black            black
  394.                 Note that Py = Pz = 50 gives the widest spectrum.
  395.  
  396.         For RGB: Px = red, 0-100%, Py = green, 0-100%, Pz = blue, 0-100%
  397.                 If any color exceeds 50% then the bold bit is turned on for
  398.                 the ensemble (IBM ega display adapter constraint for iRGB).
  399.  
  400.         Palette registers can be selected by the substring
  401.                 # Pc    followed by a non-numeric char other than ";"
  402.                         and Pc is the palette register, 0..15.
  403.  
  404.         Example of dynamic palette register selection -
  405.  
  406.                 ESC P ;1 q AAAA#2BBBBBB#3!6C ESC \      (omit the spaces)
  407.  
  408.                 Displays Sixel char A four times in the default foreground
  409.                 color (palette 7), then B five times in colors of palette 2,
  410.                 then C six times in palette 3 colors.  The ";1" says skip
  411.                 coloring dots with 0 bits.
  412.                 Exception from DEC: color of black always writes all dots in
  413.                 black (an erasure or clearing).
  414.  
  415.    Suggestion: when possible ask for a palette report and store the reponse,
  416.    change palettes as desired for a plot, and then restore the palettes.
  417.  
  418.    Sixel character plotting begins at the upper left of the current text
  419.    cell.  Thus, either Tek or ANSI cursor steering commands can be employed
  420.    to locate the starting position.  ESC ╒ ..m coloring escape sequence can
  421.    occur withing a Sixel string and it acts on the current fore/background
  422.    colors and stores them in palettes 7 and 0.  Sixel dots are stored by
  423.    ORing the palette value with the palette value already existing in that
  424.    dot, with the exception that all black writes black absolutely.  At the
  425.    completion of a Sixel DCS the screen colors are reset to palette 7 and 0
  426.    for foreground and background, respectively.
  427.  
  428. TIFF SCREEN DUMPS
  429.  
  430.         These follow Aldus/Microsoft TIFF version 5.0 specifications.  The
  431. output filename is always TEKPLTnn.TIF, where nn starts at 01 and increments
  432. by one for each new screen dump.  The files are in uncompressed format and
  433. thus EGA/VGA screens yield 100KB+ files.  Monochrome graphics are written
  434. as one bit per pixel TIFF type B format, with the screen divided into 25 or
  435. fewer strips.  EGA and VGA screens use TIFF type P palette format and a
  436. supplementary color palette to RGB table.  They too are divided into 25 or
  437. fewer strips and use four bits per pixel.  The color palette contents are iRGB,
  438. to match normal IBM PC display adapter conventions.
  439.  
  440.         When dumping a screen via Control End or keyboard verb \Kdump the
  441. graphics screen needs to be visible; otherwise, an ordinary text screen is
  442. written to the Kermit.scn file.
  443.  
  444.         TIFF v5 specifications are available directly from Aldus or Microsoft
  445. and by anonymous ftp from site wsmr-simtel20.army.mil as file
  446.  PD1:╒MSDOS.GRAPHICSσTIFF-5.ARC.
  447.  
  448. EXAMPLES
  449.  
  450. Tek 4010 line drawing:
  451.  
  452. Suppose <xy> is point y = 300, x = 500 in Tektronix coordinates.    Split  each
  453. 10-bit  coordinate into 5-bit groups, add add the Kind code to each. Send the X
  454. part last.
  455.  
  456.                     HI-Y     LO-Y                   HI-X     LO-X
  457.     Y=300d=012Ch=  01001    01100   X=500d=01F4h=  01111    10100
  458.       +Kind code +100000 +1100000     +kind code +100000 +1000000
  459.     Binary        101001 01101100                 101111  1000100
  460.     ASCII            )       l                       /       D
  461.  
  462. So <xy> = (500,300) is sent or received in a GS command as ")l/D".  An  example
  463. in C (program fragments):
  464.  
  465. -----------------------
  466. /* File tek.c. Creates binary output file tek.tst. Replay that file. */
  467. /* writes a Tek test file  'tek.tst', Lattice C */
  468. #include <stdio.h>
  469. #include <math.h>
  470.  
  471. #define ESC 0x1b
  472. #define FF 0x0c
  473. #define CAN 0x18
  474. #define FS 0x1c
  475. #define GS 0x1d
  476. #define US 0x1f
  477. #define ESCZ 0x1a
  478. #define RED 1
  479. #define GREEN 2
  480. #define BLUE 4
  481. #define color(c) fputc(ESC,fp);fputc('╒',fp);fputc('1',fp);\
  482.         fputc(';',fp);fputc('3',fp); fputc('0'+c,fp);fputc('m',fp);
  483. FILE *fp;
  484.  
  485. main()
  486. {
  487.         int i, x, y, xc = 750, yc = 500;
  488.         double radius = 125.0;
  489.  
  490.         if ((fp = fopen("tek.tst", "wb")) == NULL) /* write binary mode */
  491.                 exit(1);
  492.  
  493.         fputc(ESC, fp); fputc(FF, fp);  /* clear screen, enter graphics mode*/
  494.         for (i = 0; i < 40; i++) fputc('\0', fp);       /* padding */
  495.                                                         /* for mode switch */
  496.         fputc(GS, fp); coord(210,500);                  /* moveto */
  497.         color(RED);
  498.         fputc(US, fp); fputs("shallow fan",fp);         /* text mode */
  499.         color(GREEN+RED);
  500.         fputc(GS, fp); coord(50,500); coord(200,400);   /* drawto's */
  501.         coord(50,500); coord(200,450);
  502.         coord(50,500); coord(200,500);
  503.         coord(50,500); coord(200,550);
  504.         coord(50,500); coord(200,600);
  505.  
  506.         fputc(GS, fp); coord(460,500);
  507.         color(BLUE);
  508.         fputc(US, fp); fputs("steep fan", fp);
  509.         fputc(GS, fp); coord(400,200); coord(400,800);
  510.         coord(400,500); coord(450,200);
  511.         coord(400,500); coord(450,300);
  512.         coord(400,500); coord(450,400);
  513.         coord(400,500); coord(450,500);
  514.         coord(400,500); coord(450,600);
  515.         coord(400,500); coord(450,700);
  516.         coord(400,500); coord(450,800);
  517.         fputc(US, fp); fputc(' ', fp);
  518.  
  519.         color(GREEN);
  520.         fputc(GS, fp);                          /* simple circle */
  521.         for (i = 0; i <= 360; i++)
  522.                 {
  523.                 x = radius * cos(PI * i / 180.0);
  524.                 y = radius * sin(PI * i / 180.0);
  525.                 coord(x+xc, y+yc);
  526.                 }
  527.  
  528.         color(GREEN+BLUE);
  529.         fputc(GS, fp); coord(75, 65);                   /* moveto */
  530.         fputc(US, fp); fputs("This is a house\n", fp);  /* text mode */
  531.         fputc(GS, fp);                          /* draw lines for house */
  532.         coord(50,50); coord(300,50);
  533.         coord(300,200); coord(50,200);
  534.         coord(175,250); coord(300,200);
  535.         fputc(GS, fp); coord(50,50); coord(50,200);
  536.         color(RED+BLUE);
  537.                                         /* do some point plotting */
  538.         fputc(GS, fp); coord(350,50);
  539.         fputc(FS, fp);                  /* draw a dotted rectangle */
  540.         for (i = 350; i <= 600; i += 4) coord(i,50);
  541.         for (i = 50;  i <= 200; i += 4) coord(600,i);
  542.         for (i = 600; i >= 350; i -= 4) coord(i,200);
  543.         for (i = 200; i >= 50;  i -= 4) coord(350,i);
  544.         color(RED+GREEN+BLUE);
  545.         fputc(GS, fp); coord(50,10);                    /* move to */
  546.         fputc(US, fp); fputs(" the end.", fp);          /* text mode */
  547.  
  548.         fclose(fp);
  549.         exit(0);
  550. }
  551.  
  552. coord(x, y)                             /* package coordinates Tek style */
  553. int x, y;
  554. {
  555.         fputc((y / 32) + 32, fp);       /* high y */
  556.         fputc((y % 32) + 96, fp);       /* low y */
  557.         fputc((x / 32) + 32, fp);       /* high x */
  558.         fputc((x % 32) + 64, fp);       /* low x */
  559. }
  560. ---------------------------------
  561. SIXEL PLOTTING
  562.  
  563.         Sixel file cat.six below is from an anonymous source.  It uses only
  564. Sixel commands.  Please edit this file and replace <ESC> with a real escape
  565. code.  Note the presence of CR/LF's in the file; they do adjust the cursor.
  566. Two Sixel commands are present: a short one to set color palettes followed
  567. directly by the main long one.  The picture halts prematurely at the right
  568. margin because it was designed for VT340 terminals which are wider and taller
  569. than IBM PC screens.  View the file via the REPLAY command.
  570.  
  571. Another example file is DEMO.TEK on the MS-DOS Kermit distribution disk.  That
  572. file has mixed Tek drawing and Sixel commands.  WordPerfect Corporation made
  573. DEMO.TEK for MS-DOS Kermit testing and demonstration.
  574.  
  575. File cat.six:
  576.  
  577. <ESC>\<ESC>Pq#0;1;280;35;60#1;10;0;0#2;1;120;50;100#3;1;0;99;0<ESC>\
  578. <ESC>\<ESC>P;1q-----
  579. $#1???!424?!8_-
  580. $#1???!373?owwK{C{C}E}A}AyE}C{C{C{KwGwGwGwK{C{E}A}A}A}A}B~@~@~@~?~?}@~@~@~@~B}A
  581. }EsK{GgWwOoOoOOoo!7_
  582. $#2???!376?_?o?w?w?{?{?w?w?w?w?o?o?o?o?o?o?w?w?{?{?{?{?{?}?}?}?~?}?}?}?}?{?{?w?
  583. o?o?_?_?_?_-
  584. $#1???!368?_owWKNNFCFEBAABB@@BBABABABABEFKNW^O~o~_~?~?~?~?~?~?~?~?~?~?~?~?~?~?~
  585. ?~?~?~?~?~?~?~?~?~?~?~?~?~?~@~@~@]B~A}A}A}E{C{CsK{Gw
  586. GwGwWoOOoo___
  587. $#2???!376?B?@?@!9?@?@?@?@?@?B?F?N?^?^?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?
  588. ~?~?~?~?~?~?~?}?}?}?{?{?{?{?w?w?w?o?o?o?o?_?_
  589. $#3???!371?__oo!4w!16{wwoo!4_-
  590. $#1???!368?FNkww!14?!17_??!6@BBABEFCNKNW^W~w~o~o~o~_~_~_~?~?~?~?~_~_~_~_~_~_~_~
  591. _no~O^O^O^O^O^O^O^WNGNGNGNGNGNGNW^O^O^P\R^QσQYUσSS{{
  592. MFB@BB@@BBAAσ}o
  593. $#2???!416?@?@?B?F?F?F?F?N?N?^?^?^?^?~?~?~?^?^?^?^?^?^?^?^?N?N?N?N?N?N?N?N?F?F?
  594. F?F?F?F?F?F?F?N?M?K?K?K?G?G
  595. $#3???!371?FF!14~!18^!6}!4{!4woo!4_!90?ww!8{__-
  596. $#1???!367?o}^B@?_oOWKKKCEFbppXXH!4G!8?_``ppPPZZIMMEEEM!4EM!5K\^vvbBBAEEC!4t]]!
  597. 4xh!5gww!10OoowG!42?BBAEECKKGGKKCEEBB
  598. $#2???!376?_?o?o?w?K?e?u?v?v?~?~?~?~?σ?M?M?C?C!19?G?╒?{?w?G?G!7?O?O?O!5?_?_?_?_
  599. $#3???!369?__}}NNFF!4B!25?!4_oppxhxp!4xppRrrr__!86?@@!8B@@-
  600. $#1???!346?__ckwoOOO╒╒OOPZ^NMKK╒\NNEFDDKKGG?!7_!4?_ooW╒KEEBB@@@!27?@BFE{{_?F^^N
  601. !5FfbbrrRRZZLMEAABB!5@
  602. $#2???!354?_?_?_?_?_?o?_?_?o?w?q?v?~?^?^?^?^?~?^?N?B?@!37?@?B?w?_?w?w?w?╒?K?K?C
  603. ???@
  604. $#3???!393?__oWw{{}}}!22~}!4~}swG-
  605. $#1???!342?CEFDDDCCCS\LNJz~vfFN^^!4?o{{cEABA?@@@!5?@BBEM^zo!21?KσσK!17?N~w__oo╒
  606. ╒FFPp`?wXHHLLFF!4EAA
  607. $#2???!348?B?B?A!7?W?_?~?f?B?B?@???@!61?F?N?B?_?g?σ?F?E?A
  608. $#3???!372?w{{{!4}!5~}{{w__CN~]!19~r``r!15~{~o-
  609. $#1???!354?AEKσzpb}{{___fNLWoo___??ENNE!4?___oWNN?EEKKGWWoo!6_o!7Oo!4_!9?_ow╒NF
  610. @?@BECEσσ}{LFBA
  611. $#2???!360?K?@?N?@!24?o?w?o?o?_!36?o?}?{?z?`?@?A
  612. $#3???!371?NN^^^~~xoox!4~^^^Nf?o?x@r@vBfNN!6^NnNnNnNnN!4^!9~^NFB-
  613. $#1???!355?_o╒{~vFNZp_!9@BBBEAAEAA@@@?@BBEEkk{{╒MMBB?@@B!7?C!6?@@@B!4@AFBLLww_?
  614. ?CKσua!4B@BA
  615. $#2???!391?@?B?B?@!34?A?F?^?z?`?@
  616. $#3???!362?o?K?}?}?}?}?}?{?x@]@]@}?}?}?{?x?R?B?`?o?{?}?~?~?~?~?~?~?~?}?}?}?}?]?
  617. {?_-
  618. $#1???!354?@@?N^Zro!4?__!24?Kr@!28?oue!5Ccc~~JJJIIIZPRU╒W!6Oo!8_
  619. $#2???!440?@
  620. $#3???!360?C?N?~?^?~?~?~?~?~?~?~?~?~?~?~?~?r?K?~?~?~?~?~?~?~?~?~?~?~?~?~?~?H?z?
  621. z?z?Z-
  622. $#1???!360?brσMMNXWoo{{__?G???G!6?___oo{{v{{ww!4o!6_!4?!5_oo!4OwxNMK╒vf@@
  623. $#3???!364?@?A?F?B?^?^?~?~?~?~?~?^?^?N?B???B?F?N?N?^?^?^?~?^?^?^?N?N?N?E?@?B-
  624. $#1???!352?_oOWKEAB@!8?{~B!5@`brZNnxx@@!4?x!18~]xxp??KK^~]╒scD@!4?@BEKWo_
  625. $#2???!384?E?}?~?~!21?E?M?r?_-
  626. $#1???!343?OWGKCEAB@@!15?MN@!6?AEKWr]]~~!5?^!19~^N~{!4?F~{_@BEKG!8?@@
  627. $#2???!388?~?~!20?_!4?~?~
  628. $#3???!412?_-
  629. $#1???!378?GKEB`o~^!6?!18~{__`BBAAEECDD!11CKK!17GWWOOoo!4_
  630. $#2???!386?_?~?~!20?^?╒?{?w@w@w?w?w?w?w?w?o?o?o?o?o?o?o?o?o?o?_?_
  631. $#3???!412?^?╒?{?w?w?w?w?w?w?w?w?o?o?o?o?o?o?o?o?o?o?_?_-
  632. $#1???!379?cuzx~NB@!5?B!15~rp__!6@BB!5A!36?@@@FFK{w
  633. $#2???!386?}?~?~?{!16?M?σ?}?}?{?{?]?]?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?}?w?o
  634. $#3???!410?M?σ?}?}?{?{?]?]?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?}?w?o-
  635. $#1???!376?CEb`}~RWKC!7?@BFnn!4N^^~!6^NNNffvp^^BBB}}YqaA!6CG!8O!5_!6?!4_owWGGKK
  636. EFB
  637. $#2???!384?r?~?~?~?~?{?O?o?o?_???_?_?_?o?O?G?_?{?{@?@?@?B?B?B?F?N?N?N?N?^?^?~?~
  638. ?~?^?^?F?F?B?@
  639. $#3???!424?@?@?@?B?B?B?F?N?N?N?N?^?^?~?~?~?^?^?F?F?B?@-
  640. $#1???!375?CEz]NF!5?!6_!4?@@@BBAA!5IJB!6@!6?C^~qAEECCKWo_!14?!8@
  641. $#2???!380?o?~?~?^?^?^?^?~?}?}?{?]?t?t?s?}?}?}?~?~?~?z
  642. $#3???!425?KK!4w__-
  643. $#1???!369?wwKKCEEABB!9@??!9@BB!4AEECCCEEAAAEECCEEABB@@!8?@BE}{_
  644. $#2???!402?@?@?@?B?@?@?@?@?B?@
  645. $#3???!371?oo!4w{{!20}!6{!8w{{!6w!4{}}!6~}}ww-
  646. $#1???!369?bfess╒╒GGWWOOOoo!5_!32?___???wwG?_{}E??BBM}w
  647. $#3???!371?@@BBbb!4fnnNN!6^!31~^^^~~~FFv~^B@x~{{oo-
  648. $#1???!367?Gσ^ro!44?AB@???BB???BB@??BB__ow╒EABB
  649. $#3???!371?NN!43~]{}~~~{{~~~{{}~~{╒^NNBB@@-
  650. $#1???!370?@Bb}}uM{GwGwGwGwWoOoOoOoo!8OWW!10GwwwK{C{C{C{C{C{E}BvN\wo___
  651. $#2???!376?o?o?o?o?o?_?_?_?_!25?O?o?w?w?w?w?w?{?o
  652. $#3???!373?!4@BB!8F!8N!8nff!10vFF!12B@@-
  653. $#1???!364?_{{}E}B~@~?~?~?~?~?~?~?~?~?No~^!21?f~{~?~?~?~?~?~?~?~?~?~?~@~B}Mww_
  654. $#2???!368?w?{?{?}?~?~?~?~?~?~?~?~?N!27?~?~?~?~?~?~?~?~?~?~?}?{?o
  655. $#3???!395?!20~WW-
  656. $#1???!362?o}^~?~?~?~?~?~?~?~?~?~?~?~?^_{~F!7?CCM^^MCC!7?F~{~?~?~?~?~?~?~?~?~?~
  657. ?~?~?~?{BF}{
  658. $#2???!366?{?~?~?~?~?~?~?~?~?~?~?~?^!29?~?~?~?~?~?~?~?~?~?~?~?~?~?{
  659. $#3???!393?ww!6~zz!4_zz!6~ww-
  660. $#1???!360?o}^~?~?~?~?~?~?~?~?~?~?~?~?~??~~!24?_~~~?~?~?~?~?~?~?~?~?~?~?~?~?~?w
  661. F~{
  662. $#2???!364?{?~?~?~?~?~?~?~?~?~?~?~?~!31?~?~?~?~?~?~?~?~?~?~?~?~?~?~?w
  663. $#3???!393?!22~^^-
  664. $#1???!360?~~?~?~?~?~?~?~?~?~?~?~?~?~?~??~~!9?__owwo__!7?~~?~?~?~?~?~?~?~?~?~?~
  665. ?~?~?~?~?~?`^~o
  666. $#2???!364?~?~?~?~?~?~?~?~?~?~?~?~?~!31?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?_
  667. $#3???!393?!8~^^!4F^^!6~-
  668. $#1???!360?b~}~?~?~?~?~?~?~?~?~?~?~?~?~?}@~~!10?@BBB!8?{~~?~?~?~?~?~?~?~?~?~?~?
  669. ~?~?~?~?~?~?N~w
  670. $#2???!364?~?~?~?~?~?~?~?~?~?~?~?~?~?}!27?w?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~
  671. $#3???!393?!10~!4{!8~-
  672. $#1???!360?~~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~~!8?__owwo__!6?~~~?~?~?~?~?~?~?~?~?~
  673. ?~?~?~?~?~?~?~?{B~}
  674. $#2???!364?~?~?~?~?~?~?~?~?~?~?~?~?~?~!27?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?~?{
  675. $#3???!393?!8~^^!4F^^!6~-
  676. $#1???!359?{~~_~_~_~_~_~_~_~_~_~_~_~_~_~_~_~~!10_bbb`!8_~~~_~_~_~_~_~_~_~_~_~_~
  677. _~_~_~_~_~_~_~_`~~
  678. $#2???!362?W?^?^?^?^?^?^?^?^?^?^?^?^?^?^!27?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^?^
  679. $#3???!393?!10^!4╒!8^--
  680. $#3???!597?_OKCCc╒??o_?OOo!4?!4Oo??_O!4?_O?_o?OOOo!11?_oGSOOo??_O???_O!21?_okcc
  681. CSK?o_?OOo!5?oO?C!4?!4Oo??_o?OOOo!11?_O?G?CCCK_O???_
  682. O!5?oO?C??_o?OOOo??_o?OOOo-
  683. $#3???!593?CCEDC?A?@?CA@!6?EC!4DB@?E@A?F?A@CA@???CA@!9?CAFCCC?AXOORAICB@!19?CCE
  684. DCC?A@?CA@!6?CCCED!4?EC!4DB@CA@???CA@!11?FCCC@B@?EDC
  685. C?E@??CCCED???CA@???CA@CA@???CA@??CEA-<ESC>\
  686. --------------------- End of file TEKEMU.TXT --------------------------------
  687.