Subversion Repositories Kolibri OS

Rev

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

Rev 1681 Rev 1686
Line 14... Line 14...
14
 
14
 
15
	db 'MENUET01'
15
	db 'MENUET01'
16
	dd 1
16
	dd 1
17
	dd START
17
	dd START
18
	dd IM_END
18
	dd IM_END
19
memf	dd I_END
19
	dd I_END		;memf
20
	dd stacktop
20
	dd stacktop
21
	dd params
21
	dd params
22
	dd 0		;cur_dir_path
22
	dd cur_dir_path
23
;---------------------------------------------------------------------
23
;---------------------------------------------------------------------
-
 
24
include '..\..\..\macros.inc'
-
 
25
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
-
 
26
include '../../../develop/libraries/box_lib/load_lib.mac'
Line 24... Line 27...
24
include '..\..\..\macros.inc'
27
  @use_library
-
 
28
 
-
 
29
START:
-
 
30
	mcall	68,11
25
 
31
	mcall	40,100111b
26
START:
32
 
27
	call	clear_messages
33
	call	clear_messages
28
; set default path = /RD/1/
34
; set default path = /RD/1/
29
	mov	esi,defpath
35
	mov	esi,defpath
Line 34... Line 40...
34
; get system window info
40
; get system window info
35
	mcall	48,3,color_table,40
41
	mcall	48,3,color_table,40
36
	inc	ebx
42
	inc	ebx
37
	mcall
43
	mcall
38
	mov	[skinheight],eax
44
	mov	[skinheight],eax
-
 
45
	jmp	default
39
; check command line
46
; check command line
40
	mov	esi,params
47
	mov	esi,params
41
	mov	[esi+100h],byte 0
48
	mov	[esi+100h],byte 0
42
;--------------------------------------
49
;--------------------------------------
43
parse_opt:
50
parse_opt:
Line 56... Line 63...
56
	jnz	default
63
	jnz	default
57
;--------------------------------------
64
;--------------------------------------
58
doit:
65
doit:
59
	call	draw_window
66
	call	draw_window
60
	call	pack
67
	call	pack
61
	jmp	waitevent
68
	jmp	still
62
;---------------------------------------------------------------------
69
;---------------------------------------------------------------------
63
clear_messages:
70
clear_messages:
64
	xor	eax,eax
71
	xor	eax,eax
65
	mov	ecx,80*20/4+1
72
	mov	ecx,80*20/4+1
66
	mov	edi,message_mem
73
	mov	edi,message_mem
Line 71... Line 78...
71
	xor	eax,eax
78
	xor	eax,eax
72
	dec	eax
79
	dec	eax
73
	mcall
80
	mcall
74
;--------------------------------------
81
;--------------------------------------
75
outeqin:
82
outeqin:
76
	mov	ecx,48/4+1
83
	mov	ecx,256/4+1
77
	mov	esi,inname-4
84
	mov	esi,inname-4
78
	mov	edi,outname-4
85
	mov	edi,outname-4
79
	rep	movsd
86
	rep	movsd
80
	jmp	doit
87
	jmp	doit
81
;---------------------------------------------------------------------
88
;---------------------------------------------------------------------
82
default:
89
default:
-
 
90
 
83
	mov	[curedit],inname
91
load_libraries l_libs_start,load_lib_end
84
	mov	ecx,[skinheight]
-
 
85
	add	ecx,5
92
	cmp eax,-1
86
	mov	[curedit_y],ecx
93
	je exit
-
 
94
 
87
	mov	esi,definoutname
95
	mov	esi,definoutname
88
	mov	edi,esi
96
	mov	edi,esi
89
	xor	ecx,ecx
97
	xor	ecx,ecx
90
	xor	eax,eax
98
	xor	eax,eax
91
	dec	ecx
99
	dec	ecx
Line 101... Line 109...
101
	pop	ecx
109
	pop	ecx
102
	mov	[outnamelen],ecx
110
	mov	[outnamelen],ecx
103
	mov	edi,outname
111
	mov	edi,outname
104
	rep	movsb
112
	rep	movsb
105
;---------------------------------------------------------------------
113
;---------------------------------------------------------------------
-
 
114
;	mov	edi,fname_buf
-
 
115
;	mov	esi,path4
-
 
116
;	call	copy_1
-
 
117
	
-
 
118
;OpenDialog	initialisation
-
 
119
	push    dword OpenDialog_data
-
 
120
	call    [OpenDialog_Init]
-
 
121
;---------------------------------------------------------------------
-
 
122
	call	set_editbox_position_all
-
 
123
;---------------------------------------------------------------------
106
dodraw:
124
red:
107
	call	draw_window
125
	call	draw_window
108
;--------------------------------------
126
;--------------------------------------
109
waitevent:
127
still:
110
	mcall	10
128
	mcall	10
111
	dec	eax
129
	dec	eax
112
	jz	dodraw
130
	jz	red
Line 113... Line 131...
113
 
131
 
114
	dec	eax
132
	dec	eax
Line 115... Line 133...
115
	jz	keypressed
133
	jz	key
116
 
134
 
-
 
135
	dec	eax
-
 
136
	jz	button
-
 
137
 
-
 
138
	push	dword edit1
-
 
139
	call	[edit_box_mouse]
-
 
140
 
-
 
141
	push	dword edit2
-
 
142
	call	[edit_box_mouse]
-
 
143
 
-
 
144
	push	dword edit3
-
 
145
	call	[edit_box_mouse]
-
 
146
 
-
 
147
	jmp	still
117
	dec	eax
148
;*********************************************************************
118
	jnz	waitevent
149
button:
119
; button pressed
150
; button pressed
120
	mcall	17
151
	mcall	17
121
	xchg	al,ah
152
	xchg	al,ah
Line 127... Line 158...
127
 
158
 
128
	dec	eax
159
	dec	eax
Line 129... Line 160...
129
	jnz	nopack
160
	jnz	nopack
130
 
161
 
131
	call	pack
162
	call	pack
132
	jmp	waitevent
163
	jmp	still
133
;---------------------------------------------------------------------
164
;---------------------------------------------------------------------
134
nopack:
165
nopack:
Line 135... Line 166...
135
	dec	eax
166
	dec	eax
136
	jnz	nounpack
167
	jnz	nounpack
137
 
168
 
138
	call	unpack
169
	call	unpack
139
	jmp	waitevent
170
	jmp	still
140
;---------------------------------------------------------------------
171
;---------------------------------------------------------------------
141
but7:
172
but7:
Line 147... Line 178...
147
	call	write_string
178
	call	write_string
148
; display info
179
; display info
149
	mov	esi,usage_str
180
	mov	esi,usage_str
150
	mov	ecx,usage_len
181
	mov	ecx,usage_len
151
	call	write_string
182
	call	write_string
152
	jmp	waitevent
183
	jmp	still
153
;---------------------------------------------------------------------
184
;---------------------------------------------------------------------
154
nounpack:
185
nounpack:
155
; this is infile/outfile/path button
-
 
156
	call	clear_edit_points
-
 
157
	mov	esi,inname
-
 
158
	mov	ecx,[skinheight]
-
 
159
	add	ecx,5
-
 
160
	dec	eax
-
 
161
	jz	edit
-
 
162
 
-
 
163
	mov	esi,outname
-
 
164
	add	ecx,0Ch
-
 
165
	dec	eax
-
 
166
	jz	edit
-
 
167
 
-
 
168
	mov	esi,path
-
 
169
	add	ecx,0Ch
-
 
170
;--------------------------------------
-
 
171
edit:
-
 
172
	cmp	esi,[curedit]
-
 
173
	mov	[curedit],0
-
 
174
	jz	waitevent
-
 
175
 
-
 
176
	mov	[curedit],esi
-
 
177
	mov	[curedit_y],ecx
-
 
178
	mov	al,1
-
 
179
	mov	ebx,[esi-4]
-
 
180
	mov	edi,ebx
-
 
181
	imul	ebx,6
-
 
182
	add	ebx,42h
-
 
183
	add	ecx,4
-
 
184
	xor	edx,edx
-
 
185
;--------------------------------------
-
 
186
@@:
-
 
187
	cmp	edi,48
-
 
188
	jz	waitevent
-
 
189
 
-
 
190
	mcall
-
 
191
	add	ebx,6
-
 
192
	inc	edi
-
 
193
	jmp	@b
-
 
194
;---------------------------------------------------------------------
-
 
195
keypressed:
-
 
196
	mcall	2
-
 
197
	xchg	al,ah
-
 
198
	mov	edi,[curedit]
-
 
199
	test	edi,edi
-
 
200
	jz	waitevent
-
 
201
 
-
 
202
	mov	ebx,[edi-4]
-
 
203
	cmp	al,8
-
 
204
	jz	backspace
-
 
205
 
-
 
206
	cmp	al,13
-
 
207
	jz	onenter
-
 
208
 
-
 
209
	cmp	al,20h
-
 
210
	jb	waitevent
-
 
211
 
-
 
212
	cmp	ebx,48
-
 
213
	jz	waitevent
-
 
214
 
-
 
215
	mov	[edi+ebx],al
-
 
216
	inc	ebx
-
 
217
	mov	[edi-4],ebx
-
 
218
; clear point and draw symbol
-
 
219
	lea	edi,[edi+ebx-1]
-
 
220
	imul	ebx,6
-
 
221
	add	ebx,40h-6
-
 
222
	shl	ebx,16
-
 
223
	mov	bl,6
-
 
224
	mov	ecx,[curedit_y]
-
 
225
	push	ecx
-
 
226
	shl	ecx,16
-
 
227
	mov	cl,9
-
 
228
	mcall	13,,,[color_table+20]
-
 
229
	pop	ecx
-
 
230
	mov	bx,cx
-
 
231
	mcall	4,,[color_table+32],edi,1
-
 
232
	jmp	waitevent
-
 
233
;---------------------------------------------------------------------
-
 
234
backspace:
-
 
235
	test	ebx,ebx
-
 
236
	jz	waitevent
-
 
237
 
-
 
238
	dec	ebx
-
 
239
	mov	[edi-4],ebx
-
 
240
; clear symbol and set point
-
 
241
	imul	ebx,6
-
 
242
	add	ebx,40h
-
 
243
	shl	ebx,16
-
 
244
	mov	bl,6
-
 
245
	mov	ecx,[curedit_y]
-
 
246
	push	ecx
-
 
247
	shl	ecx,16
-
 
248
	mov	cl,9
-
 
249
	mcall	13,,,[color_table+20]
-
 
250
	xor	edx,edx
-
 
251
	shr	ebx,16
-
 
252
	inc	ebx
-
 
253
	inc	ebx
-
 
254
	pop	ecx
-
 
255
	add	ecx,4
-
 
256
	mcall	1
-
 
257
	jmp	waitevent
-
 
258
;---------------------------------------------------------------------
-
 
259
onenter:
-
 
260
	cmp	[curedit],inname
-
 
261
	jnz	@f
-
 
262
 
-
 
263
	push	2
-
 
264
	pop	eax
-
 
265
	jmp	nounpack
-
 
266
;---------------------------------------------------------------------
-
 
267
@@:
-
 
268
	cmp	[curedit],outname
-
 
269
	jnz	@f
-
 
270
 
-
 
271
	call	pack
-
 
272
	jmp	waitevent
-
 
273
;---------------------------------------------------------------------
-
 
274
@@:
-
 
275
	call	clear_edit_points
-
 
276
	jmp	waitevent
-
 
277
;---------------------------------------------------------------------
-
 
278
pack:
-
 
279
	call	clear_edit_points
-
 
280
	and	[curedit],0
-
 
281
; clear messages
-
 
282
	call	clear_messages
-
 
283
; display logo
-
 
284
	mov	esi,info_str
-
 
285
	push	info_len
-
 
286
	pop	ecx
-
 
287
	call	write_string
-
 
288
; load input file
-
 
289
	mov	esi,inname
-
 
290
	call	get_full_name
-
 
291
	mov	ebx,fn70block
-
 
292
	mov	[ebx],dword 5
-
 
293
	and	[ebx+4],dword 0
-
 
294
	and	[ebx+8],dword 0
-
 
295
	and     [ebx+12],dword 0
-
 
296
	mov	[ebx+16],dword  file_attr
-
 
297
	mcall	70
-
 
298
	test	eax,eax
-
 
299
	jz	inopened
-
 
300
;---------------------------------------------------------------------
-
 
301
infileerr:
-
 
302
	mov	esi,errload_str
-
 
303
	push	errload_len
-
 
304
	pop	ecx
-
 
305
	jmp	write_string
-
 
306
;---------------------------------------------------------------------
-
 
307
inopened:
-
 
308
        mov     ebx,[insize]
-
 
309
        test    ebx,ebx
-
 
310
        jz      infileerr
-
 
311
; maximum memory requests: 2*insize + 2*(maxoutsize+400h) + worksize
-
 
312
	mov	esi,[memf]
-
 
313
	mov	[infile],esi
-
 
314
	add	esi,ebx
-
 
315
	mov	[inbuftmp],esi
-
 
316
	add	esi,ebx
-
 
317
	mov	[outfile],esi
-
 
318
	mov	[outfile1],esi
-
 
319
	mov	[outfilebest],esi
-
 
320
	mov	ecx,ebx
-
 
321
	shr	ecx,3
-
 
322
	add	ecx,ebx
-
 
323
	add	ecx,400h
-
 
324
	add	esi,ecx
-
 
325
	mov	[outfile2],esi
-
 
326
	add	esi,ecx
-
 
327
	mov	[workmem],esi
-
 
328
	add	ecx,ebx
-
 
329
	add	ecx,ecx
-
 
330
	add	ecx,[memf]
-
 
331
; LZMA requires 0x448000 + dictsize*9.5 bytes for workmem,
-
 
332
	and	[lzma_dictsize],0
-
 
333
	push	ecx
-
 
334
	mov	eax,ebx
-
 
335
	dec	eax
186
	dec	eax
336
	bsr	ecx,eax
-
 
337
	inc	ecx
-
 
338
	cmp	ecx,28
-
 
339
	jb	@f
-
 
340
 
-
 
341
	mov	cl,28
-
 
342
;--------------------------------------
-
 
343
@@:
-
 
344
	mov	edx,ecx
-
 
345
	xor	eax,eax
-
 
346
	inc	eax
-
 
347
	shl	eax,cl
-
 
348
	imul	eax,19
-
 
349
	shr	eax,1
-
 
350
	add	eax,448000h
-
 
351
	pop	ecx
-
 
352
	add	ecx,eax
-
 
353
	mcall	64,1
-
 
354
	test	eax,eax
-
 
355
	jz	mem_ok
-
 
356
;--------------------------------------
-
 
357
; try to use smaller dictionary
-
 
358
meml0:
-
 
359
	cmp	edx,4
-
 
360
	jbe	memf1
-
 
361
 
-
 
362
	dec	edx
-
 
363
	xor	eax,eax
-
 
364
	inc	eax
-
 
365
	mov	ecx,edx
-
 
366
	shl	eax,cl
-
 
367
	imul	eax,19
-
 
368
	shr	eax,1
-
 
369
	add	eax,509000h
-
 
370
	pop	ecx
-
 
371
	push	ecx
-
 
372
	add	ecx,eax
-
 
373
	mcall	64
-
 
374
	test	eax,eax
-
 
375
	jnz	meml0
187
	jnz	still
376
;--------------------------------------
-
 
377
; ok, say warning and continue
-
 
378
	mov	[lzma_dictsize],edx
-
 
379
	mov	esi,lzma_memsmall_str
-
 
380
	push	lzma_memsmall_len
-
 
381
	pop	ecx
-
 
382
	call	write_string
-
 
383
	jmp	mem_ok
-
 
384
;---------------------------------------------------------------------
-
 
385
memf1:
-
 
386
	mov	esi,nomem_str
-
 
387
	push	nomem_len
-
 
388
	pop	ecx
-
 
389
	jmp	write_string
-
 
390
;---------------------------------------------------------------------
-
 
391
mem_ok:
-
 
392
	mov	eax,[insize]
-
 
393
	mov	ebx,fn70block
-
 
394
	mov	[ebx],byte 0
-
 
395
	mov	[ebx+12],eax
-
 
396
	mov	esi,[infile]
-
 
397
	mov	[ebx+16],esi
-
 
398
	mcall	70
-
 
399
	test	eax,eax
-
 
400
	jnz	infileerr
-
 
Line 401... Line 188...
401
 
188
 
402
	mov	eax,[outfile]
-
 
403
	mov	[eax],dword 'KPCK'	;'KCPK'
-
 
404
	mov     ecx,[insize]
-
 
405
	mov	[eax+4],dword ecx
189
	call	OpenDialog_start
406
	mov	edi,eax
190
	jmp	still
407
; set LZMA dictionary size
-
 
408
	mov	eax,[lzma_dictsize]
191
;*********************************************************************
409
	test	eax,eax
192
OpenDialog_start:
410
	js	no_lzma_setds
193
	push    dword OpenDialog_data
411
	jnz	lzma_setds
-
 
412
 
194
	call    [OpenDialog_Start]
413
	mov	ecx,[insize]
-
 
414
	dec	ecx
-
 
415
	bsr	eax,ecx
195
	cmp	[OpenDialog_data.status],1
416
	inc	eax
-
 
417
	cmp	eax,28
-
 
Line 418... Line -...
418
	jb	lzma_setds
-
 
419
 
-
 
420
	mov	eax,28
-
 
421
;--------------------------------------
-
 
422
lzma_setds:
-
 
423
	push	eax
-
 
424
	call	lzma_set_dict_size
-
 
425
;--------------------------------------
-
 
426
no_lzma_setds:
-
 
427
	push	compressing_len
-
 
428
	pop	ecx
-
 
429
	mov	esi,compressing_str
-
 
430
	call	write_string
-
 
431
	mov	esi,[outfile1]
-
 
432
	mov     edi,[outfile2]
-
 
433
	movsd
-
 
434
	movsd
-
 
435
	movsd
-
 
436
	call	pack_lzma
-
 
437
	mov	[outsize],eax
-
 
438
	mov	eax,[outfile]
-
 
439
	mov	[outfilebest],eax
-
 
440
	mov	[method],use_lzma
-
 
441
;--------------------------------------
-
 
442
@@:
-
 
443
	call	preprocess_calltrick
-
 
444
	test	eax,eax
-
 
445
	jz	noct1
-
 
446
 
-
 
447
	call	set_outfile
-
 
448
	call	pack_lzma
-
 
449
	add	eax,5
-
 
450
	cmp	eax,[outsize]
-
 
451
	jae	@f
-
 
452
 
-
 
453
	mov	[outsize],eax
-
 
454
	mov	eax,[outfile]
-
 
455
	mov	[outfilebest],eax
-
 
456
	mov	[method],use_lzma or use_calltrick1
-
 
457
;--------------------------------------
-
 
458
@@:
-
 
459
noct1:
-
 
460
	call	set_outfile
-
 
461
	push	[ctn]
-
 
462
	mov	al,[cti]
-
 
463
	push	eax
-
 
464
	call	preprocess_calltrick2
-
 
465
	test	eax,eax
-
 
466
	jz	noct2
-
 
467
 
-
 
468
	call	set_outfile
-
 
469
	call	pack_lzma
-
 
470
	add	eax,5
-
 
471
	cmp	eax,[outsize]
-
 
472
	jae	@f
-
 
473
 
-
 
474
	mov	[outsize],eax
-
 
475
	mov	eax,[outfile]
-
 
476
	mov	[outfilebest],eax
-
 
477
	mov	[method],use_lzma or use_calltrick2
-
 
478
	pop	ecx
-
 
479
	pop	ecx
-
 
480
	push	[ctn]
-
 
481
	mov	al,[cti]
-
 
482
	push	eax
-
 
483
;--------------------------------------
-
 
484
@@:
-
 
485
noct2:
-
 
486
	pop	eax
-
 
