1
0
Fork 0
forked from len0rd/rockbox

Second part of graphics api rework. Bitmap drawing and text output converted; some code cleanup and more optimisations.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6906 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-06-28 23:15:47 +00:00
parent c2bf5dfe12
commit 7e11acbce9
28 changed files with 625 additions and 559 deletions

View file

@ -72,10 +72,10 @@ int show_logo( void )
lcd_clear_display(); lcd_clear_display();
#if LCD_WIDTH == 112 || LCD_WIDTH == 128 #if LCD_WIDTH == 112 || LCD_WIDTH == 128
lcd_bitmap(rockbox112x37, 0, 10, 112, 37, false); lcd_bitmap(rockbox112x37, 0, 10, 112, 37);
#endif #endif
#if LCD_WIDTH >= 160 #if LCD_WIDTH >= 160
lcd_bitmap(rockbox160x53, 0, 10, 160, 53, false); lcd_bitmap(rockbox160x53, 0, 10, 160, 53);
#endif #endif
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD

View file

@ -116,8 +116,7 @@ void put_cursorxy(int x, int y, bool on)
/* place the cursor */ /* place the cursor */
if(on) { if(on) {
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
lcd_bitmap ( bitmap_icons_6x8[Cursor], lcd_bitmap(bitmap_icons_6x8[Cursor], xpos, ypos, 4, 8);
xpos, ypos, 4, 8, true);
#else #else
lcd_putc(x, y, CURSOR_CHAR); lcd_putc(x, y, CURSOR_CHAR);
#endif #endif

View file

@ -463,8 +463,7 @@ static void display_playlist(void)
offset = (viewer.line_height - 8) / 2; offset = (viewer.line_height - 8) / 2;
lcd_bitmap(bitmap_icons_6x8[File], lcd_bitmap(bitmap_icons_6x8[File],
CURSOR_X * 6 + CURSOR_WIDTH, CURSOR_X * 6 + CURSOR_WIDTH,
MARGIN_Y+(i*viewer.line_height) + offset, MARGIN_Y+(i*viewer.line_height) + offset, 6, 8);
6, 8, true);
#else #else
lcd_putc(LINE_X-1, i, File); lcd_putc(LINE_X-1, i, File);
#endif #endif

View file

@ -110,8 +110,11 @@ static const struct plugin_api rockbox_api = {
lcd_getstringsize, lcd_getstringsize,
lcd_drawpixel, lcd_drawpixel,
lcd_drawline, lcd_drawline,
lcd_hline,
lcd_vline,
lcd_drawrect, lcd_drawrect,
lcd_fillrect, lcd_fillrect,
lcd_bitmap_part,
lcd_bitmap, lcd_bitmap,
lcd_putsxy, lcd_putsxy,
lcd_puts_style, lcd_puts_style,

View file

@ -87,12 +87,12 @@
#endif #endif
/* increase this every time the api struct changes */ /* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 41 #define PLUGIN_API_VERSION 42
/* update this to latest version if a change to the api struct breaks /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 41 #define PLUGIN_MIN_API_VERSION 42
/* plugin return codes */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -160,17 +160,21 @@ struct plugin_api {
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
void (*lcd_drawpixel)(int x, int y); void (*lcd_drawpixel)(int x, int y);
void (*lcd_drawline)(int x1, int y1, int x2, int y2); void (*lcd_drawline)(int x1, int y1, int x2, int y2);
void (*lcd_drawrect)(int x, int y, int nx, int ny); void (*lcd_hline)(int x1, int x2, int y);
void (*lcd_fillrect)(int x, int y, int nx, int ny); void (*lcd_vline)(int x, int y1, int y2);
void (*lcd_drawrect)(int x, int y, int width, int height);
void (*lcd_fillrect)(int x, int y, int width, int height);
void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height);
void (*lcd_bitmap)(const unsigned char *src, int x, int y, void (*lcd_bitmap)(const unsigned char *src, int x, int y,
int nx, int ny, bool clear); int width, int height);
void (*lcd_putsxy)(int x, int y, const unsigned char *string); void (*lcd_putsxy)(int x, int y, const unsigned char *string);
void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
int style); int style);
unsigned char* lcd_framebuffer; unsigned char* lcd_framebuffer;
void (*lcd_blit) (const unsigned char* p_data, int x, int y, int width, void (*lcd_blit) (const unsigned char* data, int x, int by, int width,
int height, int stride); int bheight, int stride);
void (*lcd_update)(void); void (*lcd_update)(void);
void (*lcd_update_rect)(int x, int y, int width, int height); void (*lcd_update_rect)(int x, int y, int width, int height);
void (*scrollbar)(int x, int y, int width, int height, int items, void (*scrollbar)(int x, int y, int width, int height, int items,

View file

@ -303,16 +303,17 @@ static int scrollit(void)
return -1; return -1;
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_set_drawmode(DRMODE_FG);
for(i=0, yy=y, xx=x; i< LETTERS_ON_SCREEN; i++) { for(i=0, yy=y, xx=x; i< LETTERS_ON_SCREEN; i++) {
letter = rock[(i+textpos) % rocklen ]; letter = rock[(i+textpos) % rocklen ];
rb->lcd_bitmap((char *)char_gen_12x16[letter-0x20], rb->lcd_bitmap((char *)char_gen_12x16[letter-0x20],
xx, table[yy&(TABLE_SIZE-1)], xx, table[yy&(TABLE_SIZE-1)], 11, 16);
11, 16, false);
yy += YADD; yy += YADD;
xx+= LCD_WIDTH/LETTERS_ON_SCREEN; xx+= LCD_WIDTH/LETTERS_ON_SCREEN;
} }
rb->lcd_set_drawmode(DRMODE_SOLID);
#ifdef HAVE_RTC #ifdef HAVE_RTC
addclock(); addclock();
#endif #endif
@ -393,13 +394,15 @@ static int loopit(void)
rb->lcd_putsxy(0, LCD_HEIGHT - 8, buffer); rb->lcd_putsxy(0, LCD_HEIGHT - 8, buffer);
timeout--; timeout--;
} }
rb->lcd_set_drawmode(DRMODE_FG);
for(i=0, yy=y, xx=x; for(i=0, yy=y, xx=x;
i<rocklen; i<rocklen;
i++, yy+=values[NUM_YDIST].num, xx+=values[NUM_XDIST].num) i++, yy+=values[NUM_YDIST].num, xx+=values[NUM_XDIST].num)
rb->lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20], rb->lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20],
xtable[xx&(TABLE_SIZE-1)], table[yy&(TABLE_SIZE-1)], xtable[xx&(TABLE_SIZE-1)], table[yy&(TABLE_SIZE-1)],
11, 16, false); 11, 16);
rb->lcd_update(); rb->lcd_update();
rb->lcd_set_drawmode(DRMODE_SOLID);
ysanke+= values[NUM_YSANKE].num; ysanke+= values[NUM_YSANKE].num;
xsanke+= values[NUM_XSANKE].num; xsanke+= values[NUM_XSANKE].num;

View file

