summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/2048.c4
-rw-r--r--apps/plugins/brickmania.c6
-rw-r--r--apps/plugins/chessclock.c8
-rw-r--r--apps/plugins/demystify.c4
-rw-r--r--apps/plugins/doom/rockdoom.c5
-rw-r--r--apps/plugins/fire.c6
-rw-r--r--apps/plugins/fireworks.c5
-rw-r--r--apps/plugins/imageviewer/imageviewer.c4
-rw-r--r--apps/plugins/invadrox.c6
-rw-r--r--apps/plugins/lrcplayer.c4
-rw-r--r--apps/plugins/maze.c4
-rw-r--r--apps/plugins/mazezam.c5
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c4
-rw-r--r--apps/plugins/oscilloscope.c5
-rwxr-xr-xapps/plugins/pacbox/pacbox.c6
-rw-r--r--apps/plugins/plasma.c5
-rw-r--r--apps/plugins/pong.c5
-rw-r--r--apps/plugins/resistor.c45
-rw-r--r--apps/plugins/rockblox.c10
-rw-r--r--apps/plugins/rockboy/menu.c6
-rw-r--r--apps/plugins/rockboy/rockboy.c5
-rw-r--r--apps/plugins/rocklife.c4
-rw-r--r--apps/plugins/sdl/main.c6
-rw-r--r--apps/plugins/spacerocks.c4
-rw-r--r--apps/plugins/speedread.c4
-rw-r--r--apps/plugins/starfield.c7
-rw-r--r--apps/plugins/stats.c2
-rw-r--r--apps/plugins/wormlet.c5
-rw-r--r--apps/plugins/xobox.c5
-rw-r--r--apps/plugins/xworld/sys.c4
30 files changed, 149 insertions, 44 deletions
diff --git a/apps/plugins/2048.c b/apps/plugins/2048.c
index 08be294d88..1604b73c62 100644
--- a/apps/plugins/2048.c
+++ b/apps/plugins/2048.c
@@ -148,7 +148,9 @@ static inline int rand_range(int min, int max)
148/* prepares for exit */ 148/* prepares for exit */
149static void cleanup(void) 149static void cleanup(void)
150{ 150{
151#ifdef HAVE_BACKLIGHT
151 backlight_use_settings(); 152 backlight_use_settings();
153#endif
152} 154}
153 155
154/* returns 2 or 4 */ 156/* returns 2 or 4 */
@@ -698,7 +700,9 @@ static void init_game(bool newgame)
698 max_numeral_width = rb->font_get_width(rb->font_get(WHAT_FONT), '0'); 700 max_numeral_width = rb->font_get_width(rb->font_get(WHAT_FONT), '0');
699#endif 701#endif
700 702
703#ifdef HAVE_BACKLIGHT
701 backlight_ignore_timeout(); 704 backlight_ignore_timeout();
705#endif
702 draw(); 706 draw();
703} 707}
704 708
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index dd46f98b8e..5764c6869d 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -2526,9 +2526,10 @@ enum plugin_status plugin_start(const void* parameter)
2526#if LCD_DEPTH > 1 2526#if LCD_DEPTH > 1
2527 rb->lcd_set_backdrop(NULL); 2527 rb->lcd_set_backdrop(NULL);
2528#endif 2528#endif
2529#ifdef HAVE_BACKLIGHT
2529 /* Turn off backlight timeout */ 2530 /* Turn off backlight timeout */
2530 backlight_ignore_timeout(); 2531 backlight_ignore_timeout();
2531 2532#endif
2532 /* now go ahead and have fun! */ 2533 /* now go ahead and have fun! */
2533 rb->srand( *rb->current_tick ); 2534 rb->srand( *rb->current_tick );
2534 brickmania_loadgame(); 2535 brickmania_loadgame();
@@ -2557,8 +2558,9 @@ enum plugin_status plugin_start(const void* parameter)
2557 configfile_save(CONFIG_FILE_NAME,config,1,0); 2558 configfile_save(CONFIG_FILE_NAME,config,1,0);
2558 /* Restore user's original backlight setting */ 2559 /* Restore user's original backlight setting */
2559 rb->lcd_setfont(FONT_UI); 2560 rb->lcd_setfont(FONT_UI);
2561#ifdef HAVE_BACKLIGHT
2560 /* Turn on backlight timeout (revert to settings) */ 2562 /* Turn on backlight timeout (revert to settings) */
2561 backlight_use_settings(); 2563 backlight_use_settings();
2562 2564#endif
2563 return PLUGIN_OK; 2565 return PLUGIN_OK;
2564} 2566}
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index fea966213d..649ab164d0 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -21,8 +21,6 @@
21#include "plugin.h" 21#include "plugin.h"
22#include "lib/playback_control.h" 22#include "lib/playback_control.h"
23 23
24
25
26/* variable button definitions */ 24/* variable button definitions */
27#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ 25#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
28 (CONFIG_KEYPAD == IRIVER_H300_PAD) 26 (CONFIG_KEYPAD == IRIVER_H300_PAD)
@@ -636,15 +634,19 @@ static int run_timer(int nr)
636 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"ROUND UP!"); 634 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"ROUND UP!");
637 else 635 else
638 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"TIME OUT!"); 636 rb->lcd_puts(0, FIRST_LINE+1, (unsigned char *)"TIME OUT!");
637#ifdef HAVE_BACKLIGHT
639 rb->backlight_on(); 638 rb->backlight_on();
639#endif
640 ticks = max_ticks; 640 ticks = max_ticks;
641 } else { 641 } else {
642 now=*rb->current_tick; 642 now=*rb->current_tick;
643 if (!chesspause) { 643 if (!chesspause) {
644 ticks+=now-last_tick; 644 ticks+=now-last_tick;
645 if ((max_ticks-ticks)/HZ == 10) { 645 if ((max_ticks-ticks)/HZ == 10) {
646 /* Backlight on if 10 seconds remain */ 646#ifdef HAVE_BACKLIGHT
647 /* Backlight on if 10 seconds remain */
647 rb->backlight_on(); 648 rb->backlight_on();
649#endif
648 } 650 }
649 } 651 }
650 last_tick=now; 652 last_tick=now;
diff --git a/apps/plugins/demystify.c b/apps/plugins/demystify.c
index a389018c4e..74537e94f8 100644
--- a/apps/plugins/demystify.c
+++ b/apps/plugins/demystify.c
@@ -262,10 +262,12 @@ static void polygons_draw(struct polygon_fifo * polygons, struct screen * displa
262 262
263static void cleanup(void) 263static void cleanup(void)
264{ 264{
265#ifdef HAVE_BACKLIGHT
265 backlight_use_settings(); 266 backlight_use_settings();
266#ifdef HAVE_REMOTE_LCD 267#ifdef HAVE_REMOTE_LCD
267 remote_backlight_use_settings(); 268 remote_backlight_use_settings();
268#endif 269#endif
270#endif
269} 271}
270 272
271#ifdef HAVE_LCD_COLOR 273#ifdef HAVE_LCD_COLOR
@@ -436,10 +438,12 @@ enum plugin_status plugin_start(const void* parameter)
436#if LCD_DEPTH > 1 438#if LCD_DEPTH > 1
437 rb->lcd_set_backdrop(NULL); 439 rb->lcd_set_backdrop(NULL);
438#endif 440#endif
441#ifdef HAVE_BACKLIGHT
439 backlight_ignore_timeout(); 442 backlight_ignore_timeout();
440#ifdef HAVE_REMOTE_LCD 443#ifdef HAVE_REMOTE_LCD
441 remote_backlight_ignore_timeout(); 444 remote_backlight_ignore_timeout();
442#endif 445#endif
446#endif
443 ret = plugin_main(); 447 ret = plugin_main();
444 448
445 return ret; 449 return ret;
diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c
index 85e3225af8..6594859c08 100644
--- a/apps/plugins/doom/rockdoom.c
+++ b/apps/plugins/doom/rockdoom.c
@@ -722,7 +722,9 @@ enum plugin_status plugin_start(const void* parameter)
722 systemvol= rb->global_settings->volume-rb->global_settings->volume%mod; 722 systemvol= rb->global_settings->volume-rb->global_settings->volume%mod;
723 general_translucency = default_translucency; // phares 723 general_translucency = default_translucency; // phares
724 724
725#ifdef HAVE_BACKLIGHT
725 backlight_ignore_timeout(); 726 backlight_ignore_timeout();
727#endif
726#ifdef RB_PROFILE 728#ifdef RB_PROFILE
727 rb->profile_thread(); 729 rb->profile_thread();
728#endif 730#endif
@@ -736,8 +738,9 @@ enum plugin_status plugin_start(const void* parameter)
736#ifdef RB_PROFILE 738#ifdef RB_PROFILE
737 rb->profstop(); 739 rb->profstop();
738#endif 740#endif
741#ifdef HAVE_BACKLIGHT
739 backlight_use_settings(); 742 backlight_use_settings();
740 743#endif
741 M_SaveDefaults (); 744 M_SaveDefaults ();
742 745
743 I_Quit(); // Make SURE everything was closed out right 746 I_Quit(); // Make SURE everything was closed out right
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index 4fc30173da..8873642f3c 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -277,8 +277,10 @@ static void cleanup(void *parameter)
277#ifndef HAVE_LCD_COLOR 277#ifndef HAVE_LCD_COLOR
278 grey_release(); 278 grey_release();
279#endif 279#endif
280#ifdef HAVE_BACKLIGHT
280 /* Turn on backlight timeout (revert to settings) */ 281 /* Turn on backlight timeout (revert to settings) */
281 backlight_use_settings(); 282 backlight_use_settings();
283#endif
282} 284}
283 285
284 286
@@ -366,15 +368,17 @@ enum plugin_status plugin_start(const void* parameter)
366#if LCD_DEPTH > 1 368#if LCD_DEPTH > 1
367 rb->lcd_set_backdrop(NULL); 369 rb->lcd_set_backdrop(NULL);
368#endif 370#endif
371#ifdef HAVE_BACKLIGHT
369 /* Turn off backlight timeout */ 372 /* Turn off backlight timeout */
370 backlight_ignore_timeout(); 373 backlight_ignore_timeout();
374#endif
371 375
372#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 376#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
373 rb->lcd_set_mode(LCD_MODE_PAL256); 377 rb->lcd_set_mode(LCD_MODE_PAL256);
374#endif 378#endif
375 379
376 ret = main(); 380 ret = main();
377 381
378#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 382#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
379 rb->lcd_set_mode(LCD_MODE_RGB565); 383 rb->lcd_set_mode(LCD_MODE_RGB565);
380#endif 384#endif
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index d6ca6618cb..b7dad0d8ba 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -358,7 +358,9 @@ enum plugin_status plugin_start(const void* parameter)
358 358
359 /* set everything up.. no BL timeout, no backdrop, 359 /* set everything up.. no BL timeout, no backdrop,
360 white-text-on-black-background. */ 360 white-text-on-black-background. */
361#ifdef HAVE_BACKLIGHT
361 backlight_ignore_timeout(); 362 backlight_ignore_timeout();
363#endif
362#if LCD_DEPTH > 1 364#if LCD_DEPTH > 1
363 rb->lcd_set_backdrop(NULL); 365 rb->lcd_set_backdrop(NULL);
364 rb->lcd_set_background(LCD_BLACK); 366 rb->lcd_set_background(LCD_BLACK);
@@ -522,9 +524,10 @@ enum plugin_status plugin_start(const void* parameter)
522 break; 524 break;
523 } 525 }
524 } 526 }
527#ifdef HAVE_BACKLIGHT
525 /* Turn on backlight timeout (revert to settings) */ 528 /* Turn on backlight timeout (revert to settings) */
526 backlight_use_settings(); 529 backlight_use_settings();
527 530#endif
528#ifdef HAVE_ADJUSTABLE_CPU_FREQ 531#ifdef HAVE_ADJUSTABLE_CPU_FREQ
529 rb->cpu_boost(false); 532 rb->cpu_boost(false);
530#endif 533#endif
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c
index c6d33dad38..4070f4b513 100644
--- a/apps/plugins/imageviewer/imageviewer.c
+++ b/apps/plugins/imageviewer/imageviewer.c
@@ -1025,8 +1025,10 @@ enum plugin_status plugin_start(const void* parameter)
1025 ARRAYLEN(config), IMGVIEW_SETTINGS_MINVERSION); 1025 ARRAYLEN(config), IMGVIEW_SETTINGS_MINVERSION);
1026 rb->memcpy(&old_settings, &settings, sizeof (settings)); 1026 rb->memcpy(&old_settings, &settings, sizeof (settings));
1027 1027
1028#ifdef HAVE_BACKLIGHT
1028 /* Turn off backlight timeout */ 1029 /* Turn off backlight timeout */
1029 backlight_ignore_timeout(); 1030 backlight_ignore_timeout();
1031#endif
1030 1032
1031#if LCD_DEPTH > 1 1033#if LCD_DEPTH > 1
1032 rb->lcd_set_backdrop(NULL); 1034 rb->lcd_set_backdrop(NULL);
@@ -1053,8 +1055,10 @@ enum plugin_status plugin_start(const void* parameter)
1053 rb->storage_spindown(rb->global_settings->disk_spindown); 1055 rb->storage_spindown(rb->global_settings->disk_spindown);
1054#endif 1056#endif
1055 1057
1058#ifdef HAVE_BACKLIGHT
1056 /* Turn on backlight timeout (revert to settings) */ 1059 /* Turn on backlight timeout (revert to settings) */
1057 backlight_use_settings(); 1060 backlight_use_settings();
1061#endif
1058 1062
1059#ifdef USEGSLIB 1063#ifdef USEGSLIB
1060 grey_release(); /* deinitialize */ 1064 grey_release(); /* deinitialize */
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index e7529895ac..e275129d27 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -1899,8 +1899,9 @@ enum plugin_status plugin_start(UNUSED const void* parameter)
1899{ 1899{
1900 rb->lcd_setfont(FONT_SYSFIXED); 1900 rb->lcd_setfont(FONT_SYSFIXED);
1901 /* Turn off backlight timeout */ 1901 /* Turn off backlight timeout */
1902#ifdef HAVE_BACKLIGHT
1902 backlight_ignore_timeout(); 1903 backlight_ignore_timeout();
1903 1904#endif
1904 /* now go ahead and have fun! */ 1905 /* now go ahead and have fun! */
1905 game_loop(); 1906 game_loop();
1906 1907
@@ -1916,8 +1917,9 @@ enum plugin_status plugin_start(UNUSED const void* parameter)
1916 /* Restore user's original backlight setting */ 1917 /* Restore user's original backlight setting */
1917 rb->lcd_setfont(FONT_UI); 1918 rb->lcd_setfont(FONT_UI);
1918 /* Turn on backlight timeout (revert to settings) */ 1919 /* Turn on backlight timeout (revert to settings) */
1920#ifdef HAVE_BACKLIGHT
1919 backlight_use_settings(); 1921 backlight_use_settings();
1920 1922#endif
1921 return PLUGIN_OK; 1923 return PLUGIN_OK;
1922} 1924}
1923 1925
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c
index 2c7742fd94..2abfbef6c9 100644
--- a/apps/plugins/lrcplayer.c
+++ b/apps/plugins/lrcplayer.c
@@ -2687,8 +2687,10 @@ static int lrc_main(void)
2687 vp_lyrics[i].height -= h; 2687 vp_lyrics[i].height -= h;
2688 } 2688 }
2689 2689
2690#ifdef HAVE_BACKLIGHT
2690 if (prefs.backlight_on) 2691 if (prefs.backlight_on)
2691 backlight_ignore_timeout(); 2692 backlight_ignore_timeout();
2693#endif
2692 2694
2693 /* in case settings that may affect break position 2695 /* in case settings that may affect break position
2694 * are changed (statusbar_on and wrap). */ 2696 * are changed (statusbar_on and wrap). */
@@ -2780,8 +2782,10 @@ static int lrc_main(void)
2780 FOR_NB_SCREENS(i) 2782 FOR_NB_SCREENS(i)
2781 rb->viewportmanager_theme_undo(i, false); 2783 rb->viewportmanager_theme_undo(i, false);
2782 2784
2785#ifdef HAVE_BACKLIGHT
2783 if (prefs.backlight_on) 2786 if (prefs.backlight_on)
2784 backlight_use_settings(); 2787 backlight_use_settings();
2788#endif
2785 2789
2786 return ret; 2790 return ret;
2787} 2791}
diff --git a/apps/plugins/maze.c b/apps/plugins/maze.c
index bcdb4ff553..20d5c82495 100644
--- a/apps/plugins/maze.c
+++ b/apps/plugins/maze.c
@@ -498,8 +498,10 @@ enum plugin_status plugin_start(const void* parameter)
498 struct maze maze; 498 struct maze maze;
499 (void)parameter; 499 (void)parameter;
500 500
501#ifdef HAVE_BACKLIGHT
501 /* Turn off backlight timeout */ 502 /* Turn off backlight timeout */
502 backlight_ignore_timeout(); 503 backlight_ignore_timeout();
504#endif
503 505
504 /* Seed the RNG */ 506 /* Seed the RNG */
505 rb->srand(*rb->current_tick); 507 rb->srand(*rb->current_tick);
@@ -589,6 +591,8 @@ enum plugin_status plugin_start(const void* parameter)
589#endif 591#endif
590 } 592 }
591 /* Turn on backlight timeout (revert to settings) */ 593 /* Turn on backlight timeout (revert to settings) */
594#ifdef HAVE_BACKLIGHT
592 backlight_use_settings(); 595 backlight_use_settings();
596#endif
593 return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED); 597 return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED);
594} 598}
diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c
index 423b09288d..cd7b6e22a8 100644
--- a/apps/plugins/mazezam.c
+++ b/apps/plugins/mazezam.c
@@ -256,7 +256,9 @@ static void store_lcd_settings(void)
256******************************************************************************/ 256******************************************************************************/
257static void restore_lcd_settings(void) { 257static void restore_lcd_settings(void) {
258 /* Turn on backlight timeout (revert to settings) */ 258 /* Turn on backlight timeout (revert to settings) */
259#ifdef HAVE_BACKLIGHT
259 backlight_use_settings(); 260 backlight_use_settings();
261#endif
260 262
261 /* Restore the old settings */ 263 /* Restore the old settings */
262#if LCD_DEPTH > 1 264#if LCD_DEPTH > 1
@@ -270,9 +272,10 @@ static void restore_lcd_settings(void) {
270* Adjust the LCD settings to suit MazezaM levels 272* Adjust the LCD settings to suit MazezaM levels
271******************************************************************************/ 273******************************************************************************/
272static void plugin_lcd_settings(void) { 274static void plugin_lcd_settings(void) {
275#ifdef HAVE_BACKLIGHT
273 /* Turn off backlight timeout */ 276 /* Turn off backlight timeout */
274 backlight_ignore_timeout(); 277 backlight_ignore_timeout();
275 278#endif
276 /* Set the new settings */ 279 /* Set the new settings */
277#ifdef HAVE_LCD_COLOR 280#ifdef HAVE_LCD_COLOR
278 rb->lcd_set_background(MAZEZAM_BG_COLOR); 281 rb->lcd_set_background(MAZEZAM_BG_COLOR);
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index eed1fab6d7..5c06fe257d 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -1204,8 +1204,10 @@ static void osd_lcd_enable_hook(unsigned short id, void* param)
1204static void osdbacklight_hw_on_video_mode(bool video_on) 1204static void osdbacklight_hw_on_video_mode(bool video_on)
1205{ 1205{
1206 if (video_on) { 1206 if (video_on) {
1207#ifdef HAVE_BACKLIGHT
1207 /* Turn off backlight timeout */ 1208 /* Turn off backlight timeout */
1208 backlight_ignore_timeout(); 1209 backlight_ignore_timeout();
1210#endif
1209#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1211#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
1210 rb->remove_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook); 1212 rb->remove_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook);
1211#endif 1213#endif
@@ -1213,8 +1215,10 @@ static void osdbacklight_hw_on_video_mode(bool video_on)
1213#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1215#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
1214 rb->add_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook); 1216 rb->add_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook);
1215#endif 1217#endif
1218#ifdef HAVE_BACKLIGHT
1216 /* Revert to user's backlight settings */ 1219 /* Revert to user's backlight settings */
1217 backlight_use_settings(); 1220 backlight_use_settings();
1221#endif
1218 } 1222 }
1219} 1223}
1220 1224
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 2af70204a1..4fd1883f82 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -1929,9 +1929,10 @@ static void osc_cleanup(void)
1929 rb->lcd_set_foreground(LCD_DEFAULT_FG); 1929 rb->lcd_set_foreground(LCD_DEFAULT_FG);
1930 rb->lcd_set_background(LCD_DEFAULT_BG); 1930 rb->lcd_set_background(LCD_DEFAULT_BG);
1931#endif 1931#endif
1932#ifdef HAVE_BACKLIGHT
1932 /* Turn on backlight timeout (revert to settings) */ 1933 /* Turn on backlight timeout (revert to settings) */
1933 backlight_use_settings(); 1934 backlight_use_settings();
1934 1935#endif
1935 1936
1936 /* save settings if changed */ 1937 /* save settings if changed */
1937 if (rb->memcmp(&osc, &osc_disk, sizeof(osc))) 1938 if (rb->memcmp(&osc, &osc_disk, sizeof(osc)))
@@ -1964,8 +1965,10 @@ static void osc_setup(void)
1964 mixer_sampr = rb->mixer_get_frequency(); 1965 mixer_sampr = rb->mixer_get_frequency();
1965#endif 1966#endif
1966 1967
1968#ifdef HAVE_BACKLIGHT
1967 /* Turn off backlight timeout */ 1969 /* Turn off backlight timeout */
1968 backlight_ignore_timeout(); 1970 backlight_ignore_timeout();
1971#endif
1969 graphmode_setup(); 1972 graphmode_setup();
1970} 1973}
1971 1974
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 33c1cf6bba..182e4a473a 100755
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -768,9 +768,11 @@ enum plugin_status plugin_start(const void* parameter)
768 the settings have changed when we quit */ 768 the settings have changed when we quit */
769 old_settings = settings; 769 old_settings = settings;
770 770
771#ifdef HAVE_BACKLIGHT
771 /*Turn off backlight for ai*/ 772 /*Turn off backlight for ai*/
772 if(settings.ai) 773 if(settings.ai)
773 backlight_ignore_timeout(); 774 backlight_ignore_timeout();
775#endif
774 776
775 /* Initialise the hardware */ 777 /* Initialise the hardware */
776 init_PacmanMachine(settings_to_dip(settings)); 778 init_PacmanMachine(settings_to_dip(settings));
@@ -803,8 +805,8 @@ enum plugin_status plugin_start(const void* parameter)
803#ifdef HAVE_ADJUSTABLE_CPU_FREQ 805#ifdef HAVE_ADJUSTABLE_CPU_FREQ
804 rb->cpu_boost(false); 806 rb->cpu_boost(false);
805#endif 807#endif
806 808#ifdef HAVE_BACKLIGHT
807 backlight_use_settings(); 809 backlight_use_settings();
808 810#endif
809 return PLUGIN_OK; 811 return PLUGIN_OK;
810} 812}
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c
index 541d53cdef..3a2238bb60 100644
--- a/apps/plugins/plasma.c
+++ b/apps/plugins/plasma.c
@@ -138,8 +138,10 @@ static void cleanup(void)
138#ifndef HAVE_LCD_COLOR 138#ifndef HAVE_LCD_COLOR
139 grey_release(); 139 grey_release();
140#endif 140#endif
141#ifdef HAVE_BACKLIGHT
141 /* Turn on backlight timeout (revert to settings) */ 142 /* Turn on backlight timeout (revert to settings) */
142 backlight_use_settings(); 143 backlight_use_settings();
144#endif
143#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 145#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
144 rb->lcd_set_mode(LCD_MODE_RGB565); 146 rb->lcd_set_mode(LCD_MODE_RGB565);
145#endif 147#endif
@@ -317,9 +319,10 @@ enum plugin_status plugin_start(const void* parameter)
317#if LCD_DEPTH > 1 319#if LCD_DEPTH > 1
318 rb->lcd_set_backdrop(NULL); 320 rb->lcd_set_backdrop(NULL);
319#endif 321#endif
322#ifdef HAVE_BACKLIGHT
320 /* Turn off backlight timeout */ 323 /* Turn off backlight timeout */
321 backlight_ignore_timeout(); 324 backlight_ignore_timeout();
322 325#endif
323#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 326#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
324 rb->lcd_set_mode(LCD_MODE_PAL256); 327 rb->lcd_set_mode(LCD_MODE_PAL256);
325#endif 328#endif
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index fcc4c5a3b9..a000a88fe7 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -747,8 +747,10 @@ enum plugin_status plugin_start(const void* parameter)
747 this to avoid the compiler warning about it */ 747 this to avoid the compiler warning about it */
748 (void)parameter; 748 (void)parameter;
749 749
750#ifdef HAVE_BACKLIGHT
750 /* Turn off backlight timeout */ 751 /* Turn off backlight timeout */
751 backlight_ignore_timeout(); 752 backlight_ignore_timeout();
753#endif
752 /* Clear screen */ 754 /* Clear screen */
753 rb->lcd_clear_display(); 755 rb->lcd_clear_display();
754 756
@@ -787,8 +789,9 @@ enum plugin_status plugin_start(const void* parameter)
787 rb->lcd_clear_display(); 789 rb->lcd_clear_display();
788 } 790 }
789 } 791 }
790 792#ifdef HAVE_BACKLIGHT
791 /* Turn on backlight timeout (revert to settings) */ 793 /* Turn on backlight timeout (revert to settings) */
792 backlight_use_settings(); 794 backlight_use_settings();
795#endif
793 return (game == 0) ? PLUGIN_OK : PLUGIN_USB_CONNECTED; 796 return (game == 0) ? PLUGIN_OK : PLUGIN_USB_CONNECTED;
794} 797}
diff --git a/apps/plugins/resistor.c b/apps/plugins/resistor.c
index ec6a364f23..2e204010a9 100644
--- a/apps/plugins/resistor.c
+++ b/apps/plugins/resistor.c
@@ -566,15 +566,17 @@ static void display_helpfile(void)
566 { 159, TEXT_UNDERLINE }, 566 { 159, TEXT_UNDERLINE },
567 LAST_STYLE_ITEM 567 LAST_STYLE_ITEM
568 }; 568 };
569 569
570 display_text(ARRAYLEN(helpfile_text), helpfile_text, formatting, 570 display_text(ARRAYLEN(helpfile_text), helpfile_text, formatting,
571 NULL, true); 571 NULL, true);
572 return; 572 return;
573} 573}
574 574
575static void led_resistance_calc(void) 575static void led_resistance_calc(void)
576{ 576{
577#ifdef HAVE_BACKLIGHT
577 backlight_ignore_timeout(); 578 backlight_ignore_timeout();
579#endif
578 int voltage_menu_selection, button_press, j, k, l, foreward_current = 0; 580 int voltage_menu_selection, button_press, j, k, l, foreward_current = 0;
579 int fwd_current_selection = 0; 581 int fwd_current_selection = 0;
580 bool quit = false; 582 bool quit = false;
@@ -759,14 +761,17 @@ static void led_resistance_calc(void)
759 rb->lcd_puts_scroll(resistance_val_x, lineno++, power_rating_out_str); 761 rb->lcd_puts_scroll(resistance_val_x, lineno++, power_rating_out_str);
760 762
761 rb->lcd_update(); 763 rb->lcd_update();
762 764
763 while ((button_press = rb->button_get(true)) & BUTTON_REL); 765 while ((button_press = rb->button_get(true)) & BUTTON_REL);
764 switch(button_press) { 766 switch(button_press) {
765 case PLA_SELECT: 767 case PLA_SELECT:
766 break; 768 break;
767 default: 769 default:
768 quit = true; 770 quit = true;
771
772#ifdef HAVE_BACKLIGHT
769 backlight_use_settings(); 773 backlight_use_settings();
774#endif
770 break; 775 break;
771 } 776 }
772 } 777 }
@@ -776,10 +781,12 @@ static void led_resistance_calc(void)
776 rb->lcd_clear_display(); 781 rb->lcd_clear_display();
777} 782}
778 783
779 784
780static void resistance_to_color(void) 785static void resistance_to_color(void)
781{ 786{
787#ifdef HAVE_BACKLIGHT
782 backlight_ignore_timeout(); 788 backlight_ignore_timeout();
789#endif
783 int menu_selection; 790 int menu_selection;
784 int menu_selection_tol; 791 int menu_selection_tol;
785 int button_press; 792 int button_press;
@@ -883,27 +890,29 @@ static void resistance_to_color(void)
883 in_resistance_int,band_data[units_used].unit); 890 in_resistance_int,band_data[units_used].unit);
884 return; 891 return;
885 } 892 }
886 893
887 rb->lcd_clear_display(); 894 rb->lcd_clear_display();
888 lineno = INITIAL_TEXT_Y; 895 lineno = INITIAL_TEXT_Y;
889#ifndef USE_TEXT_ONLY 896#ifndef USE_TEXT_ONLY
890 draw_resistor(first_band, second_band, multiplier, fourth_band); 897 draw_resistor(first_band, second_band, multiplier, fourth_band);
891#endif 898#endif
892 draw_resistor_text(first_band, second_band, multiplier, fourth_band); 899 draw_resistor_text(first_band, second_band, multiplier, fourth_band);
893 900
894 rb->snprintf(out_str, sizeof(out_str), "Input: %d %s", in_resistance_int, 901 rb->snprintf(out_str, sizeof(out_str), "Input: %d %s", in_resistance_int,
895 band_data[units_used].unit); 902 band_data[units_used].unit);
896 display->set_viewport(&text_vp); 903 display->set_viewport(&text_vp);
897 rb->lcd_puts_scroll(r_to_c_out_str_x, lineno++, out_str); 904 rb->lcd_puts_scroll(r_to_c_out_str_x, lineno++, out_str);
898 rb->lcd_update(); 905 rb->lcd_update();
899 906
900 button_press = rb->button_get(true); 907 button_press = rb->button_get(true);
901 switch(button_press) { 908 switch(button_press) {
902 case PLA_SELECT: 909 case PLA_SELECT:
903 break; 910 break;
904 default: 911 default:
905 quit = true; 912 quit = true;
913#ifdef HAVE_BACKLIGHT
906 backlight_use_settings(); 914 backlight_use_settings();
915#endif
907 break; 916 break;
908 } 917 }
909 } 918 }
@@ -912,25 +921,27 @@ static void resistance_to_color(void)
912 display->set_viewport(&screen_vp); 921 display->set_viewport(&screen_vp);
913 rb->lcd_clear_display(); 922 rb->lcd_clear_display();
914} 923}
915 924
916static void color_to_resistance(void) 925static void color_to_resistance(void)
917{ 926{
927#ifdef HAVE_BACKLIGHT
918 backlight_ignore_timeout(); 928 backlight_ignore_timeout();
929#endif
919 bool quit = false; 930 bool quit = false;
920 int button_input = 0; 931 int button_input = 0;
921 932
922 /* The colors of the bands */ 933 /* The colors of the bands */
923 enum color first_band = 0; 934 enum color first_band = 0;
924 enum color second_band = 0; 935 enum color second_band = 0;
925 enum color third_band = 0; 936 enum color third_band = 0;
926 enum color fourth_band = 0; 937 enum color fourth_band = 0;
927 938
928 int total_resistance_centiunits = 0; 939 int total_resistance_centiunits = 0;
929 char total_resistance_str [35]; 940 char total_resistance_str [35];
930 941
931 rb->splash(HZ/2, "Colour to resistance"); 942 rb->splash(HZ/2, "Colour to resistance");
932 rb->lcd_clear_display(); 943 rb->lcd_clear_display();
933 944
934 while(!quit) { 945 while(!quit) {
935 first_band = do_first_band_menu(); 946 first_band = do_first_band_menu();
936 if(first_band==RES_INVALID) break; 947 if(first_band==RES_INVALID) break;
@@ -984,9 +995,11 @@ static void color_to_resistance(void)
984 case PLA_SELECT: 995 case PLA_SELECT:
985 default: 996 default:
986 quit = true; 997 quit = true;
998#ifdef HAVE_BACKLIGHT
987 backlight_use_settings(); 999 backlight_use_settings();
1000#endif
988 break; 1001 break;
989 } 1002 }
990 } 1003 }
991 display->set_viewport(&text_vp); 1004 display->set_viewport(&text_vp);
992 rb->lcd_scroll_stop(); 1005 rb->lcd_scroll_stop();
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 31c626e267..f1f260a55d 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -1505,14 +1505,16 @@ static int rockblox_loop (void)
1505#ifdef HAS_BUTTON_HOLD 1505#ifdef HAS_BUTTON_HOLD
1506 if (rb->button_hold ()) { 1506 if (rb->button_hold ()) {
1507 /* Turn on backlight timeout (revert to settings) */ 1507 /* Turn on backlight timeout (revert to settings) */
1508#ifdef HAVE_BACKLIGHT
1508 backlight_use_settings(); 1509 backlight_use_settings();
1510#endif
1509 rb->splash(0, "Paused"); 1511 rb->splash(0, "Paused");
1510 while (rb->button_hold ()) 1512 while (rb->button_hold ())
1511 rb->sleep(HZ/10); 1513 rb->sleep(HZ/10);
1512 1514#ifdef HAVE_BACKLIGHT
1513 /* Turn off backlight timeout */ 1515 /* Turn off backlight timeout */
1514 backlight_ignore_timeout(); 1516 backlight_ignore_timeout();
1515 1517#endif
1516 /* get rid of the splash text */ 1518 /* get rid of the splash text */
1517 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); 1519 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
1518 show_details (); 1520 show_details ();
@@ -1682,8 +1684,10 @@ enum plugin_status plugin_start (const void *parameter)
1682 1684
1683 rb->lcd_setfont (FONT_SYSFIXED); 1685 rb->lcd_setfont (FONT_SYSFIXED);
1684 1686
1687#ifdef HAVE_BACKLIGHT
1685 /* Turn off backlight timeout */ 1688 /* Turn off backlight timeout */
1686 backlight_ignore_timeout(); 1689 backlight_ignore_timeout();
1690#endif
1687 load_game(); 1691 load_game();
1688 resume_file = resume; 1692 resume_file = resume;
1689 1693
@@ -1731,7 +1735,9 @@ enum plugin_status plugin_start (const void *parameter)
1731 1735
1732 /* Save user's HighScore */ 1736 /* Save user's HighScore */
1733 highscore_save(SCORE_FILE, highscores, NUM_SCORES); 1737 highscore_save(SCORE_FILE, highscores, NUM_SCORES);
1738#ifdef HAVE_BACKLIGNT
1734 backlight_use_settings(); 1739 backlight_use_settings();
1740#endif
1735 1741
1736 return PLUGIN_OK; 1742 return PLUGIN_OK;
1737} 1743}
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index caa8d499cb..6fafdc11a6 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -83,8 +83,9 @@ int do_user_menu(void) {
83 rb->lcd_set_mode(LCD_MODE_RGB565); 83 rb->lcd_set_mode(LCD_MODE_RGB565);
84#endif 84#endif
85 85
86#ifdef HAVE_BACKLIGHT
86 backlight_use_settings(); 87 backlight_use_settings();
87 88#endif
88 /* Clean out the button Queue */ 89 /* Clean out the button Queue */
89 while (rb->button_get(false) != BUTTON_NONE) 90 while (rb->button_get(false) != BUTTON_NONE)
90 rb->yield(); 91 rb->yield();
@@ -138,9 +139,10 @@ int do_user_menu(void) {
138 rb->lcd_set_mode(LCD_MODE_PAL256); 139 rb->lcd_set_mode(LCD_MODE_PAL256);
139#endif 140#endif
140 141
142#ifdef HAVE_BACKLIGHT
141 /* ignore backlight time out */ 143 /* ignore backlight time out */
142 backlight_ignore_timeout(); 144 backlight_ignore_timeout();
143 145#endif
144 return ret; 146 return ret;
145} 147}
146 148
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index 57f0c95ea6..202cdf6570 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -594,9 +594,10 @@ enum plugin_status plugin_start(const void* parameter)
594 rb->lcd_set_mode(LCD_MODE_PAL256); 594 rb->lcd_set_mode(LCD_MODE_PAL256);
595#endif 595#endif
596 596
597#ifdef HAVE_BACKLIGHT
597 /* ignore backlight time out */ 598 /* ignore backlight time out */
598 backlight_ignore_timeout(); 599 backlight_ignore_timeout();
599 600#endif
600 gnuboy_main(parameter); 601 gnuboy_main(parameter);
601 602
602#ifdef HAVE_WHEEL_POSITION 603#ifdef HAVE_WHEEL_POSITION
@@ -607,7 +608,9 @@ enum plugin_status plugin_start(const void* parameter)
607 rb->lcd_set_mode(LCD_MODE_RGB565); 608 rb->lcd_set_mode(LCD_MODE_RGB565);
608#endif 609#endif
609 610
611#ifdef HAVE_BACKLIGHT
610 backlight_use_settings(); 612 backlight_use_settings();
613#endif
611 614
612 if(!rb->audio_status()) 615 if(!rb->audio_status())
613 rockboy_pcm_close(); 616 rockboy_pcm_close();
diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c
index 1effeb2f00..0be48dcce8 100644
--- a/apps/plugins/rocklife.c
+++ b/apps/plugins/rocklife.c
@@ -473,7 +473,9 @@ enum plugin_status plugin_start(const void* parameter)
473 char *ptemp; 473 char *ptemp;
474 (void)(parameter); 474 (void)(parameter);
475 475
476#ifdef HAVE_BACKLIGHT
476 backlight_ignore_timeout(); 477 backlight_ignore_timeout();
478#endif
477#if LCD_DEPTH > 1 479#if LCD_DEPTH > 1
478 rb->lcd_set_backdrop(NULL); 480 rb->lcd_set_backdrop(NULL);
479#ifdef HAVE_LCD_COLOR 481#ifdef HAVE_LCD_COLOR
@@ -577,6 +579,8 @@ enum plugin_status plugin_start(const void* parameter)
577 rb->yield(); 579 rb->yield();
578 } 580 }
579 581
582#ifdef HAVE_BACKLIGHT
580 backlight_use_settings(); 583 backlight_use_settings();
584#endif
581 return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK; 585 return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK;
582} 586}
diff --git a/apps/plugins/sdl/main.c b/apps/plugins/sdl/main.c
index be5192898c..6efb072faf 100644
--- a/apps/plugins/sdl/main.c
+++ b/apps/plugins/sdl/main.c
@@ -64,8 +64,9 @@ void cleanup(void)
64 if(audiobuf) 64 if(audiobuf)
65 memset(audiobuf, 0, 4); /* clear */ 65 memset(audiobuf, 0, 4); /* clear */
66 66
67#ifdef HAVE_BACKLIGHT
67 backlight_use_settings(); 68 backlight_use_settings();
68 69#endif
69#ifdef HAVE_ADJUSTABLE_CPU_FREQ 70#ifdef HAVE_ADJUSTABLE_CPU_FREQ
70 rb->cpu_boost(false); 71 rb->cpu_boost(false);
71#endif 72#endif
@@ -218,8 +219,9 @@ enum plugin_status plugin_start(const void *param)
218#ifdef HAVE_ADJUSTABLE_CPU_FREQ 219#ifdef HAVE_ADJUSTABLE_CPU_FREQ
219 rb->cpu_boost(true); 220 rb->cpu_boost(true);
220#endif 221#endif
221 222#ifdef HAVE_BACKLIGHT
222 backlight_ignore_timeout(); 223 backlight_ignore_timeout();
224#endif
223 /* set the real exit handler */ 225 /* set the real exit handler */
224#undef rb_atexit 226#undef rb_atexit
225 rb_atexit(cleanup); 227 rb_atexit(cleanup);
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 268c55ad35..b366da0d60 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -2125,8 +2125,10 @@ enum plugin_status plugin_start(const void* parameter)
2125#endif 2125#endif
2126 /* universal font */ 2126 /* universal font */
2127 rb->lcd_setfont(FONT_SYSFIXED); 2127 rb->lcd_setfont(FONT_SYSFIXED);
2128#ifdef HAVE_BACKLIGHT
2128 /* Turn off backlight timeout */ 2129 /* Turn off backlight timeout */
2129 backlight_ignore_timeout(); 2130 backlight_ignore_timeout();
2131#endif
2130 highscore_load(SCORE_FILE, highscores, NUM_SCORES); 2132 highscore_load(SCORE_FILE, highscores, NUM_SCORES);
2131 rb->srand(*rb->current_tick); 2133 rb->srand(*rb->current_tick);
2132 2134
@@ -2138,8 +2140,10 @@ enum plugin_status plugin_start(const void* parameter)
2138 2140
2139 rb->lcd_setfont(FONT_UI); 2141 rb->lcd_setfont(FONT_UI);
2140 highscore_save(SCORE_FILE, highscores, NUM_SCORES); 2142 highscore_save(SCORE_FILE, highscores, NUM_SCORES);
2143#ifdef HAVE_BACKLIGHT
2141 /* Turn on backlight timeout (revert to settings) */ 2144 /* Turn on backlight timeout (revert to settings) */
2142 backlight_use_settings(); 2145 backlight_use_settings();
2146#endif
2143 2147
2144 return ret; 2148 return ret;
2145} 2149}
diff --git a/apps/plugins/speedread.c b/apps/plugins/speedread.c
index b6fce77de1..42634fb536 100644
--- a/apps/plugins/speedread.c
+++ b/apps/plugins/speedread.c
@@ -141,7 +141,9 @@ static void cleanup(void)
141{ 141{
142 if(custom_font != FONT_UI) 142 if(custom_font != FONT_UI)
143 rb->font_unload(custom_font); 143 rb->font_unload(custom_font);
144#ifdef HAVE_BACKLIGHT
144 backlight_use_settings(); 145 backlight_use_settings();
146#endif
145} 147}
146 148
147/* returns height of drawn area */ 149/* returns height of drawn area */
@@ -300,7 +302,9 @@ static void begin_anim(void)
300 302
301static void init_drawing(void) 303static void init_drawing(void)
302{ 304{
305#ifdef HAVE_BACKLIGHT
303 backlight_ignore_timeout(); 306 backlight_ignore_timeout();
307#endif
304 atexit(cleanup); 308 atexit(cleanup);
305 309
306 rb->lcd_set_background(OUTSIDE_COLOR); 310 rb->lcd_set_background(OUTSIDE_COLOR);
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index 24e2e4c085..7fc400d0ee 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -324,13 +324,14 @@ enum plugin_status plugin_start(const void* parameter)
324 int ret; 324 int ret;
325 325
326 (void)parameter; 326 (void)parameter;
327#ifdef HAVE_BACKLIGHT
327 /* Turn off backlight timeout */ 328 /* Turn off backlight timeout */
328 backlight_ignore_timeout(); 329 backlight_ignore_timeout();
329 330#endif
330 ret = plugin_main(); 331 ret = plugin_main();
331 332#ifdef HAVE_BACKLIGHT
332 /* Turn on backlight timeout (revert to settings) */ 333 /* Turn on backlight timeout (revert to settings) */
333 backlight_use_settings(); 334 backlight_use_settings();
334 335#endif
335 return ret; 336 return ret;
336} 337}
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c
index 0a29a7aa30..19ccd9f452 100644
--- a/apps/plugins/stats.c
+++ b/apps/plugins/stats.c
@@ -189,10 +189,12 @@ enum plugin_status plugin_start(const void* parameter)
189 return PLUGIN_OK; 189 return PLUGIN_OK;
190 } 190 }
191 update_screen(); 191 update_screen();
192#ifdef HAVE_BACKLIGHT
192#ifdef HAVE_REMOTE_LCD 193#ifdef HAVE_REMOTE_LCD
193 rb->remote_backlight_on(); 194 rb->remote_backlight_on();
194#endif 195#endif
195 rb->backlight_on(); 196 rb->backlight_on();
197#endif
196 rb->splash(HZ, "Done"); 198 rb->splash(HZ, "Done");
197 update_screen(); 199 update_screen();
198 while (1) { 200 while (1) {
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index b18cdc21f8..419b258fe5 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -2415,9 +2415,10 @@ static bool launch_wormlet(void)
2415 2415
2416 rb->lcd_clear_display(); 2416 rb->lcd_clear_display();
2417 2417
2418#ifdef HAVE_BACKLIGHT
2418 /* Turn off backlight timeout */ 2419 /* Turn off backlight timeout */
2419 backlight_ignore_timeout(); 2420 backlight_ignore_timeout();
2420 2421#endif
2421 /* start the game */ 2422 /* start the game */
2422 while (game_result == 1) 2423 while (game_result == 1)
2423 game_result = run(); 2424 game_result = run();
@@ -2425,8 +2426,10 @@ static bool launch_wormlet(void)
2425 switch (game_result) 2426 switch (game_result)
2426 { 2427 {
2427 case 2: 2428 case 2:
2429#ifdef HAVE_BACKLIGHT
2428 /* Turn on backlight timeout (revert to settings) */ 2430 /* Turn on backlight timeout (revert to settings) */
2429 backlight_use_settings(); 2431 backlight_use_settings();
2432#endif
2430 return false; 2433 return false;
2431 break; 2434 break;
2432 } 2435 }
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index e2cccba8fc..5ed1fbb612 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -1303,9 +1303,10 @@ enum plugin_status plugin_start (const void *parameter)
1303 rb->lcd_set_backdrop(NULL); 1303 rb->lcd_set_backdrop(NULL);
1304#endif 1304#endif
1305 1305
1306#ifdef HAVE_BACKLIGHT
1306 /* Turn off backlight timeout */ 1307 /* Turn off backlight timeout */
1307 backlight_ignore_timeout(); 1308 backlight_ignore_timeout();
1308 1309#endif
1309 highscore_load(SCORE_FILE, highscores, NUM_SCORES); 1310 highscore_load(SCORE_FILE, highscores, NUM_SCORES);
1310 1311
1311 if (!load_game()) { 1312 if (!load_game()) {
@@ -1315,8 +1316,10 @@ enum plugin_status plugin_start (const void *parameter)
1315 randomize (); 1316 randomize ();
1316 ret = xobox_loop (); 1317 ret = xobox_loop ();
1317 1318
1319#ifdef HAVE_BACKLIGHT
1318 /* Turn on backlight timeout (revert to settings) */ 1320 /* Turn on backlight timeout (revert to settings) */
1319 backlight_use_settings(); 1321 backlight_use_settings();
1322#endif
1320 rb->lcd_setfont (FONT_UI); 1323 rb->lcd_setfont (FONT_UI);
1321 1324
1322 highscore_save(SCORE_FILE, highscores, NUM_SCORES); 1325 highscore_save(SCORE_FILE, highscores, NUM_SCORES);
diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c
index 1416a40577..db01dcc974 100644
--- a/apps/plugins/xworld/sys.c
+++ b/apps/plugins/xworld/sys.c
@@ -121,7 +121,9 @@ void exit_handler(void)
121#ifdef HAVE_ADJUSTABLE_CPU_FREQ 121#ifdef HAVE_ADJUSTABLE_CPU_FREQ
122 rb->cpu_boost(false); 122 rb->cpu_boost(false);
123#endif 123#endif
124#ifdef HAVE_BACKLIGHT
124 backlight_use_settings(); 125 backlight_use_settings();
126#endif
125} 127}
126 128
127static bool sys_do_help(void) 129static bool sys_do_help(void)
@@ -425,7 +427,9 @@ void sys_menu(struct System* sys)
425void sys_init(struct System* sys, const char* title) 427void sys_init(struct System* sys, const char* title)
426{ 428{
427 (void) title; 429 (void) title;
430#ifdef HAVE_BACKLIGHT
428 backlight_ignore_timeout(); 431 backlight_ignore_timeout();
432#endif
429 rb_atexit(exit_handler); 433 rb_atexit(exit_handler);
430 save_sys = sys; 434 save_sys = sys;
431 rb->memset(&sys->input, 0, sizeof(sys->input)); 435 rb->memset(&sys->input, 0, sizeof(sys->input));