--- sbbs/src/conio/ciolib.h 2018/04/24 16:41:23 1.1 +++ sbbs/src/conio/ciolib.h 2018/04/24 16:42:18 1.1.1.2 @@ -1,4 +1,4 @@ -/* $Id: ciolib.h,v 1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: ciolib.h,v 1.1.1.2 2018/04/24 16:42:18 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * @@ -76,8 +76,11 @@ enum { ,CIOLIB_MODE_ANSI ,CIOLIB_MODE_X ,CIOLIB_MODE_CONIO + ,CIOLIB_MODE_CONIO_FULLSCREEN ,CIOLIB_MODE_SDL ,CIOLIB_MODE_SDL_FULLSCREEN + ,CIOLIB_MODE_SDL_YUV + ,CIOLIB_MODE_SDL_YUV_FULLSCREEN }; #if defined(_WIN32) /* presumably, Win32 */ @@ -114,6 +117,10 @@ enum { #define BLINK 128 #endif +#define CIOLIB_VIDEO_ALTCHARS (1<<0) // Attribute bit 3 selects alternate char set +#define CIOLIB_VIDEO_NOBRIGHT (1<<1) // Attribute bit 3 does not increase intensity +#define CIOLIB_VIDEO_BGBRIGHT (1<<2) // Attribute bit 7 selects high intensity background, not blink + enum text_modes { /* DOS-compatible modes */ @@ -168,7 +175,23 @@ enum text_modes C4350 = C80X50, /* this is actually "64" in the "real" conio */ - _ORIGMODE = 65 /* original mode at program startup */ + _ORIGMODE = 65, /* original mode at program startup */ + + C64_40X25 = 147, /* Commodore 64 40x25 colour mode */ + C128_40X25, /* Commodore 128 40x25 colour mode */ + C128_80X25, /* Commodore 128 40x25 colour mode */ + ATARI_40X24, /* Atari 800 40x24 colour text mode */ + ATARI_80X25, /* Atari 800 XEP80 80x25 mono text mode */ + + /* VESA Modes */ + VESA_132X21 = 235, + VESA_132X25 = 231, + VESA_132X28 = 228, + VESA_132X30 = 226, + VESA_132X34 = 222, + VESA_132X43 = 213, + VESA_132X50 = 206, + VESA_132X60 = 196, }; #define COLOR_MODE C80 @@ -195,6 +218,8 @@ struct text_info { unsigned char cury; /* y-coordinate in current window */ }; +extern struct text_info cio_textinfo; + typedef struct { int mode; int mouse; @@ -237,13 +262,19 @@ typedef struct { int (*showmouse) (void); void (*settitle) (const char *); void (*setname) (const char *); + void (*seticon) (const void *, unsigned long); void (*copytext) (const char *, size_t); char *(*getcliptext) (void); void (*suspend) (void); void (*resume) (void); - int (*setfont) (int font, int force); + int (*setfont) (int font, int force, int font_num); int (*getfont) (void); int (*loadfont) (char *filename); + int (*get_window_info) (int* width, int* height, int* xpos, int* ypos); + void (*getcustomcursor) (int *startline, int *endline, int *range, int *blink, int *visible); + void (*setcustomcursor) (int startline, int endline, int range, int blink, int visible); + void (*setvideoflags) (int flags); + int (*getvideoflags) (void); int *ESCDELAY; } cioapi_t; @@ -295,13 +326,23 @@ CIOLIBEXPORT void CIOLIBCALL ciolib_insl CIOLIBEXPORT char * CIOLIBCALL ciolib_getpass(const char *prompt); CIOLIBEXPORT void CIOLIBCALL ciolib_settitle(const char *title); CIOLIBEXPORT void CIOLIBCALL ciolib_setname(const char *title); +CIOLIBEXPORT void CIOLIBCALL ciolib_seticon(const void *icon,unsigned long size); CIOLIBEXPORT int CIOLIBCALL ciolib_showmouse(void); CIOLIBEXPORT int CIOLIBCALL ciolib_hidemouse(void); CIOLIBEXPORT void CIOLIBCALL ciolib_copytext(const char *text, size_t buflen); CIOLIBEXPORT char * CIOLIBCALL ciolib_getcliptext(void); -CIOLIBEXPORT int CIOLIBCALL ciolib_setfont(int font, int force); +CIOLIBEXPORT int CIOLIBCALL ciolib_setfont(int font, int force, int font_num); CIOLIBEXPORT int CIOLIBCALL ciolib_getfont(void); CIOLIBEXPORT int CIOLIBCALL ciolib_loadfont(char *filename); +CIOLIBEXPORT int CIOLIBCALL ciolib_get_window_info(int *width, int *height, int *xpos, int *ypos); +CIOLIBEXPORT int CIOLIBCALL ciolib_beep(void); +CIOLIBEXPORT void CIOLIBCALL ciolib_getcustomcursor(int *startline, int *endline, int *range, int *blink, int *visible); +CIOLIBEXPORT void CIOLIBCALL ciolib_setcustomcursor(int startline, int endline, int range, int blink, int visible); +CIOLIBEXPORT void CIOLIBCALL ciolib_setvideoflags(int flags); +CIOLIBEXPORT int CIOLIBCALL ciolib_getvideoflags(void); + +/* DoorWay specific stuff that's only applicable to ANSI mode. */ +CIOLIBEXPORT void CIOLIBCALL ansi_ciolib_setdoorway(int enable); #ifdef __cplusplus } #endif @@ -345,12 +386,28 @@ CIOLIBEXPORT int CIOLIBCALL ciolib_loadf #define hidemouse() ciolib_hidemouse() #define showmouse() ciolib_showmouse() #define setname(a) ciolib_setname(a) + #define seticon(a,b) ciolib_seticon(a,b) #define settitle(a) ciolib_settitle(a) #define copytext(a,b) ciolib_copytext(a,b) #define getcliptext() ciolib_getcliptext() - #define setfont(a,b) ciolib_setfont(a,b) + #define setfont(a,b,c) ciolib_setfont(a,b,c) #define getfont() ciolib_getfont() #define loadfont(a) ciolib_loadfont(a) + #define get_window_info(a,b,c,d) ciolib_get_window_info(a,b,c,d) + #define beep() ciolib_beep() + #define getcustomcursor(a,b,c,d,e) ciolib_getcustomcursor(a,b,c,d,e) + #define setcustomcursor(a,b,c,d,e) ciolib_setcustomcursor(a,b,c,d,e) + #define setvideoflags(a) ciolib_setvideoflags(a) + #define getvideoflags() ciolib_getvideoflags() +#endif + +#ifdef WITH_SDL + #include + + #ifdef main + #undef main + #endif + #define main CIOLIB_main #endif #endif /* Do not add anything after this line */