Subversion Repositories Kolibri OS

Rev

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

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