/[projet1]/public/atari/demos/next/phaleon-gigademo/shadow-menu/PLAYROUT.S
Defence Force logotype

Contents of /public/atari/demos/next/phaleon-gigademo/shadow-menu/PLAYROUT.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (show annotations)
Wed Apr 22 20:37:17 2009 UTC (10 years, 11 months ago) by dbug
File size: 10369 byte(s)
Added the Shadow of the Beast menu of the Phaleon Gigademo
1 * player BIPBIP LAP
2 * version avec repeat param‚trable (FFT)
3
4 opt o+
5
6 PEA 0.W
7 MOVE #$20,-(SP)
8 TRAP #1
9 ADDQ.L #6,SP
10 LOADER
11 move $ffff8240.w,s_color
12 move.b #2,$484.w
13
14 bsr.s init
15
16 loop move #$25,-(a7)
17 trap #14
18 addq.l #2,a7
19 lea $ffff8209.w,a0
20 wait move.b (a0),d0
21 beq.s wait
22 neg.w d0
23 lsl.l d0,d0
24 move.w #0,$ffff8240.w
25 bsr.s vbl
26 move.w #$777,$ffff8240.w
27 cmp.b #$39,$fffffc02.w
28 bne.s loop
29
30 sortir bsr.s cut
31 move s_color,$ffff8240.w
32 clr -(sp)
33 trap #1
34 cut clr.l $4d2.w
35 move.b #7,$484.w
36 move.l #$08080000,$ffff8800.w
37 move.l #$09090000,$ffff8800.w
38 move.l #$0a0a0000,$ffff8800.w
39 rts
40
41 s_color ds.w 1
42
43
44 *****************************************
45 * PLAYER *
46 * MUSIQUE Sound Chip LAP *
47 *****************************************
48
49 *********************************
50 * routine de pre-init *
51 *********************************
52
53 init
54 movem.l d0-d2/a0-a3,-(a7)
55 LEA DATA_LAP_MUSIX(PC),A0
56 BSR.S NETOYAGE
57 lea wc_adresse(pc),a1
58 MOVE.L A0,(A1)
59 lea position_pattern(pc),a1
60 move 4(a0),(a1)
61 bsr read_note
62 movem.l (a7)+,d0-d2/a0-a3
63 rts
64
65 *************************************************
66 * routine a executer ttes les vbls *
67 *************************************************
68 vbl
69 movem.l a0-a3/d0-d3,-(sp)
70 lea $ffff8800.w,a2
71
72 lea compteur_vitesse(pc),a0
73 subq #1,(a0)
74
75 bne soundengine
76 bsr read_note
77 movem.l (sp)+,a0-a3/d0-d3
78 rts
79
80 inter tst.b d0
81 bmi.s .rts
82 movem.l a0-a1,-(a7)
83 lea priorite(pc),a1
84 move.b #1,(a1)
85 lea infos_voies(pc),a0
86 lea wc_adresse(pc),a1
87 movea.l (a1),a1
88 add.w 14(a1),d0
89 add (a1),a1
90 and #$ff,d0
91 add d0,d0
92 add d0,a1
93 move.w (a1),offset_adr_son+voie_3(a0)
94 move.b #1,flag_son+voie_3(a0)
95 movem.l (a7)+,a0-a1
96 .rts rts
97 NETOYAGE:
98 LEA INFOS_VOIES(PC),A1
99 MOVEQ #2,D0
100 .LOOP CLR pos_sequence(A1)
101 CLR.B transposition(A1)
102 CLR.B seq(A1)
103 CLR.L sequence(A1)
104 CLR.B note(A1)
105 CLR.B son(A1)
106 CLR offset_adr_son(A1)
107 CLR frequence(A1)
108 CLR.B flag_son(A1)
109 CLR.B transp_son(A1)
110 LEA TAILLE_INFO(A1),A1
111 DBF D0,.LOOP
112
113 LEA manu(PC),A1
114 CLR (A1)
115 CLR 2(A1)
116 CLR 4(A1)
117 CLR 6(A1)
118 CLR 8(A1)
119 CLR 10(A1)
120 CLR.B 13(A1)
121 CLR.B 15(A1)
122 CLR.B 17(A1)
123 CLR.B 19(A1)
124 CLR.B 21(A1)
125 CLR.B 23(A1)
126 MOVE.B #%11111000,25(A1)
127
128 RTS
129
130
131 *********************************
132 * gestion partition *
133 *********************************
134 read_note
135
136 lea position_pattern(pc),a1
137 lea infos_voies(pc),a0
138 lea wc_adresse(pc),a2
139 movea.l (a2),a2
140 move voie_2+pos_sequence(a0),d0
141 cmp 10(a2),d0
142 bne.s .mesure_pas_fini
143
144 move 6(a2),d0
145 cmp (a1),d0
146 bne.s .pas_fin_music
147
148 move 8(a2),(a1)
149 bra.s .saute_ajout
150
151 .pas_fin_music
152 addq #1,(a1)
153 .saute_ajout
154 clr pos_sequence(a0)
155 clr pos_sequence+voie_2(a0)
156 clr pos_sequence+voie_3(a0)
157
158 ******************************** lecture de la mesure
159 .mesure_pas_fini
160
161 moveq #0,d1
162 move (a1),d1
163 add 2(a2),a2
164 move.l a2,a1
165 mulu #12,d1
166 adda d1,a1
167
168 lea priorite(pc),a2
169 tst.b (a2)
170 beq.s yop
171 addq.w #2,pos_sequence+voie_3(a0)
172 moveq #1,d2
173 bra.s superloop
174
175 yop moveq #2,d2
176 superloop
177 move.b (a1)+,seq(a0)
178 move.b (a1)+,transposition(a0)
179 move.b (a1)+,transp_son(a0)
180 move.b (a1)+,d1
181
182 moveq #0,d1
183 move.b seq(a0),d1
184 lea wc_adresse(pc),a2
185 movea.l (a2),a2
186 mulu 10(a2),d1
187 ADD 14(A2),A2
188 add d1,a2
189 add pos_sequence(a0),a2
190 move.l a2,sequence(a0)
191 move.l a2,a3
192
193 moveq #0,d0
194 move.b 1(a2),son(a0)
195 beq.s .pas_de_son
196 move.b transp_son(a0),d0
197 add.b d0,son(a0)
198
199 ***************************** gestion des sons ******
200
201 .pas_de_son
202 move.b son(a0),d0
203 bne.s z1
204
205 tst.b flag_son(a0)
206 bne.s r1
207 z1
208
209 lea wc_adresse(pc),a2
210 movea.l (a2),a2
211 add (a2),a2
212 and #$ff,d0
213 add d0,d0
214 add d0,a2
215 move.w (a2),offset_adr_son(a0)
216 move.b #1,flag_son(a0)
217 r1
218
219 ************************************ frequence de la note
220 moveq #0,d0
221 move.b (a3),d0
222 beq.s fin_gestion_voie
223
224 add.b transposition(a0),d0
225 move.b d0,note(a0)
226
227 lea table_frequence(pc),a2
228 add d0,d0
229 add d0,a2
230 move.w (a2),frequence(a0)
231
232 fin_gestion_voie
233 addq.w #2,pos_sequence(a0)
234 lea taille_info(a0),a0
235 dbra d2,superloop
236
237 lea compteur_vitesse(pc),a0
238 lea wc_adresse(pc),a2
239 movea.l (a2),a2
240 move.w 12(a2),(a0)
241 rts
242
243
244 *************************************************
245 * Lecture effets (sons), restitution *
246 *************************************************
247 soundengine
248 lea infos_voies(pc),a1
249 tst.b flag_son(a1)
250 beq.s .pas_effet_voie_1
251 moveq #0,d2
252 bsr.s gere_effet_son
253 .pas_effet_voie_1
254
255 lea infos_voies+voie_2(pc),a1
256 tst.b flag_son(a1)
257 beq.s .pas_effet_voie_2
258 moveq #1,d2
259 bsr.s gere_effet_son
260 .pas_effet_voie_2
261
262 lea infos_voies+voie_3(pc),a1
263 tst.b flag_son(a1)
264 beq.s .pas_effet_voie_3
265 moveq #2,d2
266 bsr.s gere_effet_son
267 .pas_effet_voie_3
268
269 *********************************** restitution yamhaha
270 lea registre(pc),a0
271 movem.l (a0)+,d0-d3
272 movep.l d0,(a2)
273 movep.l d1,(a2)
274 movep.l d2,(a2)
275 movep.l d3,(a2)
276
277 movem.l (sp)+,a0-a3/d0-d3
278 rts
279
280
281 *********************************
282 * Gestion des sons *
283 *********************************
284 gere_effet_son
285 lea wc_adresse(pc),a0
286 movea.l (a0),a0
287 add (a0),a0
288 add offset_adr_son(a1),a0
289
290 effet_boucle
291 cmp.b #-1,(a0)
292 beq ret_force1
293
294 cmpi.b #$f0,(a0)
295 bne.s f1
296 moveq #8,d0
297 add d2,d0
298 move.b d0,(a2)
299 move.b 1(a0),2(a2)
300 addq #2,offset_adr_son(a1)
301 bra.s GERE_EFFET_SON
302 f1
303 cmpi.b #$f1,(a0)
304 bne.s f2
305 moveq #8,d0
306 lea reg7(pc),a3
307 bset d2,(a3)
308 add d2,d0
309 move.b d0,(a2)
310 move.b #16,2(a2)
311 move.b #11,(a2)
312 move.b 1(a0),2(a2)
313 move.l #$0c0c0000,(a2)
314 move.l #$0d0d0e0e,(a2)
315 addq.w #2,offset_adr_son(a1)
316 bra fin_effet
317 f2
318 cmpi.b #$f2,(a0)
319 bne.s f3
320 MOVEQ #0,D0
321 move.b 1(a0),d0
322 lea reg7(pc),a0
323 move.b d0,-2(a0)
324 move.B d2,d0
325 bset.B d0,(a0)
326 addq.B #3,d0
327 bclr.B d0,(a0)
328 addq.W #2,offset_adr_son(a1)
329 bra fin_effet
330 f3
331 cmpi.b #$f3,(a0)
332 bne.s f4
333 moveq #0,d0
334 move.b 1(a0),d0
335 add.w d0,frequence(a1)
336 addq #2,offset_adr_son(a1)
337 bra fin_effet
338 f4
339 cmpi.b #$f4,(a0)
340 bne.s f5
341 moveq #0,d0
342 move.b 1(a0),d0
343 sub d0,frequence(a1)
344 addq #2,offset_adr_son(a1)
345 bra fin_effet
346 f5
347 cmpi.b #$f5,(a0)
348 bne.s f6
349 moveq #0,d0
350 move.b note(a1),d0
351 add.b 1(a0),d0
352 and #$7f,d0
353 add d0,d0
354 lea table_frequence(pc),a0
355 add d0,a0
356 move (a0),frequence(a1)
357 addq #2,offset_adr_son(a1)
358 bra fin_effet
359 f6
360 cmpi.b #$f6,(a0)
361 bne.s f7
362 moveq #0,d0
363 move.b 1(a0),d0
364 sub d0,offset_adr_son(a1)
365 bra tt
366 f7
367 cmpi.b #$f7,(a0)
368 bne.s f8
369 moveq #0,d0
370 lea priorite(pc),a3
371 clr.b (a3)
372 bra ret_force1
373
374 F8 cmpi.B #$F8,(A0)
375 bne.b f9
376 lea wc_adresse(pc),a3
377 movea.l (a3),a3
378 move.b 1(a0),11(a3)
379 addq.w #2,offset_adr_son(a1)
380 bra fin_effet
381
382 F9 cmpi.B #$F9,(A0)
383 bne.b fa
384 moveq.l #0,d0
385 move.L d2,d0
386 addq.b #8,d0
387 move.b d0,(a2)
388 move.b #16,2(a2)
389 move.b #11,(a2)
390 move.b 1(a0),2(a2)
391 move.b #12,(a2)
392 move.b 2(a0),2(a2)
393 move.b #13,(a2)
394 move.b 3(a0),2(a2)
395 addq.w #4,offset_adr_son(a1)
396 bra fin_effet
397
398 Fa cmpi.B #$Fa,(A0)
399 bne.b fb
400 move.l #$0B0B0000,(a2)
401 move.l #$0C0C0000,(a2)
402 move.l #$0D0D0000,(a2)
403 addq.w #1,offset_adr_son(a1)
404 bra gere_effet_son
405
406 fb
407 fC cmpi.b #$fC,(a0)
408 bne.b fD
409 lea reg7(pc),a3
410 move.b d2,d0
411 addq.b #3,d0
412 bclr.B d0,(a3)
413 move.b 1(a0),-2(a3)
414 addq.w #2,offset_adr_son(a1)
415 bra fin_effet
416 fd
417 cmpi.b #$fd,(a0)
418 bne.s fe
419 moveq #0,d0
420 MOVEQ #0,D1
421 move.b 1(a0),d1
422 lea reg7(pc),a0
423 bset d2,(a0)
424
425 move.b note(a1),d0
426 lea table_frequence(pc),a0
427 add #$30,d0
428 and #$7f,d0
429 add d0,d0
430 add d0,a0
431
432 move.b #11,(a2)
433 move.b 1(a0),2(a2)
434 move.l #$0c0c0000,(a2)
435 LEA sauve_gras(PC),A3
436
437 MOVE.B 1(A0),(A3)
438 move.b #13,(a2)
439 move.b d1,2(a2)
440 moveq #8,d1
441 add d2,d1
442 move.b d1,(a2)
443 move.b #16,2(a2)
444
445 addq.w #2,offset_adr_son(a1)
446 bra.s fin_effet
447
448 fe cmpi.b #$fe,(a0)
449 bne.b e0
450 moveq.l #0,d0
451 move.b 1(a0),d0
452 bmi.s fe_suite
453 add.b note(a1),d0
454 bra.s fe_suite2
455 fe_suite
456 subi.b #$80,d0
457 fe_suite2
458 lea table_frequence(pc),a0
459 add.W d0,d0
460 add.l d0,a0
461 move.w (a0),d0
462 and.l #$ffff,d0
463 move.w d0,frequence(a1)
464 addq.w #2,offset_adr_son(a1)
465 bra.S fin_effet
466
467 e0
468 f00
469 cmpi.b #$00,(a0)
470 bne.s f01
471 addq #1,offset_adr_son(a1)
472 bra.s fin_effet
473 f01
474 cmpi.b #$01,(a0)
475 bne.s f02
476 MOVEQ #0,D0
477 lea reg7(pc),a3
478 bclr.B d2,(a3)
479 move.B d2,d0
480 addq.B #3,d0
481 bset.B d0,(a3)
482 addq.W #1,offset_adr_son(a1)
483 bra gere_effet_son
484 f02
485
486 F03 cmpi.b #$03,(a0)
487 bne.b RET_FORCE1
488 move.b 1(a0),d0
489 LEA sauve_gras(PC),A3
490 add.B d0,(a3)
491 move.b #11,(a2)
492 move.b (A3),2(a2)
493 addq.w #2,OFFSET_ADR_SON(a1)
494
495 f04
496
497 fin_effet
498 move frequence(a1),d0
499 lea manu(pc),a0
500 move.w d0,(a0)
501
502 lea reg0(pc),a0
503 add d2,d2
504 add d2,d2
505 add d2,a0
506 move.b d0,(a0)
507 move.b manu(pc),2(a0)
508
509 tt
510 rts
511
512 ret_force1
513 move.w frequence(a1),d0
514 lea manu(pc),a0
515 move.w d0,(a0)
516
517 lea reg0(pc),a0
518 move d2,d3
519 add d2,d2
520 add d2,d2
521 add d2,a0
522 move.b d0,(a0)
523 move.b manu(pc),2(a0)
524
525 clr.b flag_son(a1)
526
527 lea reg7(pc),a0
528 addq #3,d3
529 bset d3,(a0)
530 rts
531
532 section data
533
534 ************ taille des bloc info sur chaque voie
535 rsreset
536 pos_sequence rs.w 1 *0
537 transposition rs.b 1 *2
538 seq rs.b 1 *3
539 sequence rs.l 1 *4
540 note rs.b 1 *8
541 son rs.b 1 *9
542 offset_adr_son rs.w 1 *10
543 frequence rs.w 1 *12
544 flag_son rs.b 1 *14
545 transp_son rs.b 1 *15
546
547 voie_1=0
548 voie_2=__rs
549 voie_3=__rs*2
550 taille_info=__rs
551 infos_voies ds.b __rs*3
552
553 even
554 manu ds.w 1
555 compteur_vitesse ds.w 1
556 position_pattern ds.w 1
557 sauve_gras DC.B 0,0
558 priorite dc.b 0,0
559
560 registre dc.b 0
561 reg0 dc.b 0
562 dc.b 1
563 reg1 dc.b 0
564 dc.b 2
565 reg2 dc.b 0
566 dc.b 3
567 reg3 dc.b 0
568 dc.b 4
569 reg4 dc.b 0
570 dc.b 5
571 reg5 dc.b 0
572 dc.b 6
573 reg6 dc.b 0
574 dc.b 7
575 reg7 dc.b %11111000
576 EVEN
577
578 table_frequence
579 dc.w $eee,$e17,$d4d,$c8e,$bd9,$b2f
580 dc.w $a8e,$9f7,$967,$8e0,$861,$7e8,$777,$70b
581 dc.w $6a6,$647,$5ec,$597,$547,$4fb,$4b3,$470
582 dc.w $430,$3f4,$3bb,$385,$353,$323,$2f6,$2cb
583 dc.w $2a3,$27d,$259,$238,$218,$1fa,$1dd,$1c2
584 dc.w $1a9,$191,$17b,$165,$151,$13e,$12c,$11c
585 dc.w $10c,$fd,$ee,$e1,$d4,$c8,$bd,$b2
586 dc.w $a8,$9f,$96,$8e,$86,$7e,$77,$70
587 dc.w $6a,$64,$5e,$59,$54,$4f,$4b,$47
588 dc.w $43,$3f,$3b,$38,$35,$32,$2f,$2c
589 dc.w $2a,$27,$25,$23,$21,$1f,$1d,$1c
590 dc.w $1a,$19,$17,$16,$15,$13,$12,$11,$10,$f
591 EVEN
592 WC_adresse: dc.l 0

  ViewVC Help
Powered by ViewVC 1.1.26