News:

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

Main Menu

"Hello masm32", not a BOT, new member

Started by LordAdef, January 22, 2017, 09:42:24 AM

Previous topic - Next topic

LordAdef

Hey guys,

After your tips in the other thread, I enclosed the prog now with the rle working fine and faster (decomp.inc, decomp.asm).

Richmasm and Asm files included, although qEditor (not its fault, mine for sure) complaint when building:
QuoteC:\masm32\AFprojs\09_game_test_03\Main.asm(64) : warning A4014: instructions and initialized data not supported in BSS segments
...
LINK : fatal error LNK1181: cannot open input file "C:\masm32\AFprojs\09_game_test_03\Main.obj"

Mineiro, I tried to make a struct for the header (mainly because there are more things to go in there). It slowed it down a bit, I kept it as it was.

I´m also now using "Alloc" in the procedure (sending the address to MapPtr  dd  ?).

Next, I´m creating an array of pointers to hold the line addresses. That will speed up my paint code and also give me freedom to do my next step with this thing.

Cheers, Alex

jj2007

Works fine indeed :t

I wonder why it throws a Warning A4184: Instructions and initialized data not supported in BSS segments on
gm  Game    <> ::)

dedndave

possibly either the symbol "gm" or "Game" (or both) are defined elsewhere ?

LordAdef

Hey, I got some interesting update on this, and I think I found a bug in qEditor and that´s why it´s not building.

1. Decomp????

Yep, my bad. I left a line of code of this old variable. Here it is the culprit:
Quotemov   edi, offset Decomp   ====> The little persistent bastard is here!
   mov   esi, InputFile(string)
          mov   tLen, ecx
         
          ; allocate dest. memory
          mov MapPtr, alloc ( DWORD Ptr [esi])   ====> It was replaced by this fellow
          mov edi, MapPtr

2. gm Game <>:
Quote


        Game STRUCT
               lives          dd  ?
               level          dd  ?
               state       dd  ?
               speed        dd  ?
               kills      dd    ?
               mapRect   RECT   <>
               dispRect     RECT <>
               bomber   dd   30   dup(Bomber)   <==== HERE. Bomber is a uninitialized struct too. 
               enemies   dd   60   dup(?)   
        Game ENDS

3. qEditor:
Quote
LINK : fatal error LNK1181: cannot open input file "C:\masm32\AFprojs\09_game_test_03\Main.obj"
Link error
=> It doesn´t build when you "Windows Explorer->Main.asm->rightClick->open in qEditor"
   => It builds fine when you open the file from within qEditor
   Please try and replicate this issue, so to confirm it to Hutch

dedndave

i'm a little rusty, but i think it should be...

               bomber   dd   30   dup(Bomber<>)

something like that

LordAdef

Yes, thanks!
Did you replicate the qEditor thing?

dedndave


jj2007

Quote from: LordAdef on March 31, 2017, 06:18:49 AM=> It builds fine when you open the file from within qEditor

Builds fine with RichMasm, and builds OK when I drag Main.asm over qEditor.exe - but qEditor ignores the resources for some reason.

hutch--

The default MASM32 console build requires the resource script to be called RSRC.RC. Added a "makeit.bat" and renamed the RC script and it builds as normal in QE using the MASM32 default.

LordAdef

Hi guys,

It´s been a while I don´t update this project, so here I am.

It´s not optimized "at all". There are many decouplings to fix and CPU is running hot for now. But all in all this begins to look like a game.

1. My rle is working in all its glory (thanks everyone for helping optimizing it)
2. I made some game management already, so it loads levels, reset level when we die and so forth...
3. Fuel is working now (not refueling)
4. There are 3 temporary maps so I can test things
5. Made a experimental explosion. Try and suicide, and check it out. It´s quite nice :D
6. Maps are way larger now. I decompress them, but in fact I use an array of pointers. This way I´m doubling its lenght, but reversing it in the second half. More content for the same space
7. Collision Detection is in place, but in pure bare bones, only for development.
8. Made some "god mode" keys for development:
    number 1: resume game
    number 2: pause game
    number 4: load next level
   
9. arrows work as usual, however I limited to only 2 speeds for now.
10. Built with RichMasm. This time I didn´t try on qEditor, but I know it gives it errors. I didn´t try to fix them though
Cheers, Alex


   

Siekmanski

Hi LordAdef,

The arrow keys are not responding.

EDIT: it works now, had to press 1 first.  :t
Creative coders use backward thinking techniques as a strategy.

HSE

Just a fixed map, with the airplane and a copyright symbold instead the bombarder of previous versions.
Equations in Assembly: SmplMath

LordAdef

try number 1 to resume game, it starts in pause mode

press 2 and it pauses.
if you press 4 "while" running, it loads the next level

HSE

Beautifull ... crash using 1

The code is not ML compatible. For this I used AsmC:

004014F5 >  55              PUSH EBP
004014F6    8BEC            MOV EBP, ESP
004014F8    A1 8CD14000     MOV EAX, DWORD PTR DS:[man]
004014FD    83E8 62         SUB EAX, 62
00401500    BB 05000000     MOV EBX, 5
00401505    F7F3            DIV EBX                <---   CRASH
00401507    8B3D 78544000   MOV EDI, DWORD PTR DS:[405478]
0040150D    83C7 3C         ADD EDI, 3C
00401510    8B34BD 8C544000 MOV ESI, DWORD PTR DS:[EDI*4+40548C]
00401517    03F0            ADD ESI, EAX
00401519    803E 40         CMP BYTE PTR DS:[ESI], 40
0040151C    74 02           JE SHORT Main_v8_.00401520
0040151E    EB 08           JMP SHORT Main_v8_.00401528
00401520    FF75 08         PUSH DWORD PTR SS:[EBP+8]
00401523    E8 E1090000     CALL Main_v8_.pDead
00401528    5D              POP EBP
00401529    C2 0400         RETN 4

Equations in Assembly: SmplMath

LordAdef

JWasm.
I'll check it out for compatibility. Cheers