summaryrefslogtreecommitdiff
path: root/apps/plugins/mazezam.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mazezam.c')
-rw-r--r--apps/plugins/mazezam.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/plugins/mazezam.c b/apps/plugins/mazezam.c
index fac12def4f..8981986144 100644
--- a/apps/plugins/mazezam.c
+++ b/apps/plugins/mazezam.c
@@ -28,13 +28,11 @@
28/* Include standard plugin macro */ 28/* Include standard plugin macro */
29PLUGIN_HEADER 29PLUGIN_HEADER
30 30
31static const struct plugin_api* rb;
32
33/* The plugin actions of interest. */ 31/* The plugin actions of interest. */
34const struct button_mapping *plugin_contexts[] 32const struct button_mapping *plugin_contexts[]
35= {generic_directions, generic_actions}; 33= {generic_directions, generic_actions};
36 34
37MEM_FUNCTION_WRAPPERS(rb); 35MEM_FUNCTION_WRAPPERS;
38 36
39/* Use the standard plugin buttons rather than a hard-to-maintain list of 37/* Use the standard plugin buttons rather than a hard-to-maintain list of
40 * MazezaM specific buttons. */ 38 * MazezaM specific buttons. */
@@ -252,7 +250,7 @@ static void store_lcd_settings(void)
252******************************************************************************/ 250******************************************************************************/
253static void restore_lcd_settings(void) { 251static void restore_lcd_settings(void) {
254 /* Turn on backlight timeout (revert to settings) */ 252 /* Turn on backlight timeout (revert to settings) */
255 backlight_use_settings(rb); /* backlight control in lib/helper.c */ 253 backlight_use_settings(); /* backlight control in lib/helper.c */
256 254
257 /* Restore the old settings */ 255 /* Restore the old settings */
258#if LCD_DEPTH > 1 256#if LCD_DEPTH > 1
@@ -267,7 +265,7 @@ static void restore_lcd_settings(void) {
267******************************************************************************/ 265******************************************************************************/
268static void plugin_lcd_settings(void) { 266static void plugin_lcd_settings(void) {
269 /* Turn off backlight timeout */ 267 /* Turn off backlight timeout */
270 backlight_force_on(rb); /* backlight control in lib/helper.c */ 268 backlight_force_on(); /* backlight control in lib/helper.c */
271 269
272 /* Set the new settings */ 270 /* Set the new settings */
273#ifdef HAVE_LCD_COLOR 271#ifdef HAVE_LCD_COLOR
@@ -546,7 +544,7 @@ static void level_loop(struct level_info* li, short* shift, short *x, short *y)
546 while (state >= STATE_IN_LEVEL) { 544 while (state >= STATE_IN_LEVEL) {
547 draw_level(li, shift, *x, *y); 545 draw_level(li, shift, *x, *y);
548 rb->lcd_update(); 546 rb->lcd_update();
549 button = pluginlib_getaction(rb, TIMEOUT_BLOCK, plugin_contexts, 2); 547 button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, 2);
550 blocked = false; 548 blocked = false;
551 549
552 switch (button) { 550 switch (button) {
@@ -643,7 +641,7 @@ static void in_game_menu(void)
643 break; 641 break;
644 642
645 case 2: /* Audio playback */ 643 case 2: /* Audio playback */
646 playback_control(rb, NULL); 644 playback_control(NULL);
647 state = STATE_IN_LEVEL; 645 state = STATE_IN_LEVEL;
648 break; 646 break;
649 647
@@ -918,17 +916,12 @@ static void main_menu(void)
918/***************************************************************************** 916/*****************************************************************************
919* Plugin entry point 917* Plugin entry point
920******************************************************************************/ 918******************************************************************************/
921enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) 919enum plugin_status plugin_start(const void* parameter)
922{ 920{
923 enum plugin_status plugin_state; 921 enum plugin_status plugin_state;
924 922
925 /* Usual plugin stuff */ 923 /* Usual plugin stuff */
926 (void)parameter; 924 (void)parameter;
927 rb = api;
928
929
930 /* initialise the config file module */
931 configfile_init(rb);
932 925
933 store_lcd_settings(); 926 store_lcd_settings();
934 927