@ -214,7 +214,7 @@ static void show_pause_mode(bool enabled)
static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00}; static const char pause_icon[] = {0x00,0x7f,0x7f,0x00,0x7f,0x7f,0x00};
if (enabled) if (enabled)
rb->lcd_bitmap(pause_icon, 52, 0, 7, 8, true); rb->lcd_bitmap(pause_icon, 52, 0, 7, 8);
else else
{ {
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);

View file

@ -788,9 +788,9 @@ bool colon, bool lcd)
if(settings.digital_12h) if(settings.digital_12h)
{ {
if(hour > 12) if(hour > 12)
rb->lcd_bitmap(pm, 97, 55, 15, 8, true); rb->lcd_bitmap(pm, 97, 55, 15, 8);
else else
rb->lcd_bitmap(am, 1, 55, 15, 8, true); rb->lcd_bitmap(am, 1, 55, 15, 8);
} }
} }
else else
@ -798,9 +798,9 @@ bool colon, bool lcd)
if(settings.lcd_12h) if(settings.lcd_12h)
{ {
if(hour > 12) if(hour > 12)
rb->lcd_bitmap(pm, 97, 55, 15, 8, true); rb->lcd_bitmap(pm, 97, 55, 15, 8);
else else
rb->lcd_bitmap(am, 1, 55, 15, 8, true); rb->lcd_bitmap(am, 1, 55, 15, 8);
} }
} }
@ -881,138 +881,138 @@ void binary(int hour, int minute, int second)
*****/ *****/
if(temphour >= 32) if(temphour >= 32)
{ {
rb->lcd_bitmap(bitmap_1, 0, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 0, 1, 15, 20);
temphour -= 32; temphour -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 0, 1, 15, 20);
if(temphour >= 16) if(temphour >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 19, 1, 15, 20);
temphour -= 16; temphour -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 19, 1, 15, 20);
if(temphour >= 8) if(temphour >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 38, 1, 15, 20);
temphour -= 8; temphour -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 38, 1, 15, 20);
if(temphour >= 4) if(temphour >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 57, 1, 15, 20);
temphour -= 4; temphour -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 57, 1, 15, 20);
if(temphour >= 2) if(temphour >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 76, 1, 15, 20);
temphour -= 2; temphour -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 76, 1, 15, 20);
if(temphour >= 1) if(temphour >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 1, 15, 20, true); rb->lcd_bitmap(bitmap_1, 95, 1, 15, 20);
temphour -= 1; temphour -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 1, 15, 20, true); rb->lcd_bitmap(bitmap_0, 95, 1, 15, 20);
/********* /*********
* MINUTES * MINUTES
********/ ********/
if(tempmin >= 32) if(tempmin >= 32)
{ {
rb->lcd_bitmap(bitmap_1, 0, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 0, 21, 15, 20);
tempmin -= 32; tempmin -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 0, 21, 15, 20);
if(tempmin >= 16) if(tempmin >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 19, 21, 15, 20);
tempmin -= 16; tempmin -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 19, 21, 15, 20);
if(tempmin >= 8) if(tempmin >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 38, 21, 15, 20);
tempmin -= 8; tempmin -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 38, 21, 15, 20);
if(tempmin >= 4) if(tempmin >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 57, 21, 15, 20);
tempmin -= 4; tempmin -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 57, 21, 15, 20);
if(tempmin >= 2) if(tempmin >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 76, 21, 15, 20);
tempmin -= 2; tempmin -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 76, 21, 15, 20);
if(tempmin >= 1) if(tempmin >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 21, 15, 20, true); rb->lcd_bitmap(bitmap_1, 95, 21, 15, 20);
tempmin -= 1; tempmin -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 21, 15, 20, true); rb->lcd_bitmap(bitmap_0, 95, 21, 15, 20);
/********* /*********
* SECONDS * SECONDS
********/ ********/
if(tempsec >= 32) if(tempsec >= 32)
{ {
rb->lcd_bitmap(bitmap_1, 0, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 0, 42, 15, 20);
tempsec -= 32; tempsec -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 0, 42, 15, 20);
if(tempsec >= 16) if(tempsec >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 19, 42, 15, 20);
tempsec -= 16; tempsec -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 19, 42, 15, 20);
if(tempsec >= 8) if(tempsec >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 38, 42, 15, 20);
tempsec -= 8; tempsec -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 38, 42, 15, 20);
if(tempsec >= 4) if(tempsec >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 57, 42, 15, 20);
tempsec -= 4; tempsec -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 57, 42, 15, 20);
if(tempsec >= 2) if(tempsec >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 76, 42, 15, 20);
tempsec -= 2; tempsec -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 76, 42, 15, 20);
if(tempsec >= 1) if(tempsec >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 42, 15, 20, true); rb->lcd_bitmap(bitmap_1, 95, 42, 15, 20);
tempsec -= 1; tempsec -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 42, 15, 20, true); rb->lcd_bitmap(bitmap_0, 95, 42, 15, 20);
rb->lcd_update(); rb->lcd_update();
} }
@ -1039,7 +1039,7 @@ void show_logo(bool animate, bool show_clock_text)
rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1);
rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37);
if(show_clock_text) if(show_clock_text)
rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf);
rb->lcd_update(); rb->lcd_update();
@ -1051,7 +1051,7 @@ void show_logo(bool animate, bool show_clock_text)
rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1);
rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37);
if(show_clock_text) if(show_clock_text)
rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf);
rb->lcd_update(); rb->lcd_update();
@ -1063,7 +1063,7 @@ void show_logo(bool animate, bool show_clock_text)
rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1);
rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38); rb->lcd_drawline(0, y_position/2+38, 111, y_position/2+38);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37);
if(show_clock_text) if(show_clock_text)
rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf);
rb->lcd_update(); rb->lcd_update();
@ -1071,7 +1071,7 @@ void show_logo(bool animate, bool show_clock_text)
} }
else /* don't animate, just show */ else /* don't animate, just show */
{ {
rb->lcd_bitmap(clogo, 0, 10, 112, 37, true); rb->lcd_bitmap(clogo, 0, 10, 112, 37);
if(show_clock_text) if(show_clock_text)
rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 48, buf);
rb->lcd_update(); rb->lcd_update();
@ -1094,7 +1094,7 @@ void exit_logo(void)
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1); rb->lcd_drawline(0, y_position/2-1, 111, y_position/2-1);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37, true); rb->lcd_bitmap(clogo, 0, y_position/2, 112, 37);
rb->lcd_update(); rb->lcd_update();
} }
} }
@ -1511,9 +1511,9 @@ bool f1_screen(void)
void draw_checkbox(bool setting, int x, int y) void draw_checkbox(bool setting, int x, int y)
{ {
if(setting) /* checkbox is on */ if(setting) /* checkbox is on */
rb->lcd_bitmap(checkbox_full, x, y, 8, 6, true); rb->lcd_bitmap(checkbox_full, x, y, 8, 6);
else /* checkbox is off */ else /* checkbox is off */
rb->lcd_bitmap(checkbox_empty, x, y, 8, 6, true); rb->lcd_bitmap(checkbox_empty, x, y, 8, 6);
} }
void draw_settings(void) void draw_settings(void)
@ -1544,18 +1544,18 @@ void draw_settings(void)
draw_checkbox(settings.analog_digits, 1, 33); draw_checkbox(settings.analog_digits, 1, 33);
if(settings.analog_date == 0) if(settings.analog_date == 0)
rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6);
else if(settings.analog_date == 1) else if(settings.analog_date == 1)
rb->lcd_bitmap(checkbox_half, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_half, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
if(settings.analog_time == 0) if(settings.analog_time == 0)
rb->lcd_bitmap(checkbox_empty, 1, 49, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 49, 8, 6);
else if(settings.analog_time == 1) else if(settings.analog_time == 1)
rb->lcd_bitmap(checkbox_half, 1, 49, 8, 6, true); rb->lcd_bitmap(checkbox_half, 1, 49, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 49, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 49, 8, 6);
draw_checkbox(settings.analog_secondhand, 1, 57); draw_checkbox(settings.analog_secondhand, 1, 57);
} }
@ -1584,20 +1584,20 @@ void draw_settings(void)
/* Draw checkboxes */ /* Draw checkboxes */
if(settings.digital_date == 0) if(settings.digital_date == 0)
rb->lcd_bitmap(checkbox_empty, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 33, 8, 6);
else if(settings.digital_date == 1) else if(settings.digital_date == 1)
rb->lcd_bitmap(checkbox_half, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_half, 1, 33, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6);
if(settings.digital_seconds == 0) if(settings.digital_seconds == 0)
rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6);
else if(settings.digital_seconds == 1) else if(settings.digital_seconds == 1)
rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6);
else if(settings.digital_seconds == 2) else if(settings.digital_seconds == 2)
rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
draw_checkbox(settings.digital_blinkcolon, 1, 49); draw_checkbox(settings.digital_blinkcolon, 1, 49);
draw_checkbox(settings.digital_12h, 1, 57); draw_checkbox(settings.digital_12h, 1, 57);
@ -1627,20 +1627,20 @@ void draw_settings(void)
/* Draw checkboxes */ /* Draw checkboxes */
if(settings.lcd_date == 0) if(settings.lcd_date == 0)
rb->lcd_bitmap(checkbox_empty, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 33, 8, 6);
else if(settings.lcd_date == 1) else if(settings.lcd_date == 1)
rb->lcd_bitmap(checkbox_half, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_half, 1, 33, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6);
if(settings.lcd_seconds == 0) if(settings.lcd_seconds == 0)
rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_empty, 1, 41, 8, 6);
else if(settings.lcd_seconds == 1) else if(settings.lcd_seconds == 1)
rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6);
else if(settings.lcd_seconds == 2) else if(settings.lcd_seconds == 2)
rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
draw_checkbox(settings.lcd_blinkcolon, 1, 49); draw_checkbox(settings.lcd_blinkcolon, 1, 49);
draw_checkbox(settings.lcd_12h, 1, 57); draw_checkbox(settings.lcd_12h, 1, 57);
@ -2131,16 +2131,16 @@ void general_settings(void)
rb->lcd_getstringsize(buf, &buf_w, &buf_h); rb->lcd_getstringsize(buf, &buf_w, &buf_h);
rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf);
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
draw_checkbox(settings.display_counter, 1, 33); draw_checkbox(settings.display_counter, 1, 33);
if(settings.save_mode == 1) if(settings.save_mode == 1)
rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6);
else if(settings.save_mode == 2) else if(settings.save_mode == 2)
rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
switch(cursorpos) switch(cursorpos)
{ {
@ -2181,15 +2181,15 @@ void general_settings(void)
rb->lcd_puts(2, 5, "Save: Automatic"); rb->lcd_puts(2, 5, "Save: Automatic");
else else
rb->lcd_puts(2, 5, "Save: Manually"); rb->lcd_puts(2, 5, "Save: Manually");
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
draw_checkbox(settings.display_counter, 1, 33); draw_checkbox(settings.display_counter, 1, 33);
if(settings.save_mode == 1) if(settings.save_mode == 1)
rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6);
else if(settings.save_mode == 2) else if(settings.save_mode == 2)
rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
cursor(0, cursor_y, 112, 8); cursor(0, cursor_y, 112, 8);
rb->lcd_update(); rb->lcd_update();
@ -2218,15 +2218,15 @@ void general_settings(void)
rb->lcd_puts(2, 5, "Save: Automatic"); rb->lcd_puts(2, 5, "Save: Automatic");
else else
rb->lcd_puts(2, 5, "Save: Manually"); rb->lcd_puts(2, 5, "Save: Manually");
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
draw_checkbox(settings.display_counter, 1, 33); draw_checkbox(settings.display_counter, 1, 33);
if(settings.save_mode == 1) if(settings.save_mode == 1)
rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_onethird, 1, 41, 8, 6);
else if(settings.save_mode == 2) else if(settings.save_mode == 2)
rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6, true); rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6);
cursor(0, cursor_y, 112, 8); cursor(0, cursor_y, 112, 8);
rb->lcd_update(); rb->lcd_update();
@ -2323,9 +2323,9 @@ void draw_extras(int year, int day, int month, int hour, int minute, int second)
if(settings.analog_time == 2) if(settings.analog_time == 2)
{ {
if(current_time->tm_hour > 12) /* PM */ if(current_time->tm_hour > 12) /* PM */
rb->lcd_bitmap(pm, 96, 1, 15, 8, true); rb->lcd_bitmap(pm, 96, 1, 15, 8);
else /* AM */ else /* AM */
rb->lcd_bitmap(am, 96, 1, 15, 8, true); rb->lcd_bitmap(am, 96, 1, 15, 8);
} }
} }
@ -2460,11 +2460,11 @@ void select_mode(void)
rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel"); rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel");
/* draw an arrow next to all of them */ /* draw an arrow next to all of them */
rb->lcd_bitmap(arrow, 1, 9, 8, 6, true); rb->lcd_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6, true); rb->lcd_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6, true); rb->lcd_bitmap(arrow, 1, 41, 8, 6);
/* draw line selector */ /* draw line selector */
switch(cursorpos) switch(cursorpos)
@ -2501,11 +2501,11 @@ void select_mode(void)
rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel"); rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel");
/* draw an arrow next to all of them */ /* draw an arrow next to all of them */
rb->lcd_bitmap(arrow, 1, 9, 8, 6, true); rb->lcd_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6, true); rb->lcd_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6, true); rb->lcd_bitmap(arrow, 1, 41, 8, 6);
cursor(0, cursor_y, 112, 8); cursor(0, cursor_y, 112, 8);
rb->lcd_update(); rb->lcd_update();
@ -2535,11 +2535,11 @@ void select_mode(void)
rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel"); rb->lcd_puts(0, 7, "PLAY:Go|OFF:Cancel");
/* draw an arrow next to all of them */ /* draw an arrow next to all of them */
rb->lcd_bitmap(arrow, 1, 9, 8, 6, true); rb->lcd_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6, true); rb->lcd_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6, true); rb->lcd_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6, true); rb->lcd_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6, true); rb->lcd_bitmap(arrow, 1, 41, 8, 6);
cursor(0, cursor_y, 112, 8); cursor(0, cursor_y, 112, 8);
rb->lcd_update(); rb->lcd_update();
@ -2580,7 +2580,7 @@ void counter_finished(void)
rb->lcd_clear_display(); rb->lcd_clear_display();
/* draw "TIME'S UP" text */ /* draw "TIME'S UP" text */
rb->lcd_bitmap(times_up, 0, xpos, 112, 50, true); rb->lcd_bitmap(times_up, 0, xpos, 112, 50);
/* invert lcd */ /* invert lcd */
rb->lcd_set_drawmode(DRMODE_COMPLEMENT); rb->lcd_set_drawmode(DRMODE_COMPLEMENT);

View file

@ -71,9 +71,9 @@ static unsigned char cursor_pic[32] = {
/* draw a spot at the coordinates (x,y), range of p is 0-19 */ /* draw a spot at the coordinates (x,y), range of p is 0-19 */
static void draw_spot(int p) { static void draw_spot(int p) {
ptr = spot_pic[spots[p]]; ptr = spot_pic[spots[p]];
rb->lcd_bitmap (ptr, (p%5)*16+1, (p/5)*16+1, 14, 8, true); rb->lcd_bitmap (ptr, (p%5)*16+1, (p/5)*16+1, 14, 8);
ptr += 14; ptr += 14;
rb->lcd_bitmap (ptr, (p%5)*16+1, (p/5)*16+9, 14, 6, true); rb->lcd_bitmap (ptr, (p%5)*16+1, (p/5)*16+9, 14, 6);
} }
/* draw the cursor at the current cursor position */ /* draw the cursor at the current cursor position */
@ -81,10 +81,12 @@ static void draw_cursor(void) {
int i,j; int i,j;
i = (cursor_pos%5)*16; i = (cursor_pos%5)*16;
j = (cursor_pos/5)*16; j = (cursor_pos/5)*16;
rb->lcd_set_drawmode(DRMODE_FG);
ptr = cursor_pic; ptr = cursor_pic;
rb->lcd_bitmap (ptr, i, j, 16, 8, false); rb->lcd_bitmap (ptr, i, j, 16, 8);
ptr += 16; ptr += 16;
rb->lcd_bitmap (ptr, i, j+8, 16, 8, false); rb->lcd_bitmap (ptr, i, j+8, 16, 8);
rb->lcd_set_drawmode(DRMODE_SOLID);
} }
/* clear the cursor where it is */ /* clear the cursor where it is */

View file

@ -229,7 +229,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) {
while (1) { while (1) {
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT, false); rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT);
#ifdef REMOTE_LOGO #ifdef REMOTE_LOGO
rb->remote_clear_display(); rb->remote_clear_display();
rb->remote_bitmap(REMOTE_LOGO, rb->remote_bitmap(REMOTE_LOGO,

View file

@ -379,7 +379,9 @@ int minesweeper(void)
if(minefield[i][j].mine){ if(minefield[i][j].mine){
rb->lcd_putsxy(j*8+1,i*8+1,"b"); rb->lcd_putsxy(j*8+1,i*8+1,"b");
} else if(minefield[i][j].neighbors){ } else if(minefield[i][j].neighbors){
rb->lcd_bitmap(num[minefield[i][j].neighbors],j*8,i*8,8,8,false); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(num[minefield[i][j].neighbors],j*8,i*8,8,8);
rb->lcd_set_drawmode(DRMODE_SOLID);
} }
} else if(minefield[i][j].flag) { } else if(minefield[i][j].flag) {
rb->lcd_drawline(j*8+2,i*8+2,j*8+5,i*8+5); rb->lcd_drawline(j*8+2,i*8+2,j*8+5,i*8+5);

View file

@ -148,7 +148,7 @@ static unsigned char picture[20][32] = {
static void draw_spot(int p, int x, int y) static void draw_spot(int p, int x, int y)
{ {
if (pic || p==20) { if (pic || p==20) {
rb->lcd_bitmap (picture[p-1], x, y, 16, 16, true); rb->lcd_bitmap (picture[p-1], x, y, 16, 16);
} else { } else {
rb->lcd_drawrect(x, y, 16, 16); rb->lcd_drawrect(x, y, 16, 16);
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);

View file

@ -619,11 +619,13 @@ void draw_apple( void )
#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128
char pscore[5], counter[4]; char pscore[5], counter[4];
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp,false); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp);
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
rb->lcd_fillrect(0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); rb->lcd_fillrect(0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp);
rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp,false);
rb->snprintf(counter,sizeof(counter),"%d",applecount); rb->snprintf(counter,sizeof(counter),"%d",applecount);
rb->lcd_getstringsize(counter,&strwdt,&strhgt); rb->lcd_getstringsize(counter,&strwdt,&strhgt);
@ -1295,7 +1297,9 @@ void game_init(void)
#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPWIDTH_snakebmp,false); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPWIDTH_snakebmp);
rb->lcd_set_drawmode(DRMODE_SOLID);
rb->snprintf(plevel,sizeof(plevel),"%d",level); rb->snprintf(plevel,sizeof(plevel),"%d",level);
rb->lcd_getstringsize(plevel,&strwdt,&strhgt); rb->lcd_getstringsize(plevel,&strwdt,&strhgt);

View file

@ -115,7 +115,7 @@ static void snow_move(void)
if (particle_exists(i)) if (particle_exists(i))
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
rb->lcd_bitmap(flake,particles[i][0],particles[i][1], rb->lcd_bitmap(flake,particles[i][0],particles[i][1],
FLAKE_WIDTH,FLAKE_WIDTH,true); FLAKE_WIDTH,FLAKE_WIDTH);
#else #else
pgfx_drawpixel(particles[i][0],particles[i][1]); pgfx_drawpixel(particles[i][0],particles[i][1]);
#endif #endif

View file

@ -900,8 +900,8 @@ int solitaire(void){
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
/* known card */ /* known card */
if(deck[c].known){ if(deck[c].known){
rb->lcd_bitmap(numbers[deck[c].num], i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1, j, 8, 8, true); rb->lcd_bitmap(numbers[deck[c].num], i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1, j, 8, 8);
rb->lcd_bitmap(colors[deck[c].color], i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+7, j, 8, 8, true); rb->lcd_bitmap(colors[deck[c].color], i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+7, j, 8, 8);
} }
/* draw top line of the card */ /* draw top line of the card */
rb->lcd_drawline(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1,j,i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+CARD_WIDTH-1,j); rb->lcd_drawline(i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+1,j,i*(LCD_WIDTH - CARD_WIDTH)/COL_NUM+CARD_WIDTH-1,j);
@ -944,9 +944,9 @@ int solitaire(void){
} }
} }
if(c != NOT_A_CARD) { if(c != NOT_A_CARD) {
rb->lcd_bitmap(numbers[deck[c].num], LCD_WIDTH2 - CARD_WIDTH+1, i*CARD_HEIGHT, 8, 8, true); rb->lcd_bitmap(numbers[deck[c].num], LCD_WIDTH2 - CARD_WIDTH+1, i*CARD_HEIGHT, 8, 8);
} }
rb->lcd_bitmap(colors[i], LCD_WIDTH2 - CARD_WIDTH+7, i*CARD_HEIGHT, 8, 8, true); rb->lcd_bitmap(colors[i], LCD_WIDTH2 - CARD_WIDTH+7, i*CARD_HEIGHT, 8, 8);
/* draw a selected card */ /* draw a selected card */
if(c != NOT_A_CARD) { if(c != NOT_A_CARD) {
if(sel_card == c){ if(sel_card == c){
@ -976,8 +976,8 @@ int solitaire(void){
rb->lcd_drawline(LCD_WIDTH2,LCD_HEIGHT-CARD_HEIGHT,LCD_WIDTH2,LCD_HEIGHT-2); rb->lcd_drawline(LCD_WIDTH2,LCD_HEIGHT-CARD_HEIGHT,LCD_WIDTH2,LCD_HEIGHT-2);
#endif #endif
if(cur_rem != NOT_A_CARD){ if(cur_rem != NOT_A_CARD){
rb->lcd_bitmap(numbers[deck[cur_rem].num], LCD_WIDTH2 - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT, 8, 8, true); rb->lcd_bitmap(numbers[deck[cur_rem].num], LCD_WIDTH2 - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT, 8, 8);
rb->lcd_bitmap(colors[deck[cur_rem].color], LCD_WIDTH2 - CARD_WIDTH+7, LCD_HEIGHT-CARD_HEIGHT, 8, 8, true); rb->lcd_bitmap(colors[deck[cur_rem].color], LCD_WIDTH2 - CARD_WIDTH+7, LCD_HEIGHT-CARD_HEIGHT, 8, 8);
/* draw a selected card */ /* draw a selected card */
if(sel_card == cur_rem){ if(sel_card == cur_rem){
rb->lcd_drawrect(LCD_WIDTH2 - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT,CARD_WIDTH-1, CARD_HEIGHT-1); rb->lcd_drawrect(LCD_WIDTH2 - CARD_WIDTH+1, LCD_HEIGHT-CARD_HEIGHT,CARD_WIDTH-1, CARD_HEIGHT-1);

View file

@ -262,18 +262,18 @@ static void update_icons(void)
/* The CUT icon */ /* The CUT icon */
rb->lcd_bitmap(CUT_BMP, rb->lcd_bitmap(CUT_BMP,
LCD_WIDTH / 3 / 2 - BMPWIDTH / 2, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH / 3 / 2 - BMPWIDTH / 2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT, true); BMPWIDTH, BMPHEIGHT);
/* The loop mode icon */ /* The loop mode icon */
rb->lcd_bitmap(LOOP_BMP[splitedit_get_loop_mode()], rb->lcd_bitmap(LOOP_BMP[splitedit_get_loop_mode()],
LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT, true); BMPWIDTH, BMPHEIGHT);
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F)
/* The scale icon */ /* The scale icon */
rb->lcd_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs()], rb->lcd_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs()],
2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT, true); BMPWIDTH, BMPHEIGHT);
#else #else
{ {
static int idx; static int idx;
@ -281,7 +281,7 @@ static void update_icons(void)
idx = 1 - idx; idx = 1 - idx;
rb->lcd_bitmap(SCALE_BMP[idx], rb->lcd_bitmap(SCALE_BMP[idx],
2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT, true); BMPWIDTH, BMPHEIGHT);
} }
#endif #endif

View file

@ -485,10 +485,10 @@ static void star_display_board_info(void)
if (control == STAR_CONTROL_BALL) if (control == STAR_CONTROL_BALL)
rb->lcd_bitmap (ball_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE, rb->lcd_bitmap (ball_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE,
STAR_TILE_SIZE, true); STAR_TILE_SIZE);
else else
rb->lcd_bitmap (block_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE, rb->lcd_bitmap (block_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE,
STAR_TILE_SIZE, true); STAR_TILE_SIZE);
rb->lcd_update_rect(0, label_offset_y, LCD_WIDTH, char_height); rb->lcd_update_rect(0, label_offset_y, LCD_WIDTH, char_height);
} }
@ -522,14 +522,14 @@ static int star_load_level(int current_level)
rb->lcd_bitmap (wall_bmp, rb->lcd_bitmap (wall_bmp,
STAR_OFFSET_X + x * STAR_TILE_SIZE, STAR_OFFSET_X + x * STAR_TILE_SIZE,
STAR_OFFSET_Y + y * STAR_TILE_SIZE, STAR_OFFSET_Y + y * STAR_TILE_SIZE,
STAR_TILE_SIZE, STAR_TILE_SIZE, false); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
case STAR_STAR: case STAR_STAR:
rb->lcd_bitmap (star_bmp, rb->lcd_bitmap (star_bmp,
STAR_OFFSET_X + x * STAR_TILE_SIZE, STAR_OFFSET_X + x * STAR_TILE_SIZE,
STAR_OFFSET_Y + y * STAR_TILE_SIZE, STAR_OFFSET_Y + y * STAR_TILE_SIZE,
STAR_TILE_SIZE, STAR_TILE_SIZE, false); STAR_TILE_SIZE, STAR_TILE_SIZE);
star_count++; star_count++;
break; break;
@ -539,7 +539,7 @@ static int star_load_level(int current_level)
rb->lcd_bitmap (ball_bmp, rb->lcd_bitmap (ball_bmp,
STAR_OFFSET_X + x * STAR_TILE_SIZE, STAR_OFFSET_X + x * STAR_TILE_SIZE,
STAR_OFFSET_Y + y * STAR_TILE_SIZE, STAR_OFFSET_Y + y * STAR_TILE_SIZE,
STAR_TILE_SIZE, STAR_TILE_SIZE, false); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
@ -549,7 +549,7 @@ static int star_load_level(int current_level)
rb->lcd_bitmap (block_bmp, rb->lcd_bitmap (block_bmp,
STAR_OFFSET_X + x * STAR_TILE_SIZE, STAR_OFFSET_X + x * STAR_TILE_SIZE,
STAR_OFFSET_Y + y * STAR_TILE_SIZE, STAR_OFFSET_Y + y * STAR_TILE_SIZE,
STAR_TILE_SIZE, STAR_TILE_SIZE, false); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
} }
ptr_tab++; ptr_tab++;
@ -668,7 +668,7 @@ static int star_run_game(void)
ball_bmp, ball_bmp,
STAR_OFFSET_X + ball_x * STAR_TILE_SIZE + move_x * i, STAR_OFFSET_X + ball_x * STAR_TILE_SIZE + move_x * i,
STAR_OFFSET_Y + ball_y * STAR_TILE_SIZE + move_y * i, STAR_OFFSET_Y + ball_y * STAR_TILE_SIZE + move_y * i,
STAR_TILE_SIZE, STAR_TILE_SIZE, true); STAR_TILE_SIZE, STAR_TILE_SIZE);
rb->lcd_update_rect( rb->lcd_update_rect(
STAR_OFFSET_X + ball_x * STAR_TILE_SIZE + move_x * i, STAR_OFFSET_X + ball_x * STAR_TILE_SIZE + move_x * i,
@ -700,7 +700,7 @@ static int star_run_game(void)
block_bmp, block_bmp,
STAR_OFFSET_X + block_x * STAR_TILE_SIZE + move_x * i, STAR_OFFSET_X + block_x * STAR_TILE_SIZE + move_x * i,
STAR_OFFSET_Y + block_y * STAR_TILE_SIZE + move_y * i, STAR_OFFSET_Y + block_y * STAR_TILE_SIZE + move_y * i,
STAR_TILE_SIZE, STAR_TILE_SIZE, true); STAR_TILE_SIZE, STAR_TILE_SIZE);
rb->lcd_update_rect( rb->lcd_update_rect(
STAR_OFFSET_X + block_x * STAR_TILE_SIZE + move_x * i, STAR_OFFSET_X + block_x * STAR_TILE_SIZE + move_x * i,
@ -766,7 +766,7 @@ static int star_menu(void)
move_y = 0; move_y = 0;
rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]], rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]],
2, menu_offset_y + menu_y * char_height, 7, 8, true); 2, menu_offset_y + menu_y * char_height, 7, 8);
rb->lcd_update_rect (2, menu_offset_y + menu_y * 8, 8, 8); rb->lcd_update_rect (2, menu_offset_y + menu_y * 8, 8, 8);
rb->sleep(STAR_SLEEP); rb->sleep(STAR_SLEEP);
anim_state++; anim_state++;
@ -840,14 +840,14 @@ static int star_menu(void)
{ {
rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
rb->lcd_fillrect (2, 30, 7, 4 * 8); rb->lcd_fillrect (2, 30, 7, 4 * 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]], rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]],
2, menu_offset_y + menu_y * 8 + move_y * i, 7, 8, 2, menu_offset_y + menu_y * 8 + move_y * i, 7, 8);
false);
rb->lcd_update_rect(2, 30, 8, 4 * 8); rb->lcd_update_rect(2, 30, 8, 4 * 8);
anim_state++; anim_state++;
rb->sleep(STAR_SLEEP); rb->sleep(STAR_SLEEP);
} }
rb->lcd_set_drawmode(DRMODE_SOLID);
menu_y += move_y; menu_y += move_y;
} }
} }

