home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / testi / corsoasm / sorgenti6 / lezione10l2.s < prev    next >
Text File  |  1995-10-23  |  19KB  |  440 lines

  1.  
  2. ; Lezione10l2.s    Animazione "avanti/indietro" con il blitter
  3. ;        Tasto sinistro per uscire.
  4.  
  5.     SECTION    CiriCop,CODE
  6.  
  7. ;    Include    "DaWorkBench.s"    ; togliere il ; prima di salvare con "WO"
  8.  
  9. *****************************************************************************
  10.     include    "startup1.s"    ; Salva Copperlist Etc.
  11. *****************************************************************************
  12.  
  13.         ;5432109876543210
  14. DMASET    EQU    %1000001111000000    ; copper,bitplane,blitter DMA
  15.  
  16.  
  17. START:
  18.  
  19.     MOVE.L    #BITPLANE,d0    ; dove puntare
  20.     LEA    BPLPOINTERS,A1    ; puntatori COP
  21.     MOVEQ    #2-1,D1        ; numero di bitplanes
  22. POINTBP:
  23.     move.w    d0,6(a1)
  24.     swap    d0
  25.     move.w    d0,2(a1)
  26.     swap    d0
  27.     ADD.L    #40*256,d0    ; + lunghezza bitplane (qua e' alto 256 linee)
  28.     addq.w    #8,a1
  29.     dbra    d1,POINTBP
  30.  
  31.     lea    $dff000,a5        ; CUSTOM REGISTER in a5
  32.     MOVE.W    #DMASET,$96(a5)        ; DMACON - abilita bitplane, copper
  33.     move.l    #COPPERLIST,$80(a5)    ; Puntiamo la nostra COP
  34.     move.w    d0,$88(a5)        ; Facciamo partire la COP
  35.     move.w    #0,$1fc(a5)        ; Disattiva l'AGA
  36.     move.w    #$c00,$106(a5)        ; Disattiva l'AGA
  37.     move.w    #$11,$10c(a5)        ; Disattiva l'AGA
  38.  
  39. mouse:
  40.  
  41.     MOVE.L    #$1ff00,d1    ; bit per la selezione tramite AND
  42.     MOVE.L    #$13000,d2    ; linea da aspettare = $130
  43. Waity1:
  44.     MOVE.L    4(A5),D0    ; VPOSR e VHPOSR - $dff004/$dff006
  45.     ANDI.L    D1,D0        ; Seleziona solo i bit della pos. verticale
  46.     CMPI.L    D2,D0
  47.     BNE.S    Waity1
  48.  
  49.     bsr.s    Animazione    ; sposta i fotogrammi nella tabella
  50.     move.l    Frametab(pc),a0    ; Disegna il primo frame della tabella    
  51.     bsr.w    DisegnaFrame    ; disegna il frame
  52.  
  53.     btst    #6,$bfe001    ; tasto sinistro del mouse premuto?
  54.     bne.s    mouse        ; se no, torna a mouse
  55.     rts
  56.  
  57.  
  58. ;****************************************************************************
  59. ; Questa routine crea l'animazione, spostando gli indirizzi dei fotogrammi.
  60. ; Gli indirizzi scorrono in avanti o all'indietro a seconda della direzione
  61. ; dell'animazione.
  62. ;****************************************************************************
  63.  
  64. Animazione:
  65.     addq.b    #1,ContaAnim    ; queste tre istruzioni fanno si' che il
  66.     cmp.b    #10,ContaAnim   ; fotogramma venga cambiato una volta
  67.     bne.w    NonCambiare     ; si e 9 no.
  68.     clr.b    ContaAnim
  69.  
  70.     tst.b    Direzione    ; controlla flag direzione
  71.     beq.s    Avanti        ; se flag=0 va in avanti
  72.  
  73.     LEA    FRAMETAB(PC),a0 ; tabella dei fotogrammi
  74.     MOVE.L    4*4(a0),d0    ; salva l'ultimo indirizzo in d0
  75.  
  76.     MOVE.L    4*3(a0),4*4(a0)    ; sposta avanti gli altri indirizzi
  77.     MOVE.L    4*2(a0),4*3(a0)    ; Queste istruzioni "ruotano" gli indirizzi
  78.     MOVE.L    4(a0),4*2(a0)     ; della tabella.
  79.     MOVE.L    (a0),4(a0)
  80.     MOVE.L    d0,(a0)        ; metti l'ex ultimo indirizzo al primo posto
  81.  
  82.     CMP.L    #FRAME1,(a0)    ; abbiamo il primo frame in testa ?
  83.     BNE.S    AncoraIndietro    ; no, continua ad andare indietro
  84.     CLR.B    Direzione    ; si, devi cambiare direzione
  85. AncoraIndietro:
  86.     BRA.S    NonCambiare
  87.  
  88. Avanti:    LEA    FRAMETAB(PC),a0 ; tabella dei fotogrammi
  89.     MOVE.L    (a0),d0        ; salva il primo indirizzo in d0
  90.  
  91.     MOVE.L    4(a0),(a0)    ; sposta indietro gli altri indirizzi
  92.     MOVE.L    4*2(a0),4(a0)    ; Queste istruzioni "ruotano" gli indirizzi
  93.     MOVE.L    4*3(a0),4*2(a0) ; della tabella.
  94.     MOVE.L    4*4(a0),4*3(a0)
  95.     MOVE.L    d0,4*4(a0)    ; metti l'ex primo indirizzo all'ottavo posto
  96.  
  97.     CMP.L    #FRAME5,(A0)    ; abbiamo il primo frame in testa ?
  98.     BNE.S    AncoraAvanti    ; no, continua ad andare indietro
  99.     MOVE.B    #-1,Direzione    ; si, devi cambiare direzione
  100. AncoraAvanti:
  101.  
  102. NonCambiare:
  103.     rts
  104.  
  105. ; flag che indica la direzione dell'animazione
  106. Direzione:
  107.     dc.b    0
  108.  
  109. ContaAnim:
  110.     dc.b    0
  111.  
  112. ; Questa e` la tabella degli indirizzi dei fotogrammi. Gli indirizzi
  113. ; presenti nella tabella vengono "ruotati" all'interno della tabella dalla
  114. ; routine Animazione, in modo che il primo nella lista sia la prima volta il
  115. ; fotogramma1, la volta dopo il Fotogramma2, poi il 3,4,5 e di nuovo il
  116. ; primo, ciclicamente. In questo modo basta prendere l'indirizzo che sta
  117. ; all'inizio della tabella ogni volta dopo il "rimescolamento" per avere gli
  118. ; indirizzi dei fotogrammi in sequenza.
  119.  
  120. FRAMETAB:
  121.     DC.L    Frame1
  122.     DC.L    Frame2
  123.     DC.L    Frame3
  124.     DC.L    Frame4
  125.     DC.L    Frame5
  126.  
  127.  
  128. ;****************************************************************************
  129. ; Questa routine copia un frame di animazione sullo schermo.
  130. ; la posizione sullo schermo e le dimensioni dei frames sono costanti
  131. ; A0 - indirizzo sorgente
  132. ;****************************************************************************
  133.  
  134. ;               ,-~~-.___.
  135. ;              / ()=(()   \
  136. ;             (  |         0
  137. ;              \_,\, ,----'
  138. ;         ##XXXxxxxxxx
  139. ;                /  ---'~;
  140. ;               /    /~|-
  141. ;             =(   ~~  |
  142. ;       /~~~~~~~~~~~~~~~~~~~~~\
  143. ;      /_______________________\
  144. ;     /_________________________\
  145. ;    /___________________________\
  146. ;       |____________________|
  147. ;       |____________________| W<
  148. ;       |____________________|
  149. ;       |                    |
  150.  
  151. DisegnaFrame:
  152.     moveq    #2-1,d7            ; numero planes
  153.     lea    bitplane+80*40+6,a1    ; indirizzo destinazione
  154.  
  155. DisegnaLoop:
  156.     btst    #6,2(a5) ; dmaconr
  157. WBlit1:
  158.     btst    #6,2(a5) ; dmaconr - attendi che il blitter abbia finito
  159.     bne.s    wblit1
  160.  
  161.     move.l    #$ffffffff,$44(a5)    ; maschere
  162.     move.l    #$09f00000,$40(a5)    ; BLTCON0  e BLTCON1 (usa A+D)
  163.                     ; copia normale
  164.     move.w    #0,$64(a5)        ; BLTAMOD (=0)
  165.     move.w    #32,$66(a5)        ; BLTDMOD (40-8=32)
  166.     move.l    a0,$50(a5)        ; BLTAPT  puntatore sorgente
  167.     move.l    a1,$54(a5)        ; BLTDPT  puntatore destinazione
  168.     move.w    #(64*55)+4,$58(a5)    ; BLTSIZE (via al blitter !)
  169.                     ; larghezza 4 word
  170.                     ; altezza 55 linee
  171.  
  172.     lea    2*4*55(a0),a0        ; punta al prossimo plane sorgente
  173.                     ; ogni plane e` largo 4 words e alto
  174.                     ; 55 righe
  175.  
  176.     lea    40*256(a1),a1        ; punta al prossimo plane destinazione
  177.  
  178.     dbra    d7,DisegnaLoop
  179.  
  180.     rts
  181.  
  182. ;****************************************************************************
  183.  
  184.     SECTION    GRAPHIC,DATA_C
  185.  
  186. COPPERLIST:
  187.     dc.w    $8E,$2c81    ; DiwStrt
  188.     dc.w    $90,$2cc1    ; DiwStop
  189.     dc.w    $92,$38        ; DdfStart
  190.     dc.w    $94,$d0        ; DdfStop
  191.     dc.w    $102,0        ; BplCon1
  192.     dc.w    $104,0        ; BplCon2
  193.     dc.w    $108,0        ; Bpl1Mod
  194.     dc.w    $10a,0        ; Bpl2Mod
  195.  
  196.     dc.w    $100,$2200    ; bplcon0
  197.  
  198. BPLPOINTERS:
  199.     dc.w $e0,$0000,$e2,$0000    ;primo     bitplane
  200.     dc.w $e4,$0000,$e6,$0000
  201.  
  202.     dc.w    $180,$000    ; color0
  203.     dc.w    $182,$00b    ; color1
  204.     dc.w    $184,$cc0    ; color2
  205.     dc.w    $186,$b00    ; color3
  206.  
  207.     dc.w    $FFFF,$FFFE    ; Fine della copperlist
  208.  
  209. ;****************************************************************************
  210. ; Questi sono i frames che compongono l'animazione
  211.  
  212. Frame1:
  213.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  214.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  215.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  216.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  217.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  218.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  219.     dc.l    $3fffffcf,$fffff800,$7fffff87,$fffffc00,$7fffff03,$fffffc00
  220.     dc.l    $7ffffe01,$fffffc00,$fffffc00,$fffffe00,$fffff800,$7ffffe00
  221.     dc.l    $fffff000,$3ffffe00,$ffffff87,$fffffe00,$ffffff87,$fffffe00
  222.     dc.l    $ffffff87,$fffffe00,$ffffff87,$fffffe00,$ffffff87,$fffffe00
  223.     dc.l    $ffffff87,$fffffe00,$ffffff87,$fffffe00,$ffffff87,$fffffe00
  224.     dc.l    $7fffff87,$fffffc00,$7fffff87,$fffffc00,$7fffff87,$fffffc00
  225.     dc.l    $3fffff87,$fffff800,$3fffff87,$fffff800,$3fffffff,$fffff800
  226.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  227.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  228.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  229.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  230.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  231.     dc.l    $000003ff,$80000000
  232.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  233.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  234.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  235.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  236.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  237.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffcf,$fffff800
  238.     dc.l    $3fffffb7,$fffff800,$7fffff7b,$fffffc00,$7ffffefd,$fffffc00
  239.     dc.l    $7ffffdfe,$fffffc00,$fffffbff,$7ffffe00,$fffff7ff,$bffffe00
  240.     dc.l    $ffffefff,$dffffe00,$ffffe078,$1ffffe00,$ffffff7b,$fffffe00
  241.     dc.l    $ffffff7b,$fffffe00,$ffffff7b,$fffffe00,$ffffff7b,$fffffe00
  242.     dc.l    $ffffff7b,$fffffe00,$ffffff7b,$fffffe00,$ffffff7b,$fffffe00
  243.     dc.l    $7fffff7b,$fffffc00,$7fffff7b,$fffffc00,$7fffff7b,$fffffc00
  244.     dc.l    $3fffff7b,$fffff800,$3fffff7b,$fffff800,$3fffff03,$fffff800
  245.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  246.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  247.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  248.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  249.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  250.     dc.l    $000003ff,$80000000
  251.  
  252.  
  253. Frame2:
  254.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  255.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  256.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  257.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  258.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  259.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  260.     dc.l    $3fffffff,$fffff800,$7fffffff,$fffffc00,$7fffffff,$fffffc00
  261.     dc.l    $7fffff80,$3ffffc00,$ffffffc0,$3ffffe00,$ffffffe0,$3ffffe00
  262.     dc.l    $fffffff0,$3ffffe00,$ffffffe0,$3ffffe00,$ffffffc0,$3ffffe00
  263.     dc.l    $ffffff82,$3ffffe00,$ffffff07,$3ffffe00,$fffffe0f,$bffffe00
  264.     dc.l    $fffffc1f,$fffffe00,$fffff83f,$fffffe00,$fffff07f,$fffffe00
  265.     dc.l    $7fffe0ff,$fffffc00,$7ffff1ff,$fffffc00,$7ffffbff,$fffffc00
  266.     dc.l    $3fffffff,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  267.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  268.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  269.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  270.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  271.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  272.     dc.l    $000003ff,$80000000
  273.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  274.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  275.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  276.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  277.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  278.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  279.     dc.l    $3fffffff,$fffff800,$7fffffff,$fffffc00,$7ffffe00,$1ffffc00
  280.     dc.l    $7ffffe7f,$dffffc00,$ffffff3f,$dffffe00,$ffffff9f,$dffffe00
  281.     dc.l    $ffffffcf,$dffffe00,$ffffff9f,$dffffe00,$ffffff3f,$dffffe00
  282.     dc.l    $fffffe7d,$dffffe00,$fffffcf8,$dffffe00,$fffff9f2,$5ffffe00
  283.     dc.l    $fffff3e7,$1ffffe00,$ffffe7cf,$9ffffe00,$ffffcf9f,$fffffe00
  284.     dc.l    $7fff9f3f,$fffffc00,$7fffce7f,$fffffc00,$7fffe4ff,$fffffc00
  285.     dc.l    $3ffff1ff,$fffff800,$3ffffbff,$fffff800,$3fffffff,$fffff800
  286.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  287.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  288.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  289.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  290.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  291.     dc.l    $000003ff,$80000000
  292.  
  293.  
  294. Frame3:
  295.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  296.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  297.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  298.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  299.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  300.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  301.     dc.l    $3fffffff,$fffff800,$7fffffff,$fffffc00,$7ffffffd,$fffffc00
  302.     dc.l    $7ffffffc,$fffffc00,$fffffffc,$7ffffe00,$fffffffc,$3ffffe00
  303.     dc.l    $fffffffc,$1ffffe00,$ffff8000,$0ffffe00,$ffff8000,$07fffe00
  304.     dc.l    $ffff8000,$07fffe00,$ffff8000,$0ffffe00,$fffffffc,$1ffffe00
  305.     dc.l    $fffffffc,$3ffffe00,$fffffffc,$7ffffe00,$fffffffc,$fffffe00
  306.     dc.l    $7ffffffd,$fffffc00,$7fffffff,$fffffc00,$7fffffff,$fffffc00
  307.     dc.l    $3fffffff,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  308.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  309.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  310.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  311.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  312.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  313.     dc.l    $000003ff,$80000000
  314.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  315.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  316.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  317.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  318.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  319.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  320.     dc.l    $3fffffff,$fffff800,$7ffffff9,$fffffc00,$7ffffffa,$fffffc00
  321.     dc.l    $7ffffffb,$7ffffc00,$fffffffb,$bffffe00,$fffffffb,$dffffe00
  322.     dc.l    $ffff0003,$effffe00,$ffff7fff,$f7fffe00,$ffff7fff,$fbfffe00
  323.     dc.l    $ffff7fff,$fbfffe00,$ffff7fff,$f7fffe00,$ffff0003,$effffe00
  324.     dc.l    $fffffffb,$dffffe00,$fffffffb,$bffffe00,$fffffffb,$7ffffe00
  325.     dc.l    $7ffffffa,$fffffc00,$7ffffff9,$fffffc00,$7fffffff,$fffffc00
  326.     dc.l    $3fffffff,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  327.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  328.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  329.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  330.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  331.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  332.     dc.l    $000003ff,$80000000
  333.  
  334.  
  335. Frame4:
  336.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  337.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  338.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  339.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  340.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  341.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffff,$fffff800
  342.     dc.l    $3fffffff,$fffff800,$7ffffbff,$fffffc00,$7ffff1ff,$fffffc00
  343.     dc.l    $7fffe0ff,$fffffc00,$fffff07f,$fffffe00,$fffff83f,$fffffe00
  344.     dc.l    $fffffc1f,$fffffe00,$fffffe0f,$bffffe00,$ffffff07,$3ffffe00
  345.     dc.l    $ffffff82,$3ffffe00,$ffffffc0,$3ffffe00,$ffffffe0,$3ffffe00
  346.     dc.l    $fffffff0,$3ffffe00,$ffffffe0,$3ffffe00,$ffffffc0,$3ffffe00
  347.     dc.l    $7fffff80,$3ffffc00,$7fffffff,$fffffc00,$7fffffff,$fffffc00
  348.     dc.l    $3fffffff,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  349.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  350.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  351.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  352.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  353.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  354.     dc.l    $000003ff,$80000000
  355.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  356.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  357.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  358.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  359.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  360.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3ffffbff,$fffff800
  361.     dc.l    $3ffff1ff,$fffff800,$7fffe4ff,$fffffc00,$7fffce7f,$fffffc00
  362.     dc.l    $7fff9f3f,$fffffc00,$ffffcf9f,$fffffe00,$ffffe7cf,$9ffffe00
  363.     dc.l    $fffff3e7,$1ffffe00,$fffff9f2,$5ffffe00,$fffffcf8,$dffffe00
  364.     dc.l    $fffffe7d,$dffffe00,$ffffff3f,$dffffe00,$ffffff9f,$dffffe00
  365.     dc.l    $ffffffcf,$dffffe00,$ffffff9f,$dffffe00,$ffffff3f,$dffffe00
  366.     dc.l    $7ffffe7f,$dffffc00,$7ffffe00,$1ffffc00,$7fffffff,$fffffc00
  367.     dc.l    $3fffffff,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  368.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  369.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  370.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  371.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  372.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  373.     dc.l    $000003ff,$80000000
  374.  
  375.  
  376. Frame5:
  377.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  378.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  379.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  380.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  381.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  382.     dc.l    $1fffffff,$fffff000,$3fffffff,$fffff800,$3fffffc3,$fffff800
  383.     dc.l    $3fffffc3,$fffff800,$7fffffc3,$fffffc00,$7fffffc3,$fffffc00
  384.     dc.l    $7fffffc3,$fffffc00,$ffffffc3,$fffffe00,$ffffffc3,$fffffe00
  385.     dc.l    $ffffffc3,$fffffe00,$ffffffc3,$fffffe00,$ffffffc3,$fffffe00
  386.     dc.l    $ffffffc3,$fffffe00,$ffffffc3,$fffffe00,$ffffffc3,$fffffe00
  387.     dc.l    $fffff800,$1ffffe00,$fffffc00,$3ffffe00,$fffffe00,$7ffffe00
  388.     dc.l    $7fffff00,$fffffc00,$7fffff81,$fffffc00,$7fffffc3,$fffffc00
  389.     dc.l    $3fffffe7,$fffff800,$3fffffff,$fffff800,$3fffffff,$fffff800
  390.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  391.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  392.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  393.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  394.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  395.     dc.l    $000003ff,$80000000
  396.     dc.l    $000003ff,$80000000,$00001fff,$f0000000,$0000ffff,$fe000000
  397.     dc.l    $0003ffff,$ff800000,$0007ffff,$ffc00000,$001fffff,$fff00000
  398.     dc.l    $003fffff,$fff80000,$007fffff,$fffc0000,$00ffffff,$fffe0000
  399.     dc.l    $01ffffff,$ffff0000,$03ffffff,$ffff8000,$07ffffff,$ffffc000
  400.     dc.l    $07ffffff,$ffffc000,$0fffffff,$ffffe000,$1fffffff,$fffff000
  401.     dc.l    $1fffffff,$fffff000,$3fffff81,$fffff800,$3fffffbd,$fffff800
  402.     dc.l    $3fffffbd,$fffff800,$7fffffbd,$fffffc00,$7fffffbd,$fffffc00
  403.     dc.l    $7fffffbd,$fffffc00,$ffffffbd,$fffffe00,$ffffffbd,$fffffe00
  404.     dc.l    $ffffffbd,$fffffe00,$ffffffbd,$fffffe00,$ffffffbd,$fffffe00
  405.     dc.l    $ffffffbd,$fffffe00,$ffffffbd,$fffffe00,$fffff03c,$0ffffe00
  406.     dc.l    $fffff7ff,$effffe00,$fffffbff,$dffffe00,$fffffdff,$bffffe00
  407.     dc.l    $7ffffeff,$7ffffc00,$7fffff7e,$fffffc00,$7fffffbd,$fffffc00
  408.     dc.l    $3fffffdb,$fffff800,$3fffffe7,$fffff800,$3fffffff,$fffff800
  409.     dc.l    $1fffffff,$fffff000,$1fffffff,$fffff000,$0fffffff,$ffffe000
  410.     dc.l    $07ffffff,$ffffc000,$07ffffff,$ffffc000,$03ffffff,$ffff8000
  411.     dc.l    $01ffffff,$ffff0000,$00ffffff,$fffe0000,$007fffff,$fffc0000
  412.     dc.l    $003fffff,$fff80000,$001fffff,$fff00000,$0007ffff,$ffc00000
  413.     dc.l    $0003ffff,$ff800000,$0000ffff,$fe000000,$00001fff,$f0000000
  414.     dc.l    $000003ff,$80000000
  415.  
  416. ;****************************************************************************
  417.  
  418.     SECTION    bitplane,BSS_C
  419.  
  420. BITPLANE:
  421.     ds.b    40*256        ; 2 bitplanes
  422.     ds.b    40*256
  423.  
  424. ;****************************************************************************
  425.  
  426.     end
  427.  
  428. In questo esempio mostriamo un animazione del tipo "avanti/indierto" realizzata
  429. con il blitter. L'animazione e` costituita da 5 fotogrammi. Questi fotogrammi
  430. vanno mostrati in un primo momento dal primo fino all'ultimo e subito dopo
  431. in ordine inverso fino a tornare al primo.
  432. L'ordine dunque e` il seguente: 1-2-3-4-5-4-3-2-1-2-3- ecc.
  433. Per realizzare quest'ordine abbiamo una routine di animazione che in base
  434. allo stato di un flag fa scorrere gli indirizzi nella tabella in avanti o
  435. all'indietro. Quando si il primo o l'ultimo fotogramma raggiungono il primo
  436. posto della tabella lo stato del flag viene invertito, determinando
  437. l'inversione della direzione di animazione.
  438. La routine di disegno e` identica a quella di lezione10l1.s
  439.  
  440.