Initial release of Maemo 5 port of gnuplot
[gnuplot] / term / emxvga.trm
1 /* Hello, Emacs, this is -*-C-*-
2  * $Id: emxvga.trm,v 1.15 2006/07/21 02:35:46 sfeam Exp $
3  */
4
5 /* GNUPLOT - emxvga.trm */
6
7 /*[
8  * Copyright 1994, 1998, 2004
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 complete modified source code.  Modifications are to
18  * be distributed as patches to the released version.  Permission to
19  * distribute binaries produced by compiling modified sources is granted,
20  * provided you
21  *   1. distribute the corresponding source modifications from the
22  *    released version in the form of a patch file along with the binaries,
23  *   2. add special version identification to distinguish your version
24  *    in addition to the base release version number,
25  *   3. provide your name and address as the primary contact for the
26  *    support of your modified version, and
27  *   4. retain our contact information in regard to use of the base
28  *    software.
29  * Permission to distribute the released version of the source code along
30  * with corresponding source modifications in the form of a patch file is
31  * granted with same provisions 2 through 4 for binary distributions.
32  *
33  * This software is provided "as is" without express or implied warranty
34  * to the extent permitted by applicable law.
35 ]*/
36
37 /*
38  * This file is included by ../term.c.
39  *
40  * This terminal driver supports:
41  *  SVGA 1024x768x256 for PC's running DOS or OS/2
42  *
43  * AUTHOR
44  *   David J. Liu (liudj0@minerva.cis.yale.edu)
45  */
46 /*
47  * Compile with GCC (emx) with VESA and SVGAKIT maintained by
48  * Johannes Martin (JMARTIN@GOOFY.ZDV.UNI-MAINZ.DE)
49  * with additions by David J. Liu (liudj0@minerva.cis.yale.edu)
50  * supports VESA, Trident, Cirrus, ET4000, WD and S3.
51  */
52 /*
53  * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
54  */
55
56 #include "driver.h"
57
58 #ifdef TERM_REGISTER
59 #ifdef EMXVESA
60 register_term(vesa)
61 #endif /* EMXVESA */
62 register_term(emxvga)
63 #endif
64
65 #ifdef TERM_PROTO
66 TERM_PUBLIC void EMXVGA_init __PROTO((void));
67 TERM_PUBLIC void EMXVGA_reset __PROTO((void));
68 TERM_PUBLIC void EMXVGA_text __PROTO((void));
69 TERM_PUBLIC void EMXVGA_graphics __PROTO((void));
70 TERM_PUBLIC void EMXVGA_linetype __PROTO((int));
71 TERM_PUBLIC void EMXVGA_move __PROTO((unsigned int, unsigned int));
72 TERM_PUBLIC void EMXVGA_vector __PROTO((unsigned int, unsigned int));
73 TERM_PUBLIC int EMXVGA_text_angle __PROTO((int));
74 TERM_PUBLIC void EMXVGA_put_text __PROTO((unsigned int, unsigned int, const char *));
75 #define EMXVGA_VCHAR 8
76 #define EMXVGA_HCHAR 8
77 #define EMXVGA_VTIC 4
78 #define EMXVGA_HTIC 4
79 #define EMXVGA_XMAX 0           /* These two entries are just place holders. */
80 #define EMXVGA_YMAX 0           /* The actual values will be filled in init. */
81 #ifdef EMXVESA
82 TERM_PUBLIC void EMXVESA_options __PROTO((void));
83 TERM_PUBLIC void EMXVESA_init __PROTO((void));
84 TERM_PUBLIC void EMXVESA_graphics __PROTO((void));
85 TERM_PUBLIC void EMXVESA_text __PROTO((void));
86 TERM_PUBLIC void EMXVESA_reset __PROTO((void));
87 #endif
88 #endif /* TERM_PROTO */
89 #ifndef TERM_PROTO_ONLY
90 #ifdef TERM_BODY
91 /* avoid name clash with graph.h - lets hope that no following
92  * driver needs these symbols !
93  */
94 #ifdef RIGHT
95 #undef RIGHT
96 #endif
97 #ifdef DOWN
98 #undef DOWN
99 #endif
100 #include <vesa.h>
101 #include <jmgraph.h>
102 #include <conio.h>              /* for getch()            -SB */
103 #include <stdlib.h>
104 #include <dos.h>
105 /*
106  * Some versions of graph.h (e.g. jmgraph.h) define RIGHT to be 0
107  * colliding with enum JUSTIFY. We don't need this define anyway,
108  * just undef it.                       -SB
109  */
110 #ifdef RIGHT
111 #undef RIGHT
112 #endif
113 #ifdef DOWN
114 #undef DOWN
115 #endif
116 static int EMXVGA_vmode = G640x480x256;         /* default mode */
117 static int vgacolor[] ={ 7, 8, 2, 3, 4, 5, 9, 14, 12, 15, 13, 10, 11, 1, 6 };
118 static int graphics_on = FALSE;
119 int startx, starty, lasty;
120 int EMXVGA_angle, EMXVGA_color;
121 char *EMXVGA_buf;
122
123 void
124 emx_getch()
125 {
126     union REGS reg;
127     char c;
128     if (_osmode == OS2_MODE)
129         VesaGetCharacter(&c);
130     else {
131         reg.x.ax = 0x0000;
132         _int86(0x16, &reg, &reg);
133         if (reg.h.al == 0) {
134             reg.x.ax = 0x0000;
135             _int86(0x16, &reg, &reg);
136         }
137     }
138 }
139
140 /* gstring.c (emx+gcc) -- Copyright (c) 1994 by David J. Liu */
141 unsigned char font[128][8] =
142 {                               /* 8x8 font */
143     {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
144     {0x7E, 0x81, 0xA5, 0x81, 0xBD, 0x99, 0x81, 0x7E},
145     {0x7E, 0xFF, 0xDB, 0xFF, 0xC3, 0xE7, 0xFF, 0x7E},
146     {0x6C, 0xFE, 0xFE, 0xFE, 0x7C, 0x38, 0x10, 0x00},
147     {0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x10, 0x00},
148     {0x38, 0x7C, 0x38, 0xFE, 0xFE, 0x92, 0x10, 0x7C},
149     {0x00, 0x10, 0x38, 0x7C, 0xFE, 0x7C, 0x38, 0x7C},
150     {0x00, 0x00, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00},
151     {0xFF, 0xFF, 0xE7, 0xC3, 0xC3, 0xE7, 0xFF, 0xFF},
152     {0x00, 0x3C, 0x66, 0x42, 0x42, 0x66, 0x3C, 0x00},
153     {0xFF, 0xC3, 0x99, 0xBD, 0xBD, 0x99, 0xC3, 0xFF},
154     {0x0F, 0x07, 0x0F, 0x7D, 0xCC, 0xCC, 0xCC, 0x78},
155     {0x3C, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x7E, 0x18},
156     {0x3F, 0x33, 0x3F, 0x30, 0x30, 0x70, 0xF0, 0xE0},
157     {0x7F, 0x63, 0x7F, 0x63, 0x63, 0x67, 0xE6, 0xC0},
158     {0x99, 0x5A, 0x3C, 0xE7, 0xE7, 0x3C, 0x5A, 0x99},
159     {0x80, 0xE0, 0xF8, 0xFE, 0xF8, 0xE0, 0x80, 0x00},
160     {0x02, 0x0E, 0x3E, 0xFE, 0x3E, 0x0E, 0x02, 0x00},
161     {0x18, 0x3C, 0x7E, 0x18, 0x18, 0x7E, 0x3C, 0x18},
162     {0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00},
163     {0x7F, 0xDB, 0xDB, 0x7B, 0x1B, 0x1B, 0x1B, 0x00},
164     {0x3E, 0x63, 0x38, 0x6C, 0x6C, 0x38, 0x86, 0xFC},
165     {0x00, 0x00, 0x00, 0x00, 0x7E, 0x7E, 0x7E, 0x00},
166     {0x18, 0x3C, 0x7E, 0x18, 0x7E, 0x3C, 0x18, 0xFF},
167     {0x18, 0x3C, 0x7E, 0x18, 0x18, 0x18, 0x18, 0x00},
168     {0x18, 0x18, 0x18, 0x18, 0x7E, 0x3C, 0x18, 0x00},
169     {0x00, 0x18, 0x0C, 0xFE, 0x0C, 0x18, 0x00, 0x00},
170     {0x00, 0x30, 0x60, 0xFE, 0x60, 0x30, 0x00, 0x00},
171     {0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xFE, 0x00, 0x00},
172     {0x00, 0x24, 0x66, 0xFF, 0x66, 0x24, 0x00, 0x00},
173     {0x00, 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x00, 0x00},
174     {0x00, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x00, 0x00},
175     {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
176     {0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00},
177     {0x6C, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00},
178     {0x6C, 0x6C, 0xFE, 0x6C, 0xFE, 0x6C, 0x6C, 0x00},
179     {0x18, 0x7E, 0xC0, 0x7C, 0x06, 0xFC, 0x18, 0x00},
180     {0x00, 0xC6, 0xCC, 0x18, 0x30, 0x66, 0xC6, 0x00},
181     {0x38, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0x76, 0x00},
182     {0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00},
183     {0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00},
184     {0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00},
185     {0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00},
186     {0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00},
187     {0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30},
188     {0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00},
189     {0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00},
190     {0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00},
191     {0x7C, 0xCE, 0xDE, 0xF6, 0xE6, 0xC6, 0x7C, 0x00},
192     {0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xFC, 0x00},
193     {0x78, 0xCC, 0x0C, 0x38, 0x60, 0xCC, 0xFC, 0x00},
194     {0x78, 0xCC, 0x0C, 0x38, 0x0C, 0xCC, 0x78, 0x00},
195     {0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x1E, 0x00},
196     {0xFC, 0xC0, 0xF8, 0x0C, 0x0C, 0xCC, 0x78, 0x00},
197     {0x38, 0x60, 0xC0, 0xF8, 0xCC, 0xCC, 0x78, 0x00},
198     {0xFC, 0xCC, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x00},
199     {0x78, 0xCC, 0xCC, 0x78, 0xCC, 0xCC, 0x78, 0x00},
200     {0x78, 0xCC, 0xCC, 0x7C, 0x0C, 0x18, 0x70, 0x00},
201     {0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00},
202     {0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30},
203     {0x18, 0x30, 0x60, 0xC0, 0x60, 0x30, 0x18, 0x00},
204     {0x00, 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00},
205     {0x60, 0x30, 0x18, 0x0C, 0x18, 0x30, 0x60, 0x00},
206     {0x3C, 0x66, 0x0C, 0x18, 0x18, 0x00, 0x18, 0x00},
207     {0x7C, 0xC6, 0xDE, 0xDE, 0xDC, 0xC0, 0x7C, 0x00},
208     {0x30, 0x78, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0x00},
209     {0xFC, 0x66, 0x66, 0x7C, 0x66, 0x66, 0xFC, 0x00},
210     {0x3C, 0x66, 0xC0, 0xC0, 0xC0, 0x66, 0x3C, 0x00},
211     {0xF8, 0x6C, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00},
212     {0xFE, 0x62, 0x68, 0x78, 0x68, 0x62, 0xFE, 0x00},
213     {0xFE, 0x62, 0x68, 0x78, 0x68, 0x60, 0xF0, 0x00},
214     {0x3C, 0x66, 0xC0, 0xC0, 0xCE, 0x66, 0x3A, 0x00},
215     {0xCC, 0xCC, 0xCC, 0xFC, 0xCC, 0xCC, 0xCC, 0x00},
216     {0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
217     {0x1E, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78, 0x00},
218     {0xE6, 0x66, 0x6C, 0x78, 0x6C, 0x66, 0xE6, 0x00},
219     {0xF0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00},
220     {0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0x00},
221     {0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6, 0xC6, 0x00},
222     {0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00},
223     {0xFC, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00},
224     {0x7C, 0xC6, 0xC6, 0xC6, 0xD6, 0x7C, 0x0E, 0x00},
225     {0xFC, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0xE6, 0x00},
226     {0x7C, 0xC6, 0xE0, 0x78, 0x0E, 0xC6, 0x7C, 0x00},
227     {0xFC, 0xB4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
228     {0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xFC, 0x00},
229     {0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00},
230     {0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00},
231     {0xC6, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0xC6, 0x00},
232     {0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x30, 0x78, 0x00},
233     {0xFE, 0xC6, 0x8C, 0x18, 0x32, 0x66, 0xFE, 0x00},
234     {0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00},
235     {0xC0, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x02, 0x00},
236     {0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00},
237     {0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00},
238     {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF},
239     {0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00},
240     {0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0x76, 0x00},
241     {0xE0, 0x60, 0x60, 0x7C, 0x66, 0x66, 0xDC, 0x00},
242     {0x00, 0x00, 0x78, 0xCC, 0xC0, 0xCC, 0x78, 0x00},
243     {0x1C, 0x0C, 0x0C, 0x7C, 0xCC, 0xCC, 0x76, 0x00},
244     {0x00, 0x00, 0x78, 0xCC, 0xFC, 0xC0, 0x78, 0x00},
245     {0x38, 0x6C, 0x64, 0xF0, 0x60, 0x60, 0xF0, 0x00},
246     {0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8},
247     {0xE0, 0x60, 0x6C, 0x76, 0x66, 0x66, 0xE6, 0x00},
248     {0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00},
249     {0x0C, 0x00, 0x1C, 0x0C, 0x0C, 0xCC, 0xCC, 0x78},
250     {0xE0, 0x60, 0x66, 0x6C, 0x78, 0x6C, 0xE6, 0x00},
251     {0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00},
252     {0x00, 0x00, 0xCC, 0xFE, 0xFE, 0xD6, 0xD6, 0x00},
253     {0x00, 0x00, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0x00},
254     {0x00, 0x00, 0x78, 0xCC, 0xCC, 0xCC, 0x78, 0x00},
255     {0x00, 0x00, 0xDC, 0x66, 0x66, 0x7C, 0x60, 0xF0},
256     {0x00, 0x00, 0x76, 0xCC, 0xCC, 0x7C, 0x0C, 0x1E},
257     {0x00, 0x00, 0xDC, 0x76, 0x62, 0x60, 0xF0, 0x00},
258     {0x00, 0x00, 0x7C, 0xC0, 0x70, 0x1C, 0xF8, 0x00},
259     {0x10, 0x30, 0xFC, 0x30, 0x30, 0x34, 0x18, 0x00},
260     {0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00},
261     {0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x78, 0x30, 0x00},
262     {0x00, 0x00, 0xC6, 0xC6, 0xD6, 0xFE, 0x6C, 0x00},
263     {0x00, 0x00, 0xC6, 0x6C, 0x38, 0x6C, 0xC6, 0x00},
264     {0x00, 0x00, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xF8},
265     {0x00, 0x00, 0xFC, 0x98, 0x30, 0x64, 0xFC, 0x00},
266     {0x1C, 0x30, 0x30, 0xE0, 0x30, 0x30, 0x1C, 0x00},
267     {0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00},
268     {0xE0, 0x30, 0x30, 0x1C, 0x30, 0x30, 0xE0, 0x00},
269     {0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
270     {0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0x00}
271 };
272
273 void g_set(int x, int y, int color);    /* part of SVGA */
274
275 void
276 g_string(int x0, int y0, int color, int angle, char *s)
277 {
278     int i, j, k;
279     float sa, ca, x, y;
280     k = 0;
281     x = 0.5 + x0;
282     y = 0.5 + y0;
283     sa = sin(- DEG2RAD * angle);
284     ca = cos(DEG2RAD * angle);
285     while (s[k]) {
286         for (i = 0; i < 8; i++)
287             for (j = 0; j < 8; j++)
288                 g_set(x + ca * j - sa * i, y + ca * i + sa * j, (font[(int) s[k]][i] & (1 << (7 - j))) ? color : 0);
289         k++;
290         x += ca * 8;
291         y += sa * 8;
292     }
293 }
294
295 /* end of gstring.c */
296
297 TERM_PUBLIC void
298 EMXVGA_init()
299 {
300     if (!g_mode(EMXVGA_vmode)) {
301         fputs("Unable to initiate graphics.\n", stderr);
302         return;
303     }
304     term->xmax = g_xsize;
305     term->ymax = g_ysize;
306     lasty = g_ysize - 1;
307 }
308
309 TERM_PUBLIC void
310 EMXVGA_reset()
311 {
312     g_mode(GTEXT);
313     graphics_on = FALSE;
314 }
315
316 TERM_PUBLIC void
317 EMXVGA_text()
318 {
319     if (graphics_on) {
320         emx_getch();
321         g_mode(GTEXT);
322         graphics_on = FALSE;
323     }
324 }
325
326 TERM_PUBLIC void
327 EMXVGA_graphics()
328 {
329     if (!graphics_on) {
330         g_mode(EMXVGA_vmode);
331         graphics_on = TRUE;
332     }
333 }
334
335 TERM_PUBLIC void
336 EMXVGA_linetype(int linetype)
337 {
338     EMXVGA_color = vgacolor[(linetype % 13) + 2];
339 }
340
341 TERM_PUBLIC void
342 EMXVGA_move(unsigned int x, unsigned int y)
343 {
344     startx = x;
345     starty = y;
346 }
347
348 TERM_PUBLIC void
349 EMXVGA_vector(unsigned int x, unsigned int y)
350 {
351     g_line(startx, lasty - starty, x, lasty - y, EMXVGA_color);
352     startx = x;
353     starty = y;
354 }
355
356 TERM_PUBLIC int
357 EMXVGA_text_angle(int ang)
358 {
359     EMXVGA_angle = (ang ? 90 : 0);
360     return (TRUE);
361 }
362
363 TERM_PUBLIC void
364 EMXVGA_put_text(unsigned int x, unsigned int y, const char *str)
365 {
366     g_string(x, lasty - y - 3, EMXVGA_color, EMXVGA_angle, str);
367 }
368
369 TERM_PUBLIC void
370 EMXVGA_suspend()
371 {
372     if (EMXVGA_buf)
373         free(EMXVGA_buf);       /* do this just for safety */
374     EMXVGA_buf = (char *) malloc(g_memsize);
375     g_save(EMXVGA_buf);
376     emx_getch();
377     g_mode(GTEXT);
378 }
379
380 TERM_PUBLIC void
381 EMXVGA_resume()
382 {
383     g_mode(EMXVGA_vmode);
384     g_restore(EMXVGA_buf);
385     free(EMXVGA_buf);
386 }
387
388 #ifdef EMXVESA
389 int emx_vesamode = G640x480x256;
390 int emx_xlast, emx_ylast;
391 TERM_PUBLIC void
392 EMXVESA_options()
393 {
394     if (!END_OF_COMMAND) {
395         if (almost_equals(c_token, "d$efault")) {
396             emx_vesamode = G640x480x256;
397             c_token++;
398         }
399     }
400     if (!END_OF_COMMAND) {
401         /* We have a vesa mode specified */
402         struct value a;
403         emx_vesamode = (int) real(const_express(&a));
404     }
405     sprintf(term_options, "%d", emx_vesamode);
406 }
407
408 TERM_PUBLIC void
409 EMXVESA_init()
410 {
411     if (!g_mode(emx_vesamode))
412         int_error(NO_CARET, "Couldn't select graphics mode");
413     emx_xlast = g_xsize - 1;
414     term->xmax = emx_xlast + 1;
415     emx_ylast = g_ysize - 1;
416     term->ymax = emx_ylast + 1;
417     g_mode(GTEXT);
418 }
419
420 TERM_PUBLIC void
421 EMXVESA_graphics()
422 {
423     g_mode(emx_vesamode);
424 }
425
426 TERM_PUBLIC void
427 EMXVESA_text()
428 {
429     int ch;
430     ch = getch();
431     g_mode(GTEXT);
432     if (ch == 3)
433         int_error(NO_CARET, "Interrupt");
434 }
435
436 TERM_PUBLIC void
437 EMXVESA_reset()
438 {
439 }
440
441 #endif /* VESA */
442 #endif /* TERM_BODY */
443
444 #ifdef TERM_TABLE
445 #ifdef EMXVESA
446 TERM_TABLE_START(vesa_driver)
447     "vesa", "IBM PC/Clone with VESA SVGA graphics board [vesa mode]",
448     EMXVGA_XMAX, EMXVGA_YMAX, EMXVGA_VCHAR, EMXVGA_HCHAR,
449     EMXVGA_VTIC, EMXVGA_HTIC, EMXVESA_options, EMXVESA_init, EMXVESA_reset,
450     EMXVESA_text, null_scale, EMXVESA_graphics, EMXVGA_move, EMXVGA_vector,
451     EMXVGA_linetype, EMXVGA_put_text, EMXVGA_text_angle,
452     null_justify_text, do_point, do_arrow, set_font_null
453 TERM_TABLE_END(vesa_driver)
454
455 #undef LAST_TERM
456 #define LAST_TERM vesa_driver
457
458 #endif /* VESA */
459
460 TERM_TABLE_START(emxvga_driver)
461     "emxvga", "PC with VGA running DOS or OS/2",
462     EMXVGA_XMAX, EMXVGA_YMAX, EMXVGA_VCHAR, EMXVGA_HCHAR,
463     EMXVGA_VTIC, EMXVGA_HTIC, options_null, EMXVGA_init, EMXVGA_reset,
464     EMXVGA_text, null_scale, EMXVGA_graphics, EMXVGA_move,
465     EMXVGA_vector, EMXVGA_linetype, EMXVGA_put_text, EMXVGA_text_angle,
466     null_justify_text, do_point, do_arrow, set_font_null,
467     0,                          /* pointsize */
468     TERM_CAN_MULTIPLOT, EMXVGA_suspend, EMXVGA_resume
469 TERM_TABLE_END(emxvga_driver)
470
471 #undef LAST_TERM
472 #define LAST_TERM emxvga_driver
473
474 #endif /* TERM_TABLE */
475 #endif /* TERM_PROTO_ONLY */
476 #ifdef TERM_HELP
477 START_HELP(emxvga)
478 "1 emxvga",
479 "?commands set terminal emxvga",
480 "?set terminal emxvga",
481 "?set term emxvga",
482 "?terminal emxvga",
483 "?term emxvga",
484 "?emxvga",
485 "?commands set terminal emxvesa",
486 "?set terminal emxvesa",
487 "?set term emxvesa",
488 "?terminal emxvesa",
489 "?term emxvesa",
490 "?emxvesa",
491 "?commands set terminal vgal",
492 "?set terminal vgal",
493 "?set term vgal",
494 "?terminal vgal",
495 "?term vgal",
496 "?vgal",
497 " The `emxvga`, `emxvesa` and `vgal` terminal drivers support PCs with SVGA,",
498 " vesa SVGA and VGA graphics boards, respectively.  They are intended to be",
499 " compiled with \"emx-gcc\" under either DOS or OS/2.  They also need VESA and",
500 " SVGAKIT maintained by Johannes Martin (JMARTIN@GOOFY.ZDV.UNI-MAINZ.DE) with",
501 " additions by David J. Liu (liu@phri.nyu.edu).",
502 "",
503 " Syntax:",
504 "       set terminal emxvga",
505 "       set terminal emxvesa {vesa-mode}",
506 "       set terminal vgal",
507 "",
508 " The only option is the vesa mode for `emxvesa`, which defaults to G640x480x256."
509 END_HELP(emxvga)
510 #endif /* TERM_HELP */