View file

@ -278,47 +278,55 @@ void change_settings(void)
} }
void draw_analog_minimeters(void) { void draw_analog_minimeters(void) {
rb->lcd_bitmap(sound_speaker, 0, 12, 4, 8, true); rb->lcd_bitmap(sound_speaker, 0, 12, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(5<left_needle_top_x) if(5<left_needle_top_x)
rb->lcd_bitmap(sound_low_level, 5, 12, 2, 8, false); rb->lcd_bitmap(sound_low_level, 5, 12, 2, 8);
if(12<left_needle_top_x) if(12<left_needle_top_x)
rb->lcd_bitmap(sound_med_level, 7, 12, 2, 8, false); rb->lcd_bitmap(sound_med_level, 7, 12, 2, 8);
if(24<left_needle_top_x) if(24<left_needle_top_x)
rb->lcd_bitmap(sound_high_level, 9, 12, 2, 8, false); rb->lcd_bitmap(sound_high_level, 9, 12, 2, 8);
if(40<left_needle_top_x) if(40<left_needle_top_x)
rb->lcd_bitmap(sound_max_level, 12, 12, 3, 8, false); rb->lcd_bitmap(sound_max_level, 12, 12, 3, 8);
rb->lcd_bitmap(sound_speaker, 54, 12, 4, 8, true); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(sound_speaker, 54, 12, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(5<(right_needle_top_x-56)) if(5<(right_needle_top_x-56))
rb->lcd_bitmap(sound_low_level, 59, 12, 2, 8, false); rb->lcd_bitmap(sound_low_level, 59, 12, 2, 8);
if(12<(right_needle_top_x-56)) if(12<(right_needle_top_x-56))
rb->lcd_bitmap(sound_med_level, 61, 12, 2, 8, false); rb->lcd_bitmap(sound_med_level, 61, 12, 2, 8);
if(24<(right_needle_top_x-56)) if(24<(right_needle_top_x-56))
rb->lcd_bitmap(sound_high_level, 63, 12, 2, 8, false); rb->lcd_bitmap(sound_high_level, 63, 12, 2, 8);
if(40<(right_needle_top_x-56)) if(40<(right_needle_top_x-56))
rb->lcd_bitmap(sound_max_level, 66, 12, 3, 8, false); rb->lcd_bitmap(sound_max_level, 66, 12, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID);
} }
void draw_digital_minimeters(void) { void draw_digital_minimeters(void) {
rb->lcd_bitmap(sound_speaker, 34, 24, 4, 8, true); rb->lcd_bitmap(sound_speaker, 34, 24, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(1<num_left_leds) if(1<num_left_leds)
rb->lcd_bitmap(sound_low_level, 39, 24, 2, 8, false); rb->lcd_bitmap(sound_low_level, 39, 24, 2, 8);
if(2<num_left_leds) if(2<num_left_leds)
rb->lcd_bitmap(sound_med_level, 41, 24, 2, 8, false); rb->lcd_bitmap(sound_med_level, 41, 24, 2, 8);
if(5<num_left_leds) if(5<num_left_leds)
rb->lcd_bitmap(sound_high_level, 43, 24, 2, 8, false); rb->lcd_bitmap(sound_high_level, 43, 24, 2, 8);
if(8<num_left_leds) if(8<num_left_leds)
rb->lcd_bitmap(sound_max_level, 46, 24, 3, 8, false); rb->lcd_bitmap(sound_max_level, 46, 24, 3, 8);
rb->lcd_bitmap(sound_speaker, 34, 40, 4, 8, true); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(sound_speaker, 34, 40, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG);
if(1<(num_right_leds)) if(1<(num_right_leds))
rb->lcd_bitmap(sound_low_level, 39, 40, 2, 8, false); rb->lcd_bitmap(sound_low_level, 39, 40, 2, 8);
if(2<(num_right_leds)) if(2<(num_right_leds))
rb->lcd_bitmap(sound_med_level, 41, 40, 2, 8, false); rb->lcd_bitmap(sound_med_level, 41, 40, 2, 8);
if(5<(num_right_leds)) if(5<(num_right_leds))
rb->lcd_bitmap(sound_high_level, 43, 40, 2, 8, false); rb->lcd_bitmap(sound_high_level, 43, 40, 2, 8);
if(8<(num_right_leds)) if(8<(num_right_leds))
rb->lcd_bitmap(sound_max_level, 46, 40, 3, 8, false); rb->lcd_bitmap(sound_max_level, 46, 40, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID);
} }
void analog_meter(void) { void analog_meter(void) {
@ -350,8 +358,10 @@ void analog_meter(void) {
draw_analog_minimeters(); draw_analog_minimeters();
/* Needle covers */ /* Needle covers */
rb->lcd_bitmap(needle_cover, 22, 59, 13, 5, false); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(needle_cover, 78, 59, 13, 5, false); rb->lcd_bitmap(needle_cover, 22, 59, 13, 5);
rb->lcd_bitmap(needle_cover, 78, 59, 13, 5);
rb->lcd_set_drawmode(DRMODE_SOLID);
/* Show Left/Right */ /* Show Left/Right */
rb->lcd_putsxy(16, 12, "Left"); rb->lcd_putsxy(16, 12, "Left");
@ -383,12 +393,15 @@ void digital_meter(void) {
last_num_left_leds = num_left_leds; last_num_left_leds = num_left_leds;
last_num_right_leds = num_right_leds; last_num_right_leds = num_right_leds;
rb->lcd_set_drawmode(DRMODE_FG);
/* LEDS */ /* LEDS */
for(i=0; i<num_left_leds; i++) for(i=0; i<num_left_leds; i++)
rb->lcd_bitmap(led, i*9+2+i, 14, 9, 5, false); rb->lcd_bitmap(led, i*9+2+i, 14, 9, 5);
for(i=0; i<num_right_leds; i++) for(i=0; i<num_right_leds; i++)
rb->lcd_bitmap(led, i*9+2+i, 52, 9, 5, false); rb->lcd_bitmap(led, i*9+2+i, 52, 9, 5);
rb->lcd_set_drawmode(DRMODE_SOLID);
if(settings.digital_minimeters) if(settings.digital_minimeters)
draw_digital_minimeters(); draw_digital_minimeters();

View file

@ -323,7 +323,7 @@ bool statusbar_icon_volume(int percent)
if (volume==0) { if (volume==0) {
lcd_bitmap(bitmap_icons_7x8[Icon_Mute], lcd_bitmap(bitmap_icons_7x8[Icon_Mute],
ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 - 4, ICON_VOLUME_X_POS + ICON_VOLUME_WIDTH / 2 - 4,
STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT, false); STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT);
} }
else { else {
/* We want to redraw the icon later on */ /* We want to redraw the icon later on */
@ -371,7 +371,7 @@ bool statusbar_icon_volume(int percent)
void statusbar_icon_play_state(int state) void statusbar_icon_play_state(int state)
{ {
lcd_bitmap(bitmap_icons_7x8[state], ICON_PLAY_STATE_X_POS, STATUSBAR_Y_POS, lcd_bitmap(bitmap_icons_7x8[state], ICON_PLAY_STATE_X_POS, STATUSBAR_Y_POS,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -380,7 +380,7 @@ void statusbar_icon_play_state(int state)
void statusbar_icon_play_mode(int mode) void statusbar_icon_play_mode(int mode)
{ {
lcd_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS, STATUSBAR_Y_POS, lcd_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS, STATUSBAR_Y_POS,
ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -389,7 +389,7 @@ void statusbar_icon_play_mode(int mode)
void statusbar_icon_shuffle(void) void statusbar_icon_shuffle(void)
{ {
lcd_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS, lcd_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS,
STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT, false); STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -398,7 +398,7 @@ void statusbar_icon_shuffle(void)
void statusbar_icon_lock(void) void statusbar_icon_lock(void)
{ {
lcd_bitmap(bitmap_icons_5x8[Icon_Lock], LOCK_X_POS, lcd_bitmap(bitmap_icons_5x8[Icon_Lock], LOCK_X_POS,
STATUSBAR_Y_POS, 5, 8, false); STATUSBAR_Y_POS, 5, 8);
} }
#if CONFIG_LED == LED_VIRTUAL #if CONFIG_LED == LED_VIRTUAL
@ -408,7 +408,7 @@ void statusbar_icon_lock(void)
void statusbar_led(void) void statusbar_led(void)
{ {
lcd_bitmap(bitmap_icon_disk, ICON_DISK_X_POS, lcd_bitmap(bitmap_icon_disk, ICON_DISK_X_POS,
STATUSBAR_Y_POS, ICON_DISK_WIDTH, STATUSBAR_HEIGHT, false); STATUSBAR_Y_POS, ICON_DISK_WIDTH, STATUSBAR_HEIGHT);
} }
#endif #endif

View file

@ -1108,7 +1108,7 @@ void peak_meter_draw_trig(int xpos, int ypos) {
scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2, scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2,
TRIGBAR_WIDTH, 0, 0, HORIZONTAL); TRIGBAR_WIDTH, 0, 0, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos, lcd_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_STEADY: case TRIG_STEADY:
@ -1118,7 +1118,7 @@ void peak_meter_draw_trig(int xpos, int ypos) {
scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2, scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2,
TRIGBAR_WIDTH, 0, TRIGBAR_WIDTH - time_left, HORIZONTAL); TRIGBAR_WIDTH, 0, TRIGBAR_WIDTH - time_left, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos, lcd_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_GO: case TRIG_GO:
@ -1127,7 +1127,7 @@ void peak_meter_draw_trig(int xpos, int ypos) {
TRIGBAR_WIDTH, TRIGBAR_WIDTH, TRIGBAR_WIDTH, HORIZONTAL); TRIGBAR_WIDTH, TRIGBAR_WIDTH, TRIGBAR_WIDTH, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Record], lcd_bitmap(bitmap_icons_7x8[Icon_Record],
TRIG_WIDTH - ICON_PLAY_STATE_WIDTH, ypos, TRIG_WIDTH - ICON_PLAY_STATE_WIDTH, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_POSTREC: case TRIG_POSTREC:
@ -1137,7 +1137,7 @@ void peak_meter_draw_trig(int xpos, int ypos) {
TRIGBAR_WIDTH, time_left, TRIGBAR_WIDTH, HORIZONTAL); TRIGBAR_WIDTH, time_left, TRIGBAR_WIDTH, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Record], lcd_bitmap(bitmap_icons_7x8[Icon_Record],
TRIG_WIDTH - ICON_PLAY_STATE_WIDTH, ypos, TRIG_WIDTH - ICON_PLAY_STATE_WIDTH, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT, false); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
} }

View file

@ -870,7 +870,7 @@ bool f2_rec_screen(void)
snprintf(buf, 32, "%d", global_settings.rec_quality); snprintf(buf, 32, "%d", global_settings.rec_quality);
lcd_putsxy(0, LCD_HEIGHT/2-h, buf); lcd_putsxy(0, LCD_HEIGHT/2-h, buf);
lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
/* Frequency */ /* Frequency */
snprintf(buf, sizeof buf, "%s:", str(LANG_RECORDING_FREQUENCY)); snprintf(buf, sizeof buf, "%s:", str(LANG_RECORDING_FREQUENCY));
@ -880,7 +880,7 @@ bool f2_rec_screen(void)
lcd_getstringsize(ptr, &w, &h); lcd_getstringsize(ptr, &w, &h);
lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
/* Channel mode */ /* Channel mode */
switch ( global_settings.rec_channels ) { switch ( global_settings.rec_channels ) {
@ -901,7 +901,7 @@ bool f2_rec_screen(void)
lcd_getstringsize(ptr, &w, &h); lcd_getstringsize(ptr, &w, &h);
lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], lcd_bitmap(bitmap_icons_7x8[Icon_FastForward],
LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true); LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
lcd_update(); lcd_update();
@ -995,14 +995,14 @@ bool f3_rec_screen(void)
lcd_getstringsize(ptr, &w, &h); lcd_getstringsize(ptr, &w, &h);
lcd_putsxy(0, LCD_HEIGHT/2-h, ptr); lcd_putsxy(0, LCD_HEIGHT/2-h, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
/* trigger setup */ /* trigger setup */
ptr = str(LANG_RECORD_TRIGGER); ptr = str(LANG_RECORD_TRIGGER);
lcd_getstringsize(ptr,&w,&h); lcd_getstringsize(ptr,&w,&h);
lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr); lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
lcd_update(); lcd_update();

View file

@ -94,7 +94,9 @@ void usb_display_info(void)
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
/* Center bitmap on screen */ /* Center bitmap on screen */
lcd_bitmap(usb_logo, LCD_WIDTH/2-BMPWIDTH_usb_logo/2, LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo, BMPHEIGHT_usb_logo, false); lcd_bitmap(usb_logo, LCD_WIDTH/2-BMPWIDTH_usb_logo/2,
LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo,
BMPHEIGHT_usb_logo);
status_draw(true); status_draw(true);
lcd_update(); lcd_update();
#else #else
@ -231,14 +233,16 @@ void charging_display_info(bool animate)
if (!animate) if (!animate)
{ /* draw the outline */ { /* draw the outline */
/* middle part */ /* middle part */
lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8, true); lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
lcd_set_drawmode(DRMODE_FG);
/* upper line */ /* upper line */
charging_logo[0] = charging_logo[1] = 0x00; charging_logo[0] = charging_logo[1] = 0x00;
memset(charging_logo+2, 0x80, 34); memset(charging_logo+2, 0x80, 34);
lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8, false); lcd_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8);
/* lower line */ /* lower line */
memset(charging_logo+2, 0x01, 34); memset(charging_logo+2, 0x01, 34);
lcd_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8, false); lcd_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8);
lcd_set_drawmode(DRMODE_SOLID);
} }
else else
{ /* animate the middle part */ { /* animate the middle part */
@ -253,7 +257,7 @@ void charging_display_info(bool animate)
charging_logo[i] = 0x01 << bitpos; charging_logo[i] = 0x01 << bitpos;
} }
} }
lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8, true); lcd_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
phase++; phase++;
} }
lcd_update(); lcd_update();
@ -411,7 +415,7 @@ int pitch_screen(void)
lcd_getstringsize(ptr,&w,&h); lcd_getstringsize(ptr,&w,&h);
lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr); lcd_putsxy((LCD_WIDTH-w)/2, 0, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_UpArrow], lcd_bitmap(bitmap_icons_7x8[Icon_UpArrow],
LCD_WIDTH/2 - 3, h*2, 7, 8, true); LCD_WIDTH/2 - 3, h*2, 7, 8);
snprintf(buf, sizeof buf, "%d.%d%%", pitch / 10, pitch % 10 ); snprintf(buf, sizeof buf, "%d.%d%%", pitch / 10, pitch % 10 );
lcd_getstringsize(buf,&w,&h); lcd_getstringsize(buf,&w,&h);
@ -421,13 +425,13 @@ int pitch_screen(void)
lcd_getstringsize(ptr,&w,&h); lcd_getstringsize(ptr,&w,&h);
lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
ptr = str(LANG_PAUSE); ptr = str(LANG_PAUSE);
lcd_getstringsize(ptr,&w,&h); lcd_getstringsize(ptr,&w,&h);
lcd_putsxy((LCD_WIDTH-(w/2))/2, LCD_HEIGHT/2 - h/2, ptr); lcd_putsxy((LCD_WIDTH-(w/2))/2, LCD_HEIGHT/2 - h/2, ptr);
lcd_bitmap(bitmap_icons_7x8[Icon_Pause], lcd_bitmap(bitmap_icons_7x8[Icon_Pause],
(LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8, true); (LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8);
lcd_update(); lcd_update();
} }
@ -632,11 +636,11 @@ bool quick_screen(int context, int button)
} }
lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8, true); LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8, true); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], lcd_bitmap(bitmap_icons_7x8[Icon_FastForward],
LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8, true); LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
lcd_update(); lcd_update();
key = button_get(true); key = button_get(true);

View file

@ -245,11 +245,11 @@ void status_draw(bool force_redraw)
/* draw power plug if charging */ /* draw power plug if charging */
if (info.inserted) if (info.inserted)
lcd_bitmap(bitmap_icons_7x8[Icon_Plug], ICON_PLUG_X_POS, lcd_bitmap(bitmap_icons_7x8[Icon_Plug], ICON_PLUG_X_POS,
STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT, false); STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT);
#ifdef HAVE_USB_POWER #ifdef HAVE_USB_POWER
else if (info.usb_power) else if (info.usb_power)
lcd_bitmap(bitmap_icons_7x8[Icon_USBPlug], ICON_PLUG_X_POS, lcd_bitmap(bitmap_icons_7x8[Icon_USBPlug], ICON_PLUG_X_POS,
STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT, false); STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT);
#endif #endif
info.redraw_volume = statusbar_icon_volume(info.volume); info.redraw_volume = statusbar_icon_volume(info.volume);

View file

@ -395,8 +395,7 @@ static int showdir(void)
offset = (line_height - 8) / 2; offset = (line_height - 8) / 2;
lcd_bitmap(icon, lcd_bitmap(icon,
CURSOR_X * 6 + CURSOR_WIDTH, CURSOR_X * 6 + CURSOR_WIDTH,
MARGIN_Y+(i-start)*line_height + offset, MARGIN_Y+(i-start)*line_height + offset, 6, 8);
6, 8, true);
#else #else
if (icon < 0 ) if (icon < 0 )
icon = Unknown; icon = Unknown;

View file

@ -112,11 +112,13 @@ static bool wps_loaded = false;
/* Display images */ /* Display images */
static void wps_display_images(void) { static void wps_display_images(void) {
int n; int n;
lcd_set_drawmode(DRMODE_FG);
for (n = 0; n < MAX_IMAGES; n++) { for (n = 0; n < MAX_IMAGES; n++) {
if (img[n].loaded) { if (img[n].loaded) {
lcd_bitmap(img[n].ptr, img[n].x, img[n].y, img[n].w, img[n].h, false); lcd_bitmap(img[n].ptr, img[n].x, img[n].y, img[n].w, img[n].h);
} }
} }
lcd_set_drawmode(DRMODE_SOLID);
} }
#endif #endif

View file

@ -208,19 +208,19 @@ void lcd_init(void)
/*** update functions ***/ /*** update functions ***/
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that y and height are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* p_data, int x, int y, int width, void lcd_blit(const unsigned char* data, int x, int by, int width,
int height, int stride) int bheight, int stride)
{ {
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
while (height--) while (bheight--)
{ {
lcd_write_command_ex(LCD_CNTL_PAGE, y++ & 0xf, -1); lcd_write_command_ex(LCD_CNTL_PAGE, by++ & 0xf, -1);
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE); lcd_write_command(LCD_CNTL_DATA_WRITE);
lcd_write_data(p_data, width); lcd_write_data(data, width);
p_data += stride; data += stride;
} }
} }
@ -245,16 +245,16 @@ void lcd_update(void)
/* Update a fraction of the display. */ /* Update a fraction of the display. */
void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode")));
void lcd_update_rect(int x_start, int y, int width, int height) void lcd_update_rect(int x, int y, int width, int height)
{ {
int ymax; int ymax;
/* The Y coordinates have to work on even 8 pixel rows */ /* The Y coordinates have to work on even 8 pixel rows */
ymax = (y + height-1)/8; ymax = (y + height-1) >> 3;
y /= 8; y >>= 3;
if(x_start + width > LCD_WIDTH) if(x + width > LCD_WIDTH)
width = LCD_WIDTH - x_start; width = LCD_WIDTH - x;
if (width <= 0) if (width <= 0)
return; /* nothing left to do, 0 is harmful to lcd_write_data() */ return; /* nothing left to do, 0 is harmful to lcd_write_data() */
if(ymax >= LCD_HEIGHT/8) if(ymax >= LCD_HEIGHT/8)
@ -264,10 +264,10 @@ void lcd_update_rect(int x_start, int y, int width, int height)
for (; y <= ymax; y++) for (; y <= ymax; y++)
{ {
lcd_write_command_ex(LCD_CNTL_PAGE, y, -1); lcd_write_command_ex(LCD_CNTL_PAGE, y, -1);
lcd_write_command_ex(LCD_CNTL_COLUMN, x_start, -1); lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE); lcd_write_command(LCD_CNTL_DATA_WRITE);
lcd_write_data (&lcd_framebuffer[y][x_start], width); lcd_write_data (&lcd_framebuffer[y][x], width);
} }
} }
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
@ -333,8 +333,10 @@ static void nopixel(int x, int y)
(void)y; (void)y;
} }
lcd_pixelfunc_type* pixelfunc[8] = {flippixel, nopixel, setpixel, setpixel, lcd_pixelfunc_type* pixelfunc[8] = {
nopixel, clearpixel, nopixel, clearpixel}; flippixel, nopixel, setpixel, setpixel,
nopixel, clearpixel, nopixel, clearpixel
};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits) static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
@ -356,7 +358,30 @@ static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
*address = (*address & ~mask) | (bits & mask); *address = (*address & ~mask) | (bits & mask);
} }
lcd_blockfunc_type* blockfunc[4] = {flipblock, bgblock, fgblock, solidblock}; static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address ^= (~bits & mask);
}
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address &= ~(bits & mask);
}
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address |= (~bits & mask);
}
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (~bits & mask);
}
lcd_blockfunc_type* blockfunc[8] = {
flipblock, bgblock, fgblock, solidblock,
flipinvblock, bginvblock, fginvblock, solidinvblock
};
/*** drawing functions ***/ /*** drawing functions ***/
@ -452,7 +477,7 @@ void lcd_hline(int x1, int x2, int y)
{ {
int x; int x;
unsigned char *dst; unsigned char *dst;
unsigned char mask, bits; unsigned mask;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
/* direction flip */ /* direction flip */
@ -473,13 +498,12 @@ void lcd_hline(int x1, int x2, int y)
if (x2 >= LCD_WIDTH) if (x2 >= LCD_WIDTH)
x2 = LCD_WIDTH-1; x2 = LCD_WIDTH-1;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; bfunc = blockfunc[drawmode];
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; dst = &lcd_framebuffer[y>>3][x1];
dst = &lcd_framebuffer[y/8][x1];
mask = 1 << (y & 7); mask = 1 << (y & 7);
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
bfunc(dst++, mask, bits); bfunc(dst++, mask, 0xFFu);
} }
/* Draw a vertical line (optimised) */ /* Draw a vertical line (optimised) */
@ -487,7 +511,7 @@ void lcd_vline(int x, int y1, int y2)
{ {
int ny; int ny;
unsigned char *dst; unsigned char *dst;
unsigned char mask_top, mask_bottom, bits; unsigned mask, mask_bottom;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
/* direction flip */ /* direction flip */
@ -508,28 +532,20 @@ void lcd_vline(int x, int y1, int y2)
if (y2 >= LCD_HEIGHT) if (y2 >= LCD_HEIGHT)
y2 = LCD_HEIGHT-1; y2 = LCD_HEIGHT-1;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; bfunc = blockfunc[drawmode];
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; dst = &lcd_framebuffer[y1>>3][x];
dst = &lcd_framebuffer[y1/8][x];
ny = y2 - (y1 & ~7); ny = y2 - (y1 & ~7);
mask_top = 0xFFu << (y1 & 7); mask = 0xFFu << (y1 & 7);
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (7 - (ny & 7));
if (ny >= 8) for (; ny >= 8; ny -= 8)
{ {
bfunc(dst, mask_top, bits); bfunc(dst, mask, 0xFFu);
dst += LCD_WIDTH;
for (; ny > 15; ny -= 8)
{
bfunc(dst, 0xFFu, bits);
dst += LCD_WIDTH; dst += LCD_WIDTH;
mask = 0xFFu;
} }
} mask_bottom &= mask;
else bfunc(dst, mask_bottom, 0xFFu);
mask_bottom &= mask_top;
bfunc(dst, mask_bottom, bits);
} }
/* Draw a rectangular box */ /* Draw a rectangular box */
@ -547,29 +563,19 @@ void lcd_drawrect(int x, int y, int width, int height)
lcd_hline(x, x2, y2); lcd_hline(x, x2, y2);
} }
/* helper function for lcd_fillrect() */
static void fillrow(lcd_blockfunc_type *bfunc, unsigned char *address,
int width, unsigned mask, unsigned bits)
{
int i;
for (i = 0; i < width; i++)
bfunc(address++, mask, bits);
}
/* Fill a rectangular area */ /* Fill a rectangular area */
void lcd_fillrect(int x, int y, int width, int height) void lcd_fillrect(int x, int y, int width, int height)
{ {
int ny; int ny, i;
unsigned char *dst; unsigned char *dst;
unsigned char mask_top, mask_bottom, bits; unsigned mask, mask_bottom;
unsigned bits = 0xFFu;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt = (drawmode & DRMODE_INVERSEVID) ? bool fillopt;
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width < 0) || (y + height < 0)) || (x + width <= 0) || (y + height <= 0))
return; return;
/* clipping */ /* clipping */
@ -588,37 +594,40 @@ void lcd_fillrect(int x, int y, int width, int height)
if (y + height > LCD_HEIGHT) if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y; height = LCD_HEIGHT - y;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; fillopt = (drawmode & DRMODE_INVERSEVID) ?
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
dst = &lcd_framebuffer[y/8][x]; if (fillopt &&(drawmode & DRMODE_INVERSEVID))
bits = 0;
bfunc = blockfunc[drawmode];
dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7); ny = height - 1 + (y & 7);
mask_top = 0xFFu << (y & 7); mask = 0xFFu << (y & 7);
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (7 - (ny & 7));
if (ny >= 8) for (; ny >= 8; ny -= 8)
{ {
if (fillopt && mask_top == 0xFF) if (fillopt && (mask == 0xFFu))
memset(dst, bits, width); memset(dst, bits, width);
else else
fillrow(bfunc, dst, width, mask_top, bits);
dst += LCD_WIDTH;
for (; ny > 15; ny -= 8)
{ {
if (fillopt) unsigned char *dst_row = dst;
memset(dst, bits, width);
else
fillrow(bfunc, dst, width, 0xFFu, bits);
dst += LCD_WIDTH;
}
}
else
mask_bottom &= mask_top;
if (fillopt && mask_bottom == 0xFF) for (i = width; i > 0; i--)
bfunc(dst_row++, mask, 0xFFu);
}
dst += LCD_WIDTH;
mask = 0xFFu;
}
mask_bottom &= mask;
if (fillopt && (mask_bottom == 0xFFu))
memset(dst, bits, width); memset(dst, bits, width);
else else
fillrow(bfunc, dst, width, mask_bottom, bits); {
for (i = width; i > 0; i--)
bfunc(dst++, mask_bottom, 0xFFu);
}
} }
/* About Rockbox' internal bitmap format: /* About Rockbox' internal bitmap format:
@ -632,93 +641,118 @@ void lcd_fillrect(int x, int y, int width, int height)
* *
* This is the same as the internal lcd hw format. */ * This is the same as the internal lcd hw format. */
/* Draw a bitmap at (x, y), size (nx, ny) /* Draw a partial bitmap */
if 'clear' is true, clear destination area first */ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny, int stride, int x, int y, int width, int height)
bool clear) __attribute__ ((section (".icode"))); __attribute__ ((section(".icode")));
void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny, void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
bool clear) int stride, int x, int y, int width, int height)
{ {
const unsigned char *src_col; int shift, ny, i;
unsigned char *dst, *dst_col; unsigned char *dst;
unsigned int data, mask1, mask2, mask3, mask4; unsigned mask, mask_bottom;
int stride, shift; lcd_blockfunc_type *bfunc;
if (((unsigned) x >= LCD_WIDTH) || ((unsigned) y >= LCD_HEIGHT)) /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width <= 0) || (y + height <= 0))
return; return;
stride = nx; /* otherwise right-clipping will destroy the image */ /* clipping */
if (x < 0)
if (((unsigned) (x + nx)) >= LCD_WIDTH) {
nx = LCD_WIDTH - x; width += x;
if (((unsigned) (y + ny)) >= LCD_HEIGHT) src_x -= x;
ny = LCD_HEIGHT - y; x = 0;
}
if (y < 0)
{
height += y;
src_y -= y;
y = 0;
}
if (x + width > LCD_WIDTH)
width = LCD_WIDTH - x;
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
src += stride * (src_y >> 3) + src_x; /* move starting point */
src_y &= 7;
y -= src_y;
dst = &lcd_framebuffer[y>>3][x]; dst = &lcd_framebuffer[y>>3][x];
shift = y & 7; shift = y & 7;
ny = height - 1 + shift + src_y;
if (!shift && clear) /* shortcut for byte aligned match with clear */ bfunc = blockfunc[drawmode];
mask = 0xFFu << (shift + src_y);
mask_bottom = 0xFFu >> (7 - (ny & 7));
if (shift == 0)
{ {
while (ny >= 8) /* all full rows */ bool copyopt = (drawmode == DRMODE_SOLID);
for (; ny >= 8; ny -= 8)
{ {
memcpy(dst, src, nx); if (copyopt && (mask == 0xFFu))
memcpy(dst, src, width);
else
{
const unsigned char *src_row = src;
unsigned char *dst_row = dst;
for (i = width; i > 0; i--)
bfunc(dst_row++, mask, *src_row++);
}
src += stride; src += stride;
dst += LCD_WIDTH; dst += LCD_WIDTH;
ny -= 8; mask = 0xFFu;
}
if (ny == 0) /* nothing left to do? */
return;
/* last partial row to do by default routine */
} }
mask_bottom &= mask;
ny += shift; if (copyopt && (mask_bottom == 0xFFu))
memcpy(dst, src, width);
/* Calculate bit masks */ else
mask4 = ~(0xfe << ((ny-1) & 7)); /* data mask for last partial row */
if (clear)
{ {
mask1 = ~(0xff << shift); /* clearing of first partial row */ for (i = width; i > 0; i--)
mask2 = 0; /* clearing of intermediate (full) rows */ bfunc(dst++, mask_bottom, *src++);
mask3 = ~mask4; /* clearing of last partial row */ }
if (ny <= 8)
mask3 |= mask1;
} }
else else
mask1 = mask2 = mask3 = 0xff;
/* Loop for each column */
for (x = 0; x < nx; x++)
{ {
src_col = src++; for (x = 0; x < width; x++)
dst_col = dst++;
data = 0;
y = 0;
if (ny > 8)
{ {
/* First partial row */ const unsigned char *src_col = src++;
data = *src_col << shift; unsigned char *dst_col = dst++;
*dst_col = (*dst_col & mask1) | data; unsigned mask_col = mask;
src_col += stride; unsigned data = 0;
dst_col += LCD_WIDTH;
data >>= 8;
/* Intermediate rows */ for (y = ny; y >= 8; y -= 8)
for (y = 8; y < ny-8; y += 8)
{ {
data |= *src_col << shift; data |= *src_col << shift;
*dst_col = (*dst_col & mask2) | data;
if (mask_col & 0xFFu)
{
bfunc(dst_col, mask_col, data);
mask_col = 0xFFu;
}
else
mask_col >>= 8;
src_col += stride; src_col += stride;
dst_col += LCD_WIDTH; dst_col += LCD_WIDTH;
data >>= 8; data >>= 8;
} }
data |= *src_col << shift;
bfunc(dst_col, mask_col & mask_bottom, data);
}
}
} }
/* Last partial row */ /* Draw a full bitmap */
if (y + shift < ny) void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height)
data |= *src_col << shift; {
*dst_col = (*dst_col & mask3) | (data & mask4); lcd_bitmap_part(src, 0, 0, width, x, y, width, height);
}
} }
/* put a string at a given pixel position, skipping first ofs pixel columns */ /* put a string at a given pixel position, skipping first ofs pixel columns */
@ -729,7 +763,8 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
while ((ch = *str++) != '\0' && x < LCD_WIDTH) while ((ch = *str++) != '\0' && x < LCD_WIDTH)
{ {
int gwidth, width; int width;
const unsigned char *bits;
/* check input range */ /* check input range */
if (ch < pf->firstchar || ch >= pf->firstchar+pf->size) if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
@ -737,40 +772,20 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
ch -= pf->firstchar; ch -= pf->firstchar;
/* get proportional width and glyph bits */ /* get proportional width and glyph bits */
gwidth = pf->width ? pf->width[ch] : pf->maxwidth; width = pf->width ? pf->width[ch] : pf->maxwidth;
width = MIN (gwidth, LCD_WIDTH - x);
if (ofs != 0)
{
if (ofs > width) if (ofs > width)
{ {
ofs -= width; ofs -= width;
continue; continue;
} }
width -= ofs;
}
if (width > 0) bits = pf->bits + (pf->offset ?
{ pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch));
unsigned int i;
const unsigned char* bits = pf->bits +
(pf->offset ? pf->offset[ch]
: ((pf->height + 7) / 8 * pf->maxwidth * ch));
if (ofs != 0) lcd_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
{
for (i = 0; i < pf->height; i += 8) x += width - ofs;
{
lcd_bitmap (bits + ofs, x, y + i, width,
MIN(8, pf->height - i), true);
bits += gwidth;
}
}
else
lcd_bitmap ((unsigned char*) bits, x, y, gwidth,
pf->height, true);
x += width;
}
ofs = 0; ofs = 0;
} }
} }

View file

@ -265,19 +265,19 @@ void lcd_init(void)
/*** Update functions ***/ /*** Update functions ***/
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that y and height are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit(const unsigned char* p_data, int x, int y, int width, void lcd_blit(const unsigned char* data, int x, int by, int width,
int height, int stride) int bheight, int stride)
{ {
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
while (height--) while (bheight--)
{ {
lcd_write_command (LCD_CNTL_PAGE | (y++ & 0xf)); lcd_write_command (LCD_CNTL_PAGE | (by++ & 0xf));
lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset)>>4) & 0xf)); lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset)>>4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
lcd_write_data(p_data, width); lcd_write_data(data, width);
p_data += stride; data += stride;
} }
} }
@ -302,29 +302,31 @@ void lcd_update(void)
/* Update a fraction of the display. */ /* Update a fraction of the display. */
void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode"))); void lcd_update_rect(int, int, int, int) __attribute__ ((section (".icode")));
void lcd_update_rect(int x_start, int y, int width, int height) void lcd_update_rect(int x, int y, int width, int height)
{ {
int ymax; int ymax;
/* The Y coordinates have to work on even 8 pixel rows */ /* The Y coordinates have to work on even 8 pixel rows */
ymax = (y + height-1)/8; ymax = (y + height-1) >> 3;
y /= 8; y >>= 3;
if(x_start + width > LCD_WIDTH) if(x + width > LCD_WIDTH)
width = LCD_WIDTH - x_start; width = LCD_WIDTH - x;
if (width <= 0) if (width <= 0)
return; /* nothing left to do, 0 is harmful to lcd_write_data() */ return; /* nothing left to do, 0 is harmful to lcd_write_data() */
if(ymax >= LCD_HEIGHT/8) if(ymax >= LCD_HEIGHT/8)
ymax = LCD_HEIGHT/8-1; ymax = LCD_HEIGHT/8-1;
x += xoffset;
/* Copy specified rectange bitmap to hardware */ /* Copy specified rectange bitmap to hardware */
for (; y <= ymax; y++) for (; y <= ymax; y++)
{ {
lcd_write_command (LCD_CNTL_PAGE | (y & 0xf)); lcd_write_command (LCD_CNTL_PAGE | (y & 0xf));
lcd_write_command (LCD_CNTL_HIGHCOL | (((x_start+xoffset)>>4) & 0xf)); lcd_write_command (LCD_CNTL_HIGHCOL | ((x >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x_start+xoffset) & 0xf)); lcd_write_command (LCD_CNTL_LOWCOL | (x & 0xf));
lcd_write_data (&lcd_framebuffer[y][x_start], width); lcd_write_data (&lcd_framebuffer[y][x], width);
} }
} }
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
@ -390,8 +392,10 @@ static void nopixel(int x, int y)
(void)y; (void)y;
} }
lcd_pixelfunc_type* pixelfunc[8] = {flippixel, nopixel, setpixel, setpixel, lcd_pixelfunc_type* pixelfunc[8] = {
nopixel, clearpixel, nopixel, clearpixel}; flippixel, nopixel, setpixel, setpixel,
nopixel, clearpixel, nopixel, clearpixel
};
static void flipblock(unsigned char *address, unsigned mask, unsigned bits) static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
@ -413,7 +417,30 @@ static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
*address = (*address & ~mask) | (bits & mask); *address = (*address & ~mask) | (bits & mask);
} }
lcd_blockfunc_type* blockfunc[4] = {flipblock, bgblock, fgblock, solidblock}; static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address ^= (~bits & mask);
}
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address &= ~(bits & mask);
}
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address |= (~bits & mask);
}
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{
*address = (*address & ~mask) | (~bits & mask);
}
lcd_blockfunc_type* blockfunc[8] = {
flipblock, bgblock, fgblock, solidblock,
flipinvblock, bginvblock, fginvblock, solidinvblock
};
/*** drawing functions ***/ /*** drawing functions ***/
@ -509,7 +536,7 @@ void lcd_hline(int x1, int x2, int y)
{ {
int x; int x;
unsigned char *dst; unsigned char *dst;
unsigned char mask, bits; unsigned mask;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
/* direction flip */ /* direction flip */
@ -530,13 +557,12 @@ void lcd_hline(int x1, int x2, int y)
if (x2 >= LCD_WIDTH) if (x2 >= LCD_WIDTH)
x2 = LCD_WIDTH-1; x2 = LCD_WIDTH-1;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; bfunc = blockfunc[drawmode];
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; dst = &lcd_framebuffer[y>>3][x1];
dst = &lcd_framebuffer[y/8][x1];
mask = 1 << (y & 7); mask = 1 << (y & 7);
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
bfunc(dst++, mask, bits); bfunc(dst++, mask, 0xFFu);
} }
/* Draw a vertical line (optimised) */ /* Draw a vertical line (optimised) */
@ -544,7 +570,7 @@ void lcd_vline(int x, int y1, int y2)
{ {
int ny; int ny;
unsigned char *dst; unsigned char *dst;
unsigned char mask_top, mask_bottom, bits; unsigned mask, mask_bottom;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
/* direction flip */ /* direction flip */
@ -565,28 +591,20 @@ void lcd_vline(int x, int y1, int y2)
if (y2 >= LCD_HEIGHT) if (y2 >= LCD_HEIGHT)
y2 = LCD_HEIGHT-1; y2 = LCD_HEIGHT-1;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; bfunc = blockfunc[drawmode];
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; dst = &lcd_framebuffer[y1>>3][x];
dst = &lcd_framebuffer[y1/8][x];
ny = y2 - (y1 & ~7); ny = y2 - (y1 & ~7);
mask_top = 0xFFu << (y1 & 7); mask = 0xFFu << (y1 & 7);
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (7 - (ny & 7));
if (ny >= 8) for (; ny >= 8; ny -= 8)
{ {
bfunc(dst, mask_top, bits); bfunc(dst, mask, 0xFFu);
dst += LCD_WIDTH;
for (; ny > 15; ny -= 8)
{
bfunc(dst, 0xFFu, bits);
dst += LCD_WIDTH; dst += LCD_WIDTH;
mask = 0xFFu;
} }
} mask_bottom &= mask;
else bfunc(dst, mask_bottom, 0xFFu);
mask_bottom &= mask_top;
bfunc(dst, mask_bottom, bits);
} }
/* Draw a rectangular box */ /* Draw a rectangular box */
@ -604,29 +622,19 @@ void lcd_drawrect(int x, int y, int width, int height)
lcd_hline(x, x2, y2); lcd_hline(x, x2, y2);
} }
/* helper function for lcd_fillrect() */
static void fillrow(lcd_blockfunc_type *bfunc, unsigned char *address,
int width, unsigned mask, unsigned bits)
{
int i;
for (i = 0; i < width; i++)
bfunc(address++, mask, bits);
}
/* Fill a rectangular area */ /* Fill a rectangular area */
void lcd_fillrect(int x, int y, int width, int height) void lcd_fillrect(int x, int y, int width, int height)
{ {
int ny; int ny, i;
unsigned char *dst; unsigned char *dst;
unsigned char mask_top, mask_bottom, bits; unsigned mask, mask_bottom;
unsigned bits = 0xFFu;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt = (drawmode & DRMODE_INVERSEVID) ? bool fillopt;
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
/* nothing to draw? */ /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT) if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width < 0) || (y + height < 0)) || (x + width <= 0) || (y + height <= 0))
return; return;
/* clipping */ /* clipping */
@ -645,37 +653,40 @@ void lcd_fillrect(int x, int y, int width, int height)
if (y + height > LCD_HEIGHT) if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y; height = LCD_HEIGHT - y;
bfunc = blockfunc[drawmode & ~DRMODE_INVERSEVID]; fillopt = (drawmode & DRMODE_INVERSEVID) ?
bits = (drawmode & DRMODE_INVERSEVID) ? 0x00 : 0xFFu; (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
dst = &lcd_framebuffer[y/8][x]; if (fillopt &&(drawmode & DRMODE_INVERSEVID))
bits = 0;
bfunc = blockfunc[drawmode];
dst = &lcd_framebuffer[y>>3][x];
ny = height - 1 + (y & 7); ny = height - 1 + (y & 7);
mask_top = 0xFFu << (y & 7); mask = 0xFFu << (y & 7);
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (7 - (ny & 7));
if (ny >= 8) for (; ny >= 8; ny -= 8)
{ {
if (fillopt && mask_top == 0xFF) if (fillopt && (mask == 0xFFu))
memset(dst, bits, width); memset(dst, bits, width);
else else
fillrow(bfunc, dst, width, mask_top, bits);
dst += LCD_WIDTH;
for (; ny > 15; ny -= 8)
{ {
if (fillopt) unsigned char *dst_row = dst;
memset(dst, bits, width);
else
fillrow(bfunc, dst, width, 0xFFu, bits);
dst += LCD_WIDTH;
}
}
else
mask_bottom &= mask_top;
if (fillopt && mask_bottom == 0xFF) for (i = width; i > 0; i--)
bfunc(dst_row++, mask, 0xFFu);
}
dst += LCD_WIDTH;
mask = 0xFFu;
}
mask_bottom &= mask;
if (fillopt && (mask_bottom == 0xFFu))
memset(dst, bits, width); memset(dst, bits, width);
else else
fillrow(bfunc, dst, width, mask_bottom, bits); {
for (i = width; i > 0; i--)
bfunc(dst++, mask_bottom, 0xFFu);
}
} }
/* About Rockbox' internal bitmap format: /* About Rockbox' internal bitmap format:
@ -689,93 +700,118 @@ void lcd_fillrect(int x, int y, int width, int height)
* *
* This is the same as the internal lcd hw format. */ * This is the same as the internal lcd hw format. */
/* Draw a bitmap at (x, y), size (nx, ny) /* Draw a partial bitmap */
if 'clear' is true, clear destination area first */ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny, int stride, int x, int y, int width, int height)
bool clear) __attribute__ ((section (".icode"))); __attribute__ ((section(".icode")));
void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny, void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
bool clear) int stride, int x, int y, int width, int height)
{ {
const unsigned char *src_col; int shift, ny, i;
unsigned char *dst, *dst_col; unsigned char *dst;
unsigned int data, mask1, mask2, mask3, mask4; unsigned mask, mask_bottom;
int stride, shift; lcd_blockfunc_type *bfunc;
if (((unsigned) x >= LCD_WIDTH) || ((unsigned) y >= LCD_HEIGHT)) /* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width <= 0) || (y + height <= 0))
return; return;
stride = nx; /* otherwise right-clipping will destroy the image */ /* clipping */
if (x < 0)
if (((unsigned) (x + nx)) >= LCD_WIDTH) {
nx = LCD_WIDTH - x; width += x;
if (((unsigned) (y + ny)) >= LCD_HEIGHT) src_x -= x;
ny = LCD_HEIGHT - y; x = 0;
}
if (y < 0)
{
height += y;
src_y -= y;
y = 0;
}
if (x + width > LCD_WIDTH)
width = LCD_WIDTH - x;
if (y + height > LCD_HEIGHT)
height = LCD_HEIGHT - y;
src += stride * (src_y >> 3) + src_x; /* move starting point */
src_y &= 7;
y -= src_y;
dst = &lcd_framebuffer[y>>3][x]; dst = &lcd_framebuffer[y>>3][x];
shift = y & 7; shift = y & 7;
ny = height - 1 + shift + src_y;
if (!shift && clear) /* shortcut for byte aligned match with clear */ bfunc = blockfunc[drawmode];
mask = 0xFFu << (shift + src_y);
mask_bottom = 0xFFu >> (7 - (ny & 7));
if (shift == 0)
{ {
while (ny >= 8) /* all full rows */ bool copyopt = (drawmode == DRMODE_SOLID);
for (; ny >= 8; ny -= 8)
{ {
memcpy(dst, src, nx); if (copyopt && (mask == 0xFFu))
memcpy(dst, src, width);
else
{
const unsigned char *src_row = src;
unsigned char *dst_row = dst;
for (i = width; i > 0; i--)
bfunc(dst_row++, mask, *src_row++);
}
src += stride; src += stride;
dst += LCD_WIDTH; dst += LCD_WIDTH;
ny -= 8; mask = 0xFFu;
}
if (ny == 0) /* nothing left to do? */
return;
/* last partial row to do by default routine */
} }
mask_bottom &= mask;
ny += shift; if (copyopt && (mask_bottom == 0xFFu))
memcpy(dst, src, width);
/* Calculate bit masks */ else
mask4 = ~(0xfe << ((ny-1) & 7)); /* data mask for last partial row */
if (clear)
{ {
mask1 = ~(0xff << shift); /* clearing of first partial row */ for (i = width; i > 0; i--)
mask2 = 0; /* clearing of intermediate (full) rows */ bfunc(dst++, mask_bottom, *src++);
mask3 = ~mask4; /* clearing of last partial row */ }
if (ny <= 8)
mask3 |= mask1;
} }
else else
mask1 = mask2 = mask3 = 0xff;
/* Loop for each column */
for (x = 0; x < nx; x++)
{ {
src_col = src++; for (x = 0; x < width; x++)
dst_col = dst++;
data = 0;
y = 0;
if (ny > 8)
{ {
/* First partial row */ const unsigned char *src_col = src++;
data = *src_col << shift; unsigned char *dst_col = dst++;
*dst_col = (*dst_col & mask1) | data; unsigned mask_col = mask;
src_col += stride; unsigned data = 0;
dst_col += LCD_WIDTH;
data >>= 8;
/* Intermediate rows */ for (y = ny; y >= 8; y -= 8)
for (y = 8; y < ny-8; y += 8)
{ {
data |= *src_col << shift; data |= *src_col << shift;
*dst_col = (*dst_col & mask2) | data;
if (mask_col & 0xFFu)
{
bfunc(dst_col, mask_col, data);
mask_col = 0xFFu;
}
else
mask_col >>= 8;
src_col += stride; src_col += stride;
dst_col += LCD_WIDTH; dst_col += LCD_WIDTH;
data >>= 8; data >>= 8;
} }
data |= *src_col << shift;
bfunc(dst_col, mask_col & mask_bottom, data);
}
}
} }
/* Last partial row */ /* Draw a full bitmap */
if (y + shift < ny) void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height)
data |= *src_col << shift; {
*dst_col = (*dst_col & mask3) | (data & mask4); lcd_bitmap_part(src, 0, 0, width, x, y, width, height);
}
} }
/* put a string at a given pixel position, skipping first ofs pixel columns */ /* put a string at a given pixel position, skipping first ofs pixel columns */
@ -786,7 +822,8 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
while ((ch = *str++) != '\0' && x < LCD_WIDTH) while ((ch = *str++) != '\0' && x < LCD_WIDTH)
{ {
int gwidth, width; int width;
const unsigned char *bits;
/* check input range */ /* check input range */
if (ch < pf->firstchar || ch >= pf->firstchar+pf->size) if (ch < pf->firstchar || ch >= pf->firstchar+pf->size)
@ -794,44 +831,23 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
ch -= pf->firstchar; ch -= pf->firstchar;
/* get proportional width and glyph bits */ /* get proportional width and glyph bits */
gwidth = pf->width ? pf->width[ch] : pf->maxwidth; width = pf->width ? pf->width[ch] : pf->maxwidth;
width = MIN (gwidth, LCD_WIDTH - x);
if (ofs != 0)
{
if (ofs > width) if (ofs > width)
{ {
ofs -= width; ofs -= width;
continue; continue;
} }
width -= ofs;
}
if (width > 0) bits = pf->bits + (pf->offset ?
{ pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch));
unsigned int i;
const unsigned char* bits = pf->bits +
(pf->offset ? pf->offset[ch]
: ((pf->height + 7) / 8 * pf->maxwidth * ch));
if (ofs != 0) lcd_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
{
for (i = 0; i < pf->height; i += 8) x += width - ofs;
{
lcd_bitmap (bits + ofs, x, y + i, width,
MIN(8, pf->height - i), true);
bits += gwidth;
}
}
else
lcd_bitmap ((unsigned char*) bits, x, y, gwidth,
pf->height, true);
x += width;
}
ofs = 0; ofs = 0;
} }
} }
/* put a string at a given pixel position */ /* put a string at a given pixel position */
void lcd_putsxy(int x, int y, const unsigned char *str) void lcd_putsxy(int x, int y, const unsigned char *str)
{ {

View file

@ -57,8 +57,8 @@ extern void lcd_icon(int icon, bool enable);
#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) #if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
/* performance function */ /* performance function */
extern void lcd_blit(const unsigned char* p_data, int x, int y, int width, extern void lcd_blit(const unsigned char* data, int x, int by, int width,
int height, int stride); int bheight, int stride);
extern void lcd_update(void); extern void lcd_update(void);
/* update a fraction of the screen */ /* update a fraction of the screen */
@ -150,8 +150,9 @@ extern void lcd_hline(int x1, int x2, int y);
extern void lcd_vline(int x, int y1, int y2); extern void lcd_vline(int x, int y1, int y2);
extern void lcd_drawrect(int x, int y, int width, int height); extern void lcd_drawrect(int x, int y, int width, int height);
extern void lcd_fillrect(int x, int y, int width, int height); extern void lcd_fillrect(int x, int y, int width, int height);
extern void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny, extern void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
bool clear); int stride, int x, int y, int width, int height);
extern void lcd_bitmap(const unsigned char *src, int x, int y, int nx, int ny);
extern void lcd_putsxy(int x, int y, const unsigned char *string); extern void lcd_putsxy(int x, int y, const unsigned char *string);
extern void lcd_invertscroll(int x, int y); extern void lcd_invertscroll(int x, int y);