[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pcvt hacking, and VGA adapter strangeness


I tried hacking up pcvt to allow bright foreground colors
(such as \033[33m = brown [as before], but \033[1;33m = yellow [before,
it was brown also. The Linux console *does* yield yellow).

The result was the patch done below (it also allows blinking custom
colors, such as \033[5;31;46m for blinking red on cyan).

While testing it, I found out that the blink+color combination works
now, but the intense+color combination does NOT work. After debugging
for a while, I wrote a small programm to mmap() /dev/ttyC1 and write
the attribute byte given on the command line (quite hackish, but it
worked). I found out that on my graphics adapter, the intense
attribute (bit 3; 0-2 is foreground color, 3 is foreground intensity,
4-6 is background and 7 is blink) just doesn't work (i.e. attribute
foo & (~8) works out just the same as attribute foo | 8). The colors
map exactly onto the same VGA palette entries (tested with intense
white text, simultaneously displayed with non-intense white text,
then change the palette via scon -p).

The kernel probes the GA as
vt0 at isa0 port 0x60-0x6f irq 1: S3 968, 80 col, color, 8 scr, mf2-kbd
It *is* a Diamond Stealth64 Video 3000 (according to /etc/XF86Config:
Diamond Stealth64 Video 3240/3400 (IBM RAMDAC)).

Are there known problems with that GA? Some modes one has to set
to use the intense attribute bit?

Thanks and regards,


Index: pcvt_vtf.c
RCS file: /cvs/src/sys/arch/i386/isa/pcvt/pcvt_vtf.c,v
retrieving revision 1.5
diff -u -r1.5 pcvt_vtf.c
--- pcvt_vtf.c	1997/05/30 01:43:07	1.5
+++ pcvt_vtf.c	1998/06/01 19:57:16
@@ -215,9 +215,13 @@
 	while(i <= svsp->parmi);
-		if(colortouched)
+		if(colortouched) {
+			if (svsp->vtsgr & VT_BOLD)
+				setcolor |= FG_DARKGREY << 8; /* XXX */
+			if (svsp->vtsgr & VT_BLINK)
+				setcolor |= FG_BLINK << 8;
 			svsp->c_attr = setcolor;
-		else
+		} else
 			svsp->c_attr = ((sgr_tab_color[svsp->vtsgr]) << 8);