kolibrios-fun/programs/media/animage/trunk/memory.inc
Marat Zakiyanov (Mario79) bab525b2cf Animage v1.3
1) Fixed window flicker when redrawing
2) Fixed memory leak for stack

git-svn-id: svn://kolibrios.org@1643 a494cfbc-eb01-0410-851d-a64ba20cac60
2010-10-04 20:40:19 +00:00

63 lines
1.6 KiB
PHP

;----------------------------------------------------------
;--------change size of memory which use program-----------
;----------------------------------------------------------
GetMemory:
pusha
mov ecx,[Picture_SizeX]
mov edx,[Picture_SizeY]
imul ecx,edx
lea ecx,[ecx+ecx*2]
lea ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5
add ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 ; 4192384
mcall 68,20,,[ScreenPointer]
test eax,eax
jnz have_new_memory
mov esi,sound_havent_memory
call sound
popa
add esp,4
jmp still
have_new_memory:
mov [ScreenPointer],eax
call prepare_data_pointers
popa
ret
;---------------------------------------------------------
prepare_data_pointers:
mov eax,[Picture_SizeX]
mov ebx,[Picture_SizeY]
imul eax,ebx
lea eax,[eax+eax*2]
mov ebx,[ScreenPointer]
add ebx,(1200*1000*3)+50*(20*20*3)+500000
mov [PointerToPicture],ebx
mov [PointerToCopyPicture],ebx
mov [PointerToCopyPicture2],ebx
mov [PointerToEditBufer],ebx
mov [PointerToSpriteBufer],ebx
add [PointerToCopyPicture],eax
add [PointerToCopyPicture2],eax
add [PointerToCopyPicture2],eax
add [PointerToEditBufer],eax
add [PointerToEditBufer],eax
add [PointerToEditBufer],eax
add [PointerToSpriteBufer],eax
add [PointerToSpriteBufer],eax
add [PointerToSpriteBufer],eax
add [PointerToSpriteBufer],eax
mov eax,[ScreenPointer]
add eax,(1200*100*3)+50*(20*20*3)+1
mov [PointerToPalette],eax
mov eax,[ScreenPointer]
add eax,(1200*1000)*3+50*(20*20*3)+8
mov [ReserveArray],eax
ret
;---------------------------------------------------------