summaryrefslogtreecommitdiffstats
path: root/firmware/export/lcd.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2012-02-22 21:18:05 +1100
committerJonathan Gordon <rockbox@jdgordon.info>2012-02-28 11:44:59 +1100
commitb37e6bc8c119289aca8740dd5e3b60d72f9d6b40 (patch)
tree7ee9d491811c950943f0fc068d2e2b460ff05c6d /firmware/export/lcd.h
parent15c69b8bafc3e89e1a825b5bbefef4a97f0001b1 (diff)
downloadrockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.tar.gz
rockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.zip
lcd drivers: Convert lcd_[remote_]framebuffer to a pointer
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
Diffstat (limited to 'firmware/export/lcd.h')
-rw-r--r--firmware/export/lcd.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 2d0123cfe3..052b368d9b 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -413,7 +413,14 @@ static inline unsigned lcd_color_to_native(unsigned color)
#define LCD_FBHEIGHT LCD_HEIGHT
#endif
/* The actual framebuffer */
-extern fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
+extern fb_data *lcd_framebuffer;
+extern fb_data lcd_static_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
+#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
+#define FBADDR(x, y) (lcd_framebuffer + ((x) * LCD_FBHEIGHT) + (y))
+#else
+#define FBADDR(x, y) (lcd_framebuffer + ((y) * LCD_FBWIDTH) + (x))
+#endif
+#define FRAMEBUFFER_SIZE (sizeof(lcd_static_framebuffer))
/** Port-specific functions. Enable in port config file. **/
#ifdef HAVE_REMOTE_LCD_AS_MAIN