diff options
author | Dave Chapman <dave@dchapman.com> | 2009-10-04 17:32:51 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2009-10-04 17:32:51 +0000 |
commit | b349d8b0eac089260a66b4bd847da859e6ba53e7 (patch) | |
tree | 16c909d4e2db88a2f375093add503e4b276621b5 /firmware/target | |
parent | 45c411e6c8b73f0b3ab4bc69eb6da15901ced59c (diff) | |
download | rockbox-b349d8b0eac089260a66b4bd847da859e6ba53e7.tar.gz rockbox-b349d8b0eac089260a66b4bd847da859e6ba53e7.zip |
Implement lcd_update_rect()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22924 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c index 2887dad8ee..6ce9707732 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/lcd-nano2g.c | |||
@@ -205,13 +205,54 @@ void lcd_update(void) | |||
205 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; | 205 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; |
206 | void lcd_update_rect(int x, int y, int width, int height) | 206 | void lcd_update_rect(int x, int y, int width, int height) |
207 | { | 207 | { |
208 | (void)x; | 208 | int xx,yy; |
209 | (void)y; | 209 | int y0, x0, y1, x1; |
210 | (void)width; | 210 | fb_data* p; |
211 | (void)height; | 211 | fb_data pixel; |
212 | |||
213 | x0 = x; /* start horiz */ | ||
214 | y0 = y; /* start vert */ | ||
215 | x1 = (x + width) - 1; /* max horiz */ | ||
216 | y1 = (y + height) - 1; /* max vert */ | ||
217 | |||
218 | if (lcd_type==0) { | ||
219 | s5l_lcd_write_cmd_data(R_HORIZ_ADDR_START_POS, x0); | ||
220 | s5l_lcd_write_cmd_data(R_HORIZ_ADDR_END_POS, x1); | ||
221 | s5l_lcd_write_cmd_data(R_VERT_ADDR_START_POS, y0); | ||
222 | s5l_lcd_write_cmd_data(R_VERT_ADDR_END_POS, y1); | ||
212 | 223 | ||
213 | /* TODO. For now, just do a full-screen update */ | 224 | s5l_lcd_write_cmd_data(R_HORIZ_GRAM_ADDR_SET, (x1 << 8) | x0); |
214 | lcd_update(); | 225 | s5l_lcd_write_cmd_data(R_VERT_GRAM_ADDR_SET, (y1 << 8) | y0); |
226 | |||
227 | s5l_lcd_write_cmd(0); | ||
228 | s5l_lcd_write_cmd(R_WRITE_DATA_TO_GRAM); | ||
229 | } else { | ||
230 | s5l_lcd_write_cmd(R_COLUMN_ADDR_SET); | ||
231 | s5l_lcd_write_data(x0); /* Start column */ | ||
232 | s5l_lcd_write_data(x1); /* End column */ | ||
233 | |||
234 | s5l_lcd_write_cmd(R_ROW_ADDR_SET); | ||
235 | s5l_lcd_write_data(y0); /* Start row */ | ||
236 | s5l_lcd_write_data(y1); /* End row */ | ||
237 | |||
238 | s5l_lcd_write_cmd(R_MEMORY_WRITE); | ||
239 | } | ||
240 | |||
241 | |||
242 | /* Copy display bitmap to hardware */ | ||
243 | p = &lcd_framebuffer[y0][x0]; | ||
244 | yy = height; | ||
245 | for (yy = y0; yy <= y1; yy++) { | ||
246 | for (xx = x0; xx <= x1; xx++) { | ||
247 | pixel = *(p++); | ||
248 | |||
249 | while (LCD_STATUS & 0x10); | ||
250 | LCD_WDATA = (pixel & 0xff00) >> 8; | ||
251 | while (LCD_STATUS & 0x10); | ||
252 | LCD_WDATA = pixel & 0xff; | ||
253 | } | ||
254 | p += LCD_WIDTH - width; | ||
255 | } | ||
215 | } | 256 | } |
216 | 257 | ||
217 | /* Performance function to blit a YUV bitmap directly to the LCD */ | 258 | /* Performance function to blit a YUV bitmap directly to the LCD */ |