1
0
Fork 0
forked from len0rd/rockbox

4-shades greyscale graphics core for iriver H1x0. 4-grey rockbox logo and light grey background in splash() boxes. Simplified the splash() box creation as the new graphics core does clipping. Adapted screendump feature and added flexible preprocessing to construct the bmp header. Rockboy now uses 4-grey mode as well. 4-grey support for win32 simulator. Fixed win32 player sim to not use double bitmap conversion via a recorder-like framebuffer, and correctly display double-height text. X11 simulator temporarily adapted. The display won't be distorted, but it still shows b&w only.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7046 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-07-06 22:58:02 +00:00
parent 1076eb1d27
commit f894a4c269
39 changed files with 998 additions and 571 deletions

View file

@ -75,7 +75,7 @@ int show_logo( void )
lcd_bitmap(rockbox112x37, 0, 10, 112, 37); lcd_bitmap(rockbox112x37, 0, 10, 112, 37);
#endif #endif
#if LCD_WIDTH >= 160 #if LCD_WIDTH >= 160
lcd_bitmap(rockbox160x53, 0, 10, 160, 53); lcd_bitmap(rockbox160x53x2, 0, 10, 160, 53);
#endif #endif
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD

View file

@ -116,7 +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], xpos, ypos, 4, 8); lcd_mono_bitmap(bitmap_icons_6x8[Cursor], xpos, ypos, 4, 8);
#else #else
lcd_putc(x, y, CURSOR_CHAR); lcd_putc(x, y, CURSOR_CHAR);
#endif #endif

View file

@ -136,35 +136,81 @@ int read_line(int fd, char* buffer, int buffer_size)
} }
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
#if LCD_DEPTH <= 8
#define BMP_NUMCOLORS (1 << LCD_DEPTH)
#else
#define BMP_NUMCOLORS 0
#endif
#if LCD_DEPTH == 1
#define BMP_BPP 1
#define BMP_LINESIZE ((LCD_WIDTH/8 + 3) & ~3)
#elif LCD_DEPTH <= 4
#define BMP_BPP 4
#define BMP_LINESIZE ((LCD_WIDTH/2 + 3) & ~3)
#elif LCD_DEPTH <= 8
#define BMP_BPP 8
#define BMP_LINESIZE ((LCD_WIDTH + 3) & ~3)
#elif LCD_DEPTH <= 16
#define BMP_BPP 16
#define BMP_LINESIZE ((LCD_WIDTH*2 + 3) & ~3)
#else
#define BMP_BPP 24
#define BMP_LINESIZE ((LCD_WIDTH*3 + 3) & ~3)
#endif
#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS)
#define BMP_DATASIZE (BMP_LINESIZE * LCD_HEIGHT)
#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE)
#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff
#define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff
static const unsigned char bmpheader[] = static const unsigned char bmpheader[] =
{ {
0x42, 0x4d, 0x3e, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x42, 0x4d, /* 'BM' */
0x00, 0x00, 0x28, 0x00, 0x00, 0x00, LCD_WIDTH, 0x00, 0x00, 0x00, LCD_HEIGHT, 0x00, LE32_CONST(BMP_TOTALSIZE), /* Total file size */
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Reserved */
#if LCD_WIDTH == 160 LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
0x00, 0x00, 0x00, 0x0a,
#else 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */
0x00, 0x00, 0x00, 0x04, LE32_CONST(LCD_WIDTH), /* Width in pixels */
LE32_CONST(LCD_HEIGHT), /* 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 */
LE32_CONST(BMP_DATASIZE), /* Size of bitmap data */
0xc4, 0x0e, 0x00, 0x00, /* Horizontal resolution (pixels/meter) */
0xc4, 0x0e, 0x00, 0x00, /* Vertical resolution (pixels/meter) */
LE32_CONST(BMP_NUMCOLORS), /* Number of used colours */
LE32_CONST(BMP_NUMCOLORS), /* Number of important 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 #endif
0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0xc4, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
#ifdef IRIVER_H100
0xe6, 0xd8, 0xad,
#else
0x90, 0xee, 0x90,
#endif
0x00, 0x00, 0x00,
0x00, 0x00
}; };
void screen_dump(void) void screen_dump(void)
{ {
int fh; int fh;
int bx, by, ix, iy; int bx, by, iy;
int src_byte, src_mask, dst_mask; int src_byte;
char filename[MAX_PATH]; char filename[MAX_PATH];
static unsigned char line_block[8][(LCD_WIDTH/8+3) & ~3]; #if LCD_DEPTH == 1
int ix, src_mask, dst_mask;
static unsigned char line_block[8][BMP_LINESIZE];
#elif LCD_DEPTH == 2
int src_byte2;
static unsigned char line_block[4][BMP_LINESIZE];
#endif
#ifdef HAVE_RTC #ifdef HAVE_RTC
struct tm *tm = get_time(); struct tm *tm = get_time();
@ -213,6 +259,7 @@ void screen_dump(void)
write(fh, bmpheader, sizeof(bmpheader)); write(fh, bmpheader, sizeof(bmpheader));
/* BMP image goes bottom up */ /* BMP image goes bottom up */
#if LCD_DEPTH == 1
for (by = LCD_HEIGHT/8 - 1; by >= 0; by--) for (by = LCD_HEIGHT/8 - 1; by >= 0; by--)
{ {
memset(&line_block[0][0], 0, sizeof(line_block)); memset(&line_block[0][0], 0, sizeof(line_block));
@ -236,6 +283,26 @@ void screen_dump(void)
write(fh, &line_block[0][0], sizeof(line_block)); write(fh, &line_block[0][0], sizeof(line_block));
} }
#elif LCD_DEPTH == 2
for (by = LCD_HEIGHT/4 - 1; by >= 0; by--)
{
memset(&line_block[0][0], 0, sizeof(line_block));
for (bx = 0; bx < LCD_WIDTH/2; bx++)
{
src_byte = lcd_framebuffer[by][2*bx];
src_byte2 = lcd_framebuffer[by][2*bx+1];
for (iy = 3; iy >= 0; iy--)
{
line_block[iy][bx] = ((src_byte & 3) << 4) | (src_byte2 & 3);
src_byte >>= 2;
src_byte2 >>= 2;
}
}
write(fh, &line_block[0][0], sizeof(line_block));
}
#endif
close(fh); close(fh);
} }
#endif #endif

View file

@ -461,8 +461,8 @@ static void display_playlist(void)
int offset=0; int offset=0;
if ( viewer.line_height > 8 ) if ( viewer.line_height > 8 )
offset = (viewer.line_height - 8) / 2; offset = (viewer.line_height - 8) / 2;
lcd_bitmap(bitmap_icons_6x8[File], lcd_mono_bitmap(bitmap_icons_6x8[File],
CURSOR_X * 6 + CURSOR_WIDTH, CURSOR_X * 6 + CURSOR_WIDTH,
MARGIN_Y+(i*viewer.line_height) + offset, 6, 8); MARGIN_Y+(i*viewer.line_height) + offset, 6, 8);
#else #else
lcd_putc(LINE_X-1, i, File); lcd_putc(LINE_X-1, i, File);

View file

@ -114,8 +114,8 @@ static const struct plugin_api rockbox_api = {
lcd_vline, lcd_vline,
lcd_drawrect, lcd_drawrect,
lcd_fillrect, lcd_fillrect,
lcd_bitmap_part, lcd_mono_bitmap_part,
lcd_bitmap, lcd_mono_bitmap,
lcd_putsxy, lcd_putsxy,
lcd_puts_style, lcd_puts_style,
lcd_puts_scroll_style, lcd_puts_scroll_style,

View file

@ -164,10 +164,10 @@ struct plugin_api {
void (*lcd_vline)(int x, int y1, int y2); void (*lcd_vline)(int x, int y1, int y2);
void (*lcd_drawrect)(int x, int y, int width, int height); void (*lcd_drawrect)(int x, int y, int width, int height);
void (*lcd_fillrect)(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, void (*lcd_mono_bitmap_part)(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height); int stride, int x, int y, int width, int height);
void (*lcd_bitmap)(const unsigned char *src, int x, int y, void (*lcd_mono_bitmap)(const unsigned char *src, int x, int y,
int width, int height); 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,

View file

@ -309,8 +309,8 @@ static int scrollit(void)
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_mono_bitmap((char *)char_gen_12x16[letter-0x20],
xx, table[yy&(TABLE_SIZE-1)], 11, 16); xx, table[yy&(TABLE_SIZE-1)], 11, 16);
yy += YADD; yy += YADD;
xx+= LCD_WIDTH/LETTERS_ON_SCREEN; xx+= LCD_WIDTH/LETTERS_ON_SCREEN;
} }
@ -399,9 +399,9 @@ static int loopit(void)
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_mono_bitmap((char *)char_gen_12x16[rock[i]-0x20],
xtable[xx&(TABLE_SIZE-1)], table[yy&(TABLE_SIZE-1)], xtable[xx&(TABLE_SIZE-1)],
11, 16); table[yy&(TABLE_SIZE-1)], 11, 16);
rb->lcd_update(); rb->lcd_update();
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);

View file

@ -215,7 +215,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); rb->lcd_mono_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

@ -1062,7 +1062,7 @@ static void chip8_update_display(void)
} }
#ifdef SIMULATOR #ifdef SIMULATOR
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, CHIP8_HEIGHT); rb->lcd_mono_bitmap(lcd_framebuf[0], CHIP8_X, CHIP8_Y, CHIP8_LCDWIDTH, CHIP8_HEIGHT);
rb->lcd_update(); rb->lcd_update();
#else #else
rb->lcd_blit(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH, CHIP8_HEIGHT>>3 rb->lcd_blit(lcd_framebuf[0], CHIP8_X, CHIP8_Y>>3, CHIP8_LCDWIDTH, CHIP8_HEIGHT>>3

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); rb->lcd_mono_bitmap(pm, 97, 55, 15, 8);
else else
rb->lcd_bitmap(am, 1, 55, 15, 8); rb->lcd_mono_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); rb->lcd_mono_bitmap(pm, 97, 55, 15, 8);
else else
rb->lcd_bitmap(am, 1, 55, 15, 8); rb->lcd_mono_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); rb->lcd_mono_bitmap(bitmap_1, 0, 1, 15, 20);
temphour -= 32; temphour -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 0, 1, 15, 20);
if(temphour >= 16) if(temphour >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 19, 1, 15, 20);
temphour -= 16; temphour -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 19, 1, 15, 20);
if(temphour >= 8) if(temphour >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 38, 1, 15, 20);
temphour -= 8; temphour -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 38, 1, 15, 20);
if(temphour >= 4) if(temphour >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 57, 1, 15, 20);
temphour -= 4; temphour -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 57, 1, 15, 20);
if(temphour >= 2) if(temphour >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 76, 1, 15, 20);
temphour -= 2; temphour -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 76, 1, 15, 20);
if(temphour >= 1) if(temphour >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 95, 1, 15, 20);
temphour -= 1; temphour -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 1, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 95, 1, 15, 20);
/********* /*********
* MINUTES * MINUTES
********/ ********/
if(tempmin >= 32) if(tempmin >= 32)
{ {
rb->lcd_bitmap(bitmap_1, 0, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 0, 21, 15, 20);
tempmin -= 32; tempmin -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 0, 21, 15, 20);
if(tempmin >= 16) if(tempmin >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 19, 21, 15, 20);
tempmin -= 16; tempmin -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 19, 21, 15, 20);
if(tempmin >= 8) if(tempmin >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 38, 21, 15, 20);
tempmin -= 8; tempmin -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 38, 21, 15, 20);
if(tempmin >= 4) if(tempmin >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 57, 21, 15, 20);
tempmin -= 4; tempmin -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 57, 21, 15, 20);
if(tempmin >= 2) if(tempmin >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 76, 21, 15, 20);
tempmin -= 2; tempmin -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 76, 21, 15, 20);
if(tempmin >= 1) if(tempmin >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 95, 21, 15, 20);
tempmin -= 1; tempmin -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 21, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 95, 21, 15, 20);
/********* /*********
* SECONDS * SECONDS
********/ ********/
if(tempsec >= 32) if(tempsec >= 32)
{ {
rb->lcd_bitmap(bitmap_1, 0, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 0, 42, 15, 20);
tempsec -= 32; tempsec -= 32;
} }
else else
rb->lcd_bitmap(bitmap_0, 0, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 0, 42, 15, 20);
if(tempsec >= 16) if(tempsec >= 16)
{ {
rb->lcd_bitmap(bitmap_1, 19, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 19, 42, 15, 20);
tempsec -= 16; tempsec -= 16;
} }
else else
rb->lcd_bitmap(bitmap_0, 19, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 19, 42, 15, 20);
if(tempsec >= 8) if(tempsec >= 8)
{ {
rb->lcd_bitmap(bitmap_1, 38, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 38, 42, 15, 20);
tempsec -= 8; tempsec -= 8;
} }
else else
rb->lcd_bitmap(bitmap_0, 38, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 38, 42, 15, 20);
if(tempsec >= 4) if(tempsec >= 4)
{ {
rb->lcd_bitmap(bitmap_1, 57, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 57, 42, 15, 20);
tempsec -= 4; tempsec -= 4;
} }
else else
rb->lcd_bitmap(bitmap_0, 57, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 57, 42, 15, 20);
if(tempsec >= 2) if(tempsec >= 2)
{ {
rb->lcd_bitmap(bitmap_1, 76, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 76, 42, 15, 20);
tempsec -= 2; tempsec -= 2;
} }
else else
rb->lcd_bitmap(bitmap_0, 76, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_0, 76, 42, 15, 20);
if(tempsec >= 1) if(tempsec >= 1)
{ {
rb->lcd_bitmap(bitmap_1, 95, 42, 15, 20); rb->lcd_mono_bitmap(bitmap_1, 95, 42, 15, 20);
tempsec -= 1; tempsec -= 1;
} }
else else
rb->lcd_bitmap(bitmap_0, 95, 42, 15, 20); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_full, x, y, 8, 6);
else /* checkbox is off */ else /* checkbox is off */
rb->lcd_bitmap(checkbox_empty, x, y, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_half, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_half, 1, 49, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 49, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_half, 1, 33, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_half, 1, 33, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 33, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(checkbox_twothird, 1, 41, 8, 6);
else else
rb->lcd_bitmap(checkbox_full, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(pm, 96, 1, 15, 8);
else /* AM */ else /* AM */
rb->lcd_bitmap(am, 96, 1, 15, 8); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_bitmap(arrow, 1, 9, 8, 6);
rb->lcd_bitmap(arrow, 1, 17, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 17, 8, 6);
rb->lcd_bitmap(arrow, 1, 25, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 25, 8, 6);
rb->lcd_bitmap(arrow, 1, 33, 8, 6); rb->lcd_mono_bitmap(arrow, 1, 33, 8, 6);
rb->lcd_bitmap(arrow, 1, 41, 8, 6); rb->lcd_mono_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); rb->lcd_mono_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

@ -72,9 +72,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); rb->lcd_mono_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); rb->lcd_mono_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 */
@ -84,9 +84,9 @@ static void draw_cursor(void) {
j = (cursor_pos/5)*16; j = (cursor_pos/5)*16;
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
ptr = cursor_pic; ptr = cursor_pic;
rb->lcd_bitmap (ptr, i, j, 16, 8); rb->lcd_mono_bitmap (ptr, i, j, 16, 8);
ptr += 16; ptr += 16;
rb->lcd_bitmap (ptr, i, j+8, 16, 8); rb->lcd_mono_bitmap (ptr, i, j+8, 16, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
} }

View file

@ -230,7 +230,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); rb->lcd_mono_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT);
#ifdef REMOTE_LOGO #ifdef REMOTE_LOGO
rb->lcd_remote_clear_display(); rb->lcd_remote_clear_display();
rb->lcd_remote_bitmap(REMOTE_LOGO, rb->lcd_remote_bitmap(REMOTE_LOGO,

View file

@ -381,7 +381,7 @@ int minesweeper(void)
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_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(num[minefield[i][j].neighbors],j*8,i*8,8,8); rb->lcd_mono_bitmap(num[minefield[i][j].neighbors],j*8,i*8,8,8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
} }
} else if(minefield[i][j].flag) { } else if(minefield[i][j].flag) {

View file

@ -16,7 +16,7 @@ struct scan
{ {
int bg[64]; int bg[64];
int wnd[64]; int wnd[64];
#ifdef GRAYSCALE #if LCD_DEPTH == 2
byte buf[4][256]; byte buf[4][256];
#else #else
byte buf[8][256]; byte buf[8][256];

View file

@ -786,7 +786,7 @@ void lcd_refreshline(void)
recolor(BUF+WX, 0x04, 160-WX); recolor(BUF+WX, 0x04, 160-WX);
} }
spr_scan(); spr_scan();
#ifdef GRAYSCALE #if LCD_DEPTH == 2
if (scanline_ind == 3) if (scanline_ind == 3)
#else #else
if (scanline_ind == 7) if (scanline_ind == 7)
@ -800,7 +800,7 @@ void lcd_refreshline(void)
#if LCD_HEIGHT == 64 #if LCD_HEIGHT == 64
scanline_ind = (scanline_ind+1) % 8; scanline_ind = (scanline_ind+1) % 8;
#else #else
#ifdef GRAYSCALE #if LCD_DEPTH == 2
scanline_ind = (scanline_ind+1) % 4; scanline_ind = (scanline_ind+1) % 4;
#else #else
scanline_ind = (scanline_ind+1) % 8; scanline_ind = (scanline_ind+1) % 8;

View file

@ -245,21 +245,21 @@ void vid_update(int scanline)
scanline-=16; scanline-=16;
else if (fb.mode==2) else if (fb.mode==2)
scanline-=8; scanline-=8;
#ifdef GRAYSCALE #if LCD_DEPTH == 2
scanline_remapped = scanline / 4; scanline_remapped = scanline / 4;
#else #else
scanline_remapped = scanline / 8; scanline_remapped = scanline / 8;
#endif #endif
frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH; frameb = rb->lcd_framebuffer + scanline_remapped * LCD_WIDTH;
while (cnt < 160) { while (cnt < 160) {
#ifdef GRAYSCALE #if LCD_DEPTH == 2
*(frameb++) = (scan.buf[0][cnt]&0x3) | *(frameb++) = (scan.buf[0][cnt]&0x3) |
((scan.buf[1][cnt]&0x3)<<2) | ((scan.buf[1][cnt]&0x3)<<2) |
((scan.buf[2][cnt]&0x3)<<4) | ((scan.buf[2][cnt]&0x3)<<4) |
((scan.buf[3][cnt]&0x3)<<6); ((scan.buf[3][cnt]&0x3)<<6);
cnt++; cnt++;
} }
rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4); //8); rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4);
#else #else
register unsigned scrbyte = 0; register unsigned scrbyte = 0;
if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01; if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01;
@ -274,7 +274,7 @@ void vid_update(int scanline)
cnt++; cnt++;
} }
rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8); rb->lcd_update_rect(0, scanline & ~7, LCD_WIDTH, 8);
#endif /* GRAYSCALE */ #endif /* LCD_DEPTH */
#endif /* LCD_HEIGHT */ #endif /* LCD_HEIGHT */
} }

View file

@ -149,7 +149,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); rb->lcd_mono_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

@ -625,11 +625,11 @@ void draw_apple( void )
char pscore[5], counter[4]; char pscore[5], counter[4];
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPHEIGHT_snakebmp); rb->lcd_mono_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_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp); rb->lcd_mono_bitmap(snakeupbmp,0,0,BMPWIDTH_snakeupbmp,BMPHEIGHT_snakeupbmp);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->snprintf(counter,sizeof(counter),"%d",applecount); rb->snprintf(counter,sizeof(counter),"%d",applecount);
@ -1303,7 +1303,7 @@ void game_init(void)
#if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128 #if LCD_WIDTH >= 160 && LCD_HEIGHT >= 128
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPWIDTH_snakebmp); rb->lcd_mono_bitmap(snakebmp,0,0,BMPWIDTH_snakebmp,BMPWIDTH_snakebmp);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->snprintf(plevel,sizeof(plevel),"%d",level); rb->snprintf(plevel,sizeof(plevel),"%d",level);

View file

@ -118,8 +118,8 @@ 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_mono_bitmap(flake,particles[i][0],particles[i][1],
FLAKE_WIDTH,FLAKE_WIDTH); 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

@ -902,8 +902,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); rb->lcd_mono_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); rb->lcd_mono_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);
@ -946,9 +946,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); rb->lcd_mono_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); rb->lcd_mono_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){
@ -978,8 +978,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); rb->lcd_mono_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); rb->lcd_mono_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

@ -260,18 +260,18 @@ static void update_icons(void)
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
/* The CUT icon */ /* The CUT icon */
rb->lcd_bitmap(CUT_BMP, rb->lcd_mono_bitmap(CUT_BMP,
LCD_WIDTH / 3 / 2 - BMPWIDTH / 2, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH / 3 / 2 - BMPWIDTH / 2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT); BMPWIDTH, BMPHEIGHT);
/* The loop mode icon */ /* The loop mode icon */
rb->lcd_bitmap(LOOP_BMP[splitedit_get_loop_mode()], rb->lcd_mono_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); 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_mono_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); BMPWIDTH, BMPHEIGHT);
#else #else
@ -279,7 +279,7 @@ static void update_icons(void)
static int idx; static int idx;
if (idx < 0 || idx > 1) idx = 0; if (idx < 0 || idx > 1) idx = 0;
idx = 1 - idx; idx = 1 - idx;
rb->lcd_bitmap(SCALE_BMP[idx], rb->lcd_mono_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); BMPWIDTH, BMPHEIGHT);
} }

View file

@ -485,11 +485,11 @@ static void star_display_board_info(void)
rb->lcd_putsxy(0, label_offset_y, str_info); rb->lcd_putsxy(0, label_offset_y, str_info);
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_mono_bitmap (ball_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE,
STAR_TILE_SIZE); STAR_TILE_SIZE);
else else
rb->lcd_bitmap (block_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE, rb->lcd_mono_bitmap (block_bmp, 103, label_offset_y + 1, STAR_TILE_SIZE,
STAR_TILE_SIZE); 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);
} }
@ -520,37 +520,37 @@ static int star_load_level(int current_level)
break; break;
case STAR_WALL: case STAR_WALL:
rb->lcd_bitmap (wall_bmp, rb->lcd_mono_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); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
case STAR_STAR: case STAR_STAR:
rb->lcd_bitmap (star_bmp, rb->lcd_mono_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); STAR_TILE_SIZE, STAR_TILE_SIZE);
star_count++; star_count++;
break; break;
case STAR_BALL: case STAR_BALL:
ball_x = x; ball_x = x;
ball_y = y; ball_y = y;
rb->lcd_bitmap (ball_bmp, rb->lcd_mono_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); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
case STAR_BLOCK: case STAR_BLOCK:
block_x = x; block_x = x;
block_y = y; block_y = y;
rb->lcd_bitmap (block_bmp, rb->lcd_mono_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); STAR_TILE_SIZE, STAR_TILE_SIZE);
break; break;
} }
ptr_tab++; ptr_tab++;
@ -665,7 +665,7 @@ static int star_run_game(void)
{ {
for (i = 0 ; i < 7 ; i++) for (i = 0 ; i < 7 ; i++)
{ {
rb->lcd_bitmap( rb->lcd_mono_bitmap(
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,
@ -697,7 +697,7 @@ static int star_run_game(void)
{ {
for (i = 0 ; i < 7 ; i++) for (i = 0 ; i < 7 ; i++)
{ {
rb->lcd_bitmap( rb->lcd_mono_bitmap(
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,
@ -766,8 +766,8 @@ static int star_menu(void)
} }
move_y = 0; move_y = 0;
rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]], rb->lcd_mono_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]],
2, menu_offset_y + menu_y * char_height, 7, 8); 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++;
@ -842,8 +842,8 @@ 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_FG); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(arrow_bmp[anim_arrow[(anim_state & 0x38) >> 3]], rb->lcd_mono_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);
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);

View file

@ -278,54 +278,54 @@ void change_settings(void)
} }
void draw_analog_minimeters(void) { void draw_analog_minimeters(void) {
rb->lcd_bitmap(sound_speaker, 0, 12, 4, 8); rb->lcd_mono_bitmap(sound_speaker, 0, 12, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); 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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(sound_max_level, 12, 12, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(sound_speaker, 54, 12, 4, 8); rb->lcd_mono_bitmap(sound_speaker, 54, 12, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); 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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(sound_max_level, 66, 12, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); 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); rb->lcd_mono_bitmap(sound_speaker, 34, 24, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); 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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(sound_max_level, 46, 24, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_bitmap(sound_speaker, 34, 40, 4, 8); rb->lcd_mono_bitmap(sound_speaker, 34, 40, 4, 8);
rb->lcd_set_drawmode(DRMODE_FG); 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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_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); rb->lcd_mono_bitmap(sound_max_level, 46, 40, 3, 8);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
} }
@ -359,8 +359,8 @@ void analog_meter(void) {
/* Needle covers */ /* Needle covers */
rb->lcd_set_drawmode(DRMODE_FG); rb->lcd_set_drawmode(DRMODE_FG);
rb->lcd_bitmap(needle_cover, 22, 59, 13, 5); rb->lcd_mono_bitmap(needle_cover, 22, 59, 13, 5);
rb->lcd_bitmap(needle_cover, 78, 59, 13, 5); rb->lcd_mono_bitmap(needle_cover, 78, 59, 13, 5);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);
/* Show Left/Right */ /* Show Left/Right */
@ -396,10 +396,10 @@ void digital_meter(void) {
rb->lcd_set_drawmode(DRMODE_FG); 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); rb->lcd_mono_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); rb->lcd_mono_bitmap(led, i*9+2+i, 52, 9, 5);
rb->lcd_set_drawmode(DRMODE_SOLID); rb->lcd_set_drawmode(DRMODE_SOLID);

View file

@ -141,98 +141,202 @@ const unsigned char rockbox112x37[]={
#if LCD_WIDTH >= 160 #if LCD_WIDTH >= 160
/* iRiver LCD width */ /* iRiver LCD width */
const unsigned char rockbox160x53[] = { const unsigned char rockbox160x53x2[] = {
0x00, 0x00, 0x00, 0x04, 0x04, 0xff, 0x04, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0x00, 0x00, 0x00, 0x30, 0x30, 0xff, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xe0, 0xe0, 0xe0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf8, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xcc,
0xfa, 0xf2, 0xf4, 0xf4, 0xe8, 0xc8, 0x90, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0xcc, 0x0c, 0x30, 0x30, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x40, 0x20, 0x90, 0xc8, 0xe4, 0xf4, 0xf4, 0xf2, 0xfa, 0xfa, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x30, 0x30, 0x0c, 0xcc, 0xcc, 0xcc,
0xf4, 0xf4, 0xf4, 0xe8, 0xc8, 0x98, 0x04, 0x04, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0x30, 0x30, 0x30, 0xc0, 0xc0, 0xc0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
0x04, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0xf4, 0xf4, 0xf4, 0xf4, 0x30, 0xff, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30,
0xf4, 0x74, 0x1c, 0x06, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xf0, 0x3c, 0x33, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x5f, 0x5f, 0x5f, 0x5f, 0x9f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0xe0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x1f, 0x0f, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc, 0xfc, 0xfc, 0xf0, 0xc0, 0x00, 0x00,
0x4f, 0x9f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xe1, 0x0e, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff,
0x06, 0xf1, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x1f, 0x9f, 0x4f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc3, 0x0c, 0x30, 0xc0, 0x00, 0x00, 0x00,
0x1f, 0x1f, 0x3f, 0x7f, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0x30, 0x0c, 0xc3, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0xff, 0x00, 0x00, 0x80, 0xe0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xbf, 0x8f, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc3, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x83, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1c, 0x34, 0xc4, 0x08, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x80, 0x80, 0xc1, 0x3e, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00,
0x00, 0x01, 0x1e, 0xe0, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x80, 0x7c, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xc0, 0x03, 0xfc, 0x00, 0xc0,
0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3c, 0x03, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0xff, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x1f, 0x0f, 0x70, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x03, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x08, 0x08, 0x08, 0xff, 0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x08, 0xff, 0x33, 0x33, 0x33, 0x33, 0xc3, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0x08, 0xff, 0x08, 0x08, 0x08, 0x08, 0xff, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x03, 0x00, 0xf0,
0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x30, 0xc3, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x3f, 0x0f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xc0, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x03, 0xc3, 0x30, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x03, 0x03, 0x0f, 0x3f, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x08, 0x30, 0x60, 0x10, 0x08, 0x04, 0x00, 0xff, 0x00, 0x00, 0xc0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0xc0,
0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1c, 0x32, 0x1d, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x30, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x67, 0x19, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1f, 0x7f, 0x60, 0xc4, 0xc2, 0x83, 0x30, 0x0e, 0x9c, 0xc1, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xff, 0x03, 0x1f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xf8, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0x3c, 0x83, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x03, 0xf0, 0x30, 0x30, 0xc0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x1f, 0x60, 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff,
0x0f, 0x19, 0xe3, 0x1f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfc, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfc, 0x86, 0x01, 0x01, 0x00, 0x00, 0x02, 0x82, 0x85, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00,
0x79, 0x02, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x78, 0x86, 0x03, 0x01, 0x00, 0x00, 0x02, 0x02, 0x04, 0xc9, 0x33, 0x00, 0xff, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55,
0xce, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x20, 0x00, 0x00, 0x55, 0x55, 0x55, 0x55, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xec, 0x07, 0x71, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x70, 0x0f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xff, 0x00, 0x00, 0x00, 0x03, 0x1f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xc0, 0x03, 0x1f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xfa, 0x00, 0x00, 0x00, 0x00,
0xf9, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x03, 0x00, 0x00, 0x00,
0x00, 0x07, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf9, 0xf9, 0xff, 0x03, 0x0f, 0xf0, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xf8, 0xfc, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xc0, 0xf0, 0x0f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x07, 0x38, 0xc3, 0x1f, 0x7f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x03, 0xfc, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xf0,
0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x30, 0x18, 0x20, 0xc0, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0x02, 0x06, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0x55, 0x55, 0x55,
0x60, 0xb0, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x19, 0x72, 0xcc, 0x55, 0x55, 0x55, 0x55, 0xff, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x10, 0x60, 0x80, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x06, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x04, 0x1f, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x07, 0x07, 0x07, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00,
0x07, 0x07, 0x07, 0x1c, 0x04, 0x04, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0,
0x0f, 0x0f, 0x07, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00,
0x08, 0x08, 0x08, 0x08, 0x09, 0x0b, 0x0b, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,
0x0f, 0x07, 0x07, 0x03, 0x01, 0x01, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x1c, 0x07, 0x07, 0x04, 0x04, 0x04, 0xf0, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00,
0x04, 0x04, 0x04, 0x04, 0x06, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xff,
0x04, 0x04, 0x04, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xff, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xff,
0x01, 0x03, 0x02, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc0, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xff,
0x06, 0x06, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x01, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x06, 0x01, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x55, 0x55, 0x55,
0x07, 0x06, 0x00, 0x06, 0x55, 0x55, 0x55, 0x55, 0x5f, 0x57, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x57, 0x57, 0x5c, 0x5c, 0x70, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x70,
0x5c, 0x5c, 0x57, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x57, 0x57, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5f, 0x7c,
0xf0, 0x0c, 0xf3, 0x7c, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xf5,
0x3f, 0xc3, 0x3c, 0x03,
0x00, 0x00, 0xff, 0x03, 0x00, 0x3f, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f,
0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xff, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0xd5, 0xd5, 0xd5, 0xd5, 0xd5,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5f, 0x7c, 0x57, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0xd5, 0xd5, 0xd5, 0xd5, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x57, 0x5f, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0xfd, 0x0f, 0xc0,
0x3c, 0x03, 0x00, 0x00,
0x00, 0xff, 0xff, 0x00, 0x30, 0x0c, 0x0f, 0x00, 0xfc, 0xf0, 0x03, 0xff, 0xff,
0x0f, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xc0, 0x00, 0x00,
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xc3, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0xf5, 0x3d, 0x03, 0x03, 0x00, 0x00, 0x0c, 0x0c, 0x33,
0xc3, 0x0d, 0xf5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0xd5, 0x3d, 0x0f, 0x03, 0x00, 0x00, 0x0c, 0x0c, 0x30, 0xc3, 0x0f,
0xfd, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xf5, 0x3f, 0x03, 0xf0, 0x0f, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x3f, 0x3c, 0xf0, 0xf0, 0xc0, 0x0f, 0x00, 0xc3, 0xf0, 0xff, 0xff,
0x00, 0xff, 0x00, 0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00,
0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0x0f, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x03, 0x3c, 0xc0, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xfc, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x03, 0xfc, 0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
0x3f, 0x00, 0xff, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f,
0xf0, 0x7f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f, 0x5d, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x7f, 0xf0, 0x00, 0x3f, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff,
0x00, 0xff, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc0, 0xcc,
0xc3, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00,
0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc3, 0xc3, 0xff,
0xc0, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x3f, 0xc0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x57, 0x5c, 0x70, 0x70, 0x73, 0x73, 0x70, 0x70,
0x5c, 0x5f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x57, 0x5c, 0x7c, 0x70, 0x70, 0x73, 0x73, 0x73, 0x7c, 0x5f,
0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5f, 0x7c, 0xc3, 0x0c, 0xf0,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x3f, 0x3f, 0x00, 0xff, 0xff,
0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xf0, 0x00, 0x03, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x0f, 0xf0, 0x03, 0x3f, 0xff, 0xff, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x35, 0x0f, 0x03, 0x0d, 0xf5, 0xd5,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55,
0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5,
0x3d, 0xcf, 0xfd, 0xd5, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57, 0x7f, 0xf0,
0x03, 0x3c, 0xc0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x3c, 0x3f, 0x3f, 0x3f,
0x30, 0xff, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x3f, 0x3f, 0x3f, 0x3f,
0x3f, 0x3f, 0x3f, 0xf0, 0x30, 0x30, 0x03, 0x0f, 0x3f, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0x3f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0xc0, 0xc0, 0xc0, 0xc3, 0xcf, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x3f, 0x0f, 0x03, 0x03, 0x00, 0x00, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x3f, 0xf0, 0x3f, 0x3f, 0x35, 0x35, 0x35,
0x35, 0x35, 0x35, 0x35, 0x3d, 0x0d, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
0x35, 0x35, 0x35, 0x0d, 0x0d, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x0f, 0x0d, 0x3d, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
0x3d, 0x3d, 0x3f, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x3d, 0x03,
0x3c, 0x03, 0x00, 0x03, 0x0d, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35, 0x35,
0x3f, 0x3c, 0x00, 0x3c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
}; };
#endif #endif
@ -321,9 +425,9 @@ bool statusbar_icon_volume(int percent)
volume = 100; volume = 100;
if (volume==0) { if (volume==0) {
lcd_bitmap(bitmap_icons_7x8[Icon_Mute], lcd_mono_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); STATUSBAR_Y_POS, 7, STATUSBAR_HEIGHT);
} }
else { else {
/* We want to redraw the icon later on */ /* We want to redraw the icon later on */
@ -370,8 +474,8 @@ 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_mono_bitmap(bitmap_icons_7x8[state], ICON_PLAY_STATE_X_POS, STATUSBAR_Y_POS,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -379,8 +483,8 @@ 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_mono_bitmap(bitmap_icons_7x8[mode], ICON_PLAY_MODE_X_POS, STATUSBAR_Y_POS,
ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT); ICON_PLAY_MODE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -388,8 +492,8 @@ 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_mono_bitmap(bitmap_icons_7x8[Icon_Shuffle], ICON_SHUFFLE_X_POS,
STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT); STATUSBAR_Y_POS, ICON_SHUFFLE_WIDTH, STATUSBAR_HEIGHT);
} }
/* /*
@ -397,8 +501,8 @@ 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_mono_bitmap(bitmap_icons_5x8[Icon_Lock], LOCK_X_POS,
STATUSBAR_Y_POS, 5, 8); STATUSBAR_Y_POS, 5, 8);
} }
#if CONFIG_LED == LED_VIRTUAL #if CONFIG_LED == LED_VIRTUAL
@ -407,8 +511,8 @@ void statusbar_icon_lock(void)
*/ */
void statusbar_led(void) void statusbar_led(void)
{ {
lcd_bitmap(bitmap_icon_disk, ICON_DISK_X_POS, lcd_mono_bitmap(bitmap_icon_disk, ICON_DISK_X_POS,
STATUSBAR_Y_POS, ICON_DISK_WIDTH, STATUSBAR_HEIGHT); STATUSBAR_Y_POS, ICON_DISK_WIDTH, STATUSBAR_HEIGHT);
} }
#endif #endif

View file

@ -72,7 +72,7 @@ extern const unsigned char bitmap_icon_disk[];
extern const unsigned char rockbox112x37[]; extern const unsigned char rockbox112x37[];
#endif #endif
#if LCD_WIDTH >= 160 #if LCD_WIDTH >= 160
extern const unsigned char rockbox160x53[]; extern const unsigned char rockbox160x53x2[];
#endif #endif
#define STATUSBAR_X_POS 0 #define STATUSBAR_X_POS 0

View file

@ -1107,8 +1107,8 @@ void peak_meter_draw_trig(int xpos, int ypos) {
case TRIG_READY: case TRIG_READY:
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_mono_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_STEADY: case TRIG_STEADY:
@ -1117,17 +1117,17 @@ void peak_meter_draw_trig(int xpos, int ypos) {
time_left = time_left * TRIGBAR_WIDTH / trig_strt_duration; time_left = time_left * TRIGBAR_WIDTH / trig_strt_duration;
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_mono_bitmap(bitmap_icons_7x8[Icon_Stop], xpos, ypos,
ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_GO: case TRIG_GO:
case TRIG_CONTINUE: case TRIG_CONTINUE:
scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2, scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2,
TRIGBAR_WIDTH, TRIGBAR_WIDTH, TRIGBAR_WIDTH, HORIZONTAL); TRIGBAR_WIDTH, TRIGBAR_WIDTH, TRIGBAR_WIDTH, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Record], lcd_mono_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); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
case TRIG_POSTREC: case TRIG_POSTREC:
@ -1135,9 +1135,9 @@ void peak_meter_draw_trig(int xpos, int ypos) {
time_left = time_left * TRIGBAR_WIDTH / trig_stp_hold; time_left = time_left * TRIGBAR_WIDTH / trig_stp_hold;
scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2, scrollbar(x, ypos + 1, TRIGBAR_WIDTH, TRIG_HEIGHT - 2,
TRIGBAR_WIDTH, time_left, TRIGBAR_WIDTH, HORIZONTAL); TRIGBAR_WIDTH, time_left, TRIGBAR_WIDTH, HORIZONTAL);
lcd_bitmap(bitmap_icons_7x8[Icon_Record], lcd_mono_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); ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
break; break;
} }

View file

@ -869,8 +869,8 @@ bool f2_rec_screen(void)
lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_QUALITY)); lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_QUALITY));
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_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); 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));
@ -879,8 +879,8 @@ bool f2_rec_screen(void)
ptr = freq_str[global_settings.rec_frequency]; ptr = freq_str[global_settings.rec_frequency];
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_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
/* Channel mode */ /* Channel mode */
switch ( global_settings.rec_channels ) { switch ( global_settings.rec_channels ) {
@ -900,8 +900,8 @@ bool f2_rec_screen(void)
lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE));
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_mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
lcd_update(); lcd_update();
@ -994,15 +994,15 @@ bool f3_rec_screen(void)
ptr = src_str[global_settings.rec_source]; ptr = src_str[global_settings.rec_source];
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_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); 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_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
lcd_update(); lcd_update();

View file

@ -95,9 +95,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_mono_bitmap(usb_logo, LCD_WIDTH/2-BMPWIDTH_usb_logo/2,
LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo, LCD_HEIGHT/2-BMPHEIGHT_usb_logo/2, BMPWIDTH_usb_logo,
BMPHEIGHT_usb_logo); BMPHEIGHT_usb_logo);
status_draw(true); status_draw(true);
lcd_update(); lcd_update();
#else #else
@ -234,15 +234,15 @@ 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); lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
lcd_set_drawmode(DRMODE_FG); 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); lcd_mono_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); lcd_mono_bitmap(charging_logo, pox_x, pox_y + 16, sizeof(charging_logo), 8);
lcd_set_drawmode(DRMODE_SOLID); lcd_set_drawmode(DRMODE_SOLID);
} }
else else
@ -258,7 +258,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); lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8, sizeof(charging_logo), 8);
phase++; phase++;
} }
lcd_update(); lcd_update();
@ -415,8 +415,8 @@ int pitch_screen(void)
ptr = str(LANG_PITCH_UP); ptr = str(LANG_PITCH_UP);
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_mono_bitmap(bitmap_icons_7x8[Icon_UpArrow],
LCD_WIDTH/2 - 3, h*2, 7, 8); 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);
@ -425,14 +425,14 @@ int pitch_screen(void)
ptr = str(LANG_PITCH_DOWN); ptr = str(LANG_PITCH_DOWN);
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_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); 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_mono_bitmap(bitmap_icons_7x8[Icon_Pause],
(LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8); (LCD_WIDTH-(w/2))/2-10, LCD_HEIGHT/2 - h/2, 7, 8);
lcd_update(); lcd_update();
} }
@ -637,12 +637,12 @@ bool quick_screen(int context, int button)
#endif #endif
} }
lcd_bitmap(bitmap_icons_7x8[Icon_FastBackward], lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
lcd_bitmap(bitmap_icons_7x8[Icon_DownArrow], lcd_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
lcd_bitmap(bitmap_icons_7x8[Icon_FastForward], lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
lcd_update(); lcd_update();
key = button_get(true); key = button_get(true);
@ -862,24 +862,18 @@ void splash(int ticks, /* how long the splash is displayed */
} }
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
/* If we center the display and it wouldn't cover the full screen, /* If we center the display, then just clear the box we need and put
then just clear the box we need and put a nice little frame and a nice little frame and put the text in there! */
put the text in there! */
if(center && (y > 2)) { if(center && (y > 2)) {
if(maxw < (LCD_WIDTH -4)) { int xx = (LCD_WIDTH-maxw)/2 - 2;
int xx = (LCD_WIDTH-maxw)/2 - 2; /* The new graphics routines handle clipping, so no need to check */
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); #if LCD_DEPTH > 1
lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); lcd_set_background(MAX_LEVEL-1);
lcd_set_drawmode(DRMODE_SOLID); #endif
lcd_drawrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
} lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
else { lcd_set_drawmode(DRMODE_SOLID);
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); lcd_drawrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
lcd_fillrect(0, y-2, LCD_WIDTH, LCD_HEIGHT-y*2+4);
lcd_set_drawmode(DRMODE_SOLID);
lcd_hline(0, LCD_WIDTH-1, y-2);
lcd_hline(0, LCD_WIDTH-1, LCD_HEIGHT-y+2);
}
} }
else else
#endif #endif
@ -921,6 +915,9 @@ void splash(int ticks, /* how long the splash is displayed */
x += w+SPACE; /* pixels space! */ x += w+SPACE; /* pixels space! */
next = strtok_r(NULL, " ", &store); next = strtok_r(NULL, " ", &store);
} }
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
lcd_set_background(MAX_LEVEL);
#endif
lcd_update(); lcd_update();
if(ticks) if(ticks)

View file

@ -244,12 +244,12 @@ 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_mono_bitmap(bitmap_icons_7x8[Icon_Plug], ICON_PLUG_X_POS,
STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT); 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_mono_bitmap(bitmap_icons_7x8[Icon_USBPlug], ICON_PLUG_X_POS,
STATUSBAR_Y_POS, ICON_PLUG_WIDTH, STATUSBAR_HEIGHT); 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,9 +395,9 @@ static int showdir(void)
int offset=0; int offset=0;
if ( line_height > 8 ) if ( line_height > 8 )
offset = (line_height - 8) / 2; offset = (line_height - 8) / 2;
lcd_bitmap(icon, lcd_mono_bitmap(icon,
CURSOR_X * 6 + CURSOR_WIDTH, CURSOR_X * 6 + CURSOR_WIDTH,
MARGIN_Y+(i-start)*line_height + offset, 6, 8); MARGIN_Y+(i-start)*line_height + offset, 6, 8);
#else #else
if (icon < 0 ) if (icon < 0 )
icon = Unknown; icon = Unknown;

View file

@ -115,7 +115,7 @@ static void wps_display_images(void) {
lcd_set_drawmode(DRMODE_FG); 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); lcd_mono_bitmap(img[n].ptr, img[n].x, img[n].y, img[n].w, img[n].h);
} }
} }
lcd_set_drawmode(DRMODE_SOLID); lcd_set_drawmode(DRMODE_SOLID);

View file

@ -60,8 +60,16 @@
/*** globals ***/ /*** globals ***/
unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH] IDATA_ATTR; unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH] IDATA_ATTR;
/* should be 'const', but this causes a section type conflict */
static unsigned char dibits[16] IDATA_ATTR = {
0x00, 0x03, 0x0C, 0x0F, 0x30, 0x33, 0x3C, 0x3F,
0xC0, 0xC3, 0xCC, 0xCF, 0xF0, 0xF3, 0xFC, 0xFF
};
static unsigned fg_pattern IDATA_ATTR = 0xFF; /* initially black */
static unsigned bg_pattern IDATA_ATTR = 0x00; /* initially white */
static int drawmode = DRMODE_SOLID; static int drawmode = DRMODE_SOLID;
static int xmargin = 0; static int xmargin = 0;
static int ymargin = 0; static int ymargin = 0;
@ -131,14 +139,8 @@ void lcd_set_flip(bool yesno)
* The value must be 0 <= pixels < LCD_HEIGHT. */ * The value must be 0 <= pixels < LCD_HEIGHT. */
void lcd_roll(int lines) void lcd_roll(int lines)
{ {
char data[2];
lines &= LCD_HEIGHT-1; lines &= LCD_HEIGHT-1;
data[0] = lines & 0xff; lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, lines, -1);
data[1] = lines >> 8;
lcd_write_command(LCD_CNTL_DISPLAY_START_LINE);
lcd_write_data(data, 2);
} }
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
@ -157,15 +159,15 @@ void lcd_init(void)
{ {
/* GPO35 is the LCD A0 pin /* GPO35 is the LCD A0 pin
GPO46 is LCD RESET */ GPO46 is LCD RESET */
GPIO1_OUT |= 0x00004008; or_l(0x00004008, &GPIO1_OUT);
GPIO1_ENABLE |= 0x00004008; or_l(0x00004008, &GPIO1_ENABLE);
GPIO1_FUNCTION |= 0x00004008; or_l(0x00004008, &GPIO1_FUNCTION);
/* Reset LCD */ /* Reset LCD */
sleep(1); sleep(1);
GPIO1_OUT &= ~0x00004000; and_l(~0x00004000, &GPIO1_OUT);
sleep(1); sleep(1);
GPIO1_OUT |= 0x00004000; or_l(0x00004000, &GPIO1_OUT);
sleep(1); sleep(1);
lcd_write_command(LCD_CNTL_COLUMN_ADDRESS_DIR | 0); /* Normal */ lcd_write_command(LCD_CNTL_COLUMN_ADDRESS_DIR | 0); /* Normal */
@ -190,7 +192,7 @@ void lcd_init(void)
lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, 0, -1); lcd_write_command_ex(LCD_CNTL_DISPLAY_START_LINE, 0, -1);
lcd_write_command_ex(LCD_CNTL_GRAY_SCALE_PATTERN, 0x42, -1); lcd_write_command_ex(LCD_CNTL_GRAY_SCALE_PATTERN, 0x42, -1);
lcd_write_command_ex(LCD_CNTL_DISPLAY_MODE, 1, -1); /* Monochrome mode */ lcd_write_command_ex(LCD_CNTL_DISPLAY_MODE, 0, -1); /* Greyscale mode */
lcd_write_command(LCD_CNTL_DATA_INPUT_DIR | 0); /* Column mode */ lcd_write_command(LCD_CNTL_DATA_INPUT_DIR | 0); /* Column mode */
lcd_clear_display(); lcd_clear_display();
@ -204,7 +206,7 @@ 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 by and bheight are in 8-pixel units! */ note that by and bheight are in 4-pixel units! */
void lcd_blit(const unsigned char* data, int x, int by, int width, void lcd_blit(const unsigned char* data, int x, int by, int width,
int bheight, int stride) int bheight, int stride)
{ {
@ -223,13 +225,13 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
/* Update the display. /* Update the display.
This must be called after all other LCD functions that change the display. */ This must be called after all other LCD functions that change the display. */
void lcd_update(void) __attribute__ ((section (".icode"))); void lcd_update(void) ICODE_ATTR;
void lcd_update(void) void lcd_update(void)
{ {
int y; int y;
/* Copy display bitmap to hardware */ /* Copy display bitmap to hardware */
for (y = 0; y < LCD_HEIGHT/8; y++) for (y = 0; y < LCD_HEIGHT/4; 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, 0, -1); lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
@ -240,21 +242,21 @@ 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) ICODE_ATTR;
void lcd_update_rect(int x, 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) >> 3; ymax = (y + height-1) >> 2;
y >>= 3; y >>= 2;
if(x + width > LCD_WIDTH) if(x + width > LCD_WIDTH)
width = LCD_WIDTH - x; 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/4)
ymax = LCD_HEIGHT/8-1; ymax = LCD_HEIGHT/4-1;
/* Copy specified rectange bitmap to hardware */ /* Copy specified rectange bitmap to hardware */
for (; y <= ymax; y++) for (; y <= ymax; y++)
@ -280,6 +282,26 @@ int lcd_get_drawmode(void)
return drawmode; return drawmode;
} }
void lcd_set_foreground(int brightness)
{
fg_pattern = 0x55 * (~brightness & 3);
}
int lcd_get_foreground(void)
{
return ~fg_pattern & 3;
}
void lcd_set_background(int brightness)
{
bg_pattern = 0x55 * (~brightness & 3);
}
int lcd_get_background(void)
{
return ~bg_pattern & 3;
}
void lcd_setmargins(int x, int y) void lcd_setmargins(int x, int y)
{ {
xmargin = x; xmargin = x;
@ -310,17 +332,21 @@ int lcd_getstringsize(const unsigned char *str, int *w, int *h)
static void setpixel(int x, int y) static void setpixel(int x, int y)
{ {
DRAW_PIXEL(x, y); unsigned char *data = &lcd_framebuffer[y>>2][x];
unsigned mask = 3 << (2 * (y & 3));
*data = (*data & ~mask) | (fg_pattern & mask);
} }
static void clearpixel(int x, int y) static void clearpixel(int x, int y)
{ {
CLEAR_PIXEL(x, y); unsigned char *data = &lcd_framebuffer[y>>2][x];
unsigned mask = 3 << (2 * (y & 3));
*data = (*data & ~mask) | (bg_pattern & mask);
} }
static void flippixel(int x, int y) static void flippixel(int x, int y)
{ {
INVERT_PIXEL(x, y); lcd_framebuffer[y>>2][x] ^= 3 << (2 * (y & 3));
} }
static void nopixel(int x, int y) static void nopixel(int x, int y)
@ -333,61 +359,68 @@ lcd_pixelfunc_type* lcd_pixelfuncs[8] = {
flippixel, nopixel, setpixel, setpixel, flippixel, nopixel, setpixel, setpixel,
nopixel, clearpixel, nopixel, clearpixel nopixel, clearpixel, nopixel, clearpixel
}; };
/* 'mask' and 'bits' contain 2 bits per pixel */
static void flipblock(unsigned char *address, unsigned mask, unsigned bits) static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void flipblock(unsigned char *address, unsigned mask, unsigned bits) static void flipblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address ^= (bits & mask); *address ^= bits & mask;
} }
static void bgblock(unsigned char *address, unsigned mask, unsigned bits) static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void bgblock(unsigned char *address, unsigned mask, unsigned bits) static void bgblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address &= (bits | ~mask); mask &= ~bits;
*address = (*address & ~mask) | (bg_pattern & mask);
} }
static void fgblock(unsigned char *address, unsigned mask, unsigned bits) static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void fgblock(unsigned char *address, unsigned mask, unsigned bits) static void fgblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address |= (bits & mask); mask &= bits;
*address = (*address & ~mask) | (fg_pattern & mask);
} }
static void solidblock(unsigned char *address, unsigned mask, unsigned bits) static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void solidblock(unsigned char *address, unsigned mask, unsigned bits) static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address = (*address & ~mask) | (bits & mask); *address = (*address & ~mask) | (bits & mask & fg_pattern)
| (~bits & mask & bg_pattern);
} }
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address ^= (~bits & mask); *address ^= ~bits & mask;
} }
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) static void bginvblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address &= ~(bits & mask); mask &= bits;
*address = (*address & ~mask) | (bg_pattern & mask);
} }
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) static void fginvblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address |= (~bits & mask); mask &= ~bits;
*address = (*address & ~mask) | (fg_pattern & mask);
} }
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
__attribute__ ((section(".icode"))); ICODE_ATTR;
static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
{ {
*address = (*address & ~mask) | (~bits & mask); *address = (*address & ~mask) | (~bits & mask & fg_pattern)
| (bits & mask & bg_pattern);
} }
lcd_blockfunc_type* lcd_blockfuncs[8] = { lcd_blockfunc_type* lcd_blockfuncs[8] = {
@ -400,7 +433,7 @@ lcd_blockfunc_type* lcd_blockfuncs[8] = {
/* Clear the whole display */ /* Clear the whole display */
void lcd_clear_display(void) void lcd_clear_display(void)
{ {
unsigned bits = (drawmode & DRMODE_INVERSEVID) ? 0xFFu : 0; unsigned bits = (drawmode & DRMODE_INVERSEVID) ? fg_pattern : bg_pattern;
memset(lcd_framebuffer, bits, sizeof lcd_framebuffer); memset(lcd_framebuffer, bits, sizeof lcd_framebuffer);
scrolling_lines = 0; scrolling_lines = 0;
@ -511,8 +544,8 @@ void lcd_hline(int x1, int x2, int y)
x2 = LCD_WIDTH-1; x2 = LCD_WIDTH-1;
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>3][x1]; dst = &lcd_framebuffer[y>>2][x1];
mask = 1 << (y & 7); mask = 3 << (2 * (y & 3));
dst_end = dst + x2 - x1; dst_end = dst + x2 - x1;
do do
@ -547,12 +580,12 @@ void lcd_vline(int x, int y1, int y2)
y2 = LCD_HEIGHT-1; y2 = LCD_HEIGHT-1;
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y1>>3][x]; dst = &lcd_framebuffer[y1>>2][x];
ny = y2 - (y1 & ~7); ny = y2 - (y1 & ~3);
mask = 0xFFu << (y1 & 7); mask = 0xFFu << (2 * (y1 & 3));
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (2 * (~ny & 3));
for (; ny >= 8; ny -= 8) for (; ny >= 4; ny -= 4)
{ {
bfunc(dst, mask, 0xFFu); bfunc(dst, mask, 0xFFu);
dst += LCD_WIDTH; dst += LCD_WIDTH;
@ -583,7 +616,7 @@ void lcd_fillrect(int x, int y, int width, int height)
int ny; int ny;
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
unsigned mask, mask_bottom; unsigned mask, mask_bottom;
unsigned bits = 0xFFu; unsigned bits = fg_pattern;
lcd_blockfunc_type *bfunc; lcd_blockfunc_type *bfunc;
bool fillopt; bool fillopt;
@ -611,14 +644,14 @@ void lcd_fillrect(int x, int y, int width, int height)
fillopt = (drawmode & DRMODE_INVERSEVID) ? fillopt = (drawmode & DRMODE_INVERSEVID) ?
(drawmode & DRMODE_BG) : (drawmode & DRMODE_FG); (drawmode & DRMODE_BG) : (drawmode & DRMODE_FG);
if (fillopt &&(drawmode & DRMODE_INVERSEVID)) if (fillopt &&(drawmode & DRMODE_INVERSEVID))
bits = 0; bits = bg_pattern;
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
dst = &lcd_framebuffer[y>>3][x]; dst = &lcd_framebuffer[y>>2][x];
ny = height - 1 + (y & 7); ny = height - 1 + (y & 3);
mask = 0xFFu << (y & 7); mask = 0xFFu << (2 * (y & 3));
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (2 * (~ny & 3));
for (; ny >= 8; ny -= 8) for (; ny >= 4; ny -= 4)
{ {
if (fillopt && (mask == 0xFFu)) if (fillopt && (mask == 0xFFu))
memset(dst, bits, width); memset(dst, bits, width);
@ -648,7 +681,7 @@ void lcd_fillrect(int x, int y, int width, int height)
} }
} }
/* About Rockbox' internal bitmap format: /* About Rockbox' internal monochrome bitmap format:
* *
* A bitmap contains one bit for every pixel that defines if that pixel is * A bitmap contains one bit for every pixel that defines if that pixel is
* black (1) or white (0). Bits within a byte are arranged vertically, LSB * black (1) or white (0). Bits within a byte are arranged vertically, LSB
@ -657,14 +690,14 @@ void lcd_fillrect(int x, int y, int width, int height)
* byte 1 2nd from left etc. The first row of bytes defines pixel rows * byte 1 2nd from left etc. The first row of bytes defines pixel rows
* 0..7, the second row defines pixel row 8..15 etc. * 0..7, the second row defines pixel row 8..15 etc.
* *
* This is the same as the internal lcd hw format. */ * This is similar to the internal lcd hw format. */
/* Draw a partial bitmap */ /* Draw a partial monochrome bitmap */
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height) int stride, int x, int y, int width, int height)
__attribute__ ((section(".icode"))); ICODE_ATTR;
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height) int stride, int x, int y, int width, int height)
{ {
int shift, ny; int shift, ny;
unsigned char *dst, *dst_end; unsigned char *dst, *dst_end;
@ -697,46 +730,75 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
src += stride * (src_y >> 3) + src_x; /* move starting point */ src += stride * (src_y >> 3) + src_x; /* move starting point */
src_y &= 7; src_y &= 7;
y -= src_y; y -= src_y;
dst = &lcd_framebuffer[y>>3][x]; dst = &lcd_framebuffer[y>>2][x];
shift = y & 7; shift = y & 3;
ny = height - 1 + shift + src_y; ny = height - 1 + shift + src_y;
bfunc = lcd_blockfuncs[drawmode]; bfunc = lcd_blockfuncs[drawmode];
mask = 0xFFu << (shift + src_y); mask = 0xFFu << (shift + src_y);
mask_bottom = 0xFFu >> (7 - (ny & 7)); mask_bottom = 0xFFu >> (~ny & 7);
if (shift == 0) if (shift == 0)
{ {
bool copyopt = (drawmode == DRMODE_SOLID); unsigned dmask1, dmask2, data;
for (; ny >= 8; ny -= 8) for (; ny >= 8; ny -= 8)
{ {
if (copyopt && (mask == 0xFFu)) const unsigned char *src_row = src;
memcpy(dst, src, width); unsigned char *dst_row = dst + LCD_WIDTH;
else
{ dmask1 = dibits[mask&0x0F];
const unsigned char *src_row = src; dmask2 = dibits[(mask>>4)&0x0F];
unsigned char *dst_row = dst; dst_end = dst_row + width;
dst_end = dst_row + width; if (dmask1 != 0)
{
do do
bfunc(dst_row++, mask, *src_row++); {
data = *src_row++;
bfunc(dst_row - LCD_WIDTH, dmask1, dibits[data&0x0F]);
bfunc(dst_row++, dmask2, dibits[(data>>4)&0x0F]);
}
while (dst_row < dst_end);
}
else
{
do
bfunc(dst_row++, dmask2, dibits[((*src_row++)>>4)&0x0F]);
while (dst_row < dst_end); while (dst_row < dst_end);
} }
src += stride; src += stride;
dst += LCD_WIDTH; dst += 2*LCD_WIDTH;
mask = 0xFFu; mask = 0xFFu;
} }
mask &= mask_bottom; mask &= mask_bottom;
dmask1 = dibits[mask&0x0F];
if (copyopt && (mask == 0xFFu)) dmask2 = dibits[(mask>>4)&0x0F];
memcpy(dst, src, width); dst_end = dst + width;
if (dmask1 != 0)
{
if (dmask2 != 0)
{
do
{
data = *src++;
bfunc(dst, dmask1, dibits[data&0x0F]);
bfunc((dst++) + LCD_WIDTH, dmask2, dibits[(data>>4)&0x0F]);
}
while (dst < dst_end);
}
else
{
do
bfunc(dst++, dmask1, dibits[(*src++)&0x0F]);
while (dst < dst_end);
}
}
else else
{ {
dst_end = dst + width;
do do
bfunc(dst++, mask, *src++); bfunc((dst++) + LCD_WIDTH, dmask2, dibits[((*src++)>>4)&0x0F]);
while (dst < dst_end); while (dst < dst_end);
} }
} }
@ -754,6 +816,144 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
{ {
data |= *src_col << shift; data |= *src_col << shift;
if (mask_col & 0xFFu)
{
if (mask_col & 0x0F)
bfunc(dst_col, dibits[mask_col&0x0F], dibits[data&0x0F]);
bfunc(dst_col + LCD_WIDTH, dibits[(mask_col>>4)&0x0F],
dibits[(data>>4)&0x0F]);
mask_col = 0xFFu;
}
else
mask_col >>= 8;
src_col += stride;
dst_col += 2*LCD_WIDTH;
data >>= 8;
}
data |= *src_col << shift;
mask_bottom &= mask_col;
if (mask_bottom & 0x0F)
bfunc(dst_col, dibits[mask_bottom&0x0F], dibits[data&0x0F]);
if (mask_bottom & 0xF0)
bfunc(dst_col + LCD_WIDTH, dibits[(mask_bottom&0xF0)>>4],
dibits[(data>>4)&0x0F]);
}
while (dst < dst_end);
}
}
/* Draw a full monochrome bitmap */
void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, int height)
{
lcd_mono_bitmap_part(src, 0, 0, width, x, y, width, height);
}
/* About Rockbox' internal native bitmap format:
*
* A bitmap contains two bits for every pixel. 00 = white, 01 = light grey,
* 10 = dark grey, 11 = black. Bits within a byte are arranged vertically, LSB
* at top.
* The bytes are stored in row-major order, with byte 0 being top left,
* byte 1 2nd from left etc. The first row of bytes defines pixel rows
* 0..3, the second row defines pixel row 4..7 etc.
*
* This is the same as the internal lcd hw format. */
/* Draw a partial native bitmap */
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
ICODE_ATTR;
void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height)
{
int shift, ny;
unsigned char *dst, *dst_end;
unsigned mask, mask_bottom;
lcd_blockfunc_type *bfunc;
/* nothing to draw? */
if ((width <= 0) || (height <= 0) || (x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
|| (x + width <= 0) || (y + height <= 0))
return;
/* clipping */
if (x < 0)
{
width += x;
src_x -= x;
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 >> 2) + src_x; /* move starting point */
src_y &= 3;
y -= src_y;
dst = &lcd_framebuffer[y>>2][x];
shift = y & 3;
ny = height - 1 + shift + src_y;
bfunc = lcd_blockfuncs[drawmode];
mask = 0xFFu << (2 * (shift + src_y));
mask_bottom = 0xFFu >> (2 * (~ny & 3));
if (shift == 0)
{
for (; ny >= 4; ny -= 4)
{
if (mask == 0xFFu)
memcpy(dst, src, width);
else
{
const unsigned char *src_row = src;
unsigned char *dst_row = dst;
dst_end = dst_row + width;
do
bfunc(dst_row++, mask, *src_row++);
while (dst_row < dst_end);
}
src += stride;
dst += LCD_WIDTH;
mask = 0xFFu;
}
mask &= mask_bottom;
if (mask == 0xFFu)
memcpy(dst, src, width);
else
{
dst_end = dst + width;
do
bfunc(dst++, mask, *src++);
while (dst < dst_end);
}
}
else
{
shift *= 2;
dst_end = dst + width;
do
{
const unsigned char *src_col = src++;
unsigned char *dst_col = dst++;
unsigned mask_col = mask;
unsigned data = 0;
for (y = ny; y >= 4; y -= 4)
{
data |= *src_col << shift;
if (mask_col & 0xFFu) if (mask_col & 0xFFu)
{ {
bfunc(dst_col, mask_col, data); bfunc(dst_col, mask_col, data);
@ -773,7 +973,7 @@ void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y,
} }
} }
/* Draw a full bitmap */ /* Draw a full native bitmap */
void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height) void lcd_bitmap(const unsigned char *src, int x, int y, int width, int height)
{ {
lcd_bitmap_part(src, 0, 0, width, x, y, width, height); lcd_bitmap_part(src, 0, 0, width, x, y, width, height);
@ -807,7 +1007,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
bits = pf->bits + (pf->offset ? bits = pf->bits + (pf->offset ?
pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch)); pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch));
lcd_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
x += width - ofs; x += width - ofs;
ofs = 0; ofs = 0;
@ -825,7 +1025,7 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
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)
{ {
int xpos,ypos,w,h; int xpos,ypos,w,h;
int lastmode = lcd_get_drawmode(); int lastmode = drawmode;
/* make sure scrolling is turned off on the line we are updating */ /* make sure scrolling is turned off on the line we are updating */
scrolling_lines &= ~(1 << y); scrolling_lines &= ~(1 << y);
@ -837,14 +1037,14 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style)
xpos = xmargin + x*w / strlen(str); xpos = xmargin + x*w / strlen(str);
ypos = ymargin + y*h; ypos = ymargin + y*h;
lcd_putsxy(xpos, ypos, str); lcd_putsxy(xpos, ypos, str);
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h); lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
if (style & STYLE_INVERT) if (style & STYLE_INVERT)
{ {
lcd_set_drawmode(DRMODE_COMPLEMENT); drawmode = DRMODE_COMPLEMENT;
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h); lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, h);
} }
lcd_set_drawmode(lastmode); drawmode = lastmode;
} }
/* put a string at a given char position */ /* put a string at a given char position */
@ -1006,17 +1206,17 @@ static void scroll_thread(void)
s->offset %= s->width; s->offset %= s->width;
} }
lastmode = lcd_get_drawmode(); lastmode = drawmode;
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
lcd_set_drawmode(DRMODE_SOLID); drawmode = DRMODE_SOLID;
lcd_putsxyofs(xpos, ypos, s->offset, s->line); lcd_putsxyofs(xpos, ypos, s->offset, s->line);
if (s->invert) if (s->invert)
{ {
lcd_set_drawmode(DRMODE_COMPLEMENT); drawmode = DRMODE_COMPLEMENT;
lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
} }
lcd_set_drawmode(lastmode); drawmode = lastmode;
lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
} }

View file

@ -868,7 +868,7 @@ static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
bits = pf->bits + (pf->offset ? bits = pf->bits + (pf->offset ?
pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch)); pf->offset[ch] : ((pf->height + 7) / 8 * pf->maxwidth * ch));
lcd_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
x += width - ofs; x += width - ofs;
ofs = 0; ofs = 0;

View file

@ -4,6 +4,7 @@
/* LCD dimensions (for the simulator) */ /* LCD dimensions (for the simulator) */
#define LCD_WIDTH (4*11*6) /* Display width in pixels */ #define LCD_WIDTH (4*11*6) /* Display width in pixels */
#define LCD_HEIGHT (4*16+2*24) /* 4*char + 2*icons */ #define LCD_HEIGHT (4*16+2*24) /* 4*char + 2*icons */
#define LCD_DEPTH 1
/* define this if you have the Player's keyboard */ /* define this if you have the Player's keyboard */
#define CONFIG_KEYPAD PLAYER_PAD #define CONFIG_KEYPAD PLAYER_PAD

View file

@ -121,7 +121,7 @@ extern void lcd_jump_scroll_delay(int ms);
#define DRMODE_INVERSEVID 4 /* used as bit modifier for basic modes */ #define DRMODE_INVERSEVID 4 /* used as bit modifier for basic modes */
/* Low-level drawing function types */ /* Low-level drawing function types */
typedef void lcd_pixelfunc_type(int x, int y); /* for b&w */ typedef void lcd_pixelfunc_type(int x, int y);
typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits); typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits);
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) #if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
@ -131,7 +131,12 @@ typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned
#define INVERT_PIXEL(x,y) lcd_framebuffer[(y)>>3][(x)] ^= (1<<((y)&7)) #define INVERT_PIXEL(x,y) lcd_framebuffer[(y)>>3][(x)] ^= (1<<((y)&7))
/* Memory copy of display bitmap */ /* Memory copy of display bitmap */
#if LCD_DEPTH == 1
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
#elif LCD_DEPTH == 2
#define MAX_LEVEL 3
extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
#endif
extern void lcd_set_invert_display(bool yesno); extern void lcd_set_invert_display(bool yesno);
extern void lcd_set_flip(bool yesno); extern void lcd_set_flip(bool yesno);
@ -165,6 +170,20 @@ extern void lcd_invertscroll(int x, int y);
extern void lcd_bidir_scroll(int threshold); extern void lcd_bidir_scroll(int threshold);
extern void lcd_scroll_step(int pixels); extern void lcd_scroll_step(int pixels);
#if LCD_DEPTH > 1
extern void lcd_set_foreground(int brightness);
extern int lcd_get_foreground(void);
extern void lcd_set_background(int brightness);
extern int lcd_get_background(void);
extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
int stride, int x, int y, int width, int height);
extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width,
int height);
#else /* LCD_DEPTH == 1 */
#define lcd_mono_bitmap lcd_bitmap
#define lcd_mono_bitmap_part lcd_bitmap_part
#endif
#endif /* CHARCELLS / BITMAP */ #endif /* CHARCELLS / BITMAP */
/* internal usage, but in multiple drivers */ /* internal usage, but in multiple drivers */

View file

@ -23,33 +23,28 @@
#include "lcd.h" #include "lcd.h"
#include "lcd-playersim.h" #include "lcd-playersim.h"
unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; /* the display */
char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */ char bitmap[LCD_HEIGHT][LCD_WIDTH]; /* the ui display */
BITMAPINFO2 bmi = RGBQUAD color_zero = {UI_LCD_BGCOLORLIGHT, 0};
RGBQUAD color_max = {0, 0, 0, 0};
BITMAPINFO256 bmi =
{ {
{sizeof (BITMAPINFOHEADER), {sizeof (BITMAPINFOHEADER),
LCD_WIDTH, -LCD_HEIGHT, 1, 8, LCD_WIDTH, -LCD_HEIGHT, 1, 8,
BI_RGB, 0, 0, 0, 2, 2, BI_RGB, 0, 0, 0, 2, 2,
}, },
{ {} /* colour lookup table gets filled later */
//{UI_LCD_BGCOLOR, 0}, /* green background color */
{UI_LCD_BGCOLORLIGHT, 0}, /* green background color */
{UI_LCD_BLACK, 0} /* black color */
}
}; /* bitmap information */ }; /* bitmap information */
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_BITMAP
/* Defined in lcd-playersim.c */
extern void lcd_print_char(int x, int y); #if LCD_DEPTH == 1
extern bool lcd_display_redraw; extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; /* the display */
extern unsigned char hardware_buffer_lcd[11][2]; #elif LCD_DEPTH == 2
static unsigned char lcd_buffer_copy[11][2]; extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; /* the display */
#endif #endif
/* lcd_update()
update lcd */
void lcd_update() void lcd_update()
{ {
int x, y; int x, y;
@ -58,26 +53,13 @@ void lcd_update()
if (hGUIWnd == NULL) if (hGUIWnd == NULL)
_endthread (); _endthread ();
#ifdef HAVE_LCD_CHARCELLS
for (y = 0; y < 2; y++)
{
for (x = 0; x < 11; x++)
{
if (lcd_display_redraw ||
lcd_buffer_copy[x][y] != hardware_buffer_lcd[x][y])
{
lcd_buffer_copy[x][y] = hardware_buffer_lcd[x][y];
lcd_print_char(x, y);
}
}
}
lcd_display_redraw = false;
#endif
for (x = 0; x < LCD_WIDTH; x++) for (x = 0; x < LCD_WIDTH; x++)
for (y = 0; y < LCD_HEIGHT; y++) for (y = 0; y < LCD_HEIGHT; y++)
#if LCD_DEPTH == 1
bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
#elif LCD_DEPTH == 2
bitmap[y][x] = ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3);
#endif
/* Invalidate only the window part that actually did change */ /* Invalidate only the window part that actually did change */
GetClientRect (hGUIWnd, &r); GetClientRect (hGUIWnd, &r);
@ -108,7 +90,11 @@ void lcd_update_rect(int x_start, int y_start,
for (x = x_start; x < xmax; x++) for (x = x_start; x < xmax; x++)
for (y = y_start; y < ymax; y++) for (y = y_start; y < ymax; y++)
#if LCD_DEPTH == 1
bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); bitmap[y][x] = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
#elif LCD_DEPTH == 2
bitmap[y][x] = ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3);
#endif
/* Invalidate only the window part that actually did change */ /* Invalidate only the window part that actually did change */
GetClientRect (hGUIWnd, &r); GetClientRect (hGUIWnd, &r);
@ -136,37 +122,55 @@ void lcd_remote_update_rect(int x_start, int y_start,
(void)width; (void)width;
(void)height; (void)height;
} }
#endif /* HAVE_LCD_BITMAP */
/* lcd_backlight() #ifdef HAVE_LCD_CHARCELLS
set backlight state of lcd */ /* Defined in lcd-playersim.c */
void lcd_backlight (bool on) extern void lcd_print_char(int x, int y);
extern bool lcd_display_redraw;
extern unsigned char hardware_buffer_lcd[11][2];
static unsigned char lcd_buffer_copy[11][2];
void lcd_update()
{ {
if (on) int x, y;
{ bool changed = false;
RGBQUAD blon = {UI_LCD_BGCOLORLIGHT, 0}; RECT r;
bmi.bmiColors[0] = blon;
}
else
{
RGBQUAD blon = {UI_LCD_BGCOLOR, 0};
bmi.bmiColors[0] = blon;
}
InvalidateRect (hGUIWnd, NULL, FALSE); if (hGUIWnd == NULL)
_endthread ();
for (y = 0; y < 2; y++)
{
for (x = 0; x < 11; x++)
{
if (lcd_display_redraw ||
lcd_buffer_copy[x][y] != hardware_buffer_lcd[x][y])
{
lcd_buffer_copy[x][y] = hardware_buffer_lcd[x][y];
lcd_print_char(x, y);
changed = true;
}
}
}
if (changed)
{
/* Invalidate only the window part that actually did change */
GetClientRect (hGUIWnd, &r);
r.left = UI_LCD_POSX * r.right / UI_WIDTH;
r.top = UI_LCD_POSY * r.bottom / UI_HEIGHT;
r.right = (UI_LCD_POSX + UI_LCD_WIDTH) * r.right / UI_WIDTH;
r.bottom = (UI_LCD_POSY + UI_LCD_HEIGHT) * r.bottom / UI_HEIGHT;
InvalidateRect (hGUIWnd, &r, FALSE);
}
lcd_display_redraw = false;
} }
void drawdots(int color, struct coordinate *points, int count) void drawdots(int color, struct coordinate *points, int count)
{ {
while (count--) while (count--)
{ {
if (color) bitmap[points[count].y][points[count].x] = color;
{
DRAW_PIXEL(points[count].x, points[count].y);
}
else
{
CLEAR_PIXEL(points[count].x, points[count].y);
}
} }
} }
@ -181,17 +185,50 @@ void drawrectangles(int color, struct rectangle *points, int count)
for (x = points[count].x, ix = 0; ix < points[count].width; x++, ix++) for (x = points[count].x, ix = 0; ix < points[count].width; x++, ix++)
{ {
for (y = points[count].y, iy = 0; iy < points[count].width; y++, iy++) for (y = points[count].y, iy = 0; iy < points[count].height; y++, iy++)
{ {
if (color) bitmap[y][x] = color;
{
DRAW_PIXEL(x, y);
}
else
{
CLEAR_PIXEL(x, y);
}
} }
} }
} }
} }
#endif /* HAVE_LCD_CHARCELLS */
#if 0
/* set backlight state of lcd */
void lcd_backlight (bool on)
{
if (on)
color_zero = {UI_LCD_BGCOLORLIGHT, 0};
else
color_zero = {UI_LCD_BGCOLOR, 0};
lcdcolors(0, (1<<LCD_DEPTH), &color_zero, &color_max);
InvalidateRect (hGUIWnd, NULL, FALSE);
}
#endif
/* set a range of bitmap indices to a gradient from startcolour to endcolour */
void lcdcolors(int index, int count, RGBQUAD *start, RGBQUAD *end)
{
int i;
count--;
for (i = 0; i <= count; i++)
{
bmi.bmiColors[i+index].rgbRed = start->rgbRed
+ (end->rgbRed - start->rgbRed) * i / count;
bmi.bmiColors[i+index].rgbGreen = start->rgbGreen
+ (end->rgbGreen - start->rgbGreen) * i / count;
bmi.bmiColors[i+index].rgbBlue = start->rgbBlue
+ (end->rgbBlue - start->rgbBlue) * i / count;
}
}
/* initialise simulator lcd driver */
void simlcdinit(void)
{
bmi.bmiHeader.biClrUsed = (1<<LCD_DEPTH);
bmi.bmiHeader.biClrImportant = (1<<LCD_DEPTH);
lcdcolors(0, (1<<LCD_DEPTH), &color_zero, &color_max);
}

View file

@ -23,24 +23,16 @@
#include "uisw32.h" #include "uisw32.h"
#include "lcd.h" #include "lcd.h"
// BITMAPINFO2 // BITMAPINFO256
typedef struct typedef struct
{ {
BITMAPINFOHEADER bmiHeader; BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[2]; RGBQUAD bmiColors[256];
} BITMAPINFO2; } BITMAPINFO256;
#ifdef HAVE_LCD_BITMAP extern char bitmap[LCD_HEIGHT][LCD_WIDTH]; // the ui display
extern BITMAPINFO256 bmi; // bitmap information
extern unsigned char display[LCD_WIDTH][LCD_HEIGHT/8]; // the display
#else
#define DISP_X 112
#define DISP_Y 64
#endif
extern char bitmap[LCD_HEIGHT][LCD_WIDTH]; // the ui display
extern BITMAPINFO2 bmi; // bitmap information
void simlcdinit(void);
#endif // #ifndef __LCDWIN32_H__ #endif // #ifndef __LCDWIN32_H__

View file

@ -239,6 +239,8 @@ BOOL GUIStartup ()
if (hGUIWnd == NULL) if (hGUIWnd == NULL)
return FALSE; return FALSE;
simlcdinit();
return TRUE; return TRUE;
} }

View file

@ -40,11 +40,19 @@
#include "lcd-x11.h" #include "lcd-x11.h"
#include "lcd-playersim.h" #include "lcd-playersim.h"
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; #if LCD_DEPTH == 2
#define YBLOCK 4
#define BITOFFS 1 /* take the MSB of each pixel */
#else
#define YBLOCK 8
#define BITOFFS 0
#endif
extern void screen_resized(int width, int height); extern void screen_resized(int width, int height);
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
unsigned char lcd_framebuffer_copy[LCD_HEIGHT/8][LCD_WIDTH]; extern unsigned char lcd_framebuffer[LCD_HEIGHT/YBLOCK][LCD_WIDTH];
unsigned char lcd_framebuffer_copy[LCD_HEIGHT/YBLOCK][LCD_WIDTH];
void lcd_update (void) void lcd_update (void)
{ {
@ -55,21 +63,21 @@ void lcd_update (void)
int cp=0; int cp=0;
struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT];
for(y=0; y<LCD_HEIGHT; y+=8) { for(y=0; y<LCD_HEIGHT; y+=YBLOCK) {
for(x=0; x<LCD_WIDTH; x++) { for(x=0; x<LCD_WIDTH; x++) {
if(lcd_framebuffer[y/8][x] || lcd_framebuffer_copy[y/8][x]) { if(lcd_framebuffer[y/YBLOCK][x] || lcd_framebuffer_copy[y/YBLOCK][x]) {
/* one or more bits/pixels are changed */ /* one or more bits/pixels are changed */
unsigned char diff = unsigned char diff =
lcd_framebuffer[y/8][x] ^ lcd_framebuffer_copy[y/8][x]; lcd_framebuffer[y/YBLOCK][x] ^ lcd_framebuffer_copy[y/YBLOCK][x];
for(bit=0; bit<8; bit++) { for(bit=0; bit<YBLOCK; bit++) {
if(lcd_framebuffer[y/8][x]&(1<<bit)) { if(lcd_framebuffer[y/YBLOCK][x]&(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* set a dot */ /* set a dot */
points[p].x = x + MARGIN_X; points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y; points[p].y = y+bit + MARGIN_Y;
p++; /* increase the point counter */ p++; /* increase the point counter */
} }
else if(diff &(1<<bit)) { else if(diff &(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* clear a dot */ /* clear a dot */
clearpoints[cp].x = x + MARGIN_X; clearpoints[cp].x = x + MARGIN_X;
clearpoints[cp].y = y+bit + MARGIN_Y; clearpoints[cp].y = y+bit + MARGIN_Y;
@ -110,33 +118,33 @@ void lcd_update_rect(int x_start, int y_start,
fprintf(stderr, "%04d: lcd_update_rect(%d, %d, %d, %d)\n", fprintf(stderr, "%04d: lcd_update_rect(%d, %d, %d, %d)\n",
counter++, x_start, y_start, width, height); counter++, x_start, y_start, width, height);
#endif #endif
/* The Y coordinates have to work on even 8 pixel rows */ /* The Y coordinates have to work on even YBLOCK pixel rows */
ymax = (yline + height)/8; ymax = (yline + height)/YBLOCK;
yline /= 8; yline /= YBLOCK;
xmax = x_start + width; xmax = x_start + width;
if(xmax > LCD_WIDTH) if(xmax > LCD_WIDTH)
xmax = LCD_WIDTH; xmax = LCD_WIDTH;
if(ymax >= LCD_HEIGHT/8) if(ymax >= LCD_HEIGHT/YBLOCK)
ymax = LCD_HEIGHT/8-1; ymax = LCD_HEIGHT/YBLOCK-1;
for(; yline<=ymax; yline++) { for(; yline<=ymax; yline++) {
y = yline * 8; y = yline * YBLOCK;
for(x=x_start; x<xmax; x++) { for(x=x_start; x<xmax; x++) {
if(lcd_framebuffer[yline][x] || lcd_framebuffer_copy[yline][x]) { if(lcd_framebuffer[yline][x] || lcd_framebuffer_copy[yline][x]) {
/* one or more bits/pixels are changed */ /* one or more bits/pixels are changed */
unsigned char diff = unsigned char diff =
lcd_framebuffer[yline][x] ^ lcd_framebuffer_copy[yline][x]; lcd_framebuffer[yline][x] ^ lcd_framebuffer_copy[yline][x];
for(bit=0; bit<8; bit++) { for(bit=0; bit<YBLOCK; bit++) {
if(lcd_framebuffer[yline][x]&(1<<bit)) { if(lcd_framebuffer[yline][x]&(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* set a dot */ /* set a dot */
points[p].x = x + MARGIN_X; points[p].x = x + MARGIN_X;
points[p].y = y+bit + MARGIN_Y; points[p].y = y+bit + MARGIN_Y;
p++; /* increase the point counter */ p++; /* increase the point counter */
} }
else if(diff &(1<<bit)) { else if(diff &(1<<(bit*LCD_DEPTH+BITOFFS))) {
/* clear a dot */ /* clear a dot */
clearpoints[cp].x = x + MARGIN_X; clearpoints[cp].x = x + MARGIN_X;
clearpoints[cp].y = y+bit + MARGIN_Y; clearpoints[cp].y = y+bit + MARGIN_Y;