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/rockboy | |
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/rockboy')
-rw-r--r-- | apps/plugins/rockboy/menu.c | 6 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 12 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockmacros.h | 1 |
3 files changed, 5 insertions, 14 deletions
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c index fe0b72d133..d10e2b6e1a 100644 --- a/apps/plugins/rockboy/menu.c +++ b/apps/plugins/rockboy/menu.c @@ -106,7 +106,7 @@ int do_user_menu(void) { pcm_init(); - m = menu_init(rb,items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); while(!done) { @@ -314,7 +314,7 @@ static void do_slot_menu(bool is_load) { for (i = 0; i < num_items; i++) slot_info(buf[i], 20, i); - m = menu_init(rb,items, num_items, NULL, NULL, NULL, NULL); + m = menu_init(items, num_items, NULL, NULL, NULL, NULL); while(!done) { @@ -391,7 +391,7 @@ static void do_opt_menu(void) #endif }; - m = menu_init(rb,items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); options.dirty=1; /* Assume that the settings have been changed */ diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c index 6733bf8551..ae0d218ccb 100644 --- a/apps/plugins/rockboy/rockboy.c +++ b/apps/plugins/rockboy/rockboy.c @@ -29,10 +29,6 @@ PLUGIN_HEADER PLUGIN_IRAM_DECLARE -/* here is a global api struct pointer. while not strictly necessary, - it's nice not to have to pass the api pointer in all function calls - in the plugin */ -const struct plugin_api* rb; int shut,cleanshut; char *errormsg; @@ -324,13 +320,9 @@ static int gnuboy_main(const char *rom) } /* this is the plugin entry point */ -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +enum plugin_status plugin_start(const void* parameter) { - PLUGIN_IRAM_INIT(api) - - /* if you are using a global api pointer, don't forget to copy it! - otherwise you will get lovely "I04: IllInstr" errors... :-) */ - rb = api; + PLUGIN_IRAM_INIT(rb) rb->lcd_setfont(0); diff --git a/apps/plugins/rockboy/rockmacros.h b/apps/plugins/rockboy/rockmacros.h index 34e8d0cd3f..414b889003 100644 --- a/apps/plugins/rockboy/rockmacros.h +++ b/apps/plugins/rockboy/rockmacros.h @@ -28,7 +28,6 @@ #define malloc(a) my_malloc(a) void *my_malloc(size_t size); -extern const struct plugin_api* rb; extern int shut,cleanshut; void vid_init(void); inline void vid_begin(void); |