flat assembler
Message board for the users of flat assembler.
![]() Goto page Previous 1, 2, 3 Next |
Author |
|
JohnFound 23 Jan 2012, 14:21
Now your game could be qualified as a "Spyware" because it successfully disclosed the color of my desktop.
![]() |
|||
![]() |
|
avcaballero 23 Jan 2012, 15:03
JohnFound wrote: Now your game could be qualified as a "Spyware" because it successfully disclosed the color of my desktop. ![]() Ha ha, yes, but an stupid spyware because it disclosed the color of my desktop too... Well, counter clock wise rotation was easy, so I did it alredy... it should works now in that way. Regarding background color, now it is COLOR_CAPTIONTEXT... yes it is configurable too, but i do not want to use a function to do it... who in the world would configure its COLOR_CAPTIONTEXT to a color distinct of black? Anyway it is only for fun, so... Regards
|
|||||||||||
![]() |
|
JohnFound 23 Jan 2012, 15:21
Why not to use simple color like $000000?
|
|||
![]() |
|
avcaballero 25 Jan 2012, 16:49
This program looks for the file WFTetris.txt in the same folder that it is, if it does not find it, create it (hidden) with initial data for storing user, level and score. Next time the program runs (and the file already exists) open it and sort (bubble) descending its data according to the score field and dump this data to the file.
Regards
|
|||||||||||
![]() |
|
JohnFound 26 Jan 2012, 07:46
BTW, the latest published version of the game, crashed on $401932 (rep movsd) - you are trying to write to the address $401fe8, but it seems to be read only.
|
|||
![]() |
|
avcaballero 26 Jan 2012, 08:25
Ok, thank you. I have also seen something wrong... I will revise it...
Regards |
|||
![]() |
|
avcaballero 26 Jan 2012, 09:49
There were an error in BubbleSort method that I've just fixed... I hope. The last procedure is this:
Code: proc BubleSort uses ecx esi edi ; Propósito: Ordena el búfer de marcadores según los marcadores, de mayor a menor ; Entrada : Ninguna ; Salida : Ninguna ; Destruye : EAX mov esi, 0 mov cl, cdNumRScore-1 @bs_BucleExt: mov ch, cl mov edi, esi add edi, stFilScoreLen ;13 @bs_BucleInt: mov eax, [vmDatosPlay+esi+9] ; Comparamos marcadores cmp eax, [vmDatosPlay+edi+9] jge @bs_Next1 stdcall Swap @bs_Next1: add edi, stFilScoreLen ;13 dec ch jnz @bs_BucleInt add esi, stFilScoreLen ;13 dec cl jnz @bs_BucleExt ret endp Regards
|
|||||||||||
![]() |
|
avcaballero 27 Jan 2012, 09:54
Maybe it would be good for a dynamic background for score reports...
|
|||||||||||
![]() |
|
avcaballero 30 Jan 2012, 17:19
This new 3d starfield version writes down the score text content. It works rather well, i think, but not completely. It has no flickering, but if another window overlap it, some funny things occurs (logical, by other hand). I have to review also the code in order it can paint wider names. In other hand, i suspect that rd variables can interactuate with system organization memory, perhaps is it better use rd variables not at the end of the code?... I should prove it... or perhaps using memory reservations...
Thank you.
|
||||||||||||||||||||
![]() |
|
avcaballero 31 Jan 2012, 17:21
Some changes has been made:
1) This time, black background forever, does not depends on Windows Configurations 2) 3d Double buffering starfield 3) About info added to system menu 4) Fixed bug on the score report on length name 5) Now, there's no problem on overlapping windows Changes that are needed to apply: 1) I believe Windows memory allocation overlaps rd variables, may be the best solution be to reserving memory... BTW, anyone interested?
|
|||||||||||
![]() |
|
AsmGuru62 31 Jan 2012, 17:49
"...Windows memory allocation overlaps rd variables..."
Can you explain that in detail? What do you mean by this? |
|||
![]() |
|
avcaballero 01 Feb 2012, 08:40
Well, i'm not sure, it is only a suspect. When I define no initialized variables with "rd" (reserve double word) it does not get place in the final executable, so, when you execute it, Windows allocate memory for it, but for the executable size, where rd variable do not be, so, it can use unused memory by the rd variables. But, because Windows is a multitasking system, if it has to allocate memory for other application, it could take the memory where rd variables are. In a monotasking system like DOS it works well because all the memory available is assigned to the application.
Well, I'm not sure if this works as it, only I guess it, in any case nothing will go wrong if i take all this rd variables into a reservation memory. I begin to worry if, even so, keeps on failing, it would be the code who were wrong. It is possible that, for any change, any pointer changes to anywhere in the memory that it has not to. I need to do some proves... and look for information... that's all |
|||
![]() |
|
revolution 01 Feb 2012, 09:30
avcaballero wrote: But, because Windows is a multitasking system, if it has to allocate memory for other application, it could take the memory where rd variables are. Don't worry about it, the OS won't screw with your memory allocations. |
|||
![]() |
|
avcaballero 01 Feb 2012, 09:46
![]() ![]() Anyway I will revise the code... and probably will use reserving memory Regards |
|||
![]() |
|
AsmGuru62 01 Feb 2012, 14:38
@avcaballero:
It depends where you use that RD directive. If this is used in a 'data' section, then memory reserved by RD is included into EXE file and NOT allocated by Windows. Also, this memory initialized to zeroes -- at least that is what I can see in debugger. If the RD is used in a local variable declaration, then this memory is also NOT allocated by Windows with any allocation techniques - it is instead allocated on stack by FASM itself, when it builds the EXE file. Something is interesting going on here... as you said -- most likely a bug. |
|||
![]() |
|
revolution 01 Feb 2012, 14:46
AsmGuru62 wrote: If this is used in a 'data' section, then memory reserved by RD is included into EXE file and NOT allocated by Windows. |
|||
![]() |
|
avcaballero 01 Feb 2012, 15:46
Well, as i can see, when define non-initialized variables (see Test01.asm, 2048 bytes exe resulting) they are not added to executable; but when I initialized them, they are added (see Test02.asm, 6144 bytes exe resulting). What I do not understand yet is how can Windows know that has to reserve memory also for non-initialized variables... I suppose that it could look inside the program and check if in it something point outside the program... but... if I do want to point outside my program to anything else...
Well, I don't know... I need to study it a bit. Regards
|
|||||||||||
![]() |
|
revolution 01 Feb 2012, 15:48
avcaballero wrote: What I do not understand yet is how can Windows know that has to reserve memory also for non-initialized variables... |
|||
![]() |
|
avcaballero 03 Feb 2012, 08:02
Well, just another version where everything have been joined, hence we have tetris game, and the hall of fame, with the gamers' figures over a 3d starfield background.
Still remains bugs to be fixed: * sometimes hungs up * a bit of flickering in main window * revise the code Regards
_________________ Siempre aprendiendo |
|||||||||||
![]() |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.