Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Subroutine to check for starting to charge a spindash
- ; ---------------------------------------------------------------------------
- ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
- ; AmyLoc_1AC3E:
- Amy_Hammer:
- tst.b Hammer_flag(a0) ;already branched?
- bne.s Amy_UpdateSpindash ;if yes, branch
- move.b (Ctrl_1_Press_Logical).w,d0 ; read controller
- andi.b #button_B_mask|button_C_mask,d0 ; is button B or C pressed
- beq.w Areturn_1AC8C ; if not branch
- move.b #AniIDAmyAni_Spindash,anim(a0) ; set anim to hammer
- move.w #SndID_SpindashRev,d0 ; set sound to spindash rev
- jsr (PlaySound).l ; play it
- addq.l #4,sp ; add 4 to sp
- move.b #1,Hammer_flag(a0) ; puts a 1 in this flag
- move.w #0,Hammer_counter(a0) ; puts a 0 in this flag
- move.b #$0,inertia(a0) ; clear inertia
- move.b #$0,x_vel(a0) ; set x velocity to 0
- +
- bsr.w Amy_LevelBound
- jsr AnglePos
- Areturn_1AC8C:
- rts
- ; End of subroutine Amy_CheckSpindash
- ; ---------------------------------------------------------------------------
- ; Subrouting to update an already-charging spindash
- ; ---------------------------------------------------------------------------
- ; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
- ; Aloc_1AC8E:
- Amy_UpdateSpindash:
- move.b (Ctrl_1_Held_Logical).w,d0 ; read controller
- bne.w Amy_ChargingSpindash ; if not branch
- move.b #0,Hammer_flag(a0) ; puts a 0 in this flag
- moveq #0,d0 ; move 0 to d0
- move.b Hammer_counter(a0),d0 ; move Hammer counter to d0
- add.w d0,d0
- +
- move.b #0,(Sonic_Dust+anim).w ; set 0 in sonic_dust
- bra.s Obj4D_Spindash_ResetScr ; branch 0bj4D_Spindash_ResetScr
- cmpi.b #$5,$1C ; is anim idle
- bne.s AmyReturn_1AC8C ; if not branch
- cmpi.b #$0,$1C ; is anim walking
- bne.s AmyReturn_1AC8C ; if not branch
- rts ; return to subroutine
- ; ===========================================================================
- ; Aloc_1AD30:
- Amy_ChargingSpindash: ; If still charging the dash...
- tst.w Hammer_counter(a0) ; still charging?
- beq.s + ;if yes branch
- move.w Hammer_counter(a0),d0 ; move hammer counter to d0
- lsr.w #5,d0
- sub.w d0,Hammer_counter(a0)
- bcc.s +
- move.w #0,Hammer_counter(a0)
- +
- ; move.b (Ctrl_1_Press_Logical).w,d0
- beq.w Obj4D_Spindash_ResetScr
- ; jsr (PlaySound).l
- ; addi.w #$200,Hammer_counter(a0)
- ; cmpi.w #$800,Hammer_counter(a0)
- ; blo.s Obj4D_Spindash_ResetScr
- ; move.w #$800,Hammer_counter(a0)
- ; Aloc_1AD78:
- Obj4D_Spindash_ResetScr:
- addq.l #4,sp
- Aloc_1AD8C:
- bsr.w Amy_LevelBound
- jsr AnglePos
- rts
- ; End of subroutine Amy_UpdateSpindash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement