diff options
-rw-r--r-- | apps/main_menu.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index 5120235d02..092efde026 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -40,35 +40,38 @@ extern void tetris(void); | |||
40 | int show_logo( void ) | 40 | int show_logo( void ) |
41 | { | 41 | { |
42 | #ifdef HAVE_LCD_BITMAP | 42 | #ifdef HAVE_LCD_BITMAP |
43 | unsigned char buffer[112 * 8]; | ||
44 | char version[32]; | 43 | char version[32]; |
44 | unsigned char *ptr=rockbox112x37; | ||
45 | int height, i, font_h, font_w; | ||
45 | 46 | ||
46 | int failure; | 47 | lcd_clear_display(); |
47 | int height, width, font_h, font_w; | 48 | |
49 | for(i=0; i < 37; i+=8) { | ||
50 | /* the bitmap function doesn't work with full-height bitmaps | ||
51 | so we "stripe" the logo output */ | ||
52 | lcd_bitmap(ptr, 0, 10+i, 112, (37-i)>8?8:37-i, false); | ||
53 | ptr += 112; | ||
54 | } | ||
55 | height = 37; | ||
56 | |||
57 | #if 0 | ||
58 | /* | ||
59 | * This code is not used anymore, but I kept it here since it shows | ||
60 | * one way of using the BMP reader function to display an externally | ||
61 | * providing logo. | ||
62 | */ | ||
63 | unsigned char buffer[112 * 8]; | ||
64 | int width; | ||
48 | 65 | ||
49 | int i; | 66 | int i; |
50 | int eline; | 67 | int eline; |
51 | 68 | ||
69 | int failure; | ||
52 | failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); | 70 | failure = read_bmp_file("/rockbox112.bmp", &width, &height, buffer); |
53 | 71 | ||
54 | debugf("read_bmp_file() returned %d, width %d height %d\n", | 72 | debugf("read_bmp_file() returned %d, width %d height %d\n", |
55 | failure, width, height); | 73 | failure, width, height); |
56 | 74 | ||
57 | lcd_clear_display(); | ||
58 | |||
59 | if (failure) { | ||
60 | unsigned char *ptr=rockbox112x37; | ||
61 | for(i=0; i < 37; i+=8) { | ||
62 | /* the bitmap function doesn't work with full-height bitmaps | ||
63 | so we "stripe" the logo output */ | ||
64 | lcd_bitmap(ptr, 0, 10+i, 112, (37-i)>8?8:37-i, false); | ||
65 | ptr += 112; | ||
66 | } | ||
67 | height = 37; | ||
68 | |||
69 | } | ||
70 | else { | ||
71 | |||
72 | for(i=0, eline=0; i < height; i+=8, eline++) { | 75 | for(i=0, eline=0; i < height; i+=8, eline++) { |
73 | /* the bitmap function doesn't work with full-height bitmaps | 76 | /* the bitmap function doesn't work with full-height bitmaps |
74 | so we "stripe" the logo output */ | 77 | so we "stripe" the logo output */ |
@@ -76,6 +79,7 @@ int show_logo( void ) | |||
76 | (height-i)>8?8:height-i, false); | 79 | (height-i)>8?8:height-i, false); |
77 | } | 80 | } |
78 | } | 81 | } |
82 | #endif | ||
79 | 83 | ||
80 | snprintf(version, sizeof(version), "Ver. %s", appsversion); | 84 | snprintf(version, sizeof(version), "Ver. %s", appsversion); |
81 | lcd_getfontsize(0, &font_w, &font_h); | 85 | lcd_getfontsize(0, &font_w, &font_h); |