home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource3 / 136_01 / terminal.doc < prev    next >
Encoding:
Text File  |  1979-12-31  |  9.5 KB  |  241 lines

  1.  
  2. /*    HEADER:  CUG136.16;
  3.     TITLE:        TERMINAL;
  4.     DATE:        7/1/86;
  5.     DESCRIPTION:    "Terminal installation program documentation";
  6.     SYSTEM:        CP/M;
  7.     FILENAME:    TERMINAL.DOC;
  8.     AUTHORS:    R. Rodman;
  9. */
  10.  
  11.  
  12. This disk contains games
  13. and  a  (quasi-)universal  terminal  definition  system.   Before 
  14.  
  15. running  any of the other programs,  run TERMINAL to  create  the 
  16.  
  17. file   TERMINAL.
  18.  Other   terminal  configuration   methods 
  19.  
  20. described  in  your  newsletter  don't  allow  for  object   code 
  21.  
  22. portability,  whereas  this  one does and has been used with  not 
  23.  
  24. only C but also BASIC,  Pascal and assembler. The games were fun 
  25.  
  26. projects of mine and I've decided to put them all into the public 
  27.  
  28. domain.  I only learned C recently,  so two were converted  from 
  29.  
  30. Basic,  the  other from assembler (Don't criticize my C too much! 
  31.  
  32. Give  me  a  chance!).   They  are  written  in  C/80  (Software 
  33.  
  34. Toolworks),  which  means they should be easily portable  to  any 
  35.  
  36. Unix-compatible C.
  37.  
  38. Here is a listing of the files on the disk:
  39.  
  40. DUMPSTAR.C, .SUB, .COM -  Dump Star video game
  41. TZ.C, .R, .COM, .DOC -  Twilight Zone adventure game
  42.  
  43.   NO FAIR READING TZ.R! (Maybe we ought to squeeze it?)
  44.  
  45. CMAZE.C, .SUB, .COM -     Perspective maze game
  46.    (Careful - doesn't use TERMINAL.SYS; also does direct
  47.    port I/O to an AY-3-9513 Cricket at ports B0,B1 hex)
  48. TERMINAL.C, .COM, .DOC -   Terminal configuration program
  49. RDTERM.C, .COM -       Check your terminal configuration
  50. RANDOM.C -          Random function for C/80
  51. PORTIO.C -          I/O port access for C/80
  52. CUG.LTR -           this letter
  53.  
  54. Someone can probably improve upon my random number generator. It 
  55.  
  56. is  pretty crude.  If anyone installs any terminals beyond  what 
  57.  
  58. TERMINAL  supports,  I'd like to get a copy of the new values  so 
  59.  
  60. that the program can be enhanced.
  61. .pa
  62.  
  63. Other projects I have underway are a 68000 cross-assembler and an 
  64.  
  65. operating system. Once the cross-assembler is complete I want to 
  66.  
  67. make  a  small-C for the 68000 which will then be used  with  the 
  68.  
  69. operating  system  as  well as  other  projects.  Currently  the 
  70.  
  71. operating system is in Z80 assembler.  When this is finished  it 
  72.  
  73. will  all become public domain.  If anyone is working on similar 
  74.  
  75. projects, I'd sure like to get in touch with them.
  76.  
  77. Have fun and ... C you later!
  78.  
  79.                   Richard Rodman
  80.                   6607 Mayfair Drive #302
  81.                   Falls Church VA 22042
  82.                   (703) 241-1681
  83. .FOThird Planet Productions, P.O. Box 3268, McLean VA 22103
  84.  
  85. HOW TO CONFIGURE OUR PROGRAMS
  86. FOR YOUR SYSTEM -
  87.  
  88. All  Third Planet Productions programs are configured by means of 
  89.  
  90. a universal Terminal File. This file is read by programs written 
  91.  
  92. in BASIC,  PASCAL and assembler,  and will be used in all  future 
  93.  
  94. TPP  software  releases as well.  The programmers out there  are 
  95.  
  96. encouraged to use it as well.
  97.  
  98. The first step in configuring the program is to find out
  99. WHAT KIND OF TERMINAL YOU HAVE.
  100. If you have a Televideo 950, STOP! That's the default.
  101.  
  102. There  is  a library of terminal configurations which comes  with 
  103.  
  104. the program (TERMINAL.LIC).  Your terminal/computer might be  in 
  105.  
  106. the library already. 
  107. The configurations currently supported are:
  108.  
  109.    TeleVideo 920   TeleVideo 950   Visual 200   Heath H19
  110.    Osborne I     ANSI Standard   MAX-80     Hazeltine
  111.    Perkin-Elmer Fox DEC VT-52
  112.  
  113. If  the configuration you need is not in the  library,  you  will 
  114.  
  115. need  to  get  your  terminal manual and  look  up  your  control 
  116.  
  117. sequences.  Some  of  the terminals included in the library  are 
  118.  
  119. listed here a little later.  Backed up by this,  you're ready to 
  120.  
  121. bring up the TERMINAL program (TERMINAL.COM).   This is done  as 
  122.  
  123. follows:
  124.  
  125. A>TERMINAL (Double width shows what you type in)
  126.  
  127. Which console do you wish to configure? In a single-user system, 
  128.  
  129. it's always console 0 (zero). In multi-user MP/M configurations, 
  130.  
  131. each console may be a different terminal type.
  132.  
  133. If you can use one of the configurations supplied in the  library 
  134.  
  135. then use the R option in the program. When you select R you will 
  136.  
  137. be asked if you wish to configure for a variety of terminals. If 
  138.  
  139. you  don't  wish  to  use a particular  configuration  answer  N; 
  140.  
  141. otherwise  answer  Y  and the program will be set  to  use  that 
  142.  
  143. terminal/computer.  It's that simple!
  144.  
  145. If  there  isn't  an entry in the library that  applies  to  your 
  146.  
  147. machine  then  you  will  need to  use  the  C  option.  Control 
  148.  
  149. characters  should  be  entered as a ^ (caret)  followed  by  the 
  150.  
  151. upper-case letter.  For example,  control-R would be entered  as 
  152.  
  153. ^R. In particular, the escape code (ESC) would be entered as ^[. 
  154.  
  155. The Home command for a Televideo would be entered as ^^.
  156.  
  157. Few  of the programs use all of the various entries in the  file. 
  158.  
  159. Most   will  operate  with  just  the  Clear  Screen  and  Cursor 
  160.  
  161. Addressing parameters.
  162. .pa
  163.  
  164. After  you enter your codes you might want to enter them into the 
  165.  
  166. library for future use. You can do this with the A option. (You 
  167.  
  168. might want to test your configuration before putting it into  the 
  169.  
  170. library.  If  so,then you can test it using the method explained 
  171.  
  172. in  the next paragraph.  Then you can reenter TERMINAL  and  add 
  173.  
  174. your settings to the library.) 
  175.  
  176. You can test how well your terminal is configured by running  the 
  177.  
  178. RDTERM program:
  179.  
  180. A>RDTERM
  181.  
  182. The various messages printed test what they say they are testing.
  183. (Honest!)
  184.  
  185. If  you are unable to decipher your terminal manual,  please feel 
  186.  
  187. free  to  write us.  In fact,  when you order  programs  in  the 
  188.  
  189. future, mention the type of terminal you have, and we may be able 
  190.  
  191. to  pass along some information on how to configure it better for 
  192.  
  193. our  software.  Also if you have a configuration that we do  not 
  194.  
  195. support,  we  would appreciate hearing from you:  either  in  the 
  196.  
  197. questionaire, your next order or in a separate note.)
  198. .PA
  199.  
  200.  
  201.       TERMINAL FILE FORMAT
  202.  
  203. This  document describes the file format of the standard terminal 
  204.  
  205. definition  file.  This  file is generated by a  program  called 
  206.  
  207. TERMINAL.COM and is named TERMINAL.SYS.
  208.  
  209. The  file has a record length of 128 characters,  divided into 16 
  210.  
  211. 8-byte  fields.  There  is  one record for each console  in  the 
  212.  
  213. system. Each field consists of a 0 to 7 ASCII characters, padded 
  214.  
  215. with  at  least one null.  If the function is  unavailable,  the 
  216.  
  217. first byte should be a null.
  218.  
  219. In most cases,  the entire field can be printed.  In the case of 
  220.  
  221. cursor  addressing,  this is not advisable.  The following BASIC 
  222.  
  223. function can be used to truncate the field string:
  224.  
  225. DEF FNS$(O$)=LEFT$(O$,INSTR(O$,CHR$(0))-1)
  226.  
  227. Field  Mnemonic  Description
  228.  
  229.  1         Miscellaneous parameters:
  230.      WIDTH      1 Screen width in columns (1 byte)
  231.      HEIGHT      2 Screen height in lines (1 byte)
  232.      DEFINT      3 Default intensity: 'L'=Low 'H'=High
  233.      USELST      4 Use last: 'Y'=Can print in last position
  234.                without scrolling
  235.           Cursor addressing parameters:
  236.      SNDFST      5 Send first: 'Y' or 'X'
  237.      METHOD      6 Method: '0'=Binary
  238.                '1'=ASCII-Decimal, req'd no. of chars
  239.                '2'=ASCII-Decimal, 2 characters
  240.                '3'=ASCII-Decimal, 3 characters
  241.      XADD       7 X addend
  242.      YADD       8 Y addend
  243.  
  244.  2   INISTR   Initialization string
  245.              (put terminal into ANSI mode, etc.)
  246.  3   CLRSCN   Clear Screen
  247.  4   CLREOS   Clear to end of screen
  248.  5   CLREOL   Clear to end of line
  249.  6   CUROFF   Turn cursor off
  250.  7   CURON   Turn cursor on
  251.  8   CURBEG   Cursor addressing - Lead-in
  252.  9   CURMID   Cursor addressing - between X and Y
  253.  10   CUREND   Cursor addressing - Trailer
  254.  11   HIINT   Begin High intensity
  255.  12   LOINT   Begin Low intensity
  256.  13   REVVID   Begin Reverse video
  257.  14   NORVID   End Reverse Video
  258.  15   INSLIN   Insert Line
  259.  16   DELLIN   Delete Line
  260. .pa
  261.  
  262.  
  263.            Some Typical Terminals
  264.  
  265. The following are some of the settings for the terminals that are 
  266.  
  267. in  the  terminal library.  When entering your  own  codes,  the 
  268.  
  269. character  ^  (caret) followed by an  upper-case  character  will 
  270.  
  271. cause  the corresponding control character to be entered into the 
  272.  
  273. file.  Control characters should not be entered directly.  Note 
  274.  
  275. that TERMINAL will also display the functions in this format  for 
  276.  
  277. verification by the user.
  278.  
  279.        Televideo    Visual   Heath   ANSI
  280.      TVI920  TVI950   200    H19   Std.
  281.      ------  ------  ------  -------  ------
  282. WIDTH    80    80    80     80    any
  283. HEIGHT   24    24    24     24    any
  284. DEFINT    H     H     H     H    H
  285. USELST    N     N     N     N    N
  286. SNDFST    Y     Y     Y     Y    Y
  287. METHOD    0     0     0     0    1
  288. XADD    32    32    32     32    0
  289. YADD    32    32    32     32    0
  290. INISTR
  291. CLRSCN   ^Z    ^Z    ^[v    ^[E   ^[[2J
  292. CLREOS   ^[Y    ^[Y    ^[y    ^[J   ^[[0J
  293. CLREOL   ^[T    ^[T    ^[x    ^[K   ^[[0K
  294. CUROFF        ^[.0         ^[x5   ^[[5h
  295. CURON        ^[.2         ^[y5   ^[[5l
  296. CURBEG   ^[=    ^[=    ^[Y    ^[Y   ^[[
  297. CURMID                        ;
  298. CUREND                        H
  299. HIINT   ^[(    ^[(    ^[3         ^[[2m
  300. LOINT   ^[)    ^[)    ^[4         ^[[0m
  301. REVVID   ^[j    ^[G4   ^[s    ^[p   ^[[7m
  302. NORVID   ^[k    ^[G0   ^[k    ^[q   ^[[0m
  303. INSLIN   ^[E    ^[E    ^[L    ^[L   ^[[1L
  304. DELLIN   ^[R    ^[R    ^[M    ^[M   ^[[1M
  305.  
  306. NOTES:
  307.  
  308. The  character  at  the end of the ANSI sequence for CURON  is  a 
  309.  
  310. small letter L.
  311.  
  312. INISTR is not shown.  To use a Heath H-19 in ANSI mode,  install 
  313.  
  314. as ANSI,  but use ^[< for INISTR.  HIINT and LOINT will not have 
  315.  
  316. any visible effect on an H-19.
  317.  
  318.  
  319.