home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / GPT34SRC / TERM / V384.TRM < prev    next >
Text File  |  1993-05-11  |  3KB  |  131 lines

  1. /*
  2.  * $Id: v384.trm 3.38.2.42 1993/01/07 17:23:59 woo Exp woo $
  3.  *
  4.  */
  5.  
  6. /* GNUPLOT - v384.trm */
  7. /*
  8.  * Copyright (C) 1990 - 1993   
  9.  *
  10.  * Permission to use, copy, and distribute this software and its
  11.  * documentation for any purpose with or without fee is hereby granted, 
  12.  * provided that the above copyright notice appear in all copies and 
  13.  * that both that copyright notice and this permission notice appear 
  14.  * in supporting documentation.
  15.  *
  16.  * Permission to modify the software is granted, but not the right to
  17.  * distribute the modified code.  Modifications are to be distributed 
  18.  * as patches to released version.
  19.  *  
  20.  * This software  is provided "as is" without express or implied warranty.
  21.  * 
  22.  * This file is included by ../term.c.
  23.  *
  24.  * This terminal driver supports:
  25.  *  Vectrix 384 - works with tandy color printer as well
  26.  *
  27.  * AUTHORS
  28.  *   roland@moncskermit.OZ (Roland Yap) 
  29.  * 
  30.  * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
  31.  * 
  32.  */
  33.  
  34. /*
  35.  *    Vectrix 384 driver - works with tandy color printer as well
  36.  *  in reverse printing 8 color mode.
  37.  *  This doesn't work on Vectrix 128 because it redefines the
  38.  *  color table. It can be hacked to work on the 128 by changing
  39.  *  the colours but then it will probably not print best. The color
  40.  *  table is purposely designed so that it will print well
  41.  *
  42.  */
  43.  
  44. #define V384_XMAX 630
  45. #define V384_YMAX 480
  46.  
  47. #define V384_XLAST (V384_XMAX - 1)
  48. #define V384_YLAST (V384_YMAX - 1)
  49.  
  50. #define V384_VCHAR    12
  51. #define V384_HCHAR    7
  52. #define V384_VTIC    8
  53. #define V384_HTIC    7
  54.  
  55.  
  56. V384_init()
  57. {
  58.     fprintf(outfile,"%c%c  G0   \n",27,18);
  59.     fprintf(outfile,"Q 0 8\n");
  60.     fprintf(outfile,"0 0 0\n");
  61.     fprintf(outfile,"255 0 0\n");
  62.     fprintf(outfile,"0 255 0\n");
  63.     fprintf(outfile,"0 0 255\n");
  64.     fprintf(outfile,"0 255 255\n");
  65.     fprintf(outfile,"255 0 255\n");
  66.     fprintf(outfile,"255 255 0\n");
  67.     fprintf(outfile,"255 255 255\n");
  68. }
  69.  
  70.  
  71. V384_graphics()
  72. {
  73.     fprintf(outfile,"%c%c E0 RE N 65535\n",27,18);
  74. }
  75.  
  76.  
  77. V384_text()
  78. {
  79.     fprintf(outfile,"%c%c\n",27,17);
  80. }
  81.  
  82.  
  83. V384_linetype(linetype)
  84. int linetype;
  85. {
  86. static int color[]= {
  87.         1 /* red */,
  88.         2 /* green */,
  89.         3 /* blue */,
  90.         4 /* cyan */,
  91.         5 /* magenta */,
  92.         6 /* yellow */, /* not a good color so not in use at the moment */
  93.         7 /* white */
  94.     };
  95.         
  96.     if (linetype < 0)
  97.         linetype=6;
  98.     else
  99.         linetype %= 5;
  100.     fprintf(outfile,"C %d\n",color[linetype]);
  101. }
  102.  
  103.  
  104. V384_move(x,y)
  105. unsigned int x,y;
  106. {
  107.     fprintf(outfile,"M %d %d\n",x+20,y);
  108. }
  109.  
  110.  
  111. V384_vector(x,y)
  112. unsigned int x,y;
  113. {
  114.     fprintf(outfile,"L %d %d\n",x+20,y);
  115. }
  116.  
  117.  
  118. V384_put_text (x, y, str)
  119. unsigned int x, y;
  120. char str[];
  121. {
  122.     V384_move (x, y + V384_VCHAR/2);
  123.     fprintf (outfile, "$%s\n", str);
  124. }
  125.  
  126.  
  127. V384_reset()
  128. {
  129. }
  130.  
  131.