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