diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2011-10-30 20:35:03 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2011-10-30 20:35:03 +0000 |
commit | d11e5201dccfb74f2c445500958b47d9ddcee741 (patch) | |
tree | 1d8142b01f6c700ca0dff743aa9a0f6fa2b1b6ef /firmware/target/arm | |
parent | eb7cf73dcbc7fff1a17aee93656e30c4a9f3f9f3 (diff) |
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')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c | 24 |
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) } } +/* Writes framebuffer data */ +void lcd_write_data(const fb_data *data, int count) +{ + fb_data pixel; + + while (count--) { + pixel = *data++; + lcd_write_dat((pixel >> 0) & 0xFF); + lcd_write_dat((pixel >> 8) & 0xFF); + } +} + /* Updates a fraction of the display. */ void lcd_update_rect(int x, int y, int width, int height) { - fb_data *ptr; - fb_data pixel; - int row, col; + int row; int x_end = x + width; int y_end = y + height; @@ -393,6 +403,7 @@ void lcd_update_rect(int x, int y, int width, int height) if (y_end > LCD_HEIGHT) { y_end = LCD_HEIGHT; } + width = x_end - x; /* setup GRAM write window */ 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) /* write to GRAM */ lcd_write_cmd((lcd_type == 0) ? 0x08 : 0x0C); /* DDRAM_DATA_ACCESS_PORT */ for (row = y; row < y_end; row++) { - ptr = &lcd_framebuffer[row][x]; - for (col = x; col < x_end; col++) { - pixel = *ptr++; - lcd_write_dat((pixel >> 0) & 0xFF); - lcd_write_dat((pixel >> 8) & 0xFF); - } + lcd_write_data(&lcd_framebuffer[row][x], width); } } |