123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- #include "asm_i386.h"
- #include "quakeasm.h"
- #include "asm_draw.h"
- #include "d_ifacea.h"
- #if id386
- .data
- Lfloat_1: .single 1.0
- Ltemp: .long 0
- Lcoords: .long 0, 0, 0
- .text
- #define fv 12+4
- #define pstverts 12+8
- .globl C(R_AliasTransformAndProjectFinalVerts)
- C(R_AliasTransformAndProjectFinalVerts):
- pushl %ebp
- pushl %edi
- pushl %esi
- movl C(r_apverts),%esi
- movl pstverts(%esp),%ebp
- movl fv(%esp),%edi
- movl C(r_anumverts),%ecx
- subl %edx,%edx
- Lloop:
- movb (%esi),%dl
- movb %dl,Lcoords
- fildl Lcoords
- movb 1(%esi),%dl
- movb %dl,Lcoords+4
- fildl Lcoords+4
- movb 2(%esi),%dl
- movb %dl,Lcoords+8
- fildl Lcoords+8
- fld %st(2)
- fmuls C(aliastransform)+32
- fld %st(2)
- fmuls C(aliastransform)+36
- fxch %st(1)
- fadds C(aliastransform)+44
- fld %st(2)
- fmuls C(aliastransform)+40
-
- fxch %st(1)
- faddp %st(0),%st(2)
- movb tv_lightnormalindex(%esi),%dl
- movl stv_s(%ebp),%eax
- movl %eax,fv_v+8(%edi)
- faddp %st(0),%st(1)
- movl stv_t(%ebp),%eax
- movl %eax,fv_v+12(%edi)
- fdivrs Lfloat_1
- movl stv_onseam(%ebp),%eax
- movl %eax,fv_flags(%edi)
- movl fv_size(%edi),%eax
- movl stv_size(%ebp),%eax
- movl 4(%esi),%eax
- leal (%edx,%edx,2),%eax
- fxch %st(3)
- flds C(r_avertexnormals)(,%eax,4)
- fmuls C(r_plightvec)
- flds C(r_avertexnormals)+4(,%eax,4)
- fmuls C(r_plightvec)+4
- flds C(r_avertexnormals)+8(,%eax,4)
- fmuls C(r_plightvec)+8
- fxch %st(1)
- faddp %st(0),%st(2)
- fld %st(2)
-
- fmuls C(aliastransform)+0
-
- fxch %st(2)
-
- faddp %st(0),%st(1)
- fsts Ltemp
- movl C(r_ambientlight),%eax
- movb Ltemp+3,%dl
- testb $0x80,%dl
- jz Lsavelight
-
- fmuls C(r_shadelight)
- fistpl Ltemp
- addl Ltemp,%eax
- jns Lp1
- subl %eax,%eax
- Lp1:
- fxch %st(1)
- fmuls C(aliastransform)+16
- fxch %st(3)
- fld %st(0)
- fmuls C(aliastransform)+4
- fxch %st(1)
- movl %eax,fv_v+16(%edi)
- fmuls C(aliastransform)+20
-
- fxch %st(2)
-
- fadds C(aliastransform)+12
-
- fxch %st(4)
-
- fadds C(aliastransform)+28
-
- fxch %st(3)
-
- fld %st(0)
-
- fmuls C(aliastransform)+8
-
- fxch %st(1)
-
- fmuls C(aliastransform)+24
-
- fxch %st(5)
-
- faddp %st(0),%st(2)
-
- fxch %st(3)
-
- faddp %st(0),%st(2)
- addl $(tv_size),%esi
- faddp %st(0),%st(2)
- faddp %st(0),%st(2)
- addl $(stv_size),%ebp
- fmul %st(2),%st(0)
- fxch %st(1)
- fmul %st(2),%st(0)
- fxch %st(1)
- fadds C(aliasxcenter)
- fxch %st(1)
- fadds C(aliasycenter)
- fxch %st(2)
- fistpl fv_v+20(%edi)
- fistpl fv_v+0(%edi)
- fistpl fv_v+4(%edi)
- addl $(fv_size),%edi
- decl %ecx
- jnz Lloop
- popl %esi
- popl %edi
- popl %ebp
- ret
- Lsavelight:
- fstp %st(0)
- jmp Lp1
- #endif
|