summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2006-02-05 00:17:53 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2006-02-05 00:17:53 +0000
commit39ecd72bd579a7519f27bf30d9292af24c353db9 (patch)
tree5ea94ede0ffa7d76968fb2b4507405cdd444be3b
parentbead47c17a41c375e1cccec609af3c1d4cc1b87b (diff)
downloadrockbox-39ecd72bd579a7519f27bf30d9292af24c353db9.zip
rockbox-39ecd72bd579a7519f27bf30d9292af24c353db9.tar.gz
rockbox-39ecd72bd579a7519f27bf30d9292af24c353db9.tar.bz2
rockbox-39ecd72bd579a7519f27bf30d9292af24c353db9.tar.xz
The iAudio X5 LCD is 18 bits
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8572 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-iaudiox5.h2
-rw-r--r--firmware/export/lcd.h11
2 files changed, 12 insertions, 1 deletions
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 246b00c..4f0d183 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -17,7 +17,7 @@
/* LCD dimensions */
#define LCD_WIDTH 160
#define LCD_HEIGHT 128
-#define LCD_DEPTH 16 /* 262.144 colors but we use 16bit for now */
+#define LCD_DEPTH 18 /* pseudo 262.144 colors */
/* remote LCD */
#define LCD_REMOTE_WIDTH 128
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 6375031..08f5f69 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -40,6 +40,8 @@
typedef unsigned char fb_data;
#elif LCD_DEPTH <= 16
typedef unsigned short fb_data;
+#else
+typedef unsigned long fb_data;
#endif
/* common functions */
@@ -157,6 +159,13 @@ typedef void lcd_fastpixelfunc_type(fb_data *address);
#else
#define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b))
#endif
+#elif LCD_DEPTH == 18
+#define LCD_MAX_RED 63
+#define LCD_MAX_GREEN 63
+#define LCD_MAX_BLUE 63
+#define LCD_RGBPACK(r, g, b) ( ((((r) * 63 + 127) / 255) << 12) \
+ |((((g) * 63 + 127) / 255) << 6) \
+ | (((b) * 63 + 127) / 255))
#else
/* other colour depths */
#endif
@@ -187,6 +196,8 @@ extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
#elif LCD_DEPTH == 16
extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH];
+#elif LCD_DEPTH == 18
+extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH];
#endif
#if CONFIG_BACKLIGHT==BL_IRIVER_H300