1
0
Fork 0
forked from len0rd/rockbox

Small iPod colour BMP fix by linuxstd

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8504 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Christi Scarborough 2006-01-31 14:29:51 +00:00
parent cce79d3805
commit ae0ae6d5cf
3 changed files with 7 additions and 10 deletions

View file

@ -326,6 +326,10 @@ bool wps_data_preload_tags(struct wps_data *data, char *buf,
if (ret > 0) if (ret > 0)
{ {
#if LCD_DEPTH == 16
if (ret % 2) ret++;
/* Always consume an even number of bytes */
#endif
/* Update the image cache. */ /* Update the image cache. */
if (bmp_cache_write && bmp_cache_fd >= 0) if (bmp_cache_write && bmp_cache_fd >= 0)
{ {

View file

@ -68,11 +68,6 @@ struct rgb_quad { /* Little endian */
unsigned char reserved; unsigned char reserved;
} STRUCT_PACKED; } STRUCT_PACKED;
#ifdef ROCKBOX_LITTLE_ENDIAN
#define readshort(x) *(x)
#define readlong(x) *(x)
#else
/* big endian functions */ /* big endian functions */
static short readshort(short *value) { static short readshort(short *value) {
unsigned char* bytes = (unsigned char*) value; unsigned char* bytes = (unsigned char*) value;
@ -85,8 +80,6 @@ static long readlong(long *value) {
((long)bytes[2] << 16) | ((long)bytes[3] << 24); ((long)bytes[2] << 16) | ((long)bytes[3] << 24);
} }
#endif
unsigned char brightness(struct rgb_quad color) unsigned char brightness(struct rgb_quad color)
{ {
return (3 * (unsigned int)color.red + 6 * (unsigned int)color.green return (3 * (unsigned int)color.red + 6 * (unsigned int)color.green

View file

@ -159,9 +159,9 @@ bool button_hold(void);
#define BUTTON_MENU 0x0002 #define BUTTON_MENU 0x0002
#define BUTTON_PLAY 0x0004 #define BUTTON_PLAY 0x0004
#define BUTTON_SELECT 0x0008 #define BUTTON_SELECT 0x0001
#define BUTTON_SCROLL_FWD 0x0010 #define BUTTON_SCROLL_FWD 0x0008
#define BUTTON_SCROLL_BACK 0x0020 #define BUTTON_SCROLL_BACK 0x0010
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD