diff --git a/src/conio/bitmap_con.c b/src/conio/bitmap_con.c index 9844eccc635e56db18457050efc8a3e753ae2093..f38b2ccdf26356d13c9e52bb7712c2afae7b8e50 100644 --- a/src/conio/bitmap_con.c +++ b/src/conio/bitmap_con.c @@ -29,8 +29,7 @@ int screenheight=0; #define PIXEL_OFFSET(x,y) ( (y)*screenwidth+(x) ) static int default_font=-99; -static int current_font=-99; -static int current_secondary_font=-99; +static int current_font[4]={-99, -99, -99, -99}; static int bitmap_initialized=0; struct video_stats vstat; static int *damaged=NULL; @@ -43,8 +42,7 @@ struct bitmap_callbacks { pthread_mutex_t vstatlock; pthread_mutex_t screenlock; static struct bitmap_callbacks callbacks; -static unsigned char *font; -static unsigned char *secondary_font; +static unsigned char *font[4]; static unsigned char space=' '; int force_redraws=0; @@ -168,7 +166,8 @@ int bitmap_init_mode(int mode, int *width, int *height) memset(screen,vstat.palette[0],screenwidth*screenheight); pthread_mutex_unlock(&screenlock); pthread_mutex_unlock(&vstatlock); - current_font=current_secondary_font=default_font; + for (i=0; i<sizeof(current_font)/sizeof(current_font[0]); i++) + current_font[i]=default_font; bitmap_loadfont(NULL); cio_textinfo.attribute=7; @@ -272,6 +271,10 @@ int bitmap_getvideoflags(void) flags |= CIOLIB_VIDEO_NOBRIGHT; if(vstat.bright_altcharset) flags |= CIOLIB_VIDEO_ALTCHARS; + if(vstat.no_blink) + flags |= CIOLIB_VIDEO_NOBLINK; + if(vstat.blink_altcharset) + flags |= CIOLIB_VIDEO_BLINKALTCHARS; return(flags); } @@ -291,6 +294,16 @@ void bitmap_setvideoflags(int flags) vstat.bright_altcharset=1; else vstat.bright_altcharset=0; + + if(flags & CIOLIB_VIDEO_NOBLINK) + vstat.no_blink=1; + else + vstat.no_blink=0; + + if(flags & CIOLIB_VIDEO_BLINKALTCHARS) + vstat.blink_altcharset=1; + else + vstat.blink_altcharset=0; } int bitmap_movetext(int x, int y, int ex, int ey, int tox, int toy) @@ -510,14 +523,17 @@ int bitmap_setfont(int font, int force, int font_num) default_font=font; /* Fall-through */ case 1: - current_font=font; + current_font[0]=font; if(font==36 /* ATARI */) space=0; else space=' '; break; case 2: - current_secondary_font=font; + case 3: + case 4: + current_font[font_num-1]=font; + break; } pthread_mutex_unlock(&vstatlock); @@ -578,7 +594,7 @@ error_return: int bitmap_getfont(void) { - return(current_font); + return(current_font[0]); } void bitmap_setscaling(int new_value) @@ -604,27 +620,31 @@ int bitmap_loadfont(char *filename) if(!bitmap_initialized) return(-1); - if(current_font==-99 || current_font>(sizeof(conio_fontdata)/sizeof(struct conio_font_data_struct)-2)) { + if(current_font[0]==-99 || current_font[0]>(sizeof(conio_fontdata)/sizeof(struct conio_font_data_struct)-2)) { for(i=0; conio_fontdata[i].desc != NULL; i++) { if(!strcmp(conio_fontdata[i].desc, "Codepage 437 English")) { - current_font=i; + current_font[0]=i; break; } } if(conio_fontdata[i].desc==NULL) - current_font=0; + current_font[0]=0; } - if(current_font==-1) + if(current_font[0]==-1) filename=current_filename; - else if(conio_fontdata[current_font].desc==NULL) + else if(conio_fontdata[current_font[0]].desc==NULL) return(-1); - if(current_secondary_font==-99) - current_secondary_font=current_font; - if(current_secondary_font==-1) - ; - else if(conio_fontdata[current_secondary_font].desc==NULL) - current_secondary_font=current_font; + if(current_font[0]==-99) { + for (i=1; i<sizeof(current_font)/sizeof(current_font[0]); i++) + current_font[i]=current_font[0]; + } + for (i=1; i<sizeof(current_font)/sizeof(current_font[0]); i++) { + if(current_font[i]==-1) + ; + else if(conio_fontdata[current_font[i]].desc==NULL) + current_font[i]=current_font[0]; + } pthread_mutex_lock(&vstatlock); fh=vstat.charheight; @@ -632,75 +652,65 @@ int bitmap_loadfont(char *filename) fontsize=fw*fh*256*sizeof(unsigned char); - if(font) - FREE_AND_NULL(font); - if(secondary_font) - FREE_AND_NULL(secondary_font); - if((font=(unsigned char *)malloc(fontsize))==NULL) - goto error_return; - if((secondary_font=(unsigned char *)malloc(fontsize))==NULL) - goto error_return; + for (i=0; i<sizeof(font)/sizeof(font[0]); i++) { + if(font[i]) + FREE_AND_NULL(font[i]); + if((font[i]=(unsigned char *)malloc(fontsize))==NULL) + goto error_return; + } if(filename != NULL) { if(flength(filename)!=fontsize) goto error_return; if((fontfile=fopen(filename,"rb"))==NULL) goto error_return; - if(fread(font, 1, fontsize, fontfile)!=fontsize) + if(fread(font[0], 1, fontsize, fontfile)!=fontsize) goto error_return; fclose(fontfile); fontfile=NULL; - current_font=-1; + current_font[0]=-1; if(filename != current_filename) SAFECOPY(current_filename,filename); - if(current_secondary_font==-1) - memcpy(secondary_font, font, fontsize); + for (i=1; i<sizeof(font)/sizeof(font[0]); i++) { + if (current_font[i]==-1) + memcpy(font[i], font[0], fontsize); + } } - if(current_font != -1 || current_secondary_font != -1) { + for (i=0; i<sizeof(font)/sizeof(font[0]); i++) { + if (current_font[i] == -1) + continue; switch(vstat.charwidth) { case 8: switch(vstat.charheight) { case 8: - if(current_font != -1) { - if(conio_fontdata[current_font].eight_by_eight==NULL) + if(conio_fontdata[current_font[i]].eight_by_eight==NULL) { + if (i==0) goto error_return; - memcpy(font, conio_fontdata[current_font].eight_by_eight, fontsize); - } - if(current_secondary_font != -1) { - if(conio_fontdata[current_secondary_font].eight_by_eight==NULL) { - FREE_AND_NULL(secondary_font); - } else - memcpy(secondary_font, conio_fontdata[current_secondary_font].eight_by_eight, fontsize); + FREE_AND_NULL(font[i]); } + else + memcpy(font[i], conio_fontdata[current_font[i]].eight_by_eight, fontsize); break; case 14: - if(current_font != -1) { - if(conio_fontdata[current_font].eight_by_fourteen==NULL) + if(conio_fontdata[current_font[i]].eight_by_fourteen==NULL) { + if (i==0) goto error_return; - memcpy(font, conio_fontdata[current_font].eight_by_fourteen, fontsize); - } - if(current_secondary_font != -1) { - if(conio_fontdata[current_secondary_font].eight_by_fourteen==NULL) { - FREE_AND_NULL(secondary_font); - } else - memcpy(secondary_font, conio_fontdata[current_secondary_font].eight_by_fourteen, fontsize); + FREE_AND_NULL(font[i]); } + else + memcpy(font[i], conio_fontdata[current_font[i]].eight_by_fourteen, fontsize); break; case 16: - if(current_font != -1) { - if(conio_fontdata[current_font].eight_by_sixteen==NULL) + if(conio_fontdata[current_font[i]].eight_by_sixteen==NULL) { + if (i==0) goto error_return; - memcpy(font, conio_fontdata[current_font].eight_by_sixteen, fontsize); - } - if(current_secondary_font != -1) { - if(conio_fontdata[current_secondary_font].eight_by_sixteen==NULL) { - FREE_AND_NULL(secondary_font); - } else - memcpy(secondary_font, conio_fontdata[current_secondary_font].eight_by_sixteen, fontsize); + FREE_AND_NULL(font[i]); } + else + memcpy(font[i], conio_fontdata[current_font[i]].eight_by_sixteen, fontsize); break; default: goto error_return; @@ -716,8 +726,8 @@ int bitmap_loadfont(char *filename) return(0); error_return: - FREE_AND_NULL(font); - FREE_AND_NULL(secondary_font); + for (i=0; i<sizeof(font)/sizeof(font[0]); i++) + FREE_AND_NULL(font[i]); if(fontfile) fclose(fontfile); pthread_mutex_unlock(&vstatlock); @@ -789,6 +799,7 @@ static int bitmap_draw_one_char(unsigned int xpos, unsigned int ypos) int x; int y; int fontoffset; + int altfont; unsigned char *this_font; WORD sch; @@ -806,25 +817,25 @@ static int bitmap_draw_one_char(unsigned int xpos, unsigned int ypos) sch=vstat.vmem[(ypos-1)*cio_textinfo.screenwidth+(xpos-1)]; + altfont = (sch>>11 & 0x01) | ((sch>>14) & 0x02); if(vstat.bright_background) { bg=(sch&0xf000)>>12; fg=(sch&0x0f00)>>8; } else { bg=(sch&0x7000)>>12; - if(sch&0x8000 && vstat.blink) + if(sch&0x8000 && vstat.blink && (!vstat.no_blink)) fg=bg; else fg=(sch&0x0f00)>>8; } - this_font=font; - if(vstat.bright_altcharset) { - if(fg & 0x08) { - this_font=secondary_font; - if(this_font==NULL) - this_font=font; - } - } + if (!vstat.bright_altcharset) + altfont &= ~0x01; + if (!vstat.blink_altcharset) + altfont &= ~0x02; + this_font=font[altfont]; + if (this_font == NULL) + this_font = font[0]; if(vstat.no_bright) fg &= 0x07; fontoffset=(sch&0xff)*vstat.charheight; @@ -908,7 +919,7 @@ static int update_rect(int sx, int sy, int width, int height, int force) for(x=0;x<width;x++) { if(force || (last_vmem[pos] != vstat.vmem[pos]) /* Different char */ - || (vstat.blink != vs.blink && vstat.vmem[pos]>>15) /* Blinking char */ + || ((vstat.blink != vs.blink) && (vstat.vmem[pos]>>15) && (!vstat.no_blink)) /* Blinking char */ || (redraw_cursor && ((vs.curs_col==sx+x && vs.curs_row==sy+y) || (vstat.curs_col==sx+x && vstat.curs_row==sy+y))) /* Cursor */ ) { last_vmem[pos] = vstat.vmem[pos]; diff --git a/src/conio/ciolib.h b/src/conio/ciolib.h index 529be01c0a13450984048337807494af8d9d0cc9..13341b48078a24109204a2128bc2463e9ca716c6 100644 --- a/src/conio/ciolib.h +++ b/src/conio/ciolib.h @@ -116,9 +116,11 @@ 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 +#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 +#define CIOLIB_VIDEO_BLINKALTCHARS (1<<3) // Attribute bit 7 selects alternate char set +#define CIOLIB_VIDEO_NOBLINK (1<<4) // Attribute bit 7 has no effect enum text_modes { diff --git a/src/conio/cterm.c b/src/conio/cterm.c index 31926f02cb03a971671faba8d0c2e0cc33ba2688..bc4c9115ca2bf2cc973fd2c98f27c6993b6c08e7 100644 --- a/src/conio/cterm.c +++ b/src/conio/cterm.c @@ -1019,6 +1019,16 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * i|=CIOLIB_VIDEO_BGBRIGHT; SETVIDEOFLAGS(i); } + if(!strcmp(cterm->escbuf,"[?34h")) { + i=GETVIDEOFLAGS(); + i|=CIOLIB_VIDEO_BLINKALTCHARS; + SETVIDEOFLAGS(i); + } + if(!strcmp(cterm->escbuf,"[?35h")) { + i=GETVIDEOFLAGS(); + i|=CIOLIB_VIDEO_NOBLINK; + SETVIDEOFLAGS(i); + } if(!strcmp(cterm->escbuf,"[=255h")) cterm->doorway_mode=1; break; @@ -1049,6 +1059,16 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * i&=~CIOLIB_VIDEO_BGBRIGHT; SETVIDEOFLAGS(i); } + if(!strcmp(cterm->escbuf,"[?34l")) { + i=GETVIDEOFLAGS(); + i&=~CIOLIB_VIDEO_BLINKALTCHARS; + SETVIDEOFLAGS(i); + } + if(!strcmp(cterm->escbuf,"[?35l")) { + i=GETVIDEOFLAGS(); + i&=~CIOLIB_VIDEO_NOBLINK; + SETVIDEOFLAGS(i); + } if(!strcmp(cterm->escbuf,"[=255l")) cterm->doorway_mode=0; break; @@ -1067,6 +1087,8 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * cterm->saved_mode |= (i&CIOLIB_VIDEO_ALTCHARS)?CTERM_SAVEMODE_ALTCHARS:0; cterm->saved_mode |= (i&CIOLIB_VIDEO_NOBRIGHT)?CTERM_SAVEMODE_NOBRIGHT:0; cterm->saved_mode |= (i&CIOLIB_VIDEO_BGBRIGHT)?CTERM_SAVEMODE_BGBRIGHT:0; + cterm->saved_mode |= (i&CIOLIB_VIDEO_BLINKALTCHARS)?CTERM_SAVEMODE_BLINKALTCHARS:0; + cterm->saved_mode |= (i&CIOLIB_VIDEO_NOBLINK)?CTERM_SAVEMODE_NOBLINK:0; cterm->saved_mode |= (cterm->doorway_mode)?CTERM_SAVEMODE_DOORWAY:0; cterm->saved_mode |= (cterm->origin_mode)?CTERM_SAVEMODE_ORIGIN:0; break; @@ -1103,6 +1125,16 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * cterm->saved_mode &= ~(CTERM_SAVEMODE_BGBRIGHT); cterm->saved_mode |= (i&CIOLIB_VIDEO_BGBRIGHT)?CTERM_SAVEMODE_BGBRIGHT:0; } + if(!strcmp(cterm->escbuf,"?34")) { + cterm->saved_mode_mask |= CTERM_SAVEMODE_BLINKALTCHARS; + cterm->saved_mode &= ~(CTERM_SAVEMODE_BLINKALTCHARS); + cterm->saved_mode |= (i&CIOLIB_VIDEO_BLINKALTCHARS)?CTERM_SAVEMODE_BLINKALTCHARS:0; + } + if(!strcmp(cterm->escbuf,"?35")) { + cterm->saved_mode_mask |= CTERM_SAVEMODE_NOBLINK; + cterm->saved_mode &= ~(CTERM_SAVEMODE_NOBLINK); + cterm->saved_mode |= (i&CIOLIB_VIDEO_NOBLINK)?CTERM_SAVEMODE_NOBLINK:0; + } if(!strcmp(cterm->escbuf,"=255")) { cterm->saved_mode_mask |= CTERM_SAVEMODE_DOORWAY; cterm->saved_mode &= ~(CTERM_SAVEMODE_DOORWAY); @@ -1133,12 +1165,24 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * else i &= ~CIOLIB_VIDEO_ALTCHARS; } + if(cterm->saved_mode_mask & CTERM_SAVEMODE_BLINKALTCHARS) { + if(cterm->saved_mode & CTERM_SAVEMODE_BLINKALTCHARS) + i |= CIOLIB_VIDEO_BLINKALTCHARS; + else + i &= ~CIOLIB_VIDEO_BLINKALTCHARS; + } if(cterm->saved_mode_mask & CTERM_SAVEMODE_NOBRIGHT) { if(cterm->saved_mode & CTERM_SAVEMODE_NOBRIGHT) i |= CIOLIB_VIDEO_NOBRIGHT; else i &= ~CIOLIB_VIDEO_NOBRIGHT; } + if(cterm->saved_mode_mask & CTERM_SAVEMODE_NOBLINK) { + if(cterm->saved_mode & CTERM_SAVEMODE_NOBLINK) + i |= CIOLIB_VIDEO_NOBLINK; + else + i &= ~CIOLIB_VIDEO_NOBLINK; + } if(cterm->saved_mode_mask & CTERM_SAVEMODE_BGBRIGHT) { if(cterm->saved_mode & CTERM_SAVEMODE_BGBRIGHT) i |= CIOLIB_VIDEO_BGBRIGHT; @@ -1197,6 +1241,24 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * SETVIDEOFLAGS(i); } } + if(!strcmp(cterm->escbuf,"?34")) { + if(cterm->saved_mode_mask & CTERM_SAVEMODE_BLINKALTCHARS) { + if(cterm->saved_mode & CTERM_SAVEMODE_BLINKALTCHARS) + i |= CIOLIB_VIDEO_BLINKALTCHARS; + else + i &= ~CIOLIB_VIDEO_BLINKALTCHARS; + SETVIDEOFLAGS(i); + } + } + if(!strcmp(cterm->escbuf,"?35")) { + if(cterm->saved_mode_mask & CTERM_SAVEMODE_NOBLINK) { + if(cterm->saved_mode & CTERM_SAVEMODE_NOBLINK) + i |= CIOLIB_VIDEO_NOBLINK; + else + i &= ~CIOLIB_VIDEO_NOBLINK; + SETVIDEOFLAGS(i); + } + } if(!strcmp(cterm->escbuf,"=255")) { if(cterm->saved_mode_mask & CTERM_SAVEMODE_DOORWAY) cterm->autowrap=(cterm->saved_mode & CTERM_SAVEMODE_DOORWAY) ? 1 : 0; @@ -1294,8 +1356,10 @@ static void do_ansi(struct cterminal *cterm, char *retbuf, size_t retsize, int * } } switch(i) { - case 0: /* Only the primary and secondary font is currently supported */ + case 0: /* Four fonts are currently supported */ case 1: + case 2: + case 3: SETFONT(j,FALSE,i+1); } } @@ -2023,8 +2087,9 @@ static void ctputs(struct cterminal *cterm, char *buf) *cterm->_wscroll=oldscroll; } -char* CIOLIBCALL cterm_write(struct cterminal * cterm, const unsigned char *buf, int buflen, char *retbuf, size_t retsize, int *speed) +char* CIOLIBCALL cterm_write(struct cterminal * cterm, const void *vbuf, int buflen, char *retbuf, size_t retsize, int *speed) { + const unsigned char *buf = (unsigned char *)vbuf; unsigned char ch[2]; unsigned char prn[BUFSIZE]; int j,k,l; diff --git a/src/conio/cterm.h b/src/conio/cterm.h index dd35ebfcca7247b198aeb2f4254b45cfa8f0df4e..787af963414c4051ff827e61c03ccbb6f6196b65 100644 --- a/src/conio/cterm.h +++ b/src/conio/cterm.h @@ -89,13 +89,15 @@ struct cterminal { char DA[1024]; // Device Attributes bool autowrap; bool origin_mode; -#define CTERM_SAVEMODE_AUTOWRAP 0x01 -#define CTERM_SAVEMODE_CURSOR 0x02 -#define CTERM_SAVEMODE_ALTCHARS 0x04 -#define CTERM_SAVEMODE_NOBRIGHT 0x08 -#define CTERM_SAVEMODE_BGBRIGHT 0x10 -#define CTERM_SAVEMODE_DOORWAY 0x20 -#define CTERM_SAVEMODE_ORIGIN 0x40 +#define CTERM_SAVEMODE_AUTOWRAP 0x001 +#define CTERM_SAVEMODE_CURSOR 0x002 +#define CTERM_SAVEMODE_ALTCHARS 0x004 +#define CTERM_SAVEMODE_NOBRIGHT 0x008 +#define CTERM_SAVEMODE_BGBRIGHT 0x010 +#define CTERM_SAVEMODE_DOORWAY 0x020 +#define CTERM_SAVEMODE_ORIGIN 0x040 +#define CTERM_SAVEMODE_BLINKALTCHARS 0x080 +#define CTERM_SAVEMODE_NOBLINK 0x100 int32_t saved_mode; int32_t saved_mode_mask; @@ -185,7 +187,7 @@ extern "C" { #endif CIOLIBEXPORT struct cterminal* CIOLIBCALL cterm_init(int height, int width, int xpos, int ypos, int backlines, unsigned char *scrollback, int emulation); -CIOLIBEXPORT char CIOLIBCALL *cterm_write(struct cterminal *cterm, const unsigned char *buf, int buflen, char *retbuf, size_t retsize, int *speed); +CIOLIBEXPORT char CIOLIBCALL *cterm_write(struct cterminal *cterm, const void *buf, int buflen, char *retbuf, size_t retsize, int *speed); CIOLIBEXPORT int CIOLIBCALL cterm_openlog(struct cterminal *cterm, char *logfile, int logtype); CIOLIBEXPORT void CIOLIBCALL cterm_closelog(struct cterminal *cterm); CIOLIBEXPORT void CIOLIBCALL cterm_end(struct cterminal *cterm); diff --git a/src/conio/cterm.txt b/src/conio/cterm.txt index c38ade0392def2dacdee97ea66e1920c4ca648b9..b441d3a1eb626f493d767bea82352e84d6982700 100644 --- a/src/conio/cterm.txt +++ b/src/conio/cterm.txt @@ -144,16 +144,18 @@ CSI ? 25 h CSI ? 31 h NON-STANDARD EXTENSION - Enable alt character set + Enable bright alt character set With this mode set, the bright (1) graphic rendition selects characters from an alternate character set. CSI ? 32 h NON-STANDARD EXTENSION - Bright Intensity Enable + Bright Intensity Disable - Reverses CSI ? 32 l + This makes the bright intensity bit not control the intesnity. + Mostly for use with CSI ? 31 h to permit fonts in the same + colours. CSI ? 33 h NON-STANDARD EXTENSION @@ -162,6 +164,21 @@ CSI ? 33 h With this mode set, the blink (5,6) graphic renditions cause the background colour to be high intensity rather than causing blink +CSI ? 34 h + NON-STANDARD EXTENSION + Enable blink alt character set + + With this mode set, the blink (5,6) graphic renditions selects + characters from an alternate character set. + +CSI ? 35 h + NON-STANDARD EXTENSION + Blink Disabled + + This makes the blink bit not cause the character to blink. + Mostly for use with CSI ? 34 h to permit fonts to be used without + blinking. + CSI = 255 l NON-STANDARD EXTENSION Disable DoorWay Mode @@ -201,10 +218,10 @@ CSI ? 31 l CSI ? 32 l NON-STANDARD EXTENSION - Bright Intensity Disable + Bright Intensity Enable - Causes "bright" foreground characters to not be bright. - Most useful in combination with CSI ? 31 h + Causes "bright" foreground characters to be bright. + Reverses CSI ? 32 h CSI ? 33 l NON-STANDARD EXTENSION @@ -212,6 +229,18 @@ CSI ? 33 l Reverses CSI ? 33 h +CSI ? 34 l + NON-STANDARD EXTENSION + Disable alt character set + + Reverses CSI ? 34 h + +CSI ? 35 l + NON-STANDARD EXTENSION + Blink Enabled + + Reverses CSI ? 35 h + CSI [ p1 [ ; p2 ] ] * r NON-STANDARD EXTENSION. Set the output emulation speed. @@ -295,10 +324,17 @@ CSI [ p1 [ ; p2 ] ] sp D Font Selection Defaults: p1 = 0 p2 = 0 "sp" indicates a single space character. - Sets font p1 to be the one indicated bu p2. Currently only the primary - font (Font zero) and secondary font (Font one) are supported. p2 must - be between 0 and 255. Not all output types support font selection. Only - X11 and SDL currently do. + Sets font p1 to be the one indicated bu p2. Currently four fonts are + supported. p2 must be between 0 and 255. Not all output types support + font selection. Only X11 and SDL currently do. + Supported p1 values: + 0 - Default font + 1 - Font selected by the high intensity bit when CSI [ ? 31 h is + enabled + 2 - Font selected by the blink intensity bit when CSI [ ? 34 h is + enabled + 3 - Font selected by both the high intensity and blink bits when + both CSI [ ? 31 h and CSI [ ? 34 h are enabled Currently included fonts are: 0 - Codepage 437 English 1 - Codepage 1251 Cyrillic, (swiss) diff --git a/src/conio/vidmodes.c b/src/conio/vidmodes.c index e9cbff03ccb7b8559b4e86a55a277b000fd9a09b..984df9502e9ed1c0efedfa89b8c2d705169dec56 100644 --- a/src/conio/vidmodes.c +++ b/src/conio/vidmodes.c @@ -181,6 +181,8 @@ int load_vmode(struct video_stats *vs, int mode) vs->bright_background=0; vs->no_bright=0; vs->bright_altcharset=0; + vs->no_blink=0; + vs->blink_altcharset=0; if(vs->curs_row < 0) vs->curs_row=0; if(vs->curs_row >= vparams[i].rows) diff --git a/src/conio/vidmodes.h b/src/conio/vidmodes.h index fa2269327f3db71bfd7626ebab7e3648e4a4c98e..6acc6e678bbfbc1d30e8ed0ed9e47a86f0d04745 100644 --- a/src/conio/vidmodes.h +++ b/src/conio/vidmodes.h @@ -80,7 +80,9 @@ struct video_stats { int bright_background; int blink; int no_bright; + int no_blink; int bright_altcharset; + int blink_altcharset; int currattr; int scaling; struct dac_colors dac_colors[256];