summaryrefslogtreecommitdiffstats
path: root/firmware/target
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/target
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/target')
-rw-r--r--firmware/target/arm/as3525/lcd-fuze.c2
-rw-r--r--firmware/target/arm/as3525/lcd-ssd1303.c4
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c2
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c2
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c8
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c2
-rw-r--r--firmware/target/arm/ipod/lcd-gray.c4
-rw-r--r--firmware/target/arm/ipod/video/lcd-video.c2
-rw-r--r--firmware/target/arm/iriver/h10/lcd-h10_20gb.c2
-rw-r--r--firmware/target/arm/iriver/h10/lcd-h10_5gb.c2
-rw-r--r--firmware/target/arm/lcd-c200_c200v2.c2
-rw-r--r--firmware/target/arm/lcd-ssd1815.c4
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-mr100.c4
-rw-r--r--firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c2
-rw-r--r--firmware/target/arm/pbell/vibe500/lcd-vibe500.c2
-rw-r--r--firmware/target/arm/philips/hdd1630/lcd-hdd1630.c2
-rw-r--r--firmware/target/arm/philips/hdd6330/lcd-hdd6330.c2
-rw-r--r--firmware/target/arm/philips/sa9200/lcd-sa9200.c6
-rw-r--r--firmware/target/arm/pnx0101/iriver-ifp7xx/lcd-ifp7xx.c4
-rw-r--r--firmware/target/arm/rk27xx/lcd-hifiman.c2
-rw-r--r--firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c2
-rw-r--r--firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c2
-rw-r--r--firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c2
-rw-r--r--firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c4
-rw-r--r--firmware/target/arm/s5l8700/yps3/lcd-yps3.c4
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c2
-rw-r--r--firmware/target/arm/samsung/yh820/lcd-yh820.c2
-rw-r--r--firmware/target/arm/samsung/yh920/lcd-yh920.c2
-rw-r--r--firmware/target/arm/samsung/yh925/lcd-yh925.c2
-rw-r--r--firmware/target/arm/sandisk/sansa-view/lcd-view.c2
-rw-r--r--firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c2
-rw-r--r--firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c2
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c6
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c8
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c2
-rw-r--r--firmware/target/arm/tms320dm320/sansa-connect/lcd-sansaconnect.c2
-rw-r--r--firmware/target/coldfire/iaudio/lcd-remote-iaudio.c4
-rw-r--r--firmware/target/coldfire/iaudio/m3/lcd-m3.c4
-rw-r--r--firmware/target/coldfire/iaudio/m5/lcd-m5.c4
-rw-r--r--firmware/target/coldfire/iaudio/x5/lcd-x5.c2
-rw-r--r--firmware/target/coldfire/iriver/h100/lcd-h100.c4
-rw-r--r--firmware/target/coldfire/iriver/h300/lcd-h300.c4
-rw-r--r--firmware/target/coldfire/iriver/lcd-remote-iriver.c4
-rw-r--r--firmware/target/coldfire/mpio/hd200/lcd-hd200.c4
-rw-r--r--firmware/target/coldfire/mpio/hd300/lcd-hd300.c4
-rw-r--r--firmware/target/hosted/android/lcd-android.c6
-rw-r--r--firmware/target/hosted/sdl/lcd-bitmap.c18
-rw-r--r--firmware/target/hosted/sdl/lcd-remote-bitmap.c4
-rw-r--r--firmware/target/hosted/ypr0/lcd-ypr0.c4
-rw-r--r--firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c4
-rw-r--r--firmware/target/sh/archos/lcd-archos-bitmap.c4
51 files changed, 88 insertions, 92 deletions
diff --git a/firmware/target/arm/as3525/lcd-fuze.c b/firmware/target/arm/as3525/lcd-fuze.c
index 2acc7b3bf9..b2033738b6 100644
--- a/firmware/target/arm/as3525/lcd-fuze.c
+++ b/firmware/target/arm/as3525/lcd-fuze.c
@@ -332,7 +332,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_cmd(R_WRITE_DATA_2_GRAM);
- ptr = &lcd_framebuffer[y][x];
+ ptr = FBADDR(x,y);
do
{
diff --git a/firmware/target/arm/as3525/lcd-ssd1303.c b/firmware/target/arm/as3525/lcd-ssd1303.c
index 213f12a424..9fcc85d243 100644
--- a/firmware/target/arm/as3525/lcd-ssd1303.c
+++ b/firmware/target/arm/as3525/lcd-ssd1303.c
@@ -273,7 +273,7 @@ void lcd_update(void)
lcd_write_command (LCD_CNTL_HIGHCOL | ((offset >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | (offset & 0xf));
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -304,6 +304,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command (LCD_CNTL_HIGHCOL | (((x+offset) >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x+offset) & 0xf));
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 3952171e7e..7673b529cc 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -426,7 +426,7 @@ void lcd_update_rect(int x, int y, int width, int height)
/* write to GRAM */
for (row = y; row < y_end; row++) {
- lcd_write_data(&lcd_framebuffer[row][x], width);
+ lcd_write_data(FBADDR(x,row), width);
}
}
diff --git a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
index f875b40c05..2c80f89ff7 100644
--- a/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
+++ b/firmware/target/arm/as3525/sansa-e200v2/lcd-e200v2.c
@@ -488,7 +488,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_window(x, y, x+width-1, y+height-1);
lcd_write_cmd(R_WRITE_DATA_2_GRAM);
- ptr = &lcd_framebuffer[y][x];
+ ptr = FBADDR(x,y);
do
{
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
index c2e80ad1fc..b25fff8c3b 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
@@ -533,12 +533,12 @@ void lcd_update_rect(int x, int y, int w, int h)
*/
if(w == LCD_WIDTH)
{
- memcpy((void *)FRAME, &lcd_framebuffer[y][x], w * h * sizeof(fb_data));
+ memcpy((void *)FRAME, FBADDR(x,y), w * h * sizeof(fb_data));
}
else
{
for(int i = 0; i < h; i++)
- memcpy((fb_data *)FRAME + i * w, &lcd_framebuffer[y + i][x], w * sizeof(fb_data));
+ memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data));
}
/* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
* (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count
@@ -599,10 +599,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
linecounter = height >> 1;
#if LCD_WIDTH >= LCD_HEIGHT
- dst = &lcd_framebuffer[y][x];
+ dst = FBADDR(x,y);
row_end = dst + width;
#else
- dst = &lcd_framebuffer[x][LCD_WIDTH - y - 1];
+ dst = FBADDR(LCD_WIDTH - y - 1,x);
row_end = dst + LCD_WIDTH * width;
#endif
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index 589e8654ae..c7676fa721 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -280,7 +280,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_setup_drawing_region(x, y, width, height);
- addr = (unsigned long*)&lcd_framebuffer[y][x];
+ addr = (unsigned long*)FBADDR(x, y);
while (height > 0) {
int r, h, pixels_to_write;
diff --git a/firmware/target/arm/ipod/lcd-gray.c b/firmware/target/arm/ipod/lcd-gray.c
index 11d4cba2f5..d8695cdb10 100644
--- a/firmware/target/arm/ipod/lcd-gray.c
+++ b/firmware/target/arm/ipod/lcd-gray.c
@@ -340,10 +340,10 @@ void lcd_update_rect(int x, int y, int width, int height)
#if defined(IPOD_MINI) || defined(IPOD_MINI2G)
if (pix_offset == -2)
- lcd_write_data_shifted(&lcd_framebuffer[y][2*x], width);
+ lcd_write_data_shifted(FBADDR(2*x, y), width);
else
#endif
- lcd_write_data(&lcd_framebuffer[y][2*x], width);
+ lcd_write_data(FBADDR(2*x, y), width);
}
}
diff --git a/firmware/target/arm/ipod/video/lcd-video.c b/firmware/target/arm/ipod/video/lcd-video.c
index c499e9f745..27d889aafa 100644
--- a/firmware/target/arm/ipod/video/lcd-video.c
+++ b/firmware/target/arm/ipod/video/lcd-video.c
@@ -410,7 +410,7 @@ void lcd_update_rect(int x, int y, int width, int height)
/* Prevent the tick from triggering BCM updates while we're writing. */
lcd_block_tick();
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x, y);
bcmaddr = BCMA_CMDPARAM + (LCD_WIDTH*2) * y + (x << 1);
if (width == LCD_WIDTH)
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
index df748a74fb..c7e339295d 100644
--- a/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
+++ b/firmware/target/arm/iriver/h10/lcd-h10_20gb.c
@@ -527,7 +527,7 @@ void lcd_update_rect(int x0, int y0, int width, int height)
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);
- addr = (unsigned short*)&lcd_framebuffer[y0][x0];
+ addr = (unsigned short*)FBADDR(x0,y0);
int c, r;
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c
index ce57af14d5..5e1ad9ce23 100644
--- a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c
+++ b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c
@@ -327,7 +327,7 @@ void lcd_update_rect(int x0, int y0, int width, int height)
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);
- addr = (unsigned long*)&lcd_framebuffer[y0][x0];
+ addr = (unsigned long*)FBADDR(x0,y0);
while (height > 0) {
int c, r;
diff --git a/firmware/target/arm/lcd-c200_c200v2.c b/firmware/target/arm/lcd-c200_c200v2.c
index f82f8a809e..38877ccac9 100644
--- a/firmware/target/arm/lcd-c200_c200v2.c
+++ b/firmware/target/arm/lcd-c200_c200v2.c
@@ -395,7 +395,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. */
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
if (width <= 1) {
/* The X end address must be larger than the X start address, so we
diff --git a/firmware/target/arm/lcd-ssd1815.c b/firmware/target/arm/lcd-ssd1815.c
index 35d8cf2275..891d4ef64d 100644
--- a/firmware/target/arm/lcd-ssd1815.c
+++ b/firmware/target/arm/lcd-ssd1815.c
@@ -303,7 +303,7 @@ void lcd_update(void)
lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -331,6 +331,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
index a0ea2a6aab..d336ad7419 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-mr100.c
@@ -239,7 +239,7 @@ void lcd_update(void)
lcd_write_command(cmd1);
lcd_write_command(cmd2);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -271,6 +271,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command(cmd1);
lcd_write_command(cmd2);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
index aa3d228952..edcdde7253 100644
--- a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c
@@ -255,7 +255,7 @@ static void remote_update_lcd(void)
data[6] = (y + 1) << 3; /* y2 */
for (x = 0; x < RC_WIDTH; x++)
- data[x + 7] = lcd_remote_framebuffer[y][x];
+ data[x + 7] = FBREMOTEADDR(x,y);
remote_tx(data, RC_WIDTH + 7);
diff --git a/firmware/target/arm/pbell/vibe500/lcd-vibe500.c b/firmware/target/arm/pbell/vibe500/lcd-vibe500.c
index 4cb073db7b..4dd2ec1206 100644
--- a/firmware/target/arm/pbell/vibe500/lcd-vibe500.c
+++ b/firmware/target/arm/pbell/vibe500/lcd-vibe500.c
@@ -483,7 +483,7 @@ void lcd_update_rect(int x0, int y0, int width, int height)
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);
- addr = &lcd_framebuffer[y0][x0];
+ addr = FBADDR(x0, y0)
int c, r;
for (r = 0; r < height; r++)
diff --git a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c
index 500120a432..28bef09463 100644
--- a/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c
+++ b/firmware/target/arm/philips/hdd1630/lcd-hdd1630.c
@@ -373,7 +373,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. */
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
lcd_send_cmd(CASET);
lcd_send_data(x);
diff --git a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
index 328c270b5e..cdd3064bba 100644
--- a/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
+++ b/firmware/target/arm/philips/hdd6330/lcd-hdd6330.c
@@ -285,7 +285,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
- addr = (unsigned long*)&lcd_framebuffer[y][x];
+ addr = (unsigned long*)FBADDR(x,y);
while (height > 0)
{
diff --git a/firmware/target/arm/philips/sa9200/lcd-sa9200.c b/firmware/target/arm/philips/sa9200/lcd-sa9200.c
index 3db308ed09..e30a298045 100644
--- a/firmware/target/arm/philips/sa9200/lcd-sa9200.c
+++ b/firmware/target/arm/philips/sa9200/lcd-sa9200.c
@@ -495,8 +495,8 @@ void lcd_update(void)
if (!display_on)
return;
- addr = &lcd_framebuffer[0][0];
- end = &lcd_framebuffer[LCD_HEIGHT - 1][LCD_WIDTH];
+ addr = FBADDR(0,0);
+ end = FBADDR(LCD_WIDTH,LCD_HEIGHT - 1);
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH - 1) << 8);
lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT - 1) << 8);
@@ -533,7 +533,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if (height <= 0)
return; /* Nothing left to do. */
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((x + width - 1) << 8) | x);
lcd_write_reg(R_VERT_RAM_ADDR_POS, ((y + height - 1) << 8) | y);
diff --git a/firmware/target/arm/pnx0101/iriver-ifp7xx/lcd-ifp7xx.c b/firmware/target/arm/pnx0101/iriver-ifp7xx/lcd-ifp7xx.c
index c71e8fd6fb..1ad604d50c 100644
--- a/firmware/target/arm/pnx0101/iriver-ifp7xx/lcd-ifp7xx.c
+++ b/firmware/target/arm/pnx0101/iriver-ifp7xx/lcd-ifp7xx.c
@@ -191,7 +191,7 @@ void lcd_update(void)
lcd_write_command (LCD_CNTL_HIGHCOL);
lcd_write_command (LCD_CNTL_LOWCOL | 4);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -219,6 +219,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command (LCD_CNTL_HIGHCOL | (((x+4) >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x+4) & 0xf));
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/arm/rk27xx/lcd-hifiman.c b/firmware/target/arm/rk27xx/lcd-hifiman.c
index 91e55894e5..21ca321d1f 100644
--- a/firmware/target/arm/rk27xx/lcd-hifiman.c
+++ b/firmware/target/arm/rk27xx/lcd-hifiman.c
@@ -162,7 +162,7 @@ void lcd_update_rect(int x, int y, int width, int height)
for (px=x; px<pxmax; px++)
for (py=y; py<pymax; py++)
- lcd_data(lcd_framebuffer[py][px]);
+ lcd_data(FBADDR(px, py));
}
/* Blit a YUV bitmap directly to the LCD */
diff --git a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
index b184630ebe..6b989a6dd7 100644
--- a/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
+++ b/firmware/target/arm/rk27xx/rk27generic/lcd-rk27generic.c
@@ -191,7 +191,7 @@ void lcd_update_rect(int x, int y, int width, int height)
for (py=y; py<pymax; py++)
{
for (px=x; px<pxmax; px++)
- LCD_DATA = lcd_pixel_transform(lcd_framebuffer[py][px]);
+ LCD_DATA = lcd_pixel_transform(FBADDR(px,py));
}
}
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
index 6434469881..13e5c5c1d4 100644
--- a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
+++ b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c
@@ -394,7 +394,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_setup_drawing_region(x, y, width, height);
/* Copy display bitmap to hardware */
- p = &lcd_framebuffer[y][x];
+ p = FBADDR(x,y);
if (LCD_WIDTH == width) {
/* Write all lines at once */
lcd_write_line(p, height*LCD_WIDTH, LCD_BASE);
diff --git a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
index 3420e92d62..5ed6c752b7 100644
--- a/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
+++ b/firmware/target/arm/s5l8700/meizu-m3/lcd-m3.c
@@ -295,7 +295,7 @@ void lcd_update(void)
LCD_WCMD = 0;
LCD_WCMD = 0x22;
}
- for(p=&lcd_framebuffer[0][0], i=0;i<LCD_WIDTH*LCD_FBHEIGHT;++i, ++p) {
+ for(p=FBADDR(0,0), i=0;i<LCD_WIDTH*LCD_FBHEIGHT;++i, ++p) {
while (LCD_STATUS & STAT_FULL);
LCD_WDATA = RGB_UNPACK_RED(*p);
while (LCD_STATUS & STAT_FULL);
diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c
index 6ab5c08a50..5e722d5a87 100644
--- a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c
+++ b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c
@@ -438,8 +438,8 @@ void lcd_init_device(void)
lcd_controller_init();
/* set framebuffer addresses */
- fb = (uint32_t) &lcd_framebuffer[0][0];
- fb_end = (uint32_t) &lcd_framebuffer[LCD_HEIGHT][0];
+ fb = (uint32_t) FBADDR(0,0);
+ fb_end = (uint32_t) FBADDR(0,LCD_HEIGHT);
window = 2 * LCD_WIDTH;
LCDB1SADDR1 = fb;
diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
index 3b57a50ec0..a9830bca57 100644
--- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c
@@ -306,7 +306,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_set_position1(x, y);
for (h = 0; h < height; h++) {
- p = &lcd_framebuffer[y][0];
+ p = FBADDR(0,y);
for (w = 0; w < LCD_WIDTH; w++) {
while (LCD_STATUS & 0x10);
LCD_WDATA = *p++;
@@ -319,7 +319,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_set_position2(x, y);
for (h = 0; h < height; h++) {
- p = &lcd_framebuffer[y][x];
+ p = FBADDR(x,y);
for (w = 0; w < width; w++) {
while (LCD_STATUS & 0x10);
LCD_WDATA = *p++;
diff --git a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
index 84443551b9..f9dbab6180 100644
--- a/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/lcd-ipod6g.c
@@ -428,7 +428,7 @@ void lcd_update_rect(int, int, int, int) ICODE_ATTR;
void lcd_update_rect(int x, int y, int width, int height)
{
int pixels = width * height;
- fb_data* p = &lcd_framebuffer[y][x];
+ fb_data* p = FBADDR(x,y);
uint16_t* out = lcd_dblbuf[0];
#ifdef HAVE_LCD_SLEEP
diff --git a/firmware/target/arm/samsung/yh820/lcd-yh820.c b/firmware/target/arm/samsung/yh820/lcd-yh820.c
index 4773e27185..10934621d7 100644
--- a/firmware/target/arm/samsung/yh820/lcd-yh820.c
+++ b/firmware/target/arm/samsung/yh820/lcd-yh820.c
@@ -347,7 +347,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. */
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
if (width <= 1) {
lcd_send_command(R_ENTRY_MODE); /* The X end address must be larger */
diff --git a/firmware/target/arm/samsung/yh920/lcd-yh920.c b/firmware/target/arm/samsung/yh920/lcd-yh920.c
index d24396050a..5563c13f53 100644
--- a/firmware/target/arm/samsung/yh920/lcd-yh920.c
+++ b/firmware/target/arm/samsung/yh920/lcd-yh920.c
@@ -259,7 +259,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_reg(LCD_CNTL_PAGE, y);
lcd_write_reg(LCD_CNTL_COLUMN, x);
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
lcd_send_cmd(LCD_CNTL_DATA_WRITE);
lcd_write_data(addr, width);
diff --git a/firmware/target/arm/samsung/yh925/lcd-yh925.c b/firmware/target/arm/samsung/yh925/lcd-yh925.c
index ceed443654..93bfb3a5f2 100644
--- a/firmware/target/arm/samsung/yh925/lcd-yh925.c
+++ b/firmware/target/arm/samsung/yh925/lcd-yh925.c
@@ -639,7 +639,7 @@ void lcd_update_rect(int x0, int y0, int width, int height)
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM);
- addr = (unsigned short*)&lcd_framebuffer[y0][x0];
+ addr = (unsigned short*)FBADDR(x0,y0);
int c, r;
diff --git a/firmware/target/arm/sandisk/sansa-view/lcd-view.c b/firmware/target/arm/sandisk/sansa-view/lcd-view.c
index 99c972704d..cc67e838f9 100644
--- a/firmware/target/arm/sandisk/sansa-view/lcd-view.c
+++ b/firmware/target/arm/sandisk/sansa-view/lcd-view.c
@@ -363,7 +363,7 @@ void lcd_update(void)
{
const fb_data *addr;
- addr = &lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH];
+ addr = FBADDR(LCD_WIDTH,LCD_HEIGHT);
lcd_write_reg(0x20, 0x0);
lcd_write_reg(0x21, 0x0);
diff --git a/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c b/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
index 4abd17741b..c53aadaf30 100644
--- a/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
+++ b/firmware/target/arm/tcc77x/c100/lcd-S6B33B2.c
@@ -252,7 +252,7 @@ void lcd_update_rect(int x, int y, int width, int height)
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. */
- addr = &lcd_framebuffer[y][x];
+ addr = FBADDR(x,y);
if (width <= 1) {
lcd_send_command(R_ENTRY_MODE); /* The X end address must be larger */
diff --git a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
index 5d2a2b8194..8b9a9bda83 100644
--- a/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
+++ b/firmware/target/arm/tcc77x/iaudio7/lcd-iaudio7.c
@@ -211,7 +211,7 @@ void lcd_update_rect(int sx, int sy, int width, int height)
fb_data c;
unsigned long color;
- c = lcd_framebuffer[y][x];
+ c = FBADDR(x,y);
color =
((c & 0x1f) << 1) | ((c & 0x7e0) << 1) | ((c & 0xf800) <<
2);
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
index 204a99f87c..5f623dc239 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/lcd-creativezvm.c
@@ -380,7 +380,7 @@ void lcd_update_rect(int x, int y, int width, int height)
#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
dst = (fb_data *)FRAME + LCD_WIDTH*y + x;
- src = &lcd_framebuffer[y][x];
+ src = FBADDR(x,y);
/* Copy part of the Rockbox framebuffer to the second framebuffer */
if (width < LCD_WIDTH)
@@ -394,7 +394,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
}
#else
- src = &lcd_framebuffer[y][x];
+ src = FBADDR(x,y);
register int xc, yc;
register fb_data *start=FRAME + LCD_HEIGHT*(LCD_WIDTH-x-1) + y + 1;
@@ -419,7 +419,7 @@ void lcd_update(void)
if (!lcd_on || direct_fb_access)
return;
#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
- lcd_copy_buffer_rect((fb_data *)FRAME, &lcd_framebuffer[0][0],
+ lcd_copy_buffer_rect((fb_data *)FRAME, FBADDR(0,0),
LCD_WIDTH*LCD_HEIGHT, 1);
#else
lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT);
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 38631401f9..c3a96a3efd 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -500,12 +500,12 @@ void lcd_update_rect(int x, int y, int width, int height)
if (width < LCD_WIDTH)
{
/* Not full width - do line-by-line */
- lcd_copy_buffer_rect(dst, &lcd_framebuffer[y][x], width, height);
+ lcd_copy_buffer_rect(dst, FBADDR(x,y), width, height);
}
else
{
/* Full width - copy as one line */
- lcd_copy_buffer_rect(dst, &lcd_framebuffer[y][x], LCD_WIDTH*height, 1);
+ lcd_copy_buffer_rect(dst, FBADDR(x,y), LCD_WIDTH*height, 1);
}
#endif
@@ -519,7 +519,7 @@ void lcd_update_rect(int x, int y, int width, int height)
#else
fb_data *src;
fb_data *dst;
- src = &lcd_framebuffer[0][0] + (x*LCD_HEIGHT + y);
+ src = FBADDR(0,0) + (x*LCD_HEIGHT + y);
dst = FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y);
while(width > 0) {
@@ -532,7 +532,7 @@ void lcd_update_rect(int x, int y, int width, int height)
#else
register fb_data *dst, *src;
- src = &lcd_framebuffer[y][x];
+ src = FBADDR(x,y);
dst=FRAME + (LCD_NATIVE_WIDTH*(LCD_NATIVE_HEIGHT-1))
- LCD_NATIVE_WIDTH*x + y ;
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
index d8f55ee63d..5b8b2f9437 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-remote-mr500.c
@@ -246,7 +246,7 @@ static void remote_tick(void)
for(i=7; i<remote_payload_size; i++)
{
remote_payload[i]=
- lcd_remote_framebuffer[remote_payload[4]>>3][i+remote_draw_x-7];
+ FBREMOTEADDR(i+remote_draw_x-7, remote_payload[4]>>3);
}
}
diff --git a/firmware/target/arm/tms320dm320/sansa-connect/lcd-sansaconnect.c b/firmware/target/arm/tms320dm320/sansa-connect/lcd-sansaconnect.c
index 403ce182be..27eb0b407a 100644
--- a/firmware/target/arm/tms320dm320/sansa-connect/lcd-sansaconnect.c
+++ b/firmware/target/arm/tms320dm320/sansa-connect/lcd-sansaconnect.c
@@ -167,7 +167,7 @@ static void dma_lcd_copy_buffer_rect(int x, int y, int width, int height)
/* Set source and destination addresses */
dst = (char*)(FRAME + LCD_WIDTH*y + x);
- src = (char*)(&lcd_framebuffer[y][x]);
+ src = (char*)(FBADDR(x,y));
/* Flush cache to memory */
commit_dcache();
diff --git a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
index 88fc6fc563..e84760e197 100644
--- a/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
+++ b/firmware/target/coldfire/iaudio/lcd-remote-iaudio.c
@@ -228,7 +228,7 @@ void lcd_remote_update(void)
have to update one page at a time. */
lcd_remote_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
lcd_remote_write_command_ex(LCD_SET_COLUMN | 0, 0);
- lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH);
+ lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
}
}
}
@@ -260,7 +260,7 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
lcd_remote_write_command_ex(LCD_SET_COLUMN | ((x >> 4) & 0xf),
x & 0xf);
- lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width);
+ lcd_remote_write_data(FBREMOTEADDR(x,y), width);
}
}
}
diff --git a/firmware/target/coldfire/iaudio/m3/lcd-m3.c b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
index 380789e7f7..1d61daf323 100644
--- a/firmware/target/coldfire/iaudio/m3/lcd-m3.c
+++ b/firmware/target/coldfire/iaudio/m3/lcd-m3.c
@@ -265,7 +265,7 @@ void lcd_update(void)
have to update one page at a time. */
lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
lcd_write_command_e(LCD_SET_COLUMN | 0, 0);
- lcd_write_data(lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data(FBADDR(0, y), LCD_WIDTH);
}
}
}
@@ -295,7 +295,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf));
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
- lcd_write_data(&lcd_framebuffer[y][x], width);
+ lcd_write_data(FBADDR(x,y), width);
}
}
}
diff --git a/firmware/target/coldfire/iaudio/m5/lcd-m5.c b/firmware/target/coldfire/iaudio/m5/lcd-m5.c
index ae8f14bb25..8f022adf96 100644
--- a/firmware/target/coldfire/iaudio/m5/lcd-m5.c
+++ b/firmware/target/coldfire/iaudio/m5/lcd-m5.c
@@ -207,7 +207,7 @@ void lcd_update(void)
lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -235,6 +235,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 19b0725ce4..cf6e301c16 100644
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -530,7 +530,7 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_begin_write_gram();
- ptr = (unsigned short *)&lcd_framebuffer[y][x];
+ ptr = (unsigned short *)FBADDR(x,y);
do
{
diff --git a/firmware/target/coldfire/iriver/h100/lcd-h100.c b/firmware/target/coldfire/iriver/h100/lcd-h100.c
index ae77affd18..b13751b9eb 100644
--- a/firmware/target/coldfire/iriver/h100/lcd-h100.c
+++ b/firmware/target/coldfire/iriver/h100/lcd-h100.c
@@ -216,7 +216,7 @@ void lcd_update(void)
lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -244,6 +244,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/iriver/h300/lcd-h300.c b/firmware/target/coldfire/iriver/h300/lcd-h300.c
index 6c21a7e260..191c769c97 100644
--- a/firmware/target/coldfire/iriver/h300/lcd-h300.c
+++ b/firmware/target/coldfire/iriver/h300/lcd-h300.c
@@ -447,13 +447,13 @@ void lcd_update_rect(int x, int y, int width, int height)
if (width == LCD_WIDTH)
{
dma_count = 1;
- SAR3 = (unsigned long)lcd_framebuffer[y];
+ SAR3 = (unsigned long)FBADDR(0, y);
BCR3 = (LCD_WIDTH*sizeof(fb_data)) * height;
}
else
{
dma_count = height;
- SAR3 = dma_addr = (unsigned long)&lcd_framebuffer[y][x];
+ SAR3 = dma_addr = (unsigned long)FBADDR(x,y);
BCR3 = dma_len = width * sizeof(fb_data);
}
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
diff --git a/firmware/target/coldfire/iriver/lcd-remote-iriver.c b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
index 0ff041f033..03c0e40dbe 100644
--- a/firmware/target/coldfire/iriver/lcd-remote-iriver.c
+++ b/firmware/target/coldfire/iriver/lcd-remote-iriver.c
@@ -312,7 +312,7 @@ void lcd_remote_update(void)
lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | (xoffset & 0xf));
- lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH);
+ lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
}
}
@@ -346,6 +346,6 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | ((x+xoffset) & 0xf));
- lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width);
+ lcd_remote_write_data(FBREMOTEADDR(x,y), width);
}
}
diff --git a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
index 879352f7b4..3c00959745 100644
--- a/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
+++ b/firmware/target/coldfire/mpio/hd200/lcd-hd200.c
@@ -187,7 +187,7 @@ void DMA3(void)
lcd_write_command_e(LCD_SET_COLUMN | ((column >> 4) & 0xf),
column & 0x0f);
- SAR3 = (unsigned long)&lcd_framebuffer[page][column];
+ SAR3 = (unsigned long)FBADDR(column,page);
BCR3 = dma_len;
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
| DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
@@ -261,7 +261,7 @@ void lcd_update_rect(int x, int y, int width, int height)
dma_count = ymax - y + 1;
/* Initialize DMA transfer */
- SAR3 = (unsigned long)&lcd_framebuffer[page][column];
+ SAR3 = (unsigned long)FBADDR(column,page);
BCR3 = dma_len;
DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
| DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
diff --git a/firmware/target/coldfire/mpio/hd300/lcd-hd300.c b/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
index 31087a5d43..509ed4cd53 100644
--- a/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
+++ b/firmware/target/coldfire/mpio/hd300/lcd-hd300.c
@@ -211,7 +211,7 @@ void lcd_update(void)
lcd_write_command(LCD_CNTL_DATA_WRITE);
/* Copy display bitmap to hardware */
- lcd_write_data (&lcd_framebuffer[0][0], LCD_WIDTH*LCD_FBHEIGHT);
+ lcd_write_data (FBADDR(0,0), LCD_WIDTH*LCD_FBHEIGHT);
}
/* Update a fraction of the display. */
@@ -238,6 +238,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
lcd_write_command(LCD_CNTL_DATA_WRITE);
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}
diff --git a/firmware/target/hosted/android/lcd-android.c b/firmware/target/hosted/android/lcd-android.c
index abde72155d..c9a3fd6edf 100644
--- a/firmware/target/hosted/android/lcd-android.c
+++ b/firmware/target/hosted/android/lcd-android.c
@@ -75,7 +75,7 @@ void connect_with_java(JNIEnv* env, jobject fb_instance)
/* Create native_buffer */
jobject buffer = (*env)->NewDirectByteBuffer(env, lcd_framebuffer,
- (jlong) sizeof(lcd_framebuffer));
+ (jlong) FRAMEBUFFER_SIZE);
/* we need to setup parts for the java object every time */
(*env)->CallVoidMethod(env, fb_instance, java_lcd_init,
@@ -206,10 +206,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
linecounter = height >> 1;
#if LCD_WIDTH >= LCD_HEIGHT
- dst = &lcd_framebuffer[y][x];
+ dst = FBADDR(x,y);
row_end = dst + width;
#else
- dst = &lcd_framebuffer[x][LCD_WIDTH - y - 1];
+ dst = FBADDR(LCD_WIDTH - y - 1,x);
row_end = dst + LCD_WIDTH * width;
#endif
diff --git a/firmware/target/hosted/sdl/lcd-bitmap.c b/firmware/target/hosted/sdl/lcd-bitmap.c
index 4ee0bbef5c..7e9bc297ef 100644
--- a/firmware/target/hosted/sdl/lcd-bitmap.c
+++ b/firmware/target/hosted/sdl/lcd-bitmap.c
@@ -92,29 +92,25 @@ static unsigned long get_lcd_pixel(int x, int y)
{
#if LCD_DEPTH == 1
#ifdef HAVE_NEGATIVE_LCD
- return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? (NUM_SHADES-1) : 0;
+ return (*FBADDR(x, y/8) & (1 << (y & 7))) ? (NUM_SHADES-1) : 0;
#else
- return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : (NUM_SHADES-1);
+ return (*FBADDR(x, y/8) & (1 << (y & 7))) ? 0 : (NUM_SHADES-1);
#endif
#elif LCD_DEPTH == 2
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
- return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3];
+ return colorindex[(*FBADDR(x/4, y) >> (2 * (~x & 3))) & 3];
#elif LCD_PIXELFORMAT == VERTICAL_PACKING
- return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3];
+ return colorindex[(*FBADDR(x, y/4) >> (2 * (y & 3))) & 3];
#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
- unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
+ unsigned bits = (*FBADDR(x, y/8) >> (y & 7)) & 0x0101;
return colorindex[(bits | (bits >> 7)) & 3];
#endif
#elif LCD_DEPTH == 16
#if LCD_PIXELFORMAT == RGB565SWAPPED
- unsigned bits = lcd_framebuffer[y][x];
+ unsigned bits = *FBADDR(x, y);
return (bits >> 8) | (bits << 8);
#else
-#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
- return *(&lcd_framebuffer[0][0]+LCD_HEIGHT*x+y);
-#else
- return lcd_framebuffer[y][x];
-#endif
+ return *FBADDR(x, y);
#endif
#endif
}
diff --git a/firmware/target/hosted/sdl/lcd-remote-bitmap.c b/firmware/target/hosted/sdl/lcd-remote-bitmap.c
index 86d45ef446..5f08b4440b 100644
--- a/firmware/target/hosted/sdl/lcd-remote-bitmap.c
+++ b/firmware/target/hosted/sdl/lcd-remote-bitmap.c
@@ -50,10 +50,10 @@ static const unsigned char colorindex[4] = {128, 85, 43, 0};
static unsigned long get_lcd_remote_pixel(int x, int y)
{
#if LCD_REMOTE_DEPTH == 1
- return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : (NUM_SHADES-1);
+ return *FBREMOTEADDR(x, y/8) & (1 << (y & 7)) ? 0 : (NUM_SHADES-1);
#elif LCD_REMOTE_DEPTH == 2
#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
- unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
+ unsigned bits = (*FBREMOTEADDR(x, y/8) >> (y & 7)) & 0x0101;
return colorindex[(bits | (bits >> 7)) & 3];
#endif
#endif
diff --git a/firmware/target/hosted/ypr0/lcd-ypr0.c b/firmware/target/hosted/ypr0/lcd-ypr0.c
index 083a9fbe28..40528c298a 100644
--- a/firmware/target/hosted/ypr0/lcd-ypr0.c
+++ b/firmware/target/hosted/ypr0/lcd-ypr0.c
@@ -39,7 +39,7 @@ fb_data *dev_fb = 0;
void lcd_shutdown(void)
{
printf("FB closed.");
- munmap(dev_fb, sizeof(lcd_framebuffer));
+ munmap(dev_fb, FRAMEBUFFER_SIZE);
close(dev_fd);
}
@@ -80,7 +80,7 @@ void lcd_init_device(void)
/* Figure out the size of the screen in bytes */
screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
- if (screensize != sizeof(lcd_framebuffer))
+ if (screensize != FRAMEBUFFER_SIZE)
{
exit(4);
perror("Display and framebuffer mismatch!\n");
diff --git a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
index e74e227e47..c644b9f477 100644
--- a/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/lcd-jz4740.c
@@ -101,7 +101,7 @@ void lcd_update_rect(int x, int y, int width, int height)
dma_enable();
REG_DMAC_DCCSR(DMA_LCD_CHANNEL) = DMAC_DCCSR_NDES;
- REG_DMAC_DSAR(DMA_LCD_CHANNEL) = PHYSADDR((unsigned long)&lcd_framebuffer[y][x]);
+ REG_DMAC_DSAR(DMA_LCD_CHANNEL) = PHYSADDR((unsigned long)FBADDR(x,y));
REG_DMAC_DRSR(DMA_LCD_CHANNEL) = DMAC_DRSR_RS_SLCD;
REG_DMAC_DTAR(DMA_LCD_CHANNEL) = PHYSADDR(SLCD_FIFO);
REG_DMAC_DTCR(DMA_LCD_CHANNEL) = (width * height) >> 3;
@@ -195,7 +195,7 @@ void lcd_blit_yuv(unsigned char * const src[3],
IPU_SET_Y_ADDR(PHYSADDR((unsigned long)yuv_src[0]));
IPU_SET_U_ADDR(PHYSADDR((unsigned long)yuv_src[1]));
IPU_SET_V_ADDR(PHYSADDR((unsigned long)yuv_src[2]));
- IPU_SET_OUT_ADDR(PHYSADDR((unsigned long)&lcd_framebuffer[x][y]));
+ IPU_SET_OUT_ADDR(PHYSADDR((unsigned long)FBADDR(y,x)));
IPU_SET_OUT_FM(height, width);
IPU_SET_OUT_STRIDE(height);
diff --git a/firmware/target/sh/archos/lcd-archos-bitmap.c b/firmware/target/sh/archos/lcd-archos-bitmap.c
index 8d8a98432d..f23289053d 100644
--- a/firmware/target/sh/archos/lcd-archos-bitmap.c
+++ b/firmware/target/sh/archos/lcd-archos-bitmap.c
@@ -192,7 +192,7 @@ void lcd_update(void)
lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
- lcd_write_data (lcd_framebuffer[y], LCD_WIDTH);
+ lcd_write_data (FBADDR(0, y), LCD_WIDTH);
}
}
@@ -219,6 +219,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
- lcd_write_data (&lcd_framebuffer[y][x], width);
+ lcd_write_data (FBADDR(x,y), width);
}
}