mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-02 22:51:41 +00:00
assembly code got messed up
This commit is contained in:
parent
6dc007dea1
commit
1caa63369f
1 changed files with 144 additions and 101 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.9 2002/06/16 20:51:10 niceass
|
||||
// assembly code got messed up
|
||||
//
|
||||
// Revision 1.8 2002/06/16 20:06:14 jbravo
|
||||
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
|
||||
//
|
||||
|
@ -987,7 +990,7 @@ int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
|||
#pragma warning( disable: 4035 )
|
||||
|
||||
__declspec(naked)
|
||||
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||
{
|
||||
static int bops_initialized;
|
||||
static int Ljmptab[8];
|
||||
|
@ -995,187 +998,227 @@ int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
|||
__asm {
|
||||
|
||||
push ebx
|
||||
cmp bops_initialized, 1
|
||||
je initialized
|
||||
mov bops_initialized, 1
|
||||
mov Ljmptab[0 * 4], offset Lcase0
|
||||
mov Ljmptab[1 * 4], offset Lcase1
|
||||
mov Ljmptab[2 * 4], offset Lcase2
|
||||
mov Ljmptab[3 * 4], offset Lcase3
|
||||
mov Ljmptab[4 * 4], offset Lcase4
|
||||
mov Ljmptab[5 * 4], offset Lcase5
|
||||
mov Ljmptab[6 * 4], offset Lcase6
|
||||
mov Ljmptab[7 * 4], offset Lcase7 initialized:mov edx, dword ptr[4 + 12 + esp]
|
||||
mov ecx, dword ptr[4 + 4 + esp]
|
||||
xor eax, eax mov ebx, dword ptr[4 + 8 + esp]
|
||||
mov al, byte ptr[17 + edx]
|
||||
cmp al, 8 jge Lerror fld dword ptr[0 + edx]
|
||||
|
||||
cmp bops_initialized, 1
|
||||
je initialized
|
||||
mov bops_initialized, 1
|
||||
|
||||
mov Ljmptab[0*4], offset Lcase0
|
||||
mov Ljmptab[1*4], offset Lcase1
|
||||
mov Ljmptab[2*4], offset Lcase2
|
||||
mov Ljmptab[3*4], offset Lcase3
|
||||
mov Ljmptab[4*4], offset Lcase4
|
||||
mov Ljmptab[5*4], offset Lcase5
|
||||
mov Ljmptab[6*4], offset Lcase6
|
||||
mov Ljmptab[7*4], offset Lcase7
|
||||
|
||||
initialized:
|
||||
|
||||
mov edx,dword ptr[4+12+esp]
|
||||
mov ecx,dword ptr[4+4+esp]
|
||||
xor eax,eax
|
||||
mov ebx,dword ptr[4+8+esp]
|
||||
mov al,byte ptr[17+edx]
|
||||
cmp al,8
|
||||
jge Lerror
|
||||
fld dword ptr[0+edx]
|
||||
fld st(0)
|
||||
jmp dword ptr[Ljmptab + eax * 4] Lcase0:fmul dword ptr[ebx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
jmp dword ptr[Ljmptab+eax*4]
|
||||
Lcase0:
|
||||
fmul dword ptr[ebx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase1:fmul dword ptr[ecx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase1:
|
||||
fmul dword ptr[ecx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase2:fmul dword ptr[ebx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase2:
|
||||
fmul dword ptr[ebx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase3:fmul dword ptr[ecx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase3:
|
||||
fmul dword ptr[ecx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase4:fmul dword ptr[ebx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase4:
|
||||
fmul dword ptr[ebx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase5:fmul dword ptr[ecx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase5:
|
||||
fmul dword ptr[ecx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase6:fmul dword ptr[ebx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase6:
|
||||
fmul dword ptr[ebx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ecx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0)
|
||||
jmp LSetSides Lcase7:fmul dword ptr[ecx]
|
||||
fld dword ptr[0 + 4 + edx]
|
||||
faddp st(2),st(0)
|
||||
jmp LSetSides
|
||||
Lcase7:
|
||||
fmul dword ptr[ecx]
|
||||
fld dword ptr[0+4+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[4 + ecx]
|
||||
fld dword ptr[0 + 8 + edx]
|
||||
fmul dword ptr[4+ecx]
|
||||
fld dword ptr[0+8+edx]
|
||||
fxch st(2)
|
||||
fmul dword ptr[4 + ebx]
|
||||
fmul dword ptr[4+ebx]
|
||||
fxch st(2)
|
||||
fld st(0)
|
||||
fmul dword ptr[8 + ecx]
|
||||
fmul dword ptr[8+ecx]
|
||||
fxch st(5)
|
||||
faddp st(3), st(0)
|
||||
fmul dword ptr[8 + ebx]
|
||||
faddp st(3),st(0)
|
||||
fmul dword ptr[8+ebx]
|
||||
fxch st(1)
|
||||
faddp st(3), st(0)
|
||||
faddp st(3),st(0)
|
||||
fxch st(3)
|
||||
faddp st(2), st(0) LSetSides:faddp st(2), st(0)
|
||||
fcomp dword ptr[12 + edx]
|
||||
xor ecx, ecx fnstsw ax fcomp dword ptr[12 + edx]
|
||||
and ah, 1
|
||||
xor ah, 1
|
||||
add cl, ah fnstsw ax and ah, 1 add ah, ah add cl, ah pop ebx mov eax, ecx ret Lerror:int 3}}
|
||||
faddp st(2),st(0)
|
||||
LSetSides:
|
||||
faddp st(2),st(0)
|
||||
fcomp dword ptr[12+edx]
|
||||
xor ecx,ecx
|
||||
fnstsw ax
|
||||
fcomp dword ptr[12+edx]
|
||||
and ah,1
|
||||
xor ah,1
|
||||
add cl,ah
|
||||
fnstsw ax
|
||||
and ah,1
|
||||
add ah,ah
|
||||
add cl,ah
|
||||
pop ebx
|
||||
mov eax,ecx
|
||||
ret
|
||||
Lerror:
|
||||
int 3
|
||||
}
|
||||
}
|
||||
#pragma warning( default: 4035 )
|
||||
#endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue