News:

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

Main Menu

What do you think about this?

Started by felipe, April 29, 2018, 09:24:57 AM

Previous topic - Next topic

felipe

Well, making a game is a lot of work certainly. I really want to just have freedom in my researching and development of assembly programming (not only doing games). So what do you think (especially you Siekmanski, i don't want to disappoint you), you want i release what i have (very little comparing to a full functional game)? Probably after doing such i will jump to other project, related or not with this one. Or you want to wait until i get some more sophisticated and finished product?  :idea:

Siekmanski

Hi Felipe,

Only you deside what you do, coding must be fun and having a good time.
I jump from project to project, finished or not.
I'm working on an Amiga Protracker Module Replayer for more than a year now.
If I didn't do other projects along side it was finished by now.
Just keep coding for fun and not because you have to please others.  :t
Creative coders use backward thinking techniques as a strategy.

Lonewolff

Quote from: Siekmanski on April 29, 2018, 09:37:43 AM
Hi Felipe,

Only you deside what you do, coding must be fun and having a good time.
I jump from project to project, finished or not.
I'm working on an Amiga Protracker Module Replayer for more than a year now.
If I didn't do other projects along side it was finished by now.
Just keep coding for fun and not because you have to please others.  :t

Exactly this  :t

I'm more motivated by learning new things these days. If I stop having fun, I shelve the project and move on to the next thing.

felipe

Thank you very much Siekmanski, you are a wise man.  :icon14:

Well, so here it is this little demo with directx 9. To run the program you need the end user runtime libraries provided by microsoft from this link: https://www.microsoft.com/en-us/download/details.aspx?id=8109. This libraries are necessary to use some extended functionality (added later) by microsoft to direct3d. As it states microsoft here:
QuoteThis download provides the DirectX end-user redistributable that developers can include with their product.
But for size limits of attachments i can't do that for you. To not using this libraries will mean i can't access this extended functionality and the alternative is to create my own libraries that implement this functionalities (which certainly will signify first to RE the microsoft libraries to see what they actually do). That will take more time than even doing this simple demo. Look the good side of downloading the libraries: you can try this program and others and you can create directx9 programs and try them in your own pc first.  :icon_mrgreen:
Escape the fullscreen and finish the program with the esc key. Move the character with left arrow and right arrow (nothing else). As you can see this is just a "demo". Run the program in the same folder of the other files (png, bmp).  :redface:
Regarding to the code: unfortunately is not well commented yet. Directx9 is a little bloated with functions, so i haven't learned too well yet. But i'm quite sure i will keeping learning and improving. I just want for now to share this and to free myself of finishing this "demo" (that just started as an exercise).  Also regarding the first part of the code that looks for the libraries in the user pc is probably not the best option, i will try to improve that too.
Mmm, actually is the wrong approach to check this libraries in the end user system, i have just tested this demo on a pc without this libraries and windows ignore my intentions with the messagebox talking about the missed libs. I think is because i missinterpreted the documentation about LoadLibrary, where it say than a NULL returned indicates a function failure, but i guess this dosen't mean that the function loaded or not the librarie? Really don't know.  :idea:

russellgreen

[/STFU]

So as not to repeat the above, I agree with both of their statements, Additionally, I would like to add that coding in whatever style you choose is important for your own pleasure. If you wish to not use macros for instance, thats okay. If you use comments sparingly you might want to use them a little more, so when you do temporarily leave a project alone, you will have your own comments to fall back on for your current reasoning behind what each procedure is supposed to accomplish, and what each variable represents.

When you fo have a product that you feel that you are ready to post, you may be met with some criticism. Don't take the criticism the wrong way, use it as a tool for learning more and expand your knowledge of assembly coding. There are quite a few very experienced coders on this forum.

Edit to add:
Macros are designed to help in minimising the code actually written. Whole procedures (or even more) can be replaced by a simple one line macro. Still produces the same full object code after "Assemble", but with fewer written lines. Properly written macros are a real timesaver!


And commenting well also benefits those who may try to help you to develop better code. It is very hard to know what someone elses code is supposed to do without commenting. So more difficult in determining where errors are, where there is need for more efficient code, etc.....

[Re-STFU]    :icon_mrgreen:


-∞

felipe

Did anyone run the .exe with succeed in his PC? If so, what do you think?  :idea:
Thanks.

HSE

Equations in Assembly: SmplMath

daydreamer

Quote from: felipe on April 30, 2018, 01:53:18 AM
Did anyone run the .exe with succeed in his PC? If so, what do you think?  :idea:
Thanks.
I downloaded from the link, but still it complains of missing that runtime,win8
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Siekmanski

The loading part of the libraries is not correct.
If the first one is not available it exits the program.
And you don't use GetProcAddress to get the functions.
Why did you also include the static d3dx9.lib?
The d3dx9.lib is for one particular version of the d3dx9_XX.dll.

One advice, try to load the dlls in a descending order, start with D3DX9d_43.dll
You need to load only 1 of the d3dx9_XX.dlls, the first one you find. ( not all of them. )
Then get only the functions you need for your program with GetProcAddress.
Get rid of the static d3dx9.lib.
Creative coders use backward thinking techniques as a strategy.

felipe

Ok, thanks for the replies. I did it in that way because i tested the program in my system in this way: I removed one of the 22 dlls of the kind d3dx9x_xx.dll from the system32 directory and from syswow64 and then i tried the program. It always gived me error when i didn't let all those libraries in this folders.  :idea:
Siekmanski i used the d3dx9.lib because when i don't use it, even if knew the librarie that contained the function requiered from me (i checked this with dumbin) it always give an error in the linking process. What i mean is that i looked with dumpbin where one function resides in those libraries, then i did load the library (LoadLibrary) and then i gotted the address of the function (GetProcAddress), but this approach allways give me an error of unresolved externals. That's why i told you before than all this libraries seems to have all of them somekind of dependencie hell.  :idea:
Please those of you who downloaded the libraries try this new version that do no check of any library in your system.  :icon14:

Siekmanski

Now it works, santa is running in the snow.  :biggrin:
Creative coders use backward thinking techniques as a strategy.

felipe

 :biggrin: Thanks for trying it. In fact doing 2d games is very funny. Is just is a lot of work! I surely will keep working with this (directx9 and probably games too).  :icon14:

HSE

Equations in Assembly: SmplMath

Siekmanski

Hi Felipe,

There are some files missing in your example, if we want to assemble your source code.

d3d9.inc
d3dx9.inc
d3dx9core.inc

d3dx9.lib ( version 43 )
Creative coders use backward thinking techniques as a strategy.