diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-ipod.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c index 30cd4555ae..69272ccccf 100644 --- a/firmware/drivers/lcd-ipod.c +++ b/firmware/drivers/lcd-ipod.c | |||
@@ -221,8 +221,11 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
221 | { | 221 | { |
222 | int rect1, rect2, rect3, rect4; | 222 | int rect1, rect2, rect3, rect4; |
223 | 223 | ||
224 | unsigned short *addr = (unsigned short *)lcd_framebuffer; | 224 | unsigned long *addr = (unsigned long *)lcd_framebuffer; |
225 | 225 | ||
226 | /* TODO: Ensure x is even - so we read 32-bit aligned data from | ||
227 | lcd_framebuffer */ | ||
228 | |||
226 | /* calculate the drawing region */ | 229 | /* calculate the drawing region */ |
227 | #if CONFIG_LCD == LCD_IPODCOLOR | 230 | #if CONFIG_LCD == LCD_IPODCOLOR |
228 | rect1 = x; /* start vert */ | 231 | rect1 = x; /* start vert */ |
@@ -277,7 +280,7 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
277 | lcd_send_lo(0x22); | 280 | lcd_send_lo(0x22); |
278 | } | 281 | } |
279 | 282 | ||
280 | addr += x * LCD_WIDTH + y; | 283 | addr += x * LCD_WIDTH + y/2; |
281 | 284 | ||
282 | while (height > 0) { | 285 | while (height > 0) { |
283 | int c, r; | 286 | int c, r; |
@@ -300,18 +303,13 @@ void lcd_update_rect(int x, int y, int width, int height) | |||
300 | for (r = 0; r < h; r++) { | 303 | for (r = 0; r < h; r++) { |
301 | /* for each column */ | 304 | /* for each column */ |
302 | for (c = 0; c < width; c += 2) { | 305 | for (c = 0; c < width; c += 2) { |
303 | unsigned two_pixels; | ||
304 | |||
305 | two_pixels = addr[0] | (addr[1] << 16); | ||
306 | addr += 2; | ||
307 | |||
308 | while ((inl(0x70008a20) & 0x1000000) == 0); | 306 | while ((inl(0x70008a20) & 0x1000000) == 0); |
309 | 307 | ||
310 | /* output 2 pixels */ | 308 | /* output 2 pixels */ |
311 | outl(two_pixels, 0x70008b00); | 309 | outl(*(addr++), 0x70008b00); |
312 | } | 310 | } |
313 | 311 | ||
314 | addr += LCD_WIDTH - width; | 312 | addr += (LCD_WIDTH - width)/2; |
315 | } | 313 | } |
316 | 314 | ||
317 | while ((inl(0x70008a20) & 0x4000000) == 0); | 315 | while ((inl(0x70008a20) & 0x4000000) == 0); |