summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-02-26 02:48:05 +0000
committerDave Chapman <dave@dchapman.com>2006-02-26 02:48:05 +0000
commit603f87fe3c0557cb31386fb89c0a49fb72102735 (patch)
treefa75366ddf1a1dc293e49ec29b9944d448da6c67 /firmware
parentdd2a5294d67266e5cf7b8739d645a2cf6edd7a28 (diff)
downloadrockbox-603f87fe3c0557cb31386fb89c0a49fb72102735.tar.gz
rockbox-603f87fe3c0557cb31386fb89c0a49fb72102735.zip
Foreground/Background colour settings. Based on patch #3050 by Jonathan Gordon, extended my me. The principle of the patch is that the three sliders contain the native ranges (currently 0..31, 0..63, 0..31), and the equivalent RGB888 colour is displayed underneath. The config block (and global_settings struct) contain the native value for the fg/bg colours (either RGB565 or RGB565SWAPPED), but the text .cfg files contain the RGB888 value written as 6 hex digits.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8840 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/lcd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index ba0e216990..6f7fef94ee 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -150,6 +150,9 @@ typedef void lcd_fastpixelfunc_type(fb_data *address);
150#define LCD_MAX_RED 31 150#define LCD_MAX_RED 31
151#define LCD_MAX_GREEN 63 151#define LCD_MAX_GREEN 63
152#define LCD_MAX_BLUE 31 152#define LCD_MAX_BLUE 31
153#define _RGB_UNPACK_RED(x) ((((x) >> 8) & 0xf8) | ((x) >> 13))
154#define _RGB_UNPACK_GREEN(x) ((((x) >> 3) & 0xfc) | (((x) >> 9) & 0x03))
155#define _RGB_UNPACK_BLUE(x) ((((x) << 3) & 0xf8) | (((x) >> 2) & 0x07))
153#define _RGBPACK(r, g, b) ( ((((r) * (31*257) + (127*257)) >> 16) << 11) \ 156#define _RGBPACK(r, g, b) ( ((((r) * (31*257) + (127*257)) >> 16) << 11) \
154 |((((g) * (63*257) + (127*257)) >> 16) << 5) \ 157 |((((g) * (63*257) + (127*257)) >> 16) << 5) \
155 | (((b) * (31*257) + (127*257)) >> 16)) 158 | (((b) * (31*257) + (127*257)) >> 16))
@@ -158,8 +161,14 @@ typedef void lcd_fastpixelfunc_type(fb_data *address);
158#if (LCD_PIXELFORMAT == RGB565SWAPPED) 161#if (LCD_PIXELFORMAT == RGB565SWAPPED)
159#define LCD_RGBPACK(r, g, b) ( ((_RGBPACK((r), (g), (b)) & 0xff00) >> 8) \ 162#define LCD_RGBPACK(r, g, b) ( ((_RGBPACK((r), (g), (b)) & 0xff00) >> 8) \
160 |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8)) 163 |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8))
164#define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(swap16(x))
165#define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(swap16(x))
166#define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(swap16(x))
161#else 167#else
162#define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b)) 168#define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b))
169#define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(x)
170#define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(x)
171#define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(x)
163#endif 172#endif
164#elif LCD_DEPTH == 18 173#elif LCD_DEPTH == 18
165#define LCD_MAX_RED 63 174#define LCD_MAX_RED 63