lkml.org 
[lkml]   [1999]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Fix console w/ 512 char font
From
Date
This fixes some problems with 512 char fonts on the console:

- don't mess up the colors with `setterm -store'
- correctly mask out the hi_font_mask from the char attributes
- on monochrom frame buffers don't mess with the complement_mask and
screen attributes when switching between 256 and 512 char fonts


--- linux/drivers/char/console.c.~2~ Mon Nov 9 19:21:25 1998
+++ linux/drivers/char/console.c Sat Jan 2 18:13:00 1999
@@ -1221,6 +1221,8 @@
break;
case 8: /* store colors as defaults */
def_color = attr;
+ if (hi_font_mask == 0x100)
+ def_color >>= 1;
default_attr(currcons);
update_attr(currcons);
break;
@@ -1894,7 +1896,7 @@
if (decim)
insert_char(currcons, 1);
scr_writew(himask ?
- ((attr & ~himask) << 8) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) :
+ ((attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) :
(attr << 8) + tc,
(u16 *) pos);
if (DO_UPDATE && draw_x < 0) {
--- linux/drivers/video/fbcon.c.~2~ Wed Dec 23 18:30:27 1998
+++ linux/drivers/video/fbcon.c Sun Jan 3 10:32:54 1999
@@ -536,13 +536,14 @@
conp->vc_can_do_color = p->var.bits_per_pixel != 1;
conp->vc_complement_mask = conp->vc_can_do_color ? 0x7700 : 0x0800;
if (charcnt == 256) {
- p->conp->vc_hi_font_mask = 0;
+ conp->vc_hi_font_mask = 0;
p->fgshift = 8;
p->bgshift = 12;
p->charmask = 0xff;
} else {
- p->conp->vc_hi_font_mask = 0x100;
- p->conp->vc_complement_mask <<= 1;
+ conp->vc_hi_font_mask = 0x100;
+ if (conp->vc_can_do_color)
+ conp->vc_complement_mask <<= 1;
p->fgshift = 9;
p->bgshift = 13;
p->charmask = 0x1ff;
@@ -1333,13 +1334,14 @@
p->_fontheight = h;
if (p->conp->vc_hi_font_mask && cnt == 256) {
p->conp->vc_hi_font_mask = 0;
- p->conp->vc_complement_mask >>= 1;
+ if (p->conp->vc_can_do_color)
+ p->conp->vc_complement_mask >>= 1;
p->fgshift--;
p->bgshift--;
p->charmask = 0xff;

/* ++Edmund: reorder the attribute bits */
- {
+ if (p->conp->vc_can_do_color) {
struct vc_data *conp = p->conp;
unsigned short *cp = (unsigned short *) conp->vc_origin;
int count = conp->vc_screenbuf_size/2;
@@ -1355,7 +1357,8 @@

} else if (!p->conp->vc_hi_font_mask && cnt == 512) {
p->conp->vc_hi_font_mask = 0x100;
- p->conp->vc_complement_mask <<= 1;
+ if (p->conp->vc_can_do_color)
+ p->conp->vc_complement_mask <<= 1;
p->fgshift++;
p->bgshift++;
p->charmask = 0x1ff;
@@ -1367,12 +1370,20 @@
int count = conp->vc_screenbuf_size/2;
unsigned short c;
for (; count > 0; count--, cp++) {
+ unsigned short newc;
c = scr_readw(cp);
- scr_writew(((c & 0xff00) << 1) | (c & 0xff), cp);
+ if (conp->vc_can_do_color)
+ newc = ((c & 0xff00) << 1) | (c & 0xff);
+ else
+ newc = c & ~0x100;
+ scr_writew(newc, cp);
}
c = conp->vc_video_erase_char;
- conp->vc_video_erase_char = ((c & 0xff00) << 1) | (c & 0xff);
- conp->vc_attr <<= 1;
+ if (conp->vc_can_do_color) {
+ conp->vc_video_erase_char = ((c & 0xff00) << 1) | (c & 0xff);
+ conp->vc_attr <<= 1;
+ } else
+ conp->vc_video_erase_char = c & ~0x100;
}

}
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.258 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site