1--- vga.c	2005-12-19 23:51:53.000000000 +0100
2+++ vga2.c	2006-04-10 20:21:56.000000000 +0200
3@@ -788,22 +788,38 @@
4
5 static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
6 {
7+#if __LITTLE_ENDIAN__
8+    return ((b >> 5) << 5) | ((g >> 5) << 2) | (r >> 6);
9+#else
10     return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
11+#endif
12 }
13
14 static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
15 {
16+#if __LITTLE_ENDIAN__
17+    return ((b >> 3) << 10) | ((g >> 3) << 5) | (r >> 3);
18+#else
19     return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
20+#endif
21 }
22
23 static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
24 {
25+#if __LITTLE_ENDIAN__
26+    return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3);
27+#else
28     return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
29+#endif
30 }
31
32 static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
33 {
34+#if __LITTLE_ENDIAN__
35+    return (b << 16) | (g << 8) | r;
36+#else
37     return (r << 16) | (g << 8) | b;
38+#endif
39 }
40
41 #define DEPTH 8
42