]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/vidconsole-uclass.c
Merge branch 'master' of git://git.denx.de/u-boot-socfpga
[u-boot] / drivers / video / vidconsole-uclass.c
index d32b1017581dd962271c20bff97ff263cb1db5da..f1d3ad36118112759fab46a9ad4670bcb420842f 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2015 Google, Inc
  * (C) Copyright 2001-2015
  * DENX Software Engineering -- wd@denx.de
  * Compulab Ltd - http://compulab.co.il/
  * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -13,7 +12,7 @@
 #include <dm.h>
 #include <video.h>
 #include <video_console.h>
-#include <video_font.h>                /* Get font data, width and height */
+#include <video_font.h>                /* Bitmap font for code page 437 */
 
 /*
  * Structure to describe a console color
@@ -119,12 +118,20 @@ static void vidconsole_newline(struct udevice *dev)
 
 static const struct vid_rgb colors[VID_COLOR_COUNT] = {
        { 0x00, 0x00, 0x00 },  /* black */
-       { 0xff, 0x00, 0x00 },  /* red */
-       { 0x00, 0xff, 0x00 },  /* green */
+       { 0xc0, 0x00, 0x00 },  /* red */
+       { 0x00, 0xc0, 0x00 },  /* green */
+       { 0xc0, 0x60, 0x00 },  /* brown */
+       { 0x00, 0x00, 0xc0 },  /* blue */
+       { 0xc0, 0x00, 0xc0 },  /* magenta */
+       { 0x00, 0xc0, 0xc0 },  /* cyan */
+       { 0xc0, 0xc0, 0xc0 },  /* light gray */
+       { 0x80, 0x80, 0x80 },  /* gray */
+       { 0xff, 0x00, 0x00 },  /* bright red */
+       { 0x00, 0xff, 0x00 },  /* bright green */
        { 0xff, 0xff, 0x00 },  /* yellow */
-       { 0x00, 0x00, 0xff },  /* blue */
-       { 0xff, 0x00, 0xff },  /* magenta */
-       { 0x00, 0xff, 0xff },  /* cyan */
+       { 0x00, 0x00, 0xff },  /* bright blue */
+       { 0xff, 0x00, 0xff },  /* bright magenta */
+       { 0x00, 0xff, 0xff },  /* bright cyan */
        { 0xff, 0xff, 0xff },  /* white */
 };
 
@@ -278,10 +285,22 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
                        s++;
 
                        switch (val) {
+                       case 0:
+                               /* all attributes off */
+                               video_set_default_colors(vid_priv);
+                               break;
+                       case 1:
+                               /* bold */
+                               vid_priv->fg_col_idx |= 8;
+                               vid_priv->colour_fg = vid_console_color(
+                                               vid_priv, vid_priv->fg_col_idx);
+                               break;
                        case 30 ... 37:
                                /* foreground color */
+                               vid_priv->fg_col_idx &= ~7;
+                               vid_priv->fg_col_idx |= val - 30;
                                vid_priv->colour_fg = vid_console_color(
-                                                       vid_priv, val - 30);
+                                               vid_priv, vid_priv->fg_col_idx);
                                break;
                        case 40 ... 47:
                                /* background color */