Advertisement
KurkZG4

JDHA WIP (NOT BUG TESTED)

Apr 24th, 2020
2,992
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Subroutine to do a Jump Dash and Homing Attack (By Kurk)
  3. ; ---------------------------------------------------------------------------
  4.  
  5. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  6.  
  7. ;Sonic_HomingAttack:
  8. ; to be coded in the forseeable future.
  9. ; the routine will automatically use the Jumpdash Routine
  10.        
  11.  
  12. Sonic_JumpDash:
  13.         cmpi.b  #2,$1C(a0)          ; is Sonic currently rolling?
  14.         bne.s   Sonic_EndJD     ; if not, branch to rts
  15.         btst    #7,$22(a0)      ; was the Jump Dash flag set?
  16.         bne.s   Sonic_EndJD     ; if yes, branch to rts
  17.         move.b  ($FFFFF603).w,d0
  18.         andi.b  #$70,d0         ; is A,B or C being pressed?
  19.         beq.w   Sonic_EndJD     ; if not, branch to rts
  20.         bset    #7,$22(a0)      ; set the Jump Dash flag
  21.         move.w  #$BC,d0         ; play Jump Dash launch sound
  22.         jsr (PlaySound_Special).l   ; play Jump Dash launch sound (continued)
  23.         move.w  #$700,$10(a0)       ; set the Jump Dash speed
  24.         move.w  #0,$12(a0)      ; clear the current Y-velocity
  25.         btst    #6,$22(a0)      ; is Sonic currently underwater?
  26.         beq.s   Sonic_CheckSpeedShoesForJD
  27.         sub.w   #$300,$10(a0)       ; set Sonic's speed to $600
  28.        
  29. Sonic_CheckSpeedShoesForJD:
  30.         tst.b   ($FFFFFE2E).w       ; does Sonic currently have the speed shoes?
  31.         beq.s   Sonic_DirectionForJD    ; if not, branch to direction check routine
  32.         add.w   #$200,$10(a0)       ; set speed to $B00 or $500 if Sonic is underwater
  33.  
  34. Sonic_DirectionForJD:
  35.         btst    #0,$22(a0)
  36.         beq.s   Sonic_EndJD
  37.         neg.w   $10(a0)
  38.  
  39. Sonic_EndJD:
  40.         rts
  41.  
  42.  
  43. ; End of function Sonic_JumpDash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement