home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / TOXIC_13.ARJ / TOXIC_13.MSA / PROGRAMS / CODING.LZH / FEU.S < prev   
Text File  |  1997-08-11  |  5KB  |  280 lines

  1.     LIST
  2. *****************************
  3. *     ROUTINE DE FLAME      *
  4. * SUPERNOVA/SUPREMACY SOFT. *    
  5. * POUR TOXIC MAG.           *
  6. *****************************    
  7.     NOLIST
  8.     
  9. larg=16
  10. haut=32     
  11. rapport=haut/20+1
  12. wide=larg/16
  13.     
  14.     opt    o+
  15.     
  16.     
  17.      pea    0.w
  18.     move    #$20,-(sp)    
  19.     trap    #1
  20.     addq.l    #6,sp
  21.     
  22.     tst.b    $ffff8260.w
  23.     beq.s    dejabas
  24.     move.b    #1,reso
  25. dejabas    
  26.     pea    0.w
  27.     pea    -1.w
  28.     pea    -1.w
  29.     move    #5,-(sp)
  30.     trap    #14
  31.     adda    #14,sp
  32.  
  33.     move.l    #pal,$45a.w    
  34.  
  35. * On effectue les precalculs pour avoir les offset des X et des Y dans la mémoire écran
  36.     
  37.     bsr    calc_big_table
  38.     bsr    make_line_table
  39.     lea    line_table,a5        Buffer contenant les precalculs en Y
  40.     move.l    $44e.w,a3        
  41.  
  42.     
  43. repeat    
  44.     move    #larg/8,d7        d7=nombre de barettes à dessiner à la base
  45. for_i
  46.     move    #17,-(sp)
  47.     trap    #14
  48.     addq.l    #2,sp
  49.      and.l    #$000000ff,d0        random(255)
  50.     cmp.w    #larg,d0        on ne doit pas dépasser la largeur voulue
  51.     bgt.s    for_i
  52.     
  53.     lea    matrice,a0        a0=écran virtuel
  54.     
  55.     add.l    #larg*(haut-1)*2,a0    a0 pointe sur la dernière ligne de l'écran virtuel (foyer)
  56.     add    d0,d0            d0=d0*2 (recherche de MOTS) d0=case x du tableau 
  57.     move    #wide,d6        d6=largeur d'une barette
  58. base    move    #rapport*16,0(a0,d0)    on met la couleur maximum
  59.     addq    #2,d0            on allume le pixel d'à coté
  60.     dbf    d6,base            pixel suivant
  61.     
  62.     dbf    d7,for_i        barette suivante
  63.  
  64. loop    
  65.     moveq    #0,d7            d7=y on commence en haut
  66. for_y    
  67.     moveq    #0,d6            d6=x on commence à gauche        
  68. for_x
  69.     move    d6,d5            on ne modifie pas d6
  70.     add    d5,d5            colone         
  71.     
  72.     move    d7,d4            on ne modifie pas d7
  73.     addq    #1,d4            ligne suivante
  74.     mulu    #larg,d4        
  75.     add    d4,d4            
  76.             
  77.     lea    matrice,a0        écran virtuel    
  78.     add.l    d4,a0            on pointe la bonne ligne
  79.     add.l    d5,a0            et la bonne colonne
  80.     move.l    a0,a1            sauve position x,y
  81.     sub    #larg*2-2,a1        pour allumer la case avec la couleur calculée après
  82.     moveq    #0,d4            d4=couleur calculée
  83.     add    (a0),d4            x-1,y+1
  84.     add    2(a0),d4        x,y+1
  85.     add    4(a0),d4        x+1,y+1
  86.     add.l    #larg*2,a0        ligne suivante
  87.     add    2(a0),d4        x,y+1
  88. p    divu    #4,d4            moyenne
  89.     move    d4,(a1)            stocke la nouvelle couleur
  90. next_x    
  91.     
  92.     lea    color,a0        buffer des couleur "étalée"
  93.     add    d4,d4            
  94.     move    0(a0,d4),d2        on cherche la correspondance avec un vrai No de couleur
  95.  
  96.     lea    big_table,a6        precalculs en X
  97.  
  98.     move    d6,d0            d0=x
  99.     move    d7,d1            d1=y
  100.     
  101.     add.w    d0,d0
  102.     add.w    d0,d0
  103.     add    d1,d1            d1=d1*2 pour la recherche des MOTS dans le tableaux
  104.  
  105.     move    (a5,d1.w),d1        d1=160*d1 
  106.     
  107.     adda.w    d0,a6            
  108.         
  109.     add    (a6)+,d1        position du pixel dans la ligne 
  110.     move    (a6),d0            motif du pixel 
  111.  
  112.     move    d0,d4
  113.     not    d4            éteind l'ancien pixel
  114.     and    d4,0(a3,d1.w)        plan0
  115.     and    d4,2(a3,d1.w)        plan1
  116.     and    d4,4(a3,d1.w)        plan2
  117.     and    d4,6(a3,d1.w)        plan3
  118.     
  119.  
  120.     ror    #1,d2            routine d'affichage du pixel 4 plans
  121.     bcc.s    a            test un à un les 4 bits de la couleur correspondant 
  122.     or    d0,0(a3,d1.w)        à chaque plans et met à 1 le bit correspondant 
  123. a    ror    #1,d2            dans le motif
  124.     bcc.s    b
  125.     or    d0,2(a3,d1.w)
  126. b    ror    #1,d2    
  127.     bcc.s    c
  128.      or    d0,4(a3,d1.w)
  129. c    ror    #1,d2
  130.     bcc.s    d
  131.     or    d0,6(a3,d1.w)
  132. d        
  133.     addq    #1,d6            pixel suivant
  134.     cmp    #larg,d6        fin de ligne?
  135.     bne    for_x
  136. next_y
  137.     addq    #1,d7            ligne suivante
  138.     cmp    #haut,d7
  139.     bne    for_y
  140.  
  141.     lea    matrice,a0        on efface la derniere ligne de l'ecran virtuel
  142.     add.l    #larg*(haut-1)*2,a0
  143.     
  144.     rept    larg            
  145.      move    #0*rapport,(a0)+    clear avec la couleur 0
  146.     endr
  147.  
  148.     cmp.b    #$39,$fffffc02.w    
  149.     bne    repeat           one again...
  150.  
  151. ;---------------------------
  152.     tst.b    reso
  153.     beq.s    bas
  154.  
  155.     move    #1,-(sp)
  156.     pea    -1.w
  157.     pea    -1.w
  158.     move    #5,-(sp)
  159.     trap    #14
  160.     adda    #14,sp
  161.  
  162. bas
  163.     move    #$555,$ffff8246.w
  164.     pea    0.w            adieu monde cruel
  165.     trap    #1
  166.     
  167. calc_big_table
  168.     lea    big_table,a0
  169.     moveq    #0,d0
  170.     moveq    #19,d1
  171. make_big_table
  172.     lea    p1,a1
  173.     move    #15,d2
  174. one_line
  175.     move    d0,(a0)+
  176.     move    (a1)+,(a0)+
  177.     dbf    d2,one_line
  178.     addq.l    #8,d0
  179.     dbf    d1,make_big_table
  180.     rts
  181.   
  182. calc_point
  183.  
  184.  
  185.  
  186. make_line_table
  187.     lea    line_table,a0
  188.     moveq    #0,d0
  189.     move    #199,d1
  190. m_l_t
  191.     move    d0,(a0)+
  192.     add.w    #160,d0
  193.     dbf    d1,m_l_t
  194.     rts
  195.  
  196. x    dc.w    0
  197. y    dc.w    0
  198. big_table
  199.     ds.w    2*20*16
  200.     nop
  201. line_table
  202.     ds.w    200
  203.  
  204. pal    dc.w    0,$100,$110,$200,$210,$310,$320,$420,$430,$530,$540,$640,$650,$750,$760,$770
  205.     *dc.w    0,$770,$760,$750,$650,$640,$540,$530,$430,$420,$320,$310,$300,$210,$200,$100
  206.  
  207. p1    dc    %1000000000000000
  208.     dc    %0100000000000000
  209.     dc    %0010000000000000
  210.     dc    %0001000000000000
  211.     dc    %0000100000000000
  212.     dc    %0000010000000000
  213.     dc    %0000001000000000
  214.     dc    %0000000100000000
  215.     dc    %0000000010000000
  216.     dc    %0000000001000000
  217.     dc    %0000000000100000
  218.     dc    %0000000000010000
  219.     dc    %0000000000001000
  220.     dc    %0000000000000100
  221.     dc    %0000000000000010
  222.     dc    %0000000000000001
  223.  
  224.     
  225. color
  226.     rept    rapport
  227.     dc.w    0
  228.     endr
  229.     rept    rapport
  230.     dc.w    1
  231.     endr
  232.     rept    rapport
  233.     dc.w    2
  234.     endr
  235.     rept    rapport
  236.     dc.w    3
  237.     endr
  238.     rept    rapport
  239.     dc.w    4
  240.     endr
  241.     rept    rapport
  242.     dc.w    5
  243.     endr
  244.     rept    rapport
  245.     dc.w    6
  246.     endr
  247.     rept    rapport
  248.     dc.w    7
  249.     endr
  250.     rept    rapport
  251.     dc.w    8
  252.     endr
  253.     rept    rapport
  254.     dc.w    9
  255.     endr
  256.     rept    rapport
  257.     dc.w    10
  258.     endr
  259.     rept    rapport
  260.     dc.w    11
  261.     endr
  262.     rept    rapport
  263.     dc.w    12
  264.     endr
  265.     rept    rapport
  266.     dc.w    13
  267.     endr
  268.     rept    rapport
  269.     dc.w    14
  270.     endr
  271.     rept    rapport
  272.     dc.w    15
  273.     endr
  274.  
  275. reso    ds.b    1
  276.  
  277. matrice    ds.w    larg*haut
  278.     ds.w    larg
  279.     end
  280.