improved animations
petaflot

petaflot commited on 2019-08-27 18:26:33
Showing 2 changed files, with 29 additions and 30 deletions.

... ...
@@ -461,10 +461,12 @@ ANIM_FADE_DOWN:
461 461
 ; fade up and down animation, bulb and frame are in opposite phase
462 462
 ; input: -
463 463
 ; output: -
464
-; changes: X, FRAME, CNT, BULB, BORDER, TMP, TMP2
464
+; changes: X, FRAME, CNT, DATA, BULB, BORDER, TMP, TMP2
465 465
 INVERTED_FADE:
466
-; fade up
467 466
         ;rcall   CLEAR                   ; clear
467
+        ldi     DATA,0xf
468
+        sts     FRAME+41,DATA           ; set filament pixel
469
+
468 470
         ldi     BORDER,15               ; start bright
469 471
         ldi     BULB,0                  ; start dark
470 472
 INVERTED_FADE_BACK:;EVEN                     ; relative to the bulb
... ...
@@ -473,8 +475,8 @@ INVERTED_FADE_BACK:;EVEN                     ; relative to the bulb
473 475
         ldi     TMP,10                  ; show frame 60 ms
474 476
         rcall   OUT_FRAME_TIME
475 477
         dec     BORDER                  ; fade down, 0-27
476
-        inc     BULB                    ; fade up, 28-41
477 478
         cpi     BORDER,255              ; loop until full off
479
+        inc     BULB                    ; fade up, 28-41
478 480
         cpi     BULB,15                 ; loop until almost full on
479 481
         brne    INVERTED_FADE_BACK
480 482
 INVERTED_FADE_FORTH:;ODD
... ...
@@ -483,8 +485,8 @@ INVERTED_FADE_FORTH:;ODD
483 485
         ldi     TMP,10                  ; show frame 60 ms
484 486
         rcall   OUT_FRAME_TIME
485 487
         inc     BORDER                  ; fade up, 28-41
486
-        dec     BULB                    ; fade down, 0-27
487 488
         cpi     BORDER,15               ; loop until almost full on
489
+        dec     BULB                    ; fade down, 0-27
488 490
         cpi     BULB,255                ; loop until full off
489 491
         brne    INVERTED_FADE_FORTH
490 492
 ; done
... ...
@@ -516,6 +518,8 @@ ANIM_FRAMEBLINK:
516 518
 ; changes: X, FRAME, CNT, BULB, TMP, TMP2
517 519
 ANIM_BULBFAST:
518 520
         rcall   CLEAR
521
+        ldi     DATA,0xf
522
+        sts     FRAME+41,DATA           ; set filament pixel
519 523
 ; off
520 524
         ldi     BULB,0                ; minimum color
521 525
         rcall   BULB_COLOR            ; paint
... ...
@@ -535,6 +539,8 @@ ANIM_BULBFAST:
535 539
 ; changes: X, FRAME, CNT, BULB, TMP, TMP2
536 540
 ANIM_BULBSLOW:
537 541
         rcall   CLEAR
542
+        ldi     DATA,0xf
543
+        sts     FRAME+41,DATA           ; set filament pixel
538 544
 ; off
539 545
         ldi     BULB,0                ; minimum color
540 546
         rcall   BULB_COLOR            ; paint
... ...
@@ -651,7 +657,7 @@ ANIM_RUN_LOOP:
651 657
         ldi     TMP,10                  ; show frame 60 ms
652 658
         rcall   OUT_FRAME_TIME
653 659
         inc     CNT                     ; next pixel
654
-        cpi     CNT,43                  ; loop until after last pixel
660
+        cpi     CNT,41                  ; loop until after last pixel
655 661
         brne    ANIM_RUN_LOOP
656 662
 ; done
657 663
         ret
... ...
@@ -663,7 +669,7 @@ ANIM_RUN_LOOP:
663 669
 ; output: -
664 670
 ; changes: X, FRAME, CNT, DATA, TMP, TMP2
665 671
 ANIM_BW_RUN:
666
-        ldi     CNT,42                  ; start after last pixel
672
+        ldi     CNT,40                  ; start after last pixel
667 673
 ANIM_BW_RUN_LOOP:
668 674
         rcall   CLEAR                   ; clear
669 675
         ldi     DATA,15                 ; current pixel full on
... ...
@@ -757,52 +763,44 @@ MODE_READ_NOT_0_TO_1:
757 763
 ANIM_TAB:
758 764
         .dw     ANIM_FRAMEBLINK
759 765
         .dw     5
760
-        .dw     ANIM_BULBFAST
766
+        .dw     ANIM_BULBSLOW
761 767
         .dw     3
762 768
         .dw     ANIM_WORM
763 769
         .dw     1
764 770
         .dw     ANIM_IDLE
765
-        .dw     10
771
+        .dw     20
772
+        .dw     ANIM_BW_WORM
773
+        .dw     1
774
+        .dw     ANIM_RUN
775
+        .dw     1
766 776
         .dw     ANIM_BW_RUN
767
-        .dw     4
777
+        .dw     1
778
+        .dw     ANIM_WORM
779
+        .dw     1
768 780
         .dw     ANIM_IDLE
769 781
         .dw     10
770
-        ;.dw     ANIM_FADE
771
-        ;.dw     5
772
-        .dw     ANIM_BW_WORM
773
-        .dw     1
774 782
         .dw     INVERTED_FADE
775
-        .dw     15
783
+        .dw     5
776 784
         .dw     ANIM_IDLE
777 785
         .dw     20
778
-        ;.dw     ANIM_WOBBLE
779
-        ;.dw     5
780
-        ;.dw     ANIM_RUN
781
-        ;.dw     3
782
-        .dw     ANIM_WORM
783
-        .dw     1
784 786
         .dw     ANIM_FLICKER
785 787
         .dw     10
786
-        .dw     ANIM_BW_WORM
787
-        .dw     1
788 788
         .dw     ANIM_IDLE
789 789
         .dw     20
790 790
         .dw     ANIM_FRAMEBLINK
791
+        .dw     1
792
+        .dw     ANIM_BULBFAST
791 793
         .dw     5
792
-        .dw     ANIM_IDLE
793
-        .dw     20
794 794
         .dw     ANIM_FRAMEBLINK
795
-        .dw     5
796
-        .dw     ANIM_BULBSLOW
797
-        .dw     3
795
+        .dw     1
798 796
         .dw     ANIM_IDLE
799 797
         .dw     20
800
-        .dw     ANIM_WORM
801
-        .dw     1
802 798
         .dw     INVERTED_FADE
803
-        .dw     15
799
+        .dw     5
804 800
         .dw     ANIM_IDLE
805 801
         .dw     20
802
+        ;.dw     ANIM_WOBBLE
803
+        ;.dw     5
806 804
 ANIM_TAB_END:
807 805
 
808 806
 
... ...
@@ -0,0 +1 @@
1
+make prog_auto
0 2