From 38f5d13943b714c8f209628d287f460730706a10 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 9 Mar 2006 16:57:32 +0000 Subject: [PATCH] * Fixed VGA colours. The values only range from 0 to 63. --- caca/driver_vga.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/caca/driver_vga.c b/caca/driver_vga.c index a785636..d6285ba 100644 --- a/caca/driver_vga.c +++ b/caca/driver_vga.c @@ -31,23 +31,24 @@ static uint8_t const vga_colors[][4] = { - { 0, 0x20, 0x20, 0x20 }, - { 1, 0x20, 0x20, 0x7f }, - { 2, 0x20, 0x7f, 0x20 }, - { 3, 0x20, 0x7f, 0x7f }, - { 4, 0x7f, 0x20, 0x20 }, - { 5, 0x7f, 0x20, 0x7f }, - { 0x14, 0x7f, 0x7f, 0x20 }, - { 7, 0x7f, 0x7f, 0x7f }, - - { 0x38, 0x40, 0x40, 0x40 }, - { 0x39, 0x40, 0x40, 0xff }, - { 0x3a, 0x40, 0xff, 0x40 }, - { 0x3b, 0x40, 0xff, 0xff }, - { 0x3c, 0xff, 0x40, 0x40 }, - { 0x3d, 0xff, 0x40, 0xff }, - { 0x3e, 0xff, 0xff, 0x40 }, - { 0x3f, 0xff, 0xff, 0xff } + /* Colour values range from 0x00 to 0x3f */ + { 0, 0x00, 0x00, 0x00 }, + { 1, 0x00, 0x00, 0x1f }, + { 2, 0x00, 0x1f, 0x00 }, + { 3, 0x00, 0x1f, 0x1f }, + { 4, 0x1f, 0x00, 0x00 }, + { 5, 0x1f, 0x00, 0x1f }, + { 0x14, 0x1f, 0x1f, 0x00 }, + { 7, 0x1f, 0x1f, 0x1f }, + + { 0x38, 0x0f, 0x0f, 0x0f }, + { 0x39, 0x0f, 0x0f, 0x3f }, + { 0x3a, 0x0f, 0x3f, 0x0f }, + { 0x3b, 0x0f, 0x3f, 0x3f }, + { 0x3c, 0x3f, 0x0f, 0x0f }, + { 0x3d, 0x3f, 0x0f, 0x3f }, + { 0x3e, 0x3f, 0x3f, 0x0f }, + { 0x3f, 0x3f, 0x3f, 0x3f }, }; static int vga_init_graphics(caca_t *kk)