diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-05 06:35:23 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-04-05 06:35:23 +0000 |
commit | 5b8aca84dca69bad86c2f01811e91faad130ecae (patch) | |
tree | d0679e5031e59f98244ac1fd4b36d5c8bccaf7a6 | |
parent | 69186f6f8528d56499b32f86204d547db834b80c (diff) | |
download | rockbox-5b8aca84dca69bad86c2f01811e91faad130ecae.tar.gz rockbox-5b8aca84dca69bad86c2f01811e91faad130ecae.zip |
Fuzev2: don't reinvent the wheel: swap pixels with existing swap_odd_even32
It is equally fast and doesn't need an additional mask
Thanks to amiconn for pointing to it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25477 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c index 06a1b7f4dd..b337a14eac 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | |||
@@ -144,23 +144,9 @@ static void dbop_write_data(const int16_t* p_bytes, int count) | |||
144 | dbop_set_mode(32); | 144 | dbop_set_mode(32); |
145 | data = (int32_t*)p_bytes; | 145 | data = (int32_t*)p_bytes; |
146 | 146 | ||
147 | const unsigned int mask = 0xff00ff; | ||
148 | while (count > 1) | 147 | while (count > 1) |
149 | { | 148 | { |
150 | register unsigned int pixels = *data++; | 149 | DBOP_DOUT32 = swap_odd_even32(*data++); |
151 | register unsigned int tmp; | ||
152 | |||
153 | /* pixels == ABCD */ | ||
154 | asm( | ||
155 | "and %[tmp], %[pixels], %[mask] \n" /* tmp = 0B0D */ | ||
156 | "and %[pixels], %[pixels], %[mask], lsl #8\n" /* %[pixels] = A0C0 */ | ||
157 | "mov %[pixels], %[pixels], lsr #8 \n" /* %[pixels] = 0A0C */ | ||
158 | "orr %[pixels], %[pixels], %[tmp], lsl #8 \n" /* %[pixels] = BADC */ | ||
159 | : [pixels]"+r"(pixels), [tmp]"=r"(tmp) /* output */ | ||
160 | : [mask]"r"(mask) /* input */ | ||
161 | ); | ||
162 | |||
163 | DBOP_DOUT32 = pixels; | ||
164 | count -= 2; | 150 | count -= 2; |
165 | 151 | ||
166 | /* Wait if push fifo is full */ | 152 | /* Wait if push fifo is full */ |