;C prototype: short CollideSprite32 (short x0,short y0,short x1,short y1,short h,void *sprite0,void *sprite1) ; ;short CollideSprite32 (register short x0 asm ("%d0"), ; register short y0 asm ("%d1"), ; register short x1 asm ("%d2"), ; register short y1 asm ("%d3"), ; register short h asm ("%d4"), ; register void *sprite0 asm ("%a0"), ; register void *sprite1 asm ("%a1")); xdef CollideSprite32 CollideSprite32: ;if (x0>x1) cmp.w d2,d0 bls.s _x1_superior exg.w d0,d2 exg.w d1,d3 exg.l a0,a1 _x1_superior: sub.w d0,d2 ;dx->d2 cmpi.w #32,d2 bge.s _no_collide cmp.w d3,d1 bge.s _y0_superior sub.w d1,d3 move.w d3,d1 lsl.w #2,d3 add.w d3,a0 bra.s _continue1 _y0_superior: sub.w d3,d1 move.w d1,d3 lsl.w #2,d3 add.w d3,a1 _continue1: cmp.w d4,d1 bge.s _no_collide addq.w #1,d1 move.l (a0)+,d0 move.l (a1)+,d3 lsr.l d2,d3 and.l d3,d0 beq.s _continue1 moveq.l #1,d0 rts _no_collide: moveq.l #0,d0 rts