summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-08-16 23:01:18 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-08-16 23:01:18 +0000
commit767c0ec5894f1acaad5e0def12d628c6f21bcf87 (patch)
treea2fbd9ac23adc395d4587a6c9cb85ba4cc001cb8 /apps
parent735ab889d2bd41fdc8a5bf22d7ce5ed724d58474 (diff)
downloadrockbox-767c0ec5894f1acaad5e0def12d628c6f21bcf87.tar.gz
rockbox-767c0ec5894f1acaad5e0def12d628c6f21bcf87.zip
Pass plugin api pointer to funtion directly, fixes crashes when doing incremental builds. Fix incorrect backlight changes in rockblox introduced recently.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14373 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/brickmania.c4
-rw-r--r--apps/plugins/chopper.c4
-rw-r--r--apps/plugins/credits.c4
-rw-r--r--apps/plugins/fire.c4
-rw-r--r--apps/plugins/fireworks.c4
-rw-r--r--apps/plugins/grayscale.c4
-rw-r--r--apps/plugins/invadrox.c4
-rw-r--r--apps/plugins/jpeg.c4
-rw-r--r--apps/plugins/lib/helper.c9
-rw-r--r--apps/plugins/lib/helper.h4
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c4
-rw-r--r--apps/plugins/oscilloscope.c4
-rw-r--r--apps/plugins/plasma.c4
-rw-r--r--apps/plugins/rockblox.c10
-rw-r--r--apps/plugins/spacerocks.c18
-rw-r--r--apps/plugins/starfield.c4
-rw-r--r--apps/plugins/test_disk.c4
-rw-r--r--apps/plugins/video.c4
-rw-r--r--apps/plugins/wormlet.c4
-rw-r--r--apps/plugins/xobox.c4
20 files changed, 54 insertions, 51 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 2530cfc618..d4b774a93d 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -2031,7 +2031,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2031 rb->lcd_set_backdrop(NULL); 2031 rb->lcd_set_backdrop(NULL);
2032#endif 2032#endif
2033 /* Turn off backlight timeout */ 2033 /* Turn off backlight timeout */
2034 backlight_force_on(); /* backlight control in lib/helper.c */ 2034 backlight_force_on(rb); /* backlight control in lib/helper.c */
2035 2035
2036 /* now go ahead and have fun! */ 2036 /* now go ahead and have fun! */
2037 while (game_loop()!=1); 2037 while (game_loop()!=1);
@@ -2041,7 +2041,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2041 /* Restore user's original backlight setting */ 2041 /* Restore user's original backlight setting */
2042 rb->lcd_setfont(FONT_UI); 2042 rb->lcd_setfont(FONT_UI);
2043 /* Turn on backlight timeout (revert to settings) */ 2043 /* Turn on backlight timeout (revert to settings) */
2044 backlight_use_settings(); /* backlight control in lib/helper.c */ 2044 backlight_use_settings(rb); /* backlight control in lib/helper.c */
2045 2045
2046 return PLUGIN_OK; 2046 return PLUGIN_OK;
2047} 2047}
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index 43b076d763..c2084f3d0b 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -949,7 +949,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
949#endif 949#endif
950 950
951 /* Turn off backlight timeout */ 951 /* Turn off backlight timeout */
952 backlight_force_on(); /* backlight control in lib/helper.c */ 952 backlight_force_on(rb); /* backlight control in lib/helper.c */
953 953
954 rb->srand( *rb->current_tick ); 954 rb->srand( *rb->current_tick );
955 955
@@ -964,7 +964,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
964 964
965 rb->lcd_setfont(FONT_UI); 965 rb->lcd_setfont(FONT_UI);
966 /* Turn on backlight timeout (revert to settings) */ 966 /* Turn on backlight timeout (revert to settings) */
967 backlight_use_settings(); /* backlight control in lib/helper.c */ 967 backlight_use_settings(rb); /* backlight control in lib/helper.c */
968 968
969 return ret; 969 return ret;
970} 970}
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c
index 204c250a89..531ad1f5b7 100644
--- a/apps/plugins/credits.c
+++ b/apps/plugins/credits.c
@@ -37,7 +37,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
37 rb = api; 37 rb = api;
38 38
39 /* Turn off backlight timeout */ 39 /* Turn off backlight timeout */
40 backlight_force_on(); /* backlight control in lib/helper.c */ 40 backlight_force_on(rb); /* backlight control in lib/helper.c */
41 41
42 rb->show_logo(); 42 rb->show_logo();
43#ifdef HAVE_LCD_CHARCELLS 43#ifdef HAVE_LCD_CHARCELLS
@@ -57,7 +57,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
57 57
58end_of_proc: 58end_of_proc:
59 /* Turn on backlight timeout (revert to settings) */ 59 /* Turn on backlight timeout (revert to settings) */
60 backlight_use_settings(); /* backlight control in lib/helper.c */ 60 backlight_use_settings(rb); /* backlight control in lib/helper.c */
61 61
62 return PLUGIN_OK; 62 return PLUGIN_OK;
63} 63}
diff --git a/apps/plugins/fire.c b/apps/plugins/fire.c
index 3cfd1abd51..5d6f0618a7 100644
--- a/apps/plugins/fire.c
+++ b/apps/plugins/fire.c
@@ -332,7 +332,7 @@ void cleanup(void *parameter)
332 gray_release(); 332 gray_release();
333#endif 333#endif
334 /* Turn on backlight timeout (revert to settings) */ 334 /* Turn on backlight timeout (revert to settings) */
335 backlight_use_settings(); /* backlight control in lib/helper.c */ 335 backlight_use_settings(rb); /* backlight control in lib/helper.c */
336} 336}
337 337
338/* 338/*
@@ -423,7 +423,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
423 rb->lcd_set_backdrop(NULL); 423 rb->lcd_set_backdrop(NULL);
424#endif 424#endif
425 /* Turn off backlight timeout */ 425 /* Turn off backlight timeout */
426 backlight_force_on(); /* backlight control in lib/helper.c */ 426 backlight_force_on(rb); /* backlight control in lib/helper.c */
427 427
428 ret = main(); 428 ret = main();
429 429
diff --git a/apps/plugins/fireworks.c b/apps/plugins/fireworks.c
index 7e3aea4ef7..e8439dff15 100644
--- a/apps/plugins/fireworks.c
+++ b/apps/plugins/fireworks.c
@@ -380,7 +380,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
380 380
381 /* set everything up.. no BL timeout, no backdrop, 381 /* set everything up.. no BL timeout, no backdrop,
382 white-text-on-black-background. */ 382 white-text-on-black-background. */
383 backlight_force_on(); /* backlight control in lib/helper.c */ 383 backlight_force_on(rb); /* backlight control in lib/helper.c */
384#if LCD_DEPTH > 1 384#if LCD_DEPTH > 1
385 rb->lcd_set_backdrop(NULL); 385 rb->lcd_set_backdrop(NULL);
386 rb->lcd_set_background(LCD_BLACK); 386 rb->lcd_set_background(LCD_BLACK);
@@ -537,7 +537,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
537 } 537 }
538 } 538 }
539 /* Turn on backlight timeout (revert to settings) */ 539 /* Turn on backlight timeout (revert to settings) */
540 backlight_use_settings(); /* backlight control in lib/helper.c */ 540 backlight_use_settings(rb); /* backlight control in lib/helper.c */
541 541
542#ifdef HAVE_ADJUSTABLE_CPU_FREQ 542#ifdef HAVE_ADJUSTABLE_CPU_FREQ
543 rb->cpu_boost(true); 543 rb->cpu_boost(true);
diff --git a/apps/plugins/grayscale.c b/apps/plugins/grayscale.c
index d28237da31..cc07ff37e5 100644
--- a/apps/plugins/grayscale.c
+++ b/apps/plugins/grayscale.c
@@ -87,7 +87,7 @@ void cleanup(void *parameter)
87 87
88 gray_release(); /* switch off overlay and deinitialize */ 88 gray_release(); /* switch off overlay and deinitialize */
89 /* Turn on backlight timeout (revert to settings) */ 89 /* Turn on backlight timeout (revert to settings) */
90 backlight_use_settings(); /* backlight control in lib/helper.c */ 90 backlight_use_settings(rb); /* backlight control in lib/helper.c */
91} 91}
92 92
93/* this is only a demo of what the framework can do */ 93/* this is only a demo of what the framework can do */
@@ -172,7 +172,7 @@ int main(void)
172 }; 172 };
173 173
174 /* Turn off backlight timeout */ 174 /* Turn off backlight timeout */
175 backlight_force_on(); /* backlight control in lib/helper.c */ 175 backlight_force_on(rb); /* backlight control in lib/helper.c */
176 176
177 rb->lcd_setfont(FONT_SYSFIXED); /* select default font */ 177 rb->lcd_setfont(FONT_SYSFIXED); /* select default font */
178 178
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 264d5725dd..527ec9587f 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -1766,7 +1766,7 @@ enum plugin_status plugin_start(struct plugin_api* api, UNUSED void* parameter)
1766 1766
1767 rb->lcd_setfont(FONT_SYSFIXED); 1767 rb->lcd_setfont(FONT_SYSFIXED);
1768 /* Turn off backlight timeout */ 1768 /* Turn off backlight timeout */
1769 backlight_force_on(); /* backlight control in lib/helper.c */ 1769 backlight_force_on(rb); /* backlight control in lib/helper.c */
1770 1770
1771 /* now go ahead and have fun! */ 1771 /* now go ahead and have fun! */
1772 game_loop(); 1772 game_loop();
@@ -1784,7 +1784,7 @@ enum plugin_status plugin_start(struct plugin_api* api, UNUSED void* parameter)
1784 /* Restore user's original backlight setting */ 1784 /* Restore user's original backlight setting */
1785 rb->lcd_setfont(FONT_UI); 1785 rb->lcd_setfont(FONT_UI);
1786 /* Turn on backlight timeout (revert to settings) */ 1786 /* Turn on backlight timeout (revert to settings) */
1787 backlight_use_settings(); /* backlight control in lib/helper.c */ 1787 backlight_use_settings(rb); /* backlight control in lib/helper.c */
1788 1788
1789 return PLUGIN_OK; 1789 return PLUGIN_OK;
1790} 1790}
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index b4f85f5a16..2c8942f8bc 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -3311,7 +3311,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
3311 buf_images = buf; buf_images_size = buf_size; 3311 buf_images = buf; buf_images_size = buf_size;
3312 3312
3313 /* Turn off backlight timeout */ 3313 /* Turn off backlight timeout */
3314 backlight_force_on(); /* backlight control in lib/helper.c */ 3314 backlight_force_on(rb); /* backlight control in lib/helper.c */
3315 3315
3316 do 3316 do
3317 { 3317 {
@@ -3335,7 +3335,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
3335#endif 3335#endif
3336 3336
3337 /* Turn on backlight timeout (revert to settings) */ 3337 /* Turn on backlight timeout (revert to settings) */
3338 backlight_use_settings(); /* backlight control in lib/helper.c */ 3338 backlight_use_settings(rb); /* backlight control in lib/helper.c */
3339 3339
3340#ifdef USEGSLIB 3340#ifdef USEGSLIB
3341 gray_release(); /* deinitialize */ 3341 gray_release(); /* deinitialize */
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c
index 42c9deca70..65108cec8f 100644
--- a/apps/plugins/lib/helper.c
+++ b/apps/plugins/lib/helper.c
@@ -19,16 +19,14 @@
19 19
20#include "plugin.h" 20#include "plugin.h"
21 21
22/* the plugin must declare the plugin_api struct pointer itself */
23extern struct plugin_api* rb;
24
25/* 22/*
26 * force the backlight on 23 * force the backlight on
27 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to 24 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to
28 * build and makes modded targets easier to update 25 * build and makes modded targets easier to update
29 */ 26 */
30void backlight_force_on(void) 27void backlight_force_on(struct plugin_api* rb)
31{ 28{
29 if(!rb) return;
32/* #ifdef HAVE_BACKLIGHT */ 30/* #ifdef HAVE_BACKLIGHT */
33 if (rb->global_settings->backlight_timeout > 1) 31 if (rb->global_settings->backlight_timeout > 1)
34 rb->backlight_set_timeout(1); 32 rb->backlight_set_timeout(1);
@@ -44,8 +42,9 @@ void backlight_force_on(void)
44 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to 42 * now enabled regardless of HAVE_BACKLIGHT because it is not needed to
45 * build and makes modded targets easier to update 43 * build and makes modded targets easier to update
46 */ 44 */
47void backlight_use_settings(void) 45void backlight_use_settings(struct plugin_api* rb)
48{ 46{
47 if(!rb) return;
49/* #ifdef HAVE_BACKLIGHT */ 48/* #ifdef HAVE_BACKLIGHT */
50 rb->backlight_set_timeout(rb->global_settings->backlight_timeout); 49 rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
51#if CONFIG_CHARGING 50#if CONFIG_CHARGING
diff --git a/apps/plugins/lib/helper.h b/apps/plugins/lib/helper.h
index 71a670884e..f2f5f8761b 100644
--- a/apps/plugins/lib/helper.h
+++ b/apps/plugins/lib/helper.h
@@ -24,7 +24,7 @@
24/** 24/**
25 * Backlight on/off operations 25 * Backlight on/off operations
26 */ 26 */
27void backlight_force_on(void); 27void backlight_force_on(struct plugin_api* rb);
28void backlight_use_settings(void); 28void backlight_use_settings(struct plugin_api* rb);
29 29
30#endif 30#endif
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index dc1b753569..4af4ed2ca4 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -1858,7 +1858,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1858 rb->lcd_update(); 1858 rb->lcd_update();
1859 1859
1860 /* Turn off backlight timeout */ 1860 /* Turn off backlight timeout */
1861 backlight_force_on(); /* backlight control in lib/helper.c */ 1861 backlight_force_on(rb); /* backlight control in lib/helper.c */
1862 1862
1863#ifdef HAVE_ADJUSTABLE_CPU_FREQ 1863#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1864 rb->cpu_boost(true); 1864 rb->cpu_boost(true);
@@ -1996,7 +1996,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1996 rb->pcm_set_frequency(HW_SAMPR_DEFAULT); 1996 rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
1997 1997
1998 /* Turn on backlight timeout (revert to settings) */ 1998 /* Turn on backlight timeout (revert to settings) */
1999 backlight_use_settings(); /* backlight control in lib/helper.c */ 1999 backlight_use_settings(rb); /* backlight control in lib/helper.c */
2000 2000
2001 return status; 2001 return status;
2002} 2002}
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 6ef398a520..bd16341008 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -564,7 +564,7 @@ void cleanup(void *parameter)
564 rb->lcd_set_background(LCD_DEFAULT_BG); 564 rb->lcd_set_background(LCD_DEFAULT_BG);
565#endif 565#endif
566 /* Turn on backlight timeout (revert to settings) */ 566 /* Turn on backlight timeout (revert to settings) */
567 backlight_use_settings(); /* backlight control in lib/helper.c */ 567 backlight_use_settings(rb); /* backlight control in lib/helper.c */
568} 568}
569 569
570enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 570enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
@@ -595,7 +595,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
595#endif 595#endif
596 596
597 /* Turn off backlight timeout */ 597 /* Turn off backlight timeout */
598 backlight_force_on(); /* backlight control in lib/helper.c */ 598 backlight_force_on(rb); /* backlight control in lib/helper.c */
599 599
600 rb->lcd_getstringsize("A", NULL, &font_height); 600 rb->lcd_getstringsize("A", NULL, &font_height);
601 601
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c
index 5de9b90908..1fae239e53 100644
--- a/apps/plugins/plasma.c
+++ b/apps/plugins/plasma.c
@@ -172,7 +172,7 @@ void cleanup(void *parameter)
172 gray_release(); 172 gray_release();
173#endif 173#endif
174 /* Turn on backlight timeout (revert to settings) */ 174 /* Turn on backlight timeout (revert to settings) */
175 backlight_use_settings(); /* backlight control in lib/helper.c */ 175 backlight_use_settings(rb); /* backlight control in lib/helper.c */
176} 176}
177 177
178/* 178/*
@@ -302,7 +302,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
302 rb->lcd_set_backdrop(NULL); 302 rb->lcd_set_backdrop(NULL);
303#endif 303#endif
304 /* Turn off backlight timeout */ 304 /* Turn off backlight timeout */
305 backlight_force_on(); /* backlight control in lib/helper.c */ 305 backlight_force_on(rb); /* backlight control in lib/helper.c */
306 306
307 ret = main(); 307 ret = main();
308 308
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 4ce95b89d5..8625e35cfb 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -855,13 +855,13 @@ static int rockblox_loop (void)
855#ifdef HAS_BUTTON_HOLD 855#ifdef HAS_BUTTON_HOLD
856 if (rb->button_hold ()) { 856 if (rb->button_hold ()) {
857 /* Turn on backlight timeout (revert to settings) */ 857 /* Turn on backlight timeout (revert to settings) */
858 backlight_use_settings(); /* backlight control in lib/helper.c */ 858 backlight_use_settings(rb); /* backlight control in lib/helper.c */
859 rb->splash(0, "Paused"); 859 rb->splash(0, "Paused");
860 while (rb->button_hold ()) 860 while (rb->button_hold ())
861 rb->sleep(HZ/10); 861 rb->sleep(HZ/10);
862 862
863 /* Turn on backlight timeout (revert to settings) */ 863 /* Turn off backlight timeout */
864 backlight_use_settings(); /* backlight control in lib/helper.c */ 864 backlight_force_on(rb); /* backlight control in lib/helper.c */
865 865
866 /* get rid of the splash text */ 866 /* get rid of the splash text */
867 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); 867 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
@@ -1029,8 +1029,8 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
1029 return PLUGIN_OK; 1029 return PLUGIN_OK;
1030 } 1030 }
1031#endif 1031#endif
1032 /* Turn on backlight timeout (revert to settings) */ 1032 /* Turn off backlight timeout */
1033 backlight_use_settings(); /* backlight control in lib/helper.c */ 1033 backlight_force_on(rb); /* backlight control in lib/helper.c */
1034 1034
1035 init_rockblox (); 1035 init_rockblox ();
1036 ret = rockblox_loop (); 1036 ret = rockblox_loop ();
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index 5d285a4ada..1278a611ce 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -490,14 +490,20 @@ void iohiscore(void)
490 rb->memset(phscore, 0, sizeof(phscore)); 490 rb->memset(phscore, 0, sizeof(phscore));
491 491
492 fd = rb->open(HISCORE_FILE,O_RDWR | O_CREAT); 492 fd = rb->open(HISCORE_FILE,O_RDWR | O_CREAT);
493 493 if(fd < 0)
494 {
495 rb->splash(HZ, "Highscore file read error");
496 return;
497 }
498
494 /* highscore used to %d, is now %d\n 499 /* highscore used to %d, is now %d\n
495 Deal with no file or bad file */ 500 Deal with no file or bad file */
496 rb->read(fd,phscore, sizeof(phscore)); 501 rb->read(fd,phscore, sizeof(phscore));
497 502
498 compare = rb->atoi(phscore); 503 compare = rb->atoi(phscore);
499 504
500 if(high_score > compare){ 505 if(high_score > compare)
506 {
501 rb->lseek(fd,0,SEEK_SET); 507 rb->lseek(fd,0,SEEK_SET);
502 rb->fdprintf(fd, "%d\n", high_score); 508 rb->fdprintf(fd, "%d\n", high_score);
503 } 509 }
@@ -1926,25 +1932,23 @@ enum plugin_status start_game(void)
1926enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 1932enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
1927{ 1933{
1928 enum plugin_status retval; 1934 enum plugin_status retval;
1929
1930 (void)(parameter); 1935 (void)(parameter);
1931 rb = api; 1936 rb = api;
1932 1937
1933 game_state = ATTRACT_MODE; 1938 game_state = ATTRACT_MODE;
1934 1939
1935 /* universal font */
1936#if LCD_DEPTH > 1 1940#if LCD_DEPTH > 1
1937 rb->lcd_set_backdrop(NULL); 1941 rb->lcd_set_backdrop(NULL);
1938#endif 1942#endif
1943 /* universal font */
1939 rb->lcd_setfont(FONT_SYSFIXED); 1944 rb->lcd_setfont(FONT_SYSFIXED);
1940 /* Turn off backlight timeout */ 1945 /* Turn off backlight timeout */
1941 backlight_force_on(); /* backlight control in lib/helper.c */ 1946 backlight_force_on(rb); /* backlight control in lib/helper.c */
1942 iohiscore(); 1947 iohiscore();
1943 retval = start_game(); 1948 retval = start_game();
1944 iohiscore(); 1949 iohiscore();
1945 rb->lcd_setfont(FONT_UI); 1950 rb->lcd_setfont(FONT_UI);
1946 /* Turn on backlight timeout (revert to settings) */ 1951 /* Turn on backlight timeout (revert to settings) */
1947 backlight_use_settings(); /* backlight control in lib/helper.c */ 1952 backlight_use_settings(rb); /* backlight control in lib/helper.c */
1948
1949 return retval; 1953 return retval;
1950} 1954}
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index 397c542e66..278d24fbc7 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -366,7 +366,7 @@ int plugin_main(void)
366 case(STARFIELD_QUIT): 366 case(STARFIELD_QUIT):
367 case(SYS_USB_CONNECTED): 367 case(SYS_USB_CONNECTED):
368 /* Turn on backlight timeout (revert to settings) */ 368 /* Turn on backlight timeout (revert to settings) */
369 backlight_use_settings(); /* backlight control in lib/helper.c*/ 369 backlight_use_settings(rb); /* backlight control in lib/helper.c*/
370 return PLUGIN_OK; 370 return PLUGIN_OK;
371 break; 371 break;
372 } 372 }
@@ -382,7 +382,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
382 rb = api; /* copy to global api pointer */ 382 rb = api; /* copy to global api pointer */
383 (void)parameter; 383 (void)parameter;
384 /* Turn off backlight timeout */ 384 /* Turn off backlight timeout */
385 backlight_force_on(); /* backlight control in lib/helper.c */ 385 backlight_force_on(rb); /* backlight control in lib/helper.c */
386 386
387 ret = plugin_main(); 387 ret = plugin_main();
388 388
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 2f06177764..216ef733bd 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -439,7 +439,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
439 rb->srand(*rb->current_tick); 439 rb->srand(*rb->current_tick);
440 440
441 /* Turn off backlight timeout */ 441 /* Turn off backlight timeout */
442 backlight_force_on(); /* backlight control in lib/helper.c */ 442 backlight_force_on(rb); /* backlight control in lib/helper.c */
443 443
444 m = menu_init(rb, items, sizeof(items) / sizeof(*items), NULL, 444 m = menu_init(rb, items, sizeof(items) / sizeof(*items), NULL,
445 NULL, NULL, NULL); 445 NULL, NULL, NULL);
@@ -447,7 +447,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
447 menu_exit(m); 447 menu_exit(m);
448 448
449 /* Turn on backlight timeout (revert to settings) */ 449 /* Turn on backlight timeout (revert to settings) */
450 backlight_use_settings(); /* backlight control in lib/helper.c */ 450 backlight_use_settings(rb); /* backlight control in lib/helper.c */
451 451
452 rb->rmdir(testbasedir); 452 rb->rmdir(testbasedir);
453 453
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index 5ebe8dc2e6..2799e3d5d1 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -561,7 +561,7 @@ void Cleanup(void *fd)
561 rb->mp3_play_stop(); /* stop audio ISR */ 561 rb->mp3_play_stop(); /* stop audio ISR */
562 562
563 /* Turn on backlight timeout (revert to settings) */ 563 /* Turn on backlight timeout (revert to settings) */
564 backlight_use_settings(); /* backlight control in lib/helper.c */ 564 backlight_use_settings(rb); /* backlight control in lib/helper.c */
565 565
566 /* restore normal contrast */ 566 /* restore normal contrast */
567 rb->lcd_set_contrast(rb->global_settings->contrast); 567 rb->lcd_set_contrast(rb->global_settings->contrast);
@@ -926,7 +926,7 @@ int main(char* filename)
926 { 926 {
927 gPlay.bHasVideo = true; 927 gPlay.bHasVideo = true;
928 /* Turn off backlight timeout */ 928 /* Turn off backlight timeout */
929 backlight_force_on(); /* backlight control in lib/helper.c */ 929 backlight_force_on(rb); /* backlight control in lib/helper.c */
930 } 930 }
931 931
932 /* prepare audio playback, if contained */ 932 /* prepare audio playback, if contained */
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index a2abdba13a..1c78f33ad0 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -2334,7 +2334,7 @@ bool launch_wormlet(void)
2334 rb->lcd_clear_display(); 2334 rb->lcd_clear_display();
2335 2335
2336 /* Turn off backlight timeout */ 2336 /* Turn off backlight timeout */
2337 backlight_force_on(); /* backlight control in lib/helper.c */ 2337 backlight_force_on(rb); /* backlight control in lib/helper.c */
2338 2338
2339 /* start the game */ 2339 /* start the game */
2340 while (game_result == 1) 2340 while (game_result == 1)
@@ -2344,7 +2344,7 @@ bool launch_wormlet(void)
2344 { 2344 {
2345 case 2: 2345 case 2:
2346 /* Turn on backlight timeout (revert to settings) */ 2346 /* Turn on backlight timeout (revert to settings) */
2347 backlight_use_settings(); /* backlight control in lib/helper.c */ 2347 backlight_use_settings(rb); /* backlight control in lib/helper.c */
2348 return false; 2348 return false;
2349 break; 2349 break;
2350 } 2350 }
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 9a112aa5eb..c91e20aedd 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -934,7 +934,7 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
934#endif 934#endif
935 935
936 /* Turn off backlight timeout */ 936 /* Turn off backlight timeout */
937 backlight_force_on(); /* backlight control in lib/helper.c */ 937 backlight_force_on(rb); /* backlight control in lib/helper.c */
938 938
939 quit = false; 939 quit = false;
940 940
@@ -945,7 +945,7 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter)
945 } 945 }
946 946
947 /* Turn on backlight timeout (revert to settings) */ 947 /* Turn on backlight timeout (revert to settings) */
948 backlight_use_settings(); /* backlight control in lib/helper.c */ 948 backlight_use_settings(rb); /* backlight control in lib/helper.c */
949 rb->lcd_setfont (FONT_UI); 949 rb->lcd_setfont (FONT_UI);
950 950
951 return ret; 951 return ret;