-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathancilla_sword_swing_sparkle.asm
188 lines (128 loc) · 4.07 KB
/
ancilla_sword_swing_sparkle.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
; ==============================================================================
; \note Each of these groupings corresponds to a different direction.
; Interestingly enough, I think the chr and properties are identical
; for all 3 directions. No surprise there, I guess.
; $45596-$45659 DATA
pool Ancilla_SwordSwingSparkle:
{
.chr
db $B7, $B7, $FF
db $80, $80, $B7
db $83, $83, $80
db $83, $FF, $FF
db $B7, $B7, $FF
db $80, $80, $B7
db $83, $83, $80
db $83, $FF, $FF
db $B7, $B7, $FF
db $80, $80, $B7
db $83, $83, $80
db $83, $FF, $FF
db $B7, $B7, $FF
db $80, $80, $B7
db $83, $83, $80
db $83, $FF, $FF
.properties
db $00, $00, $FF
db $00, $00, $00
db $80, $80, $00
db $80, $FF, $FF
db $00, $00, $FF
db $00, $00, $00
db $80, $80, $00
db $80, $FF, $FF
db $00, $00, $FF
db $00, $00, $00
db $80, $80, $00
db $80, $FF, $FF
db $00, $00, $FF
db $00, $00, $00
db $80, $80, $00
db $80, $FF, $FF
.y_offsets
db -22, -18, -1
db -22, -18, -17
db -22, -18, -17
db -17, -1, -1
db 35, 40, -1
db 35, 40, 37
db 35, 40, 37
db 37, -1, -1
db 2, 7, -1
db 2, 7, 19
db 2, 7, 19
db 19, -1, -1
db 2, 7, -1
db 2, 7, 19
db 2, 7, 19
db 19, -1, -1
.y_offsets
db 5, 10, -1
db 5, 10, -4
db 5, 10, -4
db -4, -1, -1
db 0, 5, -1
db 0, 5, 14
db 0, 5, 14
db 14, -1, -1
db -23, -27, -1
db -23, -27, -22
db -23, -27, -22
db -22, -1, -1
db 32, 35, -1
db 32, 35, 30
db 32, 35, 30
db 30, -1, -1
.directed_oam_group
db 0, 12, 24, 36
}
; ==============================================================================
; *$4565A-$45703 JUMP LOCATION
Ancilla_SwordSwingSparkle:
{
DEC $03B1, X : BPL .termination_delay
LDA.b #$00 : STA $03B1, X
INC $0C5E, X : LDA $0C5E, X : CMP.b #$04 : BNE .termination_delay
STZ $0C4A, X
RTS
.termination_delay
PHX
LDA $20 : STA $0BFA, X
LDA $21 : STA $0C0E, X
LDA $22 : STA $0C04, X
LDA $23 : STA $0C18, X
JSR Ancilla_PrepOamCoord
REP #$20
LDA $00 : STA $04
LDA $02 : STA $06
SEP #$20
; Number of sprites to draw
LDA.b #$02 : STA $08
LDY $0C72, X
LDA $0C5E, X : ASL A : ADD $0C5E, X : ADD .directed_oam_group, Y : TAX
LDY.b #$00
.next_oam_entry
LDA .chr, X : CMP.b #$FF : BEQ .skip_oam_entry
REP #$20
LDA .y_offsets, X : AND.w #$00FF : CMP.w #$0080 : BCC .positive_y_offset
ORA.w #$FF00
.positive_y_offset
ADD $04 : STA $00
LDA .x_offsets, X : AND.w #$00FF : CMP.w #$0080 : BCC .positive_x_offset
ORA.w #$FF00
.positive_x_offset
ADD $06 : STA $02
SEP #$20
JSR Ancilla_SetOam_XY
LDA .chr, X : STA ($90), Y : INY
LDA .properties, X : ORA.b #$04 : ORA $65 : STA ($90), Y : INY
PHY : TYA : SUB.b #$04 : LSR #2 : TAY
LDA.b #$00 : STA ($92), Y
PLY
.skip_oam_entry
INX
DEC $08 : BPL .next_oam_entry
PLX
RTS
}
; ==============================================================================