Rev 485 | Rev 1643 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 485 | Rev 1632 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;---------------------------------------------------------- |
1 | ;---------------------------------------------------------- |
2 | ;--------change size of memory which use program----------- |
2 | ;--------change size of memory which use program----------- |
3 | ;---------------------------------------------------------- |
3 | ;---------------------------------------------------------- |
- | 4 | ;GetMemory: |
|
- | 5 | ; pushad |
|
- | 6 | ; mov eax,64 |
|
- | 7 | ; mov ebx,1 |
|
- | 8 | ; mov ecx,[Picture_SizeX] |
|
- | 9 | ; mov edx,[Picture_SizeY] |
|
- | 10 | ; imul ecx,edx |
|
- | 11 | ; lea ecx,[ecx+ecx*2] |
|
- | 12 | ; lea ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5 |
|
- | 13 | ; add ecx,[ScreenPointer] |
|
- | 14 | ; add ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 ; 4192384 |
|
- | 15 | ; add ecx,[extended_memory] |
|
- | 16 | ; mcall |
|
- | 17 | ; test eax,eax |
|
- | 18 | ; jz have_new_memory |
|
- | 19 | ; mov esi,sound_havent_memory |
|
- | 20 | ; call sound |
|
- | 21 | ; jmp still |
|
- | 22 | ;have_new_memory: |
|
- | 23 | ; popad |
|
- | 24 | ; ret |
|
- | 25 | ||
4 | GetMemory: |
26 | GetMemory: |
5 | pushad |
27 | pushad |
6 | mov eax,64 |
- | |
7 | mov ebx,1 |
- | |
8 | mov ecx,[Picture_SizeX] |
28 | mov ecx,[Picture_SizeX] |
9 | mov edx,[Picture_SizeY] |
29 | mov edx,[Picture_SizeY] |
10 | imul ecx,edx |
30 | imul ecx,edx |
11 | lea ecx,[ecx+ecx*2] |
31 | lea ecx,[ecx+ecx*2] |
12 | lea ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5 |
32 | lea ecx,[ecx+ecx*4] ;(Picture_SizeX*Picture_SizeY*3)*5 |
13 | add ecx,[ScreenPointer] |
- | |
14 | add ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 |
33 | add ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 ; 4192384 |
15 | add ecx,[extended_memory] |
34 | mcall 68,20,,[ScreenPointer] |
16 | mcall |
- | |
17 | - | ||
18 | test eax,eax |
35 | test eax,eax |
19 | jz have_new_memory |
36 | jnz have_new_memory |
20 | - | ||
21 | mov esi,sound_havent_memory |
37 | mov esi,sound_havent_memory |
22 | call sound |
38 | call sound |
23 | 39 | pushad |
|
24 | jmp still |
40 | jmp still |
Line 25... | Line 41... | ||
25 | 41 | ||
- | 42 | have_new_memory: |
|
- | 43 | mov [ScreenPointer],eax |
|
26 | have_new_memory: |
44 | call prepare_data_pointers |
27 | popad |
45 | popad |
- | 46 | ret |
|
- | 47 | ;--------------------------------------------------------- |
|
- | 48 | prepare_data_pointers: |
|
- | 49 | mov eax,[Picture_SizeX] |
|
- | 50 | mov ebx,[Picture_SizeY] |
|
- | 51 | imul eax,ebx |
|
- | 52 | lea eax,[eax+eax*2] |
|
- | 53 | mov ebx,[ScreenPointer] |
|
- | 54 | add ebx,(1200*1000*3)+50*(20*20*3)+500000 |
|
- | 55 | ||
- | 56 | mov [PointerToPicture],ebx |
|
- | 57 | mov [PointerToCopyPicture],ebx |
|
- | 58 | mov [PointerToCopyPicture2],ebx |
|
- | 59 | mov [PointerToEditBufer],ebx |
|
- | 60 | mov [PointerToSpriteBufer],ebx |
|
- | 61 | ||
- | 62 | add [PointerToCopyPicture],eax |
|
- | 63 | ||
- | 64 | add [PointerToCopyPicture2],eax |
|
- | 65 | add [PointerToCopyPicture2],eax |
|
- | 66 | ||
- | 67 | add [PointerToEditBufer],eax |
|
- | 68 | add [PointerToEditBufer],eax |
|
- | 69 | add [PointerToEditBufer],eax |
|
- | 70 | ||
- | 71 | add [PointerToSpriteBufer],eax |
|
- | 72 | add [PointerToSpriteBufer],eax |
|
- | 73 | add [PointerToSpriteBufer],eax |
|
- | 74 | add [PointerToSpriteBufer],eax |
|
- | 75 | ret |
|
28 | ret |
76 | ;--------------------------------------------------------- |