Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; routine de sprite jamais fini
- ; taille quelquonque
- ; 2 plan masqué sur 2 plan
- ;
- ;
- ;
- ;
- BSS
- *
- maskW ds.w 1
- maskB ds.w 1
- motif ds.w 2
- *
- largeurSprite ds.w 1
- hauteurSprite ds.w 1
- adrsprite ds.l 1
- listmask
- DATA
- TEXT
- createCodeGen
- move.l adrsprite,a0
- lea spritebuffer,a1
- move.w largeurSprite,d0
- move.w hauteurSprite,d1
- moveq #0,d4
- .copySprite
- move.w d1,d6
- subq.w #1,d6
- .loopLigne
- move.w d0,d7
- subq #1,d7
- .loopLarg
- move.l (a0)+,d2 ; plan 0 plan 1
- move.l d2,(a1)+
- dbf d7,.loopLarg
- move.l d4,(a1)+
- dbf d6,.loopLigne
- lea spritebuffer,a0
- jsr makecodeGen
- jsr rollingSprite
- rollingSprite
- lea spritebuffer,a0
- move.w largeurSprite,d2
- add d2,d2
- add d2,d2
- addq.w #4,d2 ; +1
- move.w hauteursprite,d1
- subq #1,d1
- move.l a0,a1
- .loopligne
- move.w largeurSprite,d0
- ;subq #1,d0
- move.b #0,ccr
- .looprolplan0
- roxr (a0)
- lea 4(a0),a0
- dbf d0,.looprolplan0
- lea 2(a1),a0 ; selection plan 2
- move.w largeurSprite,d0
- move.b #0,ccr
- .looprolplan1
- roxr (a0)
- lea 4(a0),a0
- dbf d0,.looprolplan1
- add d2,a1
- move.l a1,a0
- dbf d1,.loopligne
- rts
- makecodeGen
- ; analyse des masque
- move.w hauteursprite,d0
- move.w largeursprite,d1
- add.w d1,d1
- add.w d1,d1
- lea maskW,a5
- lea spritebuffer,a0
- move.l a0,a1
- lea listemaskcol,a1
- move.w hauteursprite,d0
- subq.w #1,d0
- moveq #0,d4
- .loopmask
- move.w (a0)+,d2
- move.w d2,4(a5) motif
- move.w (a0)+,d3
- move.w d3,6(a5)
- or.w d3,d2
- move.w d2,(a5)
- move.w d4,(a1)+ ; numero de masque
- move.w d2,(a1)+ ; masque ajoute a la liste des masque nb ligne fois
- addq.w #1,d4
- add d1,a0
- dbf d0,.loopmask
- move.w #-1,(a1)+ ; marqueur de fin
- move.w #0,(a1)+
- move.w hauteursprite,d0
- subq.w #1+1,d0
- lea listemaskcol,a1
- move.l a1,a2
- lea listeoccurmask,a3
- listeposmask,a4
- move.w (a1),d4 ;et pas (a1)+ ; numero de masque
- move.w 2(a1),d2 ; masque
- moveq #0,d5
- .search
- move.w (a1)+,d4 ; numero de masque
- tst.w d4
- bmi.s .suite
- move.w (a1)+,d3 ; masque
- cmp.w d2,d3
- bne.s .1
- move.w d4,(a4)+ ; numero dans la liste qu'il faudra enlever
- move.w #$4e71,-4(a1) ; on met un marqueur dans la liste numero de masque, masque
- addq.w #1,d5 ; nombre d'occurence du masque
- .1
- bra.s .search
- .suite
- move.w #-1,(a4)+
- ; dans a4: liste numero de masque semblable le numero de masque seulement
- ; dans d2: masque
- ; on compare le nombre d'occurence
- cmp.w #3,d5
- bgt.s .2
- ; ici d5>3 iteration de masque
- .2
- bsr testmaskd2
- lea listeposmask,a4
- ; retire de la liste des masque
- lea listemaskcol,a1
- .boucle1
- move.w (a4)+,d4
- tst.w d4
- bmi.s .suite2
- move.w (a1)+,d5
- addq.l #2,a1
- cmp.w d4,d5
- beq.s .suprime
- bra.s .boucle1
- .suprime
- move.l a1,a3
- lea -4(a1),a1
- move.l a1,a5
- .3 move.w (a3)+,d7
- tst.w d7
- bmi.s .termine
- swap d7
- move.w (a3)+,d7
- move.l d7,(a1)+
- bra.s .3
- .termine
- move.l #$FFFF0000,(a1)+
- move.l a5,a1
- bra.s .boucle1
- .suite2
- clearoccurence4e71
- lea listemaskcol,a1
- move.l a1,a2
- .loop
- move.w (a2)+,d0
- tst.w d0
- bmi.s .finloop
- move.w (a2)+,d1
- cmp.w #$4e71,d0
- bne.s .1
- .0 move.w (a2)+,d0
- bmi.s .finloop
- move.w (a2)+,d1
- cmp.w #$4e71,d0
- beq.s .0
- .1 move.w d0,(a1)+
- move.w d1,(a1)+
- bra.s .loop
- .finloop
- move.l #$FFFF0000,(a1)+
- rts
- testmaskd2
- move.w d2,d3 ; d3 = masque
- not.w d3 ; not mask
- tst.w d3 ; mask = FFFF ? <=> not mask = 0
- beq.s .labelFFFF
- not.w d3 ,not not mask = mask
- move.w d3,d6
- tst.b d3 ; XX00
- beq.s .labelaa00
- ; d3.b contient quelquechose
- rol.w #8,d3
- tst.b d3
- beq.s .label00aa
- move.w d6,d3
- .labelaabb
- ; and.l #maskmask,dep(a0) ; separable
- ; or.l #orvalue,dep(a0)
- st.b flagMaskLong
- sf.b flagMaskWord
- st.b separable
- sf.b nomask
- rts
- .labelaa00
- cmp.w #$FF00,d3
- beq.s .labelFF00
- ; movep.w dep(a0),d6
- ; and.w #valueFF,d6
- ; or.w #value00,d6
- ; movep.w d6,dep(a0)
- sf.b flagMaskLong
- st.b flagMaskWord
- sf.b separable ; n'est pas separable du bitmap a or-é
- sf.b nomask
- rts
- .labelFF00
- ; no mask
- move.w #valuevalue,d6
- movep.w d6,dep(a0)
- st.b nomask
- rts
- .label00aa
- move.w d6,d3
- cmp.w #$00FF,d3
- beq.s .label00FF
- movep.w dep+1(a0),d6
- and.w #aaaa,d6
- or.w #value,d6
- movep.w d6,dep+1(a0)
- st.b flagMaskWord
- sf.b flagMaskLong
- sf.b separable
- sf.b nomask
- rts
- .label00FF
- ; move.w #aaaa,d6
- ; movep.w d6,1+dep(a0)
- move.w d6,d3
- and.w #$00FF,d3
- tst.w d3
- beq.s .labelFF00
- .other
- ; masquage normal (?)
- cmp.w #3,d4 ; nombre d'occurence >=3 occurence ?
- bsr serialmasquage
- bra.s .suite
- .labelFFFF
- ; move.l #value,dep(a0), pas de masquage donc on oublie les masque
- .label00FF
- move.w #valuevalue,d6
- movep.w d6,dep+1(a0) ; pas de masquage non plus
- .labelFF00
- move.w #valuevalue,d6
- movep.w d6,dep(a0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement