provide a package startup script for curl, which sets CURL_CA_BUNDLE to the common...
[AROS-Contrib.git] / Demo / Galaxy / memshd-i386.S
blob03a4b3a2df656f4d78a88f48b58116e1ce201458
2 .text
5 /* memshset (char *dst, int center_shade,int fixed_shade, int length_2)
6  dst is the *center* of the dst segment
7  center shade is the initial color (at center) (!! 8:8 also)
8  fixed_shade is the fixed point increment (8:8) 
9  length_2 is the 1/2 length to set (to the left, and to the right)
13         
14         
15 #define W 320   /*/ change this if you change W in main.c ... (dirty..) */
17         
18         
20         a memaddshadedset function
21       (or something like that ) */
22                 
23 .globl memshset
24 .type   memshset,@function
27 memshset:
28         pushl   %ebp
29         movl    %esp,%ebp
30         
31         pushl   %edi            /* registres a sauvegarder (convention gcc) */
32         pushl   %esi
33         pushl   %ebx
35         movl    8(%ebp),%edi      /* dst */
36         movl    12(%ebp),%eax
37         movl    16(%ebp),%ebx     /* fixed point */
38         movl    20(%ebp),%ecx     /* half length */
40         orl     %ecx,%ecx
41         jz      2f
43         movl    %edi,%esi
44         subl    %ecx,%edi       /* %edi  left segment */
45         addl    %ecx,%esi       /* %esi  right segment */
46         incl    %esi            /* dont overlap at middle */
47         
48         movl    %ecx,%edx
49         negl    %edx
50         decl    %edx  /* for in-advance incl in loop */
52         addl    %ebx,%eax      /* increment color */
53         incl    %edx
54         
55         addb    %ah,(%edi,%ecx) /* increment  left pixel */
56         jc      3f              /* did overflow ? */
57         
58         addb    %ah,(%esi,%edx) /* increment right pixel */
59         jc      4f
61         decl    %ecx
62         jnz     1b
64 2:      
65         popl    %ebx
66         popl    %esi
67         popl    %edi
69         leave
70         ret
71 /* function goes on (several exit points): */
73         movb    $255,(%edi,%ecx)
74         addb    %ah,(%esi,%edx)        /* we recopy all the code.. to avoid jmps   (hmm some asm guru here :     is it really efficient ?.. */
75         jc      4f
76         decl    %ecx
77         jnz     1b
78         
79         popl    %ebx
80         popl    %esi
81         popl    %edi
83         leave
84         ret
87         movb    $255,(%esi,%edx)
88         decl    %ecx
89         jnz     1b
90         
91         popl    %ebx
92         popl    %esi
93         popl    %edi
95         leave
96         ret
97 /* function really stops here  */
101 /* draw a star (5 pixels) */
102 .globl starsh
103 .type   starsh,@function
105 starsh: 
106         pushl   %ebp
107         movl    %esp,%ebp
108         
109         pushl   %edi
110         
111         movl    8(%ebp),%edi      /* dst */
112         movl    12(%ebp),%edx     /* inc */
114         addb    %dl,(W)(%edi)
115         jnc     3f
116         movb    $255,(W)(%edi)
119         shrb    $1,%dl
120         movb    (%edi),%al
121         movb    (W-1)(%edi),%cl
122         addb    %dl,%al
123         jc      1f
124         addb    %dl,%cl
125         jc      2f
126         movb    %al,(%edi)
127         movb    %cl,(W-1)(%edi)
128         jmp     31f
129 1:      
130         addb    %dl,%cl
131         jc      2f
132         movb    $255,(%edi)
133         movb    %cl,(W-1)(%edi)
135         jmp 31f
136         
137 2:      
138         movb    $255,(%edi)
139         movb    $255,(W-1)(%edi)
142 31:             
143         movb    2*W(%edi),%al
144         movb    (W+1)(%edi),%cl
145         addb    %dl,%al
146         jc      11f
147         addb    %dl,%cl
148         jc      21f
149         movb    %al,2*W(%edi)
150         movb    %cl,(W+1)(%edi)
151         popl    %edi
152         leave
153         ret
155         
156 11:     
157         addb    %dl,%cl
158         jc      21f
159         movb    $255,(2*W)(%edi)
160         movb    %cl,(W+1)(%edi)
161         popl    %edi
162         leave
163         ret
164         
165 21:     
166         movb    $255,2*W(%edi)
167         movb    $255,(W+1)(%edi)
168         popl    %edi
169         leave
170         ret
174 /* do the "motion blur" (actually the pixel fading) */
175 .globl  mblur
176 .type   mblur,@function
177         
178 mblur:  
179         pushl   %ebp
180         movl    %esp,%ebp
181         
182         pushl   %edi
183         pushl   %esi
184         pushl   %ebx
185         
186         movl    8(%ebp),%edi      /* dst */
187         movl    12(%ebp),%ecx     /* number */
188         movl    $0x7f7f7f7f,%edx  /* clear 1 upper bits */
189         movl    $0x1f1f1f1f,%esi  /* clear 3 upper bits */
190         shrl    $2,%ecx
191         jz      2f
194         movl    (%edi),%eax
195         addl    $4,%edi
196         
197         movl    %eax,%ebx
198         shrl    $1,%eax
200         
201         shrl    $3,%ebx
202         andl    %edx,%eax
203         
204         andl    %esi,%ebx
205         addl    %ebx,%eax
207         decl    %ecx
208         movl    %eax,-4(%edi)
209         
211         jnz     1b
215         popl    %ebx
216         popl    %esi
217         popl    %edi
218         leave
219         ret