Subversion Repositories Kolibri OS

Rev

Rev 2273 | Rev 3178 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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