diff --git a/apps/misc.c b/apps/misc.c index 6e871acd3b..43dfd45e51 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -344,19 +344,20 @@ int fast_readline(int fd, char *buf, int buf_size, void *parameters, #if LCD_DEPTH == 16 #define BMP_COMPRESSION 3 /* BI_BITFIELDS */ #define BMP_NUMCOLORS 3 -#else +#else /* LCD_DEPTH != 16 */ #define BMP_COMPRESSION 0 /* BI_RGB */ #if LCD_DEPTH <= 8 -#define BMP_NUMCOLORS (1 << LCD_DEPTH) +#ifdef HAVE_LCD_SPLIT +#define BMP_NUMCOLORS (2 << LCD_DEPTH) #else +#define BMP_NUMCOLORS (1 << LCD_DEPTH) +#endif +#else /* LCD_DEPTH > 8 */ #define BMP_NUMCOLORS 0 -#endif -#endif +#endif /* LCD_DEPTH > 8 */ +#endif /* LCD_DEPTH != 16 */ -#if LCD_DEPTH == 1 -#define BMP_BPP 1 -#define BMP_LINESIZE ((LCD_WIDTH/8 + 3) & ~3) -#elif LCD_DEPTH <= 4 +#if LCD_DEPTH <= 4 #define BMP_BPP 4 #define BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3) #elif LCD_DEPTH <= 8 @@ -386,7 +387,7 @@ static const unsigned char bmpheader[] = 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ LE32_CONST(LCD_WIDTH), /* Width in pixels */ - LE32_CONST(LCD_HEIGHT), /* Height in pixels */ + LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */ 0x01, 0x00, /* Number of planes (always 1) */ LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ LE32_CONST(BMP_COMPRESSION),/* Compression mode */ @@ -397,22 +398,26 @@ static const unsigned char bmpheader[] = LE32_CONST(BMP_NUMCOLORS), /* Number of important colours */ #if LCD_DEPTH == 1 -#ifdef MROBE_100 - 2, 2, 94, 0x00, /* Colour #0 */ - 3, 6, 241, 0x00 /* Colour #1 */ -#else - 0x90, 0xee, 0x90, 0x00, /* Colour #0 */ - 0x00, 0x00, 0x00, 0x00 /* Colour #1 */ +#ifdef HAVE_NEGATIVE_LCD + BMP_COLOR(LCD_BL_DARKCOLOR), + BMP_COLOR(LCD_BL_BRIGHTCOLOR), +#ifdef HAVE_LCD_SPLIT + BMP_COLOR(LCD_BL_DARKCOLOR_2), + BMP_COLOR(LCD_BL_BRIGHTCOLOR_2), #endif +#else /* positive display */ + BMP_COLOR(LCD_BL_BRIGHTCOLOR), + BMP_COLOR(LCD_BL_DARKCOLOR), +#endif /* positive display */ #elif LCD_DEPTH == 2 - 0xe6, 0xd8, 0xad, 0x00, /* Colour #0 */ - 0x99, 0x90, 0x73, 0x00, /* Colour #1 */ - 0x4c, 0x48, 0x39, 0x00, /* Colour #2 */ - 0x00, 0x00, 0x00, 0x00 /* Colour #3 */ + BMP_COLOR(LCD_BL_BRIGHTCOLOR), + BMP_COLOR_MIX(LCD_BL_BRIGHTCOLOR, LCD_BL_DARKCOLOR, 1, 3), + BMP_COLOR_MIX(LCD_BL_BRIGHTCOLOR, LCD_BL_DARKCOLOR, 2, 3), + BMP_COLOR(LCD_BL_DARKCOLOR), #elif LCD_DEPTH == 16 0x00, 0xf8, 0x00, 0x00, /* red bitfield mask */ 0xe0, 0x07, 0x00, 0x00, /* green bitfield mask */ - 0x1f, 0x00, 0x00, 0x00 /* blue bitfield mask */ + 0x1f, 0x00, 0x00, 0x00, /* blue bitfield mask */ #endif }; @@ -461,30 +466,33 @@ void screen_dump(void) for (by = LCD_FBHEIGHT - 1; by >= 0; by--) { unsigned char *src = &lcd_framebuffer[by][0]; - unsigned char *dst = &line_block[0][0]; + unsigned char *dst = &line_block[7][0]; memset(line_block, 0, sizeof(line_block)); - for (bx = LCD_WIDTH/8; bx > 0; bx--) + +#ifdef HAVE_LCD_SPLIT + if (by == (LCD_SPLIT_POS/8 - 1)) + write(fh, line_block, LCD_SPLIT_LINES * sizeof(line_block[0])); +#endif + for (bx = LCD_WIDTH/2; bx > 0; bx--) { - unsigned dst_mask = 0x80; - int ix; + unsigned char *dst_blk = dst++; + unsigned src_byte0 = *src++ << 4; + unsigned src_byte1 = *src++; + int iy; - for (ix = 8; ix > 0; ix--) + for (iy = 8; iy > 0; iy--) { - unsigned char *dst_blk = dst; - unsigned src_byte = *src++; - int iy; - - for (iy = 8; iy > 0; iy--) - { - if (src_byte & 0x80) - *dst_blk |= dst_mask; - src_byte <<= 1; - dst_blk += BMP_LINESIZE; - } - dst_mask >>= 1; + *dst_blk = (src_byte0 & 0x10) + | (src_byte1 & 0x01) +#ifdef HAVE_LCD_SPLIT + | (by < (LCD_SPLIT_POS/8) ? 0x22 : 0) +#endif + ; + src_byte0 >>= 1; + src_byte1 >>= 1; + dst_blk -= BMP_LINESIZE; } - dst++; } write(fh, line_block, sizeof(line_block)); diff --git a/apps/misc.h b/apps/misc.h index 22ae4849a4..99e709c2c8 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -93,6 +93,18 @@ void screen_dump(void); void screen_dump_set_hook(void (*hook)(int fh)); #endif +/* Make BMP colour map entries from R, G, B triples, without and with blending. + * Not within HAVE_LCD_BITMAP because it is also used for the Player sim */ +#define RED_CMP(c) (((c) >> 16) & 0xff) +#define GREEN_CMP(c) (((c) >> 8) & 0xff) +#define BLUE_CMP(c) ((c) & 0xff) + +#define BMP_COLOR(c) BLUE_CMP(c), GREEN_CMP(c), RED_CMP(c), 0 +#define BMP_COLOR_MIX(c1, c2, num, den) \ + (BLUE_CMP(c2) - BLUE_CMP(c1)) * (num) / (den) + BLUE_CMP(c1), \ + (GREEN_CMP(c2) - GREEN_CMP(c1)) * (num) / (den) + GREEN_CMP(c1), \ + (RED_CMP(c2) - RED_CMP(c1)) * (num) / (den) + RED_CMP(c1), 0 + bool settings_parseline(char* line, char** name, char** value); long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); long default_event_handler(long event); diff --git a/apps/plugin.c b/apps/plugin.c index 8828d10aa7..3b14b0032f 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -61,7 +61,7 @@ static unsigned char pluginbuf[PLUGIN_BUFFER_SIZE]; void *sim_plugin_load(char *plugin, void **pd); void sim_plugin_close(void *pd); -void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int)); +void sim_lcd_ex_init(unsigned long (*getpixel)(int, int)); void sim_lcd_ex_update_rect(int x, int y, int width, int height); #else #define sim_plugin_close(x) diff --git a/apps/plugin.h b/apps/plugin.h index 2017bf3e5b..82ce0d6ddf 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -126,12 +126,12 @@ void* plugin_get_buffer(size_t *buffer_size); #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 141 +#define PLUGIN_API_VERSION 142 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 141 +#define PLUGIN_MIN_API_VERSION 142 /* plugin return codes */ enum plugin_status { @@ -474,7 +474,7 @@ struct plugin_api { #ifdef SIMULATOR /* special simulator hooks */ #if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8 - void (*sim_lcd_ex_init)(int shades, unsigned long (*getpixel)(int, int)); + void (*sim_lcd_ex_init)(unsigned long (*getpixel)(int, int)); void (*sim_lcd_ex_update_rect)(int x, int y, int width, int height); #endif #endif diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c index c73f0cdf52..a7e8f2a08b 100644 --- a/apps/plugins/lib/grey_core.c +++ b/apps/plugins/lib/grey_core.c @@ -355,6 +355,7 @@ static inline void _deferred_update(void) * coordinates! */ static unsigned long _grey_get_pixel(int x, int y) { + long val; int xg = x - _grey_info.x; int yg = y - _grey_info.y; #if LCD_PIXELFORMAT == HORIZONTAL_PACKING @@ -364,7 +365,11 @@ static unsigned long _grey_get_pixel(int x, int y) + (xg << _GREY_BSHIFT) + (~yg & _GREY_BMASK); #endif - return _grey_info.values[idx] + (1 << LCD_DEPTH); + val = _grey_info.values[idx]; +#ifdef HAVE_LCD_SPLIT + val -= val >> 7; +#endif + return val; } #else /* !SIMULATOR */ @@ -634,9 +639,9 @@ void grey_show(bool enable) { _grey_info.flags |= _GREY_RUNNING; #ifdef SIMULATOR - rb->sim_lcd_ex_init(129, _grey_get_pixel); + rb->sim_lcd_ex_init(_grey_get_pixel); rb->sim_lcd_ex_update_rect(_grey_info.x, _grey_info.y, - _grey_info.width, _grey_info.height); + _grey_info.width, _grey_info.height); #else /* !SIMULATOR */ #ifdef NEED_BOOST rb->cpu_boost(true); @@ -655,7 +660,7 @@ void grey_show(bool enable) else if (!enable && (_grey_info.flags & _GREY_RUNNING)) { #ifdef SIMULATOR - rb->sim_lcd_ex_init(0, NULL); + rb->sim_lcd_ex_init(NULL); #else /* !SIMULATOR */ rb->timer_unregister(); #if NUM_CORES > 1 /* Make sure the ISR has finished before calling lcd_update() */ @@ -702,9 +707,14 @@ void grey_deferred_lcd_update(void) /*** Screenshot ***/ -#define BMP_FIXEDCOLORS (1 << LCD_DEPTH) -#define BMP_VARCOLORS 129 -#define BMP_NUMCOLORS (BMP_FIXEDCOLORS + BMP_VARCOLORS) +#ifdef HAVE_LCD_SPLIT +#define GRADIENT_MAX 127 +#define BMP_NUMCOLORS 256 +#else +#define GRADIENT_MAX 128 +#define BMP_NUMCOLORS 129 +#endif + #define BMP_BPP 8 #define BMP_LINESIZE ((LCD_WIDTH + 3) & ~3) #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) @@ -723,7 +733,7 @@ static const unsigned char bmpheader[] = 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ LE32_CONST(LCD_WIDTH), /* Width in pixels */ - LE32_CONST(LCD_HEIGHT), /* Height in pixels */ + LE32_CONST(LCD_HEIGHT+LCD_SPLIT_LINES), /* Height in pixels */ 0x01, 0x00, /* Number of planes (always 1) */ LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ 0x00, 0x00, 0x00, 0x00, /* Compression mode, 0 = none */ @@ -732,36 +742,11 @@ static const unsigned char bmpheader[] = 0xc4, 0x0e, 0x00, 0x00, /* Vertical resolution (pixels/meter) */ LE32_CONST(BMP_NUMCOLORS), /* Number of used colours */ LE32_CONST(BMP_NUMCOLORS), /* Number of important colours */ - - /* Fixed colours */ -#if LCD_DEPTH == 1 - 0x90, 0xee, 0x90, 0x00, /* Colour #0 */ - 0x00, 0x00, 0x00, 0x00 /* Colour #1 */ -#elif LCD_DEPTH == 2 - 0xe6, 0xd8, 0xad, 0x00, /* Colour #0 */ - 0x99, 0x90, 0x73, 0x00, /* Colour #1 */ - 0x4c, 0x48, 0x39, 0x00, /* Colour #2 */ - 0x00, 0x00, 0x00, 0x00 /* Colour #3 */ -#endif }; -#if LCD_DEPTH == 1 -#ifdef MROBE_100 -#define BMP_RED 241 -#define BMP_GREEN 6 -#define BMP_BLUE 3 -#define BMP_RED_BASE 94 -#define BMP_GREEN_BASE 2 -#define BMP_BLUE_BASE 2 -#else -#define BMP_RED 0x90 -#define BMP_GREEN 0xee -#define BMP_BLUE 0x90 -#endif -#elif LCD_DEPTH == 2 -#define BMP_RED 0xad -#define BMP_GREEN 0xd8 -#define BMP_BLUE 0xe6 +#if LCD_DEPTH == 2 +/* Only defined for positive, non-split LCD for now */ +static const unsigned char colorindex[4] = {128, 85, 43, 0}; #endif /* Hook function for core screen_dump() to save the current display @@ -772,6 +757,7 @@ static void grey_screendump_hook(int fd) int x, y, gx, gy; #if LCD_PIXELFORMAT == VERTICAL_PACKING #if LCD_DEPTH == 1 + unsigned val; unsigned mask; #elif LCD_DEPTH == 2 int shift; @@ -782,37 +768,57 @@ static void grey_screendump_hook(int fd) #endif /* LCD_PIXELFORMAT */ fb_data *lcdptr; unsigned char *clut_entry; - unsigned char linebuf[MAX(4*BMP_VARCOLORS,BMP_LINESIZE)]; + unsigned char linebuf[MAX(4*BMP_NUMCOLORS,BMP_LINESIZE)]; rb->write(fd, bmpheader, sizeof(bmpheader)); /* write header */ /* build clut */ - rb->memset(linebuf, 0, 4*BMP_VARCOLORS); + rb->memset(linebuf, 0, 4*BMP_NUMCOLORS); clut_entry = linebuf; - for (i = 0; i <= 128; i++) + for (i = 0; i <= GRADIENT_MAX; i++) { -#ifdef MROBE_100 - *clut_entry++ = (_GREY_MULUQ(BMP_BLUE-BMP_BLUE_BASE, i) >> 7) + - BMP_BLUE_BASE; - *clut_entry++ = (_GREY_MULUQ(BMP_GREEN-BMP_GREEN_BASE, i) >> 7) + - BMP_GREEN_BASE; - *clut_entry++ = (_GREY_MULUQ(BMP_RED-BMP_RED_BASE, i) >> 7) + - BMP_RED_BASE; -#else - *clut_entry++ = _GREY_MULUQ(BMP_BLUE, i) >> 7; - *clut_entry++ = _GREY_MULUQ(BMP_GREEN, i) >> 7; - *clut_entry++ = _GREY_MULUQ(BMP_RED, i) >> 7; -#endif + *clut_entry++ = (_GREY_MULUQ(BLUE_CMP(LCD_BL_BRIGHTCOLOR) + -BLUE_CMP(LCD_BL_DARKCOLOR), i) >> 7) + + BLUE_CMP(LCD_BL_DARKCOLOR); + *clut_entry++ = (_GREY_MULUQ(GREEN_CMP(LCD_BL_BRIGHTCOLOR) + -GREEN_CMP(LCD_BL_DARKCOLOR), i) >> 7) + + GREEN_CMP(LCD_BL_DARKCOLOR); + *clut_entry++ = (_GREY_MULUQ(RED_CMP(LCD_BL_BRIGHTCOLOR) + -RED_CMP(LCD_BL_DARKCOLOR), i) >> 7) + + RED_CMP(LCD_BL_DARKCOLOR); clut_entry++; } - rb->write(fd, linebuf, 4*BMP_VARCOLORS); +#ifdef HAVE_LCD_SPLIT + for (i = 0; i <= GRADIENT_MAX; i++) + { + *clut_entry++ = (_GREY_MULUQ(BLUE_CMP(LCD_BL_BRIGHTCOLOR_2) + -BLUE_CMP(LCD_BL_DARKCOLOR_2), i) >> 7) + + BLUE_CMP(LCD_BL_DARKCOLOR_2); + *clut_entry++ = (_GREY_MULUQ(GREEN_CMP(LCD_BL_BRIGHTCOLOR_2) + -GREEN_CMP(LCD_BL_DARKCOLOR_2), i) >> 7) + + GREEN_CMP(LCD_BL_DARKCOLOR_2); + *clut_entry++ = (_GREY_MULUQ(RED_CMP(LCD_BL_BRIGHTCOLOR_2) + -RED_CMP(LCD_BL_DARKCOLOR_2), i) >> 7) + + RED_CMP(LCD_BL_DARKCOLOR_2); + clut_entry++; + } +#endif + rb->write(fd, linebuf, 4*BMP_NUMCOLORS); /* BMP image goes bottom -> top */ for (y = LCD_HEIGHT - 1; y >= 0; y--) { rb->memset(linebuf, 0, BMP_LINESIZE); +#if defined(HAVE_LCD_SPLIT) && (LCD_SPLIT_LINES == 2) + if (y == LCD_SPLIT_POS - 1) + { + rb->write(fd, linebuf, BMP_LINESIZE); + rb->write(fd, linebuf, BMP_LINESIZE); + } +#endif + gy = y - _grey_info.y; #if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_DEPTH == 2 @@ -828,15 +834,15 @@ static void grey_screendump_hook(int fd) unsigned char *src = _grey_info.values + _GREY_MULUQ(_grey_info.width, gy) + gx; for (i = 0; i < 4; i++) - linebuf[x + i] = BMP_FIXEDCOLORS + *src++; + linebuf[x + i] = *src++; } else { unsigned data = *lcdptr; - linebuf[x] = (data >> 6) & 3; - linebuf[x + 1] = (data >> 4) & 3; - linebuf[x + 2] = (data >> 2) & 3; - linebuf[x + 3] = data & 3; + linebuf[x] = colorindex[(data >> 6) & 3]; + linebuf[x + 1] = colorindex[(data >> 4) & 3]; + linebuf[x + 2] = colorindex[(data >> 2) & 3]; + linebuf[x + 3] = colorindex[data & 3]; } lcdptr++; } @@ -853,16 +859,27 @@ static void grey_screendump_hook(int fd) if (((unsigned)gy < (unsigned)_grey_info.height) && ((unsigned)gx < (unsigned)_grey_info.width)) { - linebuf[x] = BMP_FIXEDCOLORS - + _grey_info.values[_GREY_MULUQ(_grey_info.width, - gy & ~_GREY_BMASK) - + (gx << _GREY_BSHIFT) - + (~gy & _GREY_BMASK)]; + val = _grey_info.values[_GREY_MULUQ(_grey_info.width, + gy & ~_GREY_BMASK) + + (gx << _GREY_BSHIFT) + + (~gy & _GREY_BMASK)]; +#ifdef HAVE_LCD_SPLIT + val -= val >> 7; +#endif } else { - linebuf[x] = (*lcdptr & mask) ? 1 : 0; +#ifdef HAVE_NEGATIVE_LCD + val = (*lcdptr & mask) ? GRADIENT_MAX : 0; +#else + val = (*lcdptr & mask) ? 0 : GRADIENT_MAX; +#endif } +#ifdef HAVE_LCD_SPLIT + if (y < LCD_SPLIT_POS) + val |= 0x80; +#endif + linebuf[x] = val; lcdptr++; } #elif LCD_DEPTH == 2 @@ -876,15 +893,14 @@ static void grey_screendump_hook(int fd) if (((unsigned)gy < (unsigned)_grey_info.height) && ((unsigned)gx < (unsigned)_grey_info.width)) { - linebuf[x] = BMP_FIXEDCOLORS - + _grey_info.values[_GREY_MULUQ(_grey_info.width, + linebuf[x] = _grey_info.values[_GREY_MULUQ(_grey_info.width, gy & ~_GREY_BMASK) + (gx << _GREY_BSHIFT) + (~gy & _GREY_BMASK)]; } else { - linebuf[x] = (*lcdptr >> shift) & 3; + linebuf[x] = colorindex[(*lcdptr >> shift) & 3]; } lcdptr++; } @@ -901,8 +917,7 @@ static void grey_screendump_hook(int fd) if (((unsigned)gy < (unsigned)_grey_info.height) && ((unsigned)gx < (unsigned)_grey_info.width)) { - linebuf[x] = BMP_FIXEDCOLORS - + _grey_info.values[_GREY_MULUQ(_grey_info.width, + linebuf[x] = _grey_info.values[_GREY_MULUQ(_grey_info.width, gy & ~_GREY_BMASK) + (gx << _GREY_BSHIFT) + (~gy & _GREY_BMASK)]; @@ -910,7 +925,7 @@ static void grey_screendump_hook(int fd) else { data = (*lcdptr >> shift) & 0x0101; - linebuf[x] = ((data >> 7) | data) & 3; + linebuf[x] = colorindex[((data >> 7) | data) & 3]; } lcdptr++; } diff --git a/firmware/export/config-clip.h b/firmware/export/config-clip.h index da8acf2fdf..95ed715276 100644 --- a/firmware/export/config-clip.h +++ b/firmware/export/config-clip.h @@ -45,7 +45,24 @@ #define LCD_WIDTH 128 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 + #define LCD_PIXELFORMAT VERTICAL_PACKING +#define HAVE_NEGATIVE_LCD /* bright on dark */ +#define HAVE_LCD_SPLIT /* split display */ + +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x000000 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x0de2e5 + +#define LCD_DARKCOLOR_2 0x000000 +#define LCD_BRIGHTCOLOR_2 0x000000 +#define LCD_BL_DARKCOLOR_2 0x000000 +#define LCD_BL_BRIGHTCOLOR_2 0xffe60f + +#define LCD_SPLIT_POS 16 +#define LCD_SPLIT_LINES 2 /* define this if you have LCD enable function */ #define HAVE_LCD_ENABLE diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index da281bd033..bc859df67a 100644 --- a/firmware/export/config-fmrecorder.h +++ b/firmware/export/config-fmrecorder.h @@ -39,6 +39,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x7ee57e + /* define this if you have a Recorder style 10-key keyboard */ #define CONFIG_KEYPAD RECORDER_PAD diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 6ca2a0701e..34ba3e5ad9 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -44,6 +44,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x7e917e +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xadd8e6 + /* remote LCD */ #define LCD_REMOTE_WIDTH 128 #define LCD_REMOTE_HEIGHT 64 @@ -51,6 +57,12 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING +/* Remote display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_REMOTE_DARKCOLOR 0x000000 +#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a +#define LCD_REMOTE_BL_DARKCOLOR 0x000000 +#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa + #define CONFIG_KEYPAD IRIVER_H100_PAD #define CONFIG_REMOTE_KEYPAD H100_REMOTE diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index 74074e83e0..37c1872335 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -39,6 +39,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x7e917e +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xadd8e6 + /* remote LCD */ #define LCD_REMOTE_WIDTH 128 #define LCD_REMOTE_HEIGHT 64 @@ -46,6 +52,12 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING +/* Remote display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_REMOTE_DARKCOLOR 0x000000 +#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a +#define LCD_REMOTE_BL_DARKCOLOR 0x000000 +#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa + #define CONFIG_KEYPAD IRIVER_H100_PAD #define CONFIG_REMOTE_KEYPAD H100_REMOTE diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 037bb26b2d..ba09884957 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h @@ -45,6 +45,12 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING +/* Remote display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_REMOTE_DARKCOLOR 0x000000 +#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a +#define LCD_REMOTE_BL_DARKCOLOR 0x000000 +#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa + #define CONFIG_KEYPAD IRIVER_H300_PAD #define CONFIG_REMOTE_KEYPAD H300_REMOTE diff --git a/firmware/export/config-iaudiom3.h b/firmware/export/config-iaudiom3.h index a6e1028897..e72813c853 100644 --- a/firmware/export/config-iaudiom3.h +++ b/firmware/export/config-iaudiom3.h @@ -52,6 +52,12 @@ #define LCD_PIXELFORMAT VERTICAL_INTERLEAVED +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x7e917e +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x82b4fa + /* define this if only the remote has an LCD */ #define HAVE_REMOTE_LCD_AS_MAIN diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h index 26cc9c5da6..d186895b45 100644 --- a/firmware/export/config-iaudiom5.h +++ b/firmware/export/config-iaudiom5.h @@ -52,6 +52,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x648764 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xdfd8ff + /* remote LCD */ #define LCD_REMOTE_WIDTH 128 #define LCD_REMOTE_HEIGHT 96 @@ -59,6 +65,12 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_INTERLEAVED +/* Remote display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_REMOTE_DARKCOLOR 0x000000 +#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a +#define LCD_REMOTE_BL_DARKCOLOR 0x000000 +#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa + #define CONFIG_KEYPAD IAUDIO_X5M5_PAD #define AB_REPEAT_ENABLE 1 diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h index 27bd2c523b..218e1657dd 100644 --- a/firmware/export/config-iaudiox5.h +++ b/firmware/export/config-iaudiox5.h @@ -61,6 +61,12 @@ #define LCD_REMOTE_PIXELFORMAT VERTICAL_INTERLEAVED +/* Remote display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_REMOTE_DARKCOLOR 0x000000 +#define LCD_REMOTE_BRIGHTCOLOR 0x5a915a +#define LCD_REMOTE_BL_DARKCOLOR 0x000000 +#define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa + #ifndef BOOTLOADER /* Define this if your LCD can be enabled/disabled */ #define HAVE_LCD_ENABLE diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h index 6a26a93da2..96faf46e91 100644 --- a/firmware/export/config-ifp7xx.h +++ b/firmware/export/config-ifp7xx.h @@ -29,6 +29,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5e6854 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x3ca0e6 + #define CONFIG_KEYPAD IRIVER_IFP7XX_PAD #define CONFIG_STORAGE STORAGE_NAND diff --git a/firmware/export/config-ipod1g2g.h b/firmware/export/config-ipod1g2g.h index 4308d9c66c..a06cb65828 100644 --- a/firmware/export/config-ipod1g2g.h +++ b/firmware/export/config-ipod1g2g.h @@ -51,6 +51,12 @@ #define LCD_PIXELFORMAT HORIZONTAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x648764 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xdfd8ff + /* define this if you can flip your LCD */ #define HAVE_LCD_FLIP diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index f1550576d2..fad3d3d0fb 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h @@ -52,6 +52,12 @@ #define LCD_PIXELFORMAT HORIZONTAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xadd8e6 + /* define this if you can flip your LCD */ #define HAVE_LCD_FLIP diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index e2aaa96ded..5bc0a18a98 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h @@ -52,6 +52,12 @@ #define LCD_DEPTH 2 /* 4 colours - 2bpp */ #define LCD_PIXELFORMAT HORIZONTAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xadd8e6 + #define HAVE_LCD_CONTRAST /* LCD contrast */ diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h index bc59ededfe..0e87d02ee8 100644 --- a/firmware/export/config-ipodmini.h +++ b/firmware/export/config-ipodmini.h @@ -51,6 +51,12 @@ #define LCD_PIXELFORMAT HORIZONTAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x648764 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xdfd8ff + #define HAVE_LCD_CONTRAST /* LCD contrast */ diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h index 4775350712..a44087f897 100644 --- a/firmware/export/config-ipodmini2g.h +++ b/firmware/export/config-ipodmini2g.h @@ -51,6 +51,12 @@ #define LCD_PIXELFORMAT HORIZONTAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x648764 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0xdfd8ff + #define HAVE_LCD_CONTRAST /* LCD contrast */ diff --git a/firmware/export/config-logikdax.h b/firmware/export/config-logikdax.h index 78a39d32b7..800688b01d 100644 --- a/firmware/export/config-logikdax.h +++ b/firmware/export/config-logikdax.h @@ -55,6 +55,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x82b4fa + /* define this to indicate your device's keypad */ #define CONFIG_KEYPAD LOGIK_DAX_PAD diff --git a/firmware/export/config-m200.h b/firmware/export/config-m200.h index cab1c9927b..38d59cbcbe 100644 --- a/firmware/export/config-m200.h +++ b/firmware/export/config-m200.h @@ -49,6 +49,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_BARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5e6854 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x3ca0e6 + /* define this to indicate your device's keypad */ #define CONFIG_KEYPAD SANSA_M200_PAD diff --git a/firmware/export/config-m200v4.h b/firmware/export/config-m200v4.h index 3c601a77cb..c34f33c306 100644 --- a/firmware/export/config-m200v4.h +++ b/firmware/export/config-m200v4.h @@ -58,6 +58,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_BARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5e6854 +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x3ca0e6 + /* define this to indicate your device's keypad */ #define CONFIG_KEYPAD SANSA_M200_PAD diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index f2fc5cb37a..817c7640b2 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h @@ -27,7 +27,15 @@ #define LCD_WIDTH 160 #define LCD_HEIGHT 128 #define LCD_DEPTH 1 -#define LCD_PIXELFORMAT VERTICAL_PACKING + +#define LCD_PIXELFORMAT VERTICAL_PACKING +#define HAVE_NEGATIVE_LCD /* bright on dark */ + +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x323232 +#define LCD_BL_DARKCOLOR 0x5e0202 +#define LCD_BL_BRIGHTCOLOR 0xf10603 /* define this if you can flip your LCD */ #define HAVE_LCD_FLIP diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 1b3b266191..32e67cac09 100644 --- a/firmware/export/config-ondiofm.h +++ b/firmware/export/config-ondiofm.h @@ -29,6 +29,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x82b4fa + /* define this if you have an Ondio style 6-key keyboard */ #define CONFIG_KEYPAD ONDIO_PAD diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 85065f40bb..baa54011ae 100644 --- a/firmware/export/config-ondiosp.h +++ b/firmware/export/config-ondiosp.h @@ -22,6 +22,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x82b4fa + /* define this if you have an Ondio style 6-key keyboard */ #define CONFIG_KEYPAD ONDIO_PAD diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 91d97abd97..3071a09be8 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h @@ -15,6 +15,12 @@ #define SIM_LCD_WIDTH 132 /* pixels */ #define SIM_LCD_HEIGHT 64 /* pixels */ +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x7ee57e + /* define this if you have the Player's keyboard */ #define CONFIG_KEYPAD PLAYER_PAD diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index f0a513851f..44006b4196 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h @@ -39,6 +39,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x7ee57e + /* define this if you have the Recorder's 10-key keyboard */ #define CONFIG_KEYPAD RECORDER_PAD diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 4e77e3d4ed..5e404a9873 100644 --- a/firmware/export/config-recorderv2.h +++ b/firmware/export/config-recorderv2.h @@ -39,6 +39,12 @@ #define LCD_PIXELFORMAT VERTICAL_PACKING +/* Display colours, for screenshots and sim (0xRRGGBB) */ +#define LCD_DARKCOLOR 0x000000 +#define LCD_BRIGHTCOLOR 0x5a915a +#define LCD_BL_DARKCOLOR 0x000000 +#define LCD_BL_BRIGHTCOLOR 0x7ee57e + /* define this if you have a Recorder style 10-key keyboard */ #define CONFIG_KEYPAD RECORDER_PAD diff --git a/firmware/export/config.h b/firmware/export/config.h index 58ae66d1cd..2c299491f9 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -412,6 +412,28 @@ #define LCD_PIXEL_ASPECT_WIDTH 1 #endif +/* Used for split displays (Sansa Clip). Set to 0 otherwise */ +#ifndef LCD_SPLIT_LINES +#define LCD_SPLIT_LINES 0 +#endif + +/* Simulator LCD dimensions. Set to standard dimensions if undefined */ +#ifndef SIM_LCD_WIDTH +#define SIM_LCD_WIDTH LCD_WIDTH +#endif +#ifndef SIM_LCD_HEIGHT +#define SIM_LCD_HEIGHT (LCD_HEIGHT + LCD_SPLIT_LINES) +#endif + +#ifdef HAVE_REMOTE_LCD +#ifndef SIM_REMOTE_WIDTH +#define SIM_REMOTE_WIDTH LCD_REMOTE_WIDTH +#endif +#ifndef SIM_REMOTE_HEIGHT +#define SIM_REMOTE_HEIGHT LCD_REMOTE_HEIGHT +#endif +#endif /* HAVE_REMOTE_LCD */ + /* define this in the target config.h to use a different size */ #ifndef CONFIG_DEFAULT_ICON_HEIGHT #define CONFIG_DEFAULT_ICON_HEIGHT 8 diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 0405ef0d1e..765bc0608e 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -1295,7 +1295,7 @@ void mouse_tick_task(void) x -= UI_LCD_POSX; y -= UI_LCD_POSY; - if(x<0 || y<0 || x>UI_LCD_WIDTH || y>UI_LCD_HEIGHT) + if(x<0 || y<0 || x>SIM_LCD_WIDTH || y>SIM_LCD_HEIGHT) return; } diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c index bc2a4c46f4..6faa5eb0b2 100644 --- a/uisimulator/sdl/lcd-bitmap.c +++ b/uisimulator/sdl/lcd-bitmap.c @@ -22,45 +22,74 @@ #include "debug.h" #include "uisdl.h" #include "lcd-sdl.h" +#include "misc.h" SDL_Surface* lcd_surface; -#ifdef UI_LCD_SPLIT -SDL_Surface* lcd_real_surface; /* the surface which represents the real screen */ -#endif -int lcd_backlight_val; #if LCD_DEPTH <= 8 #ifdef HAVE_BACKLIGHT -SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; -SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0}; -#ifdef UI_LCD_SPLIT -SDL_Color lcd_backlight_color_split= {UI_LCD_SPLIT_FGCOLORLIGHT, 0}; -#endif -#endif -SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; -SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0}; -#ifdef UI_LCD_SPLIT -SDL_Color lcd_color_split= {UI_LCD_SPLIT_FGCOLOR, 0}; +SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR), + GREEN_CMP(LCD_BL_DARKCOLOR), + BLUE_CMP(LCD_BL_DARKCOLOR), 0}; +SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR), + GREEN_CMP(LCD_BL_BRIGHTCOLOR), + BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0}; +#ifdef HAVE_LCD_SPLIT +SDL_Color lcd_bl_color2_dark = {RED_CMP(LCD_BL_DARKCOLOR_2), + GREEN_CMP(LCD_BL_DARKCOLOR_2), + BLUE_CMP(LCD_BL_DARKCOLOR_2), 0}; +SDL_Color lcd_bl_color2_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR_2), + GREEN_CMP(LCD_BL_BRIGHTCOLOR_2), + BLUE_CMP(LCD_BL_BRIGHTCOLOR_2), 0}; #endif +#endif /* HAVE_BACKLIGHT */ +SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR), + GREEN_CMP(LCD_DARKCOLOR), + BLUE_CMP(LCD_DARKCOLOR), 0}; +SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR), + GREEN_CMP(LCD_BRIGHTCOLOR), + BLUE_CMP(LCD_BRIGHTCOLOR), 0}; +#ifdef HAVE_LCD_SPLIT +SDL_Color lcd_color2_dark = {RED_CMP(LCD_DARKCOLOR_2), + GREEN_CMP(LCD_DARKCOLOR_2), + BLUE_CMP(LCD_DARKCOLOR_2), 0}; +SDL_Color lcd_color2_bright = {RED_CMP(LCD_BRIGHTCOLOR_2), + GREEN_CMP(LCD_BRIGHTCOLOR_2), + BLUE_CMP(LCD_BRIGHTCOLOR_2), 0}; #endif +#ifdef HAVE_LCD_SPLIT +#define GRADIENT_MAX 127 +#else +#define GRADIENT_MAX 128 +#endif +#endif /* LCD_DEPTH <= 8 */ + #if LCD_DEPTH < 8 -int lcd_ex_shades = 0; unsigned long (*lcd_ex_getpixel)(int, int) = NULL; +#endif /* LCD_DEPTH < 8 */ + +#if LCD_DEPTH == 2 +/* Only defined for positive, non-split LCD for now */ +static const unsigned char colorindex[4] = {128, 85, 43, 0}; #endif static unsigned long get_lcd_pixel(int x, int y) { #if LCD_DEPTH == 1 - return ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); +#ifdef HAVE_NEGATIVE_LCD + return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? GRADIENT_MAX : 0; +#else + return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : GRADIENT_MAX; +#endif #elif LCD_DEPTH == 2 #if LCD_PIXELFORMAT == HORIZONTAL_PACKING - return ((lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3); + return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3]; #elif LCD_PIXELFORMAT == VERTICAL_PACKING - return ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3); + return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3]; #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101; - return (bits | (bits >> 7)) & 3; + return colorindex[(bits | (bits >> 7)) & 3]; #endif #elif LCD_DEPTH == 16 #if LCD_PIXELFORMAT == RGB565SWAPPED @@ -80,148 +109,77 @@ void lcd_update(void) void lcd_update_rect(int x_start, int y_start, int width, int height) { - sdl_update_rect(lcd_surface, x_start, y_start, width, height, LCD_WIDTH, - LCD_HEIGHT, get_lcd_pixel); - sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start, - width, height, LCD_WIDTH, LCD_HEIGHT, + sdl_update_rect(lcd_surface, x_start, y_start, width, height, + LCD_WIDTH, LCD_HEIGHT, get_lcd_pixel); + sdl_gui_update(lcd_surface, x_start, y_start, width, + height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); } #ifdef HAVE_BACKLIGHT void sim_backlight(int value) { - lcd_backlight_val = value; - #if LCD_DEPTH <= 8 if (value > 0) { -#ifdef UI_LCD_SPLIT - sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_zero, - &lcd_backlight_color_max, &lcd_backlight_color_zero, - &lcd_backlight_color_split, 0, (1< 0) { -#ifdef UI_LCD_SPLIT - sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max, - &lcd_backlight_color_zero, &lcd_backlight_color_split, - &lcd_backlight_color_zero, - (1< 0) { -#ifdef UI_LCD_SPLIT - sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max, - &lcd_backlight_color_zero, &lcd_backlight_color_split, - &lcd_backlight_color_zero, (1< 0) { - sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, - &lcd_backlight_color_max, - 0, (1<> (y & 7)) & 1; + return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : GRADIENT_MAX; #elif LCD_REMOTE_DEPTH == 2 #if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101; - return (bits | (bits >> 7)) & 3; + return colorindex[(bits | (bits >> 7)) & 3]; #endif #endif } @@ -57,11 +75,11 @@ void lcd_remote_update_rect(int x_start, int y_start, int width, int height) void sim_remote_backlight(int value) { if (value > 0) { - sdl_set_gradient(remote_surface, &remote_backlight_color_zero, - &remote_color_max, 0, (1<= UI_LCD_SPLIT_LINES) - src.h += UI_LCD_SPLIT_BLACK_LINES * display_zoom; - - SDL_LockSurface(surface); - SDL_LockSurface(real_surface); - - int pixel, npixels; - -#if LCD_DEPTH != 1 -#error "Split screen only works for monochrome displays !" -#endif - - npixels = display_zoom * display_zoom * UI_LCD_SPLIT_LINES * surface->pitch; - const unsigned char * pixels_src = (const unsigned char*)surface->pixels; - unsigned char * pixels_dst = (unsigned char*)real_surface->pixels; - const int start_pixel = UI_LCD_SPLIT_LINES * surface->pitch * display_zoom; - const int stop_pixel = (UI_LCD_SPLIT_LINES+UI_LCD_SPLIT_BLACK_LINES) - * surface->pitch * display_zoom; - - /* draw top pixels, change the color */ - for (pixel = 0; pixel < npixels ; pixel++) - { - int pix = pixels_src[pixel] + gradient_steps; - if(pix > 255) pix = 255; - - pixels_dst[pixel] = pix; - } - - /* copy bottom pixels */ - memcpy(&pixels_dst[stop_pixel], &pixels_src[start_pixel], - (UI_LCD_HEIGHT - UI_LCD_SPLIT_LINES) * surface->pitch * display_zoom); - - /* separation lines are off */ - for (pixel = start_pixel; pixel < stop_pixel ; pixel++) - pixels_dst[pixel] = 0; - - SDL_UnlockSurface(surface); - SDL_UnlockSurface(real_surface); - - SDL_BlitSurface(real_surface, &src, gui_surface, &dest); -#else SDL_BlitSurface(surface, &src, gui_surface, &dest); -#endif SDL_Flip(gui_surface); } /* set a range of bitmap indices to a gradient from startcolour to endcolour */ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, - IFSPLIT(SDL_Color *split_start,) - IFSPLIT(SDL_Color *split_end ,) int first, int steps) + int first, int steps) { int i; - -#ifdef UI_LCD_SPLIT - int tot_steps = steps * 2; - if (tot_steps > 256) - tot_steps = 256; - - gradient_steps = steps; -#else -#define tot_steps steps -#endif - - SDL_Color palette[tot_steps]; + SDL_Color palette[steps]; for (i = 0; i < steps; i++) { palette[i].r = start->r + (end->r - start->r) * i / (steps - 1); @@ -154,14 +108,6 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, palette[i].b = start->b + (end->b - start->b) * i / (steps - 1); } -#ifdef UI_LCD_SPLIT /* extra color */ - for (i = steps ; i < tot_steps; i++) { - palette[i].r = split_start->r + (split_end->r - split_start->r) * (i - steps) / (tot_steps - steps - 1); - palette[i].g = split_start->g + (split_end->g - split_start->g) * (i - steps) / (tot_steps - steps - 1); - palette[i].b = split_start->b + (split_end->b - split_start->b) * (i - steps) / (tot_steps - steps - 1); - } -#endif - - SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, tot_steps); + SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, steps); } diff --git a/uisimulator/sdl/lcd-sdl.h b/uisimulator/sdl/lcd-sdl.h index b177eb14c9..9ffa5246cf 100644 --- a/uisimulator/sdl/lcd-sdl.h +++ b/uisimulator/sdl/lcd-sdl.h @@ -25,13 +25,6 @@ #include "lcd.h" #include "SDL.h" -#include "uisdl.h" -#ifdef UI_LCD_SPLIT -#define IFSPLIT(x,y) x,y -#else -#define IFSPLIT(x,y) -#endif - /* Default display zoom level */ extern int display_zoom; @@ -39,13 +32,11 @@ void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width, int height, int max_x, int max_y, unsigned long (*getpixel)(int, int)); -void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,) - int x_start, int y_start, int width, +void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width, int height, int max_x, int max_y, int ui_x, int ui_y); void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, - IFSPLIT( SDL_Color *split_start ,) - IFSPLIT( SDL_Color *split_end ,) int first, int steps); + int first, int steps); #endif /* #ifndef __LCDSDL_H__ */ diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c index 81f9722a68..d6a49d3a60 100644 --- a/uisimulator/sdl/uisdl.c +++ b/uisimulator/sdl/uisdl.c @@ -130,15 +130,11 @@ bool gui_startup(void) height = UI_HEIGHT; } else { #ifdef HAVE_REMOTE_LCD - width = UI_LCD_WIDTH > UI_REMOTE_WIDTH ? UI_LCD_WIDTH : UI_REMOTE_WIDTH; - height = UI_LCD_HEIGHT + UI_REMOTE_HEIGHT; + width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH; + height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT; #else - width = UI_LCD_WIDTH; - height = UI_LCD_HEIGHT -#ifdef UI_LCD_SPLIT - + UI_LCD_SPLIT_BLACK_LINES -#endif - ; + width = SIM_LCD_WIDTH; + height = SIM_LCD_HEIGHT; #endif } diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index e33be01948..6cb382ce8b 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h @@ -31,208 +31,114 @@ #define UI_TITLE "Jukebox Recorder" #define UI_WIDTH 270 /* width of GUI window */ #define UI_HEIGHT 406 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 80 /* x position of lcd */ -#define UI_LCD_POSY 104 /* y position of lcd (96 for real aspect) */ -#define UI_LCD_WIDTH 112 -#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */ +#define UI_LCD_POSY 104 /* y position of lcd */ #elif defined(ARCHOS_PLAYER) #define UI_TITLE "Jukebox Player" #define UI_WIDTH 284 /* width of GUI window */ #define UI_HEIGHT 420 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 75 /* x position of lcd */ #define UI_LCD_POSY 116 /* y position of lcd */ -#define UI_LCD_WIDTH 132 -#define UI_LCD_HEIGHT 64 #elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) #define UI_TITLE "Jukebox FM Recorder" #define UI_WIDTH 285 /* width of GUI window */ #define UI_HEIGHT 414 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 87 /* x position of lcd */ -#define UI_LCD_POSY 77 /* y position of lcd (69 for real aspect) */ -#define UI_LCD_WIDTH 112 -#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */ +#define UI_LCD_POSY 77 /* y position of lcd */ #elif defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM) #define UI_TITLE "Ondio" #define UI_WIDTH 155 /* width of GUI window */ #define UI_HEIGHT 334 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (backlight mod) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 21 /* x position of lcd */ -#define UI_LCD_POSY 82 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH 112 -#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */ +#define UI_LCD_POSY 82 /* y position of lcd */ #elif defined(IRIVER_H120) || defined(IRIVER_H100) #define UI_TITLE "iriver H1x0" #define UI_WIDTH 379 /* width of GUI window */ #define UI_HEIGHT 508 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 109 /* x position of lcd */ #define UI_LCD_POSY 23 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 -#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */ -#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */ -#define UI_REMOTE_FGCOLOR 0, 0, 0 /* foreground color of remote LCD (no backlight) */ -#define UI_REMOTE_FGCOLORLIGHT 0, 0, 0 /* foreground color of remote LCD (backlight) */ #define UI_REMOTE_POSX 50 /* x position of remote lcd */ #define UI_REMOTE_POSY 403 /* y position of remote lcd */ -#define UI_REMOTE_WIDTH 128 -#define UI_REMOTE_HEIGHT 64 #elif defined(IRIVER_H300) #define UI_TITLE "iriver H300" #define UI_WIDTH 288 /* width of GUI window */ #define UI_HEIGHT 581 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 26 /* x position of lcd */ #define UI_LCD_POSY 36 /* y position of lcd */ -#define UI_LCD_WIDTH 220 -#define UI_LCD_HEIGHT 176 -#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */ -#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */ #define UI_REMOTE_POSX 12 /* x position of remote lcd */ #define UI_REMOTE_POSY 478 /* y position of remote lcd */ -#define UI_REMOTE_WIDTH 128 -#define UI_REMOTE_HEIGHT 64 #elif defined(IPOD_1G2G) #define UI_TITLE "iPod 1G/2G" #define UI_WIDTH 224 /* width of GUI window */ #define UI_HEIGHT 382 /* height of GUI window */ -#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 32 /* x position of lcd */ #define UI_LCD_POSY 12 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 #elif defined(IPOD_3G) #define UI_TITLE "iPod 3G" #define UI_WIDTH 218 /* width of GUI window */ #define UI_HEIGHT 389 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 29 /* x position of lcd */ #define UI_LCD_POSY 16 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 #elif defined(IPOD_4G) #define UI_TITLE "iPod 4G" #define UI_WIDTH 196 /* width of GUI window */ #define UI_HEIGHT 370 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 19 /* x position of lcd */ #define UI_LCD_POSY 14 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 #elif defined(IPOD_MINI) || defined(IPOD_MINI2G) #define UI_TITLE "iPod mini" #define UI_WIDTH 191 /* width of GUI window */ #define UI_HEIGHT 365 /* height of GUI window */ -#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 24 /* x position of lcd */ #define UI_LCD_POSY 17 /* y position of lcd */ -#define UI_LCD_WIDTH 138 -#define UI_LCD_HEIGHT 110 #elif defined(IPOD_COLOR) #define UI_TITLE "iPod Color" #define UI_WIDTH 261 /* width of GUI window */ #define UI_HEIGHT 493 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 21 /* x position of lcd */ #define UI_LCD_POSY 16 /* y position of lcd */ -#define UI_LCD_WIDTH 220 -#define UI_LCD_HEIGHT 176 #elif defined(IPOD_NANO) #define UI_TITLE "iPod Nano" #define UI_WIDTH 199 /* width of GUI window */ #define UI_HEIGHT 421 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 13 /* x position of lcd */ #define UI_LCD_POSY 14 /* y position of lcd */ -#define UI_LCD_WIDTH 176 -#define UI_LCD_HEIGHT 132 #elif defined(IPOD_VIDEO) #define UI_TITLE "iPod Video" #define UI_WIDTH 350 /* width of GUI window */ #define UI_HEIGHT 591 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 14 /* x position of lcd */ #define UI_LCD_POSY 12 /* y position of lcd */ -#define UI_LCD_WIDTH 320 -#define UI_LCD_HEIGHT 240 #elif defined(IAUDIO_X5) #define UI_TITLE "iAudio X5" #define UI_WIDTH 300 /* width of GUI window */ #define UI_HEIGHT 558 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 55 /* x position of lcd */ -#define UI_LCD_POSY 61 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ -#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */ -#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */ +#define UI_LCD_POSY 61 /* y position of lcd */ #define UI_REMOTE_POSX 12 /* x position of remote lcd */ #define UI_REMOTE_POSY 462 /* y position of remote lcd */ -#define UI_REMOTE_WIDTH 128 -#define UI_REMOTE_HEIGHT 96 #elif defined(IAUDIO_M5) #define UI_TITLE "iAudio M5" #define UI_WIDTH 374 /* width of GUI window */ #define UI_HEIGHT 650 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 82 /* x position of lcd */ -#define UI_LCD_POSY 74 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ -#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */ -#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */ +#define UI_LCD_POSY 74 /* y position of lcd */ #define UI_REMOTE_POSX 59 /* x position of remote lcd */ #define UI_REMOTE_POSY 509 /* y position of remote lcd */ -#define UI_REMOTE_WIDTH 128 -#define UI_REMOTE_HEIGHT 96 #elif defined(IAUDIO_M3) #define UI_TITLE "iAudio M3" @@ -240,68 +146,43 @@ #define UI_HEIGHT 501 /* height of GUI window */ #define UI_LCD_POSX 92 /* x position of lcd */ #define UI_LCD_POSY 348 /* y position of lcd */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no bklight) */ -#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (bklight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ #elif defined(GIGABEAT_F) #define UI_TITLE "Toshiba Gigabeat" #define UI_WIDTH 401 /* width of GUI window */ #define UI_HEIGHT 655 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 48 /* x position of lcd */ #define UI_LCD_POSY 60 /* y position of lcd */ -#define UI_LCD_WIDTH 240 -#define UI_LCD_HEIGHT 320 #elif defined(GIGABEAT_S) #define UI_TITLE "Toshiba Gigabeat" #define UI_WIDTH 450 /* width of GUI window */ #define UI_HEIGHT 688 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 96 /* x position of lcd */ #define UI_LCD_POSY 90 /* y position of lcd */ -#define UI_LCD_WIDTH 240 -#define UI_LCD_HEIGHT 320 #elif defined(MROBE_500) #define UI_TITLE "Olympus M:Robe 500" #define UI_WIDTH 401 /* width of GUI window */ #define UI_HEIGHT 655 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 48 /* x position of lcd */ #define UI_LCD_POSY 60 /* y position of lcd */ -#define UI_LCD_WIDTH LCD_WIDTH -#define UI_LCD_HEIGHT LCD_HEIGHT -#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */ -#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */ #define UI_REMOTE_POSX 50 /* x position of remote lcd */ #define UI_REMOTE_POSY 403 /* y position of remote lcd */ -#define UI_REMOTE_WIDTH 79 -#define UI_REMOTE_HEIGHT 16 #elif defined(IRIVER_H10) #define UI_TITLE "iriver H10 20Gb" #define UI_WIDTH 392 /* width of GUI window */ #define UI_HEIGHT 391 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 111 /* x position of lcd */ -#define UI_LCD_POSY 30 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ +#define UI_LCD_POSY 30 /* y position of lcd */ #elif defined(IRIVER_H10_5GB) #define UI_TITLE "iriver H10 5/6Gb" #define UI_WIDTH 353 /* width of GUI window */ #define UI_HEIGHT 460 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 112 /* x position of lcd */ -#define UI_LCD_POSY 45 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ +#define UI_LCD_POSY 45 /* y position of lcd */ #elif defined(SANSA_E200) || defined(SANSA_E200V2) #ifdef SANSA_E200 @@ -311,35 +192,23 @@ #endif #define UI_WIDTH 260 /* width of GUI window */ #define UI_HEIGHT 502 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 42 /* x position of lcd */ -#define UI_LCD_POSY 37 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ +#define UI_LCD_POSY 37 /* y position of lcd */ #elif defined(SANSA_C200) #define UI_TITLE "Sansa c200" #define UI_WIDTH 350 /* width of GUI window */ #define UI_HEIGHT 152 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 42 /* x position of lcd */ -#define UI_LCD_POSY 35 /* y position of lcd (74 for real aspect) */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ +#define UI_LCD_POSY 35 /* y position of lcd */ #elif defined(IRIVER_IFP7XX) #define UI_TITLE "iriver iFP7xx" #define UI_WIDTH 425 /* width of GUI window */ #define UI_HEIGHT 183 /* height of GUI window */ -#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 115 /* x position of lcd */ #define UI_LCD_POSY 54 /* y position of lcd */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ - + #elif defined(ARCHOS_AV300) #define UI_TITLE "Archos AV300" /* We are temporarily using a 2bpp LCD driver and dummy bitmap */ @@ -347,25 +216,13 @@ #define UI_HEIGHT 340 /* height of GUI window */ #define UI_LCD_POSX 50 /* x position of lcd */ #define UI_LCD_POSY 50 /* y position of lcd */ -#define UI_LCD_WIDTH 320 -#define UI_LCD_HEIGHT 240 -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #elif defined(MROBE_100) #define UI_TITLE "Olympus M:Robe 100" #define UI_WIDTH 247 /* width of GUI window */ #define UI_HEIGHT 416 /* height of GUI window */ -#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 94, 2, 2 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 50, 50, 50 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 241, 6, 3 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 43 /* x position of lcd */ #define UI_LCD_POSY 25 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 #elif defined(COWON_D2) #define UI_TITLE "Cowon D2" @@ -373,25 +230,13 @@ #define UI_HEIGHT 368 /* height of GUI window */ #define UI_LCD_POSX 58 /* x position of lcd */ #define UI_LCD_POSY 67 /* y position of lcd */ -#define UI_LCD_WIDTH 320 -#define UI_LCD_HEIGHT 240 -#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #elif defined(IAUDIO_7) #define UI_TITLE "iAudio7" #define UI_WIDTH 494 /* width of GUI window */ #define UI_HEIGHT 214 /* height of GUI window */ -#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 131 /* x position of lcd */ #define UI_LCD_POSY 38 /* y position of lcd */ -#define UI_LCD_WIDTH 160 -#define UI_LCD_HEIGHT 128 #elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB) #ifdef CREATIVE_ZVM @@ -403,12 +248,6 @@ #define UI_HEIGHT 643 /* height of GUI window */ #define UI_LCD_POSX 31 /* x position of lcd */ #define UI_LCD_POSY 62 /* y position of lcd */ -#define UI_LCD_WIDTH 320 -#define UI_LCD_HEIGHT 240 -#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #elif defined(CREATIVE_ZV) #define UI_TITLE "Creative Zen Vision" @@ -416,12 +255,6 @@ #define UI_HEIGHT 643 /* height of GUI window */ #define UI_LCD_POSX 129 /* x position of lcd */ #define UI_LCD_POSY 85 /* y position of lcd */ -#define UI_LCD_WIDTH 640 -#define UI_LCD_HEIGHT 480 -#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #elif defined(MEIZU_M6SL) #define UI_TITLE "Meizu M6" @@ -429,22 +262,13 @@ #define UI_HEIGHT 322 /* height of GUI window */ #define UI_LCD_POSX 39 /* x position of lcd */ #define UI_LCD_POSY 38 /* y position of lcd */ -#define UI_LCD_WIDTH 320 -#define UI_LCD_HEIGHT 240 -#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #elif defined(SANSA_FUZE) #define UI_TITLE "Sansa Fuze" #define UI_WIDTH 279 /* width of GUI window */ #define UI_HEIGHT 449 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 30 /* x position of lcd */ #define UI_LCD_POSY 31 /* y position of lcd */ -#define UI_LCD_WIDTH LCD_WIDTH -#define UI_LCD_HEIGHT LCD_HEIGHT #elif defined(SANSA_CLIP) #define UI_TITLE "Sansa Clip" @@ -452,42 +276,20 @@ #define UI_HEIGHT 325 /* height of GUI window */ #define UI_LCD_POSX 38 /* x position of lcd */ #define UI_LCD_POSY 38 /* y position of lcd */ -#define UI_LCD_WIDTH 128 -#define UI_LCD_HEIGHT 64 -#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 0, 0, 0 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 13, 226, 229 /* foreground color of LCD (backlight) */ - -#define UI_LCD_SPLIT /* The screen is split in 2 areas */ -#define UI_LCD_SPLIT_LINES 16 /* the top 16 lines have a different color */ -#define UI_LCD_SPLIT_BLACK_LINES 2 /* The 2 areas are separated by 2 empty lines */ -/* Colors for the top part of the screen */ -#define UI_LCD_SPLIT_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_SPLIT_FGCOLORLIGHT 255, 230, 15 /* foreground color of LCD (backlight) */ #elif defined(PHILIPS_HDD1630) #define UI_TITLE "Philips GoGear HDD1630" #define UI_WIDTH 407 /* width of GUI window */ #define UI_HEIGHT 391 /* height of GUI window */ -/* high-colour */ #define UI_LCD_POSX 143 /* x position of lcd */ #define UI_LCD_POSY 27 /* y position of lcd */ -#define UI_LCD_WIDTH LCD_WIDTH -#define UI_LCD_HEIGHT LCD_HEIGHT #elif defined(SANSA_M200V4) #define UI_TITLE "sansa m200v4" #define UI_WIDTH 350 /* width of GUI window */ #define UI_HEIGHT 168 /* height of GUI window */ -#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */ -#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */ -#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ -#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ #define UI_LCD_POSX 42 /* x position of lcd */ #define UI_LCD_POSY 55 /* y position of lcd */ -#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ -#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */ #else