summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-10-30 20:35:03 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-10-30 20:35:03 +0000
commitd11e5201dccfb74f2c445500958b47d9ddcee741 (patch)
tree1d8142b01f6c700ca0dff743aa9a0f6fa2b1b6ef /firmware/target/arm/as3525
parenteb7cf73dcbc7fff1a17aee93656e30c4a9f3f9f3 (diff)
downloadrockbox-d11e5201dccfb74f2c445500958b47d9ddcee741.tar.gz
rockbox-d11e5201dccfb74f2c445500958b47d9ddcee741.zip
Sansa clip zip: implement lcd_write_data function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30872 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 49a8014005..cc30e19fcf 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -365,12 +365,22 @@ void oled_brightness(int brightness)
365 } 365 }
366} 366}
367 367
368/* Writes framebuffer data */
369void lcd_write_data(const fb_data *data, int count)
370{
371 fb_data pixel;
372
373 while (count--) {
374 pixel = *data++;
375 lcd_write_dat((pixel >> 0) & 0xFF);
376 lcd_write_dat((pixel >> 8) & 0xFF);
377 }
378}
379
368/* Updates a fraction of the display. */ 380/* Updates a fraction of the display. */
369void lcd_update_rect(int x, int y, int width, int height) 381void lcd_update_rect(int x, int y, int width, int height)
370{ 382{
371 fb_data *ptr; 383 int row;
372 fb_data pixel;
373 int row, col;
374 int x_end = x + width; 384 int x_end = x + width;
375 int y_end = y + height; 385 int y_end = y + height;
376 386
@@ -393,6 +403,7 @@ void lcd_update_rect(int x, int y, int width, int height)
393 if (y_end > LCD_HEIGHT) { 403 if (y_end > LCD_HEIGHT) {
394 y_end = LCD_HEIGHT; 404 y_end = LCD_HEIGHT;
395 } 405 }
406 width = x_end - x;
396 407
397 /* setup GRAM write window */ 408 /* setup GRAM write window */
398 lcd_setup_rect(x, x_end - 1, y, y_end - 1); 409 lcd_setup_rect(x, x_end - 1, y, y_end - 1);
@@ -400,12 +411,7 @@ void lcd_update_rect(int x, int y, int width, int height)
400 /* write to GRAM */ 411 /* write to GRAM */
401 lcd_write_cmd((lcd_type == 0) ? 0x08 : 0x0C); /* DDRAM_DATA_ACCESS_PORT */ 412 lcd_write_cmd((lcd_type == 0) ? 0x08 : 0x0C); /* DDRAM_DATA_ACCESS_PORT */
402 for (row = y; row < y_end; row++) { 413 for (row = y; row < y_end; row++) {
403 ptr = &lcd_framebuffer[row][x]; 414 lcd_write_data(&lcd_framebuffer[row][x], width);
404 for (col = x; col < x_end; col++) {
405 pixel = *ptr++;
406 lcd_write_dat((pixel >> 0) & 0xFF);
407 lcd_write_dat((pixel >> 8) & 0xFF);
408 }
409 } 415 }
410} 416}
411 417