Advertisement
Guest User

Four Dir. Dash (mod by Suler, JD code by Vladikcomper)

a guest
Jan 10th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Subroutine to do Jump Dash (code by Vladikcomper)  mod by Suler_Ma(d)X well.
  3. ; ---------------------------------------------------------------------------
  4.  
  5. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  6.  
  7.         if _JUMPDASH_
  8. Sonic_JumpDash:
  9.         cmpi.b  #2,$1C(a0)          ; is Sonic rolling?
  10.         bne.w   Sonic_JD_Rts        ; if no, branch
  11.         btst    #7,$22(a0)      ; was Jump Dash flag set?
  12.         bne.w   Sonic_JD_Rts        ; if yes, branch
  13.         tpress  A+B+C,(SonicControl)    ; is A, B or C pressed?
  14.         beq.w   Sonic_JD_Rts        ; if not, branch
  15.         bset    #7,$22(a0)      ; set Jump Dash flag
  16.         btst    #iUp,(Joypad|Held)  ; is left being pressed?
  17.         bne.w   UpDash          ; if not, branch
  18.         btst    #iDown,(Joypad|Held)    ; is left being pressed?
  19.         bne.w   DiveDash            ; if not, branch
  20.         move.w  #$BC,d0         ; play JD sound
  21.         jsr (PlaySound_Special).l   ;
  22.         move.w  #$C00,$10(a0)       ; set Jump Dash speed
  23.         move.w  #0,$12(a0)      ; clear Y-velocity
  24.         btst    #6,$22(a0)      ; is Sonic underwater?
  25.         beq.s   Sonic_JD_ChkShoes
  26.         subi.w  #$300,$10(a0)       ; set speed to $600
  27.         bra.w   Sonic_JD_ChkShoes
  28.        
  29. UpDash:
  30.         move.w  #-$700,$12(a0)      ; set Jump Dash speed
  31.         move.w  #$A0,d0         ; play JD sound
  32.         jsr (PlaySound_Special).l   ;
  33.         bra.w   Sonic_JD_Rts
  34.        
  35. DiveDash:
  36.         move.w  #$C00,$12(a0)       ; set Jump Dash speed
  37.         move.w  #$AE,d0         ; play JD sound
  38.         jsr (PlaySound_Special).l   ;
  39.         bra.w   Sonic_JD_Rts
  40.        
  41. Sonic_JD_ChkShoes:
  42.         tst.b   ($FFFFFE2E).w       ; does Sonic have speed shoes?
  43.         beq.w   Sonic_JD_ChkOrientation ; if not, branch
  44.  
  45. Sonic_JD_ChkOrientation:
  46.         btst    #0,$22(a0)
  47.         beq.s   Sonic_JD_Rts
  48.         neg.w   $10(a0)
  49.  
  50. Sonic_JD_Rts:
  51.         rts
  52.         endc            
  53. ; End of function Sonic_JumpDash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement