Afternoon, All.

I'm having a slight problem getting this proggy to work.

It assembles fine, however the rotating square is not seen in the window.
I've already confirmed that the data for the square is stored correctly.

The problem seems to lie within the SetupMatrices proc.
D3DXMatrixLookAtLH and D3DXMatrixPerspectiveFovLH do not seem to be creating the correct matrices I think.

Is anyone able to see where I've gone wrong?

Cheers,
Scronty
Posted on 2003-05-12 06:28:29 by Scronty
Afternoon, All.

I've confirmed that the matrices do not contain the correct data, however...I'm also having difficulty in accessing the matrices as well.

Is there something incorrect with the way the matrix structure has been created? Is it possibly a stack issue? If so, how do you increase the stack? The pdf doc doesn't make this clear (the assembler b0rks if I add "stack 62767").

Cheers,
Scronty
Posted on 2003-05-14 07:31:39 by Scronty
The stack directive works only with PE output format, not with COFF. You should specify the stack size to linker.
Posted on 2003-05-14 07:39:02 by Tomasz Grysztar
My personal advice: when you are converting some source from MASM syntax, put "offset equ " at the beginning of your source and don't remove "offset" words from your code, only add square brackets for variables - this should help detecting some of the mistakes.
Posted on 2003-05-14 07:42:40 by Tomasz Grysztar
Afternoon, Privalov.

Thanks for the advice. That'll come in handy for a few other proggies I have when they're converted.:alright:

However:tongue:
I don't use "offset" in this proggy at all. I only use "ADDR" in the invokes, which I just delete for fasm. Also: all variables have got the [] around them.

I've also gone ahead and built a lib/dll with Masm which I use from the fasm proggy (i.e. in the fasm proggy I have "invoke ssD3DXMatrixLookAtLH, matView, eyevector, lookatvector, upvector" which calls the dll proc, which in turn calls D3DXMatrixLookAtLH).
I did that just incase it was a problem to do with Fasm not being able to handle the MS DX static lib. I get the same result though. The same data ends up in the matrices.

This probably means that the data is getting corrupted/over-written somewhere.

Any advice about how to organise/align the data section?

Cheers,
Scronty
Posted on 2003-05-14 08:09:21 by Scronty
Afternoon, All.

Just tried linking using ALink.

It doesn't get past d3dx8.lib :/

I use this in the bat file:


\fasm\fasm matrices.asm matrices.obj
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
\fasm\ALINK matrices.obj rsrc.obj -oPE -entry start C:\masm32\lib\kernel32.lib

C:\masm32\lib\user32.lib C:\masm32\lib\d3d8.lib C:\masm32\lib\Winmm.lib

C:\masm32\lib\ADVAPI32.LIB C:\masm32\lib\msvcrt.lib C:\DXSDK\lib\d3dx8.lib

C:\masm32\lib\libci.lib

pause


and this is the result:


C:\Fasm\Projects\DX81\tut03_matrices>\fasm\fasm matrices.asm matrices.obj
flat assembler version 1.45
4 passes, 5009 bytes.

C:\Fasm\Projects\DX81\tut03_matrices>\masm32\bin\rc /v rsrc.rc
Microsoft (R) Windows (R) Resource Compiler, Version 5.00.1823.1 - Build 1823
Copyright (C) Microsoft Corp. 1985-1998. All rights reserved.

Using codepage 1252 as default
Creating rsrc.RES
RC: RCPP -CP 1252 -f C:\Fasm\Projects\DX81\tut03_matrices\RCa03152 -g C:\Fasm\Pr
ojects\DX81\tut03_matrices\RDa03152 -DRC_INVOKED -D_WIN32 -pc\:/ -E -I. -I . -I
C:\Program Files\Microsoft Visual Studio\VC98\atl\include -I C:\Program Files\Mi
crosoft Visual Studio\VC98\mfc\include -I C:\Program Files\Microsoft Visual Stud
io\VC98\include

