1
0
Fork 0
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:
Dave Chapman 2006-07-19 17:47:06 +00:00
parent 73c6c9d279
commit 61c301bf8d

View file

@ -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;
} }