-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathancilla_halted_arrow.asm
71 lines (40 loc) · 1.76 KB
/
ancilla_halted_arrow.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
; ==============================================================================
; *$4245B-$424DC JUMP LOCATION
Ancilla_HaltedArrow:
{
; Special object 0x0A (arrow stuck in something)
; Set to a sprite index if it collided with a sprite when it was in
; motion. Set to 0xFF otherwise.
LDY $03A9, X : BMI .didnt_collide_with_sprite
LDA $0DD0, Y : CMP.b #$09 : BCC .self_terminate
LDA $0F70, Y : BMI .self_terminate
LDA $0BA0, Y : BNE .self_terminate
LDA $0CAA, Y : AND.b #$02 : BNE .self_terminate
STZ $00
LDA $0C2C, X : BPL .positive_x_speed
DEC $00
.positive_x_speed
ADD $0D10, Y : STA $0C04, X
LDA $0D30, Y : ADC $00 : STA $0C18, X
STZ $00
LDA $0C22, X : BPL .positive_y_speed
DEC $00
.positive_y_speed
ADD $0D00, Y : PHP : SUB $0F70, Y : STA $0BFA, X
LDA $0D20, Y : SBC.b #$00 : PLP : ADC $00 : STA $0C0E, X
.didnt_collide_with_sprite
LDA $11 : BEQ .normal_submode
BRA .just_draw
.normal_submode
DEC $03B1, X : LDA $03B1, X : BNE .just_draw
LDA.b #$02 : STA $03B1, X
INC $0C5E, X : LDA $0C5E, X : CMP.b #$09 : BEQ .self_terminate
AND.b #$08 : BEQ .just_draw
LDA.b #$80 : STA $03B1, X
.just_draw
JML Arrow_Draw
; *$424DA ALTERNATE ENTRY POINT
.self_terminate
BRL Ancilla_SelfTerminate
}
; ==============================================================================