summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/sansa-clipzip
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
parentcaec07be65b2e7197b539784c4fcd52ef4d4ba24 (diff)
downloadrockbox-fdc906743ff30e4a971ce1d50036c980aa47ad39.tar.gz
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')
-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)
335 lcd_write(0x35, x_end); /* MEM_X2 */ 335 lcd_write(0x35, x_end); /* MEM_X2 */
336 lcd_write(0x36, y); /* MEM_Y1 */ 336 lcd_write(0x36, y); /* MEM_Y1 */
337 lcd_write(0x37, y_end); /* MEM_Y2 */ 337 lcd_write(0x37, y_end); /* MEM_Y2 */
338
339 lcd_write_cmd(0x08); /* DDRAM_DATA_ACCESS_PORT */
338 } 340 }
339 else { 341 else {
340 lcd_write_cmd(0x0A); 342 lcd_write_cmd(0x0A);
@@ -342,6 +344,8 @@ static void lcd_setup_rect(int x, int x_end, int y, int y_end)
342 lcd_write_nibbles(x_end); 344 lcd_write_nibbles(x_end);
343 lcd_write_nibbles(y); 345 lcd_write_nibbles(y);
344 lcd_write_nibbles(y_end); 346 lcd_write_nibbles(y_end);
347
348 lcd_write_cmd(0x0C);
345 } 349 }
346} 350}
347 351
@@ -396,6 +400,12 @@ void lcd_update_rect(int x, int y, int width, int height)
396 return; 400 return;
397 } 401 }
398 402
403 /* align horizontal position to even for wisechip display */
404 if (lcd_type == 0) {
405 x = x & ~1;
406 x_end = (x_end + 1) & ~1;
407 }
408
399 /* correct rectangle (if necessary) */ 409 /* correct rectangle (if necessary) */
400 if (x < 0) { 410 if (x < 0) {
401 x = 0; 411 x = 0;
@@ -415,7 +425,6 @@ void lcd_update_rect(int x, int y, int width, int height)
415 lcd_setup_rect(x, x_end - 1, y, y_end - 1); 425 lcd_setup_rect(x, x_end - 1, y, y_end - 1);
416 426
417 /* write to GRAM */ 427 /* write to GRAM */
418 lcd_write_cmd((lcd_type == 0) ? 0x08 : 0x0C); /* DDRAM_DATA_ACCESS_PORT */
419 for (row = y; row < y_end; row++) { 428 for (row = y; row < y_end; row++) {
420 lcd_write_data(&lcd_framebuffer[row][x], width); 429 lcd_write_data(&lcd_framebuffer[row][x], width);
421 } 430 }