/[projet1]/public/atari/demos/next/phaleon-gigademo/reset/STARRESE.S
Defence Force logotype

Contents of /public/atari/demos/next/phaleon-gigademo/reset/STARRESE.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 57 - (show annotations)
Wed Apr 22 20:23:35 2009 UTC (10 years, 11 months ago) by dbug
File size: 5773 byte(s)
Added the reset screen of the phaleon demo
1
2 random macro
3 movem.l d1-d7/a0-a6,-(sp)
4
5 move.l var_random,d0
6 move.l d0,d2
7 addq.l #1,d2
8 eor.l d4,d3
9 eor.l d5,d3
10 add.l d3,d2
11 move.l d2,d3
12 rol.l d3
13 move.l d3,var_random
14 mulu #$254,d6
15 eor.l d6,d0
16 move.l d0,d1
17 swap d1
18 eor.l d1,d0
19 muls #$19d3,d0
20 eor.l d3,d0
21 eor.l d4,d0
22 asr.l #8,d0
23 movem.l (sp)+,d1-d7/a0-a6
24 endm
25
26 change_ecr macro
27 move.l ecr,d0
28 move.l ecrb,ecr
29 move.l d0,ecrb
30 lea $ffff8201.w,a0
31 lsr.l #8,d0
32 movep d0,(a0)
33 endm
34
35 plot macro
36 move.l a1,a5
37 add d2,a5
38 add d0,a5
39 move .\@(pc,d1.w),d0
40 move.l a5,(a2)+
41 move .\@@@@@@@@@@@(pc,d3.w),.\@@@-2
42 opt o-
43 bra .\@@
44 .\@@@
45 or d0,(a5)
46 bra.s .\@@
47 .\@@@@
48 or d0,2(a5)
49 bra.s .\@@
50 .\@@@@@
51 or d0,(a5)+
52 or d0,(a5)
53 bra.s .\@@
54
55 ifeq nb_plan-3
56 .\@@@@@@
57 or d0,4(a5)
58 bra.s .\@@
59 .\@@@@@@@
60 or d0,4(a5)
61 or d0,(a5)
62 bra.s .\@@
63 .\@@@@@@@@
64 or d0,2(a5)
65 or d0,4(a5)
66 bra.s .\@@
67 .\@@@@@@@@@
68 or d0,(a5)+
69 or d0,(a5)+
70 or d0,(a5)
71 bra.s .\@@
72 endc
73
74 .\@@@@@@@@@@
75 cree_traj1
76 bra.s .\@@
77 .\@@@@@@@@@@@
78 dc .\@@-.\@@@+2 *0
79 dc .\@@@-.\@@@+2 *1
80 dc .\@@@@-.\@@@+2 *2
81 dc .\@@@@@-.\@@@+2 *3
82 ifeq nb_plan-3
83 dc .\@@@@@@-.\@@@+2 *4
84 dc .\@@@@@@@-.\@@@+2 *5
85 dc .\@@@@@@@@-.\@@@+2 *6
86 dc .\@@@@@@@@@-.\@@@+2 *7
87 dc .\@@@@@@@@@-.\@@@+2 *7
88 dc .\@@@@@@@@@-.\@@@+2 *7
89 dc .\@@@@@@@@@-.\@@@+2 *7
90 dc .\@@@@@@@@@-.\@@@+2 *7
91 dc .\@@@@@@@@@-.\@@@+2 *7
92 dc .\@@@@@@@@@-.\@@@+2 *7
93 dc .\@@@@@@@@@@-.\@@@+2 *8
94 elseif
95 dc .\@@@@@@@@@@-.\@@@+2 *8
96 dc .\@@@@@@@@@@-.\@@@+2 *8
97 dc .\@@@@@@@@@@-.\@@@+2 *8
98 dc .\@@@@@@@@@@-.\@@@+2 *8
99 dc .\@@@@@@@@@@-.\@@@+2 *8
100 dc .\@@@@@@@@@@-.\@@@+2 *8
101 dc .\@@@@@@@@@@-.\@@@+2 *8
102 endc
103 .\@
104 dc.w %1000000000000000
105 dc.w %100000000000000
106 dc.w %10000000000000
107 dc.w %1000000000000
108 dc.w %100000000000
109 dc.w %10000000000
110 dc.w %1000000000
111 dc.w %100000000
112 dc.w %10000000
113 dc.w %1000000
114 dc.w %100000
115 dc.w %10000
116 dc.w %1000
117 dc.w %100
118 dc.w %10
119 dc.w %1
120 .\@@
121 endm
122
123 star_gestion macro
124 gestion_trajectoire
125 swap d3
126 add d3,d3
127 plot
128 endm
129
130 gestion_trajectoire macro
131 move.l a3,a5
132 add.l (a0)+,a5
133 moveq #0,d0
134 move.b (a5)+,d0
135 bne .\@
136 test_x
137 .\@
138 subq.b #1,d0
139 moveq #0,d1
140 move.b (a5)+,d1
141 move.l (a0)+,d4
142 add.l d4,-8(a0)
143
144 move.l a4,a5
145 add.l (a0)+,a5
146 move (a5),d2
147 bne .\@@
148 test_y
149 .\@@
150 subq #1,d2
151 move.l (a0)+,d4
152 add.l d4,-8(a0)
153
154 move.l (a0)+,d3
155 move.l (a0)+,d4
156 add.l d4,-8(a0)
157 endm
158
159 vsync macro
160 move d0,-(sp)
161 move cp_vbl,d0
162 .\@
163 cmp cp_vbl,d0
164 beq.s .\@
165 move (sp)+,d0
166 endm
167
168
169 test_x macro
170 subq #4,a0
171 cree_traj
172 moveq #((xmax-xmin)/32)*8+1,d0
173 addq #4,a0
174 endm
175
176 test_y macro
177 lea -12(a0),a0
178 cree_traj
179 moveq #((xmax-xmin)/32)*8,d0
180 moveq #0,d1
181 move #((ymax-ymin)/2)*160+1,d2
182 lea 12(a0),a0
183 endm
184
185 cree_traj macro
186 move.l #(((xmax-xmin)/2)+max_speed)*2*precision,(a0)
187 move.l #(((ymax-ymin)/2)+max_speed)*2*precision,4*2(a0)
188 move.l d6,4*4(a0)
189 endm
190 cree_traj1 macro
191 move.l #(((xmax-xmin)/2)+max_speed)*2*precision,-6*4(a0)
192 move.l #(((ymax-ymin)/2)+max_speed)*2*precision,-6*4+4*2(a0)
193 move.l d6,-6*4+4*4(a0)
194 endm
195
196 init_all
197 lea $ffff8240.w,a0
198 ifeq nb_plan-3
199 move.l #$111,(a0)+
200 move.l #$2220333,(a0)+
201 move.l #$4440555,(a0)+
202 move.l #$6660777,(a0)+
203 elseif
204 move.l #$333,(a0)+
205 move.l #$4440777,(a0)+
206 endc
207 move.l #$78984565,var_random
208 lea eras,a0
209 move.l a0,eras_buf1
210 lea nb_star*4(a0),a1
211 move.l a1,eras_buf2
212 move #(nb_star*2)-1,d7
213 lea merde,a1
214 .init0
215 move.l a1,(a0)+
216 dbra d7,.init0
217
218 moveq #0,d6
219 lea buffer_star,a0
220 move #nb_star-1,d7
221 .init1
222 cree_traj
223
224
225 move d6,d0
226 add #((360*10)/nb_star),d6
227 cmp #360*10,d6
228 blt.s .oki
229 sub #360*10,d6
230 move d6,d0
231 .oki
232 divu #10,d0
233
234 lea cosinus,a5
235 add d0,d0
236 moveq #0,d2
237 move (a5,d0.w),d2
238 moveq #0,d3
239 lea 92*2(a5),a5
240 move (a5,d0.w),d3
241
242 random
243 and.l #$3fff,d0
244 mulu #(precision*4)/5,d0
245 lsr.l #8,d0
246 lsr.l #4,d0
247 add #precision/2,d0
248 muls d0,d2
249 muls d0,d3
250
251 moveq #14,d0
252 asr.l d0,d2
253 asr.l d0,d3
254
255
256 tst d2
257 bne.s .kiju
258 tst d3
259 bne.s .kiju0
260 move.l #precision*2,d2
261 move.l #precision,d3
262 .kiju0
263 .kiju
264
265 add.l d2,d2
266 add.l d3,d3
267 move.l d2,4(a0)
268 move.l d3,4+4*2(a0)
269 clr.l 4*4(a0)
270
271 random
272 ifeq nb_plan-3
273 and.l #$fff,d0
274 add.l #$500,d0
275 elseif
276 and.l #$7ff,d0
277 add.l #$300,d0
278 endc
279 move.l d0,4+4*4(a0)
280 lea 4*6(a0),a0
281 dbra d7,.init1
282
283
284 *
285 lea tabley,a0
286 moveq #0,d0
287 move #max_speed-1,d7
288 .init4a
289 bsr put_val
290 dbra d7,.init4a
291 move #1+(ymin*160),d0
292 move #ymax-ymin-1,d7
293 .init4
294 bsr put_val
295 add #160,d0
296 dbra d7,.init4
297 moveq #0,d0
298 move #max_speed-1,d7
299 .init4b
300 bsr put_val
301 dbra d7,.init4b
302
303 *
304 lea tablex,a0
305 move #max_speed-1,d7
306 .init5a
307 bsr put_val
308 dbra d7,.init5a
309
310 move #xmax-xmin-1,d7
311 moveq #xmin,d1
312 .init5
313 move d1,d0
314 and #$fff0,d0
315 lsl #7,d0
316 add #$100,d0
317 move.b d1,d0
318 and.b #$f,d0
319 add.b d0,d0
320 addq #1,d1
321 bsr put_val
322 dbra d7,.init5
323 moveq #0,d0
324 move #max_speed-1,d7
325 .init5b
326 bsr put_val
327 dbra d7,.init5b
328
329 move #nb_vbl_pre-1,d7
330 .init2
331 lea buffer_star,a0
332 move #nb_star-1,d5
333 .init3
334 gestion_trajectoire
335 cmp #2^nb_plan,-8(a0)
336 blt.s .okaus
337 clr.l -8(a0)
338 .okaus
339 dbra d5,.init3
340 dbra d7,.init2
341
342
343 rts
344 put_val
345 move d7,-(sp)
346 move #precision-1,d7
347 .put_val
348 move d0,(a0)+
349 dbra d7,.put_val
350 move (sp)+,d7
351 rts
352
353 star
354 move.l eras_buf1,a2
355 moveq #0,d6
356 rept nb_star
357 move.l (a2)+,a5
358 move.l d6,(a5)+
359 ifeq nb_plan-3
360 move d6,(a5)
361 endc
362 endr
363
364 move #(nb_star/2)-1,d7
365 lea buffer_star,a0
366 move.l ecr,a1
367 move.l eras_buf1,a2
368 lea tablex,a3
369 lea tabley,a4
370 .star
371 star_gestion
372 star_gestion
373 dbra d7,.star
374
375 move.l eras_buf2,d0
376 move.l eras_buf1,eras_buf2
377 move.l d0,eras_buf1
378 rts
379 cosinus incbin tablecos.dat

  ViewVC Help
Powered by ViewVC 1.1.26