mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Bring mpegplayer backlight fix to the other plugins, this also fixes some wrongly ifdef'd backlight calls.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14352 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f2b5c29234
commit
cb53e3cef4
19 changed files with 100 additions and 87 deletions
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "configfile.h" /* Part of libplugin */
|
#include "configfile.h" /* Part of libplugin */
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -2029,9 +2030,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn off backlight timeout */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout(1);
|
|
||||||
|
|
||||||
/* now go ahead and have fun! */
|
/* now go ahead and have fun! */
|
||||||
while (game_loop()!=1);
|
while (game_loop()!=1);
|
||||||
|
@ -2040,7 +2040,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
/* Restore user's original backlight setting */
|
/* Restore user's original backlight setting */
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "xlcd.h"
|
#include "xlcd.h"
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -947,9 +948,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->lcd_set_foreground(LCD_WHITE);
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn off backlight timeout */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout(1);
|
|
||||||
|
|
||||||
rb->srand( *rb->current_tick );
|
rb->srand( *rb->current_tick );
|
||||||
|
|
||||||
|
@ -962,9 +962,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
configfile_save(CFG_FILE, config, 1, 0);
|
configfile_save(CFG_FILE, config, 1, 0);
|
||||||
|
|
||||||
/* Restore user's original backlight setting */
|
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb = api;
|
rb = api;
|
||||||
|
|
||||||
/* Turn off backlight timeout */
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1);
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
rb->show_logo();
|
rb->show_logo();
|
||||||
#ifdef HAVE_LCD_CHARCELLS
|
#ifdef HAVE_LCD_CHARCELLS
|
||||||
|
@ -55,8 +56,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
roll_credits();
|
roll_credits();
|
||||||
|
|
||||||
end_of_proc:
|
end_of_proc:
|
||||||
/* Restore the values we've changed */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
|
@ -330,7 +331,8 @@ void cleanup(void *parameter)
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
gray_release();
|
gray_release();
|
||||||
#endif
|
#endif
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -420,8 +422,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1);/* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
ret = main();
|
ret = main();
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "oldmenuapi.h"
|
#include "oldmenuapi.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -379,7 +380,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
/* set everything up.. no BL timeout, no backdrop,
|
/* set everything up.. no BL timeout, no backdrop,
|
||||||
white-text-on-black-background. */
|
white-text-on-black-background. */
|
||||||
rb->backlight_set_timeout(1);
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
rb->lcd_set_background(LCD_BLACK);
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
|
@ -535,7 +536,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
rb->cpu_boost(true);
|
rb->cpu_boost(true);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
|
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4)
|
||||||
#include "gray.h"
|
#include "gray.h"
|
||||||
|
@ -85,8 +86,8 @@ void cleanup(void *parameter)
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
|
|
||||||
gray_release(); /* switch off overlay and deinitialize */
|
gray_release(); /* switch off overlay and deinitialize */
|
||||||
/* restore normal backlight setting */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is only a demo of what the framework can do */
|
/* this is only a demo of what the framework can do */
|
||||||
|
@ -170,8 +171,8 @@ int main(void)
|
||||||
110,110,110,110,110,110,110
|
110,110,110,110,110,110,110
|
||||||
};
|
};
|
||||||
|
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1); /* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED); /* select default font */
|
rb->lcd_setfont(FONT_SYSFIXED); /* select default font */
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "highscore.h"
|
#include "highscore.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -1764,9 +1765,8 @@ enum plugin_status plugin_start(struct plugin_api* api, UNUSED void* parameter)
|
||||||
rb = api;
|
rb = api;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn off backlight timeout */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout(1);
|
|
||||||
|
|
||||||
/* now go ahead and have fun! */
|
/* now go ahead and have fun! */
|
||||||
game_loop();
|
game_loop();
|
||||||
|
@ -1783,7 +1783,8 @@ enum plugin_status plugin_start(struct plugin_api* api, UNUSED void* parameter)
|
||||||
|
|
||||||
/* Restore user's original backlight setting */
|
/* Restore user's original backlight setting */
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "playback_control.h"
|
#include "playback_control.h"
|
||||||
#include "oldmenuapi.h"
|
#include "oldmenuapi.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#include "gray.h"
|
#include "gray.h"
|
||||||
|
@ -3309,14 +3310,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
buf_images = buf; buf_images_size = buf_size;
|
buf_images = buf; buf_images_size = buf_size;
|
||||||
|
|
||||||
/* make sure the backlight is always on when viewing pictures
|
/* Turn off backlight timeout */
|
||||||
(actually it should also set the timeout when plugged in,
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
but the function backlight_set_timeout_plugged is not
|
|
||||||
available in plugins) */
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
|
||||||
rb->backlight_set_timeout(1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -3339,10 +3334,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->ata_spindown(rb->global_settings->disk_spindown);
|
rb->ata_spindown(rb->global_settings->disk_spindown);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BACKLIGHT
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
/* reset backlight settings */
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USEGSLIB
|
#ifdef USEGSLIB
|
||||||
gray_release(); /* deinitialize */
|
gray_release(); /* deinitialize */
|
||||||
|
|
|
@ -26,11 +26,13 @@ extern struct plugin_api* rb;
|
||||||
void backlight_force_on(void)
|
void backlight_force_on(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_BACKLIGHT
|
#ifdef HAVE_BACKLIGHT
|
||||||
rb->backlight_set_timeout(1);
|
if (rb->global_settings->backlight_timeout > 1)
|
||||||
|
rb->backlight_set_timeout(1);
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
rb->backlight_set_timeout_plugged(1);
|
if (rb->global_settings->backlight_timeout_plugged > 1)
|
||||||
#endif
|
rb->backlight_set_timeout_plugged(1);
|
||||||
#endif
|
#endif /* CONFIG_CHARGING */
|
||||||
|
#endif /* HAVE_BACKLIGHT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reset backlight operation to its settings */
|
/* reset backlight operation to its settings */
|
||||||
|
@ -41,6 +43,6 @@ void backlight_use_settings(void)
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
rb->backlight_set_timeout_plugged(rb->global_settings-> \
|
rb->backlight_set_timeout_plugged(rb->global_settings-> \
|
||||||
backlight_timeout_plugged);
|
backlight_timeout_plugged);
|
||||||
#endif
|
#endif /* CONFIG_CHARGING */
|
||||||
#endif
|
#endif /* HAVE_BACKLIGHT */
|
||||||
}
|
}
|
||||||
|
|
|
@ -1857,7 +1857,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
backlight_force_on();
|
/* Turn off backlight timeout */
|
||||||
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||||
rb->cpu_boost(true);
|
rb->cpu_boost(true);
|
||||||
|
@ -1994,7 +1995,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
|
||||||
|
|
||||||
backlight_use_settings();
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#include "xlcd.h"
|
#include "xlcd.h"
|
||||||
|
@ -562,9 +563,8 @@ void cleanup(void *parameter)
|
||||||
rb->lcd_set_foreground(LCD_DEFAULT_FG);
|
rb->lcd_set_foreground(LCD_DEFAULT_FG);
|
||||||
rb->lcd_set_background(LCD_DEFAULT_BG);
|
rb->lcd_set_background(LCD_DEFAULT_BG);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_COLOR
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
@ -593,9 +593,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
rb->backlight_set_timeout(1); /* keep the light on */
|
/* Turn off backlight timeout */
|
||||||
#endif
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
rb->lcd_getstringsize("A", NULL, &font_height);
|
rb->lcd_getstringsize("A", NULL, &font_height);
|
||||||
|
|
||||||
while (!exit)
|
while (!exit)
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
@ -170,7 +171,8 @@ void cleanup(void *parameter)
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
gray_release();
|
gray_release();
|
||||||
#endif
|
#endif
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -299,8 +301,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1);/* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
ret = main();
|
ret = main();
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "highscore.h"
|
#include "highscore.h"
|
||||||
#include "playergfx.h"
|
#include "playergfx.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -853,17 +854,14 @@ static int rockblox_loop (void)
|
||||||
while (1) {
|
while (1) {
|
||||||
#ifdef HAS_BUTTON_HOLD
|
#ifdef HAS_BUTTON_HOLD
|
||||||
if (rb->button_hold ()) {
|
if (rb->button_hold ()) {
|
||||||
/* Restore user's original backlight setting */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout (rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
rb->splash(0, "Paused");
|
rb->splash(0, "Paused");
|
||||||
while (rb->button_hold ())
|
while (rb->button_hold ())
|
||||||
rb->sleep(HZ/10);
|
rb->sleep(HZ/10);
|
||||||
|
|
||||||
/* Permanently enable the backlight (unless the user has
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
turned it off) */
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
|
||||||
rb->backlight_set_timeout (1);
|
|
||||||
|
|
||||||
/* get rid of the splash text */
|
/* get rid of the splash text */
|
||||||
rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||||
|
@ -1031,9 +1029,8 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout (1);
|
|
||||||
|
|
||||||
init_rockblox ();
|
init_rockblox ();
|
||||||
ret = rockblox_loop ();
|
ret = rockblox_loop ();
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
/******************************* Globals ***********************************/
|
/******************************* Globals ***********************************/
|
||||||
|
@ -1935,13 +1937,14 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
rb->backlight_set_timeout(1);
|
/* Turn off backlight timeout */
|
||||||
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
iohiscore();
|
iohiscore();
|
||||||
retval = start_game();
|
retval = start_game();
|
||||||
iohiscore();
|
iohiscore();
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
/* restore normal backlight setting*/
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
|
||||||
|
|
||||||
|
@ -364,7 +365,8 @@ int plugin_main(void)
|
||||||
#endif
|
#endif
|
||||||
case(STARFIELD_QUIT):
|
case(STARFIELD_QUIT):
|
||||||
case(SYS_USB_CONNECTED):
|
case(SYS_USB_CONNECTED):
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c*/
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -379,8 +381,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
rb = api; /* copy to global api pointer */
|
rb = api; /* copy to global api pointer */
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1);/* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
ret = plugin_main();
|
ret = plugin_main();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "oldmenuapi.h"
|
#include "oldmenuapi.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -437,16 +438,16 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
rb->srand(*rb->current_tick);
|
rb->srand(*rb->current_tick);
|
||||||
|
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1); /* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
m = menu_init(rb, items, sizeof(items) / sizeof(*items), NULL,
|
m = menu_init(rb, items, sizeof(items) / sizeof(*items), NULL,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
menu_run(m);
|
menu_run(m);
|
||||||
menu_exit(m);
|
menu_exit(m);
|
||||||
|
|
||||||
/* restore normal backlight setting */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
rb->rmdir(testbasedir);
|
rb->rmdir(testbasedir);
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "sh7034.h"
|
#include "sh7034.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
#ifndef SIMULATOR /* not for simulator by now */
|
#ifndef SIMULATOR /* not for simulator by now */
|
||||||
#ifdef HAVE_LCD_BITMAP /* and definitely not for the Player, haha */
|
#ifdef HAVE_LCD_BITMAP /* and definitely not for the Player, haha */
|
||||||
|
@ -559,8 +560,8 @@ void Cleanup(void *fd)
|
||||||
if (gPlay.bHasAudio)
|
if (gPlay.bHasAudio)
|
||||||
rb->mp3_play_stop(); /* stop audio ISR */
|
rb->mp3_play_stop(); /* stop audio ISR */
|
||||||
|
|
||||||
/* restore normal backlight setting */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
/* restore normal contrast */
|
/* restore normal contrast */
|
||||||
rb->lcd_set_contrast(rb->global_settings->contrast);
|
rb->lcd_set_contrast(rb->global_settings->contrast);
|
||||||
|
@ -924,8 +925,8 @@ int main(char* filename)
|
||||||
if (gFileHdr.video_format == VIDEOFORMAT_RAW)
|
if (gFileHdr.video_format == VIDEOFORMAT_RAW)
|
||||||
{
|
{
|
||||||
gPlay.bHasVideo = true;
|
gPlay.bHasVideo = true;
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
/* Turn off backlight timeout */
|
||||||
rb->backlight_set_timeout(1); /* keep the light on */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prepare audio playback, if contained */
|
/* prepare audio playback, if contained */
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -2332,9 +2333,8 @@ bool launch_wormlet(void)
|
||||||
|
|
||||||
rb->lcd_clear_display();
|
rb->lcd_clear_display();
|
||||||
|
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn off backlight timeout */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout(1);
|
|
||||||
|
|
||||||
/* start the game */
|
/* start the game */
|
||||||
while (game_result == 1)
|
while (game_result == 1)
|
||||||
|
@ -2343,8 +2343,8 @@ bool launch_wormlet(void)
|
||||||
switch (game_result)
|
switch (game_result)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
/* Restore user's original backlight setting */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "helper.h"
|
||||||
|
|
||||||
PLUGIN_HEADER
|
PLUGIN_HEADER
|
||||||
|
|
||||||
|
@ -932,9 +933,8 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Permanently enable the backlight (unless the user has turned it off) */
|
/* Turn off backlight timeout */
|
||||||
if (rb->global_settings->backlight_timeout > 0)
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
rb->backlight_set_timeout (1);
|
|
||||||
|
|
||||||
quit = false;
|
quit = false;
|
||||||
|
|
||||||
|
@ -944,7 +944,8 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
|
||||||
ret = xobox_loop ();
|
ret = xobox_loop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
rb->backlight_set_timeout (rb->global_settings->backlight_timeout);
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
backlight_use_settings(); /* backlight control in lib/helper.c */
|
||||||
rb->lcd_setfont (FONT_UI);
|
rb->lcd_setfont (FONT_UI);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue