diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-05-01 11:49:32 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-05-01 11:49:32 +0000 |
commit | 7505ffe955403794fd7d853733c4c6ea91342061 (patch) | |
tree | 0850d50529cc4d4b3e702b52fb05d47b851e3541 | |
parent | 5f77a732972cb1329a2fd64dd2fe6540c1dfbee6 (diff) |
Another evil hack to turn sidelining into underlining on the Zaurus console.
tested dlg@
-rw-r--r-- | sys/dev/rasops/rasops.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index d77fd63c5c3..598314d17ec 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.10 2005/04/30 23:13:47 pascoe Exp $ */ +/* $OpenBSD: rasops.c,v 1.11 2005/05/01 11:49:31 pascoe Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -190,10 +190,29 @@ rasops_putchar_rotated(cookie, row, col, uc, attr) long attr; { struct rasops_info *ri; + u_char *rp; + int height; ri = (struct rasops_info *)cookie; - ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, attr); + /* Do rotated char sans (side)underline */ + ri->ri_real_ops.putchar(cookie, col, ri->ri_rows - row - 1, uc, + attr & ~1); + + /* Do rotated underline */ + rp = ri->ri_bits + col * ri->ri_yscale + (ri->ri_rows - row - 1) * + ri->ri_xscale; + height = ri->ri_font->fontheight; + + /* XXX this assumes 16-bit color depth */ + if ((attr & 1) != 0) { + int16_t c = (int16_t)ri->ri_devcmap[((u_int)attr >> 24) & 0xf]; + + while (height--) { + *(int16_t *)rp = c; + rp += ri->ri_stride; + } + } } #endif |