home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / testi / corsoasm / sorgenti9 / lezione15c3.s < prev    next >
Text File  |  1995-04-26  |  16KB  |  420 lines

  1.  
  2. ; Lezione15c3.s        - Una prima prova di fade AGA a 24bit. Precalcola
  3. ;              il fade in una tabella.
  4.  
  5.     SECTION    AgaRulez,CODE
  6.  
  7. ;    Include    "DaWorkBench.s"    ; togliere il ; prima di salvare con "WO"
  8.  
  9. *****************************************************************************
  10.     include    "startup2.s"    ; Salva Copperlist Etc.
  11. *****************************************************************************
  12.  
  13.         ;5432109876543210
  14. DMASET    EQU    %1000001110000000    ; copper, bitplane DMA
  15.  
  16. WaitDisk    EQU    30    ; 50-150 al salvataggio (secondo i casi)
  17.  
  18. START:
  19.  
  20. ;    Puntiamo la pic AGA
  21.  
  22.     MOVE.L    #PICTURE,d0
  23.     LEA    BPLPOINTERS,A1    
  24.     MOVEQ    #8-1,D7        ; num of bitplanes -1
  25. POINTB:
  26.     move.w    d0,6(a1)
  27.     swap    d0
  28.     move.w    d0,2(a1)
  29.     swap    d0
  30.     addi.l    #40*256,d0    ; lenght of bitplane
  31.     addq.w    #8,a1
  32.     dbra    d7,POINTB    ; Rifai D7 volte (D7=num of bitplanes)
  33.  
  34.     bsr.w    FADE256PRECALC    ; Precalcola i valori di tutto il fade, per
  35.                 ; un totale di 256 colori.l in 256 passaggi dal
  36.                 ; nero al colore pieno, ossia 4*256*256 bytes
  37.                 ; di tabella: 262144 bytes precalcolati!!!
  38.  
  39.     MOVE.W    #DMASET,$96(a5)        ; DMACON - abilita bitplane, copper
  40.     move.l    #CopList,$80(a5)    ; Puntiamo la nostra COP
  41.     move.w    d0,$88(a5)        ; Facciamo partire la COP
  42.     move.w    #0,$1fc(a5)        ; Fmode azzerato, burst normale
  43.     move.w    #$c00,$106(a5)        ; BPLCON3 resettato
  44.     move.w    #$11,$10c(a5)        ; BPLCON4 resettato
  45.  
  46. LOOP:
  47.     MOVE.L    #$1ff00,d1    ; bit per la selezione tramite AND
  48.     MOVE.L    #$11000,d2    ; linea da aspettare = $110
  49. Waity1:
  50.     MOVE.L    4(A5),D0    ; VPOSR e VHPOSR - $dff004/$dff006
  51.     ANDI.L    D1,D0        ; Seleziona solo i bit della pos. verticale
  52.     CMPI.L    D2,D0        ; aspetta la linea $110
  53.     BNE.S    Waity1
  54.  
  55.     bsr.s    MainFadeInOut    ; Routine che sfuma dal nero al colore pieno
  56.                 ; e viceversa.
  57.  
  58.     MOVE.L    #$1ff00,d1    ; bit per la selezione tramite AND
  59.     MOVE.L    #$11000,d2    ; linea da aspettare = $110
  60. Aspetta:
  61.     MOVE.L    4(A5),D0    ; VPOSR e VHPOSR - $dff004/$dff006
  62.     ANDI.L    D1,D0        ; Seleziona solo i bit della pos. verticale
  63.     CMPI.L    D2,D0        ; aspetta la linea $110
  64.     BEQ.S    Aspetta
  65.  
  66.     BTST    #6,$BFE001
  67.     BNE.S    LOOP
  68.     RTS
  69.  
  70.  
  71. *****************************************************************************
  72. * Questa routine fa scattare in avanti o indietro il puntatore ai colori    *
  73. * precalcolati ActualFadeTab. Quando il fade va dal nero al colore pieno    *
  74. * aggiunge 256 longwords al puntatore, facendolo puntare ai prossimi 256    *
  75. * colori, ossia al prossimo fotogramma piu' scuro precalcolato. Nel caso    *
  76. * opposto torna indietro al fotogramma precedente. La label FlagFadeInOut   *
  77. * e' usata per controllare se il fade e' In o Out.                *
  78. *****************************************************************************
  79.  
  80. MainFadeInOut:
  81.     BSR.w    MettiColori    ; Sistema i colori di questo fotogramma
  82.                 ; prendendoli e convertendoli dalla tabella
  83.                 ; del fade precalcolato.
  84.     BTST.b    #1,FlagFadeInOut ; Fade In o fade Out?
  85.     BNE.S    FadeOut
  86. FadeIn:
  87.     ADD.L    #256*4,ActualFadeTab    ; Prossimo fotogramma (256 colori .l)
  88.     LEA    CTABEND,A0        ; Indirizzo fine tabella
  89.     CMP.L    ActualFadeTab(PC),A0    ; Siamo attivati alla fine della tab
  90.                     ; del fade? (Colori pieni e lucenti)
  91.     BNE.s    NonFinito
  92.     BCHG.B    #1,FlagFadeInOut    ; Cambia la direzione del fade
  93. FadeOut:
  94.     SUB.L    #256*4,ActualFadeTab    ; Passo precedente (piu' scuro)
  95.     LEA    COLORTABBY,A0        ; Indirizzo di inizio tabella
  96.     CMP.L    ActualFadeTab(PC),A0    ; Siamo arrivati all'inizio della tab
  97.                     ; del fade? (Colore NERO)
  98.     BNE.W    NonFinito
  99.     BCHG.B    #1,FlagFadeInOut    ; cambia la direzione del fade
  100. NonFinito:
  101.     RTS
  102.  
  103. FlagFadeInOut:        ; Usato per decidere se FadeIn o FadeOut
  104.     dc.w    0
  105.  
  106. ActualFadeTab:            ; Puntatore al "fotogramma" precalcolato del
  107.     dc.l    COLORTABBY    ; fade nella tabella COLORTABBY.
  108.  
  109.  
  110. ******************************************************************************
  111. * Questa routine precalcola tutti i colori a 24 bit del fade, e fa un bel po'*
  112. * di lavoro, dato che deve scrivere 256*256 longwords, ossia 262144 bytes!   *
  113. * Non e' altro che la routine di fade usata per i colori a 12 bit dell'amiga *
  114. * normale, solo che tratta 1 byte per componente RGB, anziche' 4 bit.        *
  115. ******************************************************************************
  116.  
  117. FADE256PRECALC:
  118.     LEA    COLORTABBY,A1    ; DEST CALCULATED COLORS TAB
  119.     MOVEQ    #0,D6        ; MULTIPLIER START (0-255)
  120. FADESTEPS:
  121.     LEA    PICTURE+(10240*8),A0    ; 24bit colors tab address
  122.     MOVE.w    #256-1,D7        ; NUM. DI COLORI = 256
  123.  
  124. COLCALCLOOP:
  125.  
  126. ;    CALCOLA IL BLU
  127.  
  128.     MOVE.L    (A0),D4            ; READ COLOR FROM TAB
  129.     ANDI.L    #%000011111111,D4    ; SELECT BLUE
  130.     MULU.W    D6,D4            ; MULTIPLIER
  131.     ASR.w    #8,D4            ; -> 8 BITS
  132.     ANDI.L    #%000011111111,D4    ; SELECT BLUE VAL
  133.     MOVE.L    D4,D5            ; SAVE BLUE TO D5
  134.  
  135. ;    CALCOLA IL VERDE
  136.  
  137.     MOVE.L    (A0),D4            ; READ COLOR FROM TAB
  138.     ANDI.L    #%1111111100000000,D4    ; SELECT GREEN
  139.     LSR.L    #8,D4            ; -> 8 bits (so from 0 to 7)
  140.     MULU.W    D6,D4            ; MULTIPLIER
  141.     ASR.w    #8,D4            ; -> 8 BITS
  142.     ANDI.L    #%0000000011111111,D4    ; SELECT GREEN
  143.     LSL.L    #8,D4            ; <- 8 bits (so from 8 to 15)
  144.     OR.L    D4,D5            ; SAVE GREEN TO D5
  145.  
  146. ;    CALCOLA IL BLU
  147.  
  148.     MOVE.L    (A0)+,D4        ; READ COLOR FROM TAB AND GO TO NEXT
  149.     ANDI.L    #%111111110000000000000000,D4    ; SELECT RED
  150.     LSR.L    #8,D4            ; -> 8 bits (so from 8 to 15)
  151.     LSR.L    #8,D4            ; -> 8 bits (so from 0 to 7)
  152.     MULU.W    D6,D4            ; MULTIPLIER
  153.     ASR.w    #8,D4            ; -> 8 BITS
  154.     ANDI.L    #%0000000011111111,D4    ; SELECT RED
  155.     LSL.L    #8,D4            ; <- 8 bits (so from 8 to 15)
  156.     LSL.L    #8,D4            ; <- 8 bits (so from 0 to 7)
  157.     OR.L    D4,D5            ; SAVE RED TO D5
  158.     MOVE.L    D5,(A1)+        ; SAVE 24 BIT VALUE IN TAB
  159.     DBRA    D7,COLCALCLOOP        ; 256 TIMES FOR 256 COLORS
  160.  
  161.     ADDQ.W    #1,D6        ; ADD 1 TO MULTIPLIER
  162.     CMPI.W    #255,D6        ; MULTIPLIER MAX = 256
  163.     BLE.S    FADESTEPS    ; IF NOT MAX NEXT FADE STEP
  164.     RTS
  165.  
  166.  
  167. ******************************************************************************
  168. * Questa routine converte i colori a 24 bit, che si presentano come una      *
  169. * longword $00RrGgBb, (dove R = nibble alto di RED, r = nibble basso di RED, *
  170. * G = nibble alto di GREEN eccetera), nel formato della copperlist aga,      *
  171. * ossia in due word: $0RGB con i nibble alti e $0rgb con i nibble bassi.     *
  172. ******************************************************************************
  173.  
  174. MettiColori:
  175.     MOVE.L    ActualFadeTab(PC),A0    ; indirizzo della color palette al
  176.                     ; punto attuale del fade dalla TAB
  177.     LEA    COLP0+2,A1        ; Indirizzo del primo registro
  178.                     ; settato per i nibble ALTI
  179.     LEA    COLP0B+2,A2        ; Indirizzo del primo registro
  180.                     ; settato per i nibble BASSI
  181.     MOVEQ    #8-1,d7            ; 8 banchi da 32 registri ciascuno
  182. ConvertiPaletteBank:
  183.     moveq    #0,d0
  184.     moveq    #0,d2
  185.     moveq    #0,d3
  186.     moveq    #32-1,d6    ; 32 registri colore per banco
  187.  
  188. DaLongARegistri:    ; loop che trasforma i colori $00RrGgBb.l nelle 2
  189.             ; word $0RGB, $0rgb adatte ai registri copper.
  190.  
  191. ; Conversione dei nibble bassi da $00RgGgBb (long) al colore aga $0rgb (word)
  192.  
  193.     MOVE.B    1(A0),(a2)    ; Byte alto del colore $00Rr0000 copiato
  194.                 ; nel registro cop per nibble bassi
  195.     ANDI.B    #%00001111,(a2) ; Seleziona solo il nibble BASSO ($0r)
  196.     move.b    2(a0),d2    ; Prendi il byte $0000Gg00 dal colore a 24bit
  197.     lsl.b    #4,d2        ; Sposta a sinistra di 4 bit il nibble basso
  198.                 ; del GREEN, "trasformandolo" in nibble alto
  199.                 ; di del byte basso di D2 ($g0)
  200.     move.b    3(a0),d3    ; Prendi il byte $000000Bb dal colore a 24bit
  201.     ANDI.B    #%00001111,d3    ; Seleziona solo il nibble BASSO ($0b)
  202.     or.b    d2,d3        ; "FONDI" i nibble bassi di green e blu...
  203.     move.b    d3,1(a2)    ; Formando il byte basso finale $gb da mettere
  204.                 ; nel registro colore, dopo il byte $0r, per
  205.                 ; formare la word $0rgb dei nibble bassi
  206.  
  207. ; Conversione dei nibble alti da $00RgGgBb (long) al colore aga $0RGB (word)
  208.  
  209.     MOVE.B    1(A0),d0    ; Byte alto del colore $00Rr0000 in d0
  210.     ANDI.B    #%11110000,d0    ; Seleziona solo il nibble ALTO ($R0)
  211.     lsr.b    #4,d0        ; Shifta a destra di 4 bit il nibble, in modo
  212.                 ; che diventi il nibble basso del byte ($0R)
  213.     move.b    d0,(a1)        ; Copia il byte alto $0R nel color register
  214.     move.b    2(a0),d2    ; Prendi il byte $0000Gg00 dal colore a 24bit
  215.     ANDI.B    #%11110000,d2    ; Seleziona solo il nibble ALTO ($G0)
  216.     move.b    3(a0),d3    ; Prendi il byte $000000Bb dal colore a 24 bit
  217.     ANDI.B    #%11110000,d3    ; Seleziona solo il nibble ALTO ($B0)
  218.     lsr.b    #4,d3        ; Shiftalo di 4 bit a destra trasformandolo in
  219.                 ; nibble basso del byte basso di d3 ($0B)
  220.     ori.b    d2,d3        ; Fondi i nibble alti di green e blu ($G0+$0B)
  221.     move.b    d3,1(a1)    ; Formando il byte basso finale $GB da mettere
  222.                 ; nel registro colore, dopo il byte $0R, per
  223.                 ; formare la word $0RGB dei nibble alti.
  224.  
  225.     addq.w    #4,a0        ; Saltiamo al prossimo colore .l della palette
  226.                 ; attaccata in fondo alla pic
  227.     addq.w    #4,a1        ; Saltiamo al prossimo registro colore per i
  228.                 ; nibble ALTI in Copperlist
  229.     addq.w    #4,a2        ; Saltiamo al prossimo registro colore per i
  230.                 ; nibble BASSI in Copperlist
  231.  
  232.     dbra    d6,DaLongARegistri
  233.  
  234.     add.w    #(128+8),a1    ; salta i registri colore + il dc.w $106,xxx
  235.                 ; dei nibble ALTI
  236.     add.w    #(128+8),a2    ; salta i registri colore + il dc.w $106,xxx
  237.                 ; dei nibble BASSI
  238.  
  239.     dbra    d7,ConvertiPaletteBank    ; Converte un banco da 32 colori per
  240.     rts                ; loop. 8 loop per i 256 colori.
  241.  
  242.  
  243. ;*****************************************************************************
  244. ;*                COPPERLIST AGA                     *
  245. ;*****************************************************************************
  246.  
  247.     CNOP    0,8    ; Allineo a 64 bit
  248.  
  249.     section    coppera,data_C
  250.  
  251. COPLIST:
  252.     dc.w    $8E,$2c81    ; DiwStrt
  253.     dc.w    $90,$2cc1    ; DiwStop
  254.     dc.w    $92,$0038    ; DdfStart
  255.     dc.w    $94,$00d0    ; DdfStop
  256.     dc.w    $102,0        ; BplCon1
  257.     dc.w    $104,0        ; BplCon2
  258.     dc.w    $108,0        ; Bpl1Mod
  259.     dc.w    $10a,0        ; Bpl2Mod
  260.  
  261.             ; 5432109876543210
  262.     dc.w    $100,%0000001000010001    ; 8 bitplane LOWRES 320x256. Per
  263.                     ; settare 8 planes setto il bit 4 e
  264.                     ; azzero i bit 12,13,14. Il bit 0 e'
  265.                     ; settato dato che abilita molte
  266.                     ; funzioni AGA che vedremo dopo.
  267.  
  268.     dc.w    $1fc,0        ; Burst mode azzerato (per ora!)
  269.  
  270. BPLPOINTERS:
  271.     dc.w $e0,0,$e2,0    ; primo     bitplane
  272.     dc.w $e4,0,$e6,0    ; secondo       "
  273.     dc.w $e8,0,$ea,0    ; terzo           "
  274.     dc.w $ec,0,$ee,0    ; quarto       "
  275.     dc.w $f0,0,$f2,0    ; quinto       "
  276.     dc.w $f4,0,$f6,0    ; sesto           "
  277.     dc.w $f8,0,$fA,0    ; settimo       "
  278.     dc.w $fC,0,$fE,0    ; ottavo       "
  279.  
  280. ; In questo caso la palette viene aggiornata da una routine, per cui basta
  281. ; lasciare azzerati i valori dei registri.
  282.  
  283.     DC.W    $106,$c00    ; SELEZIONA PALETTE 0 (0-31), NIBBLE ALTI
  284. COLP0:
  285.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  286.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  287.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  288.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  289.  
  290.     DC.W    $106,$e00    ; SELEZIONA PALETTE 0 (0-31), NIBBLE BASSI
  291. COLP0B:
  292.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  293.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  294.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  295.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  296.  
  297.     DC.W    $106,$2C00    ; SELEZIONA PALETTE 1 (32-63), NIBBLE ALTI
  298.  
  299.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  300.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  301.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  302.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  303.  
  304.     DC.W    $106,$2E00    ; SELEZIONA PALETTE 1 (32-63), NIBBLE BASSI
  305.  
  306.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  307.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  308.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  309.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  310.  
  311.     DC.W    $106,$4C00    ; SELEZIONA PALETTE 2 (64-95), NIBBLE ALTI
  312.  
  313.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  314.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  315.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  316.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  317.  
  318.     DC.W    $106,$4E00    ; SELEZIONA PALETTE 2 (64-95), NIBBLE BASSI
  319.  
  320.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  321.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  322.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  323.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  324.  
  325.     DC.W    $106,$6C00    ; SELEZIONA PALETTE 3 (96-127), NIBBLE ALTI
  326.  
  327.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  328.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  329.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  330.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  331.  
  332.     DC.W    $106,$6E00    ; SELEZIONA PALETTE 3 (96-127), NIBBLE BASSI
  333.  
  334.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  335.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  336.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  337.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  338.  
  339.     DC.W    $106,$8C00    ; SELEZIONA PALETTE 4 (128-159), NIBBLE ALTI
  340.  
  341.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  342.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  343.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  344.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  345.  
  346.     DC.W    $106,$8E00    ; SELEZIONA PALETTE 4 (128-159), NIBBLE BASSI
  347.  
  348.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  349.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  350.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  351.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  352.  
  353.     DC.W    $106,$AC00    ; SELEZIONA PALETTE 5 (160-191), NIBBLE ALTI
  354.  
  355.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  356.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  357.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  358.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  359.  
  360.     DC.W    $106,$AE00    ; SELEZIONA PALETTE 5 (160-191), NIBBLE BASSI
  361.  
  362.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  363.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  364.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  365.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  366.  
  367.     DC.W    $106,$CC00    ; SELEZIONA PALETTE 6 (192-223), NIBBLE ALTI
  368.  
  369.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  370.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  371.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  372.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  373.  
  374.     DC.W    $106,$CE00    ; SELEZIONA PALETTE 6 (192-223), NIBBLE BASSI
  375.  
  376.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  377.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  378.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  379.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  380.  
  381.     DC.W    $106,$EC00    ; SELEZIONA PALETTE 7 (224-255), NIBBLE ALTI
  382.  
  383.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  384.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  385.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  386.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  387.  
  388.     DC.W    $106,$EE00    ; SELEZIONA PALETTE 7 (224-255), NIBBLE BASSI
  389.  
  390.     DC.W    $180,0,$182,0,$184,0,$186,0,$188,0,$18A,0,$18C,0,$18E,0
  391.     DC.W    $190,0,$192,0,$194,0,$196,0,$198,0,$19A,0,$19C,0,$19E,0
  392.     DC.W    $1A0,0,$1A2,0,$1A4,0,$1A6,0,$1A8,0,$1AA,0,$1AC,0,$1AE,0
  393.     DC.W    $1B0,0,$1B2,0,$1B4,0,$1B6,0,$1B8,0,$1BA,0,$1BC,0,$1BE,0
  394.  
  395.     dc.w    $FFFF,$FFFE    ; Fine della copperlist
  396.  
  397. ;******************************************************************************
  398.  
  399. ; Figura RAW ad 8 bitplanes, cioe' a 256 colori
  400.  
  401.     CNOP    0,8    ; allineo a 64 bit
  402.  
  403. PICTURE:
  404.     INCBIN    "MURALE320*256*256c.RAW"
  405.  
  406. *************************************************************************
  407.  
  408.     Section    BufPerPrecalc,BSS    ; va benissimo anche in fast!
  409.  
  410. ; 256 COLORI.L * 256
  411.  
  412. COLORTABBY:
  413.     DS.B    4*256*256    ; 262144 bytes da precalcolare!
  414. CTABEND:
  415.  
  416.     end
  417.  
  418. In fondo e' un "upgrade" della vecchia routine di fade! No?
  419.  
  420.