-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCDSpindash.asm
executable file
·87 lines (78 loc) · 2.15 KB
/
SCDSpindash.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmp.b #2,($FFFFFFF6).w ; is the character actually metal?
bne.s Return
cmpi.b #$04, ($FFFFFFF6).w ; if player flag set?
beq.s Return
Metal_Dash:
btst #0,$39(a0)
bne.s Sonic_SpinDashLaunch
cmpi.b #8,$1C(a0) ;check to see if your ducking
bne.s Return
move.b ($FFFFF603).w,d0
andi.b #%01110000,d0
beq.w Return
move.b #1,$1C(a0)
move.w #0,$3A(a0)
move.w #$D2,d0
jsr (PlaySound_Special).l ; Play spindash charge sound
addq.l #4,sp
bset #0,$39(a0)
bsr.w Sonic_LevelBound
bsr.w Sonic_AnglePos
Return:
rts
; ---------------------------------------------------------------------------
Sonic_SpinDashLaunch:
move.b #$24,$1C(a0) ;charging spindash animation (walking to running to spindash sprites)
move.b #$E,$16(a0) ; Setup collision range
move.b ($FFFFF602).w,d0
btst #1,d0
bne.w Sonic_SpinDashCharge
bclr #0,$39(a0) ; stop Dashing
cmpi.b #$1E,$3A(a0) ; have we been charging long enough?
bne.s Sonic_SpinDash_Stop_Sound
; move.b #2,$1C(a0) ; launches here (spindash sprites)
bset #2,$22(a0) ; set rolling bit
move.b #$E,$16(a0) ; Setup collision range
move.w #1,$10(a0) ; force X speed to nonzero for camera lag's benefit
move.w #$0A00,$14(a0) ;Set sonic's speed
move.w $14(a0),d0
subi.w #$800,d0
add.w d0,d0
andi.w #$1F00,d0
neg.w d0
addi.w #$2000,d0
;move.w d0,(v_cameralag).w
btst #0,$22(a0)
beq.s @dontflip
neg.w $14(a0)
; jmp Obj01_DoRoll
@dontflip:
;bset #2,$22(a0)
bclr #7,$22(a0)
move.w #$D3,d0
jsr (PlaySound_Special).l
move.w #$D4,d0
jsr (PlaySound_Special).l
bra.w Sonic_SpinDashResetScr
; ---------------------------------------------------------------------------
Sonic_SpinDashCharge: ; If still charging the dash...
cmpi.b #$1E,$3A(a0)
beq.s Sonic_SpinDashResetScr
addi.b #1,$3A(a0)
jmp Sonic_SpinDashResetScr
Sonic_SpinDash_Stop_Sound:
move.w #$D3,d0
jsr (PlaySound_Special).l
move.b #$13,$16(a0)
Sonic_SpinDashResetScr:
addq.l #4,sp ; increase stack ptr
cmpi.w #$60,($FFFFF73E).w
beq.s End
bcc.s @skip
addq.w #4,($FFFFF73E).w
@skip:
subq.w #2,($FFFFF73E).w
End:
bsr.w Sonic_LevelBound
bsr.w Sonic_AnglePos
rts