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)
15 #define W 320 /*/ change this if you change W in main.c ... (dirty..) */
20 a memaddshadedset function
21 (or something like that ) */
24 .type memshset,@function
31 pushl %edi /* registres a sauvegarder (convention gcc) */
35 movl 8(%ebp),%edi /* dst */
37 movl 16(%ebp),%ebx /* fixed point */
38 movl 20(%ebp),%ecx /* half length */
44 subl %ecx,%edi /* %edi left segment */
45 addl %ecx,%esi /* %esi right segment */
46 incl %esi /* dont overlap at middle */
50 decl %edx /* for in-advance incl in loop */
52 addl %ebx,%eax /* increment color */
55 addb %ah,(%edi,%ecx) /* increment left pixel */
56 jc 3f /* did overflow ? */
58 addb %ah,(%esi,%edx) /* increment right pixel */
71 /* function goes on (several exit points): */
74 addb %ah,(%esi,%edx) /* we recopy all the code.. to avoid jmps (hmm some asm guru here : is it really efficient ?.. */
97 /* function really stops here */
101 /* draw a star (5 pixels) */
103 .type starsh,@function
111 movl 8(%ebp),%edi /* dst */
112 movl 12(%ebp),%edx /* inc */
139 movb $255,(W-1)(%edi)
159 movb $255,(2*W)(%edi)
167 movb $255,(W+1)(%edi)
174 /* do the "motion blur" (actually the pixel fading) */
176 .type mblur,@function
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 */