Skip to contentSkip to conversation

fix blue feet by 24bpp

PATCH New Alexander Kern 1 participant 1 message Oct 17, 2004 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix blue feet by 24bpp

Hello, I have investigate, that blue feet by penguin in fbtest and 24bpp deep was caused by error in cfb24.c.
This patch fix it for me

But I have steel problems in test 007 and 008

I have posted photo pixs on
http://home.arcor.de/alexander.khe/atyfb/fbtest-results/

Is it the similar problems with byte separation?

Cheers
Alex

cfb24.c renamed from cfb24.c.orig +3 -3
@@ -33,9 +33,9 @@ static void cfb24_setpixel(u32 x, u32 y,
     u8 *dst;
 
     dst = &screen[y*screen_width+x*3];
-    dst[0] = (pixel >> 16) & 0xff;
+    dst[2] = (pixel >> 16) & 0xff;
     dst[1] = (pixel >> 8) & 0xff;
-    dst[2] = pixel & 0xff;
+    dst[0] = pixel & 0xff;
 }
 
 static pixel_t cfb24_getpixel(u32 x, u32 y)
@@ -43,7 +43,7 @@ static pixel_t cfb24_getpixel(u32 x, u32
     const u8 *src;
 
     src = &screen[y*screen_width+x*3];
-    return (src[0] << 16) | (src[1] << 8) | src[2];
+    return (src[2] << 16) | (src[1] << 8) | src[0];
 }
 
 const struct drawops cfb24_drawops = {