summaryrefslogtreecommitdiff
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.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)
155 /* calculate the drawing region */ 155 /* calculate the drawing region */
156#if CONFIG_LCD == LCD_IPODNANO 156#if CONFIG_LCD == LCD_IPODNANO
157 y0 = x; /* start horiz */ 157 y0 = x; /* start horiz */
158 x0 = y; /* start vert */
159 y1 = (x + width) - 1; /* max horiz */ 158 y1 = (x + width) - 1; /* max horiz */
159 x0 = y; /* start vert */
160 x1 = (y + height) - 1; /* max vert */ 160 x1 = (y + height) - 1; /* max vert */
161#elif CONFIG_LCD == LCD_IPODCOLOR 161#elif CONFIG_LCD == LCD_IPODCOLOR
162 y0 = y; /* start vert */ 162 y0 = y; /* start vert */
163 x0 = LCD_WIDTH - (x + width); /* start horiz */
164 y1 = (y + height) - 1; /* end vert */ 163 y1 = (y + height) - 1; /* end vert */
165 x1 = (x0 + width) - 1; /* end horiz */ 164 x1 = (LCD_WIDTH - 1) - x; /* end horiz */
165 x0 = (x1 - width) + 1; /* start horiz */
166#endif 166#endif
167 167
168 /* setup the drawing region */ 168 /* setup the drawing region */
169 if ((lcd_type&1) == 0) { 169 if ((lcd_type&1) == 0) {
170 /* x0 and x1 need to be swapped until
171 * proper direction setup is added */
170 lcd_cmd_data(0x12, y0); /* start vert */ 172 lcd_cmd_data(0x12, y0); /* start vert */
171 lcd_cmd_data(0x13, x0); /* start horiz */ 173 lcd_cmd_data(0x13, x1); /* start horiz */
172 lcd_cmd_data(0x15, y1); /* end vert */ 174 lcd_cmd_data(0x15, y1); /* end vert */
173 lcd_cmd_data(0x16, x1); /* end horiz */ 175 lcd_cmd_data(0x16, x0); /* end horiz */
174 } else { 176 } else {
175 /* max horiz << 8 | start horiz */ 177 /* max horiz << 8 | start horiz */
176 lcd_cmd_data(LCD_CNTL_HORIZ_RAM_ADDR_POS, (y1 << 8) | y0); 178 lcd_cmd_data(LCD_CNTL_HORIZ_RAM_ADDR_POS, (y1 << 8) | y0);