-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathancilla_somarian_platform_poof.asm
102 lines (59 loc) · 2.39 KB
/
ancilla_somarian_platform_poof.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
; ==============================================================================
; $46A7F-$46A82 DATA
pool Ancilla_SomarianPlatformPoof:
{
.directions
db $01, $00, $03, $02
}
; ==============================================================================
; *$46A83-$46B3D JUMP LOCATION
Ancilla_SomarianPlatformPoof:
{
; Special Object 0x39 - Cane of Somaria platform creating poof
DEC $03B1, X : BMI .initiate_poof
RTS
.initiate_poof
STZ $0C4A, X
LDA $0BFA, X : STA $72
LDA $0C0E, X : STA $73
LDA $0C04, X : STA $74
LDA $0C18, X : STA $75
LDA $0C7C, X : STA $BD
PHX
; Create a cane of Somaria platform sprite
LDA.b #$ED : JSL Sprite_SpawnDynamically : BPL .spawn_succeeded
BRL .spawn_failed
.spawn_succeeded
STZ $02F5
LDA $72 : AND.b #$F8 : ORA.b #$04 : STA $0D00, Y : STA $72
LDA $73 : STA $0D20, Y
LDA $74 : AND.b #$F8 : ORA.b #$04 : STA $0D10, Y : STA $74
LDA $75 : STA $0D30, Y
LDA $BD : CMP.b #$01 : REP #$30 : STZ $06 : BCC .on_bg2
LDA.w #$1000 : STA $06
.on_bg2
LDA $74 : AND.w #$01FF : LSR #3 : STA $04
LDA $72 : AND.w #$01F8 : ASL #3 : ADD $04 : ADD $06 : TAX
STZ $06
LDA $7F1FC0, X : AND.w #$00F0 : CMP.w #$00B0 : BEQ .attribute_match
INC $06
LDA $7F2040, X : AND.w #$00F0 : CMP.w #$00B0 : BEQ .attribute_match
INC $06
LDA $7F1FFF, X : AND.w #$00F0 : CMP.w #$00B0 : BEQ .attribute_match
INC $06
.attribute_match
SEP #$30
LDX $06
LDA .directions, X : STA $0DE0, Y
LDA.b #$00 : STA $0F20, Y
BRA .return
.spawn_failed
; \wtf What actually happens in the macroscopic game scale if we cannot
; spawn a sprite for the platform? Would be good to check this out.
; \task durp, check it out!
JSR SomarianBlock_Draw
.return
PLX
RTS
}
; ==============================================================================