1
0
Fork 0
forked from len0rd/rockbox

Patch #1377879 by Anders Kagerin - faster lcd_update_rect() for h300

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8215 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2005-12-11 00:30:15 +00:00
parent 27cd6ca152
commit 6ddfac0806
2 changed files with 16 additions and 8 deletions

View file

@ -148,4 +148,4 @@ Tat Tang
Toshihiko Itoh Toshihiko Itoh
David J. Song David J. Song
Jeong Taek In Jeong Taek In
Anders Kagerin

View file

@ -200,11 +200,19 @@ void lcd_update_rect(int x, int y, int width, int height)
if(ymax >= LCD_HEIGHT) if(ymax >= LCD_HEIGHT)
ymax = LCD_HEIGHT-1; ymax = LCD_HEIGHT-1;
/* set update window */
lcd_write_reg(0x44, (ymax<<8) | y); /* horiz ram addr */
lcd_write_reg(0x45, ((x+width-1)<<8) | x); /* vert ram addr */
lcd_write_reg(0x21, (x<<8) | y);
lcd_begin_write_gram();
/* Copy specified rectangle bitmap to hardware */ /* Copy specified rectangle bitmap to hardware */
for (; y <= ymax; y++) for (; y <= ymax; y++)
{ {
lcd_write_reg(0x21, (x << 8) + y);
lcd_begin_write_gram();
lcd_write_data ((unsigned short *)&lcd_framebuffer[y][x], width); lcd_write_data ((unsigned short *)&lcd_framebuffer[y][x], width);
} }
/* reset update window */
lcd_write_reg(0x44, 0xaf00); /* horiz ram addr: 0 - 175 */
lcd_write_reg(0x45, 0xdb00); /* vert ram addr: 0 - 219 */
} }