summaryrefslogtreecommitdiff
path: root/src/math.asm
diff options
context:
space:
mode:
authorSteven Fuller <relnev@icculus.org>2001-08-06 19:50:26 +0000
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-20 02:22:36 +0200
commit0770c95c17191b8945695eb5c27c11d279e3c1b9 (patch)
treeae08d9afa6e83bbeeb586b21bb9823f43e93cdc6 /src/math.asm
parent12c6a39177837a5c4dc8928a78140b4c3bb8f47a (diff)
Moved TranslatePoint into a separate file.
Implemented most of the main loop in main.c. Game now seems to run OK. Need to write texture code and then add OpenGL.
Diffstat (limited to 'src/math.asm')
-rw-r--r--src/math.asm52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/math.asm b/src/math.asm
new file mode 100644
index 0000000..555b289
--- /dev/null
+++ b/src/math.asm
@@ -0,0 +1,52 @@
+BITS 32
+SECTION .text
+
+GLOBAL TranslatePoint_Asm
+
+; float *source, float *dest, float *matrix
+; "S" (source), "b" (dest), "d" (matrix)
+TranslatePoint_Asm:
+ fld dword [esi]
+ fmul dword [edi]
+ fld dword [esi+4]
+ fmul dword [edi+4]
+ fld dword [esi+8]
+ fmul dword [edi+8]
+ fxch st1
+ faddp st2, st0
+ fld dword [esi]
+ fmul dword [edi+16]
+ fxch st1
+ faddp st2, st0
+ fld dword [esi+4]
+ fmul dword [edi+20]
+ fld dword [esi+8]
+ fmul dword [edi+24]
+ fxch st1
+ faddp st2, st0
+ fld dword [esi]
+ fmul dword [edi+32]
+ fxch st1
+ faddp st2, st0
+ fld dword [esi+4]
+ fmul dword [edi+36]
+ fld dword [esi+8]
+ fmul dword [edi+40]
+ fxch st1
+ faddp st2, st0
+ fxch st3
+ fadd dword [edi+12]
+ fxch st1
+ faddp st3, st0
+ fxch st1
+ fadd dword [edi+28]
+ fxch st2
+ fadd dword [edi+44]
+ fxch st1
+ fstp dword [ebx]
+ fxch st1
+ fstp dword [ebx+4]
+ fstp dword [ebx+8]
+
+ ret
+ \ No newline at end of file