summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2011-01-23 16:24:52 +0000
committerJens Arnold <amiconn@rockbox.org>2011-01-23 16:24:52 +0000
commit330676491faa397ef2b3935027ce53867d341bc8 (patch)
treee348c4d66876f700fe2d9ec92731bcf614d6d092
parent322a51d437aed568494d51bfcf8d3bb50059a8b8 (diff)
downloadrockbox-330676491faa397ef2b3935027ce53867d341bc8.tar.gz
rockbox-330676491faa397ef2b3935027ce53867d341bc8.tar.bz2
rockbox-330676491faa397ef2b3935027ce53867d341bc8.zip
Simplify x0/x1 calculation for iPod Color some more, and fix display on type 0 LCD (iPod Photo).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29120 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/ipod/lcd-color_nano.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware/target/arm/ipod/lcd-color_nano.c b/firmware/target/arm/ipod/lcd-color_nano.c
index a331b98c88..d7e3beb197 100644
--- a/firmware/target/arm/ipod/lcd-color_nano.c
+++ b/firmware/target/arm/ipod/lcd-color_nano.c
@@ -155,22 +155,24 @@ static void lcd_setup_drawing_region(int x, int y, int width, int height)
/* calculate the drawing region */
#if CONFIG_LCD == LCD_IPODNANO
y0 = x; /* start horiz */
- x0 = y; /* start vert */
y1 = (x + width) - 1; /* max horiz */
+ x0 = y; /* start vert */
x1 = (y + height) - 1; /* max vert */
#elif CONFIG_LCD == LCD_IPODCOLOR
y0 = y; /* start vert */
- x0 = LCD_WIDTH - (x + width); /* start horiz */
y1 = (y + height) - 1; /* end vert */
- x1 = (x0 + width) - 1; /* end horiz */
+ x1 = (LCD_WIDTH - 1) - x; /* end horiz */
+ x0 = (x1 - width) + 1; /* start horiz */
#endif
/* setup the drawing region */
if ((lcd_type&1) == 0) {
+ /* x0 and x1 need to be swapped until
+ * proper direction setup is added */
lcd_cmd_data(0x12, y0); /* start vert */
- lcd_cmd_data(0x13, x0); /* start horiz */
+ lcd_cmd_data(0x13, x1); /* start horiz */
lcd_cmd_data(0x15, y1); /* end vert */
- lcd_cmd_data(0x16, x1); /* end horiz */
+ lcd_cmd_data(0x16, x0); /* end horiz */
} else {
/* max horiz << 8 | start horiz */
lcd_cmd_data(LCD_CNTL_HORIZ_RAM_ADDR_POS, (y1 << 8) | y0);