While waiting further and better improvements, this fixes the bug to

lcd_update_rect() I introduced previously.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9822 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2006-04-27 21:11:18 +00:00
parent f004315105
commit 5f0395d577

View file

@ -108,15 +108,14 @@ inline void lcd_begin_write_gram(void)
inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
inline void lcd_write_data(const unsigned short* p_bytes, int count) inline void lcd_write_data(const unsigned short* p_bytes, int count)
{ {
/* Ok, by doing 32bit reads we gain a tad bit so I decided to leave this
code in for now, even though when called with an odd 'count' we will
actually output one pixel "too many". */
unsigned int tmp; unsigned int tmp;
unsigned int *ptr = (unsigned int *)p_bytes; unsigned int *ptr = (unsigned int *)p_bytes;
bool extra;
/* if there's on odd number of pixels, remmber this and output the
trailing pixel after the loop */
extra = (count&1)?true:false;
if(count&1)
count++;
count >>= 1; count >>= 1;
while(count--) { while(count--) {
tmp = *ptr++; tmp = *ptr++;
@ -125,6 +124,12 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count)
*(volatile unsigned short *)0xf0008002 = high8to9[(tmp >> 8)&255]; *(volatile unsigned short *)0xf0008002 = high8to9[(tmp >> 8)&255];
*(volatile unsigned short *)0xf0008002 = tmp<<1; *(volatile unsigned short *)0xf0008002 = tmp<<1;
} }
if(extra) {
/* the final "spare" pixel */
unsigned short read = *(unsigned short *)ptr;
*(volatile unsigned short *)0xf0008002 = high8to9[read >> 8];
*(volatile unsigned short *)0xf0008002 = read<<1;
}
} }
/*** hardware configuration ***/ /*** hardware configuration ***/