2005-10-07 20:37:41 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Kevin Ferrare
|
|
|
|
*
|
|
|
|
* Fire demo plugin
|
|
|
|
*
|
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-10-07 20:37:41 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "plugin.h"
|
2013-04-16 21:47:58 +00:00
|
|
|
#include "fixedpoint.h"
|
2008-11-20 11:27:31 +00:00
|
|
|
#include "lib/helper.h"
|
2008-01-23 08:25:04 +00:00
|
|
|
|
2008-11-20 11:27:31 +00:00
|
|
|
#include "lib/pluginlib_actions.h"
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2006-02-26 21:26:07 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
2008-11-20 11:27:31 +00:00
|
|
|
#include "lib/grey.h"
|
2008-01-07 00:01:26 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64)
|
|
|
|
/* Archos has not enough plugin RAM for full-width fire :( */
|
2008-02-24 14:43:42 +00:00
|
|
|
#define FIRE_WIDTH 106
|
|
|
|
#define FIRE_XPOS 3
|
2008-01-07 00:01:26 +00:00
|
|
|
#else
|
|
|
|
#define FIRE_WIDTH LCD_WIDTH
|
|
|
|
#define FIRE_XPOS 0
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2006-02-26 21:26:07 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
2008-01-13 00:11:43 +00:00
|
|
|
GREY_INFO_STRUCT
|
2008-01-23 08:25:04 +00:00
|
|
|
static unsigned char draw_buffer[FIRE_WIDTH];
|
|
|
|
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
|
|
|
/* Key assignement */
|
2008-01-23 08:25:04 +00:00
|
|
|
const struct button_mapping* plugin_contexts[]= {
|
2010-05-20 17:41:28 +00:00
|
|
|
pla_main_ctx,
|
2008-01-23 08:25:04 +00:00
|
|
|
#if defined(HAVE_REMOTE_LCD)
|
2010-05-20 17:41:28 +00:00
|
|
|
pla_remote_ctx,
|
2005-10-07 20:37:41 +00:00
|
|
|
#endif
|
2008-01-23 08:25:04 +00:00
|
|
|
};
|
|
|
|
|
2010-05-20 17:41:28 +00:00
|
|
|
#define FIRE_QUIT PLA_CANCEL
|
|
|
|
#define FIRE_SWITCH_FLAMES_TYPE PLA_LEFT
|
|
|
|
#define FIRE_SWITCH_FLAMES_MOVING PLA_RIGHT
|
|
|
|
|
|
|
|
#ifdef HAVE_SCROLLWHEEL
|
|
|
|
#define FIRE_INCREASE_MULT PLA_SCROLL_FWD
|
|
|
|
#define FIRE_INCREASE_MULT_REP PLA_SCROLL_FWD_REPEAT
|
|
|
|
#define FIRE_DECREASE_MULT PLA_SCROLL_BACK
|
|
|
|
#define FIRE_DECREASE_MULT_REP PLA_SCROLL_BACK_REPEAT
|
|
|
|
#else
|
|
|
|
#define FIRE_INCREASE_MULT PLA_UP
|
|
|
|
#define FIRE_INCREASE_MULT_REP PLA_UP_REPEAT
|
|
|
|
#define FIRE_DECREASE_MULT PLA_DOWN
|
|
|
|
#define FIRE_DECREASE_MULT_REP PLA_DOWN_REPEAT
|
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
|
|
|
#define MIN_FLAME_VALUE 0
|
2006-09-08 01:26:09 +00:00
|
|
|
#define COOL_MAX (440/LCD_HEIGHT+2)
|
|
|
|
|
2008-01-22 12:44:24 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
2008-01-23 08:25:04 +00:00
|
|
|
static unsigned char palette[256];
|
|
|
|
|
2011-10-15 20:38:08 +00:00
|
|
|
static void color_palette_init(unsigned char* palette)
|
2008-01-23 08:25:04 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for(i=0;i<=160;i++)//palette[i]=(3/2)*i
|
|
|
|
palette[i]=(i*3)/2;
|
|
|
|
|
2006-09-08 01:26:09 +00:00
|
|
|
/* 'regular' fire doesn't exceed this value */
|
2008-01-23 08:25:04 +00:00
|
|
|
for(;i<=255;i++)//palette[i]=(3/20)*i+216
|
|
|
|
palette[i]=(i*3+20*217)/20;
|
|
|
|
}
|
2006-02-26 21:26:07 +00:00
|
|
|
#else
|
2008-01-23 08:25:04 +00:00
|
|
|
|
|
|
|
static fb_data palette[256];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Color palette generation algorithm taken from
|
|
|
|
* the "The Demo Effects Collection" GPL project
|
|
|
|
* Copyright (C) 2002 W.P. van Paassen
|
|
|
|
*/
|
2011-10-15 20:38:08 +00:00
|
|
|
static void color_palette_init(fb_data* palette)
|
2008-01-23 08:25:04 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < 32; i++){
|
|
|
|
/* black to blue, 32 values*/
|
|
|
|
palette[i]=LCD_RGBPACK(0, 0, 2*i);
|
|
|
|
|
|
|
|
/* blue to red, 32 values*/
|
|
|
|
palette[i + 32]=LCD_RGBPACK(8*i, 0, 64 - 2*i);
|
|
|
|
|
|
|
|
/* red to yellow, 32 values*/
|
|
|
|
palette[i + 64]=LCD_RGBPACK(255, 8*i, 0);
|
|
|
|
|
|
|
|
/* yellow to white, 162 values */
|
|
|
|
palette[i + 96]=LCD_RGBPACK(255, 255, 0 + 4*i);
|
|
|
|
palette[i + 128]=LCD_RGBPACK(255, 255, 64 + 4*i);
|
|
|
|
palette[i + 160]=LCD_RGBPACK(255, 255, 128 + 4*i);
|
|
|
|
palette[i + 192]=LCD_RGBPACK(255, 255, 192 + i);
|
|
|
|
palette[i + 224]=LCD_RGBPACK(255, 255, 224 + i);
|
|
|
|
}
|
2009-09-02 02:41:32 +00:00
|
|
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
2009-09-04 00:46:24 +00:00
|
|
|
rb->lcd_pal256_update_pal(palette);
|
2009-09-02 02:41:32 +00:00
|
|
|
#endif
|
2008-01-23 08:25:04 +00:00
|
|
|
}
|
|
|
|
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
static void tab_init_rand(unsigned char *tab, unsigned int tab_size,
|
|
|
|
int rand_max)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
|
|
|
unsigned char *end = tab + tab_size;
|
|
|
|
|
|
|
|
while(tab < end)
|
|
|
|
*tab++ = (unsigned char)rb->rand() % rand_max;
|
|
|
|
}
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
struct fire {
|
|
|
|
unsigned char fire[LCD_HEIGHT+3][FIRE_WIDTH];
|
|
|
|
unsigned char cooling_map[LCD_HEIGHT][FIRE_WIDTH];
|
|
|
|
int flames_type;
|
|
|
|
bool moving;
|
|
|
|
unsigned int mult;
|
|
|
|
};
|
|
|
|
/* makes the instance a global variable since it's too big to fit on the target's stack */
|
|
|
|
static struct fire fire;
|
|
|
|
|
|
|
|
static inline void fire_convolve(struct fire* fire)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
2008-01-23 08:25:04 +00:00
|
|
|
unsigned int pixel_value;
|
2005-10-07 20:37:41 +00:00
|
|
|
unsigned int cooling_value;
|
|
|
|
unsigned char *ptr, *end, *cool;
|
2008-01-23 08:25:04 +00:00
|
|
|
unsigned int mult=fire->mult;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
|
|
|
rb->yield();
|
|
|
|
/* Convolve the pixels and handle cooling (to add nice shapes effects later) */
|
2008-01-23 08:25:04 +00:00
|
|
|
cool = &fire->cooling_map[0][0];
|
|
|
|
ptr = &fire->fire[0][0];
|
2008-01-07 00:01:26 +00:00
|
|
|
end = ptr + LCD_HEIGHT*FIRE_WIDTH;
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
switch (fire->flames_type){
|
|
|
|
case 0:
|
|
|
|
do{
|
|
|
|
pixel_value = ptr[FIRE_WIDTH-1] /* fire[y+1][x-1] */
|
2008-01-07 00:01:26 +00:00
|
|
|
+ ptr[2*FIRE_WIDTH] /* fire[y+2][x] */
|
|
|
|
+ ptr[FIRE_WIDTH+1] /* fire[y+1][x+1] */
|
|
|
|
+ ptr[3*FIRE_WIDTH]; /* fire[y+3][x] */
|
2008-01-23 08:25:04 +00:00
|
|
|
pixel_value = FMULU(pixel_value, mult) >> 10;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
cooling_value = *cool++;
|
|
|
|
if (cooling_value <= pixel_value)
|
|
|
|
pixel_value -= cooling_value;
|
|
|
|
/* else it's too cold, don't frost the pixels !!! */
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
if (pixel_value > 255)
|
|
|
|
pixel_value = 255;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
*ptr++ = pixel_value;
|
|
|
|
}while (ptr < end);
|
|
|
|
break;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
case 1:
|
|
|
|
mult -= 2;
|
|
|
|
do{
|
|
|
|
pixel_value = ptr[FIRE_WIDTH-1] /* fire[y+1][x-1] */
|
2008-01-07 00:01:26 +00:00
|
|
|
+ ptr[FIRE_WIDTH] /* fire[y+1][x] */
|
|
|
|
+ ptr[FIRE_WIDTH+1] /* fire[y+1][x+1] */
|
|
|
|
+ ptr[2*FIRE_WIDTH]; /* fire[y+2][x] */
|
2008-01-23 08:25:04 +00:00
|
|
|
pixel_value = FMULU(pixel_value, mult) >> 10;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
cooling_value = *cool++;
|
|
|
|
if (cooling_value <= pixel_value)
|
|
|
|
pixel_value -= cooling_value;
|
|
|
|
/* else it's too cold, don't frost the pixels !!! */
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
if (pixel_value > 255)
|
|
|
|
pixel_value = 255;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
*ptr++ = pixel_value;
|
|
|
|
}while (ptr < end);
|
|
|
|
break;
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
default: /* We should never reach this */
|
|
|
|
break;
|
2005-10-07 20:37:41 +00:00
|
|
|
}
|
|
|
|
rb->yield();
|
|
|
|
}
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
static void fire_generate_bottom_seed(struct fire* fire)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
2008-01-23 08:25:04 +00:00
|
|
|
unsigned char *ptr, *end;
|
|
|
|
ptr = &fire->fire[LCD_HEIGHT][0];
|
|
|
|
end = ptr + FIRE_WIDTH;
|
|
|
|
do{
|
|
|
|
*ptr++ = (MIN_FLAME_VALUE + rb->rand() % (256-MIN_FLAME_VALUE));
|
|
|
|
}while (ptr < end);
|
|
|
|
}
|
2008-01-22 12:44:24 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
static inline void fire_step(struct fire* fire)
|
|
|
|
{
|
|
|
|
if(fire->moving){
|
|
|
|
/* Randomize the bottom line */
|
|
|
|
fire_generate_bottom_seed(fire);
|
|
|
|
/* Add here further effects like fire letters, ball ... */
|
|
|
|
}
|
|
|
|
fire_convolve(fire);
|
|
|
|
}
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
static void fire_init(struct fire* fire)
|
|
|
|
{
|
|
|
|
fire->mult = 261;
|
|
|
|
fire->flames_type=0;
|
|
|
|
fire->moving=true;
|
|
|
|
rb->memset(&fire->fire[0][0], 0, sizeof(fire->fire));
|
|
|
|
tab_init_rand(&fire->cooling_map[0][0], LCD_HEIGHT*FIRE_WIDTH, COOL_MAX);
|
|
|
|
fire_generate_bottom_seed(fire);
|
|
|
|
}
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
static inline void fire_draw(struct fire* fire)
|
|
|
|
{
|
2009-09-02 02:41:32 +00:00
|
|
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
|
|
|
rb->lcd_blit_pal256((unsigned char*)&fire->fire[0][0],0,0,0,0,LCD_WIDTH,LCD_HEIGHT);
|
|
|
|
#else
|
2008-01-23 08:25:04 +00:00
|
|
|
int y;
|
|
|
|
unsigned char *src = &fire->fire[0][0];
|
2009-09-02 02:41:32 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
|
|
|
unsigned char *dest, *end;
|
2006-02-26 21:26:07 +00:00
|
|
|
#else
|
2008-01-07 00:01:26 +00:00
|
|
|
fb_data *dest, *end;
|
2008-01-23 08:25:04 +00:00
|
|
|
#endif
|
2006-02-26 21:26:07 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
for (y = 0; y < LCD_HEIGHT; y++){
|
|
|
|
#ifndef HAVE_LCD_COLOR
|
|
|
|
dest = draw_buffer;
|
|
|
|
#else
|
2008-01-07 00:01:26 +00:00
|
|
|
dest = rb->lcd_framebuffer + LCD_WIDTH * y + FIRE_XPOS;
|
2008-01-23 08:25:04 +00:00
|
|
|
#endif
|
2008-01-07 00:01:26 +00:00
|
|
|
end = dest + FIRE_WIDTH;
|
2006-09-08 01:26:09 +00:00
|
|
|
|
2008-01-07 00:01:26 +00:00
|
|
|
do
|
2008-01-23 08:25:04 +00:00
|
|
|
*dest++ = palette[*src++];
|
2008-01-07 00:01:26 +00:00
|
|
|
while (dest < end);
|
2008-01-23 08:25:04 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
|
|
|
grey_ub_gray_bitmap(draw_buffer, 0, y, FIRE_WIDTH, 1);
|
|
|
|
#endif
|
2008-01-07 00:01:26 +00:00
|
|
|
}
|
2008-01-23 08:25:04 +00:00
|
|
|
#ifdef HAVE_LCD_COLOR
|
2006-02-26 21:26:07 +00:00
|
|
|
rb->lcd_update();
|
|
|
|
#endif
|
2009-09-02 02:41:32 +00:00
|
|
|
|
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
}
|
|
|
|
|
2011-10-15 20:38:08 +00:00
|
|
|
static void cleanup(void *parameter)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
|
|
|
(void)parameter;
|
2006-04-09 15:00:30 +00:00
|
|
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
2005-10-07 20:37:41 +00:00
|
|
|
rb->cpu_boost(false);
|
|
|
|
#endif
|
2006-02-26 21:26:07 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
2008-01-07 00:01:26 +00:00
|
|
|
grey_release();
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2007-08-15 12:42:09 +00:00
|
|
|
/* Turn on backlight timeout (revert to settings) */
|
2011-01-24 12:29:16 +00:00
|
|
|
backlight_use_settings();
|
2005-10-07 20:37:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
#ifndef HAVE_LCD_COLOR
|
2011-10-15 20:38:08 +00:00
|
|
|
static int init_grey(void)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
2008-01-23 08:25:04 +00:00
|
|
|
unsigned char *gbuf;
|
|
|
|
size_t gbuf_size = 0;
|
2006-09-08 01:26:09 +00:00
|
|
|
|
2005-10-07 20:37:41 +00:00
|
|
|
/* get the remainder of the plugin buffer */
|
|
|
|
gbuf = (unsigned char *) rb->plugin_get_buffer(&gbuf_size);
|
2008-01-07 00:01:26 +00:00
|
|
|
|
2009-01-16 10:34:40 +00:00
|
|
|
if (!grey_init(gbuf, gbuf_size, GREY_ON_COP,
|
2008-04-06 13:59:31 +00:00
|
|
|
FIRE_WIDTH, LCD_HEIGHT, NULL)){
|
2007-03-16 21:56:08 +00:00
|
|
|
rb->splash(HZ, "not enough memory");
|
2005-10-07 20:37:41 +00:00
|
|
|
return PLUGIN_ERROR;
|
|
|
|
}
|
2008-01-07 00:01:26 +00:00
|
|
|
/* switch on greyscale overlay */
|
|
|
|
grey_set_position(FIRE_XPOS, 0);
|
|
|
|
grey_show(true);
|
2008-01-23 08:25:04 +00:00
|
|
|
return PLUGIN_OK;
|
|
|
|
}
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2011-10-15 20:51:12 +00:00
|
|
|
int main(void)
|
2008-01-23 08:25:04 +00:00
|
|
|
{
|
|
|
|
int action;
|
|
|
|
|
|
|
|
#ifndef HAVE_LCD_COLOR
|
|
|
|
if(init_grey()!=PLUGIN_OK)
|
|
|
|
return(PLUGIN_ERROR);
|
|
|
|
#endif
|
|
|
|
color_palette_init(palette);
|
|
|
|
|
2006-04-09 15:00:30 +00:00
|
|
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
2005-10-07 20:37:41 +00:00
|
|
|
rb->cpu_boost(true);
|
2006-02-26 21:26:07 +00:00
|
|
|
#endif
|
2008-01-23 08:25:04 +00:00
|
|
|
|
|
|
|
fire_init(&fire);
|
|
|
|
while (true){
|
|
|
|
fire_step(&fire);
|
|
|
|
fire_draw(&fire);
|
2005-10-07 20:37:41 +00:00
|
|
|
rb->yield();
|
|
|
|
|
2010-05-20 17:41:28 +00:00
|
|
|
action = pluginlib_getaction(0, plugin_contexts,
|
|
|
|
ARRAYLEN(plugin_contexts));
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
switch(action){
|
|
|
|
case FIRE_QUIT:
|
2005-10-07 20:37:41 +00:00
|
|
|
cleanup(NULL);
|
|
|
|
return PLUGIN_OK;
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
case FIRE_INCREASE_MULT:
|
|
|
|
++fire.mult;
|
2005-10-07 20:37:41 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
case FIRE_DECREASE_MULT:
|
|
|
|
if (fire.mult > 0)
|
|
|
|
--fire.mult;
|
2005-10-07 20:37:41 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
case FIRE_SWITCH_FLAMES_TYPE:
|
|
|
|
fire.flames_type = (fire.flames_type + 1) % 2;
|
2005-10-07 20:37:41 +00:00
|
|
|
break;
|
|
|
|
|
2008-01-23 08:25:04 +00:00
|
|
|
case FIRE_SWITCH_FLAMES_MOVING:
|
|
|
|
fire.moving = !fire.moving;
|
2005-10-07 20:37:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2008-01-23 08:25:04 +00:00
|
|
|
if (rb->default_event_handler_ex(action, cleanup, NULL)
|
2005-10-07 20:37:41 +00:00
|
|
|
== SYS_USB_CONNECTED)
|
|
|
|
return PLUGIN_USB_CONNECTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************** Plugin entry point ****************************/
|
|
|
|
|
2009-01-16 10:34:40 +00:00
|
|
|
enum plugin_status plugin_start(const void* parameter)
|
2005-10-07 20:37:41 +00:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
(void)parameter;
|
2006-11-15 06:46:35 +00:00
|
|
|
#if LCD_DEPTH > 1
|
2006-11-15 06:14:27 +00:00
|
|
|
rb->lcd_set_backdrop(NULL);
|
2006-11-15 06:46:35 +00:00
|
|
|
#endif
|
2007-08-15 12:42:09 +00:00
|
|
|
/* Turn off backlight timeout */
|
2011-01-24 12:29:16 +00:00
|
|
|
backlight_ignore_timeout();
|
2005-10-07 20:37:41 +00:00
|
|
|
|
2009-09-02 02:41:32 +00:00
|
|
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
|
|
|
rb->lcd_set_mode(LCD_MODE_PAL256);
|
|
|
|
#endif
|
|
|
|
|
2005-10-07 20:37:41 +00:00
|
|
|
ret = main();
|
2009-09-02 02:41:32 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
|
|
|
rb->lcd_set_mode(LCD_MODE_RGB565);
|
|
|
|
#endif
|
2005-10-07 20:37:41 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|