home *** CD-ROM | disk | FTP | other *** search
- ;------------------------------------------------------------------------
- ;- -
- ;- Vector-Stars -
- ;- -
- ;------------------------------------------------------------------------
-
- org $20000
- load $20000
-
- >EXTERN 'Perspektiv',Per
- >EXTERN 'VectorBob.RB',Bob
- >EXTERN 'VectorSin2',Sinus
-
- ;------------------------------------------------------------------------
-
- S: movem.l d0-d7/a0-a6,-(sp)
- lea.l $dff000,a6
- bsr Startup
- bsr InitRutin
- bsr BlitWait
- 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 Screen(pc),d0
- move.w #128*2*64+24,d1
- moveq #0,d2
- bsr ClearScreen
- move.l Screen+4(pc),d0
- bsr ClearScreen
- bsr BlitWait
-
- lea.l MulsList,a0
- moveq #0,d0
- move.w #300-1,d7
- MulsLoop: move.w d0,(a0)+
- add.w #44*2,d0
- dbra d7,MulsLoop
-
- move.l MatrisAdr(pc),a0
- lea Sinus,a1
- move.w #256-1,d7
- moveq #0,d4
- MatLoop1: move.w #255,d6
- move.w (a1)+,d4
- move.l #-127,d0
- MatLoop2: move.l d4,d3
- muls d0,d3
- asl.l #2,d3
- swap d3
- move.b d3,(a0)+
- addq.w #1,d0
- dbra d6,MatLoop2
- dbra d7,MatLoop1
- rts
-
- MulsList: = $7b000
-
- Screen: dc.l $60000
- dc.l $60000+[128*44]
-
- MatrisAdr: dc.l $40000
- dc.l $60000+[256*44]
-
- ;------------------------------------------------------------------------
-
- MainLoop: cmp.b #-1,$6(a6)
- bne.S MainLoop
- btst #10,$16(a6)
- beq.S MainLoop
-
- move.w #$4,$180(a6)
- bsr VectorBobs
- move.w #$40,$180(a6)
-
- btst #6,$bfe001
- bne.S MainLoop
- rts
-
- ;------------------------------------------------------------------------
-
- Vectorbobs: bsr Buffra
- bsr Rensa
- bsr VinkelAdd
- bsr Rakna
- bsr Plotta
- rts
-
- Buffra: move.l Screen(pc),d0
- move.l Screen+4(pc),Screen
- move.l d0,Screen+4
- lea.l BMap(pc),a0
- moveq #2-1,d7
- BMapLoop: swap d0
- move.w d0,2(a0)
- swap d0
- move.w d0,6(a0)
- addq.l #8,a0
- add.l #44,d0
- dbra d7,BMapLoop
- rts
-
- Rensa: move.l Screen(pc),d0
- moveq #44-40,d2
- move.w #128*64*2+20,d1
- bsr ClearScreen
- rts
-
- VinkelAdd: lea.l Vinklar(pc),a0
- lea.l VAdds(pc),a1
- move.w #512,d1
- moveq #3-1,d7
- VAddLoop: move.w (a0),d0
- add.w (a1)+,d0
- cmp.w d1,d0
- bls.S Nothing
- sub.w d1,d0
- Nothing: move.w d0,(a0)+
- dbra d7,VAddLoop
- rts
-
- Rakna: lea.l Vinklar(pc),a1
- lea.l Posses(pc),a4
- lea.l Per,a5
-
- lea CalcUp(pc),a0
- moveq #3-1,d7
- OllesBoll: move.w (a1)+,d0
- move.w d0,d1
- asl.w #6,d1
- move.w d1,2(a0)
- add.w #128,d0
- cmp.w #512,d0
- bls.S NoD2222
- sub.w #512,d0
- NoD2222: asl.w #6,d0
- move.w d0,(a0)
- addq.l #4,a0
- dbf d7,OllesBoll
-
- lea CalcUp(pc),a1
- lea.l MulsList,a6
- move.l a7,SPSave
- lea.l ObjX(pc),a0
- lea.l ObjY(pc),a2
- lea.l ObjZ(pc),a7
- move.l MatrisAdr(pc),a3
- move.w AntBobs,d7
-
- RakneLoop: move.w (a1)+,d1
- move.w (a1)+,d2
- move.b (a2),d2
- move.b (a3,d2.W),d3
- ext.w d3
- move.b (a7),d1
- move.b (a3,d1.W),d4
- ext.w d4
- sub.w d4,d3
- move.b (a2)+,d1
- move.b (a3,d1.W),d4
- ext.w d4
- move.b (a7)+,d2
- move.b (a3,d2.W),d5
- ext.w d5
- add.w d5,d4
-
- move.w (a1)+,d1
- move.w (a1)+,d2
- move.b (a0),d2
- move.b (a3,d2.W),d5
- ext.w d5
- move.b d3,d1
- move.b (a3,d1.W),d6
- ext.w d6
- sub.w d6,d5
- move.b (a0)+,d1
- move.b (a3,d1.W),d6
- ext.w d6
- move.b d3,d2
- move.b (a3,d2.W),d3
- ext.w d3
- add.w d6,d3
-
- move.w (a1)+,d1
- move.w (a1)+,d2
- move.b d5,d2
- move.b (a3,d2.W),d0
- ext.w d0
- move.b d4,d1
- move.b (a3,d1.W),d6
- ext.w d6
- sub.w d6,d0
- move.b d5,d1
- move.b (a3,d1.W),d5
- ext.w d5
- move.b d4,d2
- move.b (a3,d2.W),d4
- ext.w d4
- add.w d5,d4
-
- add.w #156,d4
- add.w d4,d4
- move.w (a5,d4.W),d2
- muls d2,d0
- muls d2,d3
- lsl.l #5,d0
- lsl.l #5,d3
- swap d0
- swap d3
-
- add.w #176,d0
- add.w #100,d3
-
- move.w d0,d1
- lsr.w #3,d0
- and.w #$f,d1
- ror.w #4,d1
- add.w d3,d3
- move.w (a6,d3.W),d3
- add.w d3,d0
-
- move.w d0,(a4)+
- move.w d1,(a4)+
- move.w d4,(a4)+
- lea -12(a1),a1
- dbra d7,RakneLoop
- lea.l $dff000,a6
- move.l SPSave(pc),a7
- rts
-
- SPSave: dc.l 0
-
- Plotta: lea.l Posses(pc),a0
- move.l Screen+4(pc),d0
- move.l #Bob,d1
- move.l d1,d2
- ;add.l #15*2*2,d2
- move.w #15*64*1+2,d3
- move.w #$fca,d6
-
- bsr BlitWait
- move.l #$ffff0000,$44(a6)
- move.w #2-4,$62(a6)
- move.w #2-4,$64(a6)
- move.w #44-4,$60(a6)
- move.w #44-4,$66(a6)
- move.l d0,$48(a6)
- move.l d0,$54(a6)
- move.l d1,$4c(a6)
- move.l d2,$50(a6)
-
- lea.l $40(a6),a1
- lea.l $4a(a6),a2
- lea.l $4e(a6),a3
- lea.l $52(a6),a4
- lea.l $56(a6),a5
- lea.l $58(a6),a6
-
- move.w AntBobs(pc),d7
-
- PlotLoop: move.w d0,d4
- add.w (a0)+,d4
- move.w (a0)+,d5
- move.w d5,2(a1)
- add.w d6,d5
- move.w d5,(a1)
- move.w d4,(a2)
- move.w d4,(a5)
- move.w d1,(a3)
- move.w d2,(a4)
- move.w d3,(a6)
- addq.w #2,a0
- dbra d7,PlotLoop
- lea.l $dff000,a6
- rts
-
- ;--------------------------------------------------
-
- BMapSize: = 280*44
-
- Posses: blk.w 400*3,0
- Posses2: blk.w 400*3,0
- CalcUp: blk.w 3*2,0
- BobAdr: dc.l 0
-
- Vinklar: dc.w 0
- dc.w 0
- dc.w 0
-
- VAdds: dc.w 0
- dc.w 0
- dc.w 0
-
- ;--------------------------------------------------
-
- ObjX:
- dc.b 5,10,15,0,10,20,0,10,20,0,20,0,20
-
- ObjY:
- dc.b 0,0,0,5,5,5,10,10,10,15,15,20,20
-
- ObjZ:
- dc.b 0,0,0,0,0,0,0,0,0,0,0,0,0
-
- even
-
- AntBobs: dc.w 13-1
-
- ;------------------------------------------------------------------------
-
- CopperList: dc.l $008e6c66,$0090ecc6,$00920030,$009400d8
- dc.l $01020000,$01040000,$0108002c,$010a002c
-
- Cols: dc.l $01800000,$01820fff,$01840fff,$01860fff
- BMap: dc.l $00e00000,$00e20000,$00e40000,$00e60000
- dc.l $01002200
-
- dc.l -2
-
- ;------------------------------------------------------------------------
-
- Per: = $30000
- Bob: = $33000
-
- Sinus: = $35000
-
- org $33000
- load $33000
-
- dc.w %1000000000000000
- blk.w 15,0
-
-
-