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