diff options
author | Jens Arnold <amiconn@rockbox.org> | 2010-05-30 22:24:50 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2010-05-30 22:24:50 +0000 |
commit | 7a1aca46a33e2c1461340238980994b471c6d71d (patch) | |
tree | 0c1d2fe6a1cc6d92d56dadab57b16eea8a291601 /firmware/target/arm/ipod/lcd-as-gray.S | |
parent | 839057733f001f458ee70cd8e146b57f858fe039 (diff) | |
download | rockbox-7a1aca46a33e2c1461340238980994b471c6d71d.tar.gz rockbox-7a1aca46a33e2c1461340238980994b471c6d71d.zip |
Smaller & faster grey blitting on greyscale ipods, based on an idea by Mike Sevakis. ISR speedup on all greyscale iPods except Mini 2nd Gen is ~10%. No speedup on the latter, because the serial transfer is the limiting factor.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26422 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/ipod/lcd-as-gray.S')
-rw-r--r-- | firmware/target/arm/ipod/lcd-as-gray.S | 77 |
1 files changed, 33 insertions, 44 deletions
diff --git a/firmware/target/arm/ipod/lcd-as-gray.S b/firmware/target/arm/ipod/lcd-as-gray.S index b6878a1a78..4579d15f71 100644 --- a/firmware/target/arm/ipod/lcd-as-gray.S +++ b/firmware/target/arm/ipod/lcd-as-gray.S | |||
@@ -201,8 +201,8 @@ lcd_mono_data: | |||
201 | * | 201 | * |
202 | * Register usage: | 202 | * Register usage: |
203 | * r3/r4 - current block of phases | 203 | * r3/r4 - current block of phases |
204 | * r5/r6 - current block of values | 204 | * r5/r6 - lcd data accumulators |
205 | * r7 - lcd data accumulator | 205 | * r6/r7 - current block of values |
206 | * r12 - phase signs mask | 206 | * r12 - phase signs mask |
207 | * lr - lcd bridge address | 207 | * lr - lcd bridge address |
208 | */ | 208 | */ |
@@ -216,63 +216,52 @@ lcd_grey_data: | |||
216 | 216 | ||
217 | .greyloop: | 217 | .greyloop: |
218 | ldmia r1, {r3-r4} /* Fetch 8 pixel phases */ | 218 | ldmia r1, {r3-r4} /* Fetch 8 pixel phases */ |
219 | ldmia r0!, {r5-r6} /* Fetch 8 pixel values */ | 219 | |
220 | 220 | bic r5, r12, r3 /* r5 = 0.......1.......2.......3....... */ | |
221 | #ifdef IPOD_MINI2G /* Serial bridge mode */ | 221 | orr r5, r5, r5, lsr #10 /* r5 = 0.......1.0.....2.1.....3.2..... */ |
222 | mov r7, #0x760000 | 222 | orr r5, r5, r5, lsr #10 /* r5 = 0.......1.0.....2.1.0...3.2.1... */ |
223 | tst r3, #0x80 | 223 | orr r5, r5, r5, lsr #10 /* r5 = 0.......1.0.....2.1.0...3.2.1.0. */ |
224 | orreq r7, r7, #0xc000 | 224 | orr r5, r5, r5, lsr #1 /* r5 = 00......1100....221100..33221100 */ |
225 | tst r3, #0x8000 | ||
226 | orreq r7, r7, #0x3000 | ||
227 | tst r3, #0x800000 | ||
228 | orreq r7, r7, #0x0c00 | ||
229 | tst r3, #0x80000000 | ||
230 | orreq r7, r7, #0x0300 | ||
231 | bic r3, r3, r12 | ||
232 | add r3, r3, r5 | ||
233 | #else /* Parallel bridge mode */ | ||
234 | mov r7, #0 | ||
235 | tst r3, #0x80 | ||
236 | orreq r7, r7, #0xc0 | ||
237 | tst r3, #0x8000 | ||
238 | orreq r7, r7, #0x30 | ||
239 | tst r3, #0x800000 | ||
240 | orreq r7, r7, #0x0c | ||
241 | tst r3, #0x80000000 | ||
242 | orreq r7, r7, #0x03 | ||
243 | bic r3, r3, r12 | 225 | bic r3, r3, r12 |
244 | add r3, r3, r5 | ||
245 | 226 | ||
227 | #ifndef IPOD_MINI2G /* 8 bit parallel bridge mode */ | ||
246 | 1: | 228 | 1: |
247 | ldr r5, [lr] | 229 | ldr r6, [lr] |
248 | tst r5, #LCD1_BUSY_MASK | 230 | tst r6, #LCD1_BUSY_MASK |
249 | bne 1b | 231 | bne 1b |
250 | 232 | ||
251 | str r7, [lr, #0x10] | 233 | str r5, [lr, #0x10] |
252 | mov r7, #0 | ||
253 | #endif | 234 | #endif |
254 | 235 | ||
255 | tst r4, #0x80 | 236 | ldmia r0!, {r6-r7} /* Fetch 8 pixel values */ |
256 | orreq r7, r7, #0xc0 | 237 | add r3, r3, r6 |
257 | tst r4, #0x8000 | 238 | |
258 | orreq r7, r7, #0x30 | 239 | bic r6, r12, r4 /* r6 = 4.......5.......6.......7....... */ |
259 | tst r4, #0x800000 | 240 | orr r6, r6, r6, lsr #10 /* r6 = 4.......5.4.....6.5.....7.6..... */ |
260 | orreq r7, r7, #0x0c | 241 | orr r6, r6, r6, lsr #10 /* r6 = 4.......5.4.....6.5.4...7.6.5... */ |
261 | tst r4, #0x80000000 | 242 | orr r6, r6, r6, lsr #10 /* r6 = 4.......5.4.....6.5.4...7.6.5.4. */ |
262 | orreq r7, r7, #0x03 | 243 | orr r6, r6, r6, lsr #1 /* r6 = 44......5544....665544..77665544 */ |
263 | bic r4, r4, r12 | 244 | bic r4, r4, r12 |
264 | add r4, r4, r6 | ||
265 | 245 | ||
246 | add r4, r4, r7 | ||
266 | stmia r1!, {r3-r4} | 247 | stmia r1!, {r3-r4} |
267 | 248 | ||
249 | #ifdef IPOD_MINI2G /* 16 bit serial bridge mode */ | ||
250 | and r5, r5, #0xff /* r5 = ........................33221100 */ | ||
251 | and r6, r6, #0xff /* r6 = ........................77665544 */ | ||
252 | orr r5, r5, r6, lsl #8 /* r5 = ................7766554433221100 */ | ||
253 | orr r5, r5, #0x760000 /* data marker */ | ||
254 | #endif | ||
255 | |||
268 | 1: | 256 | 1: |
269 | ldr r5, [lr] | 257 | ldr r7, [lr] |
270 | tst r5, #LCD1_BUSY_MASK | 258 | tst r7, #LCD1_BUSY_MASK |
271 | bne 1b | 259 | bne 1b |
260 | |||
272 | #ifdef IPOD_MINI2G | 261 | #ifdef IPOD_MINI2G |
273 | str r7, [lr, #0x08] | 262 | str r5, [lr, #0x08] |
274 | #else | 263 | #else |
275 | str r7, [lr, #0x10] | 264 | str r6, [lr, #0x10] |
276 | #endif | 265 | #endif |
277 | 266 | ||
278 | subs r2, r2, #1 | 267 | subs r2, r2, #1 |