The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Farabi on November 18, 2008, 12:02:58 PM

Title: Physic engine
Post by: Farabi on November 18, 2008, 12:02:58 PM
What is good physic engine for MASM (not COM dll)?
I saw some of free physic engine, but the lib file did not work, also, the function name on their dll is weird. I dont want to make the include file from scratch.
Title: Re: Physic engine
Post by: Tedd on November 18, 2008, 12:30:01 PM
I think you'll have trouble if you're unwilling to write your own include file or deal with mangled function names.
They're most likely to be in C or C++, so unless someone has already gone to the trouble of making the include files for masm and is willing to share it with you, you'll have to make the effort and do it yourself.
Title: Re: Physic engine
Post by: Farabi on November 19, 2008, 01:21:20 PM
I tried to build the .lib but I fail. I dont know what is wrong, the tool said unresolved external symbol. I think I did do it right. Anyone can help? I attach the include file and the dll.

[attachment deleted by admin]
Title: Re: Physic engine
Post by: Tedd on November 19, 2008, 03:37:50 PM
http://www.ode.org/

Download the source package (there's a zip version) and the user-guide.


Look through the source for .h files - they will contain the function prototypes in C form; so you can see the function names and their parameters. You will need to create appropriate proto statements for you inc file.

The exports of the DLL are in the form "_ODE_dWorldCreate@4", so that would appear in your inc file as "_ODE_dWorldCreate PROTO C :DWORD" -- the name stays the same, they're all C-style functions, and this one takes 4 bytes of paramters (i.e. one DWORD; @8 would mean 2 dwords.)
You could then also add an alias line for each function so the names are nicer to use, e.g. "dWorldCreate equ <_ODE_dWorldCreate>" - then you can use the simple name when calling the function.

So, for each function you'd have something like:
_ODE_dWorldCreate PROTO C :DWORD        ;_ODE_dWorldCreate@4
dWorldCreate equ <_ODE_dWorldCreate>

Title: Re: Physic engine
Post by: Farabi on November 19, 2008, 05:07:19 PM
Hi Tedd,
I wrote <func name> proto C but it failed. But if I write it <func name> proto SYSCALL the error message is not appear but when I compiled it MASM report an error unresolved external symbol. Im confused.