Speed up lcd_update_rect by ~2.5% by counting towards 0 in the loop.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23329 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-10-24 16:01:53 +00:00
parent c6a2964068
commit e4921d6ab5
2 changed files with 6 additions and 2 deletions

View file

@ -556,12 +556,15 @@ void lcd_update_rect(int x, int y, int width, int height)
ptr = (fb_data*)&lcd_framebuffer[y][x]; ptr = (fb_data*)&lcd_framebuffer[y][x];
height = ymax - y - 1; /* fix height */
do do
{ {
lcd_write_data(ptr, width); lcd_write_data(ptr, width);
ptr += LCD_WIDTH; ptr += LCD_WIDTH;
} }
while (++y <= ymax); while (--height > 0);
lcd_busy = false; lcd_busy = false;
} /* lcd_update_rect */ } /* lcd_update_rect */

View file

@ -405,12 +405,13 @@ void lcd_update_rect(int x, int y, int width, int height)
ptr = &lcd_framebuffer[y][x]; ptr = &lcd_framebuffer[y][x];
height = ymax - y - 1; /* fix height */
do do
{ {
lcd_write_data(ptr, width); lcd_write_data(ptr, width);
ptr += LCD_WIDTH; ptr += LCD_WIDTH;
} }
while (++y <= ymax); while (--height > 0);
lcd_busy = false; lcd_busy = false;
} }