summaryrefslogtreecommitdiff
path: root/src/mathline.c
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2001-08-15 20:09:25 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:36 +0200
commitdee2992e7f766e3dfe42ce8e4ea6edc44ab5f954 (patch)
tree162192011e0995e0dfe9af1cf752926b4b8ea542 /src/mathline.c
parentf4a6541010e5576474aa43ce2ebede85a46b7298 (diff)
Fixed crash on the Subway DM level. (something wrong with CMP_LL)
Diffstat (limited to 'src/mathline.c')
-rw-r--r--src/mathline.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mathline.c b/src/mathline.c
index 2adfc09..ceffbc9 100644
--- a/src/mathline.c
+++ b/src/mathline.c
@@ -183,8 +183,8 @@ __asm__("imull %%edx \n\t"
int CMP_LL(LONGLONGCH *a, LONGLONGCH *b)
{
- int retval;
/*
+ int retval;
_asm
{
mov ebx,a
@@ -205,6 +205,8 @@ int CMP_LL(LONGLONGCH *a, LONGLONGCH *b)
llgs:
}
*/
+#if 0
+int retval;
/* TODO */
__asm__("movl 0(%%ebx), %%eax \n\t"
"movl 4(%%ebx), %%edx \n\t"
@@ -227,6 +229,18 @@ __asm__("movl 0(%%ebx), %%eax \n\t"
);
return retval;
+#else
+ if (a->hi32 > b->hi32)
+ return 1;
+ else if (a->hi32 < b->hi32)
+ return -1;
+ else if (a->lo32 > b->lo32)
+ return 1;
+ else if (a->lo32 < b->lo32)
+ return -1;
+ else
+ return 0;
+#endif
}
/* EQUALS */
@@ -244,6 +258,7 @@ void EQUALS_LL(LONGLONGCH *a, LONGLONGCH *b)
mov [edi+4],edx
}
*/
+#if 0
__asm__("movl 0(%%esi), %%eax \n\t"
"movl 4(%%esi), %%edx \n\t"
"movl %%eax, 0(%%edi) \n\t"
@@ -252,6 +267,9 @@ __asm__("movl 0(%%esi), %%eax \n\t"
: "D" (a), "S" (b)
: "%eax", "%edx", "memory"
);
+#else
+ *a = *b;
+#endif
}
/* NEGATE */