-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstars.asm
127 lines (88 loc) · 2.25 KB
/
stars.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
init_title_stars:
lda #SINGLE_PARTICLE_EFFECT_AMOUNT
sta CurrentParticle
init_stars_loop
dec CurrentParticle
jsr init_single_title_star
lda CurrentParticle
cmpa #0
bne init_stars_loop
rts
init_single_title_star:
ldb #0
lda CurrentParticle
ldx #ParticleActive
stb a,x
rts
draw_title_stars:
lda #SINGLE_PARTICLE_EFFECT_AMOUNT
sta CurrentParticle
draw_stars_loop
dec CurrentParticle
jsr add_single_star
jsr draw_single_star
jsr update_single_star
lda CurrentParticle
cmpa #0
bne draw_stars_loop
rts
add_single_star:
ldb CurrentParticle
ldx #ParticleActive
lda b,x
cmpa #0
bne add_star_over
jsr Random
jsr randomize_a_sign
ldb CurrentParticle
ldx #ParticlePositionX
sta b,x
determine_star_y
jsr Random
jsr randomize_a_sign
cmpa #-90
blt determine_star_y
ldb CurrentParticle
ldx #ParticlePositionY
sta b,x
jsr Random
anda #0xF
ldb CurrentParticle
ldx #ParticleTime
sta b,x
lda #1
ldb CurrentParticle
ldx #ParticleActive
sta b,x
add_star_over;
rts
draw_single_star:
ldb CurrentParticle
ldx #ParticlePositionY
lda b,x
ldx #ParticlePositionX
ldb b,x
jsr Moveto_d
jsr Dot_here
ldb CurrentParticle
ldx #ParticlePositionY
lda b,x
ldx #ParticlePositionX
ldb b,x
nega
negb
jsr Moveto_d
rts
update_single_star
ldb CurrentParticle
ldx #ParticleTime
lda b,x
deca
sta b,x
cmpa #0
bne remove_star_over
lda #0
ldx #ParticleActive
sta b,x
remove_star_over:
rts