home *** CD-ROM | disk | FTP | other *** search
- ;------------------------------------------------------------------------
- ;- -
- ;- Vector-Stars -
- ;- -
- ;------------------------------------------------------------------------
-
- org $20000
- load $20000
-
- AntBars: = 16
-
- ;------------------------------------------------------------------------
-
- 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
- mulu #12,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
- rts
-
- CopAdr: dc.l $60000
- dc.l $70000
- SinAdr: = $75000
-
- 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 Blitta
- 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
- rts
-
- Blitta: move.l CopAdr(pc),d0
- add.l CopAdd(pc),d0
- addq.l #6,d0
- move.l #Bar,d1
- move.l SinSave(pc),a0
- move.l SinSave2(pc),a4
- move.w #32*64+1,d3
- bsr BlitWait
- move.l #-1,$44(a6)
- move.l #$09f00000,$40(a6)
- move.w #12-2,$66(a6)
- clr.w $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
- add.w (a4),d2
- move.w d1,(a1)
- move.w d2,(a2)
- move.w d3,(a3)
- add.w #18,a0
- add.w #16,a4
- dbra d7,BLoop
- rts
-
- Oldie: dc.w 0
- SinSave: dc.l 0
- Oldie2: dc.w 0
- SinSave2: dc.l 0
-
- Bar: dc.w 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
- dc.w $ff0,$ee0,$dd0,$cc0,$bb0,$aa0,$990,$880
- dc.w $770,$660,$550,$440,$330,$220,$110,$000
-
- ;------------------------------------------------------------------------
-
- 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
-
-