r10: removed unused files
[ctsim.git] / include / cio.h
1 /*****************************************************************************
2 **  This is part of the CTSim program
3 **  Copyright (C) 1983-2000 Kevin Rosenberg
4 **
5 **  $Id: cio.h,v 1.4 2000/04/28 18:18:59 kevin Exp $
6 **  $Log: cio.h,v $
7 **  Revision 1.4  2000/04/28 18:18:59  kevin
8 **  removed unused files
9 **
10 **  Revision 1.3  2000/04/28 14:14:16  kevin
11 **  *** empty log message ***
12 **
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27 #ifndef __CIO_H
28 #define __CIO_H
29
30 struct crtv_st {
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 */
38 }; 
39
40 #ifndef DEFINE_CRTV
41    extern struct crtv_st crtv;
42 #endif
43
44 /*----------------------------------------------------------------------*/
45
46 #define CRT_ROWS  25
47 #define CRT_COLS  80
48
49 /* crt modes */
50
51 #define GM_TEXT40    1     /* color */
52 #define GM_TEXT80    3     /* color */
53 #define GM_320x200   4     /* color */
54 #define GM_640x200   6
55 #define GM_MONOTEXT  7
56 #define GM_E320x200 13
57 #define GM_E640x200 14
58 #define GM_MONOGRF  15
59 #define GM_ENHANCED 16
60
61 #define GM_640x480x16   0x12
62 #define GM_640x480x256  0x2E
63 #define GM_1024x768x16  0x37
64 #define GM_1024x768x256 0x38
65
66
67
68 #define GM_TEXT      -1
69 #define GM_HIGHRES   -2
70 #define GM_MEDRES    -3
71
72 #define CRT_NONE    -1
73 #define CRT_MONO     0
74 #define CRT_COLOR    1
75 #define CRT_ENHANCED 2
76
77 /*----------------------------------------------------------------------*/
78
79 #define  ATTR_NORMAL     7
80 #define  ATTR_REVERSE   14
81 #define  ATTR_HIGHLIGHT 15
82
83 #define C_BLACK      0                  /* color codes */
84 #define C_BLUE       1
85 #define C_GREEN      2
86 #define C_CYAN       3
87 #define C_RED        4
88 #define C_MAGENTA    5
89 #define C_BROWN      6
90 #define C_WHITE      7
91 #define C_GREY       8
92 #define C_LTBLUE     9
93 #define C_LTGREEN   10
94 #define C_LTCYAN    11
95 #define C_LTRED     12
96 #define C_LTMAGENTA 13
97 #define C_YELLOW    14
98 #define C_LTWHITE   15
99
100 /*----------------------------------------------------------------------*/
101
102 /* screen character codes */
103
104 #define SC_BKSP           8
105 #define SC_TAB            9
106 #define SC_BLANK        ' '
107
108 #define SC_TOP_LEFT     218
109 #define SC_TOP_RIGHT    191
110 #define SC_BOTT_LEFT    192
111 #define SC_BOTT_RIGHT   217
112 #define SC_HORIZ        196
113 #define SC_VERTICAL     179
114
115
116 #define WAITKEY()       {cio_kb_clr(); while (cio_kb_read() == 0);}
117
118 /* c_save.c */
119 int crt_save(const char *fname);
120 /* center.c */
121 void crt_center_line(const char *str);
122 /* clreol.c */
123 void crt_clreol(void);
124 /* clrline.c */
125 void crt_clrline(unsigned int line);
126 /* clrscrn.c */
127 void crt_clrscrn(void);
128 /* cpos.c */
129 void crt_tab(unsigned int n);
130 void crt_save_cpos(void);
131 void crt_restore_cpos(void);
132 /* fill_eol.c */
133 void crt_fill_eol(int c, int attr);
134 /* getstate.c */
135 void crt_get_state(void);
136 /* put_ca.c */
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);
150 /* scrollup.c */
151 void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
152 /* setcpos.c */
153 void crt_set_cpos(int col, int row);
154 void crt_get_cpos(int *col, int *row);
155 /* beep.c */
156 void cio_beep(void);
157 /* kb_chk.c */
158 int cio_kb_chk(void);
159 /* kb_clr.c */
160 void cio_kb_clr(void);
161 /* kb_getc.c */
162 unsigned int cio_kb_getc(void);
163 void cio_kb_ungetc(unsigned int c);
164 /* kb_gets.c */
165 char *cio_kb_gets(char *str, int maxlen);
166 /* kb_read.c */
167 unsigned int cio_kb_read(void);
168 void cio_kb_unread(unsigned int c);
169 /* kb_waitc.c */
170 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
171 /* tone.c */
172 void cio_tone(double freq, double length);
173 /* check_kb */
174 int cio_check_kb_escape(void);
175
176 #endif