Author Topic: WinFloor Demo  (Read 9253 times)

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
WinFloor Demo
« on: November 27, 2012, 09:36:32 AM »
Hello, here it is a Win32 floor demo 2D and 3D, source code for 2D, originally writen in fasm that is supplied, and I have tried to translate it to NasmX v1.1 but had several fails... life is too short for that... does anyone want to help for that?. Coments in Spanish but I can translate it to English if that helps.

Regards

EDIT: Don't download this one! See next message.
« Last Edit: November 27, 2012, 10:19:14 AM by Frank Kotler »

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
Re: WinFloor Demo
« Reply #1 on: November 27, 2012, 10:08:11 AM »
To the moderator... I've just been realized that the bat file in the zip has the next line:

del *.exe

maybe if anyone unzip and run it, may delete some other files than the desired. I have them in a folder for them, but, maybe we have better delete de zip attached and attach this other one. I don't know if I can do it... Sorry

Regards.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2379
  • Country: us
Re: WinFloor Demo
« Reply #2 on: November 27, 2012, 10:23:31 AM »
Well, I can't figure out how to actually delete the .zip file, but I put a "warning" on it. Serves 'em right if they execute a batch file they haven't read! :)

Thanks for the example, Alfonso!

Best,
Frank


Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: WinFloor Demo
« Reply #3 on: November 29, 2012, 05:30:25 PM »
Hello, here it is a Win32 floor demo 2D and 3D, source code for 2D, originally writen in fasm that is supplied, and I have tried to translate it to NasmX v1.1 but had several fails... life is too short for that... does anyone want to help for that?. Coments in Spanish but I can translate it to English if that helps.

hmmm...I'm curious as to where you have difficulty with using NASMX?  If there is a specific concept that does not come across cleanly maybe I can tweak it for the benefit of all.

Go ahead and translate to English, get as far as you can using the NASMX syntax, then attach the zip containing the translated sources to a reply message and I'll finish it.

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
Re: WinFloor Demo
« Reply #4 on: November 30, 2012, 11:11:45 AM »
Well, here they're the translated fasm and nasm versions, I hope it would be good enough... Maybe the guilty would be the BITMAPINFOHEADER structure (in a first glance) maybe some others afterwards... or maybe not my best code ???

One of the more complicated things for working with nasm v1.x is, in my opinion, that it is very different from the previous versions... ie is a new language.

Sorry, maybe I'd have had to debug the nasm code a bit harder... lack of time. Thank you very much if you waste your time on it.

Regards

Offline Mathi

  • Jr. Member
  • *
  • Posts: 79
  • Country: in
    • Win32NASM
Re: WinFloor Demo
« Reply #5 on: December 01, 2012, 09:38:31 AM »
After a few changes and rearranging the functions i was able to get this work.
Plz compare this with the version you had attached earlier.

Also check the path of windemos.inc, stdwin.inc &  nasmx.inc before you compile this. ( I changed it w.r.t my machine).

Assemble and Link with

; nasm -fwin32 WNFloor_03.asm
; golink /entry _main kernel32.dll user32.dll gdi32.dll WNFloor_03.obj

Cool Animation :)

[Update : Attached the updated windemos.inc file]
Regards,
Mathi.
« Last Edit: December 01, 2012, 09:46:31 AM by Mathi »

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: WinFloor Demo
« Reply #6 on: December 01, 2012, 04:43:58 PM »
OK.  I see where the confusion arises from and I can fix this.  The include file windemos.inc is used by the Win32 and Win64 demos and contains only the bare minimum Windows definitions that allow the existing NASMX demos to run.  This was done due to the strain that all the Windows defines, typedefs, and structures puts on the Nasm preproccesor which causes slow assembly when pulling in the full include files.

Mathi has graciously added the additional code your program requires to that file rather than pulling in the full Windows include files.  This is something I too would have done.

The demo itself is indeed very cool and something I would like to add to the project.  We need more graphic demos like this to show potential NASMX developers how powerful the macro system is.  With your permission I'd like to include your demo, maintaining your original authorship of course, providing you agree to the BSD license used by NASMX.  The source would change slightly to indicate this as well.

