diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
commit | 23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch) | |
tree | 8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/rockblox.c | |
parent | 35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff) |
loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api
the loader uses this pointer to initialize rb before calling entry_point
entry_point is no longer passed a pointer to the plugin API
all plugins, and pluginlib functions, are modified to refer to the
global rb
pluginlib functions which only served to copy the API pointer are
removed
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockblox.c')
-rw-r--r-- | apps/plugins/rockblox.c | 17 |
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[]; */ -/* must have variable */ -static const struct plugin_api *rb; - static bool gameover = false; /* c=current f=figure o=orientation n=next */ static int lines = 0, level = 0, score = 0, cx, cy, cf, co, nf; @@ -1072,13 +1069,13 @@ static int rockblox_loop (void) #ifdef HAS_BUTTON_HOLD if (rb->button_hold ()) { /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(rb); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* backlight control in lib/helper.c */ rb->splash(0, "Paused"); while (rb->button_hold ()) rb->sleep(HZ/10); /* Turn off backlight timeout */ - backlight_force_on(rb); /* backlight control in lib/helper.c */ + backlight_force_on(); /* backlight control in lib/helper.c */ /* get rid of the splash text */ rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); @@ -1223,17 +1220,15 @@ static int rockblox_loop (void) return PLUGIN_OK; } -enum plugin_status plugin_start (const struct plugin_api *api, const void *parameter) +enum plugin_status plugin_start (const void *parameter) { int ret; (void) parameter; - rb = api; rb->srand (*rb->current_tick); /* Load HighScore if any */ - highscore_init(rb); highscore_load(HIGH_SCORE,Highest,MAX_HIGH_SCORES); #if LCD_DEPTH > 1 @@ -1243,14 +1238,14 @@ enum plugin_status plugin_start (const struct plugin_api *api, const void *param #ifdef HAVE_LCD_BITMAP rb->lcd_setfont (FONT_SYSFIXED); #else - if (!pgfx_init(rb, 4, 2)) + if (!pgfx_init(4, 2)) { rb->splash(HZ*2, "Old LCD :("); return PLUGIN_OK; } #endif /* Turn off backlight timeout */ - backlight_force_on(rb); /* backlight control in lib/helper.c */ + backlight_force_on(); /* backlight control in lib/helper.c */ init_rockblox (); ret = rockblox_loop (); @@ -1262,7 +1257,7 @@ enum plugin_status plugin_start (const struct plugin_api *api, const void *param #endif /* Save user's HighScore */ highscore_save(HIGH_SCORE,Highest,MAX_HIGH_SCORES); - backlight_use_settings(rb); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* backlight control in lib/helper.c */ return ret; } |