1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
$NetBSD: patch-ad,v 1.2 2002/02/11 18:30:23 fredb Exp $
--- vt.c.orig Fri May 24 10:13:52 1996
+++ vt.c
@@ -748,6 +748,9 @@
register int line, i;
if (v->state == ESnormal && ch >= ' ' && ch < 256) {
+ if ( (v->attr & T_LINEDRAW) && ch >= 'a' && ch <= 'z')
+ ch -= 95;
+
if (v->hanging_cursor) {
v->x = 0;
movecursordown(v);
@@ -796,13 +799,38 @@
v->hanging_cursor = 0; /* XXX Is this right? */
return;
case 13:
+ /*
+ * This is a hack! Do what I mean: after setting GS0,
+ * activate GS0 for next line, but don't just activate
+ * GS0 for every new line.
+ */
+ if (v->gset0changed) {
+ if (v->gset0 == S_ASCII)
+ v->attr &= ~T_LINEDRAW;
+ else
+ v->attr |= T_LINEDRAW;
+ v->gset0changed = 0;
+ v->gset0mapped = 0;
+ }
v->x = 0; /* Carriage return (^M) */
v->hanging_cursor = 0;
return;
case 14:
- return; /* Alternate font (^N) */
+ if (v->gset1 == S_ASCII)
+ v->attr &= ~T_LINEDRAW;
+ else
+ v->attr |= T_LINEDRAW;
+ return; /* Lock Shift 1 (^N) */
+ v->gset0changed = 0;
+ v->gset0mapped = 0;
case 15:
- return; /* Normal font (^O) */
+ if (v->gset0 == S_ASCII)
+ v->attr &= ~T_LINEDRAW;
+ else
+ v->attr |= T_LINEDRAW;
+ v->gset0changed = 1; /* to clear map bit at EOL */
+ v->gset0mapped = 1;
+ return; /* Lock Shift 0 (^O) */
case 24: /* (^X) */
case 26:
v->state = ESnormal; /* (^Z) */
@@ -1070,36 +1098,38 @@
break;
case ESsetG0:
if (ch == '0') {
- /* Set graphics character set */
- } else
- if (ch == 'B') {
- /* Set normal character set */
- } else
- if (ch == 'U') {
- /* Set null character set */
- } else
- if (ch == 'K') {
- /* Set user-defined character
- * set */
- }
- /* If currently G0, then make active set */
+ v->gset0 = S_LINEDRAW;
+ if (v->gset0mapped)
+ /*
+ * Activate immediately. We'll still mark it
+ * changed, so the mapped bit will get cleared
+ * for the next line.
+ */
+ v->attr |= T_LINEDRAW;
+ v->gset0changed = 1;
+ } else if (ch == 'B') {
+ v->gset0 = S_ASCII;
+ if (v->gset0mapped)
+ /*
+ * Activate immediately. We'll still mark it
+ * changed, so the mapped bit will get cleared
+ * for the next line.
+ */
+ v->attr &= ~T_LINEDRAW;
+ v->gset0changed = 1;
+ }
v->state = ESnormal;
break;
+ /*
+ * Not very useful. Typically, G1 would be changed to one
+ * of the other character sets, which we don't support.
+ */
case ESsetG1:
if (ch == '0') {
- /* Set graphics character set */
- } else
- if (ch == 'B') {
- /* Set normal character set */
- } else
- if (ch == 'U') {
- /* Set null character set */
- } else
- if (ch == 'K') {
- /* Set user-defined character
- * set */
- }
- /* If currently G1, then make active set */
+ v->gset1 = S_LINEDRAW;
+ } else if (ch == 'B') {
+ v->gset1 = S_ASCII;
+ }
v->state = ESnormal;
break;
default:
@@ -1187,6 +1217,10 @@
v->tab_stop[3] = 0x01010101;
v->tab_stop[4] = 0x01010101;
v->copying = 0;
+ v->gset0 = S_ASCII;
+ v->gset0changed = 0;
+ v->gset0mapped = 0;
+ v->gset1 = S_LINEDRAW;
}
}
|