News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

my 100% Assembly game development

Started by LordAdef, May 01, 2017, 03:22:26 PM

Previous topic - Next topic

mabdelouahab

Quote from: aw27 on January 20, 2018, 10:42:37 PM
I have never been good at playing games, but would like to know the reason I can't get more than this?!

me too  :(


LordAdef

Quote from: mabdelouahab on January 21, 2018, 06:24:38 AM
Quote from: aw27 on January 20, 2018, 10:42:37 PM
I have never been good at playing games, but would like to know the reason I can't get more than this?!

me too  :(


hi, wow!

what Windows is this? It didn't even find the fonts (which are basic ones... Arial etc)?!?

mabdelouahab

Quote from: LordAdef on January 21, 2018, 06:28:52 AM
what Windows is this? It didn't even find the fonts (which are basic ones... Arial etc)?!?
Windows 8.1 Enterprise 64Bit Arabic

LordAdef

http://masm32.com/board/index.php?topic=6200.msg73104#msg73104

Thanks! would you help me pinpoint the issues? this post above has a previous build (version 8.153) . would you try it and see if it works? This way I may know if it's something with my re-coding, or if the problem was already there.

The font thing is funny. You do have Arial font installed, don't you?


mabdelouahab

I tried the v8.15, V8.153, V8.16 and I have the Arial font, but the same problem appears, same funny font.

LordAdef

Quote from: mabdelouahab on January 21, 2018, 07:04:44 AM
I tried the v8.15, V8.153, V8.16 and I have the Arial font, but the same problem appears, same funny font.

I imagined you had the fonts. none of the above builds work.... ok... research time......
Thank you so much for the feedback.

So basically, I am bumping into something different between Win 7 and Win 8. The font thing is really funny cause it's a simple procedure... Possibly some suicidal code. I'll start by pushing/ preserving ABi convention stuff

let's see.

aw27

hi LordAdef,

It does not work on my Windows 10 Pro notebook, it works on Windows 7.
This may have to do with the switch from Intel Graphics card to NVidia card. I will check that, may be I need to add the game to the list on the NVidia.

aw27

I don't think it has anything to do with adding the game to NVidia list.
I tested in another notebook, this with nearly 3 years old and different hardware and with Windows 10 Home and had the same problem.
However I tested in Windows XP running from a virtual machine on the Windows 10 pro and it run well.

The problem happens in all releases I found in the thread since December.

I had a quick look at your code and did not find anything really abnormal, although I had to use an old release of MASM (10.xx) to build it due to the MASM SDWORD PTR bug on HLL compares, mentioned here http://masm32.com/board/index.php?topic=6732.0.

jj2007

For the attached debug version, I get this sequence on Win10:Line 1798: Handle non valido.
Line 1804: Handle non valido.
Line 1828: Handle non valido.
Line 1849: Handle non valido.
Line 1930: Handle non valido.
Line 1968: Handle non valido.
Line 1997: Handle non valido.
Line 1998: Handle non valido.
Line 2005: Handle non valido.


EDIT: NEW VERSION, the old one was not working. Check CreateCompatibleDC in stuff.inc, it seems to fail for the hBufferDC section:

** this is line 1636 hBufferDC **
** this is line 1636 hPreBufferDC **
** this is line 1636 hManDC **
** this is line 1636 LoadBitmap **
** this is line 1636 hManCrashDC **
** this is line 1637 after mCreateDC **

Unfortunately, this is in an external module, stuff.inc, so the macro cannot know the exact line. Both MASM and UAsm do not provide correct @Line when such things hang around in include files. Better to integrate them into the main source... I know C/C++ programmers are being taught to split everything in tiny little modules, but a) that was good advice when computers were really slow, b) it makes debugging very difficult, and c) it's not good advice if your editor has bookmarks and a powerful little listbox ;-)

Attached a version trying to guess the exact line with the ShowThisLine macro. No extra code generated, it's just echos.
P.S.: Just saw this:
   Print Str$("withinPixel: hBufferDC=%i\n", hBufferDC)
   inc gDebugCt  ; <<<< needed for the versions that work

aw27

  .IF uMsg==WM_CREATE
   ; Insert these to make it work
      invoke BeginPaint, hWnd, ADDR ps
      mov edi, eax
      mov  hdc, edi
      

PS: I got this from the hint provide by JJ  :t

LordAdef

hi guys,

It's a macro, which I placed outside the main file. Aw7 got it right, it's being used there after WM_CREATE

Aw7, please clarify me: you insert something there and it worked?


aw27

I inserted what I mentioned, because it was not there.  :biggrin:
So hdc was indefined, and what surprises me is that it worked with some OS.

LordAdef

Thanks!

Wow, but it should be there indeed! that's why I asked you. I could swear it was there.....

jj2007

Quote from: LordAdef on January 22, 2018, 03:51:30 AMWow, but it should be there indeed! that's why I asked you. I could swear it was there.....

It is there, but a few lines further down. Still, the only change that I see on Win10 (and Win7) is that I can see the gauge now. And I don't have access to the Win10 machine right now...

LordAdef

Hey, I couldn´t resist... Before solving these issues I made some drafts for two new cool Controls. Version attached is a work in progress only, only to show it.

Fuel Tank Gauge:

I used the algo kindly created by Marinus (Thanks my Friend) to move the needle.
For the needle I´m using the "line" command from masm32. Unfortunately, "line" doesn´t set a line width, so I´m going to have to shape that needle by code.

Marinus algo:

QuotepCalculateGauge proc Xpos:DWORD,Ypos:DWORD, Radius:DWORD, Angle:DWORD
   ; -------------------------------------------------------------------------------------------
   ;     This procedure was created by Marinus Siekmanski
   ; -------------------------------------------------------------------------------------------
   
    fild    Angle ; in degrees
    fmul    RotationMagic
    fsincos

    fimul   Radius
    fchs
    fiadd   Ypos
    fistp   dword ptr [esp-8]
    fimul   Radius
    fiadd   Xpos
    fistp   dword ptr [esp-4]
    mov     eax,dword ptr [esp-4]   ; New_X
    mov     ecx,dword ptr [esp-8]   ; New_Y
    ret
pCalculateGauge endp



MiniMap overview:

Still working on it. The Minimap is created on the fly using SetPixels (only setting the blue pixels). It is going to show our airplane current position. I think it´s cool  :dazzled: