flat assembler
Message board for the users of flat assembler.

Index > Windows > Tetris game, first approach

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 03 Feb 2012, 08:18
I know I am annoying, but the rotation direction is wrong again. Sad
Post 03 Feb 2012, 08:18
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 03 Feb 2012, 08:37
Very Happy

Ha ha, I'm sorry... I forgot it... Do you know? what happens is that I'm used to game on right rotation (right but not correct)... I make another version on the correct rotation.

Regards

pd: Sorry, I was wrong and put a new thread. I have deleted it already...


Description:
Download
Filename: TetrisWF2.zip
Filesize: 5.41 KB
Downloaded: 276 Time(s)


_________________
Siempre aprendiendo
Post 03 Feb 2012, 08:37
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 03 Feb 2012, 12:05
The next test report:

1. The bottom of the play field is not marked in any way and the landing of the figures "in the air" is little bit unexpected. The same about the right border. Sometimes I simply miss to fill the right most column, simply because I am not aware it is there (the field is wider than usual and this makes the problem even worse).
2. The game crashes on 4 rows removing.
Post 03 Feb 2012, 12:05
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 03 Feb 2012, 12:30
1. Yes, I guess that should paint borders
2. But not ever on 4th rows removing... at least for me. Many times I can ending the game (I have reached 9th level and over 3 hundred points Wink ). Yes I will revise the code.

Thank youk, John


Description:
Filesize: 38.78 KB
Viewed: 6363 Time(s)

Tetris2.png



_________________
Siempre aprendiendo
Post 03 Feb 2012, 12:30
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 03 Feb 2012, 14:28
It crashes on $401f5b and not only on 4 rows.
Post 03 Feb 2012, 14:28
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4354
Location: Now
edfed 03 Feb 2012, 18:54
too much bugs man, share your code please to see where are all these bugs. Smile
Post 03 Feb 2012, 18:54
View user's profile Send private message Visit poster's website Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 05 Feb 2012, 11:29
Quote:

too much bugs man


Really? Confused

Quote:

It crashes on $401f5b and not only on 4 rows.


I will revise it. The debugging task will be hard, I presume.



Well, some changes applied:

1) Now, there's no flickering in main window
2) Delimited borders with red lines

There're two versions of the program:
TetrisWF2.exe -> shapes rotates on the right
TetrisWF2b.exe -> shapes rotates on the left

I have noticed that sometimes the programs hangs up yet. I have revised the program and pusha/popa in everywhere I could to avoiding hidden changes on registers values, specially on windows internal functions callings. Hence I will do this two things:

1) Revise variables' type casting.
2) Get non-initialized variables into reserved memory

If none of them works, the debugging task would be very hard, because most of times the program works well, so it is difficult to find the characteristic of the error.

Regards


Description:
Download
Filename: TetrisWF.zip
Filesize: 11.1 KB
Downloaded: 263 Time(s)


_________________
Siempre aprendiendo
Post 05 Feb 2012, 11:29
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 05 Feb 2012, 11:46
Sorry, but it crashes instantly on the start (inside user32.dll). Debugging shows the call from $401125 to the function UpdateWindow. The reason is probably bad arguments.
Post 05 Feb 2012, 11:46
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 06 Feb 2012, 08:27
JohnFound wrote:
Sorry, but it crashes instantly on the start (inside user32.dll). Debugging shows the call from $401125 to the function UpdateWindow. The reason is probably bad arguments.


Yes, your are right, it fails at the first glance, but only in WXP, in W7 works well (sometimes hanged up, as usual)... Well, I have W7 and I was able to prove it many times with this bug, I don't know how could do it W7 for not take it in account... I feel that I have to give an explanation: let's say that for implement double buffering in main windows I had to recover an extra parameter in a central procedure but, because I recover parameters by hand, I forgot to add it in its RET sentence. I cannot get out of my surprise thinking how W7 gives the correct offset on return to EIP.

Anyway, time and tests lost... Sorry for inconveniences. This error is now corrected in both versions.


Description:
Download
Filename: TetrisWF.zip
Filesize: 11.1 KB
Downloaded: 299 Time(s)


_________________
Siempre aprendiendo
Post 06 Feb 2012, 08:27
View user's profile Send private message Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 06 Feb 2012, 09:52
It works now and it seems to be more stable. At least I was able to play 7..8 games without crash.

Regards.
Post 06 Feb 2012, 09:52
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 06 Feb 2012, 10:46
Thank you a lot, JohnFound. It is possible that some registers changed its value "hiddenly" when I called system functions, because them not only changes eax, but sometimes any others. So, it is possible that I fixed this with those pusha/popa... This would be great.

Regards.
Post 06 Feb 2012, 10:46
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20631
Location: In your JS exploiting you and your system
revolution 06 Feb 2012, 10:56
avcaballero: All Windows API calls use either standard-call or c-call convention. Both of these calling standard conventions state that EFLAGS, EAX, ECX and EDX can be clobbered at any time. EBX, ESI, EDI and EBP are all preserved at all times.
Post 06 Feb 2012, 10:56
View user's profile Send private message Visit poster's website Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach 10 Feb 2012, 01:41
crashed when i held down the left arrow key to get one block to "get under" another one, kind of spammed the left key not to make any space unused.
bottom row if it makes any difference.
Post 10 Feb 2012, 01:41
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 214
Location: Madrid - Spain
avcaballero 10 Feb 2012, 07:44
bubach, if I didn't understand you wrong, the bug appears when you hold the left key down. Do you have the lastest version? I have fixed in one version that when hold down any key (left or right) to get the figure under other, the first one put over the second before reaching the bottom of the second. This would be fine in the latest version. Also, in a previous version a hidden shape drops hiddenly and the next shape held static apparently before the end because it is above the previous hidden shape... this is also fixed and the latest version should works fine.

The latest version works well almost every time, but from time to time keeps on crashing. I have to review the code when I have time.

I don't know if this is what you mean.

Thank you
Post 10 Feb 2012, 07:44
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.