forked from len0rd/rockbox
Fixed credits roll, and improved animations. Revised the release notes as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4893 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7e5e568678
commit
97d1d15bd8
1 changed files with 61 additions and 105 deletions
|
@ -5,7 +5,7 @@
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id: clock.c,v 2.0 2003/12/8
|
* $Id: clock.c,v 2.31 2003/12/8
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003 Zakk Roberts
|
* Copyright (C) 2003 Zakk Roberts
|
||||||
*
|
*
|
||||||
|
@ -17,89 +17,51 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/********************************
|
/*****************************
|
||||||
RELEASE NOTES *******************
|
* RELEASE NOTES
|
||||||
*********************************
|
|
||||||
|
|
||||||
*********************************
|
***** VERSION 2.31 **
|
||||||
VERSION 2.3 * STABLE ************
|
Fixed credits roll - now displays all names. Features
|
||||||
*********************************
|
improved animations. Also revised release notes.
|
||||||
Tab indentation removed
|
|
||||||
Counter screen added at ON+F2, with countdown options
|
|
||||||
|
|
||||||
*********************************
|
***** VERSION 2.30 **
|
||||||
VERSION 2.22 * STABLE ***********
|
Tab indentation removed, and -Counter screen added
|
||||||
*********************************
|
at ON+F2, with countdown options
|
||||||
|
|
||||||
|
***** VERSION 2.22 **
|
||||||
Fixed two bugs:
|
Fixed two bugs:
|
||||||
Digital settings are now independent of LCD settings
|
Digital settings are now independent of LCD settings
|
||||||
12/24h "Analog" settings are now displayed correctly.
|
12/24h "Analog" settings are now displayed correctly.
|
||||||
|
|
||||||
*********************************
|
***** VERSION 2.21 **
|
||||||
VERSION 2.21 * STABLE ***********
|
-Changed the behaviour of F2
|
||||||
*********************************
|
|
||||||
Changed the behaviour of F2
|
|
||||||
|
|
||||||
********************************
|
***** VERSION 2.20 **
|
||||||
VERSION 2.2 * STABLE ***********
|
Few small bugs taken care of. New features: -New binary mode,
|
||||||
********************************
|
-new mode selector, -new feature, "counter", and -redesigned help screen.
|
||||||
Few small bugs taken care of.
|
|
||||||
Release version.
|
|
||||||
|
|
||||||
Features:
|
***** VERSION 2.10 **
|
||||||
-New mode, "Binary"
|
New bug fixes, and some new features: -an LCD imitation mode, and
|
||||||
-New mode selector - access via PLAY
|
-American and European date modes are an option.
|
||||||
-New feature, "Counter" - F2 to start/stop, Hold F2 to reset.
|
|
||||||
-New redesigned 9-page help screen.
|
|
||||||
-Small bugs fixed.
|
|
||||||
|
|
||||||
*********************************
|
***** VERSION 2.00 [BETA] **
|
||||||
VERSION 2.1 * STABLE ************
|
Major update, lots of bugfixes and new features.
|
||||||
*********************************
|
New Features: -Fullscreen mode introduced, -modes have independent
|
||||||
Even more bugs fixed. Almost bug-free :)
|
settings, -credit roll added, -options screen reworked, -logo selector,
|
||||||
|
and -much- cleaner code. Analog changes include: -removed border option,
|
||||||
Features:
|
and -added both 12/24h time readouts. Digital changes include: -centered
|
||||||
-Another new mode!! LCD imitation (similar to Digital)
|
second and date readouts and also -introduced two new additional ways
|
||||||
-American/European date modes added
|
of graphically conveying second progress: a bar, and a LCD-invert mode.
|
||||||
-lots of bugs fixed
|
|
||||||
|
|
||||||
*********************************
|
|
||||||
VERSION 2.0: * BETA *************
|
|
||||||
*********************************
|
|
||||||
|
|
||||||
Major update. Code pretty much rewritten. Lots of bugs fixed.
|
|
||||||
|
|
||||||
New Features: *******************
|
|
||||||
-New mode, Fullscreen!
|
|
||||||
-Seperate settings for each mode
|
|
||||||
-Credits at F2
|
|
||||||
-Options at F3
|
|
||||||
-Startup / Shutdown logo (choose one by hitting ON)
|
|
||||||
-CLEANER code!
|
|
||||||
|
|
||||||
Analog specific changes: ********
|
|
||||||
-removed outer border option
|
|
||||||
-added 12/24h readout (and am/pm bitmaps for 12h mode)
|
|
||||||
|
|
||||||
Digital specific changes: *******
|
|
||||||
-now centers date and second readouts
|
|
||||||
-second readout options, "Digital" (text), "Bar" (progressbar), "Inverse" (inverts the display as the seconds go by)
|
|
||||||
-12/24h modes as well here (and of course the am/pm bitmaps)
|
|
||||||
|
|
||||||
********************************
|
|
||||||
VERSION 1.0 * "ALPHA" (STABLE) *
|
|
||||||
********************************
|
|
||||||
Release Version.
|
|
||||||
|
|
||||||
Features analog / digital modes,
|
|
||||||
and a few options.
|
|
||||||
********************************/
|
|
||||||
|
|
||||||
|
***** VERSION 1.0 **
|
||||||
|
Original release, featuring analog / digital modes and a few options.
|
||||||
|
*****************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "time.h"
|
#include "time.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
#define CLOCK_VERSION "2.3"
|
#define CLOCK_VERSION "2.31"
|
||||||
|
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
void show_logo(bool animate, bool show_clock_text);
|
void show_logo(bool animate, bool show_clock_text);
|
||||||
|
@ -1096,16 +1058,8 @@ void binary(int hour, int minute, int second)
|
||||||
void show_logo(bool animate, bool show_clock_text)
|
void show_logo(bool animate, bool show_clock_text)
|
||||||
{
|
{
|
||||||
int x_position;
|
int x_position;
|
||||||
unsigned char *clogo = 0;
|
|
||||||
|
|
||||||
/* decide which logo we're using - usually #4 */
|
unsigned char *clogo = 0;
|
||||||
if(logo == 1)
|
|
||||||
clogo = (unsigned char *)clocklogo_1;
|
|
||||||
else if(logo == 2)
|
|
||||||
clogo = (unsigned char *)clocklogo_2;
|
|
||||||
else if(logo == 3)
|
|
||||||
clogo = (unsigned char *)clocklogo_3;
|
|
||||||
else
|
|
||||||
clogo = (unsigned char *)clocklogo_4;
|
clogo = (unsigned char *)clocklogo_4;
|
||||||
|
|
||||||
/* animate logo */
|
/* animate logo */
|
||||||
|
@ -1157,14 +1111,6 @@ void exit_logo(void)
|
||||||
int x_position;
|
int x_position;
|
||||||
|
|
||||||
unsigned char *clogo = 0;
|
unsigned char *clogo = 0;
|
||||||
|
|
||||||
if(logo == 1)
|
|
||||||
clogo = (unsigned char *)clocklogo_1;
|
|
||||||
else if(logo == 2)
|
|
||||||
clogo = (unsigned char *)clocklogo_2;
|
|
||||||
else if(logo == 3)
|
|
||||||
clogo = (unsigned char *)clocklogo_3;
|
|
||||||
else
|
|
||||||
clogo = (unsigned char *)clocklogo_4;
|
clogo = (unsigned char *)clocklogo_4;
|
||||||
|
|
||||||
/* fly downwards */
|
/* fly downwards */
|
||||||
|
@ -1176,9 +1122,9 @@ void exit_logo(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************
|
/********************
|
||||||
* Rolls the credits
|
* Rolls the credits
|
||||||
******************/
|
********************/
|
||||||
/* The following function is pretty confusing, so
|
/* The following function is pretty confusing, so
|
||||||
* it's extra well commented. */
|
* it's extra well commented. */
|
||||||
bool roll_credits(void)
|
bool roll_credits(void)
|
||||||
|
@ -1203,7 +1149,7 @@ bool roll_credits(void)
|
||||||
|
|
||||||
show_logo(false, false);
|
show_logo(false, false);
|
||||||
|
|
||||||
rb->snprintf(elapsednames, sizeof(elapsednames), "[Credits] %d/%d", j+1, numnames);
|
rb->snprintf(elapsednames, sizeof(elapsednames), "[Credits] %02d/%02d", j+1, numnames);
|
||||||
rb->lcd_puts(0, 0, elapsednames);
|
rb->lcd_puts(0, 0, elapsednames);
|
||||||
|
|
||||||
/* used to center the text */
|
/* used to center the text */
|
||||||
|
@ -1213,10 +1159,10 @@ bool roll_credits(void)
|
||||||
rb->lcd_getstringsize(job, &job_w, &job_h);
|
rb->lcd_getstringsize(job, &job_w, &job_h);
|
||||||
|
|
||||||
/* line 1 flies in */
|
/* line 1 flies in */
|
||||||
for (namepos=0; namepos < LCD_WIDTH/2-name_w/2; namepos++)
|
for (namepos=0-name_w; namepos < (LCD_WIDTH/2)-(name_w/2)-2; namepos++)
|
||||||
{
|
{
|
||||||
rb->lcd_clearrect(0, 48, 112, 8); /* clear any trails left behind */
|
rb->lcd_clearrect(0, 48, 112, 8); /* clear any trails left behind */
|
||||||
rb->lcd_putsxy(namepos, 48, name); /* show their name */
|
rb->lcd_putsxy(namepos, 48, name);
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
/* exit on keypress */
|
/* exit on keypress */
|
||||||
|
@ -1226,10 +1172,10 @@ bool roll_credits(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now line 2 flies in */
|
/* now line 2 flies in */
|
||||||
for(jobpos=LCD_WIDTH; jobpos > LCD_WIDTH/2-(job_w+2)/2; jobpos--) /* we use (job_w+2) to ensure it fits on the LCD */
|
for(jobpos=LCD_WIDTH; jobpos > (LCD_WIDTH/2)-(job_w+2)/2; jobpos--) /* we use (job_w+2) to ensure it fits on the LCD */
|
||||||
{
|
{
|
||||||
rb->lcd_clearrect(0, 56, 112, 8); /* clear trails */
|
rb->lcd_clearrect(0, 56, 112, 8); /* clear trails */
|
||||||
rb->lcd_putsxy(jobpos, 56, job); /* show their job */
|
rb->lcd_putsxy(jobpos, 56, job);
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
/* exit on keypress */
|
/* exit on keypress */
|
||||||
|
@ -1243,14 +1189,22 @@ bool roll_credits(void)
|
||||||
{
|
{
|
||||||
rb->sleep((HZ*2)/10); /* wait a moment */
|
rb->sleep((HZ*2)/10); /* wait a moment */
|
||||||
|
|
||||||
|
namepos++;
|
||||||
|
jobpos--;
|
||||||
|
|
||||||
|
rb->lcd_clearrect(0, 48, 112, 16);
|
||||||
|
rb->lcd_putsxy(namepos, 48, name);
|
||||||
|
rb->lcd_putsxy(jobpos, 56, job);
|
||||||
|
rb->lcd_update();
|
||||||
|
|
||||||
btn = rb->button_get(false);
|
btn = rb->button_get(false);
|
||||||
if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
|
if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fly out both lines at same time */
|
/* fly out both lines at same time */
|
||||||
namepos=(LCD_WIDTH/2-name_w/2)+5;
|
namepos=((LCD_WIDTH/2)-(name_w/2))+8;
|
||||||
jobpos=(LCD_WIDTH/2-(job_w+2)/2)-5;
|
jobpos=((LCD_WIDTH/2)-(job_w+2)/2)-8;
|
||||||
while(namepos<LCD_WIDTH || jobpos > 0-job_w)
|
while(namepos<LCD_WIDTH || jobpos > 0-job_w)
|
||||||
{
|
{
|
||||||
rb->lcd_clearrect(0, 48, 112, 16); /* clear trails */
|
rb->lcd_clearrect(0, 48, 112, 16); /* clear trails */
|
||||||
|
@ -1267,14 +1221,16 @@ bool roll_credits(void)
|
||||||
jobpos--;
|
jobpos--;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pause (.5s) */
|
/* pause (.2s) */
|
||||||
rb->sleep(HZ/2);
|
rb->sleep(HZ/2);
|
||||||
|
|
||||||
/* and scan for button presses */
|
/* and scan for button presses */
|
||||||
btn = rb->button_get(false);
|
btn = rb->button_get(false);
|
||||||
if ( (!btn) && (!(btn&BUTTON_REL)) )
|
if (btn != BUTTON_NONE && !(btn & BUTTON_REL))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
exit_logo();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1288,11 +1244,11 @@ bool show_credits(void)
|
||||||
|
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
|
|
||||||
|
rb->lcd_puts(0, 7, "Credit Roll...");
|
||||||
|
|
||||||
/* show the logo with an animation and the clock version text */
|
/* show the logo with an animation and the clock version text */
|
||||||
show_logo(true, true);
|
show_logo(true, true);
|
||||||
|
|
||||||
rb->lcd_puts(0, 7, "Credit Roll...");
|
|
||||||
|
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
/* pause while button scanning */
|
/* pause while button scanning */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue