-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathScrollerAnimation.a
More file actions
159 lines (143 loc) · 2.93 KB
/
Copy pathScrollerAnimation.a
File metadata and controls
159 lines (143 loc) · 2.93 KB
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
!zn
AnimationInit
ldx #Multiplex_items-1
.l1
lda #$ff
!ifdef Multiplex_SplitSort {
sta AnimationYPosToSort,x
}
sta AnimationYPos,x
lda #0
sta AnimationXPosHi,x
sta AnimationXPosLo,x
dex
bpl .l1
rts
!ifdef Multiplex_SplitSort {
; If Multiplex_SplitSort then after this call Multiplex_Sort
!zn
AnimationUpdateMultiplexorPre
ldx #Multiplex_items-1
.l1
!ifdef Animation_ActiveNonZeroEnabled {
lda Animation_ActiveNonZero,x
beq .blank
}
; Is the sprite totally blank? If yes then skip it
ldy AnimationSpriteFrame,x
lda SpriteEmptyLookupTab,y
beq .blank
lda AnimationYPos,x
!ifndef Animation_ActiveNonZeroEnabled {
cmp #$ff
beq .blank2
}
!ifdef Scroller_DiscardMinSpriteYPos {
cmp #Scroller_DiscardMinSpriteYPos
bcc .blank
}
!ifdef Scroller_DiscardForMultiplexorBottomDefined {
cmp #Scroller_DiscardForMultiplexorBottom
bcs .blank
}
sta AnimationYPosToSort,x
!ifdef Scroller_DiscardForMultiplexorRight {
lda AnimationXPosHi,x
!if Scroller_DiscardForMultiplexorRight >= $100 {
beq .noXDiscard
}
lda AnimationXPosLo,x
cmp #<Scroller_DiscardForMultiplexorRight
bcs .blank
.noXDiscard
}
dex
bpl .l1
rts
; This discards the sprite by moving it beyond the y position where the multiplexor rejects
; sprites.
.blank
lda #$ff
.blank2
sta AnimationYPosToSort,x
dex
bpl .l1
rts
}
; If not Multiplex_SplitSort then after this call Multiplex_Sort
!zn
AnimationUpdateMultiplexor
ldx #Multiplex_items-1
.l1
!ifndef Multiplex_SplitSort {
!ifdef Animation_ActiveNonZeroEnabled {
lda Animation_ActiveNonZero,x
beq .blank
}
}
!ifdef Multiplex_SplitSort {
; Used later on...
lda AnimationYPosToSort,x
cmp #$ff
beq .blank2
}
!ifndef Multiplex_SplitSort {
; Is the sprite totally blank? If yes then skip it
ldy AnimationSpriteFrame,x
lda SpriteEmptyLookupTab,y
beq .blank
; Used later on...
lda AnimationYPos,x
!ifndef Animation_ActiveNonZeroEnabled {
!ifndef Scroller_DiscardForMultiplexorBottomDefined {
cmp #$ff
beq .blank2
}
}
!ifdef Scroller_DiscardMinSpriteYPos {
cmp #Scroller_DiscardMinSpriteYPos
bcc .blank
}
!ifdef Scroller_DiscardForMultiplexorBottomDefined {
cmp #Scroller_DiscardForMultiplexorBottom
bcs .blank
}
} ; <!ifndef Multiplex_SplitSort {
sta Multiplex_YPos,x
lda AnimationSpriteFrame,x
sta Multiplex_SpriteFrame,x
lda AnimationSpriteColour,x
!ifdef Scroller_SpriteNegativeColourEqualsFlashingColour {
bpl .isColour
eor #$ff
; And reset the next frame?
sta AnimationSpriteColour,x
lda #Scroller_SpriteNegativeColourEqualsFlashingColour
.isColour
}
sta Multiplex_Colour,x
lda AnimationXPosLo,x
sta Multiplex_XPosLo,x
lda AnimationXPosHi,x
sta Multiplex_XPosHi,x
!ifndef Multiplex_SplitSort {
!ifdef Scroller_DiscardForMultiplexorRight {
!if Scroller_DiscardForMultiplexorRight >= $100 {
beq .noXDiscard
}
lda AnimationXPosLo,x
cmp #<Scroller_DiscardForMultiplexorRight
bcs .blank
.noXDiscard
}
} ; <!ifndef Multiplex_SplitSort {
dex
bpl .l1
rts
.blank
lda #$ff
.blank2
sta Multiplex_YPos,x
dex
bpl .l1
rts