summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-09-02 05:39:09 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-09-02 05:39:09 +0000
commit60895bc107f5689f19de61828d8ffe0f2f1f59b5 (patch)
tree0141dc6cada785f2c7c6b6655820567432c353ec
parent58e9412bff9947e4514c0d55152bfad91049a60c (diff)
downloadrockbox-60895bc107f5689f19de61828d8ffe0f2f1f59b5.tar.gz
rockbox-60895bc107f5689f19de61828d8ffe0f2f1f59b5.zip
Patch #1272052 by Henrik Backe - Move credits to a plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7450 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/Makefile11
-rw-r--r--apps/SOURCES1
-rw-r--r--apps/credits.h28
-rw-r--r--apps/main.c1
-rw-r--r--apps/main_menu.c71
-rw-r--r--apps/main_menu.h1
-rw-r--r--apps/misc.c53
-rw-r--r--apps/misc.h1
-rw-r--r--apps/plugin.c3
-rw-r--r--apps/plugin.h7
-rw-r--r--apps/plugins/Makefile11
-rw-r--r--apps/plugins/SOURCES1
-rw-r--r--apps/plugins/clock.c12
-rw-r--r--apps/plugins/credits.c (renamed from apps/credits.c)94
-rw-r--r--apps/plugins/credits.pl (renamed from apps/credits.pl)0
15 files changed, 140 insertions, 155 deletions
diff --git a/apps/Makefile b/apps/Makefile
index 5cf1ebd8a2..04e0e87728 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -152,15 +152,6 @@ $(BUILDDIR)/rombox.ucl: $(OBJDIR)/rombox.bin $(MAXOUTFILE)
152 echo "fake" > $@; \ 152 echo "fake" > $@; \
153 fi 153 fi
154 154
155$(OBJDIR)/credits.raw: $(DOCSDIR)/CREDITS
156 @echo "create credits.raw"
157 @perl credits.pl < $< > $@
158
159$(OBJDIR)/credits.o: credits.c credits.h $(OBJDIR)/credits.raw
160 @mkdir -p `dirname $@`
161 @echo "CC $<"
162 @$(CC) $(CFLAGS) -c $< -o $@
163
164include $(TOOLSDIR)/make.inc 155include $(TOOLSDIR)/make.inc
165 156
166$(OBJDIR)/build.lang: lang/$(LANGUAGE).lang $(TOOLSDIR)/uplang 157$(OBJDIR)/build.lang: lang/$(LANGUAGE).lang $(TOOLSDIR)/uplang
@@ -180,7 +171,7 @@ clean:
180 @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/rockbox.asm \ 171 @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/rockbox.asm \
181 $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/*.map \ 172 $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.elf $(OBJDIR)/*.map \
182 $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(BUILDDIR)/lang.[ch] \ 173 $(OBJDIR)/lang.o $(OBJDIR)/build.lang $(BUILDDIR)/lang.[ch] \
183 $(OBJDIR)/credits.raw $(LINKFILE) $(BUILDDIR)/rockbox.ucl $(LINKROM) \ 174 $(LINKFILE) $(BUILDDIR)/rockbox.ucl $(LINKROM) \
184 $(BUILDDIR)/rombox.ucl $(OBJDIR)/rombox.bin $(OBJDIR)/rombox.elf \ 175 $(BUILDDIR)/rombox.ucl $(OBJDIR)/rombox.bin $(OBJDIR)/rombox.elf \
185 $(MAXOUTFILE) $(DEPFILE) 176 $(MAXOUTFILE) $(DEPFILE)
186 @$(MAKE) -C plugins clean OBJDIR=$(OBJDIR)/plugins 177 @$(MAKE) -C plugins clean OBJDIR=$(OBJDIR)/plugins
diff --git a/apps/SOURCES b/apps/SOURCES
index 063abe34d7..26af159d5a 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -4,7 +4,6 @@ logfdisp.c
4alarm_menu.c 4alarm_menu.c
5abrepeat.c 5abrepeat.c
6bookmark.c 6bookmark.c
7credits.c
8debug_menu.c 7debug_menu.c
9filetypes.c 8filetypes.c
10language.c 9language.c
diff --git a/apps/credits.h b/apps/credits.h
deleted file mode 100644
index dd4b459326..0000000000
--- a/apps/credits.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Robert Hak <rhak at ramapo.edu>
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef __ROCKBOX_CREDITS_H__
21#define __ROCKBOX_CREDITS_H__
22
23/* Show who worked on the project */
24void roll_credits(void);
25
26#endif
27
28
diff --git a/apps/main.c b/apps/main.c
index 6373920c74..c272dba57e 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -40,7 +40,6 @@
40#endif 40#endif
41#include "audio.h" 41#include "audio.h"
42#include "mp3_playback.h" 42#include "mp3_playback.h"
43#include "main_menu.h"
44#include "thread.h" 43#include "thread.h"
45#include "settings.h" 44#include "settings.h"
46#include "backlight.h" 45#include "backlight.h"
diff --git a/apps/main_menu.c b/apps/main_menu.c
index b887ed6504..deaeb9b2ec 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -22,13 +22,11 @@
22 22
23#include "menu.h" 23#include "menu.h"
24#include "tree.h" 24#include "tree.h"
25#include "credits.h"
26#include "lcd.h" 25#include "lcd.h"
27#include "font.h" 26#include "font.h"
28#include "button.h" 27#include "button.h"
29#include "kernel.h" 28#include "kernel.h"
30#include "main_menu.h" 29#include "main_menu.h"
31#include "version.h"
32#include "debug_menu.h" 30#include "debug_menu.h"
33#include "sprintf.h" 31#include "sprintf.h"
34#include <string.h> 32#include <string.h>
@@ -50,83 +48,20 @@
50#include "misc.h" 48#include "misc.h"
51#include "lang.h" 49#include "lang.h"
52#include "logfdisp.h" 50#include "logfdisp.h"
51#include "plugin.h"
52#include "filetypes.h"
53 53
54#ifdef HAVE_RECORDING 54#ifdef HAVE_RECORDING
55#include "recording.h" 55#include "recording.h"
56#endif 56#endif
57 57
58#ifdef HAVE_LCD_BITMAP
59#include "bmp.h"
60#include "icons.h"
61#endif /* End HAVE_LCD_BITMAP */
62
63#ifdef HAVE_REMOTE_LCD 58#ifdef HAVE_REMOTE_LCD
64#include "lcd-remote.h" 59#include "lcd-remote.h"
65#endif 60#endif
66 61
67int show_logo( void )
68{
69#ifdef HAVE_LCD_BITMAP
70 char version[32];
71 int font_h, font_w;
72
73 lcd_clear_display();
74#if LCD_WIDTH == 112 || LCD_WIDTH == 128
75 lcd_bitmap(rockbox112x37, 0, 10, 112, 37);
76#endif
77#if LCD_WIDTH >= 160
78 lcd_bitmap(rockbox160x53x2, 0, 10, 160, 53);
79#endif
80
81#ifdef HAVE_REMOTE_LCD
82 lcd_remote_clear_display();
83 lcd_remote_bitmap(rockbox112x37,10,14,112,37);
84#endif
85
86 snprintf(version, sizeof(version), "Ver. %s", appsversion);
87 lcd_setfont(FONT_SYSFIXED);
88 lcd_getstringsize("A", &font_w, &font_h);
89 lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
90 LCD_HEIGHT-font_h, version);
91 lcd_update();
92
93#ifdef HAVE_REMOTE_LCD
94 lcd_remote_setfont(FONT_SYSFIXED);
95 lcd_remote_getstringsize("A", &font_w, &font_h);
96 lcd_remote_putsxy((LCD_REMOTE_WIDTH/2) - ((strlen(version)*font_w)/2),
97 LCD_REMOTE_HEIGHT-font_h, version);
98 lcd_remote_update();
99#endif
100
101#else
102 char *rockbox = " ROCKbox!";
103 lcd_clear_display();
104 lcd_double_height(true);
105 lcd_puts(0, 0, rockbox);
106 lcd_puts(0, 1, appsversion);
107#endif
108
109 return 0;
110}
111
112bool show_credits(void) 62bool show_credits(void)
113{ 63{
114 int j = 0; 64 plugin_load("/.rockbox/rocks/credits.rock",NULL);
115 int btn;
116
117 show_logo();
118#ifdef HAVE_LCD_CHARCELLS
119 lcd_double_height(false);
120#endif
121
122 for (j = 0; j < 10; j++) {
123 sleep((HZ*2)/10);
124
125 btn = button_get(false);
126 if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
127 return false;
128 }
129 roll_credits();
130 return false; 65 return false;
131} 66}
132 67
diff --git a/apps/main_menu.h b/apps/main_menu.h
index f05cc52adc..d1c36b3663 100644
--- a/apps/main_menu.h
+++ b/apps/main_menu.h
@@ -21,7 +21,6 @@
21 21
22#include "menu.h" 22#include "menu.h"
23 23
24extern int show_logo(void);
25extern bool main_menu(void); 24extern bool main_menu(void);
26extern bool rec_menu(void); 25extern bool rec_menu(void);
27 26
diff --git a/apps/misc.c b/apps/misc.c
index 6751da9d69..ddf8d06e7b 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -24,6 +24,7 @@
24#include "file.h" 24#include "file.h"
25#include "dir.h" 25#include "dir.h"
26#include "lcd.h" 26#include "lcd.h"
27#include "lcd-remote.h"
27#include "sprintf.h" 28#include "sprintf.h"
28#include "errno.h" 29#include "errno.h"
29#include "system.h" 30#include "system.h"
@@ -40,10 +41,17 @@
40#include "powermgmt.h" 41#include "powermgmt.h"
41#include "backlight.h" 42#include "backlight.h"
42#include "atoi.h" 43#include "atoi.h"
44#include "version.h"
45#include "font.h"
43#ifdef HAVE_MMC 46#ifdef HAVE_MMC
44#include "ata_mmc.h" 47#include "ata_mmc.h"
45#endif 48#endif
46 49
50#ifdef HAVE_LCD_BITMAP
51#include "bmp.h"
52#include "icons.h"
53#endif /* End HAVE_LCD_BITMAP */
54
47/* Format a large-range value for output, using the appropriate unit so that 55/* Format a large-range value for output, using the appropriate unit so that
48 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" 56 * the displayed value is in the range 1 <= display < 1000 (1024 for "binary"
49 * units) if possible, and 3 significant digits are shown. If a buffer is 57 * units) if possible, and 3 significant digits are shown. If a buffer is
@@ -482,3 +490,48 @@ long default_event_handler(long event)
482{ 490{
483 return default_event_handler_ex(event, NULL, NULL); 491 return default_event_handler_ex(event, NULL, NULL);
484} 492}
493
494int show_logo( void )
495{
496#ifdef HAVE_LCD_BITMAP
497 char version[32];
498 int font_h, font_w;
499
500 lcd_clear_display();
501#if LCD_WIDTH == 112 || LCD_WIDTH == 128
502 lcd_bitmap(rockbox112x37, 0, 10, 112, 37);
503#endif
504#if LCD_WIDTH >= 160
505 lcd_bitmap(rockbox160x53x2, 0, 10, 160, 53);
506#endif
507
508#ifdef HAVE_REMOTE_LCD
509 lcd_remote_clear_display();
510 lcd_remote_bitmap(rockbox112x37,10,14,112,37);
511#endif
512
513 snprintf(version, sizeof(version), "Ver. %s", appsversion);
514 lcd_setfont(FONT_SYSFIXED);
515 lcd_getstringsize("A", &font_w, &font_h);
516 lcd_putsxy((LCD_WIDTH/2) - ((strlen(version)*font_w)/2),
517 LCD_HEIGHT-font_h, version);
518 lcd_update();
519
520#ifdef HAVE_REMOTE_LCD
521 lcd_remote_setfont(FONT_SYSFIXED);
522 lcd_remote_getstringsize("A", &font_w, &font_h);
523 lcd_remote_putsxy((LCD_REMOTE_WIDTH/2) - ((strlen(version)*font_w)/2),
524 LCD_REMOTE_HEIGHT-font_h, version);
525 lcd_remote_update();
526#endif
527
528#else
529 char *rockbox = " ROCKbox!";
530 lcd_clear_display();
531 lcd_double_height(true);
532 lcd_puts(0, 0, rockbox);
533 lcd_puts(0, 1, appsversion);
534#endif
535
536 return 0;
537}
diff --git a/apps/misc.h b/apps/misc.h
index 5e7450a7b2..d637501c27 100644
--- a/apps/misc.h
+++ b/apps/misc.h
@@ -52,5 +52,6 @@ bool settings_parseline(char* line, char** name, char** value);
52long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); 52long default_event_handler_ex(long event, void (*callback)(void *), void *parameter);
53long default_event_handler(long event); 53long default_event_handler(long event);
54void car_adapter_mode_init(void); 54void car_adapter_mode_init(void);
55extern int show_logo(void);
55 56
56#endif 57#endif
diff --git a/apps/plugin.c b/apps/plugin.c
index c02a8e2936..7d3b13c726 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -98,6 +98,7 @@ static const struct plugin_api rockbox_api = {
98 lcd_put_cursor, 98 lcd_put_cursor,
99 lcd_remove_cursor, 99 lcd_remove_cursor,
100 PREFIX(lcd_icon), 100 PREFIX(lcd_icon),
101 lcd_double_height,
101#else 102#else
102#ifndef SIMULATOR 103#ifndef SIMULATOR
103 lcd_roll, 104 lcd_roll,
@@ -336,10 +337,10 @@ static const struct plugin_api rockbox_api = {
336#ifdef HAVE_LCD_BITMAP 337#ifdef HAVE_LCD_BITMAP
337 read_bmp_file, 338 read_bmp_file,
338#endif 339#endif
340 show_logo,
339 341
340 /* new stuff at the end, sort into place next time 342 /* new stuff at the end, sort into place next time
341 the API gets incompatible */ 343 the API gets incompatible */
342
343}; 344};
344 345
345int plugin_load(const char* plugin, void* parameter) 346int plugin_load(const char* plugin, void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index 2aa3e09475..01ace98690 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -44,6 +44,7 @@
44#include "mpeg.h" 44#include "mpeg.h"
45#include "audio.h" 45#include "audio.h"
46#include "mp3_playback.h" 46#include "mp3_playback.h"
47#include "misc.h"
47#if (HWCODEC == SWCODEC) 48#if (HWCODEC == SWCODEC)
48#include "pcm_playback.h" 49#include "pcm_playback.h"
49#endif 50#endif
@@ -88,12 +89,12 @@
88#endif 89#endif
89 90
90/* increase this every time the api struct changes */ 91/* increase this every time the api struct changes */
91#define PLUGIN_API_VERSION 49 92#define PLUGIN_API_VERSION 50
92 93
93/* update this to latest version if a change to the api struct breaks 94/* update this to latest version if a change to the api struct breaks
94 backwards compatibility (and please take the opportunity to sort in any 95 backwards compatibility (and please take the opportunity to sort in any
95 new function which are "waiting" at the end of the function table) */ 96 new function which are "waiting" at the end of the function table) */
96#define PLUGIN_MIN_API_VERSION 49 97#define PLUGIN_MIN_API_VERSION 50
97 98
98/* plugin return codes */ 99/* plugin return codes */
99enum plugin_status { 100enum plugin_status {
@@ -151,6 +152,7 @@ struct plugin_api {
151 void (*lcd_put_cursor)(int x, int y, char cursor_char); 152 void (*lcd_put_cursor)(int x, int y, char cursor_char);
152 void (*lcd_remove_cursor)(void); 153 void (*lcd_remove_cursor)(void);
153 void (*PREFIX(lcd_icon))(int icon, bool enable); 154 void (*PREFIX(lcd_icon))(int icon, bool enable);
155 void (*lcd_double_height)(bool on);
154#else 156#else
155#ifndef SIMULATOR 157#ifndef SIMULATOR
156 void (*lcd_roll)(int pixels); 158 void (*lcd_roll)(int pixels);
@@ -420,6 +422,7 @@ struct plugin_api {
420 int (*read_bmp_file)(char* filename, int *get_width, int *get_height, 422 int (*read_bmp_file)(char* filename, int *get_width, int *get_height,
421 char *bitmap, int maxsize); 423 char *bitmap, int maxsize);
422#endif 424#endif
425 int (*show_logo)(void);
423 426
424 /* new stuff at the end, sort into place next time 427 /* new stuff at the end, sort into place next time
425 the API gets incompatible */ 428 the API gets incompatible */
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 1f1c309bd2..96e57d3c76 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -50,6 +50,15 @@ endif
50.PHONY: $(SUBDIRS) 50.PHONY: $(SUBDIRS)
51all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE) 51all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
52 52
53$(BUILDDIR)/credits.raw: $(DOCSDIR)/CREDITS
54 @echo "create credits.raw"
55 @perl credits.pl < $< > $@
56
57$(OBJDIR)/credits.o: credits.c $(BUILDDIR)/credits.raw
58 @mkdir -p `dirname $@`
59 @echo "CC $<"
60 @$(CC) $(CFLAGS) -c $< -o $@
61
53ifndef SIMVER 62ifndef SIMVER
54$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a 63$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a
55 $(SILENT)(file=`basename $@`; \ 64 $(SILENT)(file=`basename $@`; \
@@ -117,7 +126,7 @@ $(SUBDIRS):
117clean: 126clean:
118 @echo "cleaning plugins" 127 @echo "cleaning plugins"
119 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \ 128 @rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
120 $(OBJS) $(DEFS) 129 $(BUILDDIR)/credits.raw $(OBJS) $(DEFS)
121 @$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib 130 @$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
122 @$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy 131 @$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
123 @$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine 132 @$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index cf62ee7203..254324164a 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -1,6 +1,7 @@
1/* plugins common to all models */ 1/* plugins common to all models */
2battery_test.c 2battery_test.c
3chessclock.c 3chessclock.c
4credits.c
4cube.c 5cube.c
5favorites.c 6favorites.c
6firmware_flash.c 7firmware_flash.c
diff --git a/apps/plugins/clock.c b/apps/plugins/clock.c
index 6830c74d53..6b06b1a74e 100644
--- a/apps/plugins/clock.c
+++ b/apps/plugins/clock.c
@@ -91,7 +91,7 @@ Original release, featuring analog / digital modes and a few options.
91/************ 91/************
92 * Prototypes 92 * Prototypes
93 ***********/ 93 ***********/
94void show_logo(bool animate, bool show_clock_text); 94void show_clock_logo(bool animate, bool show_clock_text);
95void exit_logo(void); 95void exit_logo(void);
96void save_settings(bool interface); 96void save_settings(bool interface);
97 97
@@ -461,7 +461,7 @@ void save_settings(bool interface)
461 rb->snprintf(buf, sizeof(buf), "Saving Settings"); 461 rb->snprintf(buf, sizeof(buf), "Saving Settings");
462 rb->lcd_getstringsize(buf, &buf_w, &buf_h); 462 rb->lcd_getstringsize(buf, &buf_w, &buf_h);
463 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); 463 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf);
464 show_logo(true, true); 464 show_clock_logo(true, true);
465 465
466 rb->lcd_update(); 466 rb->lcd_update();
467 } 467 }
@@ -523,7 +523,7 @@ void load_settings(void)
523 rb->snprintf(buf, sizeof(buf), "Loading Settings"); 523 rb->snprintf(buf, sizeof(buf), "Loading Settings");
524 rb->lcd_getstringsize(buf, &buf_w, &buf_h); 524 rb->lcd_getstringsize(buf, &buf_w, &buf_h);
525 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); 525 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf);
526 show_logo(true, true); 526 show_clock_logo(true, true);
527 rb->lcd_update(); 527 rb->lcd_update();
528 528
529 if(fd >= 0) /* does file exist? */ 529 if(fd >= 0) /* does file exist? */
@@ -1020,7 +1020,7 @@ void binary(int hour, int minute, int second)
1020/**************** 1020/****************
1021 * Shows the logo 1021 * Shows the logo
1022 ***************/ 1022 ***************/
1023void show_logo(bool animate, bool show_clock_text) 1023void show_clock_logo(bool animate, bool show_clock_text)
1024{ 1024{
1025 int y_position; 1025 int y_position;
1026 1026
@@ -1151,7 +1151,7 @@ bool roll_credits(void)
1151 { 1151 {
1152 rb->lcd_clear_display(); 1152 rb->lcd_clear_display();
1153 1153
1154 show_logo(false, false); 1154 show_clock_logo(false, false);
1155 1155
1156 rb->snprintf(elapsednames, sizeof(elapsednames), "[Credits] %02d/%02d", j+1, numnames); 1156 rb->snprintf(elapsednames, sizeof(elapsednames), "[Credits] %02d/%02d", j+1, numnames);
1157 rb->lcd_putsxy(credits_pos-1, 0, elapsednames); 1157 rb->lcd_putsxy(credits_pos-1, 0, elapsednames);
@@ -1299,7 +1299,7 @@ bool show_credits(void)
1299 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf); 1299 rb->lcd_putsxy(LCD_WIDTH/2-buf_w/2, 56, buf);
1300 1300
1301 /* show the logo with an animation and the clock version text */ 1301 /* show the logo with an animation and the clock version text */
1302 show_logo(true, true); 1302 show_clock_logo(true, true);
1303 1303
1304 rb->lcd_update(); 1304 rb->lcd_update();
1305 1305
diff --git a/apps/credits.c b/apps/plugins/credits.c
index 9acc90da19..f172cc6c18 100644
--- a/apps/credits.c
+++ b/apps/plugins/credits.c
@@ -1,10 +1,10 @@
1/*************************************************************************** 1/***************************************************************************
2 * __________ __ ___. 2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2002 by Robert Hak <rhak at ramapo.edu> 10 * Copyright (C) 2002 by Robert Hak <rhak at ramapo.edu>
@@ -16,33 +16,55 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "plugin.h"
19 20
20#include "credits.h" 21void roll_credits(void);
21#include "lcd.h"
22#include "font.h"
23#include "kernel.h"
24#include "button.h"
25#include "sprintf.h"
26#include "string.h"
27
28const char* const credits[] = { 22const char* const credits[] = {
29#include "credits.raw" /* generated list of names from docs/CREDITS */ 23#include "credits.raw" /* generated list of names from docs/CREDITS */
30}; 24};
31 25
26static struct plugin_api* rb;
27
28enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
29{
30 int j = 0;
31 int btn;
32
33 TEST_PLUGIN_API(api);
34 (void)parameter;
35 rb = api;
36
37 rb->show_logo();
38#ifdef HAVE_LCD_CHARCELLS
39 rb->lcd_double_height(false);
40#endif
41
42 for (j = 0; j < 10; j++) {
43 rb->sleep((HZ*2)/10);
44
45 btn = rb->button_get(false);
46 if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
47 return PLUGIN_OK;
48 }
49
50 roll_credits();
51
52 return PLUGIN_OK;
53}
54
32#ifdef HAVE_LCD_CHARCELLS 55#ifdef HAVE_LCD_CHARCELLS
33#define MAX(x, y) ((x) > (y) ? (x) : (y))
34void roll_credits(void) 56void roll_credits(void)
35{ 57{
36 int numnames = sizeof(credits)/sizeof(char*); 58 int numnames = sizeof(credits)/sizeof(char*);
37 int curr_name = 0; 59 int curr_name = 0;
38 int curr_len = strlen(credits[0]); 60 int curr_len = rb->strlen(credits[0]);
39 int curr_index = 0; 61 int curr_index = 0;
40 int curr_line = 0; 62 int curr_line = 0;
41 int name, len, new_len, line, x; 63 int name, len, new_len, line, x;
42 64
43 while (1) 65 while (1)
44 { 66 {
45 lcd_clear_display(); 67 rb->lcd_clear_display();
46 68
47 name = curr_name; 69 name = curr_name;
48 x = -curr_index; 70 x = -curr_index;
@@ -54,31 +76,31 @@ void roll_credits(void)
54 int x2; 76 int x2;
55 77
56 if (x < 0) 78 if (x < 0)
57 lcd_puts(0, line, credits[name] - x); 79 rb->lcd_puts(0, line, credits[name] - x);
58 else 80 else
59 lcd_puts(x, line, credits[name]); 81 rb->lcd_puts(x, line, credits[name]);
60 82
61 if (++name >= numnames) 83 if (++name >= numnames)
62 break; 84 break;
63 line ^= 1; 85 line ^= 1;
64 86
65 x2 = x + len/2; 87 x2 = x + len/2;
66 if ((unsigned)x2 < 11) 88 if ((unsigned)x2 < 11)
67 lcd_putc(x2, line, '*'); 89 rb->lcd_putc(x2, line, '*');
68 90
69 new_len = strlen(credits[name]); 91 new_len = rb->strlen(credits[name]);
70 x += MAX(len/2 + 2, len - new_len/2 + 1); 92 x += MAX(len/2 + 2, len - new_len/2 + 1);
71 len = new_len; 93 len = new_len;
72 } 94 }
73 /* abort on keypress */ 95 /* abort on keypress */
74 if (button_get_w_tmo(HZ/8) & BUTTON_REL) 96 if (rb->button_get_w_tmo(HZ/8) & BUTTON_REL)
75 return; 97 return;
76 98
77 if (++curr_index >= curr_len) 99 if (++curr_index >= curr_len)
78 { 100 {
79 if (++curr_name >= numnames) 101 if (++curr_name >= numnames)
80 break; 102 break;
81 new_len = strlen(credits[curr_name]); 103 new_len = rb->strlen(credits[curr_name]);
82 curr_index -= MAX(curr_len/2 + 2, curr_len - new_len/2 + 1); 104 curr_index -= MAX(curr_len/2 + 2, curr_len - new_len/2 + 1);
83 curr_len = new_len; 105 curr_len = new_len;
84 curr_line ^= 1; 106 curr_line ^= 1;
@@ -98,24 +120,24 @@ void roll_credits(void)
98 120
99 int height; 121 int height;
100 int width; 122 int width;
101
102 lcd_setfont(FONT_UI);
103 123
104 lcd_getstringsize("A", &width, &height); 124 rb->lcd_setfont(FONT_UI);
125
126 rb->lcd_getstringsize("A", &width, &height);
105 127
106 while(1) { 128 while(1) {
107 lcd_clear_display(); 129 rb->lcd_clear_display();
108 for ( i=0; i <= (LCD_HEIGHT-y)/height; i++ ) 130 for ( i=0; i <= (LCD_HEIGHT-y)/height; i++ )
109 lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:""); 131 rb->lcd_putsxy(0, i*height+y, line+i<numnames?credits[line+i]:"");
110 snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d ", 132 rb->snprintf(buffer, sizeof(buffer), " [Credits] %2d/%2d ",
111 line+1, numnames); 133 line+1, numnames);
112 lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 134 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
113 lcd_fillrect(0, 0, LCD_WIDTH, height); 135 rb->lcd_fillrect(0, 0, LCD_WIDTH, height);
114 lcd_set_drawmode(DRMODE_SOLID); 136 rb->lcd_set_drawmode(DRMODE_SOLID);
115 lcd_putsxy(0, 0, buffer); 137 rb->lcd_putsxy(0, 0, buffer);
116 lcd_update(); 138 rb->lcd_update();
117 139
118 if (button_get_w_tmo(HZ/20) & BUTTON_REL) 140 if (rb->button_get_w_tmo(HZ/20) & BUTTON_REL)
119 return; 141 return;
120 142
121 y--; 143 y--;
diff --git a/apps/credits.pl b/apps/plugins/credits.pl
index 942a96b99f..942a96b99f 100644
--- a/apps/credits.pl
+++ b/apps/plugins/credits.pl