Subversion Repositories Kolibri OS

Rev

Rev 485 | Rev 1643 | 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
;----------------------------------------------------------
1632 mario79 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
 
255 heavyiron 26
GetMemory:
1632 mario79 27
	pushad
28
	mov	ecx,[Picture_SizeX]
29
	mov	edx,[Picture_SizeY]
30
	imul	ecx,edx
31
	lea	ecx,[ecx+ecx*2]
32
	lea	ecx,[ecx+ecx*4]		;(Picture_SizeX*Picture_SizeY*3)*5
33
	add	ecx,(1200*1000)*3+50*(20*20*3)+500000+16000+0x4000 ; 4192384
34
	mcall	68,20,,[ScreenPointer]
35
	test	eax,eax
36
	jnz	have_new_memory
37
	mov	esi,sound_havent_memory
38
	call	sound
39
	pushad
40
	jmp	still
255 heavyiron 41
 
1632 mario79 42
have_new_memory:
43
	mov	[ScreenPointer],eax
44
	call	prepare_data_pointers
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
255 heavyiron 55
 
1632 mario79 56
	mov	[PointerToPicture],ebx
57
	mov	[PointerToCopyPicture],ebx
58
	mov	[PointerToCopyPicture2],ebx
59
	mov	[PointerToEditBufer],ebx
60
	mov	[PointerToSpriteBufer],ebx
255 heavyiron 61
 
1632 mario79 62
	add	[PointerToCopyPicture],eax
255 heavyiron 63
 
1632 mario79 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
76
;---------------------------------------------------------