1 /*****************************************************************************
2 ** This is part of the CTSim program
3 ** Copyright (C) 1983-2000 Kevin Rosenberg
5 ** $Id: cio.h,v 1.4 2000/04/28 18:18:59 kevin Exp $
7 ** Revision 1.4 2000/04/28 18:18:59 kevin
8 ** removed unused files
10 ** Revision 1.3 2000/04/28 14:14:16 kevin
11 ** *** empty log message ***
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
31 int init; /* True if initialized */
32 int bios_mode; /* Current BIOS crt mode */
33 int text_attr; /* Current text attribute */
34 int act_page; /* Active page */
35 int tcols, trows; /* Maximum text coords */
36 int xmax, ymax; /* Maximum x, y for both text & graphic modes */
37 int cx, cy; /* Current x, y position */
41 extern struct crtv_st crtv;
44 /*----------------------------------------------------------------------*/
51 #define GM_TEXT40 1 /* color */
52 #define GM_TEXT80 3 /* color */
53 #define GM_320x200 4 /* color */
56 #define GM_E320x200 13
57 #define GM_E640x200 14
59 #define GM_ENHANCED 16
61 #define GM_640x480x16 0x12
62 #define GM_640x480x256 0x2E
63 #define GM_1024x768x16 0x37
64 #define GM_1024x768x256 0x38
75 #define CRT_ENHANCED 2
77 /*----------------------------------------------------------------------*/
80 #define ATTR_REVERSE 14
81 #define ATTR_HIGHLIGHT 15
83 #define C_BLACK 0 /* color codes */
96 #define C_LTMAGENTA 13
100 /*----------------------------------------------------------------------*/
102 /* screen character codes */
108 #define SC_TOP_LEFT 218
109 #define SC_TOP_RIGHT 191
110 #define SC_BOTT_LEFT 192
111 #define SC_BOTT_RIGHT 217
113 #define SC_VERTICAL 179
116 #define WAITKEY() {cio_kb_clr(); while (cio_kb_read() == 0);}
119 int crt_save(const char *fname);
121 void crt_center_line(const char *str);
123 void crt_clreol(void);
125 void crt_clrline(unsigned int line);
127 void crt_clrscrn(void);
129 void crt_tab(unsigned int n);
130 void crt_save_cpos(void);
131 void crt_restore_cpos(void);
133 void crt_fill_eol(int c, int attr);
135 void crt_get_state(void);
137 void crt_set_text_clr(int fclr, int bclr);
138 int crt_get_texta(void);
139 void crt_set_texta(int a);
140 int crt_blank_attr(void);
141 void crt_put_ca(int c, int attr);
142 void crt_put_c(int c);
143 void crt_put_cc(int c, int count);
144 void crt_put_cca(int c, int attr, int count);
145 void crt_put_str(const char *str);
146 void crt_put_stra(const char *str, int attr);
147 void crt_inc_col(int count);
148 void crt_dec_col(int count);
149 void crt_dec_row(int count);
151 void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
153 void crt_set_cpos(int col, int row);
154 void crt_get_cpos(int *col, int *row);
158 int cio_kb_chk(void);
160 void cio_kb_clr(void);
162 unsigned int cio_kb_getc(void);
163 void cio_kb_ungetc(unsigned int c);
165 char *cio_kb_gets(char *str, int maxlen);
167 unsigned int cio_kb_read(void);
168 void cio_kb_unread(unsigned int c);
170 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
172 void cio_tone(double freq, double length);
174 int cio_check_kb_escape(void);