summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-01-11 01:32:19 +0000
committerJens Arnold <amiconn@rockbox.org>2008-01-11 01:32:19 +0000
commit8a417edb26a0f0a0149391af4e0d5e7e21abb5c3 (patch)
treecbdb69b3a970afa28f9bd5b85cb974dfa970cbca
parent753b65737f65296914bcf5055f82272af3ef2e65 (diff)
downloadrockbox-8a417edb26a0f0a0149391af4e0d5e7e21abb5c3.tar.gz
rockbox-8a417edb26a0f0a0149391af4e0d5e7e21abb5c3.zip
Another small optimisation for greyscale blitting on SH1 (making better use of page mode by reordering accesses).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16053 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/sh/archos/lcd-as-archos-bitmap.S55
1 files changed, 28 insertions, 27 deletions
diff --git a/firmware/target/sh/archos/lcd-as-archos-bitmap.S b/firmware/target/sh/archos/lcd-as-archos-bitmap.S
index a60ea9aad1..ae7b7f85cc 100644
--- a/firmware/target/sh/archos/lcd-as-archos-bitmap.S
+++ b/firmware/target/sh/archos/lcd-as-archos-bitmap.S
@@ -223,22 +223,22 @@ _lcd_write_data:
223 * r4 - current value address 223 * r4 - current value address
224 * r5 - current phase address 224 * r5 - current phase address
225 * r6 - end address 225 * r6 - end address
226 * r7/r8 - current/next pixel phase 226 * r7/r8 - current/next block of phases (alternating)
227 * r9 - current pixel value 227 * r9/r10 - current blocks of values
228 * r10 - 0x00000080 \ 228 * r11 - 0x00000080 \
229 * r11 - 0x00008000 > for phase sign check 229 * r12 - 0x00008000 > for phase sign check
230 * r12 - 0x00800000 / 230 * r13 - 0x00800000 /
231 */ 231 */
232 232
233_lcd_grey_data: 233_lcd_grey_data:
234 mov.l r8, @-r15 /* save r8 */ 234 mov.l r8, @-r15 /* save r8 */
235 shll2 r6 /* v */
236 mov.l r9, @-r15 /* save r9 */ 235 mov.l r9, @-r15 /* save r9 */
237 shll r6 /* r6 *= 8; (8 pixels per block) */
238 mov.l r10, @-r15 /* save r10 */ 236 mov.l r10, @-r15 /* save r10 */
239 add r4, r6 /* end address */ 237 shll2 r6 /* v */
238 mov.l r11, @-r15 /* save r11 */
239 shll r6 /* r6 *= 8; (8 pixels per block) */
240 mov.l .lcdr, r3 /* put lcd data port address in r3 */ 240 mov.l .lcdr, r3 /* put lcd data port address in r3 */
241 nop /* keep alignment */ 241 add r4, r6 /* end address */
242 242
243 /* This code will fail if an interrupt changes the contents of PBDRL. 243 /* This code will fail if an interrupt changes the contents of PBDRL.
244 * If so, we must disable the interrupt here. If disabling interrupts 244 * If so, we must disable the interrupt here. If disabling interrupts
@@ -248,17 +248,17 @@ _lcd_grey_data:
248 248
249 mov.b @r3, r0 /* r0 = PBDRL */ 249 mov.b @r3, r0 /* r0 = PBDRL */
250 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */ 250 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */
251 mov.l r11, @-r15 /* save r11 */
252 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
253 mov.l r12, @-r15 /* save r12 */ 251 mov.l r12, @-r15 /* save r12 */
252 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
253 mov.l r13, @-r15 /* save r13 */
254 neg r0, r2 /* r2 = 0 - r0 */ 254 neg r0, r2 /* r2 = 0 - r0 */
255 255
256 /* loop exploits that SD is on bit 0 for recorders and Ondios */ 256 /* loop exploits that SD is on bit 0 for recorders and Ondios */
257 257
258 mov.w .ptest, r10 258 mov.w .ptest, r11
259 swap.b r10, r11 259 swap.b r11, r12
260 mov.l @r5, r7 260 mov.l @r5, r7
261 swap.w r10, r12 261 swap.w r11, r13
262 mov.l .pmask, r0 262 mov.l .pmask, r0
263 263
264.greyloop: 264.greyloop:
@@ -269,66 +269,67 @@ _lcd_grey_data:
269 add #(LCD_SC), r1 269 add #(LCD_SC), r1
270 mov.b r1, @r3 270 mov.b r1, @r3
271 271
272 tst r12, r7 272 tst r13, r7
273 mov.l @(4,r5), r8 273 mov.l @r4+, r10
274 negc r2, r1 274 negc r2, r1
275 mov.b r1, @r3 275 mov.b r1, @r3
276 add #(LCD_SC), r1 276 add #(LCD_SC), r1
277 mov.b r1, @r3 277 mov.b r1, @r3
278 278
279 tst r11, r7 279 tst r12, r7
280 mov.l @(4,r5), r8
280 negc r2, r1 281 negc r2, r1
281 tst r10, r7
282 mov.b r1, @r3 282 mov.b r1, @r3
283 add #(LCD_SC), r1 283 add #(LCD_SC), r1
284 mov.b r1, @r3 284 mov.b r1, @r3
285 285
286 tst r11, r7
286 or r0, r7 287 or r0, r7
287 sub r9, r7
288 negc r2, r1 288 negc r2, r1
289 mov.b r1, @r3 289 mov.b r1, @r3
290 add #(LCD_SC), r1 290 add #(LCD_SC), r1
291 mov.b r1, @r3 291 mov.b r1, @r3
292 292
293 cmp/pz r8 293 cmp/pz r8
294 mov.l r7, @r5 294 sub r9, r7
295 negc r2, r1 295 negc r2, r1
296 mov.b r1, @r3 296 mov.b r1, @r3
297 add #(LCD_SC), r1 297 add #(LCD_SC), r1
298 mov.b r1, @r3 298 mov.b r1, @r3
299 299
300 tst r12, r8 300 tst r13, r8
301 mov.l @r4+, r9 301 mov.l r7, @r5
302 negc r2, r1 302 negc r2, r1
303 mov.b r1, @r3 303 mov.b r1, @r3
304 add #(LCD_SC), r1 304 add #(LCD_SC), r1
305 mov.b r1, @r3 305 mov.b r1, @r3
306 306
307 tst r11, r8 307 tst r12, r8
308 mov.l @(8,r5), r7 308 mov.l @(8,r5), r7
309 negc r2, r1 309 negc r2, r1
310 mov.b r1, @r3 310 mov.b r1, @r3
311 add #(LCD_SC), r1 311 add #(LCD_SC), r1
312 mov.b r1, @r3 312 mov.b r1, @r3
313 313
314 tst r10, r8 314 tst r11, r8
315 or r0, r8 315 or r0, r8
316 negc r2, r1 316 negc r2, r1
317 mov.b r1, @r3 317 mov.b r1, @r3
318 add #(LCD_SC), r1 318 add #(LCD_SC), r1
319 mov.b r1, @r3 319 mov.b r1, @r3
320 320
321 sub r9, r8 321 sub r10, r8
322 mov.l r8, @(4,r5) 322 mov.l r8, @(4,r5)
323 323
324 add #8, r5 324 add #8, r5
325 cmp/hi r4, r6 325 cmp/hi r4, r6
326 bt .greyloop 326 bt .greyloop
327 327
328 mov.l @r15+, r12 /* restore r12 */ 328 mov.l @r15+, r13 /* restore r13 */
329 mov #(LCD_CS|LCD_DS|LCD_SD|LCD_SC), r0 329 mov #(LCD_CS|LCD_DS|LCD_SD|LCD_SC), r0
330 mov.l @r15+, r11 /* restore r11 */ 330 mov.l @r15+, r12 /* restore r12 */
331 or r0, r1 /* restore port */ 331 or r0, r1 /* restore port */
332 mov.l @r15+, r11 /* restore r11 */
332 mov.l @r15+, r10 /* restore r10 */ 333 mov.l @r15+, r10 /* restore r10 */
333 mov.l @r15+, r9 /* restore r9 */ 334 mov.l @r15+, r9 /* restore r9 */
334 mov.l @r15+, r8 /* restore r8 */ 335 mov.l @r15+, r8 /* restore r8 */