2002-06-15 13:29:03 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 Daniel Stenberg
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
2003-06-29 16:33:04 +00:00
|
|
|
**************************************************************************/
|
|
|
|
#include "plugin.h"
|
2003-12-06 23:22:29 +00:00
|
|
|
#include "time.h"
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2002-06-15 13:29:03 +00:00
|
|
|
|
|
|
|
#define SS_TITLE "Bouncer"
|
|
|
|
#define SS_TITLE_FONT 2
|
|
|
|
|
2002-10-29 10:45:29 +00:00
|
|
|
#define LETTERS_ON_SCREEN 12
|
|
|
|
|
|
|
|
#define YSPEED 2
|
|
|
|
#define XSPEED 3
|
|
|
|
#define YADD -4
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
static struct plugin_api* rb;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
static unsigned char table[]={
|
2002-06-15 13:29:03 +00:00
|
|
|
26,28,30,33,35,37,39,40,42,43,45,46,46,47,47,47,47,47,46,46,45,43,42,40,39,37,35,33,30,28,26,24,21,19,17,14,12,10,8,7,5,4,2,1,1,0,0,0,0,0,1,1,2,4,5,7,8,10,12,14,17,19,21,23,
|
|
|
|
};
|
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
static unsigned char xtable[]={
|
2002-09-05 13:13:01 +00:00
|
|
|
54,58,63,67,71,75,79,82,85,88,91,93,95,97,98,99,99,99,99,99,97,96,94,92,90,87,84,80,77,73,69,65,60,56,52,47,43,39,34,30,26,22,19,15,12,9,7,5,3,2,0,0,0,0,0,1,2,4,6,8,11,14,17,20,24,28,32,36,41,45,49
|
2002-06-15 13:29:03 +00:00
|
|
|
};
|
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
static signed char speed[]={
|
|
|
|
1,2,3,3,3,2,1,0,-1,-2,-2,-2,-1,0,0,1,
|
|
|
|
};
|
|
|
|
|
2002-09-13 06:32:25 +00:00
|
|
|
const unsigned char char_gen_12x16[][22] =
|
|
|
|
{
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
2004-05-14 22:55:05 +00:00
|
|
|
{ 0x00,0x00,0x00,0x7c,0xff,0xff,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x33,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x3c,0x3c,0x00,0x00,0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x10,0x90,0xf0,0x7e,0x1e,0x90,0xf0,0x7e,0x1e,0x10,0x02,0x1e,0x1f,0x03,0x02,0x1e,0x1f,0x03,0x02,0x00,0x00 },
|
|
|
|
{ 0x00,0x78,0xfc,0xcc,0xff,0xff,0xcc,0xcc,0x88,0x00,0x00,0x00,0x04,0x0c,0x0c,0x3f,0x3f,0x0c,0x0f,0x07,0x00,0x00 },
|
|
|
|
{ 0x00,0x38,0x38,0x38,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x30,0x38,0x1c,0x0e,0x07,0x03,0x01,0x38,0x38,0x38,0x00 },
|
|
|
|
{ 0x00,0x00,0xb8,0xfc,0xc6,0xe2,0x3e,0x1c,0x00,0x00,0x00,0x00,0x1f,0x3f,0x31,0x21,0x37,0x1e,0x1c,0x36,0x22,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x27,0x3f,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0xf0,0xfc,0xfe,0x07,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x03,0x0f,0x1f,0x38,0x20,0x20,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x01,0x01,0x07,0xfe,0xfc,0xf0,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x38,0x1f,0x0f,0x03,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x98,0xb8,0xe0,0xf8,0xf8,0xe0,0xb8,0x98,0x00,0x00,0x00,0x0c,0x0e,0x03,0x0f,0x0f,0x03,0x0e,0x0c,0x00,0x00 },
|
|
|
|
{ 0x00,0x80,0x80,0x80,0xf0,0xf0,0x80,0x80,0x80,0x00,0x00,0x00,0x01,0x01,0x01,0x0f,0x0f,0x01,0x01,0x01,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0xf8,0x78,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x38,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x18,0x1c,0x0e,0x07,0x03,0x01,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xf8,0xfe,0x06,0x03,0x83,0xc3,0x63,0x33,0x1e,0xfe,0xf8,0x07,0x1f,0x1e,0x33,0x31,0x30,0x30,0x30,0x18,0x1f,0x07 },
|
|
|
|
{ 0x00,0x00,0x0c,0x0c,0x0e,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x3f,0x3f,0x30,0x30,0x30,0x00 },
|
|
|
|
{ 0x1c,0x1e,0x07,0x03,0x03,0x83,0xc3,0xe3,0x77,0x3e,0x1c,0x30,0x38,0x3c,0x3e,0x37,0x33,0x31,0x30,0x30,0x30,0x30 },
|
|
|
|
{ 0x0c,0x0e,0x07,0xc3,0xc3,0xc3,0xc3,0xc3,0xe7,0x7e,0x3c,0x0c,0x1c,0x38,0x30,0x30,0x30,0x30,0x30,0x39,0x1f,0x0e },
|
|
|
|
{ 0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x07,0xff,0xff,0x00,0x00,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x3f,0x3f,0x03,0x03 },
|
|
|
|
{ 0x3f,0x7f,0x63,0x63,0x63,0x63,0x63,0x63,0xe3,0xc3,0x83,0x0c,0x1c,0x38,0x30,0x30,0x30,0x30,0x30,0x38,0x1f,0x0f },
|
|
|
|
{ 0xc0,0xf0,0xf8,0xdc,0xce,0xc7,0xc3,0xc3,0xc3,0x80,0x00,0x0f,0x1f,0x39,0x30,0x30,0x30,0x30,0x30,0x39,0x1f,0x0f },
|
|
|
|
{ 0x03,0x03,0x03,0x03,0x03,0x03,0xc3,0xf3,0x3f,0x0f,0x03,0x00,0x00,0x00,0x30,0x3c,0x0f,0x03,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0xbc,0xfe,0xe7,0xc3,0xc3,0xc3,0xe7,0xfe,0xbc,0x00,0x0f,0x1f,0x39,0x30,0x30,0x30,0x30,0x30,0x39,0x1f,0x0f },
|
|
|
|
{ 0x3c,0x7e,0xe7,0xc3,0xc3,0xc3,0xc3,0xc3,0xe7,0xfe,0xfc,0x00,0x00,0x30,0x30,0x30,0x38,0x1c,0x0e,0x07,0x03,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x70,0x70,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x1c,0x1c,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x70,0x70,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xfc,0x7c,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0xc0,0xe0,0xf0,0x38,0x1c,0x0e,0x07,0x03,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0e,0x1c,0x38,0x30,0x00,0x00 },
|
|
|
|
{ 0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x00 },
|
|
|
|
{ 0x00,0x03,0x07,0x0e,0x1c,0x38,0xf0,0xe0,0xc0,0x00,0x00,0x00,0x30,0x38,0x1c,0x0e,0x07,0x03,0x01,0x00,0x00,0x00 },
|
|
|
|
{ 0x1c,0x1e,0x07,0x03,0x83,0xc3,0xe3,0x77,0x3e,0x1c,0x00,0x00,0x00,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xf8,0xfe,0x07,0xf3,0xfb,0x1b,0xfb,0xfb,0x07,0xfe,0xf8,0x0f,0x1f,0x18,0x33,0x37,0x36,0x37,0x37,0x36,0x03,0x01 },
|
|
|
|
{ 0x00,0x00,0xe0,0xfc,0x1f,0x1f,0xfc,0xe0,0x00,0x00,0x00,0x38,0x3f,0x07,0x06,0x06,0x06,0x06,0x07,0x3f,0x38,0x00 },
|
|
|
|
{ 0xff,0xff,0xc3,0xc3,0xc3,0xc3,0xe7,0xfe,0xbc,0x00,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x30,0x39,0x1f,0x0f,0x00 },
|
|
|
|
{ 0xf0,0xfc,0x0e,0x07,0x03,0x03,0x03,0x07,0x0e,0x0c,0x00,0x03,0x0f,0x1c,0x38,0x30,0x30,0x30,0x38,0x1c,0x0c,0x00 },
|
|
|
|
{ 0xff,0xff,0x03,0x03,0x03,0x03,0x07,0x0e,0xfc,0xf0,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x38,0x1c,0x0f,0x03,0x00 },
|
|
|
|
{ 0xff,0xff,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x03,0x03,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00 },
|
|
|
|
{ 0xff,0xff,0xc3,0xc3,0xc3,0xc3,0xc3,0xc3,0x03,0x03,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xf0,0xfc,0x0e,0x07,0x03,0xc3,0xc3,0xc3,0xc7,0xc6,0x00,0x03,0x0f,0x1c,0x38,0x30,0x30,0x30,0x30,0x3f,0x3f,0x00 },
|
|
|
|
{ 0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xff,0xff,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x00,0x00,0x03,0x03,0xff,0xff,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x3f,0x3f,0x30,0x30,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x0e,0x1e,0x38,0x30,0x30,0x30,0x30,0x38,0x1f,0x07,0x00 },
|
|
|
|
{ 0xff,0xff,0xc0,0xe0,0xf0,0x38,0x1c,0x0e,0x07,0x03,0x00,0x3f,0x3f,0x00,0x01,0x03,0x07,0x0e,0x1c,0x38,0x30,0x00 },
|
|
|
|
{ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x00 },
|
|
|
|
{ 0xff,0xff,0x1e,0x78,0xe0,0xe0,0x78,0x1e,0xff,0xff,0x00,0x3f,0x3f,0x00,0x00,0x01,0x01,0x00,0x00,0x3f,0x3f,0x00 },
|
|
|
|
{ 0xff,0xff,0x0e,0x38,0xf0,0xc0,0x00,0x00,0xff,0xff,0x00,0x3f,0x3f,0x00,0x00,0x00,0x03,0x07,0x1c,0x3f,0x3f,0x00 },
|
|
|
|
{ 0xf0,0xfc,0x0e,0x07,0x03,0x03,0x07,0x0e,0xfc,0xf0,0x00,0x03,0x0f,0x1c,0x38,0x30,0x30,0x38,0x1c,0x0f,0x03,0x00 },
|
|
|
|
{ 0xff,0xff,0x83,0x83,0x83,0x83,0x83,0xc7,0xfe,0x7c,0x00,0x3f,0x3f,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00 },
|
|
|
|
{ 0xf0,0xfc,0x0e,0x07,0x03,0x03,0x07,0x0e,0xfc,0xf0,0x00,0x03,0x0f,0x1c,0x38,0x30,0x36,0x3e,0x1c,0x3f,0x33,0x00 },
|
|
|
|
{ 0xff,0xff,0x83,0x83,0x83,0x83,0x83,0xc7,0xfe,0x7c,0x00,0x3f,0x3f,0x01,0x01,0x03,0x07,0x0f,0x1d,0x38,0x30,0x00 },
|
|
|
|
{ 0x3c,0x7e,0xe7,0xc3,0xc3,0xc3,0xc3,0xc7,0x8e,0x0c,0x00,0x0c,0x1c,0x38,0x30,0x30,0x30,0x30,0x39,0x1f,0x0f,0x00 },
|
|
|
|
{ 0x00,0x03,0x03,0x03,0xff,0xff,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x07,0x1f,0x38,0x30,0x30,0x30,0x30,0x38,0x1f,0x07,0x00 },
|
|
|
|
{ 0x07,0x3f,0xf8,0xc0,0x00,0x00,0xc0,0xf8,0x3f,0x07,0x00,0x00,0x00,0x01,0x0f,0x3e,0x3e,0x0f,0x01,0x00,0x00,0x00 },
|
|
|
|
{ 0xff,0xff,0x00,0x00,0x80,0x80,0x00,0x00,0xff,0xff,0x00,0x3f,0x3f,0x1c,0x06,0x03,0x03,0x06,0x1c,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x03,0x0f,0x1c,0x30,0xe0,0xe0,0x30,0x1c,0x0f,0x03,0x00,0x30,0x3c,0x0e,0x03,0x01,0x01,0x03,0x0e,0x3c,0x30,0x00 },
|
|
|
|
{ 0x03,0x0f,0x3c,0xf0,0xc0,0xc0,0xf0,0x3c,0x0f,0x03,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x03,0x03,0x03,0x03,0xc3,0xe3,0x33,0x1f,0x0f,0x03,0x00,0x30,0x3c,0x3e,0x33,0x31,0x30,0x30,0x30,0x30,0x30,0x00 },
|
|
|
|
{ 0x00,0x00,0xff,0xff,0x03,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x00,0x00,0x00 },
|
|
|
|
{ 0x0e,0x1c,0x38,0x70,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x07,0x0e,0x1c,0x18 },
|
|
|
|
{ 0x00,0x00,0x03,0x03,0x03,0x03,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x30,0x3f,0x3f,0x00,0x00,0x00 },
|
|
|
|
{ 0x60,0x70,0x38,0x1c,0x0e,0x07,0x0e,0x1c,0x38,0x70,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x3e,0x7e,0x4e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x40,0x60,0x60,0x60,0x60,0x60,0x60,0xe0,0xc0,0x00,0x1c,0x3e,0x33,0x33,0x33,0x33,0x33,0x33,0x3f,0x3f,0x00 },
|
|
|
|
{ 0xff,0xff,0xc0,0x60,0x60,0x60,0x60,0xe0,0xc0,0x80,0x00,0x3f,0x3f,0x30,0x30,0x30,0x30,0x30,0x38,0x1f,0x0f,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0x60,0x60,0xc0,0x80,0x00,0x0f,0x1f,0x38,0x30,0x30,0x30,0x30,0x30,0x18,0x08,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0xe0,0xc0,0xff,0xff,0x00,0x0f,0x1f,0x38,0x30,0x30,0x30,0x30,0x30,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0x60,0x60,0xc0,0x80,0x00,0x0f,0x1f,0x3b,0x33,0x33,0x33,0x33,0x33,0x13,0x01,0x00 },
|
|
|
|
{ 0xc0,0xc0,0xfc,0xfe,0xc7,0xc3,0xc3,0x03,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x00,0x03,0xc7,0xce,0xcc,0xcc,0xcc,0xcc,0xe6,0x7f,0x3f,0x00 },
|
|
|
|
{ 0xff,0xff,0xc0,0x60,0x60,0x60,0xe0,0xc0,0x80,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x60,0xec,0xec,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x3f,0x3f,0x30,0x30,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0x00,0x60,0xec,0xec,0x00,0x00,0x00,0x00,0x00,0x60,0xe0,0xc0,0xc0,0xff,0x7f,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0xff,0xff,0x00,0x80,0xc0,0xe0,0x60,0x00,0x00,0x00,0x00,0x3f,0x3f,0x03,0x07,0x0f,0x1c,0x38,0x30,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x03,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x3f,0x3f,0x30,0x30,0x00,0x00,0x00 },
|
|
|
|
{ 0xe0,0xc0,0xe0,0xe0,0xc0,0xc0,0xe0,0xe0,0xc0,0x80,0x00,0x3f,0x3f,0x00,0x00,0x3f,0x3f,0x00,0x00,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x00,0xe0,0xe0,0x60,0x60,0x60,0x60,0xe0,0xc0,0x80,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0x60,0xe0,0xc0,0x80,0x00,0x0f,0x1f,0x38,0x30,0x30,0x30,0x30,0x38,0x1f,0x0f,0x00 },
|
|
|
|
{ 0xe0,0xe0,0x60,0x60,0x60,0x60,0x60,0xe0,0xc0,0x80,0x00,0xff,0xff,0x0c,0x18,0x18,0x18,0x18,0x1c,0x0f,0x07,0x00 },
|
|
|
|
{ 0x80,0xc0,0xe0,0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x00,0x07,0x0f,0x1c,0x18,0x18,0x18,0x18,0x0c,0xff,0xff,0x00 },
|
|
|
|
{ 0x00,0xe0,0xe0,0xc0,0x60,0x60,0x60,0x60,0xe0,0xc0,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xc0,0xe0,0x60,0x60,0x60,0x60,0x60,0x40,0x00,0x00,0x00,0x11,0x33,0x33,0x33,0x33,0x33,0x3f,0x1e,0x00,0x00,0x00 },
|
|
|
|
{ 0x60,0x60,0xfe,0xfe,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x3f,0x30,0x30,0x30,0x30,0x00,0x00,0x00 },
|
|
|
|
{ 0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0x00,0x0f,0x1f,0x38,0x30,0x30,0x30,0x30,0x18,0x3f,0x3f,0x00 },
|
|
|
|
{ 0x60,0xe0,0x80,0x00,0x00,0x00,0x00,0x80,0xe0,0x60,0x00,0x00,0x01,0x07,0x1e,0x38,0x38,0x1e,0x07,0x01,0x00,0x00 },
|
|
|
|
{ 0xe0,0xe0,0x00,0x00,0xe0,0xe0,0x00,0x00,0xe0,0xe0,0x00,0x07,0x1f,0x38,0x1c,0x0f,0x0f,0x1c,0x38,0x1f,0x07,0x00 },
|
|
|
|
{ 0x60,0xe0,0xc0,0x80,0x00,0x80,0xc0,0xe0,0x60,0x00,0x00,0x30,0x38,0x1d,0x0f,0x07,0x0f,0x1d,0x38,0x30,0x00,0x00 },
|
|
|
|
{ 0x00,0x60,0xe0,0x80,0x00,0x00,0x80,0xe0,0x60,0x00,0x00,0x00,0x00,0x81,0xe7,0x7e,0x1e,0x07,0x01,0x00,0x00,0x00 },
|
|
|
|
{ 0x60,0x60,0x60,0x60,0x60,0xe0,0xe0,0x60,0x20,0x00,0x00,0x30,0x38,0x3c,0x36,0x33,0x31,0x30,0x30,0x30,0x00,0x00 },
|
|
|
|
{ 0x00,0x80,0xc0,0xfc,0x7e,0x07,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x01,0x1f,0x3f,0x70,0x60,0x60,0x60,0x00,0x00 },
|
|
|
|
{ 0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x3f,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0x00,0x03,0x03,0x03,0x07,0x7e,0xfc,0xc0,0x80,0x00,0x00,0x00,0x60,0x60,0x60,0x70,0x3f,0x1f,0x01,0x00,0x00,0x00 },
|
|
|
|
{ 0x10,0x18,0x0c,0x04,0x0c,0x18,0x10,0x18,0x0c,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 },
|
|
|
|
{ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x00 }
|
2002-09-13 06:32:25 +00:00
|
|
|
};
|
2002-09-06 12:05:37 +00:00
|
|
|
|
2002-06-15 13:29:03 +00:00
|
|
|
#define XDIFF -4
|
|
|
|
#define YDIFF -6
|
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
enum {
|
|
|
|
NUM_XSANKE,
|
|
|
|
NUM_YSANKE,
|
|
|
|
NUM_XADD,
|
|
|
|
NUM_YADD,
|
|
|
|
NUM_XDIST,
|
|
|
|
NUM_YDIST,
|
|
|
|
|
|
|
|
NUM_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
struct counter {
|
|
|
|
char *what;
|
|
|
|
int num;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct counter values[]={
|
|
|
|
{"xsanke", 1},
|
|
|
|
{"ysanke", 1},
|
|
|
|
{"xadd", 1},
|
|
|
|
{"yadd", 1},
|
|
|
|
{"xdist", -4},
|
|
|
|
{"ydistt", -6},
|
|
|
|
};
|
|
|
|
|
2002-10-11 20:15:22 +00:00
|
|
|
static unsigned char yminute[]={
|
|
|
|
53,53,52,52,51,50,49,47,46,44,42,40,38,36,34,32,29,27,25,23,21,19,17,16,14,13,12,11,11,10,10,10,11,11,12,13,14,16,17,19,21,23,25,27,29,31,34,36,38,40,42,44,46,47,49,50,51,52,52,53,
|
|
|
|
};
|
|
|
|
static unsigned char yhour[]={
|
|
|
|
42,42,42,42,41,41,40,39,39,38,37,36,35,34,33,32,30,29,28,27,26,25,24,24,23,22,22,21,21,21,21,21,21,21,22,22,23,24,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,39,40,41,41,42,42,42,
|
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned char xminute[]={
|
|
|
|
56,59,63,67,71,74,77,80,83,86,88,90,91,92,93,93,93,92,91,90,88,86,83,80,77,74,71,67,63,59,56,52,48,44,40,37,34,31,28,25,23,21,20,19,18,18,18,19,20,21,23,25,28,31,34,37,40,44,48,52,
|
|
|
|
};
|
|
|
|
static unsigned char xhour[]={
|
|
|
|
56,57,59,61,63,65,66,68,69,71,72,73,73,74,74,74,74,74,73,73,72,71,69,68,66,65,63,61,59,57,56,54,52,50,48,46,45,43,42,40,39,38,38,37,37,37,37,37,38,38,39,40,42,43,45,46,48,50,52,54,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void addclock(void)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int hour;
|
|
|
|
int minute;
|
|
|
|
int pos;
|
|
|
|
|
2003-12-06 23:22:29 +00:00
|
|
|
struct tm* current_time = rb->get_time();
|
|
|
|
hour = current_time->tm_hour;
|
|
|
|
minute = current_time->tm_min;
|
2002-10-11 20:15:22 +00:00
|
|
|
|
|
|
|
pos = 90-minute;
|
|
|
|
if(pos >= 60)
|
|
|
|
pos -= 60;
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_drawline(LCD_WIDTH/2, LCD_HEIGHT/2, xminute[pos], yminute[pos]);
|
2002-10-11 20:15:22 +00:00
|
|
|
|
|
|
|
hour = hour*5 + minute/12;
|
|
|
|
pos = 90-hour;
|
|
|
|
if(pos >= 60)
|
|
|
|
pos -= 60;
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_drawline(LCD_WIDTH/2, LCD_HEIGHT/2, xhour[pos], yhour[pos]);
|
2002-10-11 20:15:22 +00:00
|
|
|
|
|
|
|
/* draw a circle */
|
|
|
|
for(i=0; i < 60; i+=3) {
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_drawline( xminute[i],
|
2002-10-11 20:15:22 +00:00
|
|
|
yminute[i],
|
|
|
|
xminute[(i+1)%60],
|
|
|
|
yminute[(i+1)%60]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-10-13 12:48:31 +00:00
|
|
|
static int scrollit(void)
|
|
|
|
{
|
|
|
|
int b;
|
|
|
|
unsigned int y=100;
|
|
|
|
int x=LCD_WIDTH;
|
|
|
|
unsigned int yy,xx;
|
|
|
|
unsigned int i;
|
|
|
|
int textpos=0;
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
char* rock="Rockbox! Pure pleasure. Pure fun. Oooh. What fun! ;-) ";
|
2003-06-30 02:07:20 +00:00
|
|
|
unsigned int rocklen = rb->strlen(rock);
|
2002-10-13 12:48:31 +00:00
|
|
|
int letter;
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_clear_display();
|
2002-10-13 12:48:31 +00:00
|
|
|
while(1)
|
|
|
|
{
|
2003-06-29 16:33:04 +00:00
|
|
|
b = rb->button_get_w_tmo(HZ/10);
|
2002-10-23 15:09:52 +00:00
|
|
|
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
2002-10-13 12:48:31 +00:00
|
|
|
return 0;
|
2002-10-23 15:09:52 +00:00
|
|
|
else if ( b == (BUTTON_ON|BUTTON_REL) )
|
2002-10-13 12:48:31 +00:00
|
|
|
return 1;
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_clear_display();
|
2002-10-13 12:48:31 +00:00
|
|
|
|
|
|
|
for(i=0, yy=y, xx=x; i< LETTERS_ON_SCREEN; i++) {
|
2003-06-30 02:07:20 +00:00
|
|
|
letter = rock[(i+textpos) % rocklen ];
|
2002-10-13 12:48:31 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_bitmap((char *)char_gen_12x16[letter-0x20],
|
2002-10-13 12:48:31 +00:00
|
|
|
xx, table[yy&63],
|
|
|
|
11, 16, false);
|
|
|
|
yy += YADD;
|
|
|
|
xx+= LCD_WIDTH/LETTERS_ON_SCREEN;
|
|
|
|
}
|
|
|
|
addclock();
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_update();
|
2002-10-13 12:48:31 +00:00
|
|
|
|
|
|
|
x-= XSPEED;
|
|
|
|
|
|
|
|
if(x < 0) {
|
|
|
|
x += LCD_WIDTH/LETTERS_ON_SCREEN;
|
|
|
|
y += YADD;
|
|
|
|
textpos++;
|
|
|
|
}
|
|
|
|
|
|
|
|
y+=YSPEED;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int loopit(void)
|
2002-06-15 13:29:03 +00:00
|
|
|
{
|
|
|
|
int b;
|
2002-09-06 12:05:37 +00:00
|
|
|
unsigned int y=100;
|
|
|
|
unsigned int x=100;
|
|
|
|
unsigned int yy,xx;
|
2002-06-15 13:29:03 +00:00
|
|
|
unsigned int i;
|
2002-09-06 12:05:37 +00:00
|
|
|
unsigned int ysanke=0;
|
|
|
|
unsigned int xsanke=0;
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
char* rock="ROCKbox";
|
2003-06-30 02:07:20 +00:00
|
|
|
unsigned int rocklen = rb->strlen(rock);
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
int show=0;
|
|
|
|
int timeout=0;
|
|
|
|
char buffer[30];
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_clear_display();
|
2002-06-15 13:29:03 +00:00
|
|
|
while(1)
|
|
|
|
{
|
2003-06-29 16:33:04 +00:00
|
|
|
b = rb->button_get_w_tmo(HZ/10);
|
2002-10-23 15:09:52 +00:00
|
|
|
if ( b == (BUTTON_OFF|BUTTON_REL) )
|
2002-10-13 12:48:31 +00:00
|
|
|
return 0;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
|
|
|
if ( b == SYS_USB_CONNECTED) {
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->usb_screen();
|
2002-10-29 10:45:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-10-23 15:09:52 +00:00
|
|
|
if ( b == (BUTTON_ON|BUTTON_REL) )
|
2002-10-13 12:48:31 +00:00
|
|
|
return 1;
|
2002-09-06 12:05:37 +00:00
|
|
|
else if(b != BUTTON_NONE)
|
|
|
|
timeout=20;
|
2002-08-13 15:01:59 +00:00
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
y+= speed[ysanke&15] + values[NUM_YADD].num;
|
|
|
|
x+= speed[xsanke&15] + values[NUM_XADD].num;
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_clear_display();
|
2002-10-11 20:15:22 +00:00
|
|
|
addclock();
|
2002-09-06 12:05:37 +00:00
|
|
|
if(timeout) {
|
|
|
|
switch(b) {
|
|
|
|
case BUTTON_LEFT:
|
|
|
|
values[show].num--;
|
|
|
|
break;
|
|
|
|
case BUTTON_RIGHT:
|
|
|
|
values[show].num++;
|
|
|
|
break;
|
|
|
|
case BUTTON_UP:
|
|
|
|
if(++show == NUM_LAST)
|
|
|
|
show=0;
|
|
|
|
break;
|
|
|
|
case BUTTON_DOWN:
|
|
|
|
if(--show < 0)
|
|
|
|
show=NUM_LAST-1;
|
|
|
|
break;
|
|
|
|
}
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->snprintf(buffer, 30, "%s: %d",
|
|
|
|
values[show].what, values[show].num);
|
|
|
|
rb->lcd_putsxy(0, 56, buffer);
|
2002-09-06 12:05:37 +00:00
|
|
|
timeout--;
|
|
|
|
}
|
|
|
|
for(i=0, yy=y, xx=x;
|
2003-06-30 02:07:20 +00:00
|
|
|
i<rocklen;
|
2002-09-06 12:05:37 +00:00
|
|
|
i++, yy+=values[NUM_YDIST].num, xx+=values[NUM_XDIST].num)
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_bitmap((char *)char_gen_12x16[rock[i]-0x20],
|
2002-09-05 13:13:01 +00:00
|
|
|
xtable[xx%71], table[yy&63],
|
2002-06-15 13:29:03 +00:00
|
|
|
11, 16, false);
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_update();
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2002-09-06 12:05:37 +00:00
|
|
|
ysanke+= values[NUM_YSANKE].num;
|
|
|
|
xsanke+= values[NUM_XSANKE].num;
|
2002-06-15 13:29:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
2002-06-15 13:29:03 +00:00
|
|
|
{
|
|
|
|
int w, h;
|
|
|
|
char *off = "[Off] to stop";
|
2003-06-29 16:33:04 +00:00
|
|
|
int len;
|
2002-06-15 13:29:03 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
TEST_PLUGIN_API(api);
|
|
|
|
(void)(parameter);
|
|
|
|
rb = api;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
len = rb->strlen(SS_TITLE);
|
|
|
|
rb->lcd_setfont(FONT_SYSFIXED);
|
|
|
|
rb->lcd_getstringsize(SS_TITLE,&w, &h);
|
2002-06-15 13:29:03 +00:00
|
|
|
|
|
|
|
/* Get horizontel centering for text */
|
|
|
|
len *= w;
|
|
|
|
if (len%2 != 0)
|
|
|
|
len = ((len+1)/2)+(w/2);
|
|
|
|
else
|
|
|
|
len /= 2;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-06-15 13:29:03 +00:00
|
|
|
if (h%2 != 0)
|
|
|
|
h = (h/2)+1;
|
|
|
|
else
|
|
|
|
h /= 2;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_clear_display();
|
|
|
|
rb->lcd_putsxy(LCD_WIDTH/2-len, (LCD_HEIGHT/2)-h, SS_TITLE);
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-09-24 18:04:15 +00:00
|
|
|
len = 1;
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_getstringsize(off, &w, &h);
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-06-15 13:29:03 +00:00
|
|
|
/* Get horizontel centering for text */
|
|
|
|
len *= w;
|
|
|
|
if (len%2 != 0)
|
|
|
|
len = ((len+1)/2)+(w/2);
|
|
|
|
else
|
|
|
|
len /= 2;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-06-15 13:29:03 +00:00
|
|
|
if (h%2 != 0)
|
|
|
|
h = (h/2)+1;
|
|
|
|
else
|
|
|
|
h /= 2;
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_putsxy(LCD_WIDTH/2-len, LCD_HEIGHT-(2*h), off);
|
|
|
|
rb->lcd_update();
|
|
|
|
rb->sleep(HZ);
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-10-13 12:48:31 +00:00
|
|
|
do {
|
|
|
|
h= loopit();
|
|
|
|
if(h)
|
2002-10-29 10:45:29 +00:00
|
|
|
h = scrollit();
|
2002-10-13 12:48:31 +00:00
|
|
|
} while(h);
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
rb->lcd_setfont(FONT_UI);
|
2002-10-29 10:45:29 +00:00
|
|
|
|
2002-09-24 18:04:15 +00:00
|
|
|
return false;
|
2002-06-15 13:29:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|