forked from len0rd/rockbox
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
This commit is contained in:
parent
35677cbc54
commit
23d9812273
179 changed files with 586 additions and 1183 deletions
|
@ -35,12 +35,10 @@ GREY_INFO_STRUCT
|
|||
static unsigned char grey_bm_buf[LCD_WIDTH * LCD_HEIGHT +
|
||||
BM_SCALED_SIZE(LCD_WIDTH,0,FORMAT_NATIVE,0)];
|
||||
|
||||
static const struct plugin_api* rb; /* global api struct pointer */
|
||||
|
||||
MEM_FUNCTION_WRAPPERS(rb)
|
||||
MEM_FUNCTION_WRAPPERS
|
||||
|
||||
/* 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)
|
||||
{
|
||||
void * plugin_buf;
|
||||
size_t plugin_buf_len;
|
||||
|
@ -54,15 +52,8 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
|
||||
if(!parameter) return PLUGIN_ERROR;
|
||||
|
||||
rb = api;
|
||||
|
||||
rb->strcpy(filename, parameter);
|
||||
|
||||
#if LCD_DEPTH == 1
|
||||
bmp_init(rb);
|
||||
resize_init(rb);
|
||||
#endif
|
||||
|
||||
ret = BMP_LOAD(filename, &grey_bm, sizeof(grey_bm_buf),
|
||||
FORMAT_NATIVE|FORMAT_RESIZE|FORMAT_KEEP_ASPECT,
|
||||
&format_grey);
|
||||
|
@ -74,7 +65,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
|
|||
}
|
||||
|
||||
plugin_buf = rb->plugin_get_buffer(&plugin_buf_len);
|
||||
if(!grey_init(rb, plugin_buf, plugin_buf_len, 0, LCD_WIDTH, LCD_HEIGHT,
|
||||
if(!grey_init(plugin_buf, plugin_buf_len, 0, LCD_WIDTH, LCD_HEIGHT,
|
||||
NULL))
|
||||
{
|
||||
rb->splash(HZ*2,"grey init failed");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue