1 /*****************************************************************************
2 ** This is part of the CTSim program
3 ** Copyright (C) 1983-2000 Kevin Rosenberg
5 ** $Id: cio.h,v 1.6 2000/05/08 20:00:47 kevin Exp $
7 ** Revision 1.6 2000/05/08 20:00:47 kevin
10 ** Revision 1.5 2000/05/07 12:46:19 kevin
11 ** made c++ compatible
13 ** Revision 1.4 2000/04/28 18:18:59 kevin
14 ** removed unused files
16 ** Revision 1.3 2000/04/28 14:14:16 kevin
17 ** *** empty log message ***
20 ** This program is free software; you can redistribute it and/or modify
21 ** it under the terms of the GNU General Public License (version 2) as
22 ** published by the Free Software Foundation.
24 ** This program is distributed in the hope that it will be useful,
25 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ** GNU General Public License for more details.
29 ** You should have received a copy of the GNU General Public License
30 ** along with this program; if not, write to the Free Software
31 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 ******************************************************************************/
38 #endif /* __cplusplus */
42 int init; /* True if initialized */
43 int bios_mode; /* Current BIOS crt mode */
44 int text_attr; /* Current text attribute */
45 int act_page; /* Active page */
46 int tcols, trows; /* Maximum text coords */
47 int xmax, ymax; /* Maximum x, y for both text & graphic modes */
48 int cx, cy; /* Current x, y position */
52 extern struct crtv_st crtv;
55 /*----------------------------------------------------------------------*/
60 /*----------------------------------------------------------------------*/
63 #define ATTR_REVERSE 14
64 #define ATTR_HIGHLIGHT 15
66 #define C_BLACK 0 /* color codes */
79 #define C_LTMAGENTA 13
83 /*----------------------------------------------------------------------*/
85 /* screen character codes */
92 #define WAITKEY() {cio_kb_clr(); while (cio_kb_read() == 0);}
95 void crt_center_line(const char *str);
97 void cio_clreol(void);
99 void cio_clrline(unsigned int line);
101 void crt_clrscrn(void);
103 void cio_tab(unsigned int n);
104 void cio__save_cpos(void);
105 void cio__restore_cpos(void);
107 void cio_fill_eol(int c, int attr);
109 void cio_get_state(void);
111 void cio_set_text_clr(int fclr, int bclr);
112 int cio_get_texta(void);
113 void cio_set_texta(int a);
114 int cio_blank_attr(void);
115 void cio_put_ca(int c, int attr);
116 void cio_put_c(int c);
117 void cio_put_cc(int c, int count);
118 void cio_put_cca(int c, int attr, int count);
119 void cio_put_str(const char *str);
120 void cio_put_stra(const char *str, int attr);
121 void cio_inc_col(int count);
122 void cio_dec_col(int count);
123 void cio_dec_row(int count);
125 void cio_set_cpos(int col, int row);
126 void cio_get_cpos(int *col, int *row);
130 int cio_kb_chk(void);
132 void cio_kb_clr(void);
134 unsigned int cio_kb_getc(void);
135 void cio_kb_ungetc(unsigned int c);
137 char *cio_kb_gets(char *str, int maxlen);
139 unsigned int cio_kb_read(void);
140 void cio_kb_unread(unsigned int c);
142 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
144 void cio_tone(double freq, double length);
146 int cio_check_kb_escape(void);
150 #endif /* _cplusplus */