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 */
15 extern struct crtv_st crtv;
18 /*----------------------------------------------------------------------*/
25 #define GM_TEXT40 1 /* color */
26 #define GM_TEXT80 3 /* color */
27 #define GM_320x200 4 /* color */
30 #define GM_E320x200 13
31 #define GM_E640x200 14
33 #define GM_ENHANCED 16
35 #define GM_640x480x16 0x12
36 #define GM_640x480x256 0x2E
37 #define GM_1024x768x16 0x37
38 #define GM_1024x768x256 0x38
49 #define CRT_ENHANCED 2
51 /*----------------------------------------------------------------------*/
54 #define ATTR_REVERSE 14
55 #define ATTR_HIGHLIGHT 15
57 #define C_BLACK 0 /* color codes */
70 #define C_LTMAGENTA 13
74 /*----------------------------------------------------------------------*/
76 /* screen character codes */
82 #define SC_TOP_LEFT 218
83 #define SC_TOP_RIGHT 191
84 #define SC_BOTT_LEFT 192
85 #define SC_BOTT_RIGHT 217
87 #define SC_VERTICAL 179
90 #define WAITKEY() {cio_kb_clr(); while (cio_kb_read() == 0);}
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);
98 void crt_restore(const char *fname);
100 int crt_save(const char *fname);
102 int crt_center_line(const char *str);
104 void crt_clreol(void);
106 void crt_clrline(unsigned int line);
108 void crt_clrscrn(void);
110 void crt_tab(unsigned int n);
111 void crt_save_cpos(void);
112 void crt_restore_cpos(void);
114 void cio_printf(const char *cs, ...);
115 void cio_aprintf(const int attr, const char *cs, ...);
117 void cputs(const char *s);
120 void crt_set_ctype(int start, int end);
121 void crt_cursor_off(void);
122 void crt_cursor_on(void);
124 int crt_disp_card(void);
126 void crt_fill_eol(int c, int attr);
128 int crt_frame(int ulcol, int ulrow, int lrcol, int lrrow, int attr, int nlines);
130 void crt_get_ca(int *c, int *attr);
132 int crt_get_mon(void);
133 void crt_set_mon(int mon);
135 void crt_get_state(void);
137 void crt_set_mode(int mode, int cls);
138 int crt_get_mode(void);
139 int crt_bios_code(int mode);
141 void crt_set_text_clr(int fclr, int bclr);
142 int crt_get_texta(void);
143 void crt_set_texta(int a);
144 int crt_blank_attr(void);
145 void crt_put_ca(int c, int attr);
146 void crt_put_c(int c);
147 void crt_put_cc(int c, int count);
148 void crt_put_cca(int c, int attr, int count);
149 void crt_put_str(const char *str);
150 void crt_put_stra(const char *str, int attr);
151 void crt_inc_col(int count);
152 void crt_dec_col(int count);
153 void crt_dec_row(int count);
155 void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
157 void crt_set_cpos(int col, int row);
158 void crt_get_cpos(int *col, int *row);
160 void crt_set_page(int page);
162 void crt_set_palette(int id, int color);
163 void crt_set_color_table(char *color_table);
164 void crt_set_border(int bcolor);
165 int crt_calc_color(double nr, double ng, double nb);
166 int crt_icalc_color(int r, int g, int b);
171 int cio_kb_chk(void);
173 void cio_kb_clr(void);
175 unsigned int cio_kb_getc(void);
176 void cio_kb_ungetc(unsigned int c);
178 char *cio_kb_gets(char *str, int maxlen);
180 unsigned int cio_kb_read(void);
181 void cio_kb_unread(unsigned int c);
183 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
185 void cio_spkr_freq(double freq);
186 void cio_spkr_divisor(unsigned int div);
187 void cio_spkr_on(void);
188 void cio_spkr_off(void);
190 void cio_tone(double freq, double length);
192 int cio_check_kb_escape(void);