From 39ecd72bd579a7519f27bf30d9292af24c353db9 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sun, 5 Feb 2006 00:17:53 +0000 Subject: The iAudio X5 LCD is 18 bits git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8572 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-iaudiox5.h | 2 +- firmware/export/lcd.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'firmware') diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index 246b00c963..4f0d183f6c 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 6375031594..08f5f694b9 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 -- cgit v1.2.3