summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2011-11-12 20:14:44 +0000
committerBertrik Sikken <bertrik@sikken.nl>2011-11-12 20:14:44 +0000
commitfdc906743ff30e4a971ce1d50036c980aa47ad39 (patch)
tree5d71a211121a2220b4c98350cfbcdb7778c28d23 /firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
parentcaec07be65b2e7197b539784c4fcd52ef4d4ba24 (diff)
downloadrockbox-fdc906743ff30e4a971ce1d50036c980aa47ad39.tar.gz
rockbox-fdc906743ff30e4a971ce1d50036c980aa47ad39.tar.bz2
rockbox-fdc906743ff30e4a971ce1d50036c980aa47ad39.zip
Sansa clip zip: update lcd_update_rect to even-align horizontal coordinates for the wisechip display type
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30969 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c')
-rw-r--r--firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
index 2d8d25cf31..8e36ff59d1 100644
--- a/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
+++ b/firmware/target/arm/as3525/sansa-clipzip/lcd-clipzip.c
@@ -335,6 +335,8 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
lcd_write(0x35, x_end); /* MEM_X2 */
lcd_write(0x36, y); /* MEM_Y1 */
lcd_write(0x37, y_end); /* MEM_Y2 */
+
+ lcd_write_cmd(0x08); /* DDRAM_DATA_ACCESS_PORT */
}
else {
lcd_write_cmd(0x0A);
@@ -342,6 +344,8 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
lcd_write_nibbles(x_end);
lcd_write_nibbles(y);
lcd_write_nibbles(y_end);
+
+ lcd_write_cmd(0x0C);
}
}
@@ -396,6 +400,12 @@ void lcd_update_rect(int x, int y, int width, int height)
return;
}
+ /* align horizontal position to even for wisechip display */
+ if (lcd_type == 0) {
+ x = x & ~1;
+ x_end = (x_end + 1) & ~1;
+ }
+
/* correct rectangle (if necessary) */
if (x < 0) {
x = 0;
@@ -415,7 +425,6 @@ void lcd_update_rect(int x, int y, int width, int height)
lcd_setup_rect(x, x_end - 1, y, y_end - 1);
/* write to GRAM */
- lcd_write_cmd((lcd_type == 0) ? 0x08 : 0x0C); /* DDRAM_DATA_ACCESS_PORT */
for (row = y; row < y_end; row++) {
lcd_write_data(&lcd_framebuffer[row][x], width);
}