forked from len0rd/rockbox
Patch #5432 from Thomas Paul Diffenbach - small speedup for ipod video lcd_update function.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10252 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
73c6c9d279
commit
61c301bf8d
1 changed files with 13 additions and 6 deletions
|
|
@ -172,12 +172,19 @@ void lcd_update_rect(int x, int y, int width, int height)
|
||||||
unsigned short *end = &src[LCD_WIDTH * height];
|
unsigned short *end = &src[LCD_WIDTH * height];
|
||||||
int line_rem = (LCD_WIDTH - width);
|
int line_rem = (LCD_WIDTH - width);
|
||||||
while (src < end) {
|
while (src < end) {
|
||||||
/* for each column */
|
/* Duff's Device to unroll loop */
|
||||||
unsigned short *end_line = src + width;
|
register int count = width ;
|
||||||
while (src < end_line) {
|
register int n=( count + 7 ) / 8;
|
||||||
/* write out two pixels */
|
switch( count % 8 ) {
|
||||||
outw(*(src++), 0x30000000);
|
case 0: do{ outw(*(src++), 0x30000000);
|
||||||
outw(*(src++), 0x30000000);
|
case 7: outw(*(src++), 0x30000000);
|
||||||
|
case 6: outw(*(src++), 0x30000000);
|
||||||
|
case 5: outw(*(src++), 0x30000000);
|
||||||
|
case 4: outw(*(src++), 0x30000000);
|
||||||
|
case 3: outw(*(src++), 0x30000000);
|
||||||
|
case 2: outw(*(src++), 0x30000000);
|
||||||
|
case 1: outw(*(src++), 0x30000000);
|
||||||
|
} while(--n>0);
|
||||||
}
|
}
|
||||||
src += line_rem;
|
src += line_rem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue