Guest User

Untitled

a guest
Feb 15th, 2019
108
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Subroutine to check for starting to charge a Hammer
  3. ; ---------------------------------------------------------------------------
  4.  
  5. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  6.  
  7. ; AmyLoc_1AC3E:
  8. Amy_Hammer:
  9. tst.b Hammer_flag(a0) ;already branched?
  10. bne.s Amy_UpdateHammer ;if yes, branch
  11. move.b (Ctrl_1_Press_Logical).w,d0 ; read controller
  12. andi.b #button_B_mask|button_C_mask,d0 ; is button B or C pressed
  13. beq.w Areturn_1AC8C ; if not branch
  14. move.b #AniIDAmyAni_Hammer,anim(a0) ; set anim to hammer
  15. move.w #SndID_HammerRev,d0 ; set sound to Hammer rev
  16. jsr (PlaySound).l ; play it
  17. addq.l #4,sp ; add 4 to sp
  18. move.b #1,Hammer_flag(a0) ; puts a 1 in this flag
  19. move.w #0,Hammer_counter(a0) ; puts a 0 in this flag
  20.  
  21. +
  22.  
  23. bsr.w Amy_LevelBound
  24. jsr AnglePos
  25.  
  26. Areturn_1AC8C:
  27. rts
  28.  
  29.  
  30. ; ---------------------------------------------------------------------------
  31. ; Subrouting to update an already-charging Hammer
  32. ; ---------------------------------------------------------------------------
  33.  
  34. ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
  35.  
  36. ; Aloc_1AC8E:
  37. Amy_UpdateHammer:
  38. move.b (Ctrl_1_Held_Logical).w,d0 ; read controller
  39. andi.b #button_B_mask|button_C_mask,(Ctrl_1_Held_Logical).w ; is b or C pressed
  40. bne.w Amy_ChargingHammer ; if not branch
  41.  
  42. move.b #0,Hammer_flag(a0) ; puts a 0 in this flag
  43. moveq #0,d0 ; move 0 to d0
  44. move.b Hammer_counter(a0),d0 ; move Hammer counter to d0
  45. add.w d0,d0
  46. move.b #$0,inertia(a0) ; clear inertia
  47. move.b #$0,x_vel(a0) ; set x velocity to 0
  48.  
  49.  
  50. +
  51. bra.s Obj4D_Hammer_ResetScr ; branch 0bj4D_Hammer_ResetScr
  52. cmpi.b #$5,$1C ; is anim idle
  53. bne.s AReturn_1AC8C ; if not branch
  54. cmpi.b #$0,$1C ; is anim walking
  55. bne.s AReturn_1AC8C ; if not branch
  56.  
  57. rts ; return to subroutine
  58. ; ===========================================================================
  59. ; Aloc_1AD30:
  60. Amy_ChargingHammer:
  61. move.b (Ctrl_1_Held_Logical).w,d0 ; read controller ; If still charging the dash...
  62. tst.w Hammer_counter(a0) ; still charging?
  63. beq.s + ;if yes branch
  64. move.w Hammer_counter(a0),d0 ; move hammer counter to d0
  65. lsr.w #5,d0
  66. sub.w d0,Hammer_counter(a0)
  67. bcc.s +
  68. move.w #0,Hammer_counter(a0)
  69.  
  70. +
  71.  
  72.  
  73. bra.w Obj4D_Hammer_ResetScr
  74.  
  75.  
  76. beq.s Aloc_1AD8C
  77. rts
  78. ; Aloc_1AD78:
  79. Obj4D_Hammer_ResetScr:
  80. addq.l #4,sp
  81.  
  82. Aloc_1AD8C:
  83. bsr.w Amy_LevelBound
  84. jsr AnglePos
  85. rts
  86.  
  87.  
  88. ; End of subroutine Amy_Hammer
RAW Paste Data