-
Notifications
You must be signed in to change notification settings - Fork 3
/
ancilla_somarian_block_divide.asm
94 lines (51 loc) · 2.03 KB
/
ancilla_somarian_block_divide.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
; ==============================================================================
; *$46B3E-$46BE2 JUMP LOCATION
Ancilla_SomarianBlockDivide:
{
DEC $03B1, X : BPL .full_divide_delay
LDA.b #$03 : STA $03B1, X
LDA $0C5E, X : INC A : STA $0C5E, X : CMP.b #$02 : BNE .full_divide_delay
STZ $0C4A, X
PHX
JSR SomarianBlast_SpawnCentrifugalQuad
PLX
RTS
.full_divide_delay
JSR Ancilla_PrepAdjustedOamCoord
LDY.b #$00
; \wtf Where is this variable actually initialized or set for this
; object?
LDA $0380, X : CMP.b #$03 : BNE .unsigned_player_altitude
LDA $24 : CMP.b #$FF : BNE .positive_player_altitude
.unsigned_player_altitude
LDA.b #$00
.positive_player_altitude
ADD $029E, X : STA $04 : BPL .positive_object_altitude
LDY.b #$FF
.positive_object_altitude
STY $05
REP #$20
LDA $04 : EOR.w #$FFFF : INC A : ADD $00 : STA $04
LDA $02 : STA $06
SEP #$20
PHX
LDA $0C5E, X : ASL #3 : TAX
LDY.b #$00 : STY $08
.next_oam_entry
REP #$20
PHX : TXA : ASL A : TAX
LDA $04 : ADD .y_offsets, X : STA $00
LDA $06 : ADD .x_offsets, X : STA $02
PLX
SEP #$20
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 : INX
INC $08 : LDA $08 : CMP.b #$08 : BNE .next_oam_entry
PLX
RTS
}
; ==============================================================================