News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Seeking friendly collaborator

Started by mikorians, October 19, 2012, 03:29:02 AM

Previous topic - Next topic

TouEnMasm

Quote
I've learned that I've got to be flexible here.  Do you know FreeBasic?  I just got it and it looks interesting also - has tighter links to Asm.
I was a user of the qbasic who was great in his time (who is past).I have no problem with other basic.I have used the microsoft one ,visual studio 6.
I have downloded the freebasic and play a little with it.
No problem at all with basic.
Fa is a musical note to play with CL

MichaelW

#16
The FreeBASIC 0.24.0 Win32 release includes a DX9 example, d3d9_primitives.bas, in FreeBASIC\examples\win32. The source built without problems, and after I installed the end-user runtime, found the most recent DLL included, D3DX9_43.dll, copied it to my working directory and renamed it to D3DX9d.dll to match the name in the import library libd3dx9d.dll.a, it ran OK, displaying a rotating and zooming multi-color pyramid in a very normal API window.

The attachment contains the assembly output of the compiler.

Edit: The EXE triggers an access violation exception when I close it, on both of my systems, and I don't have time to run the problem down.

Edit2: The problem occurs only when the app is using the DLL in the current directory. When I move the DLL to the System32 directory then there is no problem.

Well Microsoft, here's another nice mess you've gotten us into.

MichaelW

You asked about a DLL interface with VB. The attachment contains everything that I have for a test that I did 6-7 years ago. I recall testing it and it working correctly, but I'm not sure if I tested with VB5 or VB6, I cannot find the VB source that I used, and I cannot recall if I used run-time dynamic linking or used the import library and load-time dynamic linking.
Well Microsoft, here's another nice mess you've gotten us into.

TouEnMasm

Fa is a musical note to play with CL

TouEnMasm

Quote
Edit: The EXE triggers an access violation exception when I close it, on both of my systems, and I don't have time to run the problem down.
Same thing for me when running outside the IDE (XP3).
Fa is a musical note to play with CL

jj2007

Quote from: MichaelW on October 20, 2012, 08:07:29 PM
You asked about a DLL interface with VB.

I add my version calling a DLL from a VB for Ms Word macro.
When I wrote this some time ago, the main problem was convincing VB that the calling convention was OK, by returning a specific value in esi. I have no idea if standalone VB shows the same idiosyncratic behaviour - see MasmBasicInsertStruct.bas in case you want to test it.

The macro takes a selected string content, e.g. SMALL_RECT, passes it on to a MasmBasic DLL, which looks up the struct in Windows.inc and writes it into a buffer supplied by the macro. The macro then replaces the selected text with the whole structure definition.

In case there is no Windows.inc, MasmBasic's Recall throws a runtime error, i.e. a MsgBox saying file not found; the DLL then passes back an error code that results in VB saying "bad calling convention".

There are three macros inside, two simple ones for testing and the more interesting InsertStruct macro. The latter uses SSE2 code which may not run on your machine.

In the testing phase, when I had not yet discovered that trick, Ms Word used to crash if an error happened in the DLL. If you intend to roll your own, be warned that these crashes are nasty. You lose immediately any open documents, and have to restart Ms Word.


mikorians

#21
 :dazzled: Whoa, didn't see the second page of posts here !!!
I gotta catch up!  I will analyze all of your generous data!

Complex question (I guess for all of us)
Does anybody have a vertex-buffer-based example of skin mesh loading and proper hierarchy matrix walking.
All my engine did was use the built-in mesh loader in DX8 (it's reeeeaally slow)
This would finish up what I had, but I also had no LOD using Progressive meshes -- new thing I learned about only recently
- didn't think I would need it until now.

[update]
jj I can't make any of the masmbasic stuff work right, and I have no idea what msword basic is.   :greensml:
Justbasic seemed a little too basic to handle directx very well.

In FreeBasic I got pretty good throughput with a 2d example I tested and got like 100-200K fps, so it seems to be real tight asm compilation
Right now I am not running d3d9 in debug mode, so I couldn't run the .exe of the test d3d9primitives --  I really really wanted to though..  :badgrin:

[update2]
In all honesty, I do kindof understand matrix hierarchy walking, it's just that...  My prog says the x-file data has 3 matrices affecting each joint, and I'm not sure I understand why there are 3.  I had used the standard x-file mesh loader (it's reeeeally slow).  So here's an example of a skin mesh.  I only use skin weights of 1.0, so there's no funny stuff.  Note the shortcut used on material (means all verts), and the lack of vertex weights on the root bone.  This is quite standard in skin mesh files since these represent offset matrices and make the joints work right.  Here's a simple sample:

BTW: If any of you use 3ds max 5, I have a limpy little .x file importer maxscript that I've written recently to bring 'em back in after post-processing texture coordinates for sprite sheets.  It's kinda cool...

[update3]
d3dx9d.dll is not for my version of windows.  This is my medical computer running windows 98.  I cannot change the operating system.  Anybody got the .bi files for dx8?
I noted it seems to support DirectX7, this would be equitable if it can be done - it's the same, isn't it?  Dx8 Dx7...?  Skinning, Fog?

jj2007

Quote from: mikorians on October 22, 2012, 12:32:14 AM
jj I can't make any of the masmbasic stuff work right, and I have no idea what msword basic is

Most MasmBasic algos won't work on your machine because it uses SSE2. MS Word Basic is what you see when you press Alt F11 in Microsoft Word - Visual Basic for applications. There are three macros in MasmBasicInsertStruct.bas, and the first two should work even on your machine. The whole mb2vb folder is a proof of concept showing that it is indeed possible to call assembler from Visual Basic.

mikorians

OK.  Let us remember how slow I am (or can be, heh  :icon_rolleyes:).
I don't typically install excess packages on this old beastie.
I do not have Microsoft Word.
I have wordpad.
I have visual basic 6.
It is interesting that it's possible to run Asm within VB6.
I must first aquire the necessary VB equivilants before I can even try to translate them to Asm function calls.
I am just now trying to convert my old meshloader functions into vertex buffer calls.
The engine I have was finished, but not in an efficient manner apparently, so I have to play catch up now.
I do understand and have routines that were well written by the russian to use vertex buffers with static meshes, but not with skinned meshes.
These routines are in Visual Basic though, and I am now pointing myself more towards using FreeBasic because it looks faster---
unless you would recommend a different approach that would let me keep most of my engine in Visual Basic.

This old wounded soldier needs sound advice real soon.

TouEnMasm

Quote
These routines are in Visual Basic though, and I am now pointing myself more towards using FreeBasic because it looks faster---
Bad choice.
After some tests,the freebasic is bugged and couldn't be used.
If you are an old machine, only an ide using the sdk could made it work.
other soluce is to use an old ide,if he want to work an actual system.
Fa is a musical note to play with CL

mikorians

Anybody disagree with ToutEnMasm?  You've all been so helpful.  I am aquiver.   :greenclp: :greenclp: :greenclp:
So stick with VB6 and try to get in-line assy work?
Or Masm32 dll?
I did note that freebasic had dx7 and dx8 libraries... But no, eh?

TouEnMasm


The good thing is that i have study the freebasic code and that  i know the c++ code.
The c++ code is the reference and the freebasic code is very near it.
The freebasic had no other choice than copy the c++ one.
It is your chance,use the vc ++ and you are certain to reach the goal.
I can help you doing that.
Fa is a musical note to play with CL

jj2007

Quote from: ToutEnMasm on October 22, 2012, 04:06:53 AM
Bad choice.
After some tests,the freebasic is bugged and couldn't be used.

Please show us some examples of FreeBasic bugs, Yves.

mikorians

I know I can't run the pseudo dx9 code they provided.  It's directx10.
Personal peve - C - can't use it myself.  Now if someone wants to make a library I can call to from VB, that's fine, but...  Well...  It would be almost overly generous...
My engine was very generic on purpose because I wanted to use the various switches to obtain certain effects.
Other callable applications like TrueVision3D and BlitzBasic --- while absolutely wonderful (don't get me wrong), were also quite proprietary and not modifiable.
My needs can be very specific.  Like translatable texture mapping, for example.  Neither of those apps support it correctly.
I got DevC++ to run, but it might as well be alien gibberish to me.  I could at least read freebasic.  Asm would be difficult, but something I'd learn if I had to make small changes to an existing code library.

TouEnMasm

Quote
Please show us some examples of FreeBasic bugs, Yves.
read the post of michaelw and myself.
:\Program Files\FreeBASIC\examples\win32\d3d9_primitives.exe
Just crash when exit outside the ide,run it with a shortcut.
Fa is a musical note to play with CL