From ae4b8581fa4ada4843663eca3cdcb35824658227 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 28 Jul 2003 22:40:54 +0000 Subject: 2003-07-14 Marco Gerards * vga.c: New global variable vga_display_max_glyphs. (parse_startup_args): New macro PARSE_FONT_OPT_NOARGS. (parse_startup_args): Parse --max-colors and --max-glyphs. (vga_display_init): Set disp->df_size to match the color setting. --- console-client/ChangeLog | 7 +++++++ console-client/vga.c | 20 +++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/console-client/ChangeLog b/console-client/ChangeLog index 77ba9434..94131588 100644 --- a/console-client/ChangeLog +++ b/console-client/ChangeLog @@ -1,3 +1,10 @@ +2003-07-14 Marco Gerards + + * vga.c: New global variable vga_display_max_glyphs. + (parse_startup_args): New macro PARSE_FONT_OPT_NOARGS. + (parse_startup_args): Parse "--max-colors" and "--max-glyphs". + (vga_display_init): Set disp->df_size to match the color setting. + 2003-02-24 Marco Gerards * pc-kbd.c (sc_set1_to_set2): Map the set2 scancodes for F11 and diff --git a/console-client/vga.c b/console-client/vga.c index 304adbc1..d1d73e39 100644 --- a/console-client/vga.c +++ b/console-client/vga.c @@ -1,5 +1,5 @@ /* vga.c - The VGA device display driver. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. Written by Marcus Brinkmann. This file is part of the GNU Hurd. @@ -62,6 +62,9 @@ static char *vga_display_font_bold; "/lib/hurd/fonts/vga-system-bold-italic.bdf" static char *vga_display_font_bold_italic; +/* If false use all colors, else use double font slots. */ +static int vga_display_max_glyphs; + /* The timer used for flashing the screen. */ static struct timer_list vga_display_timer; @@ -171,12 +174,24 @@ parse_startup_args (int no_exit, int argc, char *argv[], int *next) } \ } while (0) +#define PARSE_FONT_OPT_NOARGS(x,y,z) \ + { \ + if (!strcmp (argv[*next], x)) \ + { \ + (*next)++; \ + vga_display_##y = z; \ + } \ + } + while (*next < argc) { PARSE_FONT_OPT ("--font", font); PARSE_FONT_OPT ("--font-italic", font_italic); PARSE_FONT_OPT ("--font-bold", font_bold); PARSE_FONT_OPT ("--font-bold-italic", font_bold_italic); + PARSE_FONT_OPT_NOARGS ("--max-colors", max_glyphs, 1); + PARSE_FONT_OPT_NOARGS ("--max-glyphs", max_glyphs, 0); + break; } @@ -206,8 +221,7 @@ vga_display_init (void **handle, int no_exit, int argc, char *argv[], int *next) if (!disp) return ENOMEM; - /* Set this to 256 for full color support. */ - disp->df_size = 512; + disp->df_size = vga_display_max_glyphs ? 512 : 256; disp->width = VGA_DISP_WIDTH; disp->height = VGA_DISP_HEIGHT; -- cgit v1.2.3