r41: ANSI C changes
[ctsim.git] / include / cio.h
index 0bfd15da6c290fb22161ded6ac1b65a25169d171..562da97e04714390fb773e62e2957302f6f84598 100644 (file)
@@ -1,6 +1,43 @@
+/*****************************************************************************
+**  This is part of the CTSim program
+**  Copyright (C) 1983-2000 Kevin Rosenberg
+**
+**  $Id: cio.h,v 1.6 2000/05/08 20:00:47 kevin Exp $
+**  $Log: cio.h,v $
+**  Revision 1.6  2000/05/08 20:00:47  kevin
+**  ANSI C changes
+**
+**  Revision 1.5  2000/05/07 12:46:19  kevin
+**  made c++ compatible
+**
+**  Revision 1.4  2000/04/28 18:18:59  kevin
+**  removed unused files
+**
+**  Revision 1.3  2000/04/28 14:14:16  kevin
+**  *** empty log message ***
+**
+**
+**  This program is free software; you can redistribute it and/or modify
+**  it under the terms of the GNU General Public License (version 2) as
+**  published by the Free Software Foundation.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+**
+**  You should have received a copy of the GNU General Public License
+**  along with this program; if not, write to the Free Software
+**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+******************************************************************************/
 #ifndef __CIO_H
 #define __CIO_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
 struct crtv_st {
     int init;          /* True if initialized */
     int bios_mode;     /* Current BIOS crt mode */
@@ -20,34 +57,6 @@ struct crtv_st {
 #define CRT_ROWS  25
 #define CRT_COLS  80
 
-/* crt modes */
-
-#define GM_TEXT40    1     /* color */
-#define GM_TEXT80    3     /* color */
-#define GM_320x200   4     /* color */
-#define GM_640x200   6
-#define GM_MONOTEXT  7
-#define GM_E320x200 13
-#define GM_E640x200 14
-#define GM_MONOGRF  15
-#define GM_ENHANCED 16
-
-#define GM_640x480x16  0x12
-#define GM_640x480x256 0x2E
-#define GM_1024x768x16 0x37
-#define GM_1024x768x256        0x38
-
-
-
-#define GM_TEXT             -1
-#define GM_HIGHRES   -2
-#define GM_MEDRES    -3
-
-#define CRT_NONE    -1
-#define CRT_MONO     0
-#define CRT_COLOR    1
-#define CRT_ENHANCED 2
-
 /*----------------------------------------------------------------------*/
 
 #define  ATTR_NORMAL     7
@@ -79,92 +88,42 @@ struct crtv_st {
 #define SC_TAB           9
 #define SC_BLANK       ' '
 
-#define SC_TOP_LEFT    218
-#define SC_TOP_RIGHT   191
-#define SC_BOTT_LEFT   192
-#define SC_BOTT_RIGHT  217
-#define SC_HORIZ       196
-#define SC_VERTICAL    179
-
 
 #define WAITKEY()      {cio_kb_clr(); while (cio_kb_read() == 0);}
 
-/* biosf.c */
-void b_setcpos(int col, int row, int page);
-void crt_wrt_cca(int c, int attr, int count, int page);
-void crt_wrt_ca(int c, int attr, int page);
-void crt_wrt_stra(const char *str, int count, int attr, int row, int col, int page);
-/* c_restor.c */
-void crt_restore(const char *fname);
-/* c_save.c */
-int crt_save(const char *fname);
 /* center.c */
-int crt_center_line(const char *str);
+void crt_center_line(const char *str);
 /* clreol.c */
-void crt_clreol(void);
+void cio_clreol(void);
 /* clrline.c */
-void crt_clrline(unsigned int line);
+void cio_clrline(unsigned int line);
 /* clrscrn.c */
 void crt_clrscrn(void);
 /* cpos.c */
-void crt_tab(unsigned int n);
-void crt_save_cpos(void);
-void crt_restore_cpos(void);
-/* cprintf.c */
-void cio_printf(const char *cs, ...);
-void cio_aprintf(const int attr, const char *cs, ...);
-/* cputs.c */
-void cputs(const char *s);
-/* crt_data.c */
-/* ctype.c */
-void crt_set_ctype(int start, int end);
-void crt_cursor_off(void);
-void crt_cursor_on(void);
-/* dispcard.c */
-int crt_disp_card(void);
+void cio_tab(unsigned int n);
+void cio__save_cpos(void);
+void cio__restore_cpos(void);
 /* fill_eol.c */
-void crt_fill_eol(int c, int attr);
-/* frame.c */
-int crt_frame(int ulcol, int ulrow, int lrcol, int lrrow, int attr, int nlines);
-/* get_ca.c */
-void crt_get_ca(int *c, int *attr);
-/* getmon.c */
-int crt_get_mon(void);
-void crt_set_mon(int mon);
+void cio_fill_eol(int c, int attr);
 /* getstate.c */
-void crt_get_state(void);
-/* mode.c */
-void crt_set_mode(int mode, int cls);
-int crt_get_mode(void);
-int crt_bios_code(int mode);
+void cio_get_state(void);
 /* put_ca.c */
-void crt_set_text_clr(int fclr, int bclr);
-int crt_get_texta(void);
-void crt_set_texta(int a);
-int crt_blank_attr(void);
-void crt_put_ca(int c, int attr);
-void crt_put_c(int c);
-void crt_put_cc(int c, int count);
-void crt_put_cca(int c, int attr, int count);
-void crt_put_str(const char *str);
-void crt_put_stra(const char *str, int attr);
-void crt_inc_col(int count);
-void crt_dec_col(int count);
-void crt_dec_row(int count);
-/* scrollup.c */
-void crt_scrollup(int xmin, int ymin, int xmax, int ymax, int nline, int attr);
+void cio_set_text_clr(int fclr, int bclr);
+int cio_get_texta(void);
+void cio_set_texta(int a);
+int cio_blank_attr(void);
+void cio_put_ca(int c, int attr);
+void cio_put_c(int c);
+void cio_put_cc(int c, int count);
+void cio_put_cca(int c, int attr, int count);
+void cio_put_str(const char *str);
+void cio_put_stra(const char *str, int attr);
+void cio_inc_col(int count);
+void cio_dec_col(int count);
+void cio_dec_row(int count);
 /* setcpos.c */
-void crt_set_cpos(int col, int row);
-void crt_get_cpos(int *col, int *row);
-/* setpage.c */
-void crt_set_page(int page);
-/* setpal.c */
-void crt_set_palette(int id, int color);
-void crt_set_color_table(char *color_table);
-void crt_set_border(int bcolor);
-int crt_calc_color(double nr, double ng, double nb);
-int crt_icalc_color(int r, int g, int b);
-
+void cio_set_cpos(int col, int row);
+void cio_get_cpos(int *col, int *row);
 /* beep.c */
 void cio_beep(void);
 /* kb_chk.c */
@@ -181,14 +140,13 @@ unsigned int cio_kb_read(void);
 void cio_kb_unread(unsigned int c);
 /* kb_waitc.c */
 unsigned int cio_kb_waitc(const char *astr, const char *estr, int beep_on_error);
-/* speaker.c */
-void cio_spkr_freq(double freq);
-void cio_spkr_divisor(unsigned int div);
-void cio_spkr_on(void);
-void cio_spkr_off(void);
 /* tone.c */
 void cio_tone(double freq, double length);
 /* check_kb */
 int cio_check_kb_escape(void);
 
+#ifdef _cplusplus
+}
+#endif /* _cplusplus */
+
 #endif