summaryrefslogtreecommitdiffstats
path: root/bootloader/show_logo.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2014-08-28 10:26:45 -0400
committerMichael Sevakis <jethead71@rockbox.org>2014-08-28 10:44:22 -0400
commit95a4c3afcd53a1f8b835dec33de51f9c304de4d9 (patch)
tree951877fd6a5604da066ced93e0e1a16a99181de2 /bootloader/show_logo.c
parent21e2b595c2797c226699cf19a2a2ad4abf22b210 (diff)
downloadrockbox-95a4c3afcd53a1f8b835dec33de51f9c304de4d9.tar.gz
rockbox-95a4c3afcd53a1f8b835dec33de51f9c304de4d9.tar.bz2
rockbox-95a4c3afcd53a1f8b835dec33de51f9c304de4d9.zip
Fix up the bootloaders
They can't access the raw RBVERSION define any longer. Change-Id: I698062b36306399945c01de54cdccaa1a1a8434e
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 @@
#include "bitmaps/rockboxlogo.h"
#if LCD_WIDTH <= 128
-#define BOOT_VERSION ("Boot " RBVERSION)
+#define BOOT_VERFMT "Boot %s"
#else
-#define BOOT_VERSION ("Boot Ver. " RBVERSION)
+#define BOOT_VERFMT "Boot Ver. %s"
#endif
/* Ensure TEXT_XPOS is >= 0 */
-#define TEXT_WIDTH ((sizeof(BOOT_VERSION)-1)*SYSFONT_WIDTH)
-#define TEXT_XPOS ((TEXT_WIDTH > LCD_WIDTH) ? 0 : ((LCD_WIDTH - TEXT_WIDTH) / 2))
+#define TEXT_WIDTH(l) ((l)*SYSFONT_WIDTH)
+#define TEXT_XPOS(w) (((w) > LCD_WIDTH) ? 0 : ((LCD_WIDTH - (w)) / 2))
#define LOGO_XPOS ((LCD_WIDTH - BMPWIDTH_rockboxlogo) / 2)
void show_logo( void )
@@ -43,14 +43,19 @@ void show_logo( void )
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
+ char verstr[strlen(rbversion) + sizeof (BOOT_VERFMT)];
+ int len = snprintf(verstr, sizeof(verstr), BOOT_VERFMT, rbversion);
+ int text_width = TEXT_WIDTH(len);
+ int text_xpos = TEXT_XPOS(text_width);
+
#if defined(SANSA_CLIP) || defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS)
/* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48
are blue, so we reverse the usual positioning */
- lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION);
+ lcd_putsxy(text_xpos, 0, verstr);
lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 16);
#else
lcd_bmp(&bm_rockboxlogo, LOGO_XPOS, 10);
- lcd_putsxy(TEXT_XPOS, LCD_HEIGHT-SYSFONT_HEIGHT, BOOT_VERSION);
+ lcd_putsxy(text_xpos, LCD_HEIGHT-SYSFONT_HEIGHT, verstr);
#endif
lcd_update();