1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Björn Stenberg
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
26 #include "main_menu.h"
28 #include "debug_menu.h"
33 #include "settings_menu.h"
35 #include "powermgmt.h"
36 #include "sound_menu.h"
38 #ifdef HAVE_LCD_BITMAP
39 #include "games_menu.h"
40 #include "screensavers_menu.h"
47 #ifdef HAVE_LCD_BITMAP
49 unsigned char *ptr
=rockbox112x37
;
50 int height
, i
, font_h
, font_w
;
54 for(i
=0; i
< 37; i
+=8) {
55 /* the bitmap function doesn't work with full-height bitmaps
56 so we "stripe" the logo output */
57 lcd_bitmap(ptr
, 0, 10+i
, 112, (37-i
)>8?8:37-i
, false);
64 * This code is not used anymore, but I kept it here since it shows
65 * one way of using the BMP reader function to display an externally
68 unsigned char buffer
[112 * 8];
75 failure
= read_bmp_file("/rockbox112.bmp", &width
, &height
, buffer
);
77 debugf("read_bmp_file() returned %d, width %d height %d\n",
78 failure
, width
, height
);
80 for(i
=0, eline
=0; i
< height
; i
+=8, eline
++) {
81 /* the bitmap function doesn't work with full-height bitmaps
82 so we "stripe" the logo output */
83 lcd_bitmap(&buffer
[eline
*width
], 0, 10+i
, width
,
84 (height
-i
)>8?8:height
-i
, false);
89 snprintf(version
, sizeof(version
), "Ver. %s", appsversion
);
90 lcd_getfontsize(0, &font_w
, &font_h
);
91 lcd_putsxy((LCD_WIDTH
/2) - ((strlen(version
)*font_w
)/2),
92 height
+10+font_h
, version
, 0);
96 char *rockbox
= "ROCKbox!";
98 #ifdef HAVE_NEW_CHARCELL_LCD
99 lcd_double_height(true);
101 lcd_puts(0, 0, rockbox
);
102 lcd_puts(0, 1, appsversion
);
108 Menu
show_credits(void)
114 #ifdef HAVE_NEW_CHARCELL_LCD
115 lcd_double_height(false);
118 for (j
= 0; j
< 10; j
++) {
121 btn
= button_get(false);
122 if (btn
!= BUTTON_NONE
&& !(btn
& BUTTON_REL
))
133 extern Menu
simulate_usb(void);
135 /* defined in linker script */
136 extern unsigned char mp3buf
[];
137 extern unsigned char mp3end
[];
142 int buflen
= ((mp3end
- mp3buf
) * 100) / 0x100000;
143 int integer
, decimal
;
149 lcd_puts(0, 0, "Rockbox info:");
151 integer
= buflen
/ 100;
152 decimal
= buflen
% 100;
153 #ifdef HAVE_LCD_CHARCELLS
154 snprintf(s
, sizeof(s
), "Buf: %d.%02dMb", integer
, decimal
);
157 snprintf(s
, sizeof(s
), "Buffer: %d.%02d Mb", integer
, decimal
);
161 #ifdef HAVE_LCD_CHARCELLS
162 snprintf(s
, sizeof(s
), "Batt: %d%%%s", battery_level(), battery_level_safe() ? "" : "!");
165 #ifdef HAVE_CHARGE_CTRL
167 snprintf(s
, sizeof(s
), "Battery: charging");
169 snprintf(s
, sizeof(s
), "Battery: %d%%%s", battery_level(), battery_level_safe() ? "" : " !!");
172 snprintf(s
, sizeof(s
), "Battery: %d%%%s", battery_level(), battery_level_safe() ? "" : " !!");
181 /* Wait for a key to be pushed */
182 if(button_get(false) & ~BUTTON_REL
)
195 struct menu_items items
[] = {
196 { "Sound Settings", sound_menu
},
197 { "General Settings", settings_menu
},
198 #ifdef HAVE_LCD_BITMAP
199 { "Games", games_menu
},
200 { "Screensavers", screensavers_menu
},
202 { "Info", show_info
},
203 { "Version", show_credits
},
205 { "Debug (keep out!)", debug_menu
},
207 { "USB (sim)", simulate_usb
},
211 m
=menu_init( items
, sizeof items
/ sizeof(struct menu_items
) );
212 #ifdef HAVE_LCD_CHARCELLS
213 lcd_icon(ICON_PARAM
, true);
215 result
= menu_run(m
);
216 #ifdef HAVE_LCD_CHARCELLS
217 lcd_icon(ICON_PARAM
, false);