summaryrefslogtreecommitdiffstats
path: root/apps/credits.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-05 17:58:27 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-05 17:58:27 +0000
commit3fdb3607df325c11738834d101535fb82823b598 (patch)
treedf4b508452e8211de22ffd0dcc3b3a8d1f1b6c89 /apps/credits.c
parent52681472c8a0105d8a0d2b73e547edcb7a8a0a8e (diff)
downloadrockbox-3fdb3607df325c11738834d101535fb82823b598.tar.gz
rockbox-3fdb3607df325c11738834d101535fb82823b598.zip
Credits gone movie-style! ;-)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2189 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/credits.c')
-rw-r--r--apps/credits.c61
1 files changed, 45 insertions, 16 deletions
diff --git a/apps/credits.c b/apps/credits.c
index 4d24800e06..0325a6f4fe 100644
--- a/apps/credits.c
+++ b/apps/credits.c
@@ -21,6 +21,7 @@
#include "lcd.h"
#include "kernel.h"
#include "button.h"
+#include "sprintf.h"
char* credits[] = {
"Bjorn Stenberg",
@@ -73,39 +74,67 @@ char* credits[] = {
#define DISPLAY_TIME HZ
#endif
+#ifdef HAVE_LCD_CHARCELLS
void roll_credits(void)
{
int i;
- int j;
int line = 0;
int numnames = sizeof(credits)/sizeof(char*);
lcd_clear_display();
-#ifdef HAVE_LCD_BITMAP
- lcd_setmargins(0,8);
-#endif
-
for ( i=0; i < numnames; i += MAX_LINES )
{
lcd_clear_display();
-#ifdef HAVE_LCD_BITMAP
- lcd_putsxy(0, 0, " [Credits]",0);
-#endif
for(line = 0;line < MAX_LINES && line+i < numnames;line++)
{
lcd_puts(0, line, credits[line+i]);
}
- lcd_update();
-
/* abort on keypress */
- for ( j=0;j<10;j++ )
- {
- sleep(DISPLAY_TIME/10);
- if (button_get(false))
- return;
- }
+ if (button_get_w_tmo(DISPLAY_TIME))
+ return;
}
return;
}
+#else
+
+void roll_credits(void)
+{
+ int i;
+ int line = 0;
+ int numnames = sizeof(credits)/sizeof(char*);
+ char buffer[40];
+
+ int y=64;
+
+ int height;
+ int width;
+
+ lcd_getfontsize(0, &width, &height);
+
+ while(1) {
+ lcd_clear_display();
+ for ( i=0; i <= (64-y)/height; i++ )
+ lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"", 0);
+ snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d ",
+ line+1, numnames);
+ lcd_putsxy(0, 0, buffer, 0);
+ lcd_update();
+
+ if (button_get_w_tmo(HZ/10))
+ return;
+
+ y-=2;
+
+ if(y<0) {
+ line++;
+ if(line >= numnames)
+ break;
+ y+=8;
+ }
+
+ }
+ return;
+}
+#endif