Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2008 by Barry Wardell |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | #include "lcd.h" |
| 22 | #include "lcd-remote.h" |
| 23 | #include "font.h" |
| 24 | #include <stdio.h> |
| 25 | #include <string.h> |
| 26 | |
Björn Stenberg | c6b3d38 | 2008-11-20 11:27:31 +0000 | [diff] [blame] | 27 | #include "bitmaps/rockboxlogo.h" |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 28 | |
Dave Chapman | da8bff1 | 2008-10-12 16:46:01 +0000 | [diff] [blame] | 29 | #if LCD_WIDTH <= 128 |
Dave Chapman | 5134612 | 2008-10-12 22:35:03 +0000 | [diff] [blame] | 30 | #define BOOT_VERSION ("Boot " APPSVERSION) |
Dave Chapman | da8bff1 | 2008-10-12 16:46:01 +0000 | [diff] [blame] | 31 | #else |
Dave Chapman | 5134612 | 2008-10-12 22:35:03 +0000 | [diff] [blame] | 32 | #define BOOT_VERSION ("Boot Ver. " APPSVERSION) |
Dave Chapman | da8bff1 | 2008-10-12 16:46:01 +0000 | [diff] [blame] | 33 | #endif |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 34 | |
Dave Chapman | 5134612 | 2008-10-12 22:35:03 +0000 | [diff] [blame] | 35 | /* Ensure TEXT_XPOS is >= 0 */ |
| 36 | #define TEXT_WIDTH ((sizeof(BOOT_VERSION)-1)*SYSFONT_WIDTH) |
| 37 | #define TEXT_XPOS ((TEXT_WIDTH > LCD_WIDTH) ? 0 : ((LCD_WIDTH - TEXT_WIDTH) / 2)) |
| 38 | |
| 39 | int show_logo( void ) |
| 40 | { |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 41 | lcd_clear_display(); |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 42 | lcd_setfont(FONT_SYSFIXED); |
Dave Chapman | 5134612 | 2008-10-12 22:35:03 +0000 | [diff] [blame] | 43 | |
| 44 | #ifdef SANSA_CLIP |
| 45 | /* The top 16 lines of the Sansa Clip screen are yellow, and the bottom 48 |
| 46 | are blue, so we reverse the usual positioning */ |
| 47 | lcd_putsxy(TEXT_XPOS, 0, BOOT_VERSION); |
| 48 | lcd_bitmap(rockboxlogo, 0, 16, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo); |
| 49 | #else |
| 50 | lcd_bitmap(rockboxlogo, 0, 10, BMPWIDTH_rockboxlogo, BMPHEIGHT_rockboxlogo); |
| 51 | lcd_putsxy(TEXT_XPOS, LCD_HEIGHT-SYSFONT_HEIGHT, BOOT_VERSION); |
| 52 | #endif |
Barry Wardell | 536d2fe | 2008-05-05 12:12:55 +0000 | [diff] [blame] | 53 | |
| 54 | lcd_update(); |
| 55 | |
| 56 | return 0; |
| 57 | } |