r5: Continued getting rid of files not used in CTSim
[ctsim.git] / include / cio.h
1 #ifndef __CIO_H
2 #define __CIO_H
3
4 struct crtv_st {
5     int init;           /* True if initialized */
6     int bios_mode;      /* Current BIOS crt mode */
7     int text_attr;      /* Current text attribute */
8     int act_page;       /* Active page */
9     int tcols, trows;   /* Maximum text coords */
10     int xmax, ymax;     /* Maximum x, y for both text & graphic modes */
11     int cx, cy;         /* Current x, y position */
12 }; 
13
14 #ifndef DEFINE_CRTV
15    extern struct crtv_st crtv;
16 #endif
17
18 /*----------------------------------------------------------------------*/
19
20 #define CRT_ROWS  25
21 #define CRT_COLS  80
22
23 /* crt modes */
24
25 #define GM_TEXT40    1     /* color */
26 #define GM_TEXT80    3     /* color */
27 #define GM_320x200   4     /* color */
28 #define GM_640x200   6
29 #define GM_MONOTEXT  7
30 #define GM_E320x200 13
31 #define GM_E640x200 14
32 #define GM_MONOGRF  15
33 #define GM_ENHANCED 16
34
35 #define GM_640x480x16   0x12
36 #define GM_640x480x256  0x2E
37 #define GM_1024x768x16  0x37
38 #define GM_1024x768x256 0x38
39
40
41
42 #define GM_TEXT      -1
43 #define GM_HIGHRES   -2
44 #define GM_MEDRES    -3
45
46 #define CRT_NONE    -1
47 #define CRT_MONO     0
48 #define CRT_COLOR    1
49 #define CRT_ENHANCED 2
50
51 /*----------------------------------------------------------------------*/
52
53 #define  ATTR_NORMAL     7
54 #define  ATTR_REVERSE   14
55 #define  ATTR_HIGHLIGHT 15
56
57 #define C_BLACK      0                  /* color codes */
58 #define C_BLUE       1
59 #define C_GREEN      2
60 #define C_CYAN       3
61 #define C_RED        4
62 #define C_MAGENTA    5
63 #define C_BROWN      6
64 #define C_WHITE      7
65 #define C_GREY       8
66 #define C_LTBLUE     9
67 #define C_LTGREEN   10
68 #define C_LTCYAN    11
69 #define C_LTRED     12
70 #define C_LTMAGENTA 13
71 #define C_YELLOW    14
72 #define C_LTWHITE   15
73
74 /*----------------------------------------------------------------------*/
75
76 /* screen character codes */
77
78 #define SC_BKSP           8
79 #define SC_TAB            9
80 #define SC_BLANK        ' '
81
82 #define SC_TOP_LEFT     218
83 #define SC_TOP_RIGHT    191
84 #define SC_BOTT_LEFT    192
85 #define SC_BOTT_RIGHT   217
86 #define SC_HORIZ        196
87 #define SC_VERTICAL     179
88
89
90 #define WAITKEY()       {cio_kb_clr(); while (cio_kb_read() == 0);}
91
92 /* biosf.c */
93 void b_setcpos(int col, int row, int page);
94 void crt_wrt_cca(int c, int attr, int count, int page);
95 void crt_wrt_ca(int c, int attr, int page);
96 void crt_wrt_stra(const char *str, int count, int attr, int row, int col, int page);
97 /* c_save.c */
98 int crt_save(const char *fname);
99 /* center.c */
100 int crt_center_line(const char *str);
101 /* clreol.c */
102 void crt_clreol(void);
103 /* clrline.c */
104 void crt_clrline(unsigned int line);
105 /* clrscrn.c */
106 void crt_clrscrn(void);
107 /* cpos.c */
108 void crt_tab(unsigned int n);
109 void crt_save_cpos(void);
110 void crt_restore_cpos(void);
111 /* ctype.c */
112 void crt_set_ctype(int start, int end);
113 void crt_cursor_off(void);
114 void crt_cursor_on(void);
115 /* fill_eol.c */
116 void crt_fill_eol(int c, int attr);
117 /* get_ca.c */
118 void crt_get_ca(int *c, int *attr);
119 void crt_set_mon(int mon);
120 /* getstate.c */
121 void crt_get_state(void);
122 /* put_ca.c */
123 void crt_set_text_clr(int fclr, int bclr);
124 int crt_get_texta(void);
125 void crt_set_texta(int a);
126 int crt_blank_attr(void);
127 void crt_put_ca(int c, int attr);
128 void crt_put_c(int c);
129 void crt_put_cc(int c, int count);
130 void crt_put_cca(int c, int attr, int count);
131 void crt_put_str(const char *str);
132 void crt_put_stra(const char *str, int attr);
133 void crt_inc_col(int count);
134 void crt_dec_col(int count);
135 void crt_dec_row(int count);
136 /* scrollup.c */
137 void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
138 /* setcpos.c */
139 void crt_set_cpos(int col, int row);
140 void crt_get_cpos(int *col, int *row);
141 /* setpal.c */
142 void crt_set_palette(int id, int color);
143 void crt_set_color_table(char *color_table);
144 void crt_set_border(int bcolor);
145 int crt_calc_color(double nr, double ng, double nb);
146 int crt_icalc_color(int r, int g, int b);
147 /* beep.c */
148 void cio_beep(void);
149 /* kb_chk.c */
150 int cio_kb_chk(void);
151 /* kb_clr.c */
152 void cio_kb_clr(void);
153 /* kb_getc.c */
154 unsigned int cio_kb_getc(void);
155 void cio_kb_ungetc(unsigned int c);
156 /* kb_gets.c */
157 char *cio_kb_gets(char *str, int maxlen);
158 /* kb_read.c */
159 unsigned int cio_kb_read(void);
160 void cio_kb_unread(unsigned int c);
161 /* kb_waitc.c */
162 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
163 /* tone.c */
164 void cio_tone(double freq, double length);
165 /* check_kb */
166 int cio_check_kb_escape(void);
167
168 #endif