Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Subroutine to do a Jump Dash and Homing Attack (By Kurk)
- ; ---------------------------------------------------------------------------
- ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
- ;Sonic_HomingAttack:
- ; to be coded in the forseeable future.
- ; the routine will automatically use the Jumpdash Routine
- Sonic_JumpDash:
- cmpi.b #2,$1C(a0) ; is Sonic currently rolling?
- bne.s Sonic_EndJD ; if not, branch to rts
- btst #7,$22(a0) ; was the Jump Dash flag set?
- bne.s Sonic_EndJD ; if yes, branch to rts
- move.b ($FFFFF603).w,d0
- andi.b #$70,d0 ; is A,B or C being pressed?
- beq.w Sonic_EndJD ; if not, branch to rts
- bset #7,$22(a0) ; set the Jump Dash flag
- move.w #$BC,d0 ; play Jump Dash launch sound
- jsr (PlaySound_Special).l ; play Jump Dash launch sound (continued)
- move.w #$700,$10(a0) ; set the Jump Dash speed
- move.w #0,$12(a0) ; clear the current Y-velocity
- btst #6,$22(a0) ; is Sonic currently underwater?
- beq.s Sonic_CheckSpeedShoesForJD
- sub.w #$300,$10(a0) ; set Sonic's speed to $600
- Sonic_CheckSpeedShoesForJD:
- tst.b ($FFFFFE2E).w ; does Sonic currently have the speed shoes?
- beq.s Sonic_DirectionForJD ; if not, branch to direction check routine
- add.w #$200,$10(a0) ; set speed to $B00 or $500 if Sonic is underwater
- Sonic_DirectionForJD:
- btst #0,$22(a0)
- beq.s Sonic_EndJD
- neg.w $10(a0)
- Sonic_EndJD:
- rts
- ; End of function Sonic_JumpDash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement