-
Notifications
You must be signed in to change notification settings - Fork 3
/
ancilla_wall_hit.asm
140 lines (87 loc) · 3.05 KB
/
ancilla_wall_hit.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
; ==============================================================================
; *$413E8-$4141E JUMP LOCATION
Ancilla_WallHit:
{
DEC $039F, X : BPL .delay
LDA $0C5E, X : INC A : CMP.b #$05 : BEQ .self_terminate
STA $0C5E, X
; Reset the countdown tiemr to 1.
LDA.b #$01 : STA $039F, X
BRA .delay
; *$413FF ALTERNATE ENTRY POINT
shared Ancilla_SwordWallHit:
JSR Ancilla_AlertSprites
DEC $03B1, X : BPL .delay
LDA $0C5E, X : INC A : CMP.b #$08 : BEQ .self_terminate
STA $0C5E, X
; Reset the countdown timer to 1.
LDA.b #$01 : STA $03B1, X
BRA .delay
.self_terminate
BRL Ancilla_SelfTerminate
.delay
BRL WallHit_Draw
}
; ==============================================================================
; $4141F-$414DE DATA
pool WallHit_Draw:
{
.chr
db $80, $00, $00, $00, $92, $00, $00, $00
db $81, $81, $81, $81, $82, $82, $82, $82
db $93, $93, $93, $93, $92, $00, $00, $00
db $B9, $00, $00, $00, $90, $90, $00, $00
.properties
db $32, $00, $00, $00, $32, $00, $00, $00
db $32, $72, $B2, $F2, $32, $72, $B2, $F2
db $32, $72, $B2, $F2, $32, $00, $00, $00
db $72, $00, $00, $00, $32, $F2, $00, $00
.y_offsets
dw -4, 0, 0, 0, -4, 0, 0, 0
dw -8, -8, 0, 0, -8, -8, 0, 0
dw -8, -8, 0, 0, -4, 0, 0, 0
dw -4, 0, 0, 0, -8, 0, 0, 0
.x_offsets
dw -4, 0, 0, 0, -4, 0, 0, 0
dw -8, 0, -8, 0, -8, 0, -8, 0
dw -8, 0, -8, 0, -4, 0, 0, 0
dw -4, 0, 0, 0, -8, 0, 0, 0
}
; ==============================================================================
; *$414DF-$41542 LONG BRANCH LOCATION
WallHit_Draw:
{
JSR Ancilla_PrepOamCoord
REP #$20
LDA $00 : STA $04
LDA $02 : STA $06
SEP #$20
LDA.b #$03 : STA $08
PHX
LDA $0C5E, X : ASL #2 : TAX
LDY.b #$00
.next_oam_entry
LDA .chr, X : BEQ .skip_entry
PHX
TXA : ASL A : TAX
REP #$20
LDA .y_offsets, X : ADD $04 : STA $00
LDA .x_offsets, X : ADD $06 : STA $02
SEP #$20
PLX
JSR Ancilla_SetOam_XY
LDA .chr, X : STA ($90), Y
INY
LDA .properties, X : AND.b #$CF : ORA $65 : STA ($90), Y
INY : PHY
TYA : SUB.b #$04 : LSR #2 : TAY
LDA.b #$00 : STA ($92), Y
PLY
.skip_entry
JSR Ancilla_CustomAllocateOam
INX
DEC $08 : BPL .next_oam_entry
PLX
RTS
}
; ==============================================================================