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

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