487
	mov	[cti],al
-
 
488
	pop	[ctn]
-
 
489
	add     [outsize],12
-
 
490
	mov	eax,[outsize]
-
 
491
	cmp	eax,[insize]
-
 
492
	jb	packed_ok
-
 
493
 
-
 
494
	mov	esi,too_big_str
-
 
495
	push	too_big_len
-
 
496
	pop	ecx
-
 
497
	jmp	write_string
-
 
498
;---------------------------------------------------------------------
-
 
499
packed_ok:
-
 
500
; set header
-
 
501
        movzx	eax,[method]
-
 
502
	mov	edi,[outfilebest]
-
 
503
	mov     [edi+8],eax
-
 
504
	test	al,use_calltrick1 or use_calltrick2
-
 
505
	jz	@f
-
 
506
 
-
 
507
	mov	ecx,[outsize]
-
 
508
	add	ecx,edi
-
 
509
	mov	eax,[ctn]
-
 
510
	mov     [ecx-5],eax
-
 
511
	mov	al,[cti]
-
 
512
	mov     [ecx-1],al
-
 
513
;--------------------------------------
-
 
514
@@:
-
 
515
	mov	eax,[outsize]
-
 
516
	mov	ecx,100
-
 
517
	mul	ecx
-
 
518
	div	[insize]
-
 
519
	aam
-
 
520
	xchg	al,ah
-
 
521
	add	ax,'00'
196
	jne	@f
522
	mov	[ratio],ax
-
 
523
	mov	esi,done_str
-
 
524
	push	done_len
-
 
525
	pop	ecx
-
 
526
	call	write_string
-
 
527
;--------------------------------------
-
 
528
; save output file
197
 
529
saveout:
-
 
530
	mov	esi,outname
-
 
531
	call	get_full_name
-
 
532
	mov	ebx,fn70block
-
 
533
	mov	[ebx],byte 2
-
 
534
	mov	eax,[outfilebest]
-
 
535
	mov	ecx,[outsize]
-
 
536
	mov	[ebx+12],ecx
198
	mov	esi,filename_area
537
	mov	[ebx+16],eax
-
 
538
	mcall	70
-
 
539
	test	eax,eax
-
 
540
	jz	@f
-
 
541
;--------------------------------------
-
 
542
outerr:
-
 
543
	mov	esi,outfileerr_str
-
 
544
	push	outfileerr_len
-
 
545
	pop	ecx
-
 
546
	jmp	write_string
-
 
547
;---------------------------------------------------------------------
199
	mov	edi,inname
548
@@:
-
 
549
	xor	eax,eax
-
 
550
	mov	ebx,fn70block
-
 
551
	mov	[ebx],byte 6
-
 
552
	mov	[ebx+4],eax
-
 
553
	mov	[ebx+8],eax
-
 
554
	mov	[ebx+12],eax
-
 
555
	mov	[ebx+16],dword file_attr
-
 
556
	mcall	70
-
 
557
	ret
-
 
558
;---------------------------------------------------------------------
-
 
559
set_outfile:
-
 
560
	mov	eax,[outfilebest]
-
 
561
	xor	eax,[outfile1]
200
	call	copy_1
562
	xor	eax,[outfile2]
-
 
563
	mov	[outfile],eax
-
 
564
	ret
-
 
565
;---------------------------------------------------------------------
-
 
566
pack_calltrick_fail:
-
 
567
	xor	eax,eax
-
 
568
	mov	[ctn],0
-
 
569
	ret
-
 
570
;---------------------------------------------------------------------
-
 
571
preprocess_calltrick:
-
 
572
; input preprocessing
-
 
573
	xor	eax,eax
-
 
574
	mov	edi,ct1
-
 
575
	mov	ecx,256/4
-
 
576
	push	edi
-
 
577
	rep	stosd
-
 
578
	pop	edi
-
 
579
	mov	ecx,[insize]
-
 
580
	mov	esi,[infile]
-
 
581
	xchg	eax,edx
-
 
582
	mov	ebx,[inbuftmp]
-
 
583
;--------------------------------------
-
 
584
input_pre:
-
 
585
	lodsb
-
 
586
	sub	al,0E8h
-
 
587
	cmp	al,1
-
 
588
	ja	input_pre_cont
-
 
589
 
-
 
590
	cmp	ecx,5
-
 
591
	jb	input_pre_done
-
 
592
 
-
 
593
	lodsd
-
 
594
	add	eax,esi
-
 
595
	sub	eax,[infile]
-
 
Line -... Line 201...
-
 
201
	sub	edi,inname
596
	cmp	eax,[insize]
202
	mov	[innamelen],edi
597
	jae	xxx
203
 
-
 
204
	mov	esi,filename_area
-
 
205
	mov	edi,outname
Line 598... Line -...
598
 
-
 
599
	cmp	eax,1000000h
-
 
600
	jae	xxx
-
 
601
 
-
 
602
	sub	ecx,4
-
 
603
; bswap is not supported on i386
206
	call	copy_1
604
	xchg	al,ah
-
 
605
	ror	eax,16
207
	sub	edi,outname
606
	xchg	al,ah
208
	mov	[outnamelen],edi
607
	mov	[esi-4],eax
-
 
608
	inc	edx
-
 
609
	mov	[ebx],esi
-
 
610
	add	ebx,4
209
	
611
	jmp	input_pre_cont
-
 
612
;---------------------------------------------------------------------
-
 
613
xxx:
-
 
614
	sub	esi,4
-
 
615
	movzx	eax,byte [esi]
-
 
616
	mov	[eax+edi],byte 1
-
 
617
;--------------------------------------
210
	mov	esi,temp_dir_pach
618
input_pre_cont:
211
	mov	edi,path
619
	loop	input_pre
-
 
620
;--------------------------------------
-
 
621
input_pre_done:
-
 
622
	mov	[ctn],edx
-
 
Line 623... Line -...
623
	xor	eax,eax
-
 
624
	mov	ecx,256
-
 
625
	repnz	scasb
-
 
626
	jnz	pack_calltrick_fail
212
	call	copy_1
627
 
-
 
Line 628... Line -...
628
	not	cl
-
 
629
	mov	[cti],cl
213
	sub	edi,path
630
@@:
-
 
631
	cmp	ebx,[inbuftmp]
-
 
632
	jz	@f
-
 
633
 
214
	dec	edi
634
	sub	ebx,4
-
 
635
	mov	eax,[ebx]
-
 
636
	mov	[eax-4],cl
-
 
637
	jmp	@b
-
 
638
;---------------------------------------------------------------------
-
 
639
@@:
-
 
640
	mov	al,1
-
 
641
	ret
-
 
642
;---------------------------------------------------------------------
-
 
643
pack_lzma:
-
 
644
	mov	eax,[outfile]
-
 
645
	add	eax,11
-
 
646
	push	[workmem]	;workmem
-
 
647
	push    [insize]	;length
-
 
648
	push	eax		;destination
-
 
649
	push	[infile]	;source
-
 
650
	call	lzma_compress
-
 
651
	mov	ecx,[outfile]
-
 
652
	mov	edx,[ecx+12]
215
	mov	[pathlen],edi
653
	xchg	dl,dh
216
	
654
	ror	edx,16
-
 
655
	xchg	dl,dh
-
 
656
	mov     [ecx+12],edx
-
 
657
	dec     eax
-
 
658
	ret
-
 
659
;---------------------------------------------------------------------
-
 
660
preprocess_calltrick2:
217
	call	set_editbox_position_all
661
; restore input
-
 
662
	mov	esi,[infile]
-
 
663
	mov	ecx,[ctn]
-
 
664
	jecxz	pc2l2
-
 
665
;--------------------------------------
-
 
666
pc2l1:
-
 
667
	lodsb
-
 
668
	sub	al,0E8h
-
 
669
	cmp	al,1
-
 
670
	ja	pc2l1
-
 
671
 
-
 
672
	mov	al,[cti]
-
 
673
	cmp	[esi],al
-
 
674
	jnz	pc2l1
-
 
675
 
-
 
676
	lodsd
-
 
677
	shr	ax,8
-
 
678
	ror	eax,16
-
 
679
	xchg	al,ah
-
 
680
	sub	eax,esi
-
 
681
	add	eax,[infile]
-
 
682
	mov	[esi-4],eax
218
 
683
	loop	pc2l1
-
 
684
;--------------------------------------
-
 
685
pc2l2:
-
 
686
; input preprocessing
-
 
687
	mov	edi,ct1
-
 
688
	xor	eax,eax
-
 
689
	push	edi
-
 
690
	mov	ecx,256/4
-
 
691
	rep	stosd
-
 
692
	pop	edi
-
 
693
	mov	ecx,[insize]
219
	call	draw_editbox
694
	mov	esi,[infile]
-
 
695
	mov	ebx,[inbuftmp]
220
@@:
696
	xchg	eax,edx
-
 
697
;--------------------------------------
-
 
698
input_pre2:
-
 
699
	lodsb
-
 
700
;--------------------------------------
-
 
701
@@:
-
 
702
	cmp	al,0Fh
221
	ret
703
	jnz	ip1
-
 
704
 
222
;*********************************************************************
705
	dec	ecx
-
 
706
	jz	input_pre_done2
-
 
707
 
-
 
708
	lodsb
-
 
709
	cmp	al,80h
-
 
710
	jb	@b
-
 
711
 
-
 
712
	cmp	al,90h
-
 
713
	jb	@f
-
 
714
;--------------------------------------
-
 
715
ip1:
-
 
716
	sub	al,0E8h
-
 
717
	cmp	al,1
-
 
718
	ja	input_pre_cont2
-
 
719
;--------------------------------------
-
 
720
@@:
-
 
721
	cmp	ecx,5
-
 
722
	jb	input_pre_done2
-
 
723
 
-
 
724
	lodsd
-
 
725
	add	eax,esi
-
 
726
	sub	eax,[infile]
-
 
727
	cmp	eax,[insize]
-
 
728
	jae	xxx2
-
 
729
 
-
 
730
	cmp	eax,1000000h
-
 
731
	jae	xxx2
-
 
732
 
-
 
733
	sub	ecx,4
-
 
734
	xchg	al,ah
-
 
735
	rol	eax,16
-
 
736
	xchg	al,ah
-
 
737
	mov	[esi-4],eax
-
 
738
	inc	edx
-
 
739
	mov	[ebx],esi
-
 
740
	add	ebx,4
-
 
741
	jmp	input_pre_cont2
-
 
742
;---------------------------------------------------------------------
-
 
743
xxx2:	sub	esi,4
-
 
744
	movzx	eax,byte [esi]
-
 
745
	mov	[eax+edi],byte 1
-
 
746
;--------------------------------------
-
 
747
input_pre_cont2:
-
 
748
	loop	input_pre2
-
 
749
;--------------------------------------
-
 
750
input_pre_done2:
-
 
751
	mov	[ctn],edx
-
 
752
	xor	eax,eax
-
 
753
	mov	ecx,256
-
 
754
	repnz	scasb
-
 
755
	jnz	pack_calltrick_fail
-
 
756
 
-
 
757
	not	cl
-
 
758
	mov	[cti],cl
-
 
759
;--------------------------------------
-
 
760
@@:
-
 
761
	cmp	ebx,[inbuftmp]
-
 
762
	jz	@f
-
 
763
 
-
 
764
	sub	ebx,4
-
 
765
	mov	eax,[ebx]
-
 
766
	mov	[eax-4],cl
-
 
767
	jmp	@b
-
 
768
;---------------------------------------------------------------------
-
 
769
@@:
-
 
770
	mov	al,1
-
 
771
	ret
-
 
772
;---------------------------------------------------------------------
-
 
773
unpack:
-
 
774
	call	clear_edit_points
-
 
775
	and	[curedit],0
-
 
776
; clear messages
-
 
777
	call	clear_messages
-
 
778
; display logo
-
 
779
	mov	esi,info_str
-
 
780
	push	info_len
-
 
781
	pop	ecx
-
 
782
	call	write_string
-
 
783
; load input file
-
 
784
	mov	esi,inname
-
 
785
	call	get_full_name
-
 
786
	mov	ebx,fn70block
-
 
787
	mov	[ebx],dword 5
223
copy_1:
788
	and	[ebx+4],dword 0
224
	xor	eax,eax
-
 
225
	cld	
-
 
226
@@:
-
 
227
	lodsb
-
 
228
	stosb
-
 
229
	test	eax,eax
-
 
230
	jnz	@r
-
 
231
	ret
-
 
232
;*********************************************************************
-
 
233
set_editbox_position_all:
-
 
234
	mov	ebx,inname
-
 
235
	mov	edi,edit1
-
 
236
	call	set_editbox_position
-
 
237
 
-
 
238
	mov	ebx,outname
-
 
239
	mov	edi,edit2
-
 
240
	call	set_editbox_position
-
 
241
 
-
 
242
	mov	ebx,path
Line 789... Line -...
789
	and	[ebx+8],dword 0
-
 
790
	and	[ebx+12],dword 0
243
	mov	edi,edit3
791
	mov	[ebx+16],dword file_attr
244
	call	set_editbox_position
Line 792... Line 245...
792
	mcall	70
245
	ret
793
	test	eax,eax
-
 
794
	jnz	infileerr
-
 
795
 
246
;*********************************************************************
796
	mov	eax,[insize]
-
 
797
	test	eax,eax
-
 
