1 /*****************************************************************************
2 ** This is part of the CTSim program
3 ** Copyright (C) 1983-2000 Kevin Rosenberg
5 ** $Id: cio.h,v 1.5 2000/05/07 12:46:19 kevin Exp $
7 ** Revision 1.5 2000/05/07 12:46:19 kevin
10 ** Revision 1.4 2000/04/28 18:18:59 kevin
11 ** removed unused files
13 ** Revision 1.3 2000/04/28 14:14:16 kevin
14 ** *** empty log message ***
17 ** This program is free software; you can redistribute it and/or modify
18 ** it under the terms of the GNU General Public License (version 2) as
19 ** published by the Free Software Foundation.
21 ** This program is distributed in the hope that it will be useful,
22 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ** GNU General Public License for more details.
26 ** You should have received a copy of the GNU General Public License
27 ** along with this program; if not, write to the Free Software
28 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 ******************************************************************************/
35 #endif /* __cplusplus */
39 int init; /* True if initialized */
40 int bios_mode; /* Current BIOS crt mode */
41 int text_attr; /* Current text attribute */
42 int act_page; /* Active page */
43 int tcols, trows; /* Maximum text coords */
44 int xmax, ymax; /* Maximum x, y for both text & graphic modes */
45 int cx, cy; /* Current x, y position */
49 extern struct crtv_st crtv;
52 /*----------------------------------------------------------------------*/
57 /*----------------------------------------------------------------------*/
60 #define ATTR_REVERSE 14
61 #define ATTR_HIGHLIGHT 15
63 #define C_BLACK 0 /* color codes */
76 #define C_LTMAGENTA 13
80 /*----------------------------------------------------------------------*/
82 /* screen character codes */
89 #define WAITKEY() {cio_kb_clr(); while (cio_kb_read() == 0);}
92 int crt_save(const char *fname);
94 void crt_center_line(const char *str);
96 void crt_clreol(void);
98 void crt_clrline(unsigned int line);
100 void crt_clrscrn(void);
102 void crt_tab(unsigned int n);
103 void crt_save_cpos(void);
104 void crt_restore_cpos(void);
106 void crt_fill_eol(int c, int attr);
108 void crt_get_state(void);
110 void crt_set_text_clr(int fclr, int bclr);
111 int crt_get_texta(void);
112 void crt_set_texta(int a);
113 int crt_blank_attr(void);
114 void crt_put_ca(int c, int attr);
115 void crt_put_c(int c);
116 void crt_put_cc(int c, int count);
117 void crt_put_cca(int c, int attr, int count);
118 void crt_put_str(const char *str);
119 void crt_put_stra(const char *str, int attr);
120 void crt_inc_col(int count);
121 void crt_dec_col(int count);
122 void crt_dec_row(int count);
124 void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
126 void crt_set_cpos(int col, int row);
127 void crt_get_cpos(int *col, int *row);
131 int cio_kb_chk(void);
133 void cio_kb_clr(void);
135 unsigned int cio_kb_getc(void);
136 void cio_kb_ungetc(unsigned int c);
138 char *cio_kb_gets(char *str, int maxlen);
140 unsigned int cio_kb_read(void);
141 void cio_kb_unread(unsigned int c);
143 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
145 void cio_tone(double freq, double length);
147 int cio_check_kb_escape(void);
151 #endif /* __cplusplus */