2005-02-15 08:03:56 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2006-03-27 17:34:23 +00:00
|
|
|
|
* Copyright (C) 2005 Jonas H<EFBFBD>gqvist
|
2005-02-15 08:03:56 +00:00
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-02-15 08:03:56 +00:00
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
#include "plugin.h"
|
2008-11-20 11:27:31 +00:00
|
|
|
|
#include "lib/playergfx.h"
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2010-08-24 14:30:46 +00:00
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
#define DISPLAY_WIDTH LCD_WIDTH
|
|
|
|
|
#define DISPLAY_HEIGHT LCD_HEIGHT
|
|
|
|
|
#define RAND_SCALE 5
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2005-05-23 16:23:25 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
#define REMOTE_WIDTH LCD_REMOTE_WIDTH
|
|
|
|
|
#define REMOTE_HEIGHT LCD_REMOTE_HEIGHT
|
2008-11-03 14:37:50 +00:00
|
|
|
|
#include "pluginbitmaps/remote_rockboxlogo.h"
|
2008-01-31 21:05:32 +00:00
|
|
|
|
#define REMOTE_LOGO_WIDTH BMPWIDTH_remote_rockboxlogo
|
|
|
|
|
#define REMOTE_LOGO_HEIGHT BMPHEIGHT_remote_rockboxlogo
|
2008-01-31 19:28:51 +00:00
|
|
|
|
#define REMOTE_LOGO remote_rockboxlogo
|
2008-01-31 20:42:28 +00:00
|
|
|
|
extern const fb_remote_data remote_rockboxlogo[];
|
2005-06-30 21:07:00 +00:00
|
|
|
|
#endif /* HAVE_REMOTE_LCD */
|
2005-05-16 12:07:30 +00:00
|
|
|
|
|
2008-01-31 19:28:51 +00:00
|
|
|
|
#define LOGO rockboxlogo
|
2008-11-03 14:37:50 +00:00
|
|
|
|
#include "pluginbitmaps/rockboxlogo.h"
|
2008-01-31 21:05:32 +00:00
|
|
|
|
#define LOGO_WIDTH BMPWIDTH_rockboxlogo
|
|
|
|
|
#define LOGO_HEIGHT BMPHEIGHT_rockboxlogo
|
2008-01-31 19:28:51 +00:00
|
|
|
|
extern const fb_data rockboxlogo[];
|
2005-03-05 22:45:04 +00:00
|
|
|
|
|
|
|
|
|
#else /* !LCD_BITMAP */
|
|
|
|
|
#define DISPLAY_WIDTH 55
|
|
|
|
|
#define DISPLAY_HEIGHT 14
|
|
|
|
|
#define RAND_SCALE 2
|
|
|
|
|
#define LOGO_WIDTH 16
|
|
|
|
|
#define LOGO_HEIGHT 7
|
|
|
|
|
#define LOGO rockbox16x7
|
|
|
|
|
const unsigned char rockbox16x7[] = {
|
2005-06-30 21:07:00 +00:00
|
|
|
|
0x47, 0x18, 0xa6, 0xd8, 0x66, 0xde, 0xb7, 0x9b,
|
|
|
|
|
0x76, 0xdb, 0x26, 0xdb, 0x66, 0xde,
|
2005-03-05 22:45:04 +00:00
|
|
|
|
};
|
|
|
|
|
#endif /* !LCD_BITMAP */
|
|
|
|
|
|
|
|
|
|
/* variable button definitions */
|
|
|
|
|
#if CONFIG_KEYPAD == PLAYER_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_STOP
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y (BUTTON_ON | BUTTON_LEFT)
|
|
|
|
|
#define LP_INC_Y (BUTTON_ON | BUTTON_RIGHT)
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-02-24 20:54:09 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
|
2007-07-27 09:57:27 +00:00
|
|
|
|
(CONFIG_KEYPAD == IPOD_3G_PAD) || \
|
|
|
|
|
(CONFIG_KEYPAD == IPOD_1G2G_PAD)
|
2005-12-14 01:31:37 +00:00
|
|
|
|
#define LP_QUIT BUTTON_MENU
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_SCROLL_BACK
|
|
|
|
|
#define LP_INC_Y BUTTON_SCROLL_FWD
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-01-12 00:35:50 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_PLAY
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2007-03-16 23:02:39 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
|
2006-03-27 17:34:23 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2006-01-19 12:44:46 +00:00
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2008-03-22 10:24:28 +00:00
|
|
|
|
|
2006-02-24 15:42:52 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
2007-05-19 23:38:09 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2006-02-24 15:42:52 +00:00
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2006-10-26 13:38:09 +00:00
|
|
|
|
|
2007-09-20 10:49:48 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
|
2009-01-04 23:33:15 +00:00
|
|
|
|
(CONFIG_KEYPAD == SANSA_C200_PAD) || \
|
|
|
|
|
(CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
|
2011-11-16 14:08:01 +00:00
|
|
|
|
(CONFIG_KEYPAD == SANSA_M200_PAD) || \
|
|
|
|
|
(CONFIG_KEYPAD == SANSA_CONNECT_PAD)
|
2006-10-26 13:38:09 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2009-04-10 17:28:26 +00:00
|
|
|
|
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
|
|
|
|
|
#define LP_QUIT (BUTTON_HOME|BUTTON_REPEAT)
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2006-08-03 20:17:25 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_SCROLL_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_SCROLL_UP
|
2007-10-23 15:40:51 +00:00
|
|
|
|
|
|
|
|
|
#elif CONFIG_KEYPAD == MROBE500_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
|
Initial commit of the Samsung YP-R0 port.
This port is a hybrid native/RaaA port. It runs on a embedded linux system,
but is the only application. It therefore can implement lots of stuff that
native targets also implement, while leveraging the underlying linux kernel.
The port is quite advanced. User interface, audio playback, plugins work
mostly fine. Missing is e.g. power mangement and USB (see SamsungYPR0 wiki page).
Included in utils/ypr0tools are scripts and programs required to generate
a patched firmware. The patched firmware has the rootfs modified to load
Rockbox. It includes a early/safe USB mode.
This port needs a new toolchain, one that includes glibc headers and libraries.
rockboxdev.sh can generate it, but e.g. codesourcey and distro packages may
also work.
Most of the initial effort is done by Lorenzo Miori and others (on ABI),
including reverse engineering and patching of the original firmware,
initial drivers, and more. Big thanks to you.
Flyspray: FS#12348
Author: Lorenzo Miori, myself
Merry christmas to ypr0 owners! :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31415 a1c6a512-1295-4272-9138-f99709370657
2011-12-24 11:56:46 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
|
|
|
|
|
CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
|
2008-02-17 12:23:02 +00:00
|
|
|
|
#define LP_QUIT BUTTON_BACK
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2008-03-01 22:55:09 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == MROBE100_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2008-03-22 10:24:28 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_RC_REC
|
|
|
|
|
#define LP_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_DEC_Y BUTTON_RC_VOL_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_RC_VOL_UP
|
|
|
|
|
|
2009-12-15 20:51:41 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == COWON_D2_PAD
|
2008-03-22 22:03:34 +00:00
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
|
2008-10-07 16:38:28 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == IAUDIO67_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_PLAY
|
|
|
|
|
#define LP_INC_Y BUTTON_STOP
|
|
|
|
|
|
2008-12-04 21:28:56 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_BACK
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
2009-01-24 22:41:55 +00:00
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
|
|
|
|
#elif CONFIG_KEYPAD == PHILIPS_HDD1630_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
2008-12-04 21:28:56 +00:00
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2010-11-03 02:45:53 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2009-12-10 01:23:51 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_PREV
|
|
|
|
|
#define LP_INC_X BUTTON_NEXT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2009-04-07 23:41:44 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == ONDAVX747_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2009-08-31 21:11:32 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == ONDAVX777_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
2009-04-07 23:41:44 +00:00
|
|
|
|
|
2009-08-04 03:08:32 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == SAMSUNG_YH_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_PLAY
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2010-02-11 22:40:17 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_REC
|
|
|
|
|
#define LP_DEC_X BUTTON_PREV
|
|
|
|
|
#define LP_INC_X BUTTON_NEXT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2010-04-26 21:40:00 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == MPIO_HD200_PAD
|
|
|
|
|
#define LP_QUIT (BUTTON_REC|BUTTON_PLAY)
|
|
|
|
|
#define LP_DEC_X BUTTON_VOL_DOWN
|
|
|
|
|
#define LP_INC_X BUTTON_VOL_UP
|
2010-11-02 10:44:34 +00:00
|
|
|
|
#define LP_DEC_Y BUTTON_REW
|
|
|
|
|
#define LP_INC_Y BUTTON_FF
|
2010-04-26 21:40:00 +00:00
|
|
|
|
|
2010-11-30 10:52:14 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == MPIO_HD300_PAD
|
2012-02-02 13:42:42 +00:00
|
|
|
|
#define LP_QUIT (BUTTON_MENU|BUTTON_REPEAT)
|
2010-11-30 10:52:14 +00:00
|
|
|
|
#define LP_DEC_X BUTTON_REW
|
|
|
|
|
#define LP_INC_X BUTTON_FF
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2011-10-02 15:39:36 +00:00
|
|
|
|
#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
|
|
|
|
|
#define LP_QUIT BUTTON_POWER
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
#define LP_QUIT BUTTON_OFF
|
|
|
|
|
#define LP_DEC_X BUTTON_LEFT
|
|
|
|
|
#define LP_INC_X BUTTON_RIGHT
|
|
|
|
|
#define LP_DEC_Y BUTTON_DOWN
|
|
|
|
|
#define LP_INC_Y BUTTON_UP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
2005-06-29 12:47:24 +00:00
|
|
|
|
#if (CONFIG_REMOTE_KEYPAD == H100_REMOTE) || \
|
|
|
|
|
(CONFIG_REMOTE_KEYPAD == H300_REMOTE)
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#define LP_R_QUIT BUTTON_RC_STOP
|
|
|
|
|
#define LP_R_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_R_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_R_DEC_Y BUTTON_RC_SOURCE
|
|
|
|
|
#define LP_R_INC_Y BUTTON_RC_BITRATE
|
2009-04-11 07:23:56 +00:00
|
|
|
|
|
2010-07-23 20:20:40 +00:00
|
|
|
|
#elif CONFIG_REMOTE_KEYPAD == IAUDIO_REMOTE
|
|
|
|
|
#define LP_R_QUIT BUTTON_RC_REC
|
|
|
|
|
#define LP_R_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_R_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_R_DEC_Y BUTTON_RC_VOL_DOWN
|
|
|
|
|
#define LP_R_INC_Y BUTTON_RC_VOL_UP
|
|
|
|
|
|
|
|
|
|
#elif (CONFIG_REMOTE_KEYPAD == MROBE_REMOTE)
|
2009-04-11 07:23:56 +00:00
|
|
|
|
#define LP_R_QUIT BUTTON_RC_HEART
|
|
|
|
|
#define LP_R_DEC_X BUTTON_RC_REW
|
|
|
|
|
#define LP_R_INC_X BUTTON_RC_FF
|
|
|
|
|
#define LP_R_DEC_Y BUTTON_RC_DOWN
|
|
|
|
|
#define LP_R_INC_Y BUTTON_RC_PLAY
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#endif
|
2009-04-11 07:23:56 +00:00
|
|
|
|
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#endif /* CONFIG_REMOTE_KEYPAD */
|
|
|
|
|
|
2008-08-23 09:46:38 +00:00
|
|
|
|
#ifdef HAVE_TOUCHSCREEN
|
2008-04-27 15:30:19 +00:00
|
|
|
|
#ifndef LP_QUIT
|
|
|
|
|
#define LP_QUIT BUTTON_TOPLEFT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_DEC_X
|
|
|
|
|
#define LP_DEC_X BUTTON_MIDLEFT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_INC_X
|
|
|
|
|
#define LP_INC_X BUTTON_MIDRIGHT
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_DEC_Y
|
|
|
|
|
#define LP_DEC_Y BUTTON_TOPMIDDLE
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef LP_INC_Y
|
|
|
|
|
#define LP_INC_Y BUTTON_BOTTOMMIDDLE
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
2009-01-16 10:34:40 +00:00
|
|
|
|
enum plugin_status plugin_start(const void* parameter) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
int button;
|
|
|
|
|
int timer = 10;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
int x = (DISPLAY_WIDTH / 2) - (LOGO_WIDTH / 2);
|
|
|
|
|
int y = (DISPLAY_HEIGHT / 2) - (LOGO_HEIGHT / 2);
|
2005-02-15 09:27:23 +00:00
|
|
|
|
int dx;
|
|
|
|
|
int dy;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
int cpos = -1;
|
|
|
|
|
int old_cpos = -1;
|
|
|
|
|
#endif
|
2005-02-15 09:27:23 +00:00
|
|
|
|
|
2005-02-15 08:03:56 +00:00
|
|
|
|
(void)parameter;
|
2005-02-15 09:27:23 +00:00
|
|
|
|
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2009-01-16 10:34:40 +00:00
|
|
|
|
if (!pgfx_init(4, 2)) {
|
2007-03-16 21:56:08 +00:00
|
|
|
|
rb->splash(HZ*2, "Old LCD :(");
|
2005-03-05 22:45:04 +00:00
|
|
|
|
return PLUGIN_OK;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
rb->srand(*rb->current_tick);
|
|
|
|
|
dx = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE;
|
|
|
|
|
dy = rb->rand()%(2*RAND_SCALE+1) - RAND_SCALE;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
|
|
|
|
while (1) {
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->lcd_clear_display();
|
2008-01-31 19:28:51 +00:00
|
|
|
|
rb->lcd_bitmap(LOGO, x, y, LOGO_WIDTH, LOGO_HEIGHT);
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#ifdef REMOTE_LOGO
|
2005-06-29 01:39:50 +00:00
|
|
|
|
rb->lcd_remote_clear_display();
|
2008-01-31 19:28:51 +00:00
|
|
|
|
rb->lcd_remote_bitmap(REMOTE_LOGO,
|
2005-05-16 12:07:30 +00:00
|
|
|
|
(x * (REMOTE_WIDTH - REMOTE_LOGO_WIDTH)) / (DISPLAY_WIDTH - LOGO_WIDTH),
|
|
|
|
|
(y * (REMOTE_HEIGHT - REMOTE_LOGO_HEIGHT)) / (DISPLAY_HEIGHT - LOGO_HEIGHT),
|
2005-06-29 01:39:50 +00:00
|
|
|
|
REMOTE_LOGO_WIDTH, REMOTE_LOGO_HEIGHT);
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
pgfx_clear_display();
|
2005-07-07 00:05:29 +00:00
|
|
|
|
pgfx_mono_bitmap(LOGO, x % 5, y, LOGO_WIDTH, LOGO_HEIGHT);
|
2005-03-05 22:45:04 +00:00
|
|
|
|
cpos = x / 5;
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
|
|
|
|
|
x += dx;
|
|
|
|
|
if (x < 0) {
|
|
|
|
|
dx = -dx;
|
|
|
|
|
x = 0;
|
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (x > DISPLAY_WIDTH - LOGO_WIDTH) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
dx = -dx;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
x = DISPLAY_WIDTH - LOGO_WIDTH;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
y += dy;
|
|
|
|
|
if (y < 0) {
|
|
|
|
|
dy = -dy;
|
|
|
|
|
y = 0;
|
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (y > DISPLAY_HEIGHT - LOGO_HEIGHT) {
|
2005-02-15 08:03:56 +00:00
|
|
|
|
dy = -dy;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
y = DISPLAY_HEIGHT - LOGO_HEIGHT;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
}
|
2005-03-05 22:45:04 +00:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->lcd_update();
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#ifdef REMOTE_LOGO
|
2005-06-29 01:39:50 +00:00
|
|
|
|
rb->lcd_remote_update();
|
2005-05-16 12:07:30 +00:00
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#else
|
|
|
|
|
if (cpos != old_cpos) {
|
|
|
|
|
rb->lcd_clear_display();
|
|
|
|
|
pgfx_display(cpos, 0);
|
|
|
|
|
old_cpos = cpos;
|
|
|
|
|
}
|
2007-04-06 22:55:00 +00:00
|
|
|
|
pgfx_update();
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
rb->sleep(HZ/timer);
|
|
|
|
|
|
|
|
|
|
button = rb->button_get(false);
|
|
|
|
|
switch (button) {
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_QUIT:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_QUIT:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
pgfx_release();
|
|
|
|
|
#endif
|
2005-02-15 08:03:56 +00:00
|
|
|
|
return PLUGIN_OK;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_DEC_X:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_DEC_X:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (dx)
|
|
|
|
|
dx += (dx < 0) ? 1 : -1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_INC_X:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_INC_X:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
dx += (dx < 0) ? -1 : 1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_DEC_Y:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_DEC_Y:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (dy)
|
|
|
|
|
dy += (dy < 0) ? 1 : -1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
2005-03-05 22:45:04 +00:00
|
|
|
|
case LP_INC_Y:
|
2005-06-02 11:50:05 +00:00
|
|
|
|
#ifdef CONFIG_REMOTE_KEYPAD
|
|
|
|
|
case LP_R_INC_Y:
|
|
|
|
|
#endif
|
2005-03-05 22:45:04 +00:00
|
|
|
|
dy += (dy < 0) ? -1 : 1;
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2005-03-05 22:45:04 +00:00
|
|
|
|
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) {
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
pgfx_release();
|
|
|
|
|
#endif
|
|
|
|
|
return PLUGIN_USB_CONNECTED;
|
|
|
|
|
}
|
2005-02-15 08:03:56 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-27 15:30:19 +00:00
|
|
|
|
|