Subversion Repositories Kolibri OS

Rev

Rev 1632 | Rev 6328 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1632 Rev 1643
Line 1... Line -...
1
;loading file from parameters if parametrs <> 0
-
 
2
;IN
-
 
3
; eax- pointer to parameters
-
 
4
; ebx- pointer to path of file
-
 
5
;OUT
-
 
6
;value not returned
-
 
7
 
-
 
8
;check_loading_from_parameters:
-
 
9
 
-
 
10
;     cmp [eax],byte 0
-
 
11
;     jz no_parameters
-
 
12
 
-
 
13
     ;copy file name
-
 
14
;     mov esi,eax
-
 
15
;     mov edi,ebx
-
 
16
;     mov ecx,256
-
 
17
;     rep movsb
-
 
18
 
-
 
19
     ;load file in memory
-
 
20
     
-
 
21
;     call load_picture
-
 
22
 
-
 
23
;     no_parameters:
-
 
24
     
-
 
25
;     ret
-
 
26
 
-
 
27
; load picture from file to memory
1
; load picture from file to memory
Line 28... Line 2...
28
 
2
 
29
load_picture:
-
 
30
 
3
load_picture:
31
         mov eax,file_path
4
	mov	eax,file_path
32
	 mov ebx,[ScreenPointer]
5
	mov	ebx,[ScreenPointer]
Line 33... Line 6...
33
	 add ebx,0x10000
6
	add	ebx,0x10000
Line 48... Line 21...
48
	 xor ebx,ebx
21
	xor	ebx,ebx
49
	 mov eax,[esi+18]
22
	mov	eax,[esi+18]
50
	 mov ebx,[esi+22]
23
	mov	ebx,[esi+22]
51
	 mov [Picture_SizeX],eax
24
	mov	[Picture_SizeX],eax
52
	 mov [Picture_SizeY],ebx
25
	mov	[Picture_SizeY],ebx
53
 
-
 
54
	 jmp exit_type_1
26
	jmp	exit_type_1
Line 55... Line 27...
55
 
27
 
56
	 no_bmp_file_1:
-
 
57
 
28
no_bmp_file_1:
58
	 ;-------------is this GIF file ?----------------
29
;-------------is this GIF file ?----------------
59
	 xor eax,eax
30
	xor	eax,eax
60
	 mov ax,[esi]
31
	mov	ax,[esi]
61
	 mov [type],ax
-
 
62
 
32
	mov	[type],ax
63
	 cmp [type],'GI'
33
	cmp	[type],'GI'
Line 64... Line 34...
64
	 jne no_gif_file_1
34
	jne	no_gif_file_1
65
 
35
 
66
	 add esi,6
36
	add	esi,6
67
	 xor eax,eax
37
	xor	eax,eax
68
	 xor ebx,ebx
38
	xor	ebx,ebx
69
	 mov ax,word[esi]
39
	mov	ax,word[esi]
70
	 mov bx,word[esi+2]
40
	mov	bx,word[esi+2]
71
	 mov [Picture_SizeX],eax
-
 
72
	 mov [Picture_SizeY],ebx
41
	mov	[Picture_SizeX],eax
Line 73... Line 42...
73
 
42
	mov	[Picture_SizeY],ebx
74
	 jmp exit_type_1
-
 
75
 
43
	jmp	exit_type_1
Line 76... Line 44...
76
	 no_gif_file_1:
44
 
77
 
-
 
78
	 jmp no_unpakcing_file_1
45
no_gif_file_1:
79
 
46
	jmp	no_unpakcing_file_1
80
	 exit_type_1:
47
 
81
 
48
exit_type_1:
82
	 ;----------------------------------------------------------
-
 
83
	 ;Get momory for unpacking picture and for picture's bufers
49
;----------------------------------------------------------
84
	 ;----------------------------------------------------------
50
;Get momory for unpacking picture and for picture's bufers
85
	 call GetMemory
51
;----------------------------------------------------------
Line 86... Line 52...
86
 
52
	call GetMemory
87
	 ;----------------------------------------------------------
53
;----------------------------------------------------------
88
	 ;--------------------Load file in memory-------------------
54
;--------------------Load file in memory-------------------
89
	 ;----------------------------------------------------------
-
 
90
 
55
;----------------------------------------------------------
Line 91... Line 56...
91
	 mov eax,file_path
56
 
92
	 mov ebx,[PointerToCopyPicture]
57
	mov	eax,file_path
93
	 add ebx,1000
58
	mov	ebx,[PointerToCopyPicture]
94
 
59
	add	ebx,1000
95
	 call load_file
60
	call	load_file
96
 
61
 
97
	 ;----------------------------------------------------------
62
;----------------------------------------------------------
98
	 ;-------------------Unpacking picture----------------------
-
 
99
	 ;----------------------------------------------------------
63
;-------------------Unpacking picture----------------------
100
	 mov esi,[PointerToCopyPicture]
64
;----------------------------------------------------------
101
	 add esi,1000
65
	mov	esi,[PointerToCopyPicture]
102
	 mov edi,[PointerToPicture]
66
	add	esi,1000
103
	 mov eax,[ScreenPointer]
67
	mov	edi,[PointerToPicture]
104
 
68
	mov	eax,[ScreenPointer]
105
	 cmp [type],'BM'
-
 
Line -... Line 69...
-
 
69
	cmp	[type],'BM'
106
	 jne no_unpakcing_bmp_file_1
70
	jne	no_unpakcing_bmp_file_1
107
	    ;BMP DECODER
71
;BMP DECODER
108
	    call bmptoimg
72
	call	bmptoimg
109
	    mov [save_flag],1
73
	mov	[save_flag],1
110
	 no_unpakcing_bmp_file_1:
74
	jmp	no_unpakcing_file_1
111
 
75
 
112
 
-
 
Line -... Line 76...
-
 
76
no_unpakcing_bmp_file_1:
113
	 cmp [type],'GI'
77
	cmp	[type],'GI'
114
	 jne no_unpakcing_file_1
-
 
115
	   ;GIF DECODER
78
	jne	no_unpakcing_file_1
116
	   sub edi,8
79
;GIF DECODER
117
	   call ReadGIF
80
	sub	edi,8