diff --git a/ChangeLog b/ChangeLog index efef229bd..0d25eada9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-17 Robert Millan + + * term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables. + (grub_ofconsole_normal_color, grub_ofconsole_highlight_color): New + variables. + (grub_ofconsole_setcolor, grub_ofconsole_getcolor): Load/store + values in grub_ofconsole_normal_color and + grub_ofconsole_highlight_color (they're not directly related to + background and foreground). + (grub_ofconsole_setcolorstate): Extract background and foreground + from grub_ofconsole_normal_color and grub_ofconsole_highlight_color. + 2008-06-17 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Use diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 3b269ce9a..dd60de6f2 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -56,8 +56,8 @@ static struct color colors[8] = { MAX, MAX, MAX} }; -static int fgcolor = 7; -static int bgcolor = 0; +static grub_uint8_t grub_ofconsole_normal_color = 0x7; +static grub_uint8_t grub_ofconsole_highlight_color = 0x70; /* Write control characters to the console. */ static void @@ -109,12 +109,12 @@ grub_ofconsole_setcolorstate (grub_term_color_state state) { case GRUB_TERM_COLOR_STANDARD: case GRUB_TERM_COLOR_NORMAL: - fg = fgcolor; - bg = bgcolor; + fg = grub_ofconsole_normal_color & 0x0f; + bg = grub_ofconsole_normal_color >> 4; break; case GRUB_TERM_COLOR_HIGHLIGHT: - fg = bgcolor; - bg = fgcolor; + fg = grub_ofconsole_highlight_color & 0x0f; + bg = grub_ofconsole_highlight_color >> 4; break; default: return; @@ -128,15 +128,15 @@ static void grub_ofconsole_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) { - fgcolor = normal_color; - bgcolor = highlight_color; + grub_ofconsole_normal_color = normal_color; + grub_ofconsole_highlight_color = highlight_color; } static void grub_ofconsole_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) { - *normal_color = fgcolor; - *highlight_color = bgcolor; + *normal_color = grub_ofconsole_normal_color; + *highlight_color = grub_ofconsole_highlight_color; } static int