mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-03 07:01:16 +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$
|
// $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
|
// 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"
|
// 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 )
|
#pragma warning( disable: 4035 )
|
||||||
|
|
||||||
__declspec(naked)
|
__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 bops_initialized;
|
||||||
static int Ljmptab[8];
|
static int Ljmptab[8];
|
||||||
|
@ -995,187 +998,227 @@ int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *p)
|
||||||
__asm {
|
__asm {
|
||||||
|
|
||||||
push ebx
|
push ebx
|
||||||
cmp bops_initialized, 1
|
|
||||||
je initialized
|
cmp bops_initialized, 1
|
||||||
mov bops_initialized, 1
|
je initialized
|
||||||
mov Ljmptab[0 * 4], offset Lcase0
|
mov bops_initialized, 1
|
||||||
mov Ljmptab[1 * 4], offset Lcase1
|
|
||||||
mov Ljmptab[2 * 4], offset Lcase2
|
mov Ljmptab[0*4], offset Lcase0
|
||||||
mov Ljmptab[3 * 4], offset Lcase3
|
mov Ljmptab[1*4], offset Lcase1
|
||||||
mov Ljmptab[4 * 4], offset Lcase4
|
mov Ljmptab[2*4], offset Lcase2
|
||||||
mov Ljmptab[5 * 4], offset Lcase5
|
mov Ljmptab[3*4], offset Lcase3
|
||||||
mov Ljmptab[6 * 4], offset Lcase6
|
mov Ljmptab[4*4], offset Lcase4
|
||||||
mov Ljmptab[7 * 4], offset Lcase7 initialized:mov edx, dword ptr[4 + 12 + esp]
|
mov Ljmptab[5*4], offset Lcase5
|
||||||
mov ecx, dword ptr[4 + 4 + esp]
|
mov Ljmptab[6*4], offset Lcase6
|
||||||
xor eax, eax mov ebx, dword ptr[4 + 8 + esp]
|
mov Ljmptab[7*4], offset Lcase7
|
||||||
mov al, byte ptr[17 + edx]
|
|
||||||
cmp al, 8 jge Lerror fld dword ptr[0 + edx]
|
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)
|
fld st(0)
|
||||||
jmp dword ptr[Ljmptab + eax * 4] Lcase0:fmul dword ptr[ebx]
|
jmp dword ptr[Ljmptab+eax*4]
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase0:
|
||||||
|
fmul dword ptr[ebx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ecx]
|
fmul dword ptr[ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase1:fmul dword ptr[ecx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase1:
|
||||||
|
fmul dword ptr[ecx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ebx]
|
fmul dword ptr[ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase2:fmul dword ptr[ebx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase2:
|
||||||
|
fmul dword ptr[ebx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ecx]
|
fmul dword ptr[ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase3:fmul dword ptr[ecx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase3:
|
||||||
|
fmul dword ptr[ecx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ebx]
|
fmul dword ptr[ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase4:fmul dword ptr[ebx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase4:
|
||||||
|
fmul dword ptr[ebx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ecx]
|
fmul dword ptr[ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase5:fmul dword ptr[ecx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase5:
|
||||||
|
fmul dword ptr[ecx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ebx]
|
fmul dword ptr[ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase6:fmul dword ptr[ebx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase6:
|
||||||
|
fmul dword ptr[ebx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ecx]
|
fmul dword ptr[ecx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
jmp LSetSides Lcase7:fmul dword ptr[ecx]
|
jmp LSetSides
|
||||||
fld dword ptr[0 + 4 + edx]
|
Lcase7:
|
||||||
|
fmul dword ptr[ecx]
|
||||||
|
fld dword ptr[0+4+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[ebx]
|
fmul dword ptr[ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[4 + ecx]
|
fmul dword ptr[4+ecx]
|
||||||
fld dword ptr[0 + 8 + edx]
|
fld dword ptr[0+8+edx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fmul dword ptr[4 + ebx]
|
fmul dword ptr[4+ebx]
|
||||||
fxch st(2)
|
fxch st(2)
|
||||||
fld st(0)
|
fld st(0)
|
||||||
fmul dword ptr[8 + ecx]
|
fmul dword ptr[8+ecx]
|
||||||
fxch st(5)
|
fxch st(5)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fmul dword ptr[8 + ebx]
|
fmul dword ptr[8+ebx]
|
||||||
fxch st(1)
|
fxch st(1)
|
||||||
faddp st(3), st(0)
|
faddp st(3),st(0)
|
||||||
fxch st(3)
|
fxch st(3)
|
||||||
faddp st(2), st(0) LSetSides:faddp st(2), st(0)
|
faddp st(2),st(0)
|
||||||
fcomp dword ptr[12 + edx]
|
LSetSides:
|
||||||
xor ecx, ecx fnstsw ax fcomp dword ptr[12 + edx]
|
faddp st(2),st(0)
|
||||||
and ah, 1
|
fcomp dword ptr[12+edx]
|
||||||
xor ah, 1
|
xor ecx,ecx
|
||||||
add cl, ah fnstsw ax and ah, 1 add ah, ah add cl, ah pop ebx mov eax, ecx ret Lerror:int 3}}
|
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 )
|
#pragma warning( default: 4035 )
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue