Stefan Schuermans commited on 2019-08-04 11:50:39
Showing 1 changed files, with 0 additions and 223 deletions.
... | ... |
@@ -321,65 +321,6 @@ SET_PIXEL_END: |
321 | 321 |
|
322 | 322 |
|
323 | 323 |
|
324 |
-; draw worm |
|
325 |
-; input: CNT = head of worm (0..55) |
|
326 |
-; output: - |
|
327 |
-; changes: X, FRAME, TMP, DATA |
|
328 |
-; time: short |
|
329 |
-DRAW_WORM: |
|
330 |
- cpi CNT,56 ; invalid head pos -> done |
|
331 |
- brsh DRAW_WORM_END |
|
332 |
- ldi XL,low(FRAME)+1 ; ptr to before head |
|
333 |
- add XL,CNT ; XH not there on ATtiny2313 |
|
334 |
- ldi DATA,15 ; head is full on |
|
335 |
- cpi CNT,42 ; head pos in frame -> go |
|
336 |
- brlo DRAW_WORM_LOOP |
|
337 |
- mov TMP,CNT ; TMP := invisible pixels |
|
338 |
- subi TMP,41 |
|
339 |
- sub XL,TMP ; skip invisible pixels |
|
340 |
- sub DATA,TMP ; XH not there on ATtiny2313 |
|
341 |
-DRAW_WORM_LOOP: |
|
342 |
- st -X,DATA ; set pixel, go back |
|
343 |
- cpi XL,low(FRAME) ; 1st pixel -> done |
|
344 |
- breq DRAW_WORM_END ; XH not there on ATtiny2313 |
|
345 |
- dec DATA ; next pixel darker |
|
346 |
- brne DRAW_WORM_LOOP ; loop |
|
347 |
-DRAW_WORM_END: |
|
348 |
-; done |
|
349 |
- ret |
|
350 |
- |
|
351 |
- |
|
352 |
- |
|
353 |
-; draw backwards worm |
|
354 |
-; input: CNT = tail of worm (0..55) |
|
355 |
-; output: - |
|
356 |
-; changes: X, FRAME, TMP, DATA |
|
357 |
-; time: short |
|
358 |
-DRAW_BW_WORM: |
|
359 |
- cpi CNT,56 ; invalid tail pos -> done |
|
360 |
- brsh DRAW_BW_WORM_END |
|
361 |
- ldi XL,low(FRAME)+1 ; ptr to before tail |
|
362 |
- add XL,CNT ; XH not there on ATtiny2313 |
|
363 |
- ldi DATA,1 ; tail is minimum on |
|
364 |
- cpi CNT,42 ; tail pos in frame -> go |
|
365 |
- brlo DRAW_BW_WORM_LOOP |
|
366 |
- mov TMP,CNT ; TMP := invisible pixels |
|
367 |
- subi TMP,41 |
|
368 |
- sub XL,TMP ; skip invisible pixels |
|
369 |
- add DATA,TMP ; XH not there on ATtiny2313 |
|
370 |
-DRAW_BW_WORM_LOOP: |
|
371 |
- st -X,DATA ; set pixel, go back |
|
372 |
- cpi XL,low(FRAME) ; 1st pixel -> done |
|
373 |
- breq DRAW_BW_WORM_END ; XH not there on ATtiny2313 |
|
374 |
- inc DATA ; next pixel brighter |
|
375 |
- cpi DATA,16 ; loop |
|
376 |
- brne DRAW_BW_WORM_LOOP |
|
377 |
-DRAW_BW_WORM_END: |
|
378 |
-; done |
|
379 |
- ret |
|
380 |
- |
|
381 |
- |
|
382 |
- |
|
383 | 324 |
; blink animation |
384 | 325 |
; input: - |
385 | 326 |
; output: - |
... | ... |
@@ -427,158 +368,6 @@ ANIM_FADE_DOWN: |
427 | 368 |
|
428 | 369 |
|
429 | 370 |
|
430 |
-; flicker animation |
|
431 |
-; input: - |
|
432 |
-; output: - |
|
433 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
434 |
-ANIM_FLICKER: |
|
435 |
-; even pixels |
|
436 |
- rcall CLEAR ; clear |
|
437 |
- ldi DATA,15 ; even pixels to maximum |
|
438 |
- ldi CNT,0 |
|
439 |
-ANIM_FLICKER_EVEN: |
|
440 |
- rcall SET_PIXEL |
|
441 |
- subi CNT,-2 ; move two pixels |
|
442 |
- cpi CNT,42 ; loop |
|
443 |
- brlo ANIM_FLICKER_EVEN |
|
444 |
- ldi TMP,40 ; show frame 240 ms |
|
445 |
- rcall OUT_FRAME_TIME |
|
446 |
-; odd pixels |
|
447 |
- rcall CLEAR ; clear |
|
448 |
- ldi DATA,15 ; odd pixels to maximum |
|
449 |
- ldi CNT,1 |
|
450 |
-ANIM_FLICKER_ODD: |
|
451 |
- rcall SET_PIXEL |
|
452 |
- subi CNT,-2 ; move two pixels |
|
453 |
- cpi CNT,42 ; loop |
|
454 |
- brlo ANIM_FLICKER_ODD |
|
455 |
- ldi TMP,40 ; show frame 240 ms |
|
456 |
- rcall OUT_FRAME_TIME |
|
457 |
-; done |
|
458 |
- ret |
|
459 |
- |
|
460 |
- |
|
461 |
- |
|
462 |
-; wobble animation |
|
463 |
-; input: - |
|
464 |
-; output: - |
|
465 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
466 |
-ANIM_WOBBLE: |
|
467 |
-; even pixels up, odd pixels down |
|
468 |
- ldi DATA,0 ; even pixels start dark |
|
469 |
-ANIM_WOBBLE_UP: |
|
470 |
- ldi CNT,0 |
|
471 |
-ANIM_WOBBLE_UP_DRAW: |
|
472 |
- rcall SET_PIXEL |
|
473 |
- inc CNT ; next pixel |
|
474 |
- ldi TMP,0x0F ; invert color |
|
475 |
- eor DATA,TMP |
|
476 |
- cpi CNT,42 ; loop |
|
477 |
- brlo ANIM_WOBBLE_UP_DRAW |
|
478 |
- ldi TMP,10 ; show frame 60 ms |
|
479 |
- rcall OUT_FRAME_TIME |
|
480 |
- inc DATA ; next color: brighter |
|
481 |
- cpi DATA,16 |
|
482 |
- brlo ANIM_WOBBLE_UP |
|
483 |
-; even pixels down, odd pixels up |
|
484 |
- ldi DATA,15 ; even pixels start full |
|
485 |
-ANIM_WOBBLE_DOWN: |
|
486 |
- ldi CNT,0 |
|
487 |
-ANIM_WOBBLE_DOWN_DRAW: |
|
488 |
- rcall SET_PIXEL |
|
489 |
- inc CNT ; next pixel |
|
490 |
- ldi TMP,0x0F ; invert color |
|
491 |
- eor DATA,TMP |
|
492 |
- cpi CNT,42 ; loop |
|
493 |
- brlo ANIM_WOBBLE_DOWN_DRAW |
|
494 |
- ldi TMP,10 ; show frame 60 ms |
|
495 |
- rcall OUT_FRAME_TIME |
|
496 |
- dec DATA ; next color: darker |
|
497 |
- cpi DATA,16 |
|
498 |
- brlo ANIM_WOBBLE_DOWN |
|
499 |
-; done |
|
500 |
- ret |
|
501 |
- |
|
502 |
- |
|
503 |
- |
|
504 |
-; run animation |
|
505 |
-; input: - |
|
506 |
-; output: - |
|
507 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
508 |
-ANIM_RUN: |
|
509 |
- ldi CNT,255 ; start before 1st pixel |
|
510 |
-ANIM_RUN_LOOP: |
|
511 |
- rcall CLEAR ; clear |
|
512 |
- ldi DATA,15 ; current pixel full on |
|
513 |
- rcall SET_PIXEL |
|
514 |
- ldi TMP,10 ; show frame 60 ms |
|
515 |
- rcall OUT_FRAME_TIME |
|
516 |
- inc CNT ; next pixel |
|
517 |
- cpi CNT,43 ; loop until after last pixel |
|
518 |
- brne ANIM_RUN_LOOP |
|
519 |
-; done |
|
520 |
- ret |
|
521 |
- |
|
522 |
- |
|
523 |
- |
|
524 |
-; backwards run animation |
|
525 |
-; input: - |
|
526 |
-; output: - |
|
527 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
528 |
-ANIM_BW_RUN: |
|
529 |
- ldi CNT,42 ; start after last pixel |
|
530 |
-ANIM_BW_RUN_LOOP: |
|
531 |
- rcall CLEAR ; clear |
|
532 |
- ldi DATA,15 ; current pixel full on |
|
533 |
- rcall SET_PIXEL |
|
534 |
- ldi TMP,10 ; show frame 60 ms |
|
535 |
- rcall OUT_FRAME_TIME |
|
536 |
- dec CNT ; previous pixel |
|
537 |
- cpi CNT,255 ; loop until before 1st pixel |
|
538 |
- brne ANIM_BW_RUN_LOOP |
|
539 |
-; done |
|
540 |
- ret |
|
541 |
- |
|
542 |
- |
|
543 |
- |
|
544 |
-; worm animation |
|
545 |
-; input: - |
|
546 |
-; output: - |
|
547 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
548 |
-ANIM_WORM: |
|
549 |
- ldi CNT,255 ; worm starts before 1st pixel |
|
550 |
-ANIM_WORM_LOOP: |
|
551 |
- rcall CLEAR ; draw worm |
|
552 |
- rcall DRAW_WORM |
|
553 |
- ldi TMP,10 ; show frame 60 ms |
|
554 |
- rcall OUT_FRAME_TIME |
|
555 |
- inc CNT ; advance worm |
|
556 |
- cpi CNT,57 ; loop until has exits |
|
557 |
- brne ANIM_WORM_LOOP |
|
558 |
-; done |
|
559 |
- ret |
|
560 |
- |
|
561 |
- |
|
562 |
- |
|
563 |
-; backwards worm animation |
|
564 |
-; input: - |
|
565 |
-; output: - |
|
566 |
-; changes: X, FRAME, CNT, DATA, TMP, TMP2 |
|
567 |
-ANIM_BW_WORM: |
|
568 |
- ldi CNT,56 ; worm starts behind frame |
|
569 |
- ; head not yet visible |
|
570 |
-ANIM_BW_WORM_LOOP: |
|
571 |
- rcall CLEAR ; draw backwards worm |
|
572 |
- rcall DRAW_BW_WORM |
|
573 |
- ldi TMP,10 ; show frame 60 ms |
|
574 |
- rcall OUT_FRAME_TIME |
|
575 |
- dec CNT ; advance worm backwards |
|
576 |
- cpi CNT,254 ; loop until worm has exited |
|
577 |
- brne ANIM_BW_WORM_LOOP |
|
578 |
-; done |
|
579 |
- ret |
|
580 |
- |
|
581 |
- |
|
582 | 371 |
; movie data format |
583 | 372 |
; movie = frame ... frame end |
584 | 373 |
; frame = 0x0_ ... -> plain frame |
... | ... |
@@ -795,20 +584,8 @@ ANIM_TAB: |
795 | 584 |
.INCLUDE "movie_tab.inc" |
796 | 585 |
.dw ANIM_BLINK |
797 | 586 |
.dw 3 |
798 |
- .dw ANIM_WORM |
|
799 |
- .dw 3 |
|
800 |
- .dw ANIM_FLICKER |
|
801 |
- .dw 10 |
|
802 |
- .dw ANIM_BW_RUN |
|
803 |
- .dw 3 |
|
804 | 587 |
.dw ANIM_FADE |
805 | 588 |
.dw 2 |
806 |
- .dw ANIM_BW_WORM |
|
807 |
- .dw 3 |
|
808 |
- .dw ANIM_WOBBLE |
|
809 |
- .dw 5 |
|
810 |
- .dw ANIM_RUN |
|
811 |
- .dw 3 |
|
812 | 589 |
ANIM_TAB_END: |
813 | 590 |
|
814 | 591 |
|
815 | 592 |