summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
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)
332 332
333 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 333 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
334 334
335 ptr = &lcd_framebuffer[y][x]; 335 ptr = FBADDR(x,y);
336 336
337 do 337 do
338 { 338 {
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)
273 lcd_write_command (LCD_CNTL_HIGHCOL | ((offset >> 4) & 0xf)); 273 lcd_write_command (LCD_CNTL_HIGHCOL | ((offset >> 4) & 0xf));
274 lcd_write_command (LCD_CNTL_LOWCOL | (offset & 0xf)); 274 lcd_write_command (LCD_CNTL_LOWCOL | (offset & 0xf));
275 275
276 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 276 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
277 } 277 }
278} 278}
279 279
@@ -304,6 +304,6 @@ void lcd_update_rect(int x, int y, int width, int height)
304 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+offset) >> 4) & 0xf)); 304 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+offset) >> 4) & 0xf));
305 lcd_write_command (LCD_CNTL_LOWCOL | ((x+offset) & 0xf)); 305 lcd_write_command (LCD_CNTL_LOWCOL | ((x+offset) & 0xf));
306 306
307 lcd_write_data (&lcd_framebuffer[y][x], width); 307 lcd_write_data (FBADDR(x,y), width);
308 } 308 }
309} 309}
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)
426 426
427 /* write to GRAM */ 427 /* write to GRAM */
428 for (row = y; row < y_end; row++) { 428 for (row = y; row < y_end; row++) {
429 lcd_write_data(&lcd_framebuffer[row][x], width); 429 lcd_write_data(FBADDR(x,row), width);
430 } 430 }
431} 431}
432 432
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)
488 lcd_window(x, y, x+width-1, y+height-1); 488 lcd_window(x, y, x+width-1, y+height-1);
489 lcd_write_cmd(R_WRITE_DATA_2_GRAM); 489 lcd_write_cmd(R_WRITE_DATA_2_GRAM);
490 490
491 ptr = &lcd_framebuffer[y][x]; 491 ptr = FBADDR(x,y);
492 492
493 do 493 do
494 { 494 {
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)
533 */ 533 */
534 if(w == LCD_WIDTH) 534 if(w == LCD_WIDTH)
535 { 535 {
536 memcpy((void *)FRAME, &lcd_framebuffer[y][x], w * h * sizeof(fb_data)); 536 memcpy((void *)FRAME, FBADDR(x,y), w * h * sizeof(fb_data));
537 } 537 }
538 else 538 else
539 { 539 {
540 for(int i = 0; i < h; i++) 540 for(int i = 0; i < h; i++)
541 memcpy((fb_data *)FRAME + i * w, &lcd_framebuffer[y + i][x], w * sizeof(fb_data)); 541 memcpy((fb_data *)FRAME + i * w, FBADDR(x,y + i), w * sizeof(fb_data));
542 } 542 }
543 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode 543 /* WARNING The LCDIF has a limitation on the vertical count ! In 16-bit packed mode
544 * (which we used, ie 16-bit per pixel, 2 pixels per 32-bit words), the v_count 544 * (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],
599 linecounter = height >> 1; 599 linecounter = height >> 1;
600 600
601 #if LCD_WIDTH >= LCD_HEIGHT 601 #if LCD_WIDTH >= LCD_HEIGHT
602 dst = &lcd_framebuffer[y][x]; 602 dst = FBADDR(x,y);
603 row_end = dst + width; 603 row_end = dst + width;
604 #else 604 #else
605 dst = &lcd_framebuffer[x][LCD_WIDTH - y - 1]; 605 dst = FBADDR(LCD_WIDTH - y - 1,x);
606 row_end = dst + LCD_WIDTH * width; 606 row_end = dst + LCD_WIDTH * width;
607 #endif 607 #endif
608 608
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)
280 280
281 lcd_setup_drawing_region(x, y, width, height); 281 lcd_setup_drawing_region(x, y, width, height);
282 282
283 addr = (unsigned long*)&lcd_framebuffer[y][x]; 283 addr = (unsigned long*)FBADDR(x, y);
284 284
285 while (height > 0) { 285 while (height > 0) {
286 int r, h, pixels_to_write; 286 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)
340 340
341#if defined(IPOD_MINI) || defined(IPOD_MINI2G) 341#if defined(IPOD_MINI) || defined(IPOD_MINI2G)
342 if (pix_offset == -2) 342 if (pix_offset == -2)
343 lcd_write_data_shifted(&lcd_framebuffer[y][2*x], width); 343 lcd_write_data_shifted(FBADDR(2*x, y), width);
344 else 344 else
345#endif 345#endif
346 lcd_write_data(&lcd_framebuffer[y][2*x], width); 346 lcd_write_data(FBADDR(2*x, y), width);
347 } 347 }
348} 348}
349 349
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)
410 /* Prevent the tick from triggering BCM updates while we're writing. */ 410 /* Prevent the tick from triggering BCM updates while we're writing. */
411 lcd_block_tick(); 411 lcd_block_tick();
412 412
413 addr = &lcd_framebuffer[y][x]; 413 addr = FBADDR(x, y);
414 bcmaddr = BCMA_CMDPARAM + (LCD_WIDTH*2) * y + (x << 1); 414 bcmaddr = BCMA_CMDPARAM + (LCD_WIDTH*2) * y + (x << 1);
415 415
416 if (width == LCD_WIDTH) 416 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)
527 /* start drawing */ 527 /* start drawing */
528 lcd_send_cmd(R_WRITE_DATA_2_GRAM); 528 lcd_send_cmd(R_WRITE_DATA_2_GRAM);
529 529
530 addr = (unsigned short*)&lcd_framebuffer[y0][x0]; 530 addr = (unsigned short*)FBADDR(x0,y0);
531 531
532 int c, r; 532 int c, r;
533 533
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)
327 /* start drawing */ 327 /* start drawing */
328 lcd_send_cmd(R_WRITE_DATA_2_GRAM); 328 lcd_send_cmd(R_WRITE_DATA_2_GRAM);
329 329
330 addr = (unsigned long*)&lcd_framebuffer[y0][x0]; 330 addr = (unsigned long*)FBADDR(x0,y0);
331 331
332 while (height > 0) { 332 while (height > 0) {
333 int c, r; 333 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)
395 if ((width <= 0) || (height <= 0)) 395 if ((width <= 0) || (height <= 0))
396 return; /* Nothing left to do. */ 396 return; /* Nothing left to do. */
397 397
398 addr = &lcd_framebuffer[y][x]; 398 addr = FBADDR(x,y);
399 399
400 if (width <= 1) { 400 if (width <= 1) {
401 /* The X end address must be larger than the X start address, so we 401 /* 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)
303 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); 303 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
304 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf)); 304 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
305 305
306 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 306 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
307 } 307 }
308} 308}
309 309
@@ -331,6 +331,6 @@ void lcd_update_rect(int x, int y, int width, int height)
331 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); 331 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
332 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); 332 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
333 333
334 lcd_write_data (&lcd_framebuffer[y][x], width); 334 lcd_write_data (FBADDR(x,y), width);
335 } 335 }
336} 336}
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)
239 lcd_write_command(cmd1); 239 lcd_write_command(cmd1);
240 lcd_write_command(cmd2); 240 lcd_write_command(cmd2);
241 241
242 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 242 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
243 } 243 }
244} 244}
245 245
@@ -271,6 +271,6 @@ void lcd_update_rect(int x, int y, int width, int height)
271 lcd_write_command(cmd1); 271 lcd_write_command(cmd1);
272 lcd_write_command(cmd2); 272 lcd_write_command(cmd2);
273 273
274 lcd_write_data (&lcd_framebuffer[y][x], width); 274 lcd_write_data (FBADDR(x,y), width);
275 } 275 }
276} 276}
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)
255 data[6] = (y + 1) << 3; /* y2 */ 255 data[6] = (y + 1) << 3; /* y2 */
256 256
257 for (x = 0; x < RC_WIDTH; x++) 257 for (x = 0; x < RC_WIDTH; x++)
258 data[x + 7] = lcd_remote_framebuffer[y][x]; 258 data[x + 7] = FBREMOTEADDR(x,y);
259 259
260 remote_tx(data, RC_WIDTH + 7); 260 remote_tx(data, RC_WIDTH + 7);
261 261
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)
483 /* start drawing */ 483 /* start drawing */
484 lcd_send_cmd(R_WRITE_DATA_2_GRAM); 484 lcd_send_cmd(R_WRITE_DATA_2_GRAM);
485 485
486 addr = &lcd_framebuffer[y0][x0]; 486 addr = FBADDR(x0, y0)
487 487
488 int c, r; 488 int c, r;
489 for (r = 0; r < height; r++) 489 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)
373 if ((width <= 0) || (height <= 0)) 373 if ((width <= 0) || (height <= 0))
374 return; /* Nothing left to do. */ 374 return; /* Nothing left to do. */
375 375
376 addr = &lcd_framebuffer[y][x]; 376 addr = FBADDR(x,y);
377 377
378 lcd_send_cmd(CASET); 378 lcd_send_cmd(CASET);
379 lcd_send_data(x); 379 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)
285 285
286 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM); 286 lcd_send_reg(LCD_REG_WRITE_DATA_2_GRAM);
287 287
288 addr = (unsigned long*)&lcd_framebuffer[y][x]; 288 addr = (unsigned long*)FBADDR(x,y);
289 289
290 while (height > 0) 290 while (height > 0)
291 { 291 {
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)
495 if (!display_on) 495 if (!display_on)
496 return; 496 return;
497 497
498 addr = &lcd_framebuffer[0][0]; 498 addr = FBADDR(0,0);
499 end = &lcd_framebuffer[LCD_HEIGHT - 1][LCD_WIDTH]; 499 end = FBADDR(LCD_WIDTH,LCD_HEIGHT - 1);
500 500
501 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH - 1) << 8); 501 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (LCD_WIDTH - 1) << 8);
502 lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT - 1) << 8); 502 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)
533 if (height <= 0) 533 if (height <= 0)
534 return; /* Nothing left to do. */ 534 return; /* Nothing left to do. */
535 535
536 addr = &lcd_framebuffer[y][x]; 536 addr = FBADDR(x,y);
537 537
538 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((x + width - 1) << 8) | x); 538 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((x + width - 1) << 8) | x);
539 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((y + height - 1) << 8) | y); 539 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)
191 lcd_write_command (LCD_CNTL_HIGHCOL); 191 lcd_write_command (LCD_CNTL_HIGHCOL);
192 lcd_write_command (LCD_CNTL_LOWCOL | 4); 192 lcd_write_command (LCD_CNTL_LOWCOL | 4);
193 193
194 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 194 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
195 } 195 }
196} 196}
197 197
@@ -219,6 +219,6 @@ void lcd_update_rect(int x, int y, int width, int height)
219 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+4) >> 4) & 0xf)); 219 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+4) >> 4) & 0xf));
220 lcd_write_command (LCD_CNTL_LOWCOL | ((x+4) & 0xf)); 220 lcd_write_command (LCD_CNTL_LOWCOL | ((x+4) & 0xf));
221 221
222 lcd_write_data (&lcd_framebuffer[y][x], width); 222 lcd_write_data (FBADDR(x,y), width);
223 } 223 }
224} 224}
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)
162 162
163 for (px=x; px<pxmax; px++) 163 for (px=x; px<pxmax; px++)
164 for (py=y; py<pymax; py++) 164 for (py=y; py<pymax; py++)
165 lcd_data(lcd_framebuffer[py][px]); 165 lcd_data(FBADDR(px, py));
166} 166}
167 167
168/* Blit a YUV bitmap directly to the LCD */ 168/* 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)
191 for (py=y; py<pymax; py++) 191 for (py=y; py<pymax; py++)
192 { 192 {
193 for (px=x; px<pxmax; px++) 193 for (px=x; px<pxmax; px++)
194 LCD_DATA = lcd_pixel_transform(lcd_framebuffer[py][px]); 194 LCD_DATA = lcd_pixel_transform(FBADDR(px,py));
195 } 195 }
196} 196}
197 197
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)
394 lcd_setup_drawing_region(x, y, width, height); 394 lcd_setup_drawing_region(x, y, width, height);
395 395
396 /* Copy display bitmap to hardware */ 396 /* Copy display bitmap to hardware */
397 p = &lcd_framebuffer[y][x]; 397 p = FBADDR(x,y);
398 if (LCD_WIDTH == width) { 398 if (LCD_WIDTH == width) {
399 /* Write all lines at once */ 399 /* Write all lines at once */
400 lcd_write_line(p, height*LCD_WIDTH, LCD_BASE); 400 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)
295 LCD_WCMD = 0; 295 LCD_WCMD = 0;
296 LCD_WCMD = 0x22; 296 LCD_WCMD = 0x22;
297 } 297 }
298 for(p=&lcd_framebuffer[0][0], i=0;i<LCD_WIDTH*LCD_FBHEIGHT;++i, ++p) { 298 for(p=FBADDR(0,0), i=0;i<LCD_WIDTH*LCD_FBHEIGHT;++i, ++p) {
299 while (LCD_STATUS & STAT_FULL); 299 while (LCD_STATUS & STAT_FULL);
300 LCD_WDATA = RGB_UNPACK_RED(*p); 300 LCD_WDATA = RGB_UNPACK_RED(*p);
301 while (LCD_STATUS & STAT_FULL); 301 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)
438 lcd_controller_init(); 438 lcd_controller_init();
439 439
440 /* set framebuffer addresses */ 440 /* set framebuffer addresses */
441 fb = (uint32_t) &lcd_framebuffer[0][0]; 441 fb = (uint32_t) FBADDR(0,0);
442 fb_end = (uint32_t) &lcd_framebuffer[LCD_HEIGHT][0]; 442 fb_end = (uint32_t) FBADDR(0,LCD_HEIGHT);
443 window = 2 * LCD_WIDTH; 443 window = 2 * LCD_WIDTH;
444 444
445 LCDB1SADDR1 = fb; 445 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)
306 lcd_set_position1(x, y); 306 lcd_set_position1(x, y);
307 307
308 for (h = 0; h < height; h++) { 308 for (h = 0; h < height; h++) {
309 p = &lcd_framebuffer[y][0]; 309 p = FBADDR(0,y);
310 for (w = 0; w < LCD_WIDTH; w++) { 310 for (w = 0; w < LCD_WIDTH; w++) {
311 while (LCD_STATUS & 0x10); 311 while (LCD_STATUS & 0x10);
312 LCD_WDATA = *p++; 312 LCD_WDATA = *p++;
@@ -319,7 +319,7 @@ void lcd_update_rect(int x, int y, int width, int height)
319 lcd_set_position2(x, y); 319 lcd_set_position2(x, y);
320 320
321 for (h = 0; h < height; h++) { 321 for (h = 0; h < height; h++) {
322 p = &lcd_framebuffer[y][x]; 322 p = FBADDR(x,y);
323 for (w = 0; w < width; w++) { 323 for (w = 0; w < width; w++) {
324 while (LCD_STATUS & 0x10); 324 while (LCD_STATUS & 0x10);
325 LCD_WDATA = *p++; 325 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;
428void lcd_update_rect(int x, int y, int width, int height) 428void lcd_update_rect(int x, int y, int width, int height)
429{ 429{
430 int pixels = width * height; 430 int pixels = width * height;
431 fb_data* p = &lcd_framebuffer[y][x]; 431 fb_data* p = FBADDR(x,y);
432 uint16_t* out = lcd_dblbuf[0]; 432 uint16_t* out = lcd_dblbuf[0];
433 433
434#ifdef HAVE_LCD_SLEEP 434#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)
347 if ((width <= 0) || (height <= 0)) 347 if ((width <= 0) || (height <= 0))
348 return; /* Nothing left to do. */ 348 return; /* Nothing left to do. */
349 349
350 addr = &lcd_framebuffer[y][x]; 350 addr = FBADDR(x,y);
351 351
352 if (width <= 1) { 352 if (width <= 1) {
353 lcd_send_command(R_ENTRY_MODE); /* The X end address must be larger */ 353 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)
259 lcd_write_reg(LCD_CNTL_PAGE, y); 259 lcd_write_reg(LCD_CNTL_PAGE, y);
260 lcd_write_reg(LCD_CNTL_COLUMN, x); 260 lcd_write_reg(LCD_CNTL_COLUMN, x);
261 261
262 addr = &lcd_framebuffer[y][x]; 262 addr = FBADDR(x,y);
263 263
264 lcd_send_cmd(LCD_CNTL_DATA_WRITE); 264 lcd_send_cmd(LCD_CNTL_DATA_WRITE);
265 lcd_write_data(addr, width); 265 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)
639 /* start drawing */ 639 /* start drawing */
640 lcd_send_cmd(R_WRITE_DATA_2_GRAM); 640 lcd_send_cmd(R_WRITE_DATA_2_GRAM);
641 641
642 addr = (unsigned short*)&lcd_framebuffer[y0][x0]; 642 addr = (unsigned short*)FBADDR(x0,y0);
643 643
644 int c, r; 644 int c, r;
645 645
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)
363{ 363{
364 const fb_data *addr; 364 const fb_data *addr;
365 365
366 addr = &lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; 366 addr = FBADDR(LCD_WIDTH,LCD_HEIGHT);
367 367
368 lcd_write_reg(0x20, 0x0); 368 lcd_write_reg(0x20, 0x0);
369 lcd_write_reg(0x21, 0x0); 369 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)
252 if ((width <= 0) || (height <= 0)) 252 if ((width <= 0) || (height <= 0))
253 return; /* Nothing left to do. */ 253 return; /* Nothing left to do. */
254 254
255 addr = &lcd_framebuffer[y][x]; 255 addr = FBADDR(x,y);
256 256
257 if (width <= 1) { 257 if (width <= 1) {
258 lcd_send_command(R_ENTRY_MODE); /* The X end address must be larger */ 258 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)
211 fb_data c; 211 fb_data c;
212 unsigned long color; 212 unsigned long color;
213 213
214 c = lcd_framebuffer[y][x]; 214 c = FBADDR(x,y);
215 color = 215 color =
216 ((c & 0x1f) << 1) | ((c & 0x7e0) << 1) | ((c & 0xf800) << 216 ((c & 0x1f) << 1) | ((c & 0x7e0) << 1) | ((c & 0xf800) <<
217 2); 217 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)
380 380
381#if CONFIG_ORIENTATION == SCREEN_PORTRAIT 381#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
382 dst = (fb_data *)FRAME + LCD_WIDTH*y + x; 382 dst = (fb_data *)FRAME + LCD_WIDTH*y + x;
383 src = &lcd_framebuffer[y][x]; 383 src = FBADDR(x,y);
384 384
385 /* Copy part of the Rockbox framebuffer to the second framebuffer */ 385 /* Copy part of the Rockbox framebuffer to the second framebuffer */
386 if (width < LCD_WIDTH) 386 if (width < LCD_WIDTH)
@@ -394,7 +394,7 @@ void lcd_update_rect(int x, int y, int width, int height)
394 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1); 394 lcd_copy_buffer_rect(dst, src, LCD_WIDTH*height, 1);
395 } 395 }
396#else 396#else
397 src = &lcd_framebuffer[y][x]; 397 src = FBADDR(x,y);
398 398
399 register int xc, yc; 399 register int xc, yc;
400 register fb_data *start=FRAME + LCD_HEIGHT*(LCD_WIDTH-x-1) + y + 1; 400 register fb_data *start=FRAME + LCD_HEIGHT*(LCD_WIDTH-x-1) + y + 1;
@@ -419,7 +419,7 @@ void lcd_update(void)
419 if (!lcd_on || direct_fb_access) 419 if (!lcd_on || direct_fb_access)
420 return; 420 return;
421#if CONFIG_ORIENTATION == SCREEN_PORTRAIT 421#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
422 lcd_copy_buffer_rect((fb_data *)FRAME, &lcd_framebuffer[0][0], 422 lcd_copy_buffer_rect((fb_data *)FRAME, FBADDR(0,0),
423 LCD_WIDTH*LCD_HEIGHT, 1); 423 LCD_WIDTH*LCD_HEIGHT, 1);
424#else 424#else
425 lcd_update_rect(0, 0, LCD_WIDTH, LCD_HEIGHT); 425 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)
500 if (width < LCD_WIDTH) 500 if (width < LCD_WIDTH)
501 { 501 {
502 /* Not full width - do line-by-line */ 502 /* Not full width - do line-by-line */
503 lcd_copy_buffer_rect(dst, &lcd_framebuffer[y][x], width, height); 503 lcd_copy_buffer_rect(dst, FBADDR(x,y), width, height);
504 } 504 }
505 else 505 else
506 { 506 {
507 /* Full width - copy as one line */ 507 /* Full width - copy as one line */
508 lcd_copy_buffer_rect(dst, &lcd_framebuffer[y][x], LCD_WIDTH*height, 1); 508 lcd_copy_buffer_rect(dst, FBADDR(x,y), LCD_WIDTH*height, 1);
509 } 509 }
510#endif 510#endif
511 511
@@ -519,7 +519,7 @@ void lcd_update_rect(int x, int y, int width, int height)
519#else 519#else
520 fb_data *src; 520 fb_data *src;
521 fb_data *dst; 521 fb_data *dst;
522 src = &lcd_framebuffer[0][0] + (x*LCD_HEIGHT + y); 522 src = FBADDR(0,0) + (x*LCD_HEIGHT + y);
523 dst = FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y); 523 dst = FRAME + (LCD_HEIGHT*(LCD_WIDTH-1) - x * LCD_HEIGHT + y);
524 524
525 while(width > 0) { 525 while(width > 0) {
@@ -532,7 +532,7 @@ void lcd_update_rect(int x, int y, int width, int height)
532 532
533#else 533#else
534 register fb_data *dst, *src; 534 register fb_data *dst, *src;
535 src = &lcd_framebuffer[y][x]; 535 src = FBADDR(x,y);
536 536
537 dst=FRAME + (LCD_NATIVE_WIDTH*(LCD_NATIVE_HEIGHT-1)) 537 dst=FRAME + (LCD_NATIVE_WIDTH*(LCD_NATIVE_HEIGHT-1))
538 - LCD_NATIVE_WIDTH*x + y ; 538 - 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)
246 for(i=7; i<remote_payload_size; i++) 246 for(i=7; i<remote_payload_size; i++)
247 { 247 {
248 remote_payload[i]= 248 remote_payload[i]=
249 lcd_remote_framebuffer[remote_payload[4]>>3][i+remote_draw_x-7]; 249 FBREMOTEADDR(i+remote_draw_x-7, remote_payload[4]>>3);
250 } 250 }
251 } 251 }
252 252
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)
167 167
168 /* Set source and destination addresses */ 168 /* Set source and destination addresses */
169 dst = (char*)(FRAME + LCD_WIDTH*y + x); 169 dst = (char*)(FRAME + LCD_WIDTH*y + x);
170 src = (char*)(&lcd_framebuffer[y][x]); 170 src = (char*)(FBADDR(x,y));
171 171
172 /* Flush cache to memory */ 172 /* Flush cache to memory */
173 commit_dcache(); 173 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)
228 have to update one page at a time. */ 228 have to update one page at a time. */
229 lcd_remote_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y)); 229 lcd_remote_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
230 lcd_remote_write_command_ex(LCD_SET_COLUMN | 0, 0); 230 lcd_remote_write_command_ex(LCD_SET_COLUMN | 0, 0);
231 lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH); 231 lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
232 } 232 }
233 } 233 }
234} 234}
@@ -260,7 +260,7 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
260 lcd_remote_write_command_ex(LCD_SET_COLUMN | ((x >> 4) & 0xf), 260 lcd_remote_write_command_ex(LCD_SET_COLUMN | ((x >> 4) & 0xf),
261 x & 0xf); 261 x & 0xf);
262 262
263 lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width); 263 lcd_remote_write_data(FBREMOTEADDR(x,y), width);
264 } 264 }
265 } 265 }
266} 266}
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)
265 have to update one page at a time. */ 265 have to update one page at a time. */
266 lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y)); 266 lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y));
267 lcd_write_command_e(LCD_SET_COLUMN | 0, 0); 267 lcd_write_command_e(LCD_SET_COLUMN | 0, 0);
268 lcd_write_data(lcd_framebuffer[y], LCD_WIDTH); 268 lcd_write_data(FBADDR(0, y), LCD_WIDTH);
269 } 269 }
270 } 270 }
271} 271}
@@ -295,7 +295,7 @@ void lcd_update_rect(int x, int y, int width, int height)
295 lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf)); 295 lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf));
296 lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf); 296 lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
297 297
298 lcd_write_data(&lcd_framebuffer[y][x], width); 298 lcd_write_data(FBADDR(x,y), width);
299 } 299 }
300 } 300 }
301} 301}
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)
207 lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1); 207 lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
208 208
209 lcd_write_command(LCD_CNTL_DATA_WRITE); 209 lcd_write_command(LCD_CNTL_DATA_WRITE);
210 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 210 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
211 } 211 }
212} 212}
213 213
@@ -235,6 +235,6 @@ void lcd_update_rect(int x, int y, int width, int height)
235 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); 235 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
236 236
237 lcd_write_command(LCD_CNTL_DATA_WRITE); 237 lcd_write_command(LCD_CNTL_DATA_WRITE);
238 lcd_write_data (&lcd_framebuffer[y][x], width); 238 lcd_write_data (FBADDR(x,y), width);
239 } 239 }
240} 240}
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)
530 530
531 lcd_begin_write_gram(); 531 lcd_begin_write_gram();
532 532
533 ptr = (unsigned short *)&lcd_framebuffer[y][x]; 533 ptr = (unsigned short *)FBADDR(x,y);
534 534
535 do 535 do
536 { 536 {
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)
216 lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1); 216 lcd_write_command_ex(LCD_CNTL_COLUMN, 0, -1);
217 217
218 lcd_write_command(LCD_CNTL_DATA_WRITE); 218 lcd_write_command(LCD_CNTL_DATA_WRITE);
219 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 219 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
220 } 220 }
221} 221}
222 222
@@ -244,6 +244,6 @@ void lcd_update_rect(int x, int y, int width, int height)
244 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); 244 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
245 245
246 lcd_write_command(LCD_CNTL_DATA_WRITE); 246 lcd_write_command(LCD_CNTL_DATA_WRITE);
247 lcd_write_data (&lcd_framebuffer[y][x], width); 247 lcd_write_data (FBADDR(x,y), width);
248 } 248 }
249} 249}
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)
447 if (width == LCD_WIDTH) 447 if (width == LCD_WIDTH)
448 { 448 {
449 dma_count = 1; 449 dma_count = 1;
450 SAR3 = (unsigned long)lcd_framebuffer[y]; 450 SAR3 = (unsigned long)FBADDR(0, y);
451 BCR3 = (LCD_WIDTH*sizeof(fb_data)) * height; 451 BCR3 = (LCD_WIDTH*sizeof(fb_data)) * height;
452 } 452 }
453 else 453 else
454 { 454 {
455 dma_count = height; 455 dma_count = height;
456 SAR3 = dma_addr = (unsigned long)&lcd_framebuffer[y][x]; 456 SAR3 = dma_addr = (unsigned long)FBADDR(x,y);
457 BCR3 = dma_len = width * sizeof(fb_data); 457 BCR3 = dma_len = width * sizeof(fb_data);
458 } 458 }
459 DCR3 = DMA_INT | DMA_AA | DMA_BWC(1) 459 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)
312 lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y); 312 lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
313 lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); 313 lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
314 lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | (xoffset & 0xf)); 314 lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | (xoffset & 0xf));
315 lcd_remote_write_data(lcd_remote_framebuffer[y], LCD_REMOTE_WIDTH); 315 lcd_remote_write_data(FBREMOTEADDR(0, y), LCD_REMOTE_WIDTH);
316 } 316 }
317} 317}
318 318
@@ -346,6 +346,6 @@ void lcd_remote_update_rect(int x, int y, int width, int height)
346 lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y); 346 lcd_remote_write_command(LCD_REMOTE_CNTL_SET_PAGE_ADDRESS | y);
347 lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); 347 lcd_remote_write_command(LCD_REMOTE_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
348 lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | ((x+xoffset) & 0xf)); 348 lcd_remote_write_command(LCD_REMOTE_CNTL_LOWCOL | ((x+xoffset) & 0xf));
349 lcd_remote_write_data(&lcd_remote_framebuffer[y][x], width); 349 lcd_remote_write_data(FBREMOTEADDR(x,y), width);
350 } 350 }
351} 351}
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)
187 lcd_write_command_e(LCD_SET_COLUMN | ((column >> 4) & 0xf), 187 lcd_write_command_e(LCD_SET_COLUMN | ((column >> 4) & 0xf),
188 column & 0x0f); 188 column & 0x0f);
189 189
190 SAR3 = (unsigned long)&lcd_framebuffer[page][column]; 190 SAR3 = (unsigned long)FBADDR(column,page);
191 BCR3 = dma_len; 191 BCR3 = dma_len;
192 DCR3 = DMA_INT | DMA_AA | DMA_BWC(1) 192 DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
193 | DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE) 193 | DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
@@ -261,7 +261,7 @@ void lcd_update_rect(int x, int y, int width, int height)
261 dma_count = ymax - y + 1; 261 dma_count = ymax - y + 1;
262 262
263 /* Initialize DMA transfer */ 263 /* Initialize DMA transfer */
264 SAR3 = (unsigned long)&lcd_framebuffer[page][column]; 264 SAR3 = (unsigned long)FBADDR(column,page);
265 BCR3 = dma_len; 265 BCR3 = dma_len;
266 DCR3 = DMA_INT | DMA_AA | DMA_BWC(1) 266 DCR3 = DMA_INT | DMA_AA | DMA_BWC(1)
267 | DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE) 267 | 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)
211 lcd_write_command(LCD_CNTL_DATA_WRITE); 211 lcd_write_command(LCD_CNTL_DATA_WRITE);
212 212
213 /* Copy display bitmap to hardware */ 213 /* Copy display bitmap to hardware */
214 lcd_write_data (&lcd_framebuffer[0][0], LCD_WIDTH*LCD_FBHEIGHT); 214 lcd_write_data (FBADDR(0,0), LCD_WIDTH*LCD_FBHEIGHT);
215} 215}
216 216
217/* Update a fraction of the display. */ 217/* Update a fraction of the display. */
@@ -238,6 +238,6 @@ void lcd_update_rect(int x, int y, int width, int height)
238 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); 238 lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1);
239 239
240 lcd_write_command(LCD_CNTL_DATA_WRITE); 240 lcd_write_command(LCD_CNTL_DATA_WRITE);
241 lcd_write_data (&lcd_framebuffer[y][x], width); 241 lcd_write_data (FBADDR(x,y), width);
242 } 242 }
243} 243}
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)
75 75
76 /* Create native_buffer */ 76 /* Create native_buffer */
77 jobject buffer = (*env)->NewDirectByteBuffer(env, lcd_framebuffer, 77 jobject buffer = (*env)->NewDirectByteBuffer(env, lcd_framebuffer,
78 (jlong) sizeof(lcd_framebuffer)); 78 (jlong) FRAMEBUFFER_SIZE);
79 79
80 /* we need to setup parts for the java object every time */ 80 /* we need to setup parts for the java object every time */
81 (*env)->CallVoidMethod(env, fb_instance, java_lcd_init, 81 (*env)->CallVoidMethod(env, fb_instance, java_lcd_init,
@@ -206,10 +206,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
206 linecounter = height >> 1; 206 linecounter = height >> 1;
207 207
208#if LCD_WIDTH >= LCD_HEIGHT 208#if LCD_WIDTH >= LCD_HEIGHT
209 dst = &lcd_framebuffer[y][x]; 209 dst = FBADDR(x,y);
210 row_end = dst + width; 210 row_end = dst + width;
211#else 211#else
212 dst = &lcd_framebuffer[x][LCD_WIDTH - y - 1]; 212 dst = FBADDR(LCD_WIDTH - y - 1,x);
213 row_end = dst + LCD_WIDTH * width; 213 row_end = dst + LCD_WIDTH * width;
214#endif 214#endif
215 215
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)
92{ 92{
93#if LCD_DEPTH == 1 93#if LCD_DEPTH == 1
94#ifdef HAVE_NEGATIVE_LCD 94#ifdef HAVE_NEGATIVE_LCD
95 return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? (NUM_SHADES-1) : 0; 95 return (*FBADDR(x, y/8) & (1 << (y & 7))) ? (NUM_SHADES-1) : 0;
96#else 96#else
97 return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : (NUM_SHADES-1); 97 return (*FBADDR(x, y/8) & (1 << (y & 7))) ? 0 : (NUM_SHADES-1);
98#endif 98#endif
99#elif LCD_DEPTH == 2 99#elif LCD_DEPTH == 2
100#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 100#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
101 return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3]; 101 return colorindex[(*FBADDR(x/4, y) >> (2 * (~x & 3))) & 3];
102#elif LCD_PIXELFORMAT == VERTICAL_PACKING 102#elif LCD_PIXELFORMAT == VERTICAL_PACKING
103 return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3]; 103 return colorindex[(*FBADDR(x, y/4) >> (2 * (y & 3))) & 3];
104#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED 104#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
105 unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101; 105 unsigned bits = (*FBADDR(x, y/8) >> (y & 7)) & 0x0101;
106 return colorindex[(bits | (bits >> 7)) & 3]; 106 return colorindex[(bits | (bits >> 7)) & 3];
107#endif 107#endif
108#elif LCD_DEPTH == 16 108#elif LCD_DEPTH == 16
109#if LCD_PIXELFORMAT == RGB565SWAPPED 109#if LCD_PIXELFORMAT == RGB565SWAPPED
110 unsigned bits = lcd_framebuffer[y][x]; 110 unsigned bits = *FBADDR(x, y);
111 return (bits >> 8) | (bits << 8); 111 return (bits >> 8) | (bits << 8);
112#else 112#else
113#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 113 return *FBADDR(x, y);
114 return *(&lcd_framebuffer[0][0]+LCD_HEIGHT*x+y);
115#else
116 return lcd_framebuffer[y][x];
117#endif
118#endif 114#endif
119#endif 115#endif
120} 116}
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};
50static unsigned long get_lcd_remote_pixel(int x, int y) 50static unsigned long get_lcd_remote_pixel(int x, int y)
51{ 51{
52#if LCD_REMOTE_DEPTH == 1 52#if LCD_REMOTE_DEPTH == 1
53 return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : (NUM_SHADES-1); 53 return *FBREMOTEADDR(x, y/8) & (1 << (y & 7)) ? 0 : (NUM_SHADES-1);
54#elif LCD_REMOTE_DEPTH == 2 54#elif LCD_REMOTE_DEPTH == 2
55#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED 55#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
56 unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101; 56 unsigned bits = (*FBREMOTEADDR(x, y/8) >> (y & 7)) & 0x0101;
57 return colorindex[(bits | (bits >> 7)) & 3]; 57 return colorindex[(bits | (bits >> 7)) & 3];
58#endif 58#endif
59#endif 59#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;
39void lcd_shutdown(void) 39void lcd_shutdown(void)
40{ 40{
41 printf("FB closed."); 41 printf("FB closed.");
42 munmap(dev_fb, sizeof(lcd_framebuffer)); 42 munmap(dev_fb, FRAMEBUFFER_SIZE);
43 close(dev_fd); 43 close(dev_fd);
44} 44}
45 45
@@ -80,7 +80,7 @@ void lcd_init_device(void)
80 80
81 /* Figure out the size of the screen in bytes */ 81 /* Figure out the size of the screen in bytes */
82 screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8; 82 screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;
83 if (screensize != sizeof(lcd_framebuffer)) 83 if (screensize != FRAMEBUFFER_SIZE)
84 { 84 {
85 exit(4); 85 exit(4);
86 perror("Display and framebuffer mismatch!\n"); 86 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)
101 dma_enable(); 101 dma_enable();
102 102
103 REG_DMAC_DCCSR(DMA_LCD_CHANNEL) = DMAC_DCCSR_NDES; 103 REG_DMAC_DCCSR(DMA_LCD_CHANNEL) = DMAC_DCCSR_NDES;
104 REG_DMAC_DSAR(DMA_LCD_CHANNEL) = PHYSADDR((unsigned long)&lcd_framebuffer[y][x]); 104 REG_DMAC_DSAR(DMA_LCD_CHANNEL) = PHYSADDR((unsigned long)FBADDR(x,y));
105 REG_DMAC_DRSR(DMA_LCD_CHANNEL) = DMAC_DRSR_RS_SLCD; 105 REG_DMAC_DRSR(DMA_LCD_CHANNEL) = DMAC_DRSR_RS_SLCD;
106 REG_DMAC_DTAR(DMA_LCD_CHANNEL) = PHYSADDR(SLCD_FIFO); 106 REG_DMAC_DTAR(DMA_LCD_CHANNEL) = PHYSADDR(SLCD_FIFO);
107 REG_DMAC_DTCR(DMA_LCD_CHANNEL) = (width * height) >> 3; 107 REG_DMAC_DTCR(DMA_LCD_CHANNEL) = (width * height) >> 3;
@@ -195,7 +195,7 @@ void lcd_blit_yuv(unsigned char * const src[3],
195 IPU_SET_Y_ADDR(PHYSADDR((unsigned long)yuv_src[0])); 195 IPU_SET_Y_ADDR(PHYSADDR((unsigned long)yuv_src[0]));
196 IPU_SET_U_ADDR(PHYSADDR((unsigned long)yuv_src[1])); 196 IPU_SET_U_ADDR(PHYSADDR((unsigned long)yuv_src[1]));
197 IPU_SET_V_ADDR(PHYSADDR((unsigned long)yuv_src[2])); 197 IPU_SET_V_ADDR(PHYSADDR((unsigned long)yuv_src[2]));
198 IPU_SET_OUT_ADDR(PHYSADDR((unsigned long)&lcd_framebuffer[x][y])); 198 IPU_SET_OUT_ADDR(PHYSADDR((unsigned long)FBADDR(y,x)));
199 199
200 IPU_SET_OUT_FM(height, width); 200 IPU_SET_OUT_FM(height, width);
201 IPU_SET_OUT_STRIDE(height); 201 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)
192 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf)); 192 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
193 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf)); 193 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
194 194
195 lcd_write_data (lcd_framebuffer[y], LCD_WIDTH); 195 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
196 } 196 }
197} 197}
198 198
@@ -219,6 +219,6 @@ void lcd_update_rect(int x, int y, int width, int height)
219 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf)); 219 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
220 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf)); 220 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
221 221
222 lcd_write_data (&lcd_framebuffer[y][x], width); 222 lcd_write_data (FBADDR(x,y), width);
223 } 223 }
224} 224}