diff options
| author | Steven Fuller <relnev@icculus.org> | 2001-07-29 18:25:45 +0000 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 02:22:36 +0200 |
| commit | 5c497c61a656f338eb9599fb5f364ad853d0eccf (patch) | |
| tree | 125832fffe333da4ef51de914fd012de54569b4e /src/win95/plspecfn.c | |
| parent | 44d4752e83d807cde6aff8260b5aa2acdf77778d (diff) | |
Implemented (most of) the inline assembly in inline.h
Diffstat (limited to 'src/win95/plspecfn.c')
| -rw-r--r-- | src/win95/plspecfn.c | 180 |
1 files changed, 5 insertions, 175 deletions
diff --git a/src/win95/plspecfn.c b/src/win95/plspecfn.c index 26c9527..0efb61e 100644 --- a/src/win95/plspecfn.c +++ b/src/win95/plspecfn.c @@ -18,6 +18,11 @@ #include "kshape.h" #endif +/* globals from inline.h */ +int sqrt_temp1; +int sqrt_temp2; +float fti_fptmp; +int fti_itmp; /* @@ -513,88 +518,6 @@ int WideMul2NarrowDiv(int a, int b, int c, int d, int e) } - - - -/* - - Square Root - - Returns the Square Root of a 32-bit number - -*/ - -#if (SupportFPMathsFunctions || SupportFPSquareRoot) -#else - - -int SqRoot32(int A) - -{ - - unsigned int edx = A; - unsigned int ecx; - - unsigned int ax = 0; - unsigned int bx = 0; - unsigned int di = 0; - - - for(ecx = 15; ecx!=0; ecx--) { - - bx <<= 1; - if(edx & 0x80000000) bx |= 1; - edx <<= 1; - - bx <<= 1; - if(edx & 0x80000000) bx |= 1; - edx <<= 1; - - ax += ax; - di = ax; - di += di; - - if(bx > di) { - - di++; - ax++; - - bx -= di; - - } - - } - - bx <<= 1; - if(edx & 0x80000000) bx |= 1; - edx <<= 1; - - bx <<= 1; - if(edx & 0x80000000) bx |= 1; - edx <<= 1; - - ax += ax; - di = ax; - di += di; - - if(bx > di) { - - ax++; - - } - - return ((int)ax); - -} - - -#endif /* SupportFPMathsFunctions */ - - - - - - /* Calculate Plane Normal from three POP's @@ -1115,99 +1038,6 @@ int Magnitude(VECTORCH *v) } - - - - - - - - - -/* - - 64-bit Square Root returns 32-bit result - - All 64-bit operations are now done using the type LONGLONGCH whose format - varies from platform to platform, although it is always 64-bits in size. - - NOTE: - - Function currently not available to Watcom C users - A Floating point version is STRONGLY advised for the PC anyway - -*/ - -#if 0 -int SqRoot64(LONGLONGCH *A) - -{ - -#if 0 - - unsigned long long edx = *A; - - unsigned int eax = 0; - unsigned int ebx = 0; - unsigned int edi = 0; - - unsigned int ecx; - - - unsigned long long TopBit = 0x8000000000000000LL; - - for(ecx = 31; ecx != 0; ecx--) { - - ebx <<= 1; - if(edx & TopBit) ebx |= 1; - edx <<= 1; - - ebx <<= 1; - if(edx & TopBit) ebx |= 1; - edx <<= 1; - - eax += eax; - edi = eax; - edi += edi; - - if(ebx > edi) { - - edi++; - eax++; - ebx -= edi; - - } - - } - - ebx <<= 1; - if(edx & TopBit) ebx |= 1; - edx <<= 1; - - ebx <<= 1; - if(edx & TopBit) ebx |= 1; - edx <<= 1; - - eax += eax; - edi = eax; - edi += edi; - - if(ebx > edi) { - - eax++; - - } - - return eax; - -#endif - - return (0); - -} - -#endif /* for #if 0 */ - /* Shift the 64-bit value until is LTE the limit |