I will also include Mathi's fixes to the windemos.inc file and relocate it to the /inc/win32 directory enabling the file to be more accessible from other projects.  The way it is now it's rather hard-coded for the demos directory structure and I'd like to break that dependency.  This will cause a ripple effect to the existing demos but should make it easier on developers in the future.

Excellent work by both of you!

Offline Bryant Keller

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 360
  • Country: us
    • About Bryant Keller
Re: WinFloor Demo
« Reply #7 on: December 01, 2012, 07:28:38 PM »
One of the more complicated things for working with nasm v1.x is, in my opinion, that it is very different from the previous versions... ie is a new language.

Early on, the design of NASM32/NASMX was supposed to be a cross blend between the Ada programming language and the Microsoft Assembler. A lot of people didn't really catch on to the Ada relationship. With Robb's newer versions, I'm happy to say that there seems to be more Ada than MASM! This does make it a little harder on early adapters who became used to the  MASM-ish features, but it also makes the project into a far more independent syntax with a greater emphasis on readability and rapid deployment.

Another thing to keep in mind is that the project is starting to stabilize, most of the buggy features have either been fixed or phased out. I know this makes things a little difficult for someone like yourself whose cranking out a lot of tutorial code on the subject and then everything seems to change, but I believe the newer style is definitely worth taking time to adapt to.

About Bryant Keller
bkeller@about.me

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: WinFloor Demo
« Reply #8 on: December 01, 2012, 08:27:51 PM »
I've gone ahead and provided the changes and made some bug fixes along the way.  Assuming your approval the attached zip file contains what the new NASMX Win32 demo 15 final version will be.  I've added a few comments within the source which I hope will be of help regarding syntax and usage for NASMX users.  BTW, you were very close to a finished program.

Note that the new file windemos.inc should be copied to your nasmx/inc/win32/ directory.  Doing so will enable you to make reference to that file from whatever directory structure you're currently working in by simply editing the NASMENV statement within setpaths.bat to point to the /nasmx/inc/ directory prior to assembly.  This is the small change I was discussing to help.

I've also included a pre-compiled .exe as a courtesy.  This executable will not, however, be distributed via the next release.

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: WinFloor Demo
« Reply #9 on: December 02, 2012, 12:41:50 AM »
Early on, the design of NASM32/NASMX was supposed to be a cross blend between the Ada programming language and the Microsoft Assembler. A lot of people didn't really catch on to the Ada relationship. With Robb's newer versions, I'm happy to say that there seems to be more Ada than MASM! This does make it a little harder on early adapters who became used to the  MASM-ish features, but it also makes the project into a far more independent syntax with a greater emphasis on readability and rapid deployment.

I assure you that any resemblence to Ada is purely coincidental.  Portability of the NASMX framework across operating systems and the enabling of rapid application development using Nasm's capabilities were the primary driving forces.  This is why the same macro syntax can be used across Windows, Linux, and now also includes the various BSDs.  The same macro syntax can be used whether your functions are being called from Pascal or C ( possibly even Fortran or Basic ) with one simple keyword change.    So whether you're developing 32-bit or 64-bit apps for any of those systems, or interfacing with various high-level languages, or developing large assembler applications, the basic NASMX syntax does not change and contains support for all those features.

Another thing to keep in mind is that the project is starting to stabilize, most of the buggy features have either been fixed or phased out. I know this makes things a little difficult for someone like yourself whose cranking out a lot of tutorial code on the subject and then everything seems to change, but I believe the newer style is definitely worth taking time to adapt to.

As Bryant states the framework itself is rather stable.  There is still work to be done on header prototyping and such but the framework also accounts for this and does not impact usage of NASMX.  I'm hoping Bryant gets off his duff and finally learns how to use SVN properly.  ;D

I'm also interested in adding more graphics demos to the project for all supported OSes.  So anyone out there that wishes to donate small yet cool apps using NASMX will add to their own fame and fortune ( well, fame anyways 8) ) and would be much appreciated. 

Offline Bryant Keller

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 360
  • Country: us
    • About Bryant Keller
Re: WinFloor Demo
« Reply #10 on: December 02, 2012, 11:01:25 PM »
I assure you that any resemblence to Ada is purely coincidental.  Portability of the NASMX framework across operating systems and the enabling of rapid application development using Nasm's capabilities were the primary driving forces.  This is why the same macro syntax can be used across Windows, Linux, and now also includes the various BSDs.  The same macro syntax can be used whether your functions are being called from Pascal or C ( possibly even Fortran or Basic ) with one simple keyword change.    So whether you're developing 32-bit or 64-bit apps for any of those systems, or interfacing with various high-level languages, or developing large assembler applications, the basic NASMX syntax does not change and contains support for all those features.

I'm fully aware that you hadn't intentionally added any resemblance to Ada, rather the early design choices were "inspired" by Ada (and VHDL for that matter) for readability and structure and it seems that the MASM-ish features are starting to disappear which actually makes the resemblance a bit more prominent.

As Bryant states the framework itself is rather stable.  There is still work to be done on header prototyping and such but the framework also accounts for this and does not impact usage of NASMX.  I'm hoping Bryant gets off his duff and finally learns how to use SVN properly.  ;D

I actually played around with it and have become at least adequate enough to use it. That's not what's preventing me from helping out atm, it's the lack of a decent computer to work on. :P Aside from various age/health issues that have taken up a lot of my time the last few years, I've gotten stuck with 2 computers[1] (both early 90's) that don't exactly work "great" as development machines.

I'm also interested in adding more graphics demos to the project for all supported OSes.  So anyone out there that wishes to donate small yet cool apps using NASMX will add to their own fame and fortune ( well, fame anyways 8) ) and would be much appreciated.

You should send a PM to Homer on ASM Community. He's been interested in NASMX for a while, but he's kind of addicted to MASM/ObjASM32 development. He might be willing to do some demo code for the project, but I doubt he'll ever be a "NASMX User" unless I can get off my butt and get a decent/stable OOP extension for it.

[1] One runs FreeDOS/OpenGEM and the other runs an old copy of Debian.

About Bryant Keller
bkeller@about.me

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
Re: WinFloor Demo
« Reply #11 on: December 03, 2012, 08:28:50 AM »
After a few changes and rearranging the functions i was able to get this work.
Thank you, Mathi. It is necessary to comment the next line
;invoke    DeleteObject, [hDIBFloor]
Otherwise it will crash on the exit program...
BTW, if you don't mind I will include "Mathi" as the author of the NasmX version that I will upload in my own site, or perhaps in the aknowledgments...

The demo itself is indeed very cool and something I would like to add to the project.  We need more graphic demos like this to show potential NASMX developers how powerful the macro system is.  With your permission I'd like to include your demo, maintaining your original authorship of course, providing you agree to the BSD license used by NASMX.  The source would change slightly to indicate this as well.
Of course I agree, go ahead!.

Regards
« Last Edit: December 03, 2012, 08:39:17 AM by avcaballero »

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
Re: WinFloor Demo
« Reply #12 on: December 03, 2012, 12:22:52 PM »
I'm also interested in adding more graphics demos to the project for all supported OSes.  So anyone out there that wishes to donate small yet cool apps using NASMX will add to their own fame and fortune ( well, fame anyways 8) ) and would be much appreciated.
Not a graphic demo, but a hangman game example if you like it, where you can also find an example on using resources and including information in the executable. BTW, I'd like that my own site "abreojosensamblador.net" will appear anywhere, would it be possible?.

Regards

Offline avcaballero

  • Full Member
  • **
  • Posts: 130
  • Country: es
    • Abre los Ojos al Ensamblador
Re: WinFloor Demo
« Reply #13 on: December 03, 2012, 05:08:44 PM »
It was left the CenterWindow routine... Added my windemos.inc

Regards

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: WinFloor Demo
« Reply #14 on: December 03, 2012, 06:03:55 PM »
Not a graphic demo, but a hangman game example if you like it, where you can also find an example on using resources and including information in the executable. BTW, I'd like that my own site "abreojosensamblador.net" will appear anywhere, would it be possible?.

I have no objections to that.  Your site contains many valuable lessons that would benefit others.  The only requirement for inclusion into the project itself is the agreement to use the BSD license (which is the main reason for using the phrase "(c) 2012 The NASMX Project") to avoid any confusion regarding licensing.

I also wouldn't mind adding you as an official contributor to the NASMX project itself if that is of any interest to you.  PM me if interested and we can discuss offline.