Subject: DT patch
To: None <port-mac68k@netbsd.org>
From: Steven Carlson <stevec@accessone.com>
List: port-mac68k
Date: 07/15/1999 22:46:41
This patch makes DT draw the thread lines in programs like
slrn.


--- vt.c	1999/07/15 14:39:31	1.1
+++ vt.c	1999/07/16 05:38:45	1.4
@@ -30,7 +30,7 @@
 #include "vt.h"
 #include "bell.h"
 
-static char rcsid[] = "$Id: vt.c,v 1.1 1999/07/15 14:39:31 stevec Exp $";
+static char rcsid[] = "$Id: vt.c,v 1.4 1999/07/16 05:38:45 stevec Exp $";
 
 /* The VT100 states for v->state: */
 enum {
@@ -748,6 +748,9 @@
 	register int line, i;
 
 	if (v->state == ESnormal && ch >= ' ' && ch < 256) {
+		if ( (v->attr & T_G0) && ch >= 'a' && ch <= 'z')
+			ch -= 95;
+
 		if (v->hanging_cursor) {
 			v->x = 0;
 			movecursordown(v);
@@ -800,8 +803,10 @@
 		v->hanging_cursor = 0;
 		return;
 	case 14:
+		v->attr |= T_G0;
 		return;		/* Alternate font (^N)	 */
 	case 15:
+		v->attr &= ~T_G0;
 		return;		/* Normal font (^O)	 */
 	case 24:		/* (^X)			 */
 	case 26:
@@ -1071,9 +1076,11 @@
 	case ESsetG0:
 		if (ch == '0') {
 			/* Set graphics character set */
+			v->attr |= T_G0;
 		} else
 			if (ch == 'B') {
 				/* Set normal character set */
+				v->attr &= ~T_G0;
 			} else
 				if (ch == 'U') {
 					/* Set null character set */
--- vt.h	1999/07/16 04:08:21	1.1
+++ vt.h	1999/07/16 04:10:08	1.2
@@ -1,7 +1,7 @@
 /*
  * vt.h
  *
- * $Id: vt.h,v 1.1 1999/07/16 04:08:21 stevec Exp $
+ * $Id: vt.h,v 1.2 1999/07/16 04:10:08 stevec Exp $
  */
 
 #define VT_MAXVT	9
@@ -20,6 +20,7 @@
 #define T_REVERSE	0x04
 #define T_SELECTED	0x08
 #define T_INSERT	0x10
+#define T_G0		0x20
 
 /* Cursor types */
 #define C_BLOCK		0x01