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