rsrc.rc.
Writing ICON:1, lang:0x409, size 744
Writing GROUP_ICON:1, lang:0x409, size 20

C:\Fasm\Projects\DX81\tut03_matrices>\masm32\bin\cvtres /machine:ix86 rsrc.res
Microsoft (R) Windows Resource To Object Converter Version 5.00.1736.1
Copyright (C) Microsoft Corp. 1992-1997. All rights reserved.


C:\Fasm\Projects\DX81\tut03_matrices>\fasm\ALINK matrices.obj rsrc.obj -oPE -ent
ry start C:\masm32\lib\kernel32.lib C:\masm32\lib\user32.lib C:\masm32\lib\d3d8.
lib C:\masm32\lib\Winmm.lib C:\masm32\lib\ADVAPI32.LIB C:\masm32\lib\msvcrt.lib
C:\DXSDK\lib\d3dx8.lib C:\masm32\lib\libci.lib
ALINK v1.6 (C) Copyright 1998-9 Anthony A.J. Williams.
All Rights Reserved

Loading file matrices.obj
Loading file rsrc.obj
Loading file C:\masm32\lib\kernel32.lib
1431 symbols
Loaded first linker member
Loading file C:\masm32\lib\user32.lib
1245 symbols
Loaded first linker member
Loading file C:\masm32\lib\d3d8.lib
9 symbols
Loaded first linker member
Loading file C:\masm32\lib\Winmm.lib
401 symbols
Loaded first linker member
Loading file C:\masm32\lib\ADVAPI32.LIB
1065 symbols
Loaded first linker member
Loading file C:\masm32\lib\msvcrt.lib
1648 symbols
Loaded first linker member
Loading file C:\DXSDK\lib\d3dx8.lib
3480 symbols
Invalid first linker member
Pos=00029044, should be 00029043

C:\Fasm\Projects\DX81\tut03_matrices>pause
Press any key to continue . . .


Anyone with any ideas on what the problem may be?

Cheers,
Scronty
Posted on 2003-05-18 20:48:33 by Scronty
Afternoon, All.

All is well. The proggy works fine now.

Just had a slight problem with the D3DXVECTOR3 structure definition and declarations.

Attached is the working example.

Please note that the "inc" file is still in the development stage, so ignore the fact that it's not complete and extremely messy:grin: . It's functional for this particular example though.

Cheers,
Scronty
Posted on 2003-05-21 05:30:08 by Scronty
Very nice. If you want/allow , I can put it in the "examples" section of fasm's website.
Posted on 2003-05-21 07:37:19 by Tomasz Grysztar
Afternoon, Privalov.

I'd like that... but not quite yet.

I still want to get the other basic examples working first, and end up with one complete INC file for them all.

The weird thing is...the fasm example is about 20-25 kb smaller than the Masm equivalent. :tongue:

Once the basic examples are finished, I'll post messages/updates in their appropriate threads and email you with the complete package.

Cheers,
Scronty
Posted on 2003-05-21 07:49:36 by Scronty
Well, I see the square but its not rotating :tongue:
Posted on 2003-05-22 05:06:47 by Homer
:(
Posted on 2003-05-22 05:48:53 by JohnFound
Afternoon, EvilHomer2k.

Does the square rotate in the exe attached?

Afternoon, JohnFound.

I dunno what that error could mean:/

Cheers,
Scronty
Posted on 2003-05-22 07:15:08 by Scronty
Hi.
This means: "There is no function "IsProcessorFeaturePresent" in "KERNEL32.DLL". Maybe you are using some new version of Windoze? I am under Win 95 OSR2, DX8.0 (4.08.00.400)
Posted on 2003-05-22 07:40:36 by JohnFound
Afternoon, JohnFound.

That explains it then :grin: .

This is a DX8.1 proggy...not DX8.0.

DX8.1 cannot be installed on Win95.

This means that Microsoft would be using some non-Win95 functions in their libs/dlls.

Cheers,
Scronty
Posted on 2003-05-22 07:47:13 by Scronty