summaryrefslogtreecommitdiff
path: root/bootloader/show_logo.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/show_logo.c')
-rw-r--r--bootloader/show_logo.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/bootloader/show_logo.c b/bootloader/show_logo.c
index 538e90299a..6584e3f24d 100644
--- a/bootloader/show_logo.c
+++ b/bootloader/show_logo.c
@@ -28,14 +28,14 @@
28#include "bitmaps/rockboxlogo.h" 28#include "bitmaps/rockboxlogo.h"
29 29
30#if LCD_WIDTH <= 128 30#if LCD_WIDTH <= 128
31#define BOOT_VERSION ("Boot " RBVERSION) 31#define BOOT_VERFMT "Boot %s"
32#else 32#else
33#define BOOT_VERSION ("Boot Ver. " RBVERSION) 33#define BOOT_VERFMT "Boot Ver. %s"
34#endif 34#endif
35 35
36/* Ensure TEXT_XPOS is >= 0 */ 36/* Ensure TEXT_XPOS is >= 0 */
37#define TEXT_WIDTH ((sizeof(BOOT_VERSION)-1)*SYSFONT_WIDTH) 37#define TEXT_WIDTH(l) ((l)*SYSFONT_WIDTH)
38#define TEXT_XPOS ((TEXT_WIDTH > LCD_WIDTH) ? 0 : ((LCD_WIDTH - TEXT_WIDTH) / 2)) 38#define TEXT_XPOS(w) (((w) > LCD_WIDTH) ? 0 : ((LCD_WIDTH - (w)) / 2))
39#define LOGO_XPOS ((LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2) 39#define LOGO_XPOS ((LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2)
40 40
41void show_logo( void ) 41void show_logo( void )
@@ -43,14 +43,19 @@ void show_logo( void )
43 lcd_clear_display(); 43 lcd_clear_display();
44 lcd_setfont(FONT_SYSFIXED); 44 lcd_setfont(FONT_SYSFIXED);
45 45
46 char verstr[strlen(rbversion) + sizeof (BOOT_VERFMT)];
47 int len = snprintf(verstr, sizeof(verstr), BOOT_VERFMT, rbversion);
48 int text_width = TEXT_WIDTH(len);
49 int text_xpos = TEXT_XPOS(text_width);
50
46#if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS) 51#if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS)
47 /* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48 52 /* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48
48 are blue, so we reverse the usual positioning */ 53 are blue, so we reverse the usual positioning */
49 lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION); 54 lcd_putsxy(text_xpos, 0, verstr);
50 lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 16); 55 lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 16);
51#else 56#else
52 lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 10); 57 lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 10);
53 lcd_putsxy(TEXT_XPOS, LCD_HEIGHT-SYSFONT_HEIGHT, BOOT_VERSION); 58 lcd_putsxy(text_xpos, LCD_HEIGHT-SYSFONT_HEIGHT, verstr);
54#endif 59#endif
55 60
56 lcd_update(); 61 lcd_update();