/[projet1]/public/atari/tools/rembrandt/DIVERS/INC_LINE.S
Defence Force logotype

Contents of /public/atari/tools/rembrandt/DIVERS/INC_LINE.S

Parent Directory Parent Directory | Revision Log Revision Log


Revision 67 - (show annotations)
Sat Apr 25 18:10:46 2009 UTC (10 years, 7 months ago) by dbug
File size: 1973 byte(s)
Added Rembrandt and Forgotten Bits
1 opt o+,p+
2
3 deb
4
5 xx1 dc.w 0
6 x1 dc.w 0
7 yy1 dc.w 0
8 y1 dc.w 0
9 xx2 dc.w 0
10 x2 dc.w 0
11 yy2 dc.w 0
12 y2 dc.w 0
13 couleur dc.w 0
14 ‚cran dc.l 0
15
16 trace_ligne
17 movem.l d0-a6,-(sp)
18
19 move.l xx2(pc),d0
20 move.l xx1(pc),d1
21 sub.l d1,d0 d0 = Largeur
22 bpl.s .largeur_positive
23 neg.l d0 d0 = ABS(Largeur)
24 .largeur_positive
25 addq.l #1,d0 d0 = d0+1
26
27 move.l yy2(pc),d1
28 move.l yy1(pc),d2
29 sub.l d2,d1 d1 = Hauteur
30 bpl.s .hauteur_positive
31 neg.l d1 d1 = ABS(hauteur)
32 .hauteur_positive
33 addq.l #1,d1 d1 = d1+1
34
35 *** d0=ABS(largeur) /DX
36 *** d1=ABS(hauteur) /DY
37 *** d5=ix
38 *** d6=iy
39 *** d7=nombre de points
40
41 cmp.l d1,d0
42 bge.s largeur_max
43 hauteur_max
44 move d1,d7 Nombre de points=hauteur
45 subq #1,d7
46
47 move.l xx1(pc),d0
48 cmp.l xx2(pc),d0
49 ble.s .ix_positif
50 .ix_n‚gatif
51 move d0,d5
52 neg d5
53 muls.l #65536,d6
54 divs.l d1,d5 IX=-DX/DY
55 bra.s .v‚rifie_iy
56 .ix_positif
57 move d0,d5
58 swap d5
59 divu.l d1,d5 IX=DX/DY
60 bra.s .v‚rifie_iy
61 nop
62 .v‚rifie_iy
63 move.l yy1(pc),d1
64 cmp.l yy2(pc),d1
65 ble.s .iy_positif
66 .iy_n‚gatif
67 move.l #-1*65536,d6 IY=1
68 bra.s ex‚cute_trace
69 .iy_positif
70 move.l #1*65536,d6 IY=1
71 bra.s ex‚cute_trace
72
73
74 largeur_max
75 move d0,d7 Nombre de points=largeur
76 subq #1,d7
77
78 move.l xx1(pc),d0
79 cmp.l xx2(pc),d0
80 ble.s .ix_positif
81 .ix_n‚gatif
82 move.l #-1*65536,d5 IX=1
83 bra.s .v‚rifie_iy
84 .ix_positif
85 move.l #1*65536,d5 IX=1
86 bra.s .v‚rifie_iy
87 nop
88 .v‚rifie_iy
89
90 move.l yy1(pc),d1
91 cmp.l yy2(pc),d1
92 ble.s .iy_positif
93 .iy_n‚gatif
94 move d1,d6
95 neg d6
96 muls.l #65536,d6
97 divs.l d0,d6 IY=-DY/DX
98 bra.s ex‚cute_trace
99 .iy_positif
100 move d1,d6
101 swap d6
102 divu.l d0,d6 IY=DY/DX
103 bra.s ex‚cute_trace
104
105 nop
106
107 ex‚cute_trace
108 .loop
109 move.l ‚cran(pc),a0
110 add d0,a0 X x2
111 add d0,a0
112 move d1,d2 Y x640
113 mulu #640,d2
114 add.l d2,a0
115 move couleur(pc),(a0)
116 swap d0
117 swap d1
118 add.l d5,d0
119 add.l d6,d1
120 swap d0
121 swap d1
122 dbra d7,.loop
123 movem.l (sp)+,d0-a6
124 rts
125
126 fin
127

  ViewVC Help
Powered by ViewVC 1.1.26