2006-12-29 15:50:24 +01:00
|
|
|
;----------------------------------------------------------
|
|
|
|
;--------change size of memory which use program-----------
|
|
|
|
;----------------------------------------------------------
|
|
|
|
GetMemory:
|
2010-10-04 22:40:19 +02:00
|
|
|
pusha
|
2010-09-30 15:20:36 +02:00
|
|
|
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
|
2010-10-04 22:40:19 +02:00
|
|
|
popa
|
|
|
|
add esp,4
|
2010-09-30 15:20:36 +02:00
|
|
|
jmp still
|
|
|
|
|
|
|
|
have_new_memory:
|
|
|
|
mov [ScreenPointer],eax
|
|
|
|
call prepare_data_pointers
|
2010-10-04 22:40:19 +02:00
|
|
|
popa
|
2010-09-30 15:20:36 +02:00
|
|
|
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
|
2006-12-29 15:50:24 +01:00
|
|
|
|
2010-09-30 15:20:36 +02:00
|
|
|
add [PointerToCopyPicture],eax
|
2006-12-29 15:50:24 +01:00
|
|
|
|
2010-09-30 15:20:36 +02:00
|
|
|
add [PointerToCopyPicture2],eax
|
|
|
|
add [PointerToCopyPicture2],eax
|
2006-12-29 15:50:24 +01:00
|
|
|
|
2010-09-30 15:20:36 +02:00
|
|
|
add [PointerToEditBufer],eax
|
|
|
|
add [PointerToEditBufer],eax
|
|
|
|
add [PointerToEditBufer],eax
|
2006-12-29 15:50:24 +01:00
|
|
|
|
2010-09-30 15:20:36 +02:00
|
|
|
add [PointerToSpriteBufer],eax
|
|
|
|
add [PointerToSpriteBufer],eax
|
|
|
|
add [PointerToSpriteBufer],eax
|
|
|
|
add [PointerToSpriteBufer],eax
|
2010-10-04 22:40:19 +02:00
|
|
|
|
|
|
|
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
|
2010-09-30 15:20:36 +02:00
|
|
|
ret
|
|
|
|
;---------------------------------------------------------
|