home *** CD-ROM | disk | FTP | other *** search
- ;------------------------------------------------------------------------
- ;- -
- ;- 'RasterBalk - Rymd' -
- ;- -
- ;------------------------------------------------------------------------
-
- org $20000
- load $20000
-
- >EXTERN 'Perspektiv2',Per
- >EXTERN 'BalkSin',Sin
- >EXTERN 'Welcome',Text
-
- ;------------------------------------------------------------------------
-
- S: movem.l d0-d7/a0-a6,-(sp)
- bsr.s Startup
- bsr.L InitRutin
- bsr.s StartCop
- bsr.L MainLoop
- bsr.s RestoreCop
- movem.l (sp)+,d0-d7/a0-a6
- rts
-
- Startup: move.l $4.W,a6
- lea.l Lib(pc),a1
- lea OldCop(pc),a2
- moveq #0,d0
- moveq #15,d3
- jsr -408(a6)
- move.l d0,a0
- move.l $26(a0),(a2)+
- lea.l $dff000,a6
- move.w 2(a6),d0
- bset d3,d0
- move.w d0,(a2)+
- move.w $1c(a6),d0
- bset d3,d0
- move.w d0,(a2)+
- rts
-
- StartCop: lea CopperList(pc),a0
- move.l a0,$80(a6)
- tst.w $88(a6)
- move.w #$7fff,d0
- move.w d0,$96(a6)
- move.w d0,$9a(a6)
- move.w #$87c0,$96(a6)
- move.w #$c000,$9a(a6)
- rts
-
- RestoreCop: lea OldCop(pc),a0
- move.l (a0)+,$80(a6)
- tst.w $88(a6)
- move.w (a0)+,$96(a6)
- move.w (a0)+,$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: lea CopAdr(pc),a3
- movem.l (a3),a0-a1
- moveq #-2,d0
- lea.l CopperList(pc),a2
- MLoop: move.l (a2),(a0)+
- move.l (a2)+,(a1)+
- cmp.l (a2),d0
- bne.S MLoop
-
- move.l a0,d0
- sub.l (a3),d0
- lea CopAdd(pc),a2
- move.l d0,(a2)
-
- move.l #$2007fffe,d0
- move.l #$01800000,d1
- move.l #$20ddfffe,d2
- move.l #$01000000,d3
- move.w #281-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
- moveq #-2,d0
- move.l d0,(a0)+
- move.l d0,(a1)+
-
- lea BarSizes+64(pc),a0
- moveq #2,d0
- moveq #31,d7
- BarLoop1: move.w d0,d1
- lsl.w #6,d1
- addq.w #1,d1
- move.w d1,-(a0)
- addq.w #1,d0
- dbf d7,BarLoop1
-
- lea BarAddress+128(pc),a0
- lea CopperBar(pc),a1
- moveq #32*2,d0
- moveq #32-1,d7
- BarLoop2: move.l a1,-(a0)
- add.l d0,a1
- subq.w #2,d0
- dbf d7,BarLoop2
-
- lea MulsAdr,a0
- moveq #0,d0
- moveq #12,d1
- move.w #344-1,d7
- ML: move.w d0,(a0)+
- add.w d1,d0
- dbf d7,ML
- rts
-
-
- CopAdr: dc.l $60000
- dc.l $70000
- CopAdd: dc.l 0
- MulsAdr: = $65000
-
- BarSizes: blk.w 32,0
- BarAddress: blk.l 32,0
-
- ;------------------------------------------------------------------------
-
- MainLoop: tst.b $6(a6)
- bne.S MainLoop
- tst.b $5(a6)
- bne.S MainLoop
- btst #10,$16(a6)
- beq.S MainLoop
-
- ;move.w #$ff,$180(a6)
- bsr.s Bars
- ;move.w #$fff,$180(a6)
-
- btst #6,$bfe001
- bne.S MainLoop
- rts
-
- ;------------------------------------------------------------------------
-
- Bars: bsr.s Buffra
- bsr.s Rensa
- bsr.s Sinus
- bsr.L Rakna
- bsr.L Plotta
- rts
-
- Buffra: lea CopAdr(pc),a0
- move.l (a0),d0
- move.l 4(a0),(a0)+
- move.l d0,(a0)
- move.l d0,$80(a6)
- tst.w $88(a6)
- rts
-
- Rensa: lea CopAdr(pc),a0
- move.l (a0),d0
- add.l 8(a0),d0
- addq.l #6,d0
- moveq #12-2,d2
- move.w #281*64+1,d1
- bsr.L ClearScreen
- rts
-
- Sinus: lea Ollie(pc),a0
- move.w (a0),d0
- move.w #1000,d1
- addq.w #1,d0
- cmp.w d1,d0
- blo.S NoOllie
- sub.w d1,d0
- NoOllie: move.w d0,(a0)
- add.w d0,d0
- lea Sin,a0
- move.w (a0,d0.W),d0
- and.w #127,d0
- add.w #-204,d0
- lea YPos(pc),a0
- move.w d0,(a0)
-
- lea ZPos(pc),a0
- move.w (a0),d4
- sub.w #6,d4
- cmp.w #480,d4
- bge.S NoNewZ
- add.w #120,d4
- NoNewZ: move.w d4,(a0)
- rts
-
- Ollie: dc.w 0
- YPos: dc.w -140
- ZPos: dc.w 1400
-
- Rakna: lea BalkPosses(pc),a0
- lea Per(pc),a1
- move.w ZPos(pc),d0
- move.w #128,d4
- move.w YPos(pc),d5
- moveq #AntZ-1,d7
- BL1: moveq #AntY-1,d6
- move.w d5,d1
- BL2: move.w (a1,d0.W),d2
- move.w d2,d3
- muls d1,d2
- lsl.l #3,d2
- swap d2
- move.w d3,(a0)+
- add.w #204,d2
- move.w d2,(a0)+
- add.w d4,d1
- dbf d6,BL2
- sub.w #120,d0
- dbf d7,BL1
- rts
-
- Plotta: lea BalkPosses(pc),a0
- lea CopperBar(pc),a1
- lea BarAddress-4(pc),a2
- lea MulsAdr,a3
- lea Nuffror(pc),a4
- move.l CopAdr(pc),d5
- add.l CopAdd(pc),d5
- addq.w #6,d5
-
- bsr.L BlitWait
- moveq #-1,d0
- move.l d0,$44(a6)
- move.l #$09f00000,$40(a6)
- moveq #12-2,d0
- move.l d0,$64(a6)
-
- moveq #AntY*10-1,d7
- PLoop: move.w (a0)+,d0
- lsr.w #7,d0
- and.w #$fffc,d0
- move.l (a2,d0.W),d3
- lsr.w #2,d0
- move.w (a0)+,d1
- move.w d0,d4
- lsr.w #1,d4
- sub.w d4,d1
- cmp.w (a4)+,d1
- bgt.S NoBar
- cmp.w (a4)+,d1
- bgt.S NoUpper
-
- cmp.w #32,d1
- bls.S NoBar
- moveq #64,d4
- sub.w d1,d4
- cmp.w d0,d4
- bge.S NoBar
- sub.w d4,d0
- add.w d4,d4
- add.w d4,d3
- moveq #64,d1
-
- NoUpper: sub.w (a4),d1
- lsl.w #6,d0
- addq.w #1,d0
- move.l d5,d4
- add.w d1,d1
- add.w (a3,d1.W),d4
- BW: btst #14,2(a6)
- bne.S BW
- movem.l d3-d4,$50(a6)
- move.w d0,$58(a6)
- NoBar: lea Nuffror(pc),a4
- dbf d7,PLoop
- rts
-
- Nuffror: dc.w 354,64,64
-
- AntZ: = 5
- AntY: = 4
-
- BalkPosses: blk.w 2*[AntZ*AntY]*2,0
-
- ;------------------------------------------------------------------------
-
- CopperList: dc.l $008e4866,$009010c6,$00920030,$009400d8
- dc.l $01020000,$01040000,$01080000,$010a0000
-
- dc.l $01800000
- dc.l $01000000
-
- dc.l -2
-
- ;------------------------------------------------------------------------
-
- CopperBar:
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00,$e00,$f00
- dc.w $f00,$e00,$d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00,$e00
- dc.w $f00,$e00,$d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00,$e00
- dc.w $e00,$d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00
- dc.w $e00,$d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00
- dc.w $d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00
- dc.w $d00,$c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00
- dc.w $c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00
- dc.w $c00,$b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00
- dc.w $b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00
- dc.w $b00,$a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900,$a00
- dc.w $a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900
- dc.w $a00,$900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800,$900
- dc.w $900,$800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800
- dc.w $900,$800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700,$800
- dc.w $800,$700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600,$700
- dc.w $800,$700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600,$700
- dc.w $700,$600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500,$600
- dc.w $700,$600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500,$600
- dc.w $600,$500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400,$500
- dc.w $600,$500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400,$500
- dc.w $500,$400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300,$400
- dc.w $500,$400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300,$400
- dc.w $400,$300,$200,$100,$000
- dc.w $000,$100,$200,$300
- dc.w $400,$300,$200,$100,$000
-
- dc.w $000,$100,$200,$300
- dc.w $300,$200,$100,$000
- dc.w $000,$100,$200
- dc.w $300,$200,$100,$000
-
- dc.w $000,$100,$200
- dc.w $200,$100,$000
- dc.w $000,$100
- dc.w $200,$100,$000
-
- dc.w $000,$100
- dc.w $100,$000
- dc.w $000
- dc.w $100,$000
-
- dc.w $000
- dc.w $000
- dc.w $000
- dc.w $000
-
- Per: = $25000
- Sin: = $40000
- Text: = $50000
- ss:
-
-