home *** CD-ROM | disk | FTP | other *** search
- FORMAT 0-,1-
-
- LIST
- *********************************
- * *
- * EXEMPLE D'UTILISATION DES *
- * TABLES PRECALCULEES D'OBJETS *
- * MORPHEES EN GFA *
- * *
- * SUPERNOVA - DECEMBRE 95 *
- * POUR TOXIC MAG 11 *
- * *
- *********************************
- NOLIST
-
- *********************************
- * BASE PAGE *
- *********************************
-
- move.l a7,a5
- lea.l pile,a7
- move.l 4(a5),a5
- move.l 12(a5),d0
- add.l 20(a5),d0
- add.l 28(a5),d0
- add.l #$100,d0
- move.l d0,-(sp)
- move.l a5,-(sp)
- move #0,-(sp)
- move #74,-(sp)
- trap #1
- lea 12(a7),a7
-
- ******************* SUPERVISEUR *************
-
- PEA PILE
- MOVE.W #$20,-(SP)
- TRAP #1
- ADDQ.L #6,SP
-
- ******************* ON SAUVE LA PALETTE ACTUELLE
-
- move #7,d0
- lea $ffff8240.w,a0
- lea savcol,a1
- couleurs
- move.l (a0)+,(a1)+
- dbf d0,couleurs
-
- ******* ON MET NOTRE PALETTE **********
- ****** ET NOTRE ENVIRONNEMENT *********
-
- move.l #palette,$45a
-
- dc.w $a00a
- clr.b $484.w
-
- move.w #4,-(sp)
- trap #14
- addq.l #2,sp
-
- move.w d0,savres
- cmp.w #0,d0
- beq.s lowres
-
- move.w #0,-(sp)
- move.l #-1,-(sp)
- move.l #-1,-(sp)
- move.w #5,-(sp)
- trap #14
- add.l #12,sp
-
- *********** ON ITINITIALISE LES POINTEURS ********
-
- lowres
- bsr clear_screen
-
- LEA SCRIPT,A0 LES ADRESSES DES MORPHING PRECALCULEES
-
- MOVE.L A0,POINTEUR_SCRIPT SONT POINTEES PAR POINTEUR_SCRIPT
-
- MOVE.L (A0)+,LIENS
- MOVE.L (A0),BUFFER
-
- MOVE #1,NB_TRANSITIONS ON MET NB_TRANSITION A 1 POUR SIMULER LA FIN
- *DU MORPHING DU PREMIER OBJET ET AINSI POUR
- *SAUTER DIRECTEMENT A LA ROUTINE D'ATTENTE
- *AFIN D'AVOIR LE TEMPS DE VOIR LE 1er OBJET
- *AVANT QU'IL NE MORPHE.
-
- vroom
- cmp #0,nb_transitions *ON A FINI DE MORPHE L'OBJET EN COURS?
- beq NEXT_MORPHING
-
- bsr wvbl
- bsr efface_man ON EFFACE LA PORTION D'ECRAN
- move #$700,$ffff8240
-
- move.l liens,a1 POINTE SUR LA TABLE DES LIAISONS
- *ENTRE LES POINTS
- move (a1)+,d6
- sub #1,d6 NOMBRE DE LIGNES QUI COMPOSENT L'OBJET A TRACER
- move (a1)+,distance NOMBRES DE TRANSITIONS ENTRE LE POINT SOURCE ET DEST.
-
- move.l buffer,a0 POINTE SUR LES COORDONNES DES POINTS
-
- PT
- move (a1)+,d0 ON CALCULE LES OFFSET ENTRES LES POINTS
- *EN MULTIPLIANT LE NOMBRE DE POINTS INTERMEDIAIRES
- move distance,d2 PAR LE NO DU POINT ACTUEL. AINSI, ON POINTERA
- mulu d2,d0 TOUJOURS SUR LA BONNE POSITION.
- movem 0(a0,d0),d0/d1 X1/Y1
- move (a1)+,d3
- mulu d2,d3
- movem 0(a0,d3),d2/d3 X2/Y2
- BSR DRAW_LINE GO TO DRAW!
- DBF D6,PT ON FAIT DE MEME POUR TOUS LES POINTS
- clr $ffff8240 COMPOSANT L'OBJET
-
- sub #1,nb_transitions ON PASSE A LA TRANSITION SUIVANTE
- ADD.W #4,a0 ON N'OUBLE PAS DE DECALER LA TABLE DES
- move.l a0,buffer COORDONNEES.
- cmp.b #$39,$fffffc02.w APPUI TOUCHE?
- bne vroom
-
-
- fin move.b #7,$484.w MOUSE AND BIIIIP!
- dc.w $a009
-
- bsr clear_screen
-
- cmp.w #0,savres
- beq.s bibi
- move.w savres,-(sp)
- move.l #-1,-(sp) RESTORE SCREEN
- move.l #-1,-(sp)
- move.w #5,-(sp)
- trap #14
- add.l #12,sp
-
- bibi lea savcol,a0
- lea $ffff8240.w,a1
- move #7,d0
- recol move.l (a0)+,(a1)+
- dbf d0,recol
-
- MOVE.W #0,-(SP) et hasta la vista baby...
- TRAP #1
-
-
- ***************************
-
- NEXT_morphing *ARRIVE ICI, ON VA PASSER AU MORPHING
- *DE L'OBJET SUIVANT DANS LA LISTE
- sub #1,waitz MAIS AVANT, ON DECREMENTE UN COMPTEUR POUR
- cmp #0,waitz AVOIR LE TEMPS DE VOIR L'OBJET
- bne vroom
- move #50000,waitz ON REMET LE COMPTEUR POUR LE PROCHAIN OBJET
- *50000...IMAGINEZ LE TEMPS MACHINE GASPILLE!!!
- *ARGHHH! LE REMORD ME RONGE...
-
- NEXT_FIGURE
- MOVE.L POINTEUR_SCRIPT,A0 AU SUIVANT...
- MOVE.L (A0)+,LIENS NOUVELLE TABLE DE LIENS.
- CMP.L #$FFFFFFFF,LIENS C'EST LA FIN DU SCRIPT?
- BEQ DO_AGAIN ALORS ON REBOUCLE
- MOVE.L (A0)+,BUFFER
- MOVE.L A0,POINTEUR_SCRIPT ON SAUVE LE POINTEUR DE SCRIPT
-
- move.l liens,A0
- add.l #2,a0
- moveq #0,d0 ON CALCULE L'OFFSET ENTRE
- move (a0),d0 DEUX POINTS.
- divu #4,d0 UNE BONNE FOIS POUR TOUTES.
- move d0,nb_transitions
- bra vroom ET ON MORPHE...
-
- DO_AGAIN
- LEA SCRIPT,A0 ON RESET LE POINTEUR PRINCIPAL
- MOVE.L A0,POINTEUR_SCRIPT
- BRA NEXT_FIGURE
-
-
- ************ ROUTINE QUI EFFACE UNE PORTION D'ECRAN
- ************ EXTRAITE DE LA TRANSBEAUCE DEMO II TBC.
- ************ OULALA COMME C'EST VIEUX!!!
- ************ ON PEUT BIEN SUR UTILISER LE BLITTER MAIS
- ************ CE N'EST PLUS COMPATIBLE STF.
- ************ A VOUS DE L'AMELIORER POUR EFFACER DES OBJETS
- ************ PLUS GRAND PAR EXEMPLE...
-
- efface_man
- movem.l d0-a6,-(sp)
- move.l $44e,a0 * a0 = ecran
- lea (160*50)+48(a0),a0 * on se positionne bien
- move.w #120,d0 * 88 lignes à effacer
- move.w #0,d1 * motif de remplissage
- ef
-
- i set 6 * 3eme plan
- rept 8 * 14 mots par lignes
- move.w d1,i(a0) * efface
- i set i+8 * mot suivant
- endr
- lea 160(a0),a0 * ligne suivante
- dbf d0,ef
- movem.l (sp)+,d0-a6
- rts
-
-
- * ----------------------------------------------------------------
- * ENCORE EXTRAITE DE LA DEMO TBC.
- * COMME LE DISAIT DOCPROF... TO BE IMPROVED...
-
- * Routine de tracé de ligne.
- * D0 = X1 Coordonnée X point de départ.
- * D1 = Y1 Y
- * D2 = X2 Coordonnée X point d'arrivée.
- * D3 = Y2 Y
-
- Draw_line
-
- movem.l d0-d7/a0-a6,-(a7)
- move.w d2,a2
- move.w d3,a3
- move.w d0,d2 <- ne hurlez pas !
- move.w d1,d3
- move.l #0,a5
-
- * --------------------------------------------------------------
- * Trace de droite
- * --------------------------------------------------------------
-
- * Initialisation
-
- Trace_droite:
-
- * Initialisation droite
-
- move.w a2,d6 * d6 = x1
- sub.w d2,d6 * d6 = x1-x0 = pente de la droite en X
- blt.s ouga * si la droite monte en X -> dxpos
- exg.l D2,A2
- exg.l D3,A3
- neg.w D6
- ouga neg.w d6 * d6 = -dx donc d6>0 (la pente X est positive)
-
- move.w d6,d0 * d6=x1-x0
- lsr.w #1,d0
- move.w d0,A1 * repetion droite
- add.w a2,d0 * d0 = X centre
-
- * C'EST CE CAS LA
-
- move.w a3,d7 * d7 = y1
- sub.w d3,d7 * d7 = y1-y0 = pente en Y
- blt.s ouga2 * dy > 0 alors on dessine
- move.w d7,d5 * d7 = y1-y0
- lsr.w #1,d5
- move.w d5,a2 * a2 nombre de repetitions
- add.w d3,d5 * d5=y
- move.w #160,a5 * offset Y = 160 -> A5
- bra.s dur
-
- ouga2 neg.w d7 * sinon d7 = -dy donc d7>0 (la pente est positive)
-
- move.w d7,d5
- lsr.w #1,d5
- move.w d5,a2
- add.w a3,d5
- move.w #-160,a5 * on descent : offset = -160
-
- * no, no... no !!!!!
-
- dur: moveq.w #0,D4
-
- * on calcule la position en mot sur l'écran du centre
-
- * Initialisation Y
-
- move.l $44e,a0 * a0 = ecranx
- lea ordonnee,a3 * a1 = tableau ordonnee
- lsl.w #1,d3 * mulu #2,d5
- add.w (a3,d3.W),a0 * on se positionne sur le screen
-
- move.l $44e,a6 * a0 = ecranx
- lsl.w #1,d5 * mulu #2,d5
- add.w (a3,d5.w),A6 * on se positionne sur le screen
-
- * Initialisation X
-
- lea abscisse,a3 * a3 = tableau des abscisses
- lsl.w #2,d2 * mulu #4,d1
- add.w (a3,d2.W),a0 * on se positionne sur le mot
- move.w 2(a3,d2.W),d2 * d2 = motif de bits
-
- lsl.w #2,d0 * mulu #4,d1
- add.w (a3,d0.w),A6 * on se positionne sur le mot
- move.w 2(A3,D0.w),D0
-
- suite_merde
-
- * ici l'on trace ! / on choisit la routine...
-
- move.w a1,d5
- cmp.w D7,D6
- bge.s non
- move.w a2,d5
- bra.s nony
-
- * Trace de la droite (to be improved)
-
- * Incrementation X
-
- non add.w D2,D2
- bcc.s lou2
- moveq.w #1,D2
- subq.w #8,a0 * a4= offset_x
- lou2 or.w d2,6(a0)
- add.w d0,d0
- bcc.s lou3
- moveq.w #1,D0
- subq.w #8,A6
- lou3 or.w d0,6(a6)
- add.w d7,d4 * d4=(dy/dx)-(ay/ax)
- ble.s lou4
- adda.w a5,a0 * on passe a la ligne suivante
- adda.w a5,a6 * A5=OFFSET_Y
- sub.w d6,d4 * E=E-DX SOIT D4=D4-D6
- lou4 Dbf.w D5,non
- movem.l (a7)+,d0-d7/a0-a6
- rts
-
- * Routine 2
-
- * Incrementation Y
-
- nony:
- add.w a5,a0 * on passe a la ligne suivante
- add.w a5,a6
- or.w d2,6(a0)
- or.w d0,6(a6)
- sub.w d6,d4 * E=E-DX SOIT D4=D4-D6
- bge.s liou
- add.w d7,d4 * d4=(dy/dx)-(ay/ax)
- add.w d2,d2
- bcc.s codes
- moveq.w #1,D2
- subq.w #8,a0
- codes add.w d0,d0
- bcc.s liou
- moveq.w #1,D0
- subq.w #8,A6
- liou Dbf.w D5,nony
- movem.l (a7)+,d0-d7/a0-a6
- rts
-
- wvbl
- MOVE.W $468,D1
- VSYNC CMP $468,D1
- BEQ VSYNC
- rts
-
-
- clear_screen *NO COMMENTS...
- move.l $44e.w,a1
- move.w #7999,d0
- cls clr.l (a1)+
- dbf d0,cls
- rts
-
- ********************** DONNEE CONCERNANT LE MORPHING
-
- ordonnee:
- i set 0
- rept 201
- dc.w i
- i set i+160
- endr
-
- abscisse
- i set 0
- rept 25
- dc.w i,32768,i,16384,i,8192,i,4096,i,2048,i,1024,i,512
- dc.w i,256,i,128,i,64,i,32,i,16,i,8,i,4,i,2,i,1
- i set i+8
- endr
-
- carre_triangle.dat
- incbin a:\morphing\precalc\carretri.dat
- even
- carre_triangle.xy
- incbin a:\morphing\precalc\carretri.xy
- even
- triangle_sablier.dat
- incbin a:\morphing\precalc\trisabli.dat
- even
- triangle_sablier.xy
- incbin a:\morphing\precalc\trisabli.xy
- even
- sablier_fleche.xy
- incbin a:\morphing\precalc\sablifle.xy
- even
- sablier_fleche.dat
- incbin a:\morphing\precalc\sablifle.dat
- even
- fleche_carre.xy
- incbin a:\morphing\precalc\flecarre.xy
- fleche_carre.dat
- incbin a:\morphing\precalc\flecarre.dat
-
- waitz dc.w 50000
-
-
- ******** LE SCRIPT EST COMPOSE COMME SUIT:
- **
- ** DC.L ADRESSE_DES_COORDONNEES_DE_L'OBJET,ADRESSE_DE_LA_TABLE_DES_LIENS_CORRESPONDANT.
- ** DC.L ADRESSE_DES_COORDONNEES_DE_L'OBJET,ADRESSE_DE_LA_TABLE_DES_LIENS_CORRESPONDANT.
- ** DC.L ...
- ** DC.L $FFFFFFFF FIN DU SCRIPT
-
- SCRIPT
- DC.L CARRE_TRIANGLE.DAT,CARRE_TRIANGLE.XY
- DC.L TRIANGLE_SABLIER.DAT,TRIANGLE_SABLIER.XY
- DC.L SABLIER_FLECHE.DAT,SABLIER_FLECHE.XY
- DC.L FLECHE_CARRE.DAT,FLECHE_CARRE.XY
- DC.L $FFFFFFFF
-
- palette ds.w 1
- dcb.w 15,$777
-
- *******************************
- BSS
-
- POINTEUR_SCRIPT DS.L 1
- savcol ds.l 8
- savres ds.w 1
- distance ds.w 1
- liens ds.l 1
- buffer ds.l 1
- nb_transitions ds.w 1
- ds.l 200
- pile ds.w 1
-
-