diff options
| author | Steven Fuller <relnev@icculus.org> | 2001-08-09 06:23:42 +0000 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 02:22:36 +0200 |
| commit | ea2f8c4527f401e721717177a11306213c13eac1 (patch) | |
| tree | bbf2e2316b1dce71feed550b11e33e9f7885b52e /src/mathline.c | |
| parent | 45cf2eb3a194d53ccdd05a75b46e472a01359abf (diff) | |
Fixed FPU assembly. (fistp is 16bit, fistpl is 32bit)
Game displays now.
Diffstat (limited to 'src/mathline.c')
| -rw-r--r-- | src/mathline.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/mathline.c b/src/mathline.c index 98eb676..7879f95 100644 --- a/src/mathline.c +++ b/src/mathline.c @@ -20,8 +20,10 @@ int WideMulNarrowDiv(int a, int b, int c); void RotateVector_ASM(VECTORCH *v, MATRIXCH *m); void RotateAndCopyVector_ASM(VECTORCH *v1, VECTORCH *v2, MATRIXCH *m); +#if 0 int FloatToInt(float); #define f2i(a, b) { a = FloatToInt(b); } +#endif void ADD_LL(LONGLONGCH *a, LONGLONGCH *b, LONGLONGCH *c) { @@ -568,9 +570,9 @@ int SqRoot32(int A) */ __asm__("finit \n\t" - "fild sqrt_temp1 \n\t" + "fildl sqrt_temp1 \n\t" "fsqrt \n\t" - "fistp sqrt_temp2 \n\t" + "fistpl sqrt_temp2 \n\t" "fwait \n\t" : : @@ -600,6 +602,21 @@ __asm__("finit \n\t" extern float fti_fptmp; extern int fti_itmp; +void FloatToInt() +{ +#if 1 +__asm__("fld fti_fptmp \n\t" + "fistpl fti_itmp \n\t" + : + : + : "memory", "cc" + ); +#else + fti_itmp = (int)fti_fptmp; +#endif +} + +#if 0 int FloatToInt(float fptmp) { #if 1 @@ -623,6 +640,7 @@ __asm__("fld fti_fptmp \n\t" return fptmp; #endif } +#endif void TranslatePoint(float *source, float *dest, float *matrix) { |
