From 260f8d3480d5c9ae2f8973050dd4c383baeda687 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 19 Nov 2005 02:06:46 +0000 Subject: Add LCD_PIXELFORMAT config variable to distinguish between the two types of 16-bit framebuffers (the ipod framebuffer is byte-swapped) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7977 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-h300.h | 1 + firmware/export/config-ipodcolor.h | 6 ++++++ firmware/export/config-ipodnano.h | 6 ++++++ firmware/export/config.h | 4 ++++ firmware/export/lcd.h | 2 +- 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index a3d07a6..256cdea 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h @@ -19,6 +19,7 @@ #define LCD_WIDTH 220 #define LCD_HEIGHT 176 #define LCD_DEPTH 16 /* 65k colours */ +#define LCD_PIXELFORMAT RGB565 /* rgb565 */ /* remote LCD */ #define LCD_REMOTE_WIDTH 128 diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 6666ab2..dfce0e7 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h @@ -1,3 +1,8 @@ +/* + * This config file is for the Apple iPod Color/Photo + */ +#define APPLE_IPODCOLOR 1 + /* For Rolo and boot loader */ #define MODEL_NUMBER 3 @@ -14,6 +19,7 @@ #define LCD_WIDTH 220 #define LCD_HEIGHT 176 #define LCD_DEPTH 16 /* 65536 colours */ +#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ #define CONFIG_KEYPAD IPOD_4G_PAD diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index 111aec2..c8ea590 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h @@ -1,3 +1,8 @@ +/* + * This config file is for the Apple iPod Nano + */ +#define APPLE_IPODNANO 1 + /* For Rolo and boot loader */ #define MODEL_NUMBER 4 @@ -14,6 +19,7 @@ #define LCD_WIDTH 176 #define LCD_HEIGHT 132 #define LCD_DEPTH 16 /* 65536 colours */ +#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ #define CONFIG_KEYPAD IPOD_NANO_PAD diff --git a/firmware/export/config.h b/firmware/export/config.h index ea047cb..9764afd 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -76,6 +76,10 @@ #define LCD_IPODCOLOR 6 /* as used by iPod Color/Photo */ #define LCD_IPODNANO 7 /* as used by iPod Nano */ +/* LCD_PIXELFORMAT */ +#define RGB565 565 +#define RGB565SWAPPED 3553 + /* CONFIG_BACKLIGHT */ #define BL_PA14_LO 0 /* Player, PA14 low active */ #define BL_RTC 1 /* Recorder, RTC square wave output */ diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 48244fe..bd9c49f 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -146,7 +146,7 @@ typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned #define _RGBPACK(r, g, b) ( ((((r) * 31 + 127) / 255) << 11) \ |((((g) * 63 + 127) / 255) << 5) \ | (((b) * 31 + 127) / 255)) -#if (CONFIG_LCD == LCD_IPODCOLOR) || (CONFIG_LCD == LCD_IPODNANO) +#if (LCD_PIXELFORMAT == RGB565SWAPPED) #define LCD_RGBPACK(r, g, b) ( ((_RGBPACK((r), (g), (b)) & 0xff00) >> 8) \ |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8)) #else -- cgit v1.1