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 CopperList+2(pc),a0
- lea BlindSpr(pc),a1
- move.l a1,d0
- moveq #7,d7
- SprLoop: swap d0
- move.w d0,(a0)
- swap d0
- move.w d0,4(a0)
- addq.l #8,a0
- dbf d7,SprLoop
-
- move.l #TomRum,d0
- moveq #0,d2
- move.w #36*64+20,d1
- bsr.S ClearScreen
-
- lea BMap(pc),a0
- move.l #TomRum,d0
- moveq #2,d7
- BML: swap d0
- move.w d0,2(a0)
- swap d0
- move.w d0,6(a0)
- addq.l #8,a0
- dbf d7,BML
-
- 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
-
- lea CopperList(pc),a0
- lea Colors(pc),a1
- lea BMap(pc),a2
- sub.l a0,a1
- sub.l a0,a2
- lea ColAdr(pc),a0
- move.l a1,(a0)+
- move.l a2,(a0)+
-
- lea Pointer(pc),a0
- lea ShowList(pc),a1
- move.l a1,(a0)
- rts
-
-
- CopAdr: dc.l $60000
- dc.l $70000
-
- CopAdd: dc.l 0
-
- MulsAdr: = $65000
- TomRum: = $75000
-
- BarSizes: blk.w 32,0
- BarAddress: blk.l 32,0
-
- BlindSpr: dc.l 0
- ColAdr: dc.l 0
- BMapAdr: dc.l 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.L Bars
- lea WWO(pc),a0
- cmp.w #1,(a0)
- beq.S Humla
- cmp.w #1,(a0)
- bgt.S Humla2
- bsr.s Texten
- ;move.w #$fff,$180(a6)
-
- Ove: lea Exit(pc),a0
- tst.w (a0)
- beq.S MainLoop
- rts
-
- Humla: subq.w #1,(a0)
- bsr InitNext
- bra.S Ove
-
- Humla2: subq.w #1,(a0)
- bra.S Ove
-
- Exit: dc.w 0
-
- ;------------------------------------------------------------------------
-
- DB: dc.w 0
-
- Texten: lea DB(pc),a0
- bchg #0,(a0)
- tst.w (a0)
- beq.S DoIt
- rts
-
- DoIt: lea WaitReg(pc),a0
- tst.w (a0)
- bne.S NotReady
- bsr.s FadeIn
- bsr.s FadeDown
- lea TextReg(pc),a0
- tst.w (a0)
- bne.S NOOO
- lea Exit(pc),a0
- move.w #1,(a0)
- Nooo: rts
-
- NotReady: subq.w #1,(a0)
- lea FadeRegD(pc),a0
- move.w #1,(a0)
- rts
-
- FadeIn: lea FadeRegU(pc),a0
- tst.w (a0)
- bne.S FadeIt1
- rts
- FadeIt1: lea Text,a0
- move.l CopAdr(pc),a1
- add.l ColAdr(pc),a1
- move.l CopAdr+4(pc),a2
- add.l ColAdr(pc),a2
- moveq #0,d2
- moveq #7,d7
- ColLoop1: move.w (a0)+,d1
- move.w 2(a1),d0
- cmp.w d0,d1
- beq.S NoNess
- bsr.s FadeColor
- move.w d0,2(a1)
- move.w d0,2(a2)
- moveq #1,d2
- NoNess: addq.l #4,a1
- addq.l #4,a2
- dbf d7,ColLoop1
- tst.w d2
- bne.S NotFi1
- lea FadeRegD(pc),a0
- moveq #0,d0
- move.l d0,(a0)
- lea WaitReg(pc),a0
- move.w WWW(pc),(a0)
- NotFi1: rts
-
- FadeDown: lea FadeRegD(pc),a0
- tst.w (a0)
- bne.S FadeIt2
- rts
- FadeIt2: move.l CopAdr+4(pc),a1
- add.l ColAdr(pc),a1
- move.l CopAdr(pc),a2
- add.l ColAdr(pc),a2
- moveq #0,d2
- moveq #7,d7
- ColLoop2: moveq #0,d1
- move.w 2(a1),d0
- cmp.w d0,d1
- beq.S NoNess2
- bsr.s FadeColor
- move.w d0,2(a1)
- move.w d0,2(a2)
- moveq #1,d2
- NoNess2: addq.l #4,a1
- addq.l #4,a2
- dbf d7,ColLoop2
- tst.w d2
- bne.S NotFi2
- lea FadeRegD(pc),a0
- moveq #1,d0
- move.l d0,(a0)
- bsr.s InitNext
- NotFi2: rts
-
- FadeColor: move.l d2,-(a7)
- move.w d0,d2
- move.w d1,d3
- moveq #0,d4
- moveq #2,d6
- FL: move.w d2,d0
- move.w d3,d1
- and.w #$f,d0
- and.w #$f,d1
- cmp.w d0,d1
- bhi.S Raise
- cmp.w d0,d1
- blo.S Lower
- bra.S Nextis
- Raise: addq.w #1,d0
- bra.S Nextis
- Lower: subq.w #1,d0
- Nextis: or.w d0,d4
- ror.w #4,d4
- lsr.w #4,d2
- lsr.w #4,d3
- dbf d6,FL
- ror.w #4,d4
- move.w d4,d0
- move.l (a7)+,d2
- rts
-
- InitNext: move.l Pointer(pc),a0
- move.l CopAdr(pc),a1
- add.l BMapAdr(pc),a1
- move.l (a0),d0
- moveq #2,d7
- bsr.S BMapLoop
- move.l CopAdr+4(pc),a1
- add.l BMapAdr(pc),a1
- move.l (a0)+,d0
- moveq #2,d7
- bsr.S BMapLoop
- lea TextReg(pc),a1
- subq.w #1,(a1)
- lea WWW(pc),a1
- move.w (a0)+,(a1)
- lea Pointer(pc),a1
- move.l a0,(a1)
- rts
-
- BMapLoop: swap d0
- move.w d0,2(a1)
- swap d0
- move.w d0,6(a1)
- addq.l #8,a1
- add.l #111*40,d0
- dbf d7,BMapLoop
- rts
-
- WWO: dc.w 160
- WWW: dc.w 0
- Pointer: dc.l 0
- FadeRegD: dc.w 0
- FadeRegU: dc.w 1
- WaitReg: dc.w 0
- TextReg: dc.w 4
- ShowList: dc.l Text+16
- dc.w 100
- dc.l Text+[40*38]+16
- dc.w 100
- dc.l Text+[40*75]+16
- dc.w 100
-
- ;------------------------------------------------------------------------
-
- 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 $01200000,$01220000,$01240000,$01260000
- dc.l $01280000,$012a0000,$012c0000,$012e0000
- dc.l $01300000,$01320000,$01340000,$01360000
- dc.l $01380000,$013a0000,$013c0000,$013e0000
-
- dc.l $008e9a66,$0090bec6,$00920038,$009400d0
- dc.l $01020000,$01040000,$01080000,$010a0000
-
- Colors: dc.l $01800000,$01820000,$01840000,$01860000
- dc.l $01880000,$018a0000,$018c0000,$018e0000
-
- BMap: dc.l $00e00000,$00e20000,$00e40000,$00e60000
- dc.l $00e80000,$00ea0000
-
- dc.l $01003000,$1f07fffe
-
- 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:
-
-