foo
[dos_low3d] / src / 3dgfx_s.asm
index 8147e7a..30b2374 100644 (file)
@@ -1,12 +1,12 @@
        bits 32
-       section .text
+       section .text USE32
 
        ; eax: vertex ptr, edx: matrix ptr
        global g3d_xform_
 g3d_xform_:
        push ebp
        mov ebp, esp
-       sub esp, 8
+       sub esp, 12
        push ebx
        push esi
        push edi
@@ -17,15 +17,19 @@ g3d_xform_:
 %macro MULROW 0
        mov eax, [edi]          ; eax <- X
        imul dword [ebx]
+       shrd eax, edx, 16
        mov ecx, eax
        mov eax, [edi + 4]      ; eax <- Y
        imul dword [ebx + 4]
+       shrd eax, edx, 16
        add ecx, eax
        mov eax, [edi + 8]      ; eax <- Z
        imul dword [ebx + 8]
+       shrd eax, edx, 16
        add ecx, eax
        mov eax, [edi + 12]     ; eax <- W
        imul dword [ebx + 12]
+       shrd eax, edx, 16
        add eax, ecx
 %endmacro
 
@@ -41,7 +45,7 @@ g3d_xform_:
        MULROW
        mov [edi + 12], eax     ; move W into place
        ; move XYZ into place
-       mov esi, [ebp - 12]
+       lea esi, [ebp - 12]
        movsd
        movsd
        movsd
@@ -52,3 +56,5 @@ g3d_xform_:
        mov esp, ebp
        pop ebp
        ret
+
+; vi:ft=nasm ts=8 sts=8 sw=8: