Fix dependencies between kernel options:
- When both SC_PIXEL_MODE and SC_NO_FONT_LOADING are defined, quietly drop SC_NO_FONT_LOADING, because the pixel(raster) console requires font. - When SC_NO_FONT_LOADING is defined, force SC_ALT_MOUSE_IMAGE. Without font, the arrow-shaped mouse cursor cannot be drawn. - Fiddle and simplify some internal macros. MFC after: 2 weeks
This commit is contained in:
parent
d193eadbdf
commit
44b37d9627
@ -325,6 +325,7 @@ static void
|
|||||||
draw_txtmouse(scr_stat *scp, int x, int y)
|
draw_txtmouse(scr_stat *scp, int x, int y)
|
||||||
{
|
{
|
||||||
#ifndef SC_ALT_MOUSE_IMAGE
|
#ifndef SC_ALT_MOUSE_IMAGE
|
||||||
|
if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) {
|
||||||
u_char font_buf[128];
|
u_char font_buf[128];
|
||||||
u_short cursor[32];
|
u_short cursor[32];
|
||||||
u_char c;
|
u_char c;
|
||||||
@ -384,7 +385,9 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
|||||||
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
||||||
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
||||||
}
|
}
|
||||||
#else /* SC_ALT_MOUSE_IMAGE */
|
} else
|
||||||
|
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||||
|
{
|
||||||
/* Red, magenta and brown are mapped to green to to keep it readable */
|
/* Red, magenta and brown are mapped to green to to keep it readable */
|
||||||
static const int col_conv[16] = {
|
static const int col_conv[16] = {
|
||||||
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
||||||
@ -401,7 +404,7 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
|||||||
else
|
else
|
||||||
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
||||||
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
||||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -669,8 +669,6 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case MOUSE_SHOW:
|
case MOUSE_SHOW:
|
||||||
if (!ISMOUSEAVAIL(scp->sc->adp->va_flags))
|
|
||||||
return EINVAL;
|
|
||||||
s = spltty();
|
s = spltty();
|
||||||
if (!(scp->sc->flags & SC_MOUSE_ENABLED)) {
|
if (!(scp->sc->flags & SC_MOUSE_ENABLED)) {
|
||||||
scp->sc->flags |= SC_MOUSE_ENABLED;
|
scp->sc->flags |= SC_MOUSE_ENABLED;
|
||||||
|
@ -325,6 +325,7 @@ static void
|
|||||||
draw_txtmouse(scr_stat *scp, int x, int y)
|
draw_txtmouse(scr_stat *scp, int x, int y)
|
||||||
{
|
{
|
||||||
#ifndef SC_ALT_MOUSE_IMAGE
|
#ifndef SC_ALT_MOUSE_IMAGE
|
||||||
|
if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) {
|
||||||
u_char font_buf[128];
|
u_char font_buf[128];
|
||||||
u_short cursor[32];
|
u_short cursor[32];
|
||||||
u_char c;
|
u_char c;
|
||||||
@ -384,7 +385,9 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
|||||||
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
||||||
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
||||||
}
|
}
|
||||||
#else /* SC_ALT_MOUSE_IMAGE */
|
} else
|
||||||
|
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||||
|
{
|
||||||
/* Red, magenta and brown are mapped to green to to keep it readable */
|
/* Red, magenta and brown are mapped to green to to keep it readable */
|
||||||
static const int col_conv[16] = {
|
static const int col_conv[16] = {
|
||||||
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
||||||
@ -401,7 +404,7 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
|||||||
else
|
else
|
||||||
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
||||||
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
||||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -412,8 +412,6 @@ scmeminit(void *arg)
|
|||||||
sc_alloc_scr_buffer(sc_console, FALSE, FALSE);
|
sc_alloc_scr_buffer(sc_console, FALSE, FALSE);
|
||||||
|
|
||||||
#ifndef SC_NO_CUTPASTE
|
#ifndef SC_NO_CUTPASTE
|
||||||
/* cut buffer is available only when the mouse pointer is used */
|
|
||||||
if (ISMOUSEAVAIL(sc_console->sc->adp->va_flags))
|
|
||||||
sc_alloc_cut_buffer(sc_console, FALSE);
|
sc_alloc_cut_buffer(sc_console, FALSE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2801,7 +2799,6 @@ static scr_stat
|
|||||||
sc_init_emulator(scp, "*");
|
sc_init_emulator(scp, "*");
|
||||||
|
|
||||||
#ifndef SC_NO_CUTPASTE
|
#ifndef SC_NO_CUTPASTE
|
||||||
if (ISMOUSEAVAIL(sc->adp->va_flags))
|
|
||||||
sc_alloc_cut_buffer(scp, TRUE);
|
sc_alloc_cut_buffer(scp, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,6 +56,20 @@
|
|||||||
#undef SC_PIXEL_MODE
|
#undef SC_PIXEL_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Always load font data if the pixel (raster text) mode is to be used. */
|
||||||
|
#ifdef SC_PIXEL_MODE
|
||||||
|
#undef SC_NO_FONT_LOADING
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If font data is not available, the `arrow'-shaped mouse cursor cannot
|
||||||
|
* be drawn. Use the alternative drawing method.
|
||||||
|
*/
|
||||||
|
#ifdef SC_NO_FONT_LOADING
|
||||||
|
#undef SC_ALT_MOUSE_IMAGE
|
||||||
|
#define SC_ALT_MOUSE_IMAGE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SC_CURSOR_CHAR
|
#ifndef SC_CURSOR_CHAR
|
||||||
#define SC_CURSOR_CHAR (0x07)
|
#define SC_CURSOR_CHAR (0x07)
|
||||||
#endif
|
#endif
|
||||||
@ -456,15 +470,9 @@ typedef struct {
|
|||||||
== PIXEL_MODE)
|
== PIXEL_MODE)
|
||||||
#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
|
#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
|
||||||
|
|
||||||
#ifndef ISMOUSEAVAIL
|
|
||||||
#ifdef SC_ALT_MOUSE_IMAGE
|
|
||||||
#define ISMOUSEAVAIL(af) (1)
|
|
||||||
#else
|
|
||||||
#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
|
#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
|
||||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
|
||||||
#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
|
#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
|
||||||
#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
|
#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
|
||||||
#endif /* ISMOUSEAVAIL */
|
|
||||||
|
|
||||||
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
|
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user