Rev 1643 | Rev 6352 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
255 | heavyiron | 1 | ;---------------------------------------------------------- |
2 | ;--------change size of memory which use program----------- |
||
3 | ;---------------------------------------------------------- |
||
4 | GetMemory: |
||
1643 | mario79 | 5 | pusha |
1632 | mario79 | 6 | mov ecx,[Picture_SizeX] |
7 | mov edx,[Picture_SizeY] |
||
8 | imul ecx,edx |
||
9 | lea ecx,[ecx+ecx*2] |
||
10 | lea ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5 |
||
11 | add ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 ; 4192384 |
||
12 | mcall 68,20,,[ScreenPointer] |
||
13 | test eax,eax |
||
14 | jnz have_new_memory |
||
15 | mov esi,sound_havent_memory |
||
16 | call sound |
||
1643 | mario79 | 17 | popa |
18 | add esp,4 |
||
1632 | mario79 | 19 | jmp still |
255 | heavyiron | 20 | |
1632 | mario79 | 21 | have_new_memory: |
22 | mov [ScreenPointer],eax |
||
23 | call prepare_data_pointers |
||
1643 | mario79 | 24 | popa |
1632 | mario79 | 25 | ret |
26 | ;--------------------------------------------------------- |
||
27 | prepare_data_pointers: |
||
28 | mov eax,[Picture_SizeX] |
||
29 | mov ebx,[Picture_SizeY] |
||
30 | imul eax,ebx |
||
31 | lea eax,[eax+eax*2] |
||
32 | mov ebx,[ScreenPointer] |
||
33 | add ebx,(1200*1000*3)+50*(20*20*3)+500000 |
||
255 | heavyiron | 34 | |
1632 | mario79 | 35 | mov [PointerToPicture],ebx |
36 | mov [PointerToCopyPicture],ebx |
||
37 | mov [PointerToCopyPicture2],ebx |
||
38 | mov [PointerToEditBufer],ebx |
||
39 | mov [PointerToSpriteBufer],ebx |
||
255 | heavyiron | 40 | |
1632 | mario79 | 41 | add [PointerToCopyPicture],eax |
255 | heavyiron | 42 | |
1632 | mario79 | 43 | add [PointerToCopyPicture2],eax |
44 | add [PointerToCopyPicture2],eax |
||
45 | |||
46 | add [PointerToEditBufer],eax |
||
47 | add [PointerToEditBufer],eax |
||
48 | add [PointerToEditBufer],eax |
||
49 | |||
6327 | IgorA | 50 | shl eax,2 |
1632 | mario79 | 51 | add [PointerToSpriteBufer],eax |
1643 | mario79 | 52 | |
53 | mov eax,[ScreenPointer] |
||
6327 | IgorA | 54 | add eax,(1200*1000*3)+50*(20*20*3)+1 |
1643 | mario79 | 55 | mov [PointerToPalette],eax |
56 | |||
57 | mov eax,[ScreenPointer] |
||
6327 | IgorA | 58 | add eax,(1200*1000*3)+50*(20*20*3)+8 |
1643 | mario79 | 59 | mov [ReserveArray],eax |
1632 | mario79 | 60 | ret |
61 | ;--------------------------------------------------------- |