summaryrefslogtreecommitdiff
path: root/apps/plugins/rockblox.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockblox.c')
-rw-r--r--apps/plugins/rockblox.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 89971c3153..639728b370 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -570,9 +570,6 @@ extern const fb_data rockblox_background[];
570 */ 570 */
571 571
572 572
573/* must have variable */
574static const struct plugin_api *rb;
575
576static bool gameover = false; 573static bool gameover = false;
577/* c=current f=figure o=orientation n=next */ 574/* c=current f=figure o=orientation n=next */
578static int lines = 0, level = 0, score = 0, cx, cy, cf, co, nf; 575static int lines = 0, level = 0, score = 0, cx, cy, cf, co, nf;
@@ -1072,13 +1069,13 @@ static int rockblox_loop (void)
1072#ifdef HAS_BUTTON_HOLD 1069#ifdef HAS_BUTTON_HOLD
1073 if (rb->button_hold ()) { 1070 if (rb->button_hold ()) {
1074 /* Turn on backlight timeout (revert to settings) */ 1071 /* Turn on backlight timeout (revert to settings) */
1075 backlight_use_settings(rb); /* backlight control in lib/helper.c */ 1072 backlight_use_settings(); /* backlight control in lib/helper.c */
1076 rb->splash(0, "Paused"); 1073 rb->splash(0, "Paused");
1077 while (rb->button_hold ()) 1074 while (rb->button_hold ())
1078 rb->sleep(HZ/10); 1075 rb->sleep(HZ/10);
1079 1076
1080 /* Turn off backlight timeout */ 1077 /* Turn off backlight timeout */
1081 backlight_force_on(rb); /* backlight control in lib/helper.c */ 1078 backlight_force_on(); /* backlight control in lib/helper.c */
1082 1079
1083 /* get rid of the splash text */ 1080 /* get rid of the splash text */
1084 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); 1081 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT);
@@ -1223,17 +1220,15 @@ static int rockblox_loop (void)
1223 return PLUGIN_OK; 1220 return PLUGIN_OK;
1224} 1221}
1225 1222
1226enum plugin_status plugin_start (const struct plugin_api *api, const void *parameter) 1223enum plugin_status plugin_start (const void *parameter)
1227{ 1224{
1228 int ret; 1225 int ret;
1229 1226
1230 (void) parameter; 1227 (void) parameter;
1231 rb = api;
1232 1228
1233 rb->srand (*rb->current_tick); 1229 rb->srand (*rb->current_tick);
1234 1230
1235 /* Load HighScore if any */ 1231 /* Load HighScore if any */
1236 highscore_init(rb);
1237 highscore_load(HIGH_SCORE,Highest,MAX_HIGH_SCORES); 1232 highscore_load(HIGH_SCORE,Highest,MAX_HIGH_SCORES);
1238 1233
1239#if LCD_DEPTH > 1 1234#if LCD_DEPTH > 1
@@ -1243,14 +1238,14 @@ enum plugin_status plugin_start (const struct plugin_api *api, const void *param
1243#ifdef HAVE_LCD_BITMAP 1238#ifdef HAVE_LCD_BITMAP
1244 rb->lcd_setfont (FONT_SYSFIXED); 1239 rb->lcd_setfont (FONT_SYSFIXED);
1245#else 1240#else
1246 if (!pgfx_init(rb, 4, 2)) 1241 if (!pgfx_init(4, 2))
1247 { 1242 {
1248 rb->splash(HZ*2, "Old LCD :("); 1243 rb->splash(HZ*2, "Old LCD :(");
1249 return PLUGIN_OK; 1244 return PLUGIN_OK;
1250 } 1245 }
1251#endif 1246#endif
1252 /* Turn off backlight timeout */ 1247 /* Turn off backlight timeout */
1253 backlight_force_on(rb); /* backlight control in lib/helper.c */ 1248 backlight_force_on(); /* backlight control in lib/helper.c */
1254 1249
1255 init_rockblox (); 1250 init_rockblox ();
1256 ret = rockblox_loop (); 1251 ret = rockblox_loop ();
@@ -1262,7 +1257,7 @@ enum plugin_status plugin_start (const struct plugin_api *api, const void *param
1262#endif 1257#endif
1263 /* Save user's HighScore */ 1258 /* Save user's HighScore */
1264 highscore_save(HIGH_SCORE,Highest,MAX_HIGH_SCORES); 1259 highscore_save(HIGH_SCORE,Highest,MAX_HIGH_SCORES);
1265 backlight_use_settings(rb); /* backlight control in lib/helper.c */ 1260 backlight_use_settings(); /* backlight control in lib/helper.c */
1266 1261
1267 return ret; 1262 return ret;
1268} 1263}