home *** CD-ROM | disk | FTP | other *** search
- *
- * 1. move.w #149,antal ;# of bobs-1/2
- * 2. move.l #32,choice ;even 0-36 (curve)
- *
- * 1. 149 betyder 300 eftersom (149+1)*2=300
- * helften av bobarna er en mirror kopia.
- *
- * 2. 32 betyder bana 32, helt enkelt hur
- * proggy ska 'hoppa' i sinus & coslistan
- *
- * PS. det er fullt med fula tricks i denna kod
- * men vitsen med den er att ni ska fo principen
- * klar over hur det funkar.... DS.
- *
-
- opt c-
- section mycode,code_c
- incdir asmdisk1:binary/
-
- move.l #main,$80 ;Exeption!
- trap #0 ;first trix!
- moveq #0,d0
- rts
-
- main bsr preset
- bsr dubbuf
- bsr blitset
- bsr initcop
- bsr curve
-
- mouse btst #6,$bfe001
- bne mouse
-
- bsr stopcop
- rte
-
- preset move.w #149,antal ;# of bobs-1/2
- move.l #32,choice ;even 0-36 (curve)
- move.w #$0fca,d3 ;Minterm (Cookie-cut)
- move.l #mask,d4 ;Source A Pointer (mask)
- move.l #shape,d5 ;Source B Pointer (Shape)
- move.w #$0782,d6 ;BlitSize (16*30)
- move.l #$ffffffff,$dff044 ;BlitWord-Mask F & L (Source)
- move.w #28,$dff060 ;Source C Modulo
- move.w #1,$dff062 ;Source B Modulo
- move.w #1,$dff064 ;Source A Modulo
- move.w #28,$dff066 ;Destination D Modulo
- move.l #$dff000,a6 ;Offset to Hardware.
- rts
-
- blitset move.l prebuf,$dff048 ;Source C Pointer (Backgrnd)
- move.l #shape,$dff04c ;Source B Pointer (Bob)
- move.l #mask,$dff050 ;Source A pointer (Mask)
- rts
-
- initcop
- move.w $dff002,olddma
- bset #15,olddma ;Nasty!
- move.l #mycopper,$dff080
- clr.w $dff088
- move.w #%0111111111111111,$dff09a ;off all IRQ
- move.w #%1100000000010000,$dff09a ;Use Master & Copper IRQ
- move.w #%0000000000010000,$dff09c ;off Copper IRQ
- move.w #%0111111111111111,$dff096 ;off all DMA
- move.w #%1000001111000000,$dff096 ;on blten,copen,bplen,dmaen
- move.w #%1000010000000000,$dff096 ;Blitter Nasty on!
- move.l $6c,oldirq
- move.l #newirq,$6c
- move.l #0,$dff144 ;Kill all Sprites
- rts
-
- stopcop move.l oldirq,$6c
- move.w #%1110000001111111,$dff09a
- move.l 4,a6
- move.l 156(a6),a5 ;156 -> graphics.lib.
- move.l 38(a5),$dff080 ;Reactivate WB-Copper
- clr.w $dff088
- move.w #%0111111111111111,$dff096 ;off all DMA
- move.w olddma,$dff096 ;on normal DMA
- rts
-
- newirq bsr dubbuf ;Shift bitmap
- bsr clsbuf ;Clear previous
- bsr barrel ;Fix bliter shifts
- bsr putbobs ;put bob on bitmap
- move.w #16,$dff09c ;off copper IRQ
- rte ;Exit
-
- dubbuf lea bufptrs(pc),a0
- adda.w offset,a0
- move.l (a0),prebuf
- move.l (a0),d0
- move.w d0,pln1l
- swap d0
- move.w d0,pln1h
- swap d0
- addi.w #32,d0
- move.w d0,pln3l
- swap d0
- move.w d0,pln3h
- swap d0
- addi.w #$2fa0,d0
- move.w d0,pln2l
- swap d0
- move.w d0,pln2h
- swap d0
- addi.w #32,d0
- move.w d0,pln4l
- swap d0
- move.w d0,pln4h
- eori.w #4,offset ;Shifts between bitmaps
- rts
-
- clsbuf btst #14,$dff002
- bne clsbuf
- clr.l $dff064 ;No shift A & D
- move.l #$01000000,$dff040 ;D on!
- move.l prebuf,$dff054 ;Dest. D ptr.
- move.w #$3020,$dff058 ;BlitSize
- rts
-
- barrel lea cdptrs(pc),a0 ;Close your eyes now if
- lea shifts(pc),a2 ;you do NOT like TRIX!!
- lea cosinus(pc),a4 ;x
- lea sinus(pc),a5 ;y
-
- lsbptr1 addi.w #2,tabendl ;This is very nasty!!!
- msbptr1 addi.w #0,tabendh ; but i don't care...
- cmpi.w #720,tabendl
- bmi.s hiptr
- clr.w tabendl
- hiptr cmpi.w #720,tabendh
- bmi.s loptr
- clr.w tabendh
- loptr adda.w tabendl,a4
- adda.w tabendh,a5
-
- move.w antal,d7
- ext.l d7
- getnxt move.w (a5),d0
- lsbptr2 adda.w #2,a5
- lsl.w #6,d0
- move.w (a4),d2
- msbptr2 adda.w #0,a4
- move.w d2,d1
- andi.w #$000f,d1
- ror.w #4,d1
- lsr.w #3,d2
- add.w d0,d2
- add.w prebuf+2,d2
- move.w d2,(a0)+
- move.w d1,(a2)+
- dbf d7,getnxt
- rts
-
- putbobs lea shifts(pc),a2
- lea cdptrs(pc),a0
- wblit btst #14,$dff002
- bne wblit
- move.w #1,$dff064 ;Source A Modulo
- move.w #28,$dff066 ;Dest. D Modulo
- move.w antal,d7
- ext.l d7 ;Make Long
- nxtbob move.w (a2)+,d1
- move.w d1,$42(a6) ;BLTCON1
- or.w d3,d1 ;Minterm
- move.w d1,$40(a6) ;BLTCON0
- move.w (a0),$4a(a6) ;Source C (LOW)
- move.w (a0)+,$56(a6) ;Dest. D (LOW)
- move.w d4,$52(a6) ;Source A (LOW)
- move.w d5,$4e(a6) ;Source B (LOW)
- move.w d6,$58(a6) ;BLTSIZE (16*30)
- dbf d7,nxtbob
- rts
-
- curve movem.l a0-a4/d0-d4,-(a7)
- move.w #0,tabendl
- move.w #180,tabendh
- lea order1(pc),a0
- lea order2(pc),a1
- lea order3(pc),a2
- lea order4(pc),a3
- clr.l d0
- move.l choice,d0
- move.w 0(a0,d0.l),msbptr2+2 ;Ops! illegal again!
- move.w 0(a1,d0.l),lsbptr2+2
- move.w 0(a2,d0.l),lsbptr1+2
- move.w 0(a3,d0.l),msbptr1+2
- movem.l (a7)+,a0-a4/d0-d4
- rts
-
-
- prebuf dc.l $70000 ;Bitmap at ABS. addr.
- bufptrs dc.l $70000,$75000 ;makes the code shorter.
- offset dc.w 4
- choice dc.l 0
-
- order1 dc.w 2,8,18,8,30,8, 2,4,12,6, 4,12,4,2,10,92,22,118,10
- order2 dc.w 2,8,22,8,14,4,34,2,46,8,12,12,2,4, 4, 2,12, 2, 8
- order3 dc.w 2,4, 2,0, 2,4, 2,6, 2,2, 2, 2,2,8, 2, 2, 2, 2, 2
- order4 dc.w 0,2, 2,4, 2,6, 2,0, 0,2, 8, 0,8,2, 2, 4, 2, 2, 2
-
- dc.w 0,0,0,0,0,0,0,0
-
-
- mycopper
- dc.w $0182,$0093 ;also the colors are set up
- dc.w $0184,$0093 ;in a specific order.
- dc.w $0186,$0093 ;So when two bobs 'cross' each
- dc.w $0188,$0063 ;other they wont't produce
- dc.w $018a,$0043 ;another color...
- dc.w $018c,$0063
- dc.w $018e,$0043
- dc.w $0190,$0063
- dc.w $0192,$0093
- dc.w $0194,$0043
- dc.w $0196,$0093
- dc.w $0198,$0063
- dc.w $019a,$0043
- dc.w $019c,$0063
- dc.w $019e,$0043
- dc.w $0100,$4200
- dc.w $0102,$0000
- dc.w $008e,$4ca1
- dc.w $0090,$12a1
- dc.w $0092,$0048
- dc.w $0094,$00c0
- dc.w $0108,32 ;32 bytes off screen (This is the trick...)
- dc.w $010a,-96 ;32*3=96 (to get so many bobs!)
- dc.w $0180
- dc.w 0,$00e0 ;4 bitplanes but we do NOT
- pln1h dc.w 0,$00e2 ;get 16 colors on bobs....
- pln1l dc.w 0,$00e4
- pln2h dc.w 0,$00e6
- pln2l dc.w 0,$00e8
- pln3h dc.w 0,$00ea
- pln3l dc.w 0,$00ec
- pln4h dc.w 0,$00ee
- pln4l dc.w 0
- dc.w $009c,$8010
- dc.w $ffdf,$fffe,$1001,$fffe ;a good one!
- dc.w $0100,$0200 ;Garbage off! he he..
- dc.w $ffff,$fffe
-
- olddma dc.l 0
- oldirq dc.l 0
- tabendl dc.w 0
- tabendh dc.w 0
- antal dc.w 0
- even
- cdptrs dcb.w 510,0
- shifts dcb.w 510,0
- even
- dcb.w 100,0
- cosinus incbin 'cosinus'
- dcb.w 50,0
- sinus incbin 'sinus'
- dcb.w 50,0
- shape incbin 'shape' ;more tricks here!
- mask incbin 'shadow'
-
-
-
-