home *** CD-ROM | disk | FTP | other *** search
- ;------------------------------------------------------------------------
- ;- -
- ;- Vector-Stars -
- ;- -
- ;------------------------------------------------------------------------
-
- org $20000
- load $20000
-
- >EXTERN 'Perspektiv',Per
-
- AntBars: = 14
-
- ;------------------------------------------------------------------------
-
- S: movem.l d0-d7/a0-a6,-(sp)
- lea.l $dff000,a6
- bsr Startup
- bsr InitRutin
- bsr StartCop
- bsr MainLoop
- bsr RestoreCop
- movem.l (sp)+,d0-d7/a0-a6
- rts
-
- Startup: move.w 2(a6),d0
- bset #15,d0
- move.w d0,OldDma
- move.w $1c(a6),d0
- bset #15,d0
- move.w d0,OldIrq
- move.l $4,a6
- lea.l Lib(pc),a1
- moveq #0,d0
- jsr -408(a6)
- move.l d0,a0
- move.l $26(a0),OldCop
- lea.l $dff000,a6
- rts
-
- StartCop: move.l #CopperList,$80(a6)
- tst.w $88(a6)
- move.w #$7fff,$96(a6)
- move.w #$87c0,$96(a6)
- move.w #$7fff,$9a(a6)
- move.w #$c000,$9a(a6)
- rts
-
- RestoreCop: move.l OldCop(pc),$80(a6)
- tst.w $88(a6)
- move.w OldDma(pc),$96(a6)
- move.w OldIrq(pc),$9a(a6)
- rts
-
- ;-----------------------------------------------------
- OldCop: dc.l 0
- OldDma: dc.w 0
- OldIrq: dc.w 0
- Lib: dc.b 'graphics.library',0
- even
- ;-----------------------------------------------------
-
- ;------------------------------------------------------------------------
-
- BlitWait: btst #14,2(a6)
- bne.S BlitWait
- rts
-
- ClearScreen: bsr.S BlitWait
- move.l #-1,$44(a6)
- move.l #$01000000,$40(a6)
- move.w d2,$66(a6)
- move.l d0,$54(a6)
- move.w d1,$58(a6)
- rts
-
- ;------------------------------------------------------------------------
-
- InitRutin: move.l CopAdr(pc),a0
- move.l CopAdr+4(pc),a1
- lea.l CopperList(pc),a2
- MLoop: move.l (a2),(a0)+
- move.l (a2)+,(a1)+
- cmp.l #-2,(a2)
- bne.S MLoop
-
- move.l a0,d0
- sub.l CopAdr,d0
- move.l d0,CopAdd
-
- move.l #$2007fffe,d0
- move.l #$01800000,d1
- move.l #$20ddfffe,d2
- move.l #$01000000,d3
- move.w #280-1,d7
- MLoop2: move.l d0,(a0)+
- move.l d0,(a1)+
- move.l d1,(a0)+
- move.l d1,(a1)+
- move.l d2,(a0)+
- move.l d2,(a1)+
- add.l d3,d0
- add.l d3,d2
- dbra d7,MLoop2
- move.l #-2,(a0)+
- move.l #-2,(a1)+
-
- lea.l Sinus(pc),a0
- lea.l SinAdr,a1
- move.w #300-1,d7
- SLoop1: move.w (a0)+,d0
- lsr.w #1,d0
- move.w d0,(a1)+
- dbra d7,SLoop1
- lea.l SinAdr,a0
- move.w #300*9,d7
- SLoop2: move.w (a0)+,(a1)+
- dbra d7,SLoop2
-
- lea MulsList,a0
- moveq #0,d0
- move.w #300-1,d7
- MLoop3: move.w d0,(a0)+
- add.w #12,d0
- dbra d7,MLoop3
- rts
-
- CopAdr: dc.l $60000
- dc.l $70000
- SinAdr: = $75000
- MulsList: = $7a000
-
- CopAdd: dc.l 0
-
- ;------------------------------------------------------------------------
-
- MainLoop: cmp.b #-1,$6(a6)
- bne.S MainLoop
- MainLoop2: cmp.b #$38,$6(a6)
- bne.S MainLoop2
-
- ;move.w #$ff,$180(a6)
- bsr Bars
- ;move.w #$fff,$180(a6)
-
- btst #6,$bfe001
- bne.S MainLoop
- rts
-
- ;------------------------------------------------------------------------
-
- Bars: bsr Buffra
- bsr Rensa
- bsr NewSin
- bsr CalcPosses
- bsr Sortera
- bsr Blitta
- rts
-
- Sortera: lea.l Posses+2(pc),a0
- lea.l Posses2(pc),a1
- moveq #4,d6
- moveq #0,d2
- move.w #AntBars-1,d7
- move.w -2(a0),(a1)
- move.w (a0),2(a1)
- move.w (a0),d2
- addq.l #4,a0
- subq.w #1,d7
-
- bsr BlitWait
- move.l #-1,$44(a6)
- move.l #$09f00002,$40(a6)
- clr.l $64(a6)
- move.l a1,$50(a6)
- move.l a1,$54(a6)
-
- SortLoop: move.w (a0),d0
- move.w d6,d5
- move.l a1,a2
- addq.w #2,a2
- cmp.w d0,d2
- blo.S NoLow
- move.w -2(a0),(a1,d6.W)
- addq.w #2,d6
- move.w d0,(a1,d6.W)
- addq.w #2,d6
- move.w d0,d2
- bra.S Next
- NoLow: cmp.w (a2),d0
- bge.S MoveIt
- addq.w #4,a2
- subq.w #4,d5
- bne.S NoLow
- MoveIt: move.l a2,a4
- add.w d5,a2
- move.l a2,a3
- addq.w #4,a3
- lsr.w #1,d5
- addq.w #2,d5
- lsl.w #6,d5
- addq.w #1,d5
- move.l a2,$50(a6)
- move.l a3,$54(a6)
- move.w d5,$58(a6)
- WW: btst #14,$2(a6)
- bne.S WW
- move.w d0,(a4)
- move.w -2(a0),-2(a4)
- addq.w #4,d6
- Next: addq.w #4,a0
- dbra d7,SortLoop
- rts
-
- Buffra: move.l CopAdr(pc),d0
- move.l CopAdr+4(pc),CopAdr
- move.l d0,CopAdr+4
- move.l d0,$80(a6)
- tst.w $88(a6)
- rts
-
- Rensa: move.l CopAdr(pc),d0
- add.l CopAdd(pc),d0
- addq.l #6,d0
- move.w #12-2,d2
- move.w #280*64+1,d1
- bsr ClearScreen
- rts
-
- NewSin: moveq #0,d0
- move.w Oldie(pc),d0
- add.w #297,d0
- cmp.w #300,d0
- bls.S NoD
- sub.w #300,d0
- NoD: move.w d0,Oldie
- add.w d0,d0
- add.l #SinAdr,d0
- move.l d0,SinSave
- moveq #0,d0
- move.w Oldie2(pc),d0
- addq.w #2,d0
- cmp.w #300,d0
- bls.S NoD2
- sub.w #300,d0
- NoD2: move.w d0,Oldie2
- add.w d0,d0
- add.l #SinAdr,d0
- move.l d0,SinSave2
-
- move.w ZVinkel(pc),d0
- addq.w #6,d0
- cmp.w #720,d0
- bls.S NoV1
- sub.w #720,d0
- NoV1: move.w d0,ZVinkel
- rts
-
- CalcPosses: move.l SinSave(pc),a0
- move.l SinSave2(pc),a1
- lea.l VecSin(pc),a2
- lea.l Posses(pc),a3
- lea.l MulsList,a4
- lea.l Per,a5
- move.w ZVinkel(pc),d0
- move.w (a2,d0.W),d1
- add.l #180,a2
- move.w (a2,d0.W),d0
- move.w #-200,d2
- move.w #0,d6
- move.w #AntBars-1,d7
- CalcLoop: move.w (a0),d3
- add.w (a1),d3
- sub.w #140,d3
- move.w d1,d4
- muls d3,d4
- move.w d0,d5
- muls d2,d5
- sub.l d5,d4
- asl.l #2,d4
- swap d4 ;Y
- muls d0,d3
- move.w d2,d5
- muls d1,d5
- add.l d3,d5
- asl.l #2,d5
- swap d5 ;Z
- add.w #300,d5
- move.w d5,d6
- add.w d6,d6
- move.w (a5,d6.W),d6
- muls d6,d4
- asl.l #5,d4
- swap d4
- add.w #140,d4
- add.w d4,d4
- move.w (a4,d4.W),(a3)+
- move.w d5,(a3)+
- add.w #32,d2
- add.w #22,a0
- add.w #20,a1
- dbra d7,CalcLoop
- rts
-
- Blitta: move.l CopAdr(pc),d0
- add.l CopAdd(pc),d0
- addq.l #6,d0
- move.l #Bar,d1
- lea.l Posses2(pc),a0
- move.w #16*64+1,d3
- bsr BlitWait
- move.l #-1,$44(a6)
- move.l #$09f00000,$40(a6)
- move.w #12-2,$66(a6)
- move.w #0,$64(a6)
- move.l d0,$54(a6)
- move.l d1,$50(a6)
- lea.l $52(a6),a1
- lea.l $56(a6),a2
- lea.l $58(a6),a3
- move.w #AntBars-1,d7
-
- BLoop: move.w d0,d2
- add.w (a0),d2
- move.w d2,(a2)
- move.w d3,(a3)
- addq.w #4,a0
- dbra d7,BLoop
- rts
-
- Oldie: dc.w 0
- SinSave: dc.l 0
- Oldie2: dc.w 0
- SinSave2: dc.l 0
-
- ZVinkel: dc.w 0
-
- Posses: blk.w AntBars*4,0
- Posses2: blk.w AntBars*4,0
-
- Bar:
- dc.w 0,2,4,6,8,10,12,14,14,12,10,8,6,4,2,0
- dc.w 0,$22,$44,$66,$88,$aa,$cc,$ee,$ee,$cc,$aa,$88,$66,$44,$22,0
- dc.w 0,$20,$40,$60,$80,$a0,$c0,$e0,$e0,$c0,$a0,$80,$60,$40,$20,0
- dc.w 0,$220,$440,$660,$880,$aa0,$cc0,$ee0,$ee0,$cc0,$aa0,$880,$660
- dc.w $440,$220,0
- dc.w 0,$200,$400,$600,$800,$a00,$c00,$e00,$e00,$c00,$a00,$800,$600
- dc.w $400,$200,0
- dc.w 0,$202,$404,$606,$808,$a0a,$c0c,$e0e,$e0e,$c0c,$a0a,$808,$606
- dc.w $404,$202,0
- dc.w 0,$222,$444,$666,$888,$aaa,$ccc,$eee,$eee,$ccc,$aaa,$888,$666
- dc.w $444,$222,0
- dc.w 0,2,4,6,8,10,12,14,14,12,10,8,6,4,2,0
- dc.w 0,$22,$44,$66,$88,$aa,$cc,$ee,$ee,$cc,$aa,$88,$66,$44,$22,0
- dc.w 0,$20,$40,$60,$80,$a0,$c0,$e0,$e0,$c0,$a0,$80,$60,$40,$20,0
- dc.w 0,$220,$440,$660,$880,$aa0,$cc0,$ee0,$ee0,$cc0,$aa0,$880,$660
- dc.w $440,$220,0
- dc.w 0,$200,$400,$600,$800,$a00,$c00,$e00,$e00,$c00,$a00,$800,$600
- dc.w $400,$200,0
- dc.w 0,$202,$404,$606,$808,$a0a,$c0c,$e0e,$e0e,$c0c,$a0a,$808,$606
- dc.w $404,$202,0
- dc.w 0,$222,$444,$666,$888,$aaa,$ccc,$eee,$eee,$ccc,$aaa,$888,$666
- dc.w $444,$222,0
-
- ;------------------------------------------------------------------------
-
- CopperList: dc.l $008e4866,$009010c6,$00920030,$009400d8
- dc.l $01020000,$01040000,$01080000,$010a0000
-
- dc.l $01800000
- dc.l $01000000
-
- dc.l -2
-
- ;------------------------------------------------------------------------
-
- Sinus: dc.w 240,240,240,240,240,239,239,239
- dc.w 238,238,237,237,236,236,235,234
- dc.w 233,232,232,231,230,229,227,226
- dc.w 225,224,223,221,220,219,217,216
- dc.w 214,212,211,209,207,206,204,202
- dc.w 200,198,196,195,193,191,188,186
- dc.w 184,182,180,178,176,173,171,169
- dc.w 167,164,162,159,157,155,152,150
- dc.w 147,145,142,140,138,135,133,130
- dc.w 128,125,123,120,117,115,112,110
- dc.w 107,105,102,100,98,95,93,90
- dc.w 88,85,83,81,78,76,73,71
- dc.w 69,67,64,62,60,58,56,54
- dc.w 52,49,47,45,44,42,40,38
- dc.w 36,34,33,31,29,28,26,24
- dc.w 23,21,20,19,17,16,15,14
- dc.w 13,11,10,9,8,8,7,6
- dc.w 5,4,4,3,3,2,2,1
- dc.w 1,1,0,0,0,0,0,0
- dc.w 0,0,0,1,1,1,2,2
- dc.w 3,3,4,4,5,6,7,8
- dc.w 8,9,10,11,13,14,15,16
- dc.w 17,19,20,21,23,24,26,28
- dc.w 29,31,33,34,36,38,40,42
- dc.w 44,45,47,49,52,54,56,58
- dc.w 60,62,64,67,69,71,73,76
- dc.w 78,81,83,85,88,90,93,95
- dc.w 98,100,102,105,107,110,112,115
- dc.w 117,120,123,125,128,130,133,135
- dc.w 138,140,142,145,147,150,152,155
- dc.w 157,159,162,164,167,169,171,173
- dc.w 176,178,180,182,184,186,188,191
- dc.w 193,195,196,198,200,202,204,206
- dc.w 207,209,211,212,214,216,217,219
- dc.w 220,221,223,224,225,226,227,229
- dc.w 230,231,232,232,233,234,235,236
- dc.w 236,237,237,238,238,239,239,239
- dc.w 240,240,240,240
-
-
- VecSin: dc.w 16384,16382,16374,16362,16344,16322,16294,16262
- dc.w 16225,16182,16135,16083,16026,15964,15897,15826
- dc.w 15749,15668,15582,15491,15396,15296,15191,15082
- dc.w 14967,14849,14726,14598,14466,14330,14189,14044
- dc.w 13894,13741,13583,13421,13255,13085,12911,12733
- dc.w 12551,12365,12176,11982,11786,11585,11381,11174
- dc.w 10963,10749,10531,10311,10087,9860,9630,9397
- dc.w 9162,8923,8682,8438,8192,7943,7692,7438
- dc.w 7182,6924,6664,6401,6137,5871,5603,5334
- dc.w 5063,4790,4516,4240,3963,3685,3406,3126
- dc.w 2845,2563,2280,1996,1712,1427,1142,857
- dc.w 571,285,0,-285,-571,-857,-1142,-1428
- dc.w -1712,-1996,-2280,-2563,-2845,-3126,-3406,-3685
- dc.w -3963,-4240,-4516,-4790,-5063,-5334,-5603,-5871
- dc.w -6137,-6401,-6664,-6924,-7182,-7438,-7692,-7943
- dc.w -8192,-8438,-8682,-8923,-9162,-9397,-9630,-9860
- dc.w -10087,-10311,-10531,-10749,-10963,-11174,-11381,-11585
- dc.w -11786,-11982,-12176,-12365,-12551,-12733,-12911,-13085
- dc.w -13255,-13421,-13583,-13741,-13894,-14044,-14189,-14330
- dc.w -14466,-14598,-14726,-14849,-14967,-15082,-15191,-15296
- dc.w -15396,-15491,-15582,-15668,-15749,-15826,-15897,-15964
- dc.w -16026,-16083,-16135,-16182,-16225,-16262,-16294,-16322
- dc.w -16344,-16362,-16374,-16382,-16384,-16382,-16374,-16362
- dc.w -16344,-16322,-16294,-16262,-16225,-16182,-16135,-16083
- dc.w -16026,-15964,-15897,-15826,-15749,-15668,-15582,-15491
- dc.w -15396,-15296,-15191,-15082,-14968,-14849,-14726,-14598
- dc.w -14466,-14330,-14189,-14044,-13894,-13741,-13583,-13421
- dc.w -13255,-13085,-12911,-12733,-12551,-12365,-12176,-11982
- dc.w -11786,-11585,-11381,-11174,-10963,-10749,-10531,-10311
- dc.w -10087,-9860,-9630,-9397,-9162,-8923,-8682,-8438
- dc.w -8192,-7943,-7692,-7438,-7182,-6924,-6664,-6402
- dc.w -6137,-5871,-5604,-5334,-5063,-4790,-4516,-4240
- dc.w -3963,-3685,-3406,-3126,-2845,-2563,-2280,-1996
- dc.w -1712,-1428,-1143,-857,-572,-286,0,285
- dc.w 571,857,1142,1427,1712,1996,2280,2562
- dc.w 2844,3126,3406,3685,3963,4240,4515,4790
- dc.w 5062,5334,5603,5871,6137,6401,6663,6924
- dc.w 7182,7438,7691,7943,8192,8438,8682,8923
- dc.w 9161,9397,9630,9860,10087,10310,10531,10748
- dc.w 10963,11173,11381,11585,11785,11982,12175,12365
- dc.w 12551,12732,12910,13085,13255,13421,13583,13740
- dc.w 13894,14044,14189,14330,14466,14598,14726,14849
- dc.w 14967,15081,15191,15296,15396,15491,15582,15668
- dc.w 15749,15826,15897,15964,16026,16083,16135,16182
- dc.w 16224,16262,16294,16322,16344,16361,16374,16382
-
- dc.w 16384,16382,16374,16362,16344,16322,16294,16262
- dc.w 16225,16182,16135,16083,16026,15964,15897,15826
- dc.w 15749,15668,15582,15491,15396,15296,15191,15082
- dc.w 14967,14849,14726,14598,14466,14330,14189,14044
- dc.w 13894,13741,13583,13421,13255,13085,12911,12733
- dc.w 12551,12365,12176,11982,11786,11585,11381,11174
- dc.w 10963,10749,10531,10311,10087,9860,9630,9397
- dc.w 9162,8923,8682,8438,8192,7943,7692,7438
- dc.w 7182,6924,6664,6401,6137,5871,5603,5334
- dc.w 5063,4790,4516,4240,3963,3685,3406,3126
- dc.w 2845,2563,2280,1996,1712,1427,1142,857
- dc.w 571,285,0,-285,-571,-857,-1142,-1428
- dc.w -1712,-1996,-2280,-2563,-2845,-3126,-3406,-3685
- dc.w -3963,-4240,-4516,-4790,-5063,-5334,-5603,-5871
- dc.w -6137,-6401,-6664,-6924,-7182,-7438,-7692,-7943
- dc.w -8192,-8438,-8682,-8923,-9162,-9397,-9630,-9860
- dc.w -10087,-10311,-10531,-10749,-10963,-11174,-11381,-11585
- dc.w -11786,-11982,-12176,-12365,-12551,-12733,-12911,-13085
- dc.w -13255,-13421,-13583,-13741,-13894,-14044,-14189,-14330
- dc.w -14466,-14598,-14726,-14849,-14967,-15082,-15191,-15296
- dc.w -15396,-15491,-15582,-15668,-15749,-15826,-15897,-15964
- dc.w -16026,-16083,-16135,-16182,-16225,-16262,-16294,-16322
- dc.w -16344,-16362,-16374,-16382,-16384,-16382,-16374,-16362
- dc.w -16344,-16322,-16294,-16262,-16225,-16182,-16135,-16083
- dc.w -16026,-15964,-15897,-15826,-15749,-15668,-15582,-15491
- dc.w -15396,-15296,-15191,-15082,-14968,-14849,-14726,-14598
- dc.w -14466,-14330,-14189,-14044,-13894,-13741,-13583,-13421
- dc.w -13255,-13085,-12911,-12733,-12551,-12365,-12176,-11982
- dc.w -11786,-11585,-11381,-11174,-10963,-10749,-10531,-10311
- dc.w -10087,-9860,-9630,-9397,-9162,-8923,-8682,-8438
- dc.w -8192,-7943,-7692,-7438,-7182,-6924,-6664,-6402
- dc.w -6137,-5871,-5604,-5334,-5063,-4790,-4516,-4240
- dc.w -3963,-3685,-3406,-3126,-2845,-2563,-2280,-1996
- dc.w -1712,-1428,-1143,-857,-572,-286,0,285
- dc.w 571,857,1142,1427,1712,1996,2280,2562
- dc.w 2844,3126,3406,3685,3963,4240,4515,4790
- dc.w 5062,5334,5603,5871,6137,6401,6663,6924
- dc.w 7182,7438,7691,7943,8192,8438,8682,8923
- dc.w 9161,9397,9630,9860,10087,10310,10531,10748
- dc.w 10963,11173,11381,11585,11785,11982,12175,12365
- dc.w 12551,12732,12910,13085,13255,13421,13583,13740
- dc.w 13894,14044,14189,14330,14466,14598,14726,14849
- dc.w 14967,15081,15191,15296,15396,15491,15582,15668
- dc.w 15749,15826,15897,15964,16026,16083,16135,16182
- dc.w 16224,16262,16294,16322,16344,16361,16374,16382
-
- Per: = $40000
-
-