1
0
Fork 0
forked from len0rd/rockbox

Now supports charcell display

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@647 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-05-21 15:03:43 +00:00
parent 8cbedc3793
commit d1d5f95488
2 changed files with 37 additions and 31 deletions

View file

@ -21,10 +21,12 @@
#include "lcd.h" #include "lcd.h"
#include "kernel.h" #include "kernel.h"
#define DISPLAY_TIME 200 struct credit {
char *name;
char *desc;
};
struct credit credits[CREDIT_COUNT] = { struct credit credits[] = {
{ "[Credits]", "" },
{ "Bjorn Stenberg", "Originator, project manager, code" }, { "Bjorn Stenberg", "Originator, project manager, code" },
{ "Linus Nielsen Feltzing", "Electronics, code" }, { "Linus Nielsen Feltzing", "Electronics, code" },
{ "Andy Choi", "Checksums" }, { "Andy Choi", "Checksums" },
@ -47,38 +49,49 @@ struct credit credits[CREDIT_COUNT] = {
{ "Stefan Meyer", "Code" }, { "Stefan Meyer", "Code" },
}; };
#ifdef HAVE_LCD_BITMAP
#define MAX_LINES 6
#define DISPLAY_TIME HZ*2
#else
#define MAX_LINES 2
#define DISPLAY_TIME HZ
#endif
void show_credits(void) void show_credits(void)
{ {
int i = 0; int i,j;
int line = 0; int line = 0;
lcd_clear_display(); lcd_clear_display();
#ifdef HAVE_LCD_BITMAP
lcd_setmargins(0,9);
#endif
while(i < CREDIT_COUNT-1) { for ( i=0; i<sizeof(credits)/sizeof(struct credit); i++ ) {
if ((line % 4 == 0) && (line!=0)) { #ifdef HAVE_LCD_BITMAP
lcd_puts(0, 0, (char *)credits[0].name); lcd_putsxy(0, 0, " [Credits]",0);
#endif
lcd_puts(0, line, credits[i].name);
line++;
if ( line == MAX_LINES ) {
lcd_update(); lcd_update();
sleep(DISPLAY_TIME); /* abort on keypress */
for ( j=0;j<10;j++ ) {
sleep(DISPLAY_TIME/10);
if (button_get())
return;
}
lcd_clear_display(); lcd_clear_display();
line=0; line=0;
} }
lcd_puts(0, ++line, (char *)credits[++i].name);
} }
if ( line != MAX_LINES ) {
if ((i-1)%4 != 0) {
lcd_puts(0, 0, (char *)credits[0].name);
lcd_update(); lcd_update();
sleep(DISPLAY_TIME); /* abort on keypress */
lcd_clear_display(); for ( j=0;j<10;j++ ) {
sleep(DISPLAY_TIME/10);
if (button_get())
return;
}
} }
} }

View file

@ -20,13 +20,6 @@
#ifndef __ROCKBOX_CREDITS_H__ #ifndef __ROCKBOX_CREDITS_H__
#define __ROCKBOX_CREDITS_H__ #define __ROCKBOX_CREDITS_H__
#define CREDIT_COUNT 21
struct credit {
const char *name;
const char *desc;
};
/* Show who worked on the project */ /* Show who worked on the project */
void show_credits(void); void show_credits(void);