summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/xlcd_scroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/xlcd_scroll.c')
-rw-r--r--apps/plugins/lib/xlcd_scroll.c143
1 files changed, 2 insertions, 141 deletions
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c
index f2fc71ea47..e0fead71be 100644
--- a/apps/plugins/lib/xlcd_scroll.c
+++ b/apps/plugins/lib/xlcd_scroll.c
@@ -396,77 +396,7 @@ void xlcd_scroll_up(int count)
396 { 396 {
397#if LCD_PIXELFORMAT == VERTICAL_PACKING 397#if LCD_PIXELFORMAT == VERTICAL_PACKING
398 398
399#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1) 399#if defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
400 asm (
401 "mov #0,r4 \n" /* x = 0 */
402 "mova .su_shifttbl,r0 \n" /* calculate jump destination for */
403 "mov.b @(r0,%[cnt]),%[cnt] \n" /* shift amount from table */
404 "bra .su_cloop \n" /* skip table */
405 "add r0,%[cnt] \n"
406
407 ".align 2 \n"
408 ".su_shifttbl: \n" /* shift jump offset table */
409 ".byte .su_shift0 - .su_shifttbl \n"
410 ".byte .su_shift1 - .su_shifttbl \n"
411 ".byte .su_shift2 - .su_shifttbl \n"
412 ".byte .su_shift3 - .su_shifttbl \n"
413 ".byte .su_shift4 - .su_shifttbl \n"
414 ".byte .su_shift5 - .su_shifttbl \n"
415 ".byte .su_shift6 - .su_shifttbl \n"
416 ".byte .su_shift7 - .su_shifttbl \n"
417
418 ".su_cloop: \n" /* repeat for every column */
419 "mov %[addr],r2 \n" /* get start address */
420 "mov #0,r3 \n" /* current_row = 0 */
421 "mov #0,r1 \n" /* fill with zero */
422
423 ".su_iloop: \n" /* repeat for all rows */
424 "sub %[wide],r2 \n" /* address -= width */
425 "mov.b @r2,r0 \n" /* get data byte */
426 "shll8 r1 \n" /* old data to 2nd byte */
427 "extu.b r0,r0 \n" /* extend unsigned */
428 "or r1,r0 \n" /* combine old data */
429 "jmp @%[cnt] \n" /* jump into shift "path" */
430 "extu.b r0,r1 \n" /* store data for next round */
431
432 ".su_shift6: \n" /* shift right by 0..7 bits */
433 "shll2 r0 \n"
434 "bra .su_shift0 \n"
435 "shlr8 r0 \n"
436 ".su_shift4: \n"
437 "shlr2 r0 \n"
438 ".su_shift2: \n"
439 "bra .su_shift0 \n"
440 "shlr2 r0 \n"
441 ".su_shift7: \n"
442 "shlr2 r0 \n"
443 ".su_shift5: \n"
444 "shlr2 r0 \n"
445 ".su_shift3: \n"
446 "shlr2 r0 \n"
447 ".su_shift1: \n"
448 "shlr r0 \n"
449 ".su_shift0: \n"
450
451 "mov.b r0,@r2 \n" /* store data */
452 "add #1,r3 \n" /* current_row++ */
453 "cmp/hi r3,%[rows] \n" /* current_row < bheight - shift ? */
454 "bt .su_iloop \n"
455
456 "add #1,%[addr] \n" /* start_address++ */
457 "add #1,r4 \n" /* x++ */
458 "cmp/hi r4,%[wide] \n" /* x < width ? */
459 "bt .su_cloop \n"
460 : /* outputs */
461 : /* inputs */
462 [addr]"r"(rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
463 [wide]"r"(LCD_FBWIDTH),
464 [rows]"r"(blocklen),
465 [cnt] "r"(bitcount)
466 : /* clobbers */
467 "r0", "r1", "r2", "r3", "r4"
468 );
469#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
470 asm ( 400 asm (
471 "move.l %[wide],%%d3\n" /* columns = width */ 401 "move.l %[wide],%%d3\n" /* columns = width */
472 402
@@ -590,76 +520,7 @@ void xlcd_scroll_down(int count)
590 { 520 {
591#if LCD_PIXELFORMAT == VERTICAL_PACKING 521#if LCD_PIXELFORMAT == VERTICAL_PACKING
592 522
593#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1) 523#if defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
594 asm (
595 "mov #0,r4 \n" /* x = 0 */
596 "mova .sd_shifttbl,r0 \n" /* calculate jump destination for */
597 "mov.b @(r0,%[cnt]),%[cnt] \n" /* shift amount from table */
598 "bra .sd_cloop \n" /* skip table */
599 "add r0,%[cnt] \n"
600
601 ".align 2 \n"
602 ".sd_shifttbl: \n" /* shift jump offset table */
603 ".byte .sd_shift0 - .sd_shifttbl \n"
604 ".byte .sd_shift1 - .sd_shifttbl \n"
605 ".byte .sd_shift2 - .sd_shifttbl \n"
606 ".byte .sd_shift3 - .sd_shifttbl \n"
607 ".byte .sd_shift4 - .sd_shifttbl \n"
608 ".byte .sd_shift5 - .sd_shifttbl \n"
609 ".byte .sd_shift6 - .sd_shifttbl \n"
610 ".byte .sd_shift7 - .sd_shifttbl \n"
611
612 ".sd_cloop: \n" /* repeat for every column */
613 "mov %[addr],r2 \n" /* get start address */
614 "mov #0,r3 \n" /* current_row = 0 */
615 "mov #0,r1 \n" /* fill with zero */
616
617 ".sd_iloop: \n" /* repeat for all rows */
618 "shlr8 r1 \n" /* shift right to get residue */
619 "mov.b @r2,r0 \n" /* get data byte */
620 "jmp @%[cnt] \n" /* jump into shift "path" */
621 "extu.b r0,r0 \n" /* extend unsigned */
622
623 ".sd_shift6: \n" /* shift left by 0..7 bits */
624 "shll8 r0 \n"
625 "bra .sd_shift0 \n"
626 "shlr2 r0 \n"
627 ".sd_shift4: \n"
628 "shll2 r0 \n"
629 ".sd_shift2: \n"
630 "bra .sd_shift0 \n"
631 "shll2 r0 \n"
632 ".sd_shift7: \n"
633 "shll2 r0 \n"
634 ".sd_shift5: \n"
635 "shll2 r0 \n"
636 ".sd_shift3: \n"
637 "shll2 r0 \n"
638 ".sd_shift1: \n"
639 "shll r0 \n"
640 ".sd_shift0: \n"
641
642 "or r0,r1 \n" /* combine with last residue */
643 "mov.b r1,@r2 \n" /* store data */
644 "add %[wide],r2 \n" /* address += width */
645 "add #1,r3 \n" /* current_row++ */
646 "cmp/hi r3,%[rows] \n" /* current_row < bheight - shift ? */
647 "bt .sd_iloop \n"
648
649 "add #1,%[addr] \n" /* start_address++ */
650 "add #1,r4 \n" /* x++ */
651 "cmp/hi r4,%[wide] \n" /* x < width ? */
652 "bt .sd_cloop \n"
653 : /* outputs */
654 : /* inputs */
655 [addr]"r"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
656 [wide]"r"(LCD_WIDTH),
657 [rows]"r"(blocklen),
658 [cnt] "r"(bitcount)
659 : /* clobbers */
660 "r0", "r1", "r2", "r3", "r4"
661 );
662#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
663 asm ( 524 asm (
664 "move.l %[wide],%%d3\n" /* columns = width */ 525 "move.l %[wide],%%d3\n" /* columns = width */
665 526