Rev 3177 | Rev 3946 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3177 | Rev 3178 | ||
---|---|---|---|
1 | ; kpack = Kolibri Packer |
1 | ; kpack = Kolibri Packer |
2 | ;--------------------------------------------------------------------- |
2 | ;--------------------------------------------------------------------- |
3 | ; version: 0.20 |
3 | ; version: 0.20 |
4 | ; last update: 08/18/2011 |
4 | ; last update: 08/18/2011 |
5 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
5 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
6 | ; changes: Checking for "rolled up" window |
6 | ; changes: Checking for "rolled up" window |
7 | ;--------------------------------------------------------------------- |
7 | ;--------------------------------------------------------------------- |
8 | ; version: 0.20 |
8 | ; version: 0.20 |
9 | ; last update: 07/12/2010 |
9 | ; last update: 07/12/2010 |
10 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
10 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
11 | ; changes: Added code for packing the kernel.mnt |
11 | ; changes: Added code for packing the kernel.mnt |
12 | ;--------------------------------------------------------------------- |
12 | ;--------------------------------------------------------------------- |
13 | ; version: 0.15 |
13 | ; version: 0.15 |
14 | ; last update: 06/11/2010 |
14 | ; last update: 06/11/2010 |
15 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
15 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
16 | ; changes: 1) Window Y=4, B=1 |
16 | ; changes: 1) Window Y=4, B=1 |
17 | ; 2) Refresh lenght of data after Editbox editing |
17 | ; 2) Refresh lenght of data after Editbox editing |
18 | ; 3) Changed format of start parameter - |
18 | ; 3) Changed format of start parameter - |
19 | ; longer path (total length 255 + zero). |
19 | ; longer path (total length 255 + zero). |
20 | ;--------------------------------------------------------------------- |
20 | ;--------------------------------------------------------------------- |
21 | ; version: 0.14 |
21 | ; version: 0.14 |
22 | ; last update: 03/11/2010 |
22 | ; last update: 03/11/2010 |
23 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
23 | ; changed by: Marat Zakiyanov aka Mario79, aka Mario |
24 | ; changes: select path with OpenDialog, |
24 | ; changes: select path with OpenDialog, |
25 | ; using Box_Lib and Proc_Lib |
25 | ; using Box_Lib and Proc_Lib |
26 | ;--------------------------------------------------------------------- |
26 | ;--------------------------------------------------------------------- |
27 | ; Kpack - Kolibri Packer |
27 | ; Kpack - Kolibri Packer |
28 | ; Kolibri version |
28 | ; Kolibri version |
29 | ; Written by diamond in 2006, 2007 specially for KolibriOS |
29 | ; Written by diamond in 2006, 2007 specially for KolibriOS |
30 | ; |
30 | ; |
31 | ; Disassemled and corrected in 2010 specially for FASM |
31 | ; Disassemled and corrected in 2010 specially for FASM |
32 | ; by Marat Zakiyanov aka Mario79, aka Mario |
32 | ; by Marat Zakiyanov aka Mario79, aka Mario |
33 | ; |
33 | ; |
34 | ; Uses LZMA compression library by Igor Pavlov |
34 | ; Uses LZMA compression library by Igor Pavlov |
35 | ; (for more information on LZMA and 7-Zip visit http://www.7-zip.org) |
35 | ; (for more information on LZMA and 7-Zip visit http://www.7-zip.org) |
36 | ; (plain-C packer and ASM unpacker are ported by diamond) |
36 | ; (plain-C packer and ASM unpacker are ported by diamond) |
37 | ;--------------------------------------------------------------------- |
37 | ;--------------------------------------------------------------------- |
38 | use32 |
38 | use32 |
39 | org 0 |
39 | org 0 |
40 | 40 | ||
41 | db 'MENUET01' |
41 | db 'MENUET01' |
42 | dd 1 |
42 | dd 1 |
43 | dd START |
43 | dd START |
44 | dd IM_END |
44 | dd IM_END |
45 | dd I_END |
45 | dd I_END |
46 | dd stacktop |
46 | dd stacktop |
47 | dd params |
47 | dd params |
48 | dd cur_dir_path |
48 | dd cur_dir_path |
49 | ;--------------------------------------------------------------------- |
49 | ;--------------------------------------------------------------------- |
50 | include '../../../config.inc' ;for nightbuild |
50 | include '../../../config.inc' ;for nightbuild |
51 | include '../../../macros.inc' |
51 | include '../../../macros.inc' |
52 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
52 | include '../../../develop/libraries/box_lib/trunk/box_lib.mac' |
53 | include '../../../develop/libraries/box_lib/load_lib.mac' |
53 | include '../../../develop/libraries/box_lib/load_lib.mac' |
54 | @use_library |
54 | @use_library |
55 | 55 | ||
56 | START: |
56 | START: |
57 | mcall 68,11 |
57 | mcall 68,11 |
58 | mcall 40,100111b |
58 | mcall 40,100111b |
59 | 59 | ||
60 | load_libraries l_libs_start,load_lib_end |
60 | load_libraries l_libs_start,load_lib_end |
61 | cmp eax,-1 |
61 | cmp eax,-1 |
62 | je exit |
62 | je exit |
- | 63 | ||
63 | 64 | init_checkboxes2 check1,check1_end |
|
64 | push check1 |
65 | ;push check1 |
65 | call [init_checkbox] |
66 | ;call [init_checkbox] |
66 | 67 | ||
67 | call clear_messages |
68 | call clear_messages |
68 | ; set default path = /RD/1/ |
69 | ; set default path = /RD/1/ |
69 | mov esi,defpath |
70 | mov esi,defpath |
70 | mov edi,path |
71 | mov edi,path |
71 | mov [edi-4],dword 6 |
72 | mov [edi-4],dword 6 |
72 | movsw |
73 | movsw |
73 | movsd |
74 | movsd |
74 | ; get system window info |
75 | ; get system window info |
75 | xor eax,eax |
76 | xor eax,eax |
76 | cmp [params],al |
77 | cmp [params],al |
77 | je default |
78 | je default |
78 | 79 | ||
79 | mov edi,path |
80 | mov edi,path |
80 | mov esi,params |
81 | mov esi,params |
81 | call copy_1 |
82 | call copy_1 |
82 | 83 | ||
83 | sub esi,2 |
84 | sub esi,2 |
84 | std |
85 | std |
85 | @@: |
86 | @@: |
86 | lodsb |
87 | lodsb |
87 | dec edi |
88 | dec edi |
88 | cmp al,byte '/' |
89 | cmp al,byte '/' |
89 | jnz @r |
90 | jnz @r |
90 | 91 | ||
91 | mov [edi-1],byte 0 |
92 | mov [edi-1],byte 0 |
92 | mov edi,inname |
93 | mov edi,inname |
93 | add esi,2 |
94 | add esi,2 |
94 | push esi |
95 | push esi |
95 | call copy_1 |
96 | call copy_1 |
96 | pop esi |
97 | pop esi |
97 | mov edi,outname |
98 | mov edi,outname |
98 | call copy_1 |
99 | call copy_1 |
99 | ;--------------------------------------------------------------------- |
100 | ;--------------------------------------------------------------------- |
100 | call set_editbox_position_all |
101 | call set_editbox_position_all |
101 | ;--------------------------------------------------------------------- |
102 | ;--------------------------------------------------------------------- |
102 | call draw_window |
103 | call draw_window |
103 | call pack |
104 | call pack |
104 | jmp OD_initialization |
105 | jmp OD_initialization |
105 | ;********************************************************************* |
106 | ;********************************************************************* |
106 | default: |
107 | default: |
107 | mov esi,definoutname |
108 | mov esi,definoutname |
108 | mov edi,esi |
109 | mov edi,esi |
109 | xor ecx,ecx |
110 | xor ecx,ecx |
110 | xor eax,eax |
111 | xor eax,eax |
111 | dec ecx |
112 | dec ecx |
112 | repnz scasb |
113 | repnz scasb |
113 | not ecx |
114 | not ecx |
114 | dec ecx |
115 | dec ecx |
115 | mov [innamelen],ecx |
116 | mov [innamelen],ecx |
116 | push ecx |
117 | push ecx |
117 | push esi |
118 | push esi |
118 | mov edi,inname |
119 | mov edi,inname |
119 | rep movsb |
120 | rep movsb |
120 | pop esi |
121 | pop esi |
121 | pop ecx |
122 | pop ecx |
122 | mov [outnamelen],ecx |
123 | mov [outnamelen],ecx |
123 | mov edi,outname |
124 | mov edi,outname |
124 | rep movsb |
125 | rep movsb |
125 | ;--------------------------------------------------------------------- |
126 | ;--------------------------------------------------------------------- |
126 | call set_editbox_position_all |
127 | call set_editbox_position_all |
127 | ;--------------------------------------------------------------------- |
128 | ;--------------------------------------------------------------------- |
128 | OD_initialization: |
129 | OD_initialization: |
129 | ;OpenDialog initialisation |
130 | ;OpenDialog initialisation |
130 | push dword OpenDialog_data |
131 | push dword OpenDialog_data |
131 | call [OpenDialog_Init] |
132 | call [OpenDialog_Init] |
132 | ;--------------------------------------------------------------------- |
133 | ;--------------------------------------------------------------------- |
133 | red: |
134 | red: |
134 | call draw_window |
135 | call draw_window |
135 | ;-------------------------------------- |
136 | ;-------------------------------------- |
136 | still: |
137 | still: |
137 | mcall 10 |
138 | mcall 10 |
138 | dec eax |
139 | dec eax |
139 | jz red |
140 | jz red |
140 | 141 | ||
141 | dec eax |
142 | dec eax |
142 | jz key |
143 | jz key |
143 | 144 | ||
144 | dec eax |
145 | dec eax |
145 | jz button |
146 | jz button |
146 | 147 | ||
147 | push dword edit1 |
148 | push dword edit1 |
148 | call [edit_box_mouse] |
149 | call [edit_box_mouse] |
149 | 150 | ||
150 | push dword edit2 |
151 | push dword edit2 |
151 | call [edit_box_mouse] |
152 | call [edit_box_mouse] |
152 | 153 | ||
153 | push dword edit3 |
154 | push dword edit3 |
154 | call [edit_box_mouse] |
155 | call [edit_box_mouse] |
155 | 156 | ||
156 | push dword check1 |
157 | push dword check1 |
157 | call [check_box_mouse] |
158 | call [check_box_mouse] |
158 | 159 | ||
159 | jmp still |
160 | jmp still |
160 | ;********************************************************************* |
161 | ;********************************************************************* |
161 | tell_compress_mess: |
162 | tell_compress_mess: |
162 | push compressing_len |
163 | push compressing_len |
163 | pop ecx |
164 | pop ecx |
164 | mov esi,compressing_str |
165 | mov esi,compressing_str |
165 | call write_string |
166 | call write_string |
166 | ret |
167 | ret |
167 | ;********************************************************************* |
168 | ;********************************************************************* |
168 | clear_mess_and_displogo: |
169 | clear_mess_and_displogo: |
169 | call refresh_editbox_data |
170 | call refresh_editbox_data |
170 | ; clear messages |
171 | ; clear messages |
171 | call clear_messages |
172 | call clear_messages |
172 | ; display logo |
173 | ; display logo |
173 | mov esi,info_str |
174 | mov esi,info_str |
174 | push info_len |
175 | push info_len |
175 | pop ecx |
176 | pop ecx |
176 | call write_string |
177 | call write_string |
177 | ret |
178 | ret |
178 | ;********************************************************************* |
179 | ;********************************************************************* |
179 | clear_messages: |
180 | clear_messages: |
180 | xor eax,eax |
181 | xor eax,eax |
181 | mov ecx,80*20/4+1 |
182 | mov ecx,80*20/4+1 |
182 | mov edi,message_mem |
183 | mov edi,message_mem |
183 | rep stosd |
184 | rep stosd |
184 | ret |
185 | ret |
185 | ;********************************************************************* |
186 | ;********************************************************************* |
186 | exit: |
187 | exit: |
187 | xor eax,eax |
188 | xor eax,eax |
188 | dec eax |
189 | dec eax |
189 | mcall |
190 | mcall |
190 | ;********************************************************************* |
191 | ;********************************************************************* |
191 | button: |
192 | button: |
192 | ; button pressed |
193 | ; button pressed |
193 | mcall 17 |
194 | mcall 17 |
194 | xchg al,ah |
195 | xchg al,ah |
195 | cmp al,7 |
196 | cmp al,7 |
196 | jz but7 |
197 | jz but7 |
197 | 198 | ||
198 | dec eax |
199 | dec eax |
199 | jz exit |
200 | jz exit |
200 | 201 | ||
201 | dec eax |
202 | dec eax |
202 | jnz nopack |
203 | jnz nopack |
203 | 204 | ||
204 | mov eax,[check1+32] |
- | |
205 | test eax,10b |
205 | bt dword[check1.flags],1 |
206 | jnz @f |
206 | jc @f |
207 | 207 | ||
208 | call pack |
208 | call pack |
209 | jmp still |
209 | jmp still |
210 | ;--------------------------------------------------------------------- |
210 | ;--------------------------------------------------------------------- |
211 | @@: |
211 | @@: |
212 | call kerpack |
212 | call kerpack |
213 | jmp still |
213 | jmp still |
214 | ;--------------------------------------------------------------------- |
214 | ;--------------------------------------------------------------------- |
215 | nopack: |
215 | nopack: |
216 | dec eax |
216 | dec eax |
217 | jnz nounpack |
217 | jnz nounpack |
218 | 218 | ||
219 | call unpack |
219 | call unpack |
220 | jmp still |
220 | jmp still |
221 | ;--------------------------------------------------------------------- |
221 | ;--------------------------------------------------------------------- |
222 | but7: |
222 | but7: |
223 | call clear_messages |
223 | call clear_messages |
224 | ; display logo |
224 | ; display logo |
225 | mov esi,info_str |
225 | mov esi,info_str |
226 | push info_len |
226 | push info_len |
227 | pop ecx |
227 | pop ecx |
228 | call write_string |
228 | call write_string |
229 | ; display info |
229 | ; display info |
230 | mov esi,usage_str |
230 | mov esi,usage_str |
231 | mov ecx,usage_len |
231 | mov ecx,usage_len |
232 | call write_string |
232 | call write_string |
233 | jmp still |
233 | jmp still |
234 | ;--------------------------------------------------------------------- |
234 | ;--------------------------------------------------------------------- |
235 | nounpack: |
235 | nounpack: |
236 | dec eax |
236 | dec eax |
237 | jnz still |
237 | jnz still |
238 | 238 | ||
239 | call OpenDialog_start |
239 | call OpenDialog_start |
240 | jmp still |
240 | jmp still |
241 | ;********************************************************************* |
241 | ;********************************************************************* |
242 | OpenDialog_start: |
242 | OpenDialog_start: |
243 | mov esi,path |
243 | mov esi,path |
244 | mov edi,temp_dir_pach |
244 | mov edi,temp_dir_pach |
245 | call copy_1 |
245 | call copy_1 |
246 | 246 | ||
247 | push dword OpenDialog_data |
247 | push dword OpenDialog_data |
248 | call [OpenDialog_Start] |
248 | call [OpenDialog_Start] |
249 | cmp [OpenDialog_data.status],1 |
249 | cmp [OpenDialog_data.status],1 |
250 | jne @f |
250 | jne @f |
251 | 251 | ||
252 | mov esi,filename_area |
252 | mov esi,filename_area |
253 | mov edi,inname |
253 | mov edi,inname |
254 | call copy_1 |
254 | call copy_1 |
255 | 255 | ||
256 | mov esi,filename_area |
256 | mov esi,filename_area |
257 | mov edi,outname |
257 | mov edi,outname |
258 | call copy_1 |
258 | call copy_1 |
259 | 259 | ||
260 | mov esi,temp_dir_pach |
260 | mov esi,temp_dir_pach |
261 | mov edi,path |
261 | mov edi,path |
262 | call copy_1 |
262 | call copy_1 |
263 | 263 | ||
264 | call refresh_editbox_data |
264 | call refresh_editbox_data |
265 | 265 | ||
266 | call set_editbox_position_all |
266 | call set_editbox_position_all |
267 | 267 | ||
268 | call draw_editbox |
268 | call draw_editbox |
269 | @@: |
269 | @@: |
270 | ret |
270 | ret |
271 | ;********************************************************************* |
271 | ;********************************************************************* |
272 | copy_1: |
272 | copy_1: |
273 | xor eax,eax |
273 | xor eax,eax |
274 | cld |
274 | cld |
275 | @@: |
275 | @@: |
276 | lodsb |
276 | lodsb |
277 | stosb |
277 | stosb |
278 | test eax,eax |
278 | test eax,eax |
279 | jnz @r |
279 | jnz @r |
280 | ret |
280 | ret |
281 | ;********************************************************************* |
281 | ;********************************************************************* |
282 | refresh_editbox_data: |
282 | refresh_editbox_data: |
283 | mov esi,inname |
283 | mov esi,inname |
284 | mov edi,innamelen |
284 | mov edi,innamelen |
285 | call refresh_data |
285 | call refresh_data |
286 | 286 | ||
287 | mov esi,outname |
287 | mov esi,outname |
288 | mov edi,outnamelen |
288 | mov edi,outnamelen |
289 | call refresh_data |
289 | call refresh_data |
290 | 290 | ||
291 | mov esi,path |
291 | mov esi,path |
292 | mov edi,pathlen |
292 | mov edi,pathlen |
293 | call refresh_data |
293 | call refresh_data |
294 | 294 | ||
295 | ret |
295 | ret |
296 | ;********************************************************************* |
296 | ;********************************************************************* |
297 | refresh_data: |
297 | refresh_data: |
298 | push esi |
298 | push esi |
299 | xor eax,eax |
299 | xor eax,eax |
300 | cld |
300 | cld |
301 | @@: |
301 | @@: |
302 | lodsb |
302 | lodsb |
303 | test eax,eax |
303 | test eax,eax |
304 | jnz @r |
304 | jnz @r |
305 | pop eax |
305 | pop eax |
306 | sub esi,eax |
306 | sub esi,eax |
307 | dec esi |
307 | dec esi |
308 | mov [edi],esi |
308 | mov [edi],esi |
309 | ret |
309 | ret |
310 | ;********************************************************************* |
310 | ;********************************************************************* |
311 | set_editbox_position_all: |
311 | set_editbox_position_all: |
312 | mov ebx,inname |
312 | mov ebx,inname |
313 | mov edi,edit1 |
313 | mov edi,edit1 |
314 | call set_editbox_position |
314 | call set_editbox_position |
315 | 315 | ||
316 | mov ebx,outname |
316 | mov ebx,outname |
317 | mov edi,edit2 |
317 | mov edi,edit2 |
318 | call set_editbox_position |
318 | call set_editbox_position |
319 | 319 | ||
320 | mov ebx,path |
320 | mov ebx,path |
321 | mov edi,edit3 |
321 | mov edi,edit3 |
322 | call set_editbox_position |
322 | call set_editbox_position |
323 | ret |
323 | ret |
324 | ;********************************************************************* |
324 | ;********************************************************************* |
325 | key: |
325 | key: |
326 | mcall 2 |
326 | mcall 2 |
327 | 327 | ||
328 | push dword edit1 |
328 | push dword edit1 |
329 | call [edit_box_key] |
329 | call [edit_box_key] |
330 | 330 | ||
331 | push dword edit2 |
331 | push dword edit2 |
332 | call [edit_box_key] |
332 | call [edit_box_key] |
333 | 333 | ||
334 | push dword edit3 |
334 | push dword edit3 |
335 | call [edit_box_key] |
335 | call [edit_box_key] |
336 | 336 | ||
337 | jmp still |
337 | jmp still |
338 | ;********************************************************************* |
338 | ;********************************************************************* |
339 | get_full_name: |
339 | get_full_name: |
340 | push esi |
340 | push esi |
341 | mov esi,path |
341 | mov esi,path |
342 | mov ecx,[esi-4] |
342 | mov ecx,[esi-4] |
343 | mov edi,fullname |
343 | mov edi,fullname |
344 | rep movsb |
344 | rep movsb |
345 | mov al,'/' |
345 | mov al,'/' |
346 | cmp [edi-1],al |
346 | cmp [edi-1],al |
347 | jz @f |
347 | jz @f |
348 | 348 | ||
349 | stosb |
349 | stosb |
350 | ;-------------------------------------- |
350 | ;-------------------------------------- |
351 | @@: |
351 | @@: |
352 | pop esi |
352 | pop esi |
353 | cmp [esi],al |
353 | cmp [esi],al |
354 | jnz @f |
354 | jnz @f |
355 | 355 | ||
356 | mov edi,fullname |
356 | mov edi,fullname |
357 | ;-------------------------------------- |
357 | ;-------------------------------------- |
358 | @@: |
358 | @@: |
359 | mov ecx,[esi-4] |
359 | mov ecx,[esi-4] |
360 | rep movsb |
360 | rep movsb |
361 | xor eax,eax |
361 | xor eax,eax |
362 | stosb |
362 | stosb |
363 | ret |
363 | ret |
364 | ;********************************************************************* |
364 | ;********************************************************************* |
365 | write_string: |
365 | write_string: |
366 | ; in: esi=pointer, ecx=length |
366 | ; in: esi=pointer, ecx=length |
367 | mov edx,[message_cur_pos] |
367 | mov edx,[message_cur_pos] |
368 | ;-------------------------------------- |
368 | ;-------------------------------------- |
369 | x1: |
369 | x1: |
370 | lea edi,[message_mem+edx] |
370 | lea edi,[message_mem+edx] |
371 | ;-------------------------------------- |
371 | ;-------------------------------------- |
372 | do_write_char: |
372 | do_write_char: |
373 | lodsb |
373 | lodsb |
374 | cmp al,10 |
374 | cmp al,10 |
375 | jz newline |
375 | jz newline |
376 | 376 | ||
377 | stosb |
377 | stosb |
378 | inc edx |
378 | inc edx |
379 | loop do_write_char |
379 | loop do_write_char |
380 | jmp x2 |
380 | jmp x2 |
381 | ;--------------------------------------------------------------------- |
381 | ;--------------------------------------------------------------------- |
382 | newline: |
382 | newline: |
383 | xor eax,eax |
383 | xor eax,eax |
384 | stosb |
384 | stosb |
385 | xchg eax,edx |
385 | xchg eax,edx |
386 | push ecx |
386 | push ecx |
387 | push eax |
387 | push eax |
388 | mov ecx,80 |
388 | mov ecx,80 |
389 | div ecx |
389 | div ecx |
390 | pop eax |
390 | pop eax |
391 | xchg eax,edx |
391 | xchg eax,edx |
392 | sub edx,eax |
392 | sub edx,eax |
393 | add edx,ecx |
393 | add edx,ecx |
394 | pop ecx |
394 | pop ecx |
395 | loop x1 |
395 | loop x1 |
396 | ;-------------------------------------- |
396 | ;-------------------------------------- |
397 | x2: |
397 | x2: |
398 | mov [message_cur_pos],edx |
398 | mov [message_cur_pos],edx |
399 | ; update window |
399 | ; update window |
400 | mcall 13,<6,414>,<54,222>,[color_table+20] |
400 | mcall 13,<6,414>,<54,222>,[color_table+20] |
401 | ;-------------------------------------- |
401 | ;-------------------------------------- |
402 | draw_messages: |
402 | draw_messages: |
403 | mov ebx,12 shl 16+60 |
403 | mov ebx,12 shl 16+60 |
404 | mov edi,message_mem |
404 | mov edi,message_mem |
405 | ;-------------------------------------- |
405 | ;-------------------------------------- |
406 | @@: |
406 | @@: |
407 | push edi |
407 | push edi |
408 | xor eax,eax |
408 | xor eax,eax |
409 | push 80 |
409 | push 80 |
410 | pop ecx |
410 | pop ecx |
411 | repnz scasb |
411 | repnz scasb |
412 | sub ecx,79 |
412 | sub ecx,79 |
413 | neg ecx |
413 | neg ecx |
414 | mov esi,ecx |
414 | mov esi,ecx |
415 | pop edi |
415 | pop edi |
416 | mcall 4,,[color_table+32],edi |
416 | mcall 4,,[color_table+32],edi |
417 | add ebx,10 |
417 | add ebx,10 |
418 | add edi,80 |
418 | add edi,80 |
419 | cmp edi,message_cur_pos |
419 | cmp edi,message_cur_pos |
420 | jb @b |
420 | jb @b |
421 | 421 | ||
422 | ret |
422 | ret |
423 | ;********************************************************************* |
423 | ;********************************************************************* |
424 | draw_window: |
424 | draw_window: |
425 | ; start redraw |
425 | ; start redraw |
426 | mcall 12,1 |
426 | mcall 12,1 |
427 | 427 | ||
428 | mcall 48,3,color_table,40 |
428 | mcall 48,3,color_table,40 |
429 | ;-------------------------------------- |
429 | ;-------------------------------------- |
430 | edit_boxes_set_sys_color edit1,editboxes_end,color_table |
430 | edit_boxes_set_sys_color edit1,editboxes_end,color_table |
431 | check_boxes_set_sys_color2 check1,check1_end,color_table |
431 | check_boxes_set_sys_color2 check1,check1_end,color_table |
432 | ;-------------------------------------- |
432 | ;-------------------------------------- |
433 | ; define window |
433 | ; define window |
434 | xor eax,eax |
434 | xor eax,eax |
435 | mov ecx,100 shl 16+306 |
435 | mov ecx,100 shl 16+306 |
436 | mov edx,[color_table+20] |
436 | mov edx,[color_table+20] |
437 | add edx,34000000h |
437 | add edx,34000000h |
438 | xor esi,esi |
438 | xor esi,esi |
439 | xor edi,edi |
439 | xor edi,edi |
440 | mcall ,<100,436>,,,,caption_str |
440 | mcall ,<100,436>,,,,caption_str |
441 | mcall 9,procinfo,-1 |
441 | mcall 9,procinfo,-1 |
442 | 442 | ||
443 | mov eax,[procinfo+70] ;status of window |
443 | mov eax,[procinfo+70] ;status of window |
444 | test eax,100b |
444 | test eax,100b |
445 | jne .end |
445 | jne .end |
446 | ;-------------------------------------- |
446 | ;-------------------------------------- |
447 | ; draw lines and frame |
447 | ; draw lines and frame |
448 | call draw_lines |
448 | call draw_lines |
449 | ; draw buttons |
449 | ; draw buttons |
450 | call draw_buttons |
450 | call draw_buttons |
451 | ; draw messages |
451 | ; draw messages |
452 | call draw_messages |
452 | call draw_messages |
453 | ; draw editbox's |
453 | ; draw editbox's |
454 | mov eax,[procinfo+42] |
454 | mov eax,[procinfo+42] |
455 | sub eax,65+72+10 |
455 | sub eax,65+72+10 |
456 | mov [edit1.width],eax |
456 | mov [edit1.width],eax |
457 | mov [edit2.width],eax |
457 | mov [edit2.width],eax |
458 | mov [edit3.width],eax |
458 | mov [edit3.width],eax |
459 | 459 | ||
460 | call draw_editbox |
460 | call draw_editbox |
461 | ; end redraw |
461 | ; end redraw |
462 | .end: |
462 | .end: |
463 | mcall 12,2 |
463 | mcall 12,2 |
464 | ret |
464 | ret |
465 | ;********************************************************************* |
465 | ;********************************************************************* |
466 | draw_editbox: |
466 | draw_editbox: |
467 | push dword edit1 |
467 | push dword edit1 |
468 | call [edit_box_draw] |
468 | call [edit_box_draw] |
469 | 469 | ||
470 | push dword edit2 |
470 | push dword edit2 |
471 | call [edit_box_draw] |
471 | call [edit_box_draw] |
472 | 472 | ||
473 | push dword edit3 |
473 | push dword edit3 |
474 | call [edit_box_draw] |
474 | call [edit_box_draw] |
475 | 475 | ||
476 | push dword check1 |
476 | push dword check1 |
477 | call [check_box_draw] |
477 | call [check_box_draw] |
478 | ret |
478 | ret |
479 | ;********************************************************************* |
479 | ;********************************************************************* |
480 | set_editbox_position: |
480 | set_editbox_position: |
481 | mov esi,ebx |
481 | mov esi,ebx |
482 | cld |
482 | cld |
483 | @@: |
483 | @@: |
484 | lodsb |
484 | lodsb |
485 | test al,al |
485 | test al,al |
486 | jne @r |
486 | jne @r |
487 | sub esi,ebx |
487 | sub esi,ebx |
488 | mov eax,esi |
488 | mov eax,esi |
489 | dec eax |
489 | dec eax |
490 | mov [edi+48], eax ;ed_size |
490 | mov [edi+48], eax ;ed_size |
491 | mov [edi+52], eax ;ed_pos |
491 | mov [edi+52], eax ;ed_pos |
492 | ret |
492 | ret |
493 | ;********************************************************************* |
493 | ;********************************************************************* |
494 | draw_lines: |
494 | draw_lines: |
495 | mov ecx,2 shl 16+12*3 |
495 | mov ecx,2 shl 16+12*3 |
496 | ; draw frame for messages data |
496 | ; draw frame for messages data |
497 | push ecx |
497 | push ecx |
498 | add ecx,50 shl 16+16 |
498 | add ecx,50 shl 16+16 |
499 | mcall 38,<3,423>,,[color_table+36] |
499 | mcall 38,<3,423>,,[color_table+36] |
500 | add ecx,224*(1 shl 16+1) |
500 | add ecx,224*(1 shl 16+1) |
501 | mcall |
501 | mcall |
502 | sub cx,224 |
502 | sub cx,224 |
503 | mcall ,<3,3> |
503 | mcall ,<3,3> |
504 | mcall ,<423,423> |
504 | mcall ,<423,423> |
505 | pop ecx |
505 | pop ecx |
506 | ret |
506 | ret |
507 | ;********************************************************************* |
507 | ;********************************************************************* |
508 | draw_buttons: |
508 | draw_buttons: |
509 | ; define compress button |
509 | ; define compress button |
510 | mov cx,18 |
510 | mov cx,18 |
511 | mcall 8,<351,72>,<1, 17>,2,[color_table+24] |
511 | mcall 8,<351,72>,<1, 17>,2,[color_table+24] |
512 | ; uncompress button |
512 | ; uncompress button |
513 | add ecx,18 shl 16 |
513 | add ecx,18 shl 16 |
514 | inc edx |
514 | inc edx |
515 | mcall |
515 | mcall |
516 | add ecx,-12h+0Ah+140000h |
516 | add ecx,-12h+0Ah+140000h |
517 | ; question button |
517 | ; question button |
518 | push esi |
518 | push esi |
519 | mov dl,7 |
519 | mov dl,7 |
520 | mcall ,<414,9> |
520 | mcall ,<414,9> |
521 | shr ecx,16 |
521 | shr ecx,16 |
522 | lea ebx,[ecx+1A10002h] |
522 | lea ebx,[ecx+1A10002h] |
523 | mcall 4,,[color_table+28],aQuestion,1 |
523 | mcall 4,,[color_table+28],aQuestion,1 |
524 | pop esi |
524 | pop esi |
525 | ; define settings buttons |
525 | ; define settings buttons |
526 | mov ecx,16*2+2 |
526 | mov ecx,16*2+2 |
527 | shl ecx,16 |
527 | shl ecx,16 |
528 | mov cx,13 |
528 | mov cx,13 |
529 | mcall 8,<6,50>,,4 |
529 | mcall 8,<6,50>,,4 |
530 | ; text on settings buttons |
530 | ; text on settings buttons |
531 | mov ebx,9 shl 16+5 |
531 | mov ebx,9 shl 16+5 |
532 | mov al,4 |
532 | mov al,4 |
533 | mov ecx,[color_table+32] |
533 | mov ecx,[color_table+32] |
534 | push buttons1names |
534 | push buttons1names |
535 | pop edx |
535 | pop edx |
536 | push 8 |
536 | push 8 |
537 | pop esi |
537 | pop esi |
538 | ;-------------------------------------- |
538 | ;-------------------------------------- |
539 | mcall |
539 | mcall |
540 | add edx,esi |
540 | add edx,esi |
541 | add ebx,16 |
541 | add ebx,16 |
542 | mcall |
542 | mcall |
543 | add edx,esi |
543 | add edx,esi |
544 | add ebx,16 |
544 | add ebx,16 |
545 | mov ecx,[color_table+28] |
545 | mov ecx,[color_table+28] |
546 | mcall |
546 | mcall |
547 | ; text on compress and decompress buttons |
547 | ; text on compress and decompress buttons |
548 | or ecx,80000000h |
548 | or ecx,80000000h |
549 | mcall ,<364,6>,,aCompress |
549 | mcall ,<364,6>,,aCompress |
550 | mcall ,<359,24>,,aDecompress |
550 | mcall ,<359,24>,,aDecompress |
551 | ret |
551 | ret |
552 | ;********************************************************************* |
552 | ;********************************************************************* |
553 | ;Pack procedures |
553 | ;Pack procedures |
554 | include 'packpoc.inc' |
554 | include 'packpoc.inc' |
555 | ;--------------------------------------------------------------------- |
555 | ;--------------------------------------------------------------------- |
556 | ;UnPack procedures |
556 | ;UnPack procedures |
557 | include 'upacproc.inc' |
557 | include 'upacproc.inc' |
558 | ;--------------------------------------------------------------------- |
558 | ;--------------------------------------------------------------------- |
559 | ;lzma_compress: |
559 | ;lzma_compress: |
560 | include 'lzma_compress.inc' |
560 | include 'lzma_compress.inc' |
561 | ;--------------------------------------------------------------------- |
561 | ;--------------------------------------------------------------------- |
562 | ;lzma_set_dict_size: |
562 | ;lzma_set_dict_size: |
563 | include 'lzma_set_dict_size.inc' |
563 | include 'lzma_set_dict_size.inc' |
564 | ;--------------------------------------------------------------------- |
564 | ;--------------------------------------------------------------------- |
565 | ;lzma_decompress: |
565 | ;lzma_decompress: |
566 | include 'lzma_decompress.inc' |
566 | include 'lzma_decompress.inc' |
567 | ;--------------------------------------------------------------------- |
567 | ;--------------------------------------------------------------------- |
568 | ;kerpack code: |
568 | ;kerpack code: |
569 | include 'kerpack.inc' |
569 | include 'kerpack.inc' |
570 | ;--------------------------------------------------------------------- |
570 | ;--------------------------------------------------------------------- |
571 | ;initialized variables and constants |
571 | ;initialized variables and constants |
572 | include 'const_var.inc' |
572 | include 'const_var.inc' |
573 | ;--------------------------------------------------------------------- |
573 | ;--------------------------------------------------------------------- |
574 | IM_END: |
574 | IM_END: |
575 | ;--------------------------------------------------------------------- |
575 | ;--------------------------------------------------------------------- |
576 | ;uninitialized data |
576 | ;uninitialized data |
577 | include 'data.inc' |
577 | include 'data.inc' |
578 | ;--------------------------------------------------------------------- |
578 | ;--------------------------------------------------------------------- |
579 | I_END: |
579 | I_END: |
580 | ;---------------------------------------------------------------------359,24>364,6>6,50>414,9>1,>351,72>423,423>3,3>3,423>100,436>54,222>6,414> |
580 | ;---------------------------------------------------------------------359,24>364,6>6,50>414,9>1,>351,72>423,423>3,3>3,423>100,436>54,222>6,414> |