summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/lcd-16bit-vert.c
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/drivers/lcd-16bit-vert.c
parent15c69b8bafc3e89e1a825b5bbefef4a97f0001b1 (diff)
downloadrockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.tar.gz
rockbox-b37e6bc8c119289aca8740dd5e3b60d72f9d6b40.tar.bz2
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/drivers/lcd-16bit-vert.c')
-rw-r--r--firmware/drivers/lcd-16bit-vert.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index f020d74757..6f59af9f70 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -41,10 +41,7 @@
#define ROW_INC 1
#define COL_INC LCD_HEIGHT
-#define LCDADDR(x, y) (&lcd_framebuffer[0][0] + LCD_HEIGHT*(x) + (y))
-
#include "lcd-16bit-common.c"
-
#include "lcd-bitmap-common.c"
/*** drawing functions ***/
@@ -54,7 +51,7 @@ void lcd_clear_viewport(void)
{
fb_data *dst, *dst_end;
- dst = LCDADDR(current_vp->x, current_vp->y);
+ dst = FBADDR(current_vp->x, current_vp->y);
dst_end = dst + current_vp->width * LCD_HEIGHT;
if (current_vp->drawmode & DRMODE_INVERSEVID)
@@ -145,7 +142,7 @@ void lcd_hline(int x1, int x2, int y)
x2 = LCD_WIDTH-1;
#endif
- dst = LCDADDR(x1 , y );
+ dst = FBADDR(x1 , y );
dst_end = dst + (x2 - x1) * LCD_HEIGHT;
do
@@ -230,7 +227,7 @@ void lcd_vline(int x, int y1, int y2)
if (fillopt == OPT_NONE && current_vp->drawmode != DRMODE_COMPLEMENT)
return;
- dst = LCDADDR(x, y1);
+ dst = FBADDR(x, y1);
switch (fillopt)
{
@@ -333,7 +330,7 @@ void lcd_fillrect(int x, int y, int width, int height)
if (fillopt == OPT_NONE && current_vp->drawmode != DRMODE_COMPLEMENT)
return;
- dst = LCDADDR(x, y);
+ dst = FBADDR(x, y);
dst_end = dst + width * LCD_HEIGHT;
do
@@ -426,7 +423,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
#endif
src += stride * src_x + src_y; /* move starting point */
- dst = LCDADDR(x, y);
+ dst = FBADDR(x, y);
fb_data *dst_end = dst + width * LCD_HEIGHT;
do
@@ -500,7 +497,7 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
#endif
src += stride * src_x + src_y; /* move starting point */
- dst = LCDADDR(x, y);
+ dst = FBADDR(x, y);
dst_end = dst + width * LCD_HEIGHT;
do