diff options
author | Daniel Stenberg <daniel@haxx.se> | 2006-04-27 21:11:18 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2006-04-27 21:11:18 +0000 |
commit | 5f0395d577eddb867eeee30f89f19864ff04baf4 (patch) | |
tree | c906068159f80e5ff38f6882f3c27434b64aa30c | |
parent | f004315105cf2c829800bf9e20e55e6efaf6a050 (diff) | |
download | rockbox-5f0395d577eddb867eeee30f89f19864ff04baf4.tar.gz 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
-rwxr-xr-x | firmware/target/coldfire/iaudio/x5/lcd-x5.c | 17 |
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) | |||
108 | inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; | 108 | inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; |
109 | inline void lcd_write_data(const unsigned short* p_bytes, int count) | 109 | inline void lcd_write_data(const unsigned short* p_bytes, int count) |
110 | { | 110 | { |
111 | /* Ok, by doing 32bit reads we gain a tad bit so I decided to leave this | ||
112 | code in for now, even though when called with an odd 'count' we will | ||
113 | actually output one pixel "too many". */ | ||
114 | |||
115 | unsigned int tmp; | 111 | unsigned int tmp; |
116 | unsigned int *ptr = (unsigned int *)p_bytes; | 112 | unsigned int *ptr = (unsigned int *)p_bytes; |
113 | bool extra; | ||
114 | |||
115 | /* if there's on odd number of pixels, remmber this and output the | ||
116 | trailing pixel after the loop */ | ||
117 | extra = (count&1)?true:false; | ||
117 | 118 | ||
118 | if(count&1) | ||
119 | count++; | ||
120 | count >>= 1; | 119 | count >>= 1; |
121 | while(count--) { | 120 | while(count--) { |
122 | tmp = *ptr++; | 121 | tmp = *ptr++; |
@@ -125,6 +124,12 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count) | |||
125 | *(volatile unsigned short *)0xf0008002 = high8to9[(tmp >> 8)&255]; | 124 | *(volatile unsigned short *)0xf0008002 = high8to9[(tmp >> 8)&255]; |
126 | *(volatile unsigned short *)0xf0008002 = tmp<<1; | 125 | *(volatile unsigned short *)0xf0008002 = tmp<<1; |
127 | } | 126 | } |
127 | if(extra) { | ||
128 | /* the final "spare" pixel */ | ||
129 | unsigned short read = *(unsigned short *)ptr; | ||
130 | *(volatile unsigned short *)0xf0008002 = high8to9[read >> 8]; | ||
131 | *(volatile unsigned short *)0xf0008002 = read<<1; | ||
132 | } | ||
128 | } | 133 | } |
129 | 134 | ||
130 | /*** hardware configuration ***/ | 135 | /*** hardware configuration ***/ |