diff options
author | jake <jake@FreeBSD.org> | 2003-08-24 02:31:55 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-08-24 02:31:55 +0000 |
commit | 2591f69f80da576d0017f066f5c8df717fe98664 (patch) | |
tree | 05a717c9bacd94ca179bc3e02780e5a994a9a09b /sys | |
parent | 7d3b79c4ead81a7695443d9d66bd88499e73579e (diff) | |
download | FreeBSD-src-2591f69f80da576d0017f066f5c8df717fe98664.zip FreeBSD-src-2591f69f80da576d0017f066f5c8df717fe98664.tar.gz |
- Remember to flip the foreground and background color attributes in
gfb_draw if 'flip' is specified. This causes the mouse cut region
to be displayed in reverse color so it is visbile.
- Use the "other" implementation of gfb_cursor for the creator driver,
which doesn't assume there is a hardware cursor. It seems that the
hardware cursor that creator provides doesn't display the character
under the cursor in reverse colors, so the driver does this manually
and uses the hardware cursor for the mouse pointer (which it also works
much better for). This is wedged here because it required less hoops
than accessing the syscons vtb from inside the video driver, which is
needed to read the character and color attributes under the new cursor
position.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/syscons/scgfbrndr.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sys/dev/syscons/scgfbrndr.c b/sys/dev/syscons/scgfbrndr.c index 133a9be..fcc115e 100644 --- a/sys/dev/syscons/scgfbrndr.c +++ b/sys/dev/syscons/scgfbrndr.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_syscons.h" #include "opt_gfb.h" +#include "opt_creator.h" #include <sys/param.h> #include <sys/systm.h> @@ -128,8 +129,8 @@ gfb_border(scr_stat *scp, int color) static void gfb_draw(scr_stat *scp, int from, int count, int flip) { - char c; - char a; + int c; + int a; int i, n; video_adapter_t *adp; @@ -181,7 +182,7 @@ gfb_draw(scr_stat *scp, int from, int count, int flip) c = sc_vtb_getc(&scp->vtb, from); a = sc_vtb_geta(&scp->vtb, from) >> 8; (*vidsw[scp->sc->adapter]->putc)(adp, from, c, - a); + (a >> 4) | ((a & 0xf) << 4)); } else { (*vidsw[scp->sc->adapter]->puts)(adp, from, @@ -207,13 +208,14 @@ gfb_cursor_shape(scr_stat *scp, int base, int height, int blink) static int pxlblinkrate = 0; -#if 0 +#ifdef DEV_CREATOR static void gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { video_adapter_t *adp; + int a, c; - if (scp->cursor_height <= 0) /* the text cursor is disabled */ + if (scp->curs_attr.height <= 0) /* the text cursor is disabled */ return; adp = scp->sc->adp; @@ -234,11 +236,16 @@ gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) scp->status &= ~VR_CURSOR_BLINK; if(on) { scp->status |= VR_CURSOR_ON; - scp->cursor_saveunder_char = sc_vtb_getc(&scp->scr, at); - scp->cursor_saveunder_attr = sc_vtb_geta(&scp->scr, at); + (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, + scp->cursor_oldpos, + sc_vtb_getc(&scp->vtb, scp->cursor_oldpos), + sc_vtb_geta(&scp->vtb, scp->cursor_oldpos) >> 8); + a = sc_vtb_geta(&scp->vtb, at) >> 8; + c = sc_vtb_getc(&scp->vtb, at); (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, at, - scp->cursor_saveunder_char, - scp->cursor_saveunder_attr); + c, (a >> 4) | ((a & 0xf) << 4)); + scp->cursor_saveunder_attr = a; + scp->cursor_saveunder_char = c; } else { if (scp->status & VR_CURSOR_ON) (*vidsw[scp->sc->adapter]->putc)(scp->sc->adp, @@ -248,8 +255,7 @@ gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) } } } -#endif - +#else static void gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) { @@ -286,6 +292,7 @@ gfb_cursor(scr_stat *scp, int at, int blink, int on, int flip) else scp->status &= ~VR_CURSOR_BLINK; } +#endif static void gfb_blink(scr_stat *scp, int at, int flip) |