home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msvibm.tek < prev    next >
Text File  |  2020-01-01  |  36KB  |  718 lines

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