798
	jz      infileerr
-
 
799
 
-
 
Line 800... Line -...
800
	mov	ecx,[memf]
-
 
801
	mov	[infile],ecx
-
 
802
	add	ecx,eax
247
key:
803
	mov	[outfile],ecx
-
 
804
	mov	[outfilebest],ecx
248
	mcall	2
805
	mcall	64,1
-
 
806
	test	eax,eax
-
 
807
	jnz	memf1
-
 
808
 
-
 
Line 809... Line -...
809
	mov	ebx,fn70block
-
 
810
	mov	[ebx],byte 0
-
 
811
	mov	eax,[insize]
249
 
812
	mov	[ebx+12],eax
250
	push	dword edit1
813
	mov	esi,[infile]
251
	call	[edit_box_key]
814
	mov	[ebx+16],esi
-
 
815
	mcall	70
-
 
816
	test	eax,eax
-
 
817
	jnz	infileerr
252
 
818
 
-
 
819
	mov	eax,[infile]
-
 
820
	cmp	[eax],dword 'KPCK'
-
 
821
	jz	@f
-
 
822
;--------------------------------------
-
 
823
unpack_err:
-
 
824
	mov	esi,notpacked_str
253
	push	dword edit2
Line 825... Line -...
825
	push	notpacked_len
-
 
826
	pop	ecx
-
 
827
	jmp	write_string
254
	call	[edit_box_key]
828
;---------------------------------------------------------------------
-
 
829
@@:
-
 
830
	mov	ecx,[outfile]
255
 
831
	add	ecx,dword [eax+4]
-
 
832
	mcall	64,1
-
 
833
	test	eax,eax
-
 
834
	jnz	memf1
-
 
835
 
256
	push	dword edit3
836
	mov	esi,[infile]
-
 
837
	mov	eax,[esi+8]
-
 
838
	push	eax
-
 
839
	and	al,0C0h
-
 
840
	cmp	al,0C0h
-
 
841
	pop	eax
-
 
842
	jz	unpack_err
-
 
843
 
-
 
844
	and	al,not 0C0h
-
 
845
	dec	eax
-
 
846
	jnz	unpack_err
-
 
847
 
-
 
848
	mov	eax,[esi+4]
-
 
849
	mov	[outsize],eax
-
 
850
	push	eax
-
 
851
	push	[outfile]
-
 
852
	add	esi,11
-
 
853
	push	esi
-
 
854
	mov	eax,[esi+1]
-
 
855
	xchg	al,ah
-
 
856
	ror	eax,16
-
 
857
	xchg	al,ah
-
 
858
	mov	[esi+1],eax
-
 
859
	call	lzma_decompress
-
 
860
	mov	esi,[infile]
-
 
861
	test	[esi+8],byte 80h
-
 
862
	jnz	uctr1
-
 
863
 
-
 
864
	test	[esi+8],byte 40h
-
 
865
	jz	udone
-
 
866
 
-
 
867
	add	esi,[insize]
-
 
868
	sub	esi,5
-
 
869
	lodsd
-
 
870
	mov	ecx,eax
-
 
871
	jecxz	udone
-
 
872
 
-
 
873
	mov	dl,[esi]
-
 
874
	mov	esi,[outfile]
-
 
875
;--------------------------------------
-
 
876
uc1:
-
 
877
	lodsb
-
 
878
	sub	al,0E8h
-
 
879
	cmp	al,1
-
 
880
	ja	uc1
-
 
881
 
-
 
882
	cmp	[esi],dl
-
 
883
	jnz	uc1
-
 
884
 
-
 
885
	lodsd
-
 
886
	shr	ax,8
-
 
887
	ror	eax,16
-
 
888
	xchg	al,ah
-
 
889
	sub	eax,esi
-
 
890
	add	eax,[outfile]
-
 
891
	mov	[esi-4],eax
-
 
892
	loop	uc1
-
 
893
	jmp	udone
-
 
894
;---------------------------------------------------------------------
-
 
895
uctr1:
-
 
896
	add	esi,[insize]
-
 
897
	sub	esi,5
-
 
898
	lodsd
-
 
899
	mov	ecx,eax
-
 
900
	jecxz	udone
-
 
901
 
-
 
902
	mov	dl,[esi]
-
 
903
	mov	esi,[outfile]
-
 
904
;--------------------------------------
-
 
905
uc2:
-
 
906
	lodsb
-
 
907
;--------------------------------------
-
 
908
@@:
-
 
909
	cmp	al,15
-
 
910
	jnz	uf
-
 
911
 
-
 
912
	lodsb
-
 
913
	cmp	al,80h
-
 
914
	jb	@b
-
 
915
 
-
 
916
	cmp	al,90h
-
 
917
	jb	@f
-
 
918
;--------------------------------------
-
 
919
uf:
-
 
920
	sub	al,0E8h
-
 
921
	cmp	al,1
-
 
922
	ja	uc2
-
 
923
;--------------------------------------
-
 
924
@@:
-
 
925
	cmp	[esi],dl
-
 
926
	jnz	uc2
-
 
927
 
-
 
928
	lodsd
-
 
929
	shr	ax,8
-
 
930
	ror	eax,16
-
 
931
	xchg	al,ah
-
 
932
	sub	eax,esi
-
 
933
	add	eax,[outfile]
257
	call	[edit_box_key]
934
	mov	[esi-4],eax
258
 
935
	loop	uc2
259
	jmp	still
936
;--------------------------------------
260
;*********************************************************************
937
udone:
261
onenter:
938
	mov	esi,unpacked_ok
262
;	cmp	[curedit],inname
Line 965... Line 289...
965
	mov	ecx,[esi-4]
289
	mov	ecx,[esi-4]
966
	rep	movsb
290
	rep	movsb
967
	xor	eax,eax
291
	xor	eax,eax
968
	stosb
292
	stosb
969
	ret
293
	ret
970
;---------------------------------------------------------------------
-
 
971
wsret:
-
 
972
	ret
-
 
973
;---------------------------------------------------------------------
294
;*********************************************************************
974
write_string:
295
write_string:
975
; in: esi=pointer, ecx=length
296
; in: esi=pointer, ecx=length
976
	mov	edx,[message_cur_pos]
297
	mov	edx,[message_cur_pos]
977
;--------------------------------------
298
;--------------------------------------
978
x1:
299
x1:
Line 1031... Line 352...
1031
	add	edi,80
352
	add	edi,80
1032
	cmp	edi,message_cur_pos
353
	cmp	edi,message_cur_pos
1033
	jb	@b
354
	jb	@b
Line 1034... Line 355...
1034
 
355
 
1035
	ret
356
	ret
1036
;---------------------------------------------------------------------
357
;*********************************************************************
1037
draw_window:
358
draw_window:
1038
; start redraw
359
; start redraw
1039
	mcall	12,1
360
	mcall	12,1
-
 
361
	mov	edi,[skinheight]
1040
	mov	edi,[skinheight]
362
;--------------------------------------
1041
; define window
363
; define window
1042
	xor	eax,eax
364
	xor	eax,eax
1043
	mov	ecx,100 shl 16+286
365
	mov	ecx,100 shl 16+286
1044
	add	ecx,edi
366
	add	ecx,edi
1045
	mov	edx,[color_table+20]
367
	mov	edx,[color_table+20]
1046
	add	edx,13000000h
368
	add	edx,13000000h
1047
	push	edi
369
;	push	edi
1048
	xor	esi,esi
370
	xor	esi,esi
1049
	mcall	,<100,435>,,,,caption_str
371
	mcall	,<100,435>,,,,fullname	;temp_dir_pach	;caption_str
-
 
372
;	pop	edi
-
 
373
	mcall	9,procinfo,-1
-
 
374
;--------------------------------------
-
 
375
; draw lines and frame
-
 
376
	call	draw_lines
-
 
377
; draw buttons
-
 
378
	call	draw_bittons
-
 
379
; infile, outfile, path strings
-
 
380
;	call	draw_strings
-
 
381
; draw messages
-
 
382
	call	draw_messages
-
 
383
; draw editbox's
-
 
384
	mov	eax,[procinfo+42]
-
 
385
	sub	eax,65+72+10
-
 
386
	mov	[edit1.width],eax ; óñòàíàâëèâàåì øèðèíó òåêñòîâûõ ïîëåé
-
 
387
	mov	[edit2.width],eax
-
 
388
	mov	[edit3.width],eax
-
 
389
 
-
 
390
	call	draw_editbox
-
 
391
; end redraw
-
 
392
	mcall	12,2
-
 
393
	ret
-
 
394
;*********************************************************************
-
 
395
draw_editbox:
-
 
396
	push	dword edit1
-
 
397
	call	[edit_box_draw]
-
 
398
	push	dword edit2
-
 
399
	call	[edit_box_draw]
-
 
400
	push	dword edit3
-
 
401
	call	[edit_box_draw]
-
 
402
	ret
-
 
403
;*********************************************************************
-
 
404
set_editbox_position:
-
 
405
	mov	esi,ebx
-
 
406
	cld
-
 
407
@@:
-
 
408
	lodsb
-
 
409
	test	al,al
-
 
410
	jne	@r
-
 
411
	sub	esi,ebx
-
 
412
	mov	eax,esi
-
 
413
	dec	eax
-
 
414
	mov	[edi+48], eax  ;ed_size
-
 
415
	mov	[edi+52], eax  ;ed_pos
-
 
416
	ret
-
 
417
;*********************************************************************
-
 
418
draw_lines:
1050
	pop	edi
419
;	mov	edi,[skinheight]
1051
; lines - horizontal
420
; lines - horizontal
-
 
421
;	mov	ebx,8 shl 16+352
-
 
422
;	mov	ecx,edi
-
 
423
;	shl	ecx,16
-
 
424
;	or	ecx,edi
-
 
425
;	add	ecx,2 shl 16+2
-
 
426
;	mcall	38,,,[color_table+36]
-
 
427
;	mov	esi,3
-
 
428
;@@:
-
 
429
;	add	ecx,12 shl 16+12
-
 
430
;	mcall
-
 
431
;	dec	esi
-
 
432
;	jnz	@r
-
 
433
;--------------------------------------
-
 
434
; lines - vertical
-
 
435
;	sub	ecx,36 shl 16
-
 
436
;	mcall	,<8,8>
-
 
437
;	add	ebx,52 shl 16+52
-
 
438
;	mcall
-
 
439
;	add	ebx,292 shl 16+292
-
 
440
;	mcall
-
 
441
;--------------------------------------
1052
	mov	ebx,8 shl 16+352
442
	mov	edi,[skinheight]
1053
	mov	ecx,edi
443
	mov	ecx,edi
1054
	shl	ecx,16
444
	shl	ecx,16
1055
	or	ecx,edi
-
 
1056
	add	ecx,2 shl 16+2
-
 
1057
	mcall	38,,,[color_table+36]
445
	or	ecx,edi
1058
	add	ecx,12 shl 16+12
-
 
1059
	mcall
-
 
1060
	add	ecx,12 shl 16+12
-
 
1061
	mcall
446
	add	ecx,2 shl 16+2+12*3
1062
	add	ecx,12 shl 16+12
-
 
1063
	mcall
-
 
1064
; lines - vertical
-
 
1065
	sub	ecx,36 shl 16
-
 
1066
	mcall	,<8,8>
-
 
1067
	add	ebx,52 shl 16+52
-
 
1068
	mcall
-
 
1069
	add	ebx,292 shl 16+292
-
 
1070
	mcall
447
;	add	ecx,12*3
1071
; draw frame for messages data
448
; draw frame for messages data
1072
	push	ecx
449
	push	ecx
1073
	add	ecx,52 shl 16+16
450
	add	ecx,52 shl 16+16
1074
	mcall	,<8,425>
451
	mcall	38,<8,425>,,[color_table+36]
1075
	add	ecx,224*(1 shl 16+1)
452
	add	ecx,224*(1 shl 16+1)
1076
	mcall
453
	mcall
1077
	sub	cx,224
454
	sub	cx,224
1078
	mcall	,<8,8>
455
	mcall	,<8,8>
1079
	mcall	,<426,426>
456
	mcall	,<426,426>
-
 
457
	pop	ecx
-
 
458
	ret
-
 
459
;*********************************************************************
1080
	pop	ecx
460
draw_bittons:
1081
; define compress button
461
; define compress button
1082
	mov	cx,18
462
	mov	cx,18
1083
	mcall	8,<354,72>,,2,[color_table+36]
463
	mcall	8,<354,72>,,2,[color_table+36]
1084
; uncompress button
464
; uncompress button
Line 1091... Line 471...
1091
	mov	dl,7
471
	mov	dl,7
1092
	mcall	,<417,9>
472
	mcall	,<417,9>
1093
	shr	ecx,16
473
	shr	ecx,16
1094
	lea	ebx,[ecx+1A40002h]
474
	lea	ebx,[ecx+1A40002h]
1095
	mcall	4,,[color_table+28],aQuestion,1
475
	mcall	4,,[color_table+28],aQuestion,1
1096
	mov	al,8
476
;	mov	al,8
1097
	pop	esi
477
	pop	esi
1098
; define settings buttons
478
; define settings buttons
1099
	mov	ebx,9 shl 16+50
479
;	mov	ebx,9 shl 16+50
1100
	lea	ecx,[edi+2]
480
	lea	ecx,[edi+2]
-
 
481
	add	ecx,16*2
1101
	shl	ecx,16
482
	shl	ecx,16
1102
	mov	cx,11
483
	mov	cx,13
1103
	push	4
484
;	push	4
1104
	pop	edx
485
;	pop	edx
1105
;--------------------------------------
486
;--------------------------------------
1106
@@:
487
;@@:
1107
	mcall
488
;	mcall
1108
	add	ecx,12 shl 16
489
;	add	ecx,12 shl 16
1109
	inc	edx
490
;	inc	edx
1110
	cmp	edx,6
491
;	cmp	edx,6
1111
	jbe	@b
492
;	jbe	@b
-
 
493
	mcall	8,<9,50>,,4
1112
; text on settings buttons
494
; text on settings buttons
1113
	lea	ebx,[edi+5+0C0000h]
495
	lea	ebx,[edi+5+0C0000h]
1114
	mov	al,4
496
	mov	al,4
1115
	mov	ecx,[color_table+28]
497
	mov	ecx,[color_table+28]
1116
	push	buttons1names
498
	push	buttons1names
Line 1119... Line 501...
1119
	pop	esi
501
	pop	esi
1120
;--------------------------------------
502
;--------------------------------------
1121
@@:
503
@@:
1122
	mcall
504
	mcall
1123
	add	edx,esi
505
	add	edx,esi
1124
	add	ebx,12
506
	add	ebx,16
1125
	cmp	[edx-6],byte ' '
507
	cmp	[edx-6],byte ' '
1126
	jnz	@b
508
	jnz	@b
1127
; text on compress and decompress buttons
509
; text on compress and decompress buttons
1128
	lea	ebx,[edi+8+1720000h]
510
	lea	ebx,[edi+8+1720000h]
1129
	or	ecx,80000000h
511
	or	ecx,80000000h
1130
	mcall	,,,aCompress
512
	mcall	,,,aCompress
1131
	lea	ebx,[edi+1Ah+16A0000h]
513
	lea	ebx,[edi+1Ah+16A0000h]
1132
	mcall	,,,aDecompress
514
	mcall	,,,aDecompress
1133
; infile, outfile, path strings
-
 
1134
	mov	edx,inname
-
 
1135
	lea	ebx,[edi+400005h]
-
 
1136
;--------------------------------------
-
 
1137
editdraw:
-
 
1138
	mcall	4,,[color_table+32],,[edx-4]
-
 
1139
	cmp	edx,[curedit]
-
 
1140
	jnz	cont
-
 
1141
 
-
 
1142
	mov	al,1
-
 
1143
	push	ebx
-
 
1144
	push	edx
-
 
1145
	movzx	ecx,bx
-
 
1146
	shr	ebx,16
-
 
1147
	lea	edx,[esi*2]
-
 
1148
	lea	edx,[edx+edx*2]
-
 
1149
	lea	ebx,[ebx+edx+2]
-
 
1150
	add	ecx,4
-
 
1151
	xor	edx,edx
-
 
1152
;--------------------------------------
-
 
1153
@@:
-
 
1154
	cmp	esi,48
-
 
1155
	jz	@f
-
 
1156
 
-
 
1157
	mcall
-
 
1158
	add	ebx,6
-
 
1159
	inc	esi
-
 
1160
	jmp	@b
-
 
1161
;---------------------------------------------------------------------
-
 
1162
@@:
-
 
1163
	pop	edx
-
 
1164
	pop	ebx
-
 
1165
;--------------------------------------
-
 
1166
cont:
-
 
1167
	add	edx,52
-
 
1168
	add	ebx,0Ch
-
 
1169
	cmp	edx,path+52
-
 
1170
	jb	editdraw
-
 
1171
; draw messages
-
 
1172
	call	draw_messages
-
 
1173
; end redraw
-
 
1174
	mcall	12,2
-
 
1175
	ret
515
	ret
1176
;---------------------------------------------------------------------
516
;*********************************************************************
1177
copy_name:
517
copy_name:
1178
	lea	edx,[edi+48]
518
	lea	edx,[edi+256]
1179
;--------------------------------------
519
;--------------------------------------
1180
@@:
520
@@:
1181
	lodsb
521
	lodsb
1182
	cmp	al,' '
522
	cmp	al,' '
1183
	jbe	copy_name_done
523
	jbe	copy_name_done
Line 1191... Line 531...
1191
	cmp	al,' '
531
	cmp	al,' '
1192
	ja	@b
532
	ja	@b
1193
;--------------------------------------
533
;--------------------------------------
1194
copy_name_done:
534
copy_name_done:
1195
	dec	esi
535
	dec	esi
1196
	sub	edx,48
536
	sub	edx,256
1197
	sub	edi,edx
537
	sub	edi,edx
1198
	mov	[edx-4],edi
538
	mov	[edx-4],edi
1199
;--------------------------------------
539
;--------------------------------------
1200
skip_spaces:
540
skip_spaces:
1201
	lodsb
541
	lodsb
Line 1206... Line 546...
1206
	jbe	skip_spaces
546
	jbe	skip_spaces
1207
;--------------------------------------
547
;--------------------------------------
1208
@@:
548
@@:
1209
	dec	esi
549
	dec	esi
1210
	ret
550
	ret
-
 
551
;*********************************************************************
-
 
552
;Pack procedures
-
 
553
include 'packpoc.inc'
1211
;---------------------------------------------------------------------
554
;---------------------------------------------------------------------
1212
clear_edit_points:
-
 
1213
; clear edit points (if is)
-
 
1214
	mov	esi,[curedit]
-
 
1215
	test	esi,esi
-
 
1216
	jz	cleared_edit_points
-
 
1217
 
-
 
1218
	push	eax
-
 
1219
	mov	ebx,[esi-4]
-
 
1220
	imul	ebx,6
-
 
1221
	mov	edi,ebx
-
 
1222
	add	ebx,40h
-
 
1223
	shl	ebx,16
-
 
1224
	add	ebx,48*6
-
 
1225
	sub	bx,di
-
 
1226
	mov	ecx,[curedit_y]
555
;UnPack procedures
1227
	shl	ecx,16
-
 
1228
	or	cx,9
-
 
1229
	mcall	13,,,[color_table+20]
-
 
1230
	pop	eax
-
 
1231
;--------------------------------------
-
 
1232
cleared_edit_points:
556
include 'upacproc.inc'
1233
	ret
-
 
1234
;---------------------------------------------------------------------
557
;---------------------------------------------------------------------
1235
;lzma_compress:
558
;lzma_compress:
1236
include 'lzma_compress.inc'
559
include 'lzma_compress.inc'
1237
;---------------------------------------------------------------------
560
;---------------------------------------------------------------------
1238
;lzma_set_dict_size:
561
;lzma_set_dict_size: