diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2002-05-16 12:56:43 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2002-05-16 12:56:43 +0000 |
| commit | bd886481b9938d4bfc4811d2b892cf388578b9fe (patch) | |
| tree | a515b501fa2dcfa0427c2b9d4bf17b68d1fc8f70 | |
| parent | 34acad9f903982c85193068a75b7c3577528d712 (diff) | |
| download | rockbox-bd886481b9938d4bfc4811d2b892cf388578b9fe.zip rockbox-bd886481b9938d4bfc4811d2b892cf388578b9fe.tar.gz rockbox-bd886481b9938d4bfc4811d2b892cf388578b9fe.tar.bz2 rockbox-bd886481b9938d4bfc4811d2b892cf388578b9fe.tar.xz | |
display logo if present
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@591 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | uisimulator/menu.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/uisimulator/menu.c b/uisimulator/menu.c index 6a6b61e..5c8356c 100644 --- a/uisimulator/menu.c +++ b/uisimulator/menu.c @@ -117,6 +117,52 @@ void add_menu_item(int location, char *string) menu_bottom = location; } +void show_logo(void) +{ + unsigned char buffer[112 * 8]; + + int failure; + int width=0; + int height=0; + + failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); + + debugf("read_bmp_file() returned %d, width %d height %d\n", + failure, width, height); + + if(!failure) { + int i; + int eline; + for(i=0, eline=0; i< height; i+=8, eline++) { + int x,y; + + /* the bitmap function doesn't work with full-height bitmaps + so we "stripe" the logo output */ + + lcd_bitmap(&buffer[eline*width], 0, 24+i, width, + (height-i)>8?8:height-i, false); + +#if 0 + /* for screen output debugging */ + for(y=0; y<8 && (i+y < height); y++) { + for(x=0; x < width; x++) { + + if(buffer[eline*width + x] & (1<<y)) { + printf("*"); + } + else + printf(" "); + } + printf("\n"); + } +#endif + } + + lcd_update(); + } + +} + void menu_init(void) { menu_top = Tetris; @@ -132,7 +178,7 @@ void menu_draw(void) for (i = i; i < Last_Id; i++) add_menu_item(items[i].menu_id, (char *) items[i].menu_desc); - lcd_putsxy(8, 38, "Rockbox!",2); + show_logo(); redraw_cursor(); } |