summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey.h
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-01-13 00:11:43 +0000
committerJens Arnold <amiconn@rockbox.org>2008-01-13 00:11:43 +0000
commita72499a12541fa0348e92f88662d1efe15b0ea47 (patch)
tree32a874c093616649f49f4392207b738a6f7abed7 /apps/plugins/lib/grey.h
parent43cc03457d2bda7eb3057f242ff7b23a9856408c (diff)
Greyscale library: Plugins can now put the management structure in IRAM for higher update speed. Use this in doom, mpegplayer, and zxbox. Made the api pointer part of the struct.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/grey.h')
-rw-r--r--apps/plugins/lib/grey.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/plugins/lib/grey.h b/apps/plugins/lib/grey.h
index 5bef88a89a..84b6687de3 100644
--- a/apps/plugins/lib/grey.h
+++ b/apps/plugins/lib/grey.h
@@ -36,6 +36,12 @@
#define GREY_LIGHTGRAY GREY_BRIGHTNESS(170)
#define GREY_WHITE GREY_BRIGHTNESS(255)
+/* Greyscale library management structure declaration. You need one of these
+ * in every plugin using the library, depending on whether the structure should
+ * use IRAM or not. */
+#define GREY_INFO_STRUCT struct _grey_info _grey_info;
+#define GREY_INFO_STRUCT_IRAM struct _grey_info _grey_info IBSS_ATTR;
+
/* Library initialisation and release */
bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
bool buffered, int width, int height, long *buf_taken);
@@ -148,6 +154,7 @@ struct _grey_info
int bheight; /* 4-pixel or 8-pixel units */
#endif
unsigned long flags; /* various flags, see #defines */
+ struct plugin_api *rb; /* plugin API pointer */
#ifndef SIMULATOR
unsigned char *values; /* start of greyscale pixel values */
unsigned char *phases; /* start of greyscale pixel phases */
@@ -162,8 +169,7 @@ struct _grey_info
int curfont; /* current selected font */
};
-/* Global variables */
-extern struct plugin_api *_grey_rb;
+/* Global variable, defined in the plugin */
extern struct _grey_info _grey_info;
#endif /* HAVE_LCD_BITMAP && (LCD_DEPTH < 4) */