home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Source / pheno.lha / pha / StrangeBars.S < prev    next >
Encoding:
Text File  |  1987-12-17  |  5.6 KB  |  276 lines

  1. ;------------------------------------------------------------------------
  2. ;-                                    -
  3. ;-                 Vector-Stars                -
  4. ;-                                    -
  5. ;------------------------------------------------------------------------
  6.  
  7. org    $20000
  8. load    $20000
  9.  
  10. AntBars:    =    16
  11.  
  12. ;------------------------------------------------------------------------
  13.  
  14. S:        movem.l    d0-d7/a0-a6,-(sp)
  15.         lea.l    $dff000,a6
  16.         bsr    Startup
  17.         bsr    InitRutin
  18.         bsr    StartCop
  19.         bsr    MainLoop
  20.         bsr    RestoreCop
  21.         movem.l    (sp)+,d0-d7/a0-a6
  22.         rts
  23.  
  24. Startup:    move.w    2(a6),d0
  25.         bset    #15,d0
  26.         move.w    d0,OldDma
  27.         move.w    $1c(a6),d0
  28.         bset    #15,d0
  29.         move.w    d0,OldIrq
  30.         move.l    $4,a6
  31.         lea.l    Lib(pc),a1
  32.         moveq    #0,d0
  33.         jsr    -408(a6)
  34.         move.l    d0,a0
  35.         move.l    $26(a0),OldCop
  36.         lea.l    $dff000,a6
  37.         rts
  38.  
  39. StartCop:    move.l    #CopperList,$80(a6)
  40.         tst.w    $88(a6)
  41.         move.w    #$7fff,$96(a6)
  42.         move.w    #$87c0,$96(a6)
  43.         move.w    #$7fff,$9a(a6)
  44.         move.w    #$c000,$9a(a6)
  45.         rts
  46.  
  47. RestoreCop:    move.l    OldCop(pc),$80(a6)
  48.         tst.w    $88(a6)
  49.         move.w    OldDma(pc),$96(a6)
  50.         move.w    OldIrq(pc),$9a(a6)
  51.         rts
  52.  
  53.     ;-----------------------------------------------------
  54.         OldCop:        dc.l    0
  55.         OldDma:        dc.w    0
  56.         OldIrq:        dc.w    0
  57.         Lib:        dc.b    'graphics.library',0
  58.                 even
  59.     ;-----------------------------------------------------
  60.  
  61. ;------------------------------------------------------------------------
  62.  
  63. BlitWait:    btst    #14,2(a6)
  64.         bne.S    BlitWait
  65.         rts
  66.  
  67. ClearScreen:    bsr.S    BlitWait
  68.         move.l    #-1,$44(a6)
  69.         move.l    #$01000000,$40(a6)
  70.         move.w    d2,$66(a6)
  71.         move.l    d0,$54(a6)
  72.         move.w    d1,$58(a6)
  73.         rts
  74.  
  75. ;------------------------------------------------------------------------
  76.  
  77. InitRutin:    move.l    CopAdr(pc),a0
  78.         move.l    CopAdr+4(pc),a1
  79.         lea.l    CopperList(pc),a2
  80. MLoop:        move.l    (a2),(a0)+
  81.         move.l    (a2)+,(a1)+
  82.         cmp.l    #-2,(a2)
  83.         bne.S    MLoop
  84.  
  85.         move.l    a0,d0
  86.         sub.l    CopAdr,d0
  87.         move.l    d0,CopAdd
  88.  
  89.         move.l    #$2007fffe,d0
  90.         move.l    #$01800000,d1
  91.         move.l    #$20ddfffe,d2
  92.         move.l    #$01000000,d3
  93.         move.w    #280-1,d7
  94. MLoop2:        move.l    d0,(a0)+
  95.         move.l    d0,(a1)+
  96.         move.l    d1,(a0)+
  97.         move.l    d1,(a1)+
  98.         move.l    d2,(a0)+
  99.         move.l    d2,(a1)+
  100.         add.l    d3,d0
  101.         add.l    d3,d2
  102.         dbra    d7,MLoop2
  103.         move.l    #-2,(a0)+
  104.         move.l    #-2,(a1)+
  105.  
  106.         lea.l    Sinus(pc),a0
  107.         lea.l    SinAdr,a1
  108.         move.w    #300-1,d7
  109. SLoop1:        move.w    (a0)+,d0
  110.         lsr.w    #1,d0
  111.         mulu    #12,d0
  112.         move.w    d0,(a1)+
  113.         dbra    d7,SLoop1
  114.         lea.l    SinAdr,a0
  115.         move.w    #300*9,d7
  116. SLoop2:        move.w    (a0)+,(a1)+
  117.         dbra    d7,SLoop2
  118.         rts
  119.  
  120. CopAdr:        dc.l    $60000
  121.         dc.l    $70000
  122. SinAdr:        =    $75000
  123.  
  124. CopAdd:        dc.l    0
  125.  
  126. ;------------------------------------------------------------------------
  127.  
  128. MainLoop:    cmp.b    #-1,$6(a6)
  129.         bne.S    MainLoop
  130. MainLoop2:    cmp.b    #$38,$6(a6)
  131.         bne.S    MainLoop2
  132.  
  133.         ;move.w    #$ff,$180(a6)
  134.         bsr    Bars
  135.         ;move.w    #$fff,$180(a6)
  136.  
  137.         btst    #6,$bfe001
  138.         bne.S    MainLoop
  139.         rts
  140.  
  141. ;------------------------------------------------------------------------
  142.  
  143. Bars:        bsr    Buffra
  144.         bsr    Rensa
  145.         bsr    NewSin
  146.         bsr    Blitta
  147.         rts
  148.  
  149. Buffra:        move.l    CopAdr(pc),d0
  150.         move.l    CopAdr+4(pc),CopAdr
  151.         move.l    d0,CopAdr+4
  152.         move.l    d0,$80(a6)
  153.         tst.w    $88(a6)
  154.         rts
  155.  
  156. Rensa:        move.l    CopAdr(pc),d0
  157.         add.l    CopAdd(pc),d0
  158.         addq.l    #6,d0
  159.         move.w    #12-2,d2
  160.         move.w    #280*64+1,d1
  161.         bsr    ClearScreen
  162.         rts
  163.  
  164. NewSin:        moveq    #0,d0
  165.         move.w    Oldie(pc),d0
  166.         add.w    #297,d0
  167.         cmp.w    #300,d0
  168.         bls.S    NoD
  169.         sub.w    #300,d0
  170. NoD:        move.w    d0,Oldie
  171.         add.w    d0,d0
  172.         add.l    #SinAdr,d0
  173.         move.l    d0,SinSave
  174.         moveq    #0,d0
  175.         move.w    Oldie2(pc),d0
  176.         addq.w    #2,d0
  177.         cmp.w    #300,d0
  178.         bls.S    NoD2
  179.         sub.w    #300,d0
  180. NoD2:        move.w    d0,Oldie2
  181.         add.w    d0,d0
  182.         add.l    #SinAdr,d0
  183.         move.l    d0,SinSave2
  184.         rts
  185.  
  186. Blitta:        move.l    CopAdr(pc),d0
  187.         add.l    CopAdd(pc),d0
  188.         addq.l    #6,d0
  189.         move.l    #Bar,d1
  190.         move.l    SinSave(pc),a0
  191.         move.l    SinSave2(pc),a4
  192.         move.w    #32*64+1,d3
  193.         bsr    BlitWait
  194.         move.l    #-1,$44(a6)
  195.         move.l    #$09f00000,$40(a6)
  196.         move.w    #12-2,$66(a6)
  197.         clr.w    $64(a6)
  198.         move.l    d0,$54(a6)
  199.         move.l    d1,$50(a6)
  200.         lea.l    $52(a6),a1
  201.         lea.l    $56(a6),a2
  202.         lea.l    $58(a6),a3
  203.         move.w    #AntBars-1,d7
  204.  
  205. BLoop:        move.w    d0,d2
  206.         add.w    (a0),d2
  207.         add.w    (a4),d2
  208.         move.w    d1,(a1)
  209.         move.w    d2,(a2)
  210.         move.w    d3,(a3)
  211.         add.w    #18,a0
  212.         add.w    #16,a4
  213.         dbra    d7,BLoop
  214.         rts
  215.  
  216. Oldie:        dc.w    0
  217. SinSave:    dc.l    0
  218. Oldie2:        dc.w    0
  219. SinSave2:    dc.l    0
  220.  
  221. Bar:        dc.w    0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
  222.         dc.w    $ff0,$ee0,$dd0,$cc0,$bb0,$aa0,$990,$880
  223.         dc.w    $770,$660,$550,$440,$330,$220,$110,$000
  224.  
  225. ;------------------------------------------------------------------------
  226.  
  227. CopperList:    dc.l    $008e4866,$009010c6,$00920030,$009400d8
  228.         dc.l    $01020000,$01040000,$01080000,$010a0000
  229.  
  230.         dc.l    $01800000
  231.         dc.l    $01000000
  232.  
  233.         dc.l    -2
  234.  
  235. ;------------------------------------------------------------------------
  236.  
  237. Sinus:    dc.w    240,240,240,240,240,239,239,239
  238.     dc.w    238,238,237,237,236,236,235,234
  239.     dc.w    233,232,232,231,230,229,227,226
  240.     dc.w    225,224,223,221,220,219,217,216
  241.     dc.w    214,212,211,209,207,206,204,202
  242.     dc.w    200,198,196,195,193,191,188,186
  243.     dc.w    184,182,180,178,176,173,171,169
  244.     dc.w    167,164,162,159,157,155,152,150
  245.     dc.w    147,145,142,140,138,135,133,130
  246.     dc.w    128,125,123,120,117,115,112,110
  247.     dc.w    107,105,102,100,98,95,93,90
  248.     dc.w    88,85,83,81,78,76,73,71
  249.     dc.w    69,67,64,62,60,58,56,54
  250.     dc.w    52,49,47,45,44,42,40,38
  251.     dc.w    36,34,33,31,29,28,26,24
  252.     dc.w    23,21,20,19,17,16,15,14
  253.     dc.w    13,11,10,9,8,8,7,6
  254.     dc.w    5,4,4,3,3,2,2,1
  255.     dc.w    1,1,0,0,0,0,0,0
  256.     dc.w    0,0,0,1,1,1,2,2
  257.     dc.w    3,3,4,4,5,6,7,8
  258.     dc.w    8,9,10,11,13,14,15,16
  259.     dc.w    17,19,20,21,23,24,26,28
  260.     dc.w    29,31,33,34,36,38,40,42
  261.     dc.w    44,45,47,49,52,54,56,58
  262.     dc.w    60,62,64,67,69,71,73,76
  263.     dc.w    78,81,83,85,88,90,93,95
  264.     dc.w    98,100,102,105,107,110,112,115
  265.     dc.w    117,120,123,125,128,130,133,135
  266.     dc.w    138,140,142,145,147,150,152,155
  267.     dc.w    157,159,162,164,167,169,171,173
  268.     dc.w    176,178,180,182,184,186,188,191
  269.     dc.w    193,195,196,198,200,202,204,206
  270.     dc.w    207,209,211,212,214,216,217,219
  271.     dc.w    220,221,223,224,225,226,227,229
  272.     dc.w    230,231,232,232,233,234,235,236
  273.     dc.w    236,237,237,238,238,239,239,239
  274.     dc.w    240,240,240,240
  275.  
  276.