]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-06-17 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Tue, 17 Jun 2008 15:27:14 +0000 (15:27 +0000)
committerrobertmh <robertmh@localhost>
Tue, 17 Jun 2008 15:27:14 +0000 (15:27 +0000)
        * 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.

ChangeLog
term/ieee1275/ofconsole.c

index efef229bdbc082b171d1d926dc3174fcd84a007b..0d25eada9a27495facf239745a0bde437bb0df57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-06-17  Robert Millan  <rmh@aybabtu.com>
+
+       * 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  <rmh@aybabtu.com>
 
        * util/update-grub_lib.in (prepare_grub_to_access_device): Use
index 3b269ce9afaaf2c464f7f70699e4a2ab44ae1e2b..dd60de6f2f6dbb2ce086ea2edfb767476e9065a8 100644 (file)
@@ -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