mirror of
https://github.com/gwenhael-le-moine/x49gp.git
synced 2024-12-27 21:58:33 +01:00
41 lines
1.1 KiB
Diff
41 lines
1.1 KiB
Diff
--- vga.c 2005-12-19 23:51:53.000000000 +0100
|
|
+++ vga2.c 2006-04-10 20:21:56.000000000 +0200
|
|
@@ -788,22 +788,38 @@
|
|
|
|
static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
|
|
{
|
|
+#if __LITTLE_ENDIAN__
|
|
+ return ((b >> 5) << 5) | ((g >> 5) << 2) | (r >> 6);
|
|
+#else
|
|
return ((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6);
|
|
+#endif
|
|
}
|
|
|
|
static inline unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned b)
|
|
{
|
|
+#if __LITTLE_ENDIAN__
|
|
+ return ((b >> 3) << 10) | ((g >> 3) << 5) | (r >> 3);
|
|
+#else
|
|
return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
|
|
+#endif
|
|
}
|
|
|
|
static inline unsigned int rgb_to_pixel16(unsigned int r, unsigned int g, unsigned b)
|
|
{
|
|
+#if __LITTLE_ENDIAN__
|
|
+ return ((b >> 3) << 11) | ((g >> 2) << 5) | (r >> 3);
|
|
+#else
|
|
return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
|
|
+#endif
|
|
}
|
|
|
|
static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b)
|
|
{
|
|
+#if __LITTLE_ENDIAN__
|
|
+ return (b << 16) | (g << 8) | r;
|
|
+#else
|
|
return (r << 16) | (g << 8) | b;
|
|
+#endif
|
|
}
|
|
|
|
#define DEPTH 8
|