26 #define PARTICLE_OPAQUE 2
37 #if id386 && !defined __linux__ && !defined __FreeBSD__
39 static unsigned s_prefetch_address;
61 __asm mov bl,
byte ptr [edi]
67 __asm mov
al,
byte ptr [
ebp]
69 __asm mov
byte ptr [edi],
al
81 __asm mov bl,
byte ptr [edi]
86 __asm mov
al,
byte ptr [
ebp]
88 __asm mov
byte ptr [edi],
al
95 __asm mov
byte ptr [edi],
al
111 static vec3_t local, transformed;
113 static int u,
v, tmp;
125 static float one = 1.0F;
126 static float point_five = 0.5F;
127 static float eight_thousand_hex = 0x8000;
132 __asm mov ebpsave,
ebp
141 __asm fld dword ptr [esi+0] ; p_o.x
142 __asm fsub dword ptr [
r_origin+0] ; p_o.x-r_o.x
143 __asm fld dword ptr [esi+4] ; p_o.y | p_o.x-r_o.x
144 __asm fsub dword ptr [
r_origin+4] ; p_o.y-r_o.y | p_o.x-r_o.x
145 __asm fld dword ptr [esi+8] ; p_o.z | p_o.y-r_o.y | p_o.x-r_o.x
146 __asm fsub dword ptr [
r_origin+8] ; p_o.z-r_o.z | p_o.y-r_o.y | p_o.x-r_o.x
147 __asm fxch
st(2) ; p_o.x-r_o.x | p_o.y-r_o.y | p_o.z-r_o.z
148 __asm fstp dword ptr [local+0] ; p_o.y-r_o.y | p_o.z-r_o.z
149 __asm fstp dword ptr [local+4] ; p_o.z-r_o.z
150 __asm fstp dword ptr [local+8] ; (empty)
155 __asm fld dword ptr [local+0] ; l.x
156 __asm fmul dword ptr [
r_pright+0] ; l.x*pr.x
157 __asm fld dword ptr [local+4] ; l.y | l.x*pr.x
158 __asm fmul dword ptr [
r_pright+4] ; l.y*pr.y | l.x*pr.x
159 __asm fld dword ptr [local+8] ; l.z | l.y*pr.y | l.x*pr.x
160 __asm fmul dword ptr [
r_pright+8] ; l.z*pr.z | l.y*pr.y | l.x*pr.x
161 __asm fxch
st(2) ; l.x*pr.x | l.y*pr.y | l.z*pr.z
162 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y | l.z*pr.z
163 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y + l.z*pr.z
164 __asm fstp dword ptr [transformed+0] ; (empty)
166 __asm fld dword ptr [local+0] ; l.x
167 __asm fmul dword ptr [
r_pup+0] ; l.x*pr.x
168 __asm fld dword ptr [local+4] ; l.y | l.x*pr.x
169 __asm fmul dword ptr [
r_pup+4] ; l.y*pr.y | l.x*pr.x
170 __asm fld dword ptr [local+8] ; l.z | l.y*pr.y | l.x*pr.x
171 __asm fmul dword ptr [
r_pup+8] ; l.z*pr.z | l.y*pr.y | l.x*pr.x
172 __asm fxch
st(2) ; l.x*pr.x | l.y*pr.y | l.z*pr.z
173 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y | l.z*pr.z
174 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y + l.z*pr.z
175 __asm fstp dword ptr [transformed+4] ; (empty)
177 __asm fld dword ptr [local+0] ; l.x
178 __asm fmul dword ptr [
r_ppn+0] ; l.x*pr.x
179 __asm fld dword ptr [local+4] ; l.y | l.x*pr.x
180 __asm fmul dword ptr [
r_ppn+4] ; l.y*pr.y | l.x*pr.x
181 __asm fld dword ptr [local+8] ; l.z | l.y*pr.y | l.x*pr.x
182 __asm fmul dword ptr [
r_ppn+8] ; l.z*pr.z | l.y*pr.y | l.x*pr.x
183 __asm fxch
st(2) ; l.x*pr.x | l.y*pr.y | l.z*pr.z
184 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y | l.z*pr.z
185 __asm faddp
st(1),
st ; l.x*pr.x + l.y*pr.y + l.z*pr.z
186 __asm fstp dword ptr [transformed+8] ; (empty)
197 __asm mov eax, dword ptr [transformed+8]
200 __asm cmp eax, particle_z_clip
208 __asm fdiv dword ptr [transformed+8]
222 __asm je blendfunc_66
223 __asm jl blendfunc_33
225 __asm jmp done_selecting_blend_func
228 __asm jmp done_selecting_blend_func
231 done_selecting_blend_func:
232 __asm mov blendfunc, ebx
235 __asm mov
ebp, s_prefetch_address
244 __asm fmul dword ptr [transformed+0] ; zi * transformed[0]
245 __asm fld zi ; zi | zi * transformed[0]
246 __asm fmul dword ptr [transformed+4] ; zi * transformed[1] | zi * transformed[0]
247 __asm fxch
st(1) ; zi * transformed[0] | zi * transformed[1]
248 __asm fadd
xcenter ;
xcenter + zi * transformed[0] | zi * transformed[1]
249 __asm fxch
st(1) ; zi * transformed[1] |
xcenter + zi * transformed[0]
251 __asm fsubrp
st(1),
st(0) ;
ycenter - zi * transformed[1] |
xcenter + zi * transformed[0]
252 __asm fxch
st(1) ;
xcenter + zi * transformed[0] |
ycenter + zi * transformed[1]
253 __asm fadd point_five ;
xcenter + zi * transformed[0] + 0.5 |
ycenter - zi * transformed[1]
254 __asm fxch
st(1) ;
ycenter - zi * transformed[1] |
xcenter + zi * transformed[0] + 0.5
255 __asm fadd point_five ;
ycenter - zi * transformed[1] + 0.5 |
xcenter + zi * transformed[0] + 0.5
256 __asm fxch
st(1) ; u |
v
257 __asm fistp dword ptr [u] ;
v
258 __asm fistp dword ptr [
v] ; (empty)
299 __asm shl eax, 1 ; eax = 2*(
d_zwidth*
v+u)
305 __asm fmul eight_thousand_hex
332 __asm jge check_pix_max
334 __asm jmp skip_pix_clamp
340 __asm jle skip_pix_clamp
369 top_of_pix_vert_loop:
371 top_of_pix_horiz_loop:
385 __asm mov
ax, word ptr [esi]
388 __asm jg end_of_horiz_loop
390 #
if ENABLE_ZWRITES_FOR_PARTICLES
392 __asm mov word ptr [esi], bp
397 __asm call [blendfunc]
405 __asm jnz top_of_pix_horiz_loop
423 __asm jnz top_of_pix_vert_loop
432 __asm mov
ebp, ebpsave
471 vec3_t local, transformed;
475 int color = pparticle->
color;
505 zi = 1.0 / transformed[2];
506 u = (
int)(
xcenter + zi * transformed[0] + 0.5);
523 izi = (
int)(zi * 0x8000);
545 for (
i=0 ;
i<pix ;
i++)
559 for (
i=0 ;
i<pix ;
i++)
573 for (
i=0 ;
i<pix ;
i++)
601 #if id386 && !defined __linux__ && !defined __FreeBSD__
602 extern unsigned long fpu_sp24_cw, fpu_chop_cw;
609 #if id386 && !defined __linux__ && !defined __FreeBSD__
610 __asm fldcw word ptr [fpu_sp24_cw]
616 if ( p->
alpha > 0.66 )
618 else if ( p->
alpha > 0.33 )
626 #if id386 && !defined __linux__ && !defined __FreeBSD__
628 s_prefetch_address = (
unsigned int ) ( p + 1 );
636 #if id386 && !defined __linux__ && !defined __FreeBSD__
637 __asm fldcw word ptr [fpu_chop_cw]