diff options
Diffstat (limited to 'firmware/drivers/lcd.S')
-rwxr-xr-x | firmware/drivers/lcd.S | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/firmware/drivers/lcd.S b/firmware/drivers/lcd.S index 8764d793c3..d9e7092c94 100755 --- a/firmware/drivers/lcd.S +++ b/firmware/drivers/lcd.S | |||
@@ -371,99 +371,4 @@ lcd_write_data: | |||
371 | nop /* 1(0/0) */ | 371 | nop /* 1(0/0) */ |
372 | bne .loop /* 2(0/0) */ | 372 | bne .loop /* 2(0/0) */ |
373 | rts | 373 | rts |
374 | #elif defined(IRIVER_H300_SERIES) | ||
375 | .section .icode,"ax",@progbits | ||
376 | |||
377 | .align 2 | ||
378 | .global lcd_write_data | ||
379 | .type lcd_write_data,@function | ||
380 | |||
381 | lcd_write_data: | ||
382 | move.l (4,%sp),%a0 /* data pointer */ | ||
383 | move.l (8,%sp),%d0 /* length in words */ | ||
384 | add.l %d0,%d0 /* words -> bytes */ | ||
385 | add.l %a0,%d0 /* -> end address */ | ||
386 | lea.l 0xf0000002,%a1 /* LCD data port */ | ||
387 | |||
388 | move.l %a0,%d1 | ||
389 | btst.l #1,%d1 /* already longword aligned? */ | ||
390 | beq.b .word1_end /* yes: skip initial word copy */ | ||
391 | |||
392 | move.w (%a0)+,(%a1) /* transfer initial word */ | ||
393 | |||
394 | .word1_end: /* now longword aligned */ | ||
395 | moveq.l #28,%d1 | ||
396 | add.l %a0,%d1 | ||
397 | and.l #0xFFFFFFF0,%d1 /* %d1 = first line bound + 16 */ | ||
398 | cmp.l %d1,%d0 /* at least one full line to send? */ | ||
399 | blo.b .long2_start /* no: skip to trailing longword handling */ | ||
400 | |||
401 | lea.l (-16,%sp),%sp /* free up some registers */ | ||
402 | movem.l %d2-%d4/%a2,(%sp) | ||
403 | |||
404 | subq.l #8,%d1 | ||
405 | subq.l #8,%d1 /* %d1 = first line bound */ | ||
406 | |||
407 | cmp.l %a0,%d1 /* any leading longwords? */ | ||
408 | bls.b .long1_end /* no: skip leading long loop */ | ||
409 | |||
410 | .long1_loop: | ||
411 | move.l (%a0)+,%d2 /* read longword */ | ||
412 | swap %d2 /* send data to LCD in correct order...*/ | ||
413 | move.w %d2,(%a1) | ||
414 | swap %d2 | ||
415 | move.w %d2,(%a1) | ||
416 | cmp.l %a0,%d1 /* run %a0 up to first line bound */ | ||
417 | bhi.b .long1_loop | ||
418 | |||
419 | .long1_end: | ||
420 | move.l %d0,%a2 | ||
421 | lea.l (-14,%a2),%a2 /* %a2 = end address - 14 (one line/pass) */ | ||
422 | |||
423 | /* burst-optimised line transfers */ | ||
424 | .line_loop: | ||
425 | movem.l (%a0),%d1-%d4 /* burst-read line */ | ||
426 | lea.l (16,%a0),%a0 /* increment address */ | ||
427 | swap %d1 /* send data to LCD in correct order... */ | ||
428 | move.w %d1,(%a1) | ||
429 | swap %d1 | ||
430 | move.w %d1,(%a1) | ||
431 | swap %d2 | ||
432 | move.w %d2,(%a1) | ||
433 | swap %d2 | ||
434 | move.w %d2,(%a1) | ||
435 | swap %d3 | ||
436 | move.w %d3,(%a1) | ||
437 | swap %d3 | ||
438 | move.w %d3,(%a1) | ||
439 | swap %d4 | ||
440 | move.w %d4,(%a1) | ||
441 | swap %d4 | ||
442 | move.w %d4,(%a1) | ||
443 | cmp.l %a0,%a2 /* run %a0 up to last line bound */ | ||
444 | bhi.b .line_loop | ||
445 | |||
446 | movem.l (%sp),%d2-%d4/%a2 | ||
447 | lea.l (16,%sp),%sp /* restore registers */ | ||
448 | |||
449 | .long2_start: | ||
450 | subq.l #2,%d0 /* account for handling 2 words per loop */ | ||
451 | cmp.l %a0,%d0 /* any (trailing longwords? */ | ||
452 | bls.b .long2_end /* no: skip trailing longword loop */ | ||
453 | |||
454 | .long2_loop: | ||
455 | move.l (%a0)+,%d1 /* read longword */ | ||
456 | swap %d1 /* send data to LCD in correct order */ | ||
457 | move.w %d1,(%a1) | ||
458 | swap %d1 | ||
459 | move.w %d1,(%a1) | ||
460 | cmp.l %a0,%d0 /* run %a0 up to last long bound */ | ||
461 | bhi.b .long2_loop | ||
462 | |||
463 | .long2_end: | ||
464 | blo.b .word2_end /* no final word: skip */ | ||
465 | move.w (%a0)+,(%a1) /* transfer final word */ | ||
466 | |||
467 | .word2_end: | ||
468 | rts | ||
469 | #endif | 374 | #endif |