From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reinhard Arlt Date: Fri, 21 Mar 2014 14:54:04 +0100 Subject: [U-Boot] Wired cursor colors.... Message-ID: <532C447C.6080802@esd.eu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, here is an idea, how to fix the void video_invertchar(int xx, int yy) routine in cfb_console.c This is not a patch yet, just a idea. Reinhard diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 904caf7..33d5a2c 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -619,8 +619,37 @@ static void video_invertchar(int xx, int yy) int x, y; for (y = firsty; y < lasty; y += VIDEO_LINE_LEN) { for (x = firstx; x < lastx; x++) { - u8 *dest = (u8 *)(video_fb_address) + x + y; - *dest = ~*dest; + u8 *dest8; + u16 *dest16; + u32 *dest32; + + switch (VIDEO_DATA_FORMAT) { + case GDF__8BIT_INDEX: + dest8 = (u8 *)(video_fb_address) + x + y; + + *dest8 ^= 0x01; + break; + + case GDF__8BIT_332RGB: + dest8 = (u8 *)(video_fb_address) + x + y; + + *dest8 = ~*dest8; + break; + + case GDF_15BIT_555RGB: + case GDF_16BIT_565RGB: + dest16 = (u16 *)(video_fb_address) + x + y; + + *dest16 = ~*dest16; + break; + + case GDF_32BIT_X888RGB: + case GDF_24BIT_888RGB: + dest32 = (u32 *)(video_fb_address) + x + y; + + *dest32 = ~*dest32; + break; + } } } }