mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 00:02:44 +00:00
Fix a bogon in pcvt that caused a characterset designation to not take
effect immediately, but required a following (normally redundant) G0 into GL mapping. This adds one layer of indirection (thus might make it slower), but fixes the broken box character drawing in pcvt. Hellmuth and Bruce are unfortunately too busy too review this right now, but i wanna have it in 2.2 since it has often been asked in the past.
This commit is contained in:
parent
f9ba24beed
commit
e843ad34c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23481
@ -826,8 +826,8 @@ typedef struct video_state {
|
||||
u_short *sc_G1; /* save G1 ptr */
|
||||
u_short *sc_G2; /* save G2 ptr */
|
||||
u_short *sc_G3; /* save G3 ptr */
|
||||
u_short *sc_GL; /* save GL ptr */
|
||||
u_short *sc_GR; /* save GR ptr */
|
||||
u_short **sc_GL; /* save GL ptr */
|
||||
u_short **sc_GR; /* save GR ptr */
|
||||
u_char sc_sel; /* selective erase state */
|
||||
u_char ufkl[8][17]; /* user fkey-labels */
|
||||
u_char sfkl[8][17]; /* system fkey-labels */
|
||||
@ -867,8 +867,8 @@ typedef struct video_state {
|
||||
struct sixels sixel; /* structure for storing char sixels */
|
||||
u_char selchar; /* true = selective attribute on */
|
||||
u_int decsca[MAXDECSCA]; /* Select Character Attrib bit array */
|
||||
u_short *GL; /* ptr to current GL conversion table*/
|
||||
u_short *GR; /* ptr to current GR conversion table*/
|
||||
u_short **GL; /* ptr to current GL conversion table*/
|
||||
u_short **GR; /* ptr to current GR conversion table*/
|
||||
u_short *G0; /* ptr to current G0 conversion table*/
|
||||
u_short *G1; /* ptr to current G1 conversion table*/
|
||||
u_char force24; /* force 24 lines in DEC 25 and HP 28*/
|
||||
@ -878,7 +878,7 @@ typedef struct video_state {
|
||||
u_char which[DSCS_LENGTH+1]; /* which set to designate */
|
||||
u_char whichi; /* index into which .. */
|
||||
u_char ss; /* flag, single shift G2 / G3 -> GL */
|
||||
u_short *Gs; /* ptr to cur. G2/G3 conversion table*/
|
||||
u_short **Gs; /* ptr to cur. G2/G3 conversion table*/
|
||||
u_char udkbuf[MAXUDKDEF]; /* buffer for user defined keys */
|
||||
struct udkentry ukt; /* index & length for each udk */
|
||||
u_char udkff; /* index into buffer first free entry*/
|
||||
|
@ -94,11 +94,11 @@ u_short attrib, ch; /* XXX inefficient interface */
|
||||
{
|
||||
if(!svsp->ss) /* single shift G2/G3 -> GL ? */
|
||||
{
|
||||
*video = attrib | svsp->GL[ch-0x20];
|
||||
*video = attrib | (*svsp->GL)[ch-0x20];
|
||||
}
|
||||
else
|
||||
{
|
||||
*video = attrib | svsp->Gs[ch-0x20];
|
||||
*video = attrib | (*svsp->Gs)[ch-0x20];
|
||||
svsp->ss = 0;
|
||||
}
|
||||
}
|
||||
@ -110,7 +110,7 @@ u_short attrib, ch; /* XXX inefficient interface */
|
||||
{
|
||||
if(ch >= 0xA0) /* use GR if ch >= 0xA0 */
|
||||
{
|
||||
*video = attrib | svsp->GR[ch-0xA0];
|
||||
*video = attrib | (*svsp->GR)[ch-0xA0];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -284,11 +284,11 @@ sput (u_char *s, U_char kernel, int len, int page)
|
||||
break;
|
||||
|
||||
case 0x0e: /* SO */
|
||||
svsp->GL = svsp->G1;
|
||||
svsp->GL = &svsp->G1;
|
||||
break;
|
||||
|
||||
case 0x0f: /* SI */
|
||||
svsp->GL = svsp->G0;
|
||||
svsp->GL = &svsp->G0;
|
||||
break;
|
||||
|
||||
case 0x10: /* DLE */
|
||||
@ -469,13 +469,13 @@ sput (u_char *s, U_char kernel, int len, int page)
|
||||
break;
|
||||
|
||||
case 'N': /* SINGLE SHIFT G2 */
|
||||
svsp->Gs = svsp->G2;
|
||||
svsp->Gs = &svsp->G2;
|
||||
svsp->ss = 1;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
case 'O': /* SINGLE SHIFT G3 */
|
||||
svsp->Gs = svsp->G3;
|
||||
svsp->Gs = &svsp->G3;
|
||||
svsp->ss = 1;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
@ -524,27 +524,27 @@ sput (u_char *s, U_char kernel, int len, int page)
|
||||
break;
|
||||
#endif /* PCVT_SETCOLOR */
|
||||
case 'n': /* Lock Shift G2 -> GL */
|
||||
svsp->GL = svsp->G2;
|
||||
svsp->GL = &svsp->G2;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
case 'o': /* Lock Shift G3 -> GL */
|
||||
svsp->GL = svsp->G3;
|
||||
svsp->GL = &svsp->G3;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
case '}': /* Lock Shift G2 -> GR */
|
||||
svsp->GR = svsp->G2;
|
||||
svsp->GR = &svsp->G2;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
case '|': /* Lock Shift G3 -> GR */
|
||||
svsp->GR = svsp->G3;
|
||||
svsp->GR = &svsp->G3;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
case '~': /* Lock Shift G1 -> GR */
|
||||
svsp->GR = svsp->G1;
|
||||
svsp->GR = &svsp->G1;
|
||||
svsp->state = STATE_INIT;
|
||||
break;
|
||||
|
||||
@ -1082,8 +1082,8 @@ vt_coldinit(void)
|
||||
svsp->G1 = csd_ascii; /* G1 = ascii */
|
||||
svsp->G2 = csd_supplemental; /* G2 = supplemental */
|
||||
svsp->G3 = csd_supplemental; /* G3 = supplemental */
|
||||
svsp->GL = svsp->G0; /* GL = G0 */
|
||||
svsp->GR = svsp->G2; /* GR = G2 */
|
||||
svsp->GL = &svsp->G0; /* GL = G0 */
|
||||
svsp->GR = &svsp->G2; /* GR = G2 */
|
||||
svsp->whichi = 0; /* char set designate init */
|
||||
svsp->which[0] = '\0'; /* char set designate init */
|
||||
svsp->hp_state = SHP_INIT; /* init HP mode state machine*/
|
||||
|
@ -491,8 +491,8 @@ vt_str(struct video_state *svsp)
|
||||
svsp->G1 = cse_ascii; /* G1 = ascii */
|
||||
svsp->G2 = cse_supplemental; /* G2 = supplemental */
|
||||
svsp->G3 = cse_supplemental; /* G3 = supplemental */
|
||||
svsp->GL = svsp->G0; /* GL = G0 */
|
||||
svsp->GR = svsp->G2; /* GR = G2 */
|
||||
svsp->GL = &svsp->G0; /* GL = G0 */
|
||||
svsp->GR = &svsp->G2; /* GR = G2 */
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -500,8 +500,8 @@ vt_str(struct video_state *svsp)
|
||||
svsp->G1 = csd_ascii; /* G1 = ascii */
|
||||
svsp->G2 = csd_supplemental; /* G2 = supplemental */
|
||||
svsp->G3 = csd_supplemental; /* G3 = supplemental */
|
||||
svsp->GL = svsp->G0; /* GL = G0 */
|
||||
svsp->GR = svsp->G2; /* GR = G2 */
|
||||
svsp->GL = &svsp->G0; /* GL = G0 */
|
||||
svsp->GR = &svsp->G2; /* GR = G2 */
|
||||
}
|
||||
|
||||
svsp->vtsgr = VT_NORMAL; /* no attributes */
|
||||
|
Loading…
Reference in New Issue
Block a user