? apps/gui/gwps-common.c.abort Index: apps/gui/gwps-common.c =================================================================== RCS file: /cvsroot/rockbox/apps/gui/gwps-common.c,v retrieving revision 1.20 diff -u -r1.20 gwps-common.c --- apps/gui/gwps-common.c 13 Dec 2005 00:38:53 -0000 1.20 +++ apps/gui/gwps-common.c 17 Dec 2005 00:24:43 -0000 @@ -21,6 +21,7 @@ #include #include #include +#include #include "system.h" #include "settings.h" #include "audio.h" @@ -55,6 +56,11 @@ /* 3% of 30min file == 54s step size */ #define MIN_FF_REWIND_STEP 500 +static int hexvalue(char x) +{ + return isdigit(x) ? (x) - '0' : (tolower(x) - 'a' + 10); +} + /* Skip leading UTF-8 BOM, if present. */ static char* skip_utf8_bom(char* buf) { @@ -929,6 +935,31 @@ case 0: *buf++ = '%'; break; + case 'C': + /* format is %C[fb]RRGGBB, hexidecimal values */ + { + int r = 0, g = 0, b = 0; + + r = hexvalue(fmt[2]) * 16 + hexvalue(fmt[3]); + g = hexvalue(fmt[4]) * 16 + hexvalue(fmt[5]); + b = hexvalue(fmt[6]) * 16 + hexvalue(fmt[7]); + +#if LCD_DEPTH > 1 + switch (fmt[1]) + { + case 'f': + lcd_set_foreground(LCD_RGBPACK(r, g, b)); + break; + case 'b': + lcd_set_background(LCD_RGBPACK(r, g, b)); + break; + default: + break; + } +#endif + } + fmt += 8; + break; case 'a': ++fmt; /* remember where the current aligned text started */ Index: firmware/drivers/lcd-16bit.c =================================================================== RCS file: /cvsroot/rockbox/firmware/drivers/lcd-16bit.c,v retrieving revision 1.19 diff -u -r1.19 lcd-16bit.c --- firmware/drivers/lcd-16bit.c 6 Dec 2005 13:27:01 -0000 1.19 +++ firmware/drivers/lcd-16bit.c 17 Dec 2005 00:24:43 -0000 @@ -45,6 +45,7 @@ static int ymargin = 0; static int curfont = FONT_SYSFIXED; + /* scrolling */ static volatile int scrolling_lines = 0; /* Bitpattern of which lines are scrolling */ static long scroll_stack[DEFAULT_STACK_SIZE/sizeof(long)]; @@ -670,6 +671,11 @@ s->start_tick = current_tick + scroll_delay; s->invert = false; +#if LCD_DEPTH > 1 + s->fgcolor = lcd_get_foreground(); + s->bgcolor = lcd_get_background(); +#endif + if (style & STYLE_INVERT) { s->invert = true; lcd_puts_style(x,y,string,STYLE_INVERT); @@ -725,6 +731,7 @@ int index; int xpos, ypos; int lastmode; + int fgcolor_save, bgcolor_save; /* initialize scroll struct array */ scrolling_lines = 0; @@ -772,6 +779,14 @@ } } +#if LCD_DEPTH > 1 + fgcolor_save = lcd_get_foreground(); + bgcolor_save = lcd_get_background(); + + lcd_set_foreground(s->fgcolor); + lcd_set_background(s->bgcolor); +#endif + lastmode = drawmode; drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); @@ -784,6 +799,11 @@ } drawmode = lastmode; lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); + +#if LCD_DEPTH > 1 + lcd_set_foreground(fgcolor_save); + lcd_set_background(bgcolor_save); +#endif } sleep(scroll_ticks); Index: firmware/export/lcd.h =================================================================== RCS file: /cvsroot/rockbox/firmware/export/lcd.h,v retrieving revision 1.47 diff -u -r1.47 lcd.h --- firmware/export/lcd.h 28 Nov 2005 10:05:45 -0000 1.47 +++ firmware/export/lcd.h 17 Dec 2005 00:24:43 -0000 @@ -255,6 +255,8 @@ bool bidir; bool invert; /* invert the scrolled text */ long start_tick; + int fgcolor; + int bgcolor; }; #else /* !HAVE_LCD_BITMAP */ @@ -270,6 +272,8 @@ int direction; /* +1 for right or -1 for left*/ int jump_scroll; int jump_scroll_steps; + int fgcolor; + int bgcolor; }; #endif