Message board for the users of flat assembler.
> Windows > Directx9 Win64 D3DX-Functions
I'm actually new to this messageboard. I'm using fasm for a few days to do some programming for Win64. I've used MASM32 before. FASM works pretty fine, but I've some problems with DirectX. As far as I know floating points and _fastcall use the xmm0-xmm3 registers. When disassembling my program it seems to be right, but i can't see anything. It should only show a rectangle with a texture. I've done in C++ and it works. In ASM it doesn't. I think there's a problem with x64/Directx and the Matrix-Functions. But I don't understand, where the fault is.
Have a look a the source code! Any help would be greatly appreciated.
P.S.: When I don't use matrix functions I can see the rectangle. I'm using Matt Childress' include files for x64
|27 Dec 2011, 09:16||
Guys. I solved the problem. Actually I stopped using invoke Macro for these functions. Doesn't work with more than 3 arguments?! Use instead SIMD instructins directly (movss). Have a look. And I forgot to set the SetFVF, but that wasn't the real problem.
Here's the working code
;invoke D3DXMatrixPerspectiveFovLH,addr matProj,float 1.570796327,float 1.0,float 1.0,float 300.0 -> doesn't work, I use now variables and load them with movss
;invoke D3DXMatrixTranslation,addr matTrans,float 0.0,float -5.0,float 0.0
|27 Dec 2011, 11:48||
Here's the correct code. It wasn't a problem of the invoke statement. You should set only float, if it is a float, for the first 4 parameters (fastcall convention), for all other parameters, which are pushed on the stack, you should use dword:
invoke D3DXMatrixPerspectiveFovLH,addr matProj,float [PI2],float [Aspect], float [zn], dword [zf]
The above statement didn't work correctly because of "wrong" parameters in the Clear statement.
cominvk pD3DD9,Clear,0,0,D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER,00205090h,dword (float doesn't work) 1.0, dword 0
Have a nice day.
|01 Jan 2012, 09:23||
< Last Thread | Next Thread >
Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.
Website powered by rwasa.