summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-04-27 21:11:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-04-27 21:11:18 +0000
commit5f0395d577eddb867eeee30f89f19864ff04baf4 (patch)
treec906068159f80e5ff38f6882f3c27434b64aa30c /firmware
parentf004315105cf2c829800bf9e20e55e6efaf6a050 (diff)
downloadrockbox-5f0395d577eddb867eeee30f89f19864ff04baf4.tar.gz
rockbox-5f0395d577eddb867eeee30f89f19864ff04baf4.tar.bz2
rockbox-5f0395d577eddb867eeee30f89f19864ff04baf4.zip
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
Diffstat (limited to 'firmware')
-rwxr-xr-xfirmware/target/coldfire/iaudio/x5/lcd-x5.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/firmware/target/coldfire/iaudio/x5/lcd-x5.c b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
index 0f070ed2fe..9b4a54fdd6 100755
--- a/firmware/target/coldfire/iaudio/x5/lcd-x5.c
+++ b/firmware/target/coldfire/iaudio/x5/lcd-x5.c
@@ -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)
{
- /* 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 *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;
while(count--) {
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 = 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 ***/