From 23d9812273d9c74af72ccdc3aa4cfea971f220a4 Mon Sep 17 00:00:00 2001 From: Andrew Mahone Date: Fri, 16 Jan 2009 10:34:40 +0000 Subject: 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 --- apps/plugins/doom/i_video.c | 2 +- apps/plugins/doom/rockdoom.c | 18 ++++++++---------- apps/plugins/doom/rockmacros.h | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'apps/plugins/doom') diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 1d533d4..23872c2 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -772,7 +772,7 @@ void I_InitGraphics(void) #ifndef HAVE_LCD_COLOR gbuf=malloc(GREYBUFSIZE); - grey_init(rb, gbuf, GREYBUFSIZE, GREY_ON_COP, LCD_WIDTH, LCD_HEIGHT, NULL); + grey_init(gbuf, GREYBUFSIZE, GREY_ON_COP, LCD_WIDTH, LCD_HEIGHT, NULL); /* switch on greyscale overlay */ grey_show(true); #endif diff --git a/apps/plugins/doom/rockdoom.c b/apps/plugins/doom/rockdoom.c index 763e9d5..1e7c9fa 100644 --- a/apps/plugins/doom/rockdoom.c +++ b/apps/plugins/doom/rockdoom.c @@ -101,7 +101,6 @@ int my_close(int id) return 0; } #endif -const struct plugin_api* rb; #define MAXARGVS 100 bool noprintf=0; // Variable disables printf lcd updates to protect grayscale lib/direct lcd updates @@ -496,7 +495,7 @@ int Oset_keys() { "Game Automap", NULL }, }; - m = menu_init(rb, items, sizeof(items) / sizeof(*items), + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); while(!menuquit) @@ -560,7 +559,7 @@ static bool Doptions() #endif }; - m = menu_init(rb, items, sizeof(items) / sizeof(*items), + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); while(!menuquit) @@ -583,7 +582,7 @@ int menuchoice(struct menu_item *menu, int items) { int m, result; - m = menu_init(rb, menu, items,NULL, NULL, NULL, NULL); + m = menu_init(menu, items,NULL, NULL, NULL, NULL); result= menu_show(m); menu_exit(m); @@ -633,7 +632,7 @@ int doom_menu() while (rb->button_get(false) != BUTTON_NONE) rb->yield(); - m = menu_init(rb, items, sizeof(items) / sizeof(*items), + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); while(!menuquit) @@ -677,11 +676,10 @@ int doom_menu() extern int systemvol; /* 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) + PLUGIN_IRAM_INIT(rb) - rb = api; (void)parameter; doomexit=0; @@ -741,7 +739,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame systemvol= rb->global_settings->volume-rb->global_settings->volume%((rb->sound_max(SOUND_VOLUME)-rb->sound_min(SOUND_VOLUME))/15); general_translucency = default_translucency; // phares - backlight_force_on(rb); + backlight_force_on(); #ifdef RB_PROFILE rb->profile_thread(); #endif @@ -755,7 +753,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #ifdef RB_PROFILE rb->profstop(); #endif - backlight_use_settings(rb); + backlight_use_settings(); M_SaveDefaults (); diff --git a/apps/plugins/doom/rockmacros.h b/apps/plugins/doom/rockmacros.h index 6abf025..73cd902 100644 --- a/apps/plugins/doom/rockmacros.h +++ b/apps/plugins/doom/rockmacros.h @@ -26,7 +26,6 @@ #include "autoconf.h" #include "z_zone.h" -extern const struct plugin_api* rb; extern bool noprintf; extern bool doomexit; -- cgit v1.1