Subversion Repositories Kolibri OS

Rev

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

Rev 2476 Rev 2538
Line 3... Line 3...
3
;*     DESKTOP ICON MANAGER     *
3
;*     DESKTOP ICON MANAGER     *
4
;*                              *
4
;*                              *
5
;*  Compile with flat assembler *
5
;*  Compile with flat assembler *
6
;*                              *
6
;*                              *
7
;********************************
7
;********************************
-
 
8
; version:	3.00
-
 
9
; last update:  02/04/2012
-
 
10
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
-
 
11
; changes:      Program used only 2 threads: draw and mouse
-
 
12
;               Used new kernel functions: 25, 34, 15.8, 4 (redirect).
-
 
13
;               Used PNG icons with transparent.
-
 
14
;---------------------------------------------------------------------
8
; version:	2.11
15
; version:	2.11
9
; last update:  19/03/2012
16
; last update:  19/03/2012
10
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
17
; changed by:   Marat Zakiyanov aka Mario79, aka Mario
11
; changes:      The program uses only 140 Kb memory is now.
18
; changes:      The program uses only 140 Kb memory is now.
12
;               Some speedup.
19
;               Some speedup.
Line 31... Line 38...
31
; Many fix's and changes created by:
38
; Many fix's and changes created by:
32
;               Halyavin, Diamond, Heavyiron, 
39
;               Halyavin, Diamond, Heavyiron, 
33
;               SPraid, Dunkaist
40
;               SPraid, Dunkaist
34
;---------------------------------------------------------------------
41
;---------------------------------------------------------------------
35
; version:	2.00
42
; version:	2.00
36
; last update:  22|02|2005
43
; last update:  22/02/2005
37
; changed by:   Willow and Mario79
44
; changed by:   Willow and Mario79
38
; changes:      modified for work with new multi-thread ICON.
45
; changes:      modified for work with new multi-thread ICON.
39
;******************************************************************************
46
;******************************************************************************
40
ICON_SIZE equ 32*32*3
47
ICON_SIZE equ 32*32*4
41
;RAW_SIZE equ ICON_SIZE*32	;350000
-
 
42
;GIF_SIZE equ 12*1024	;45000
-
 
43
REC_SIZE equ 80
48
REC_SIZE equ 80
44
ICONS_DAT equ '/sys/ICONS.DAT'
49
ICONS_DAT equ '/sys/icons.dat'
45
ICON_APP equ '/sys/ICON'
50
ICON_APP equ '/sys/icon'
46
ICON_STRIP equ '/sys/ICONSTRP.GIF'
51
ICON_STRIP equ '/rd/1/iconstrp.png'
47
;------------------------------------------------------------------------------
52
;------------------------------------------------------------------------------
48
	use32
53
	use32
49
	org 0x0
54
	org 0x0
50
	db 'MENUET01'	; 8 byte id
55
	db 'MENUET01'	; 8 byte id
51
	dd 0x01		; header version
56
	dd 0x01		; header version
52
	dd START	; start of code
57
	dd START	; start of code
53
	dd IM_END	; size of image
58
	dd IM_END	; size of image
54
	dd I_END	; memory for app
59
	dd I_END	; memory for app
55
	dd stack_area	; esp
60
	dd stack_area	; esp
56
	dd I_Param	; boot parameters
61
	dd I_Param	; boot parameters
57
	dd 0x0		; path
62
	dd path		; path
58
;------------------------------------------------------------------------------
63
;------------------------------------------------------------------------------
59
include '../../../macros.inc'
-
 
60
include 'lang.inc'
64
include 'lang.inc'
-
 
65
include '../../../macros.inc'
-
 
66
include '../../../develop/libraries/box_lib/load_lib.mac'
61
COLOR_ORDER equ MENUETOS
67
COLOR_ORDER equ MENUETOS
62
include 'gif_lite.inc'
-
 
63
;include 'debug.inc'
68
;include 'debug.inc'
-
 
69
;------------------------------------------------------------------------------
64
purge newline
70
        @use_library    ;use load lib macros
65
;------------------------------------------------------------------------------
71
;------------------------------------------------------------------------------
66
START:		; start of execution
72
START:		; start of execution
67
	mcall	68,11
73
	mcall	68,11
-
 
74
;---------------------------------------------------------------------	
-
 
75
load_libraries l_libs_start,end_l_libs
-
 
76
	test	eax,eax
-
 
77
	jnz	close
-
 
78
	
-
 
79
; unpack deflate
-
 
80
	mov	eax,[unpack_DeflateUnpack2]
-
 
81
	mov	[deflate_unpack],eax
-
 
82
;---------------------------------------------------------------------
68
; get size of file ICONSTRP.GIF
83
; get size of file ICONSTRP.GIF
69
	mcall	70,finfo
84
	mcall	70,finfo
70
	test	eax,eax
85
	test	eax,eax
71
	jnz	close
86
	jnz	close
72
; get memory for ICONSTRP.GIF
87
; get memory for ICONSTRP.GIF
73
	mov	ecx,[process_table+32]
88
	mov	ecx,[procinfo+32]
74
	mov	[finfo.size],ecx
89
	mov	[finfo.size],ecx
-
 
90
	mov	[img_size],ecx
75
	mcall	68,12
91
	mcall	68,12
76
	mov	[finfo.point],eax
92
	mov	[finfo.point],eax
-
 
93
	mov	[image_file],eax
77
; load ICONSTRP.GIF
94
; load ICONSTRP.GIF
78
	mov	[finfo],dword 0
95
	mov	[finfo],dword 0
79
	mcall	70,finfo
96
	mcall	70,finfo
80
	test	eax,eax
97
	test	eax,eax
81
	jnz	close
98
	jnz	close
82
; calculate and get memory for RAW data	
99
; convert PNG to RAW
83
	mov	esi,[finfo.point]
100
	xor	eax,eax
84
	movzx	eax,word [esi+6]	;x
101
	mov	[return_code],eax
-
 
102
 
85
	movzx	edi,word [esi+8]	;y
103
	push	image_file
86
	imul	eax,edi		;x*y
104
	call	[cnv_png_import.Start]
-
 
105
 
87
	lea	edi,[eax+eax*2]	; multiply x3
106
	mov	eax,[raw_pointer]
88
	mov	ecx,edi
107
	mov	eax,[eax+28]
89
	mcall	68,12
108
	add	eax,[raw_pointer]
90
	mov	[strip_file],eax
109
	mov	[strip_file],eax
91
	mov	edi,eax
-
 
92
; convert GIF to RAW
-
 
93
	call	ReadGIF
-
 
94
; back memeory to system
110
; back memeory to system
95
	mcall	68,13,[finfo.point]
111
	mcall	68,13,[finfo.point]
Line -... Line 112...
-
 
112
	
96
 
113
	mov	eax,[raw_pointer]
97
	mov	eax,dword[edi+4]
114
	mov	eax,[eax+8]
98
	shr	eax,5
115
	shr	eax,5
99
	mov	[icon_count],eax
116
	mov	[icon_count],eax
100
; load ICON.DAT
117
; load ICON.DAT
101
	call	load_ic
118
	call	load_ic
102
boot_str:
119
boot_str:
103
	cmp	[I_Param],dword 'BOOT'
120
	cmp	[I_Param],dword 'BOOT'
-
 
121
	je	START2
-
 
122
;------------------------------------------------------------------------------	
-
 
123
; ICON EDITOR MODE - START1 entering label
-
 
124
;------------------------------------------------------------------------------	
104
	je	load_icon_list2
125
START1:
-
 
126
	call	load_icon_list
-
 
127
;------------------------------------------------------------------------------
105
	call	load_icon_list
128
align 4	
106
red:
129
red:
107
	call	draw_window	; at first, draw the window
130
	call	draw_window	; at first, draw the window
108
	mov	esi,[current_icon]
131
	mov	esi,[current_icon]
109
	jmp	band
132
	jmp	band
Line 120... Line 143...
120
align 4
143
align 4
121
button:
144
button:
122
	mcall	17	; get id
145
	mcall	17	; get id
123
	shr	eax,8
146
	shr	eax,8
Line 124... Line -...
124
 
-
 
125
;	dps	"button id: "
-
 
126
;	dpd	eax
-
 
127
;	newline_1
-
 
128
 
147
 
129
	cmp	eax,1	; button id=1 ?
148
	cmp	eax,1	; button id=1 ?
130
	je	close
-
 
131
;--------------------------------------
149
	je	close
132
align 4
-
 
133
noclose:
150
	
134
	mov	esi,[current_icon]
151
	mov	esi,[current_icon]
135
	add	esi,12
152
	add	esi,12
-
 
153
	mov	ebx,[cur_band]
-
 
154
	
-
 
155
	cmp	eax,11
-
 
156
	jb	@f
-
 
157
	cmp	eax,13
-
 
158
	ja	@f
-
 
159
	call	read_string
-
 
160
	jmp	still
-
 
161
;--------------------------------------
-
 
162
align 4
-
 
163
@@:
-
 
164
	cmp	eax,21	; apply changes
-
 
165
	je	apply
-
 
166
	
-
 
167
	cmp	eax,22		; user pressed the 'add icon' button
-
 
168
	je	add_icon
-
 
169
	
-
 
170
	cmp	eax,23	; user pressed the remove icon button
-
 
171
	je	remove_icon
-
 
172
 
-
 
173
	
-
 
174
	cmp	eax,30	; left arrow to icons bar
-
 
175
	je	arrow.left
136
	mov	ebx,[cur_band]	;eax
176
	
-
 
177
	cmp	eax,31	; right arrow to icons bar
-
 
178
	je	arrow.right
-
 
179
	
137
	cmp	eax,31	; right arrow to icons bar
180
	cmp	eax,32
-
 
181
	je	ico
-
 
182
 
-
 
183
	cmp	eax,40	; user pressed button for icon position
-
 
184
	jae	press_button_for_icon_position
-
 
185
	
-
 
186
	jmp	still
-
 
187
;------------------------------------------------------------------------------
-
 
188
align 4
-
 
189
arrow:
Line 138... Line -...
138
	jne	.no_back
-
 
139
 
190
.right:
-
 
191
 
140
	add	ebx,8
192
	mov	eax,[icon_count]
141
	mov	eax,[icon_count]
193
	sub	eax,8
Line 142... Line 194...
142
	cmp	eax,ebx
194
	cmp	ebx,eax
143
	jae	.drwic2
195
	jae	still	;.drwic2
144
 
196
 
145
	xor	ebx,ebx
197
	add	ebx,1
146
	jmp	.drwic2
198
	jmp	.drwic2
147
;--------------------------------------
-
 
148
align 4
-
 
149
.no_back:
-
 
150
	cmp	eax,30	; left arrow to icons bar
199
;--------------------------------------
151
	jne	.no_side
200
align 4
Line 152... Line -...
152
 
-
 
153
	test	ebx,ebx
-
 
154
	jnz	.dec
-
 
155
 
-
 
156
	mov	ebx,[icon_count]
-
 
157
	and	ebx,0xfffffff8
-
 
158
	add	ebx,8
201
.left:
159
;--------------------------------------
202
	test	ebx,ebx
160
align 4
203
	jz	still
161
.dec:
204
 
162
	sub	ebx,8
205
	sub	ebx,1
163
;--------------------------------------
206
;--------------------------------------
164
align 4
207
align 4
165
.drwic2:
208
.drwic2:
166
	mov	[cur_band],ebx
209
	mov	[cur_band],ebx
167
;--------------------------------------
210
;--------------------------------------
168
align 4
211
align 4
169
.drwic1:
212
.drwic1:
170
	call	draw_icon
213
	call	draw_icon
171
	jmp	still
-
 
172
;--------------------------------------
-
 
173
align 4
214
	jmp	still
174
.no_side:
215
;------------------------------------------------------------------------------
175
	cmp	eax,32
216
align 4
176
	jne	.no_ico
217
ico:
177
	push	ebx
218
	push	ebx
Line 184... Line 225...
184
	div	edi
225
	div	edi
185
	lea	ecx,[ebx+eax]
226
	lea	ecx,[ebx+eax]
186
	cmp	ecx,[icon_count]
227
	cmp	ecx,[icon_count]
187
	jae	still
228
	jae	still
Line 188... Line -...
188
 
-
 
189
	mov	[sel_icon1],eax
229
 
190
	mov	ecx,eax
230
	mov	ecx,eax
191
	add	eax,ebx
231
	add	eax,ebx
192
	call	itoa
232
	call	itoa
193
	jmp	.drwic1
-
 
194
;--------------------------------------
-
 
195
align 4
-
 
196
.no_ico:
-
 
197
	cmp	eax,11
-
 
198
	jb	no_str
-
 
199
	cmp	eax,13
-
 
200
	jg	no_str
-
 
201
	call	read_string
-
 
202
	jmp	still
233
	jmp	arrow.drwic1
203
;--------------------------------------
234
;------------------------------------------------------------------------------
204
align 4 
235
align 4 
205
no_str:
-
 
206
	cmp	eax,21	; apply changes
-
 
207
	jne	no_apply
236
apply:
208
	; (1) save list
237
	; (1) save list
209
	mov	ebx,finfo	; Change by spraid
238
	mov	ebx,finfo
210
	mov	dword[ebx],2
239
	mov	dword[ebx],2
211
	mov	edx,REC_SIZE
240
	mov	edx,REC_SIZE
212
	imul	edx,dword [icons]
241
	imul	edx,dword [icons]
213
	mov	[ebx+12],edx
242
	mov	[ebx+12],edx
214
	mov	esi,iconlst
243
	mov	esi,iconlst
215
	call	lst_path
244
	call	lst_path
216
	mcall	70
245
	mcall	70
217
	; (2) terminate all icons
246
	; (2) terminate all icons
218
	or	ecx,-1
247
	or	ecx,-1
219
	mcall	9,process_table
248
	mcall	9,procinfo
220
	mov	edi,[ebx+30]
249
	mov	edi,[ebx+30]
221
;--------------------------------------
250
;--------------------------------------
222
align 4
251
align 4
223
newread2:
252
newread2:
224
	mov	esi,1
253
	mov	esi,1
225
;--------------------------------------
254
;--------------------------------------
226
align 4
255
align 4
227
newread:
256
newread:
228
	inc	esi
257
	inc	esi
229
	mov	ecx,esi
258
	mov	ecx,esi
-
 
259
	mcall	9,procinfo
230
	mcall	9,process_table
260
 
231
	cmp	edi,[ebx+30]
261
	cmp	edi,[ebx+30]
Line 232... Line 262...
232
	je	newread
262
	je	newread
233
 
263
 
Line 234... Line 264...
234
	cmp	esi,eax
264
	cmp	esi,eax
235
	jg	apply_changes
265
	jg	.apply_changes
236
 
266
 
237
	mov	eax,[ebx+10]
267
	mov	eax,[ebx+10]
238
	and	eax,not 20202020h
268
	and	eax,not 20202020h
239
	cmp	eax,'@ICO'
269
	cmp	eax,'@ICO'
240
	jz	@f
270
	jz	@f
241
	cmp	eax,'ICON'
271
	cmp	eax,'ICON'
242
	jne	newread
272
	jne	newread
243
;--------------------------------------
273
;--------------------------------------
244
align 4
274
align 4
245
@@:
275
@@:
Line 246... Line 276...
246
	mov	eax,51
276
	xor	eax,eax
247
	cmp	eax,[ebx+42]
277
	cmp	eax,[ebx+42]
Line 248... Line 278...
248
	jne	newread
278
	jne	newread
249
 
279
 
-
 
280
	cmp	eax,[ebx+46]
250
	cmp	eax,[ebx+46]
281
	jne	newread
251
	jne	newread
282
 
252
 
-
 
253
	mov	ecx,esi
-
 
254
	mcall	18,2
-
 
255
	jmp	newread2
-
 
256
;------------------------------------------------------------------------------
-
 
257
align 4
-
 
258
finfo_start:
-
 
259
	dd 7
-
 
260
	dd 0
-
 
261
.params	dd 0
-
 
262
	dd 0
-
 
263
	dd 0
-
 
264
	db 0
-
 
265
	dd finfo.path
-
 
266
;------------------------------------------------------------------------------
-
 
267
align 4
-
 
268
finfo:
-
 
269
	dd 5
-
 
270
	dd 0
-
 
271
	dd 0
-
 
272
.size	dd 0	;GIF_SIZE
-
 
273
.point	dd process_table	;gif_file
283
	mov	ecx,esi
274
.path:
284
	mcall	18,2
275
	db ICON_STRIP,0
285
 
276
	rb 31-($-.path)
286
	jmp	newread2
277
;------------------------------------------------------------------------------
287
;--------------------------------------
278
align 4
288
align 4
279
apply_changes:
289
.apply_changes:
-
 
290
	mov	ebx, finfo_start
-
 
291
	mov	dword [ebx+8], boot_str+6
280
	mov	ebx, finfo_start
292
	mov	esi, iconname
281
	mov	dword [ebx+8], boot_str+6
293
	call	lst_path
282
	mov	esi, iconname
294
	mcall	70
283
	call	lst_path
-
 
284
	mcall	70
-
 
285
	jmp	still
295
	mcall	68,1
286
;------------------------------------------------------------------------------
-
 
287
align 4
296
	mcall	15,3
288
no_apply:
297
	jmp	still
Line 289... Line 298...
289
	cmp	eax,22		; user pressed the 'add icon' button
298
;------------------------------------------------------------------------------
290
	jne	no_add_icon
299
align 4
Line 343... Line 352...
343
;--------------------------------------
352
;--------------------------------------
344
align 4
353
align 4
345
no_f:
354
no_f:
346
	call	draw_btns	;draw_window
355
	call	draw_btns	;draw_window
347
	jmp	still
356
	jmp	still
348
;--------------------------------------
357
;------------------------------------------------------------------------------
349
align 4
358
align 4
350
no_add_icon:
359
remove_icon:
351
	cmp	eax,23	; user pressed the remove icon button
-
 
352
	jne	no_remove_icon
-
 
353
	
-
 
354
	mov	ebx,24*65536+250+8*14
360
	mov	ebx,24*65536+250+8*14
355
	mcall	4,,0xc0ff0000,rem_text,,0xffffff
361
	mcall	4,,0xc0ff0000,rem_text,,0xffffff
Line 356... Line 362...
356
	
362
	
357
	mcall	10
363
	mcall	10
Line 420... Line 426...
420
	shl	bl,4
426
	shl	bl,4
421
	shr	ebx,4
427
	shr	ebx,4
422
	add	ebx,40
428
	add	ebx,40
423
	mov	[cur_btn],ebx
429
	mov	[cur_btn],ebx
424
	jmp	red
430
	jmp	red
425
;--------------------------------------
431
;------------------------------------------------------------------------------
426
align 4
432
align 4
427
no_remove_icon:
-
 
428
	cmp	eax,40	; user pressed button for icon position
433
press_button_for_icon_position:
429
	jb	still
-
 
430
	mov	edi,eax
434
	mov	edi,eax
431
	sub	eax,40
435
	sub	eax,40
432
	mov	edx,eax
436
	mov	edx,eax
433
	shl	eax,4
437
	shl	eax,4
434
	and	edx,0xf
438
	and	edx,0xf
Line 452... Line 456...
452
	mov	[cur_btn],edi
456
	mov	[cur_btn],edi
453
;--------------------------------------
457
;--------------------------------------
454
align 4
458
align 4
455
band:
459
band:
456
	add	esi,12
460
	add	esi,12
457
	call	atoi
461
	call	ASCII_to_icon_number
458
	and	eax,0xfffff8
462
	and	eax,0xfffff8
459
	mov	[cur_band],eax
463
	mov	[cur_band],eax
460
	call	draw_btns
464
	call	draw_btns
461
	jmp	still
465
	jmp	still
462
;------------------------------------------------------------------------------
466
;------------------------------------------------------------------------------
463
current_icon	dd icon_data
-
 
464
;------------------------------------------------------------------------------
-
 
465
align 4
467
align 4
466
print_strings:
468
print_strings:
467
	pusha
469
	pusha
468
	mcall	13,<100,180>,<278+12,40>,0xffffff	; clear text area
470
	mcall	13,<100,180>,<278+12,40>,0xffffff	; clear text area
469
	xor	edi,edi
471
	xor	edi,edi
Line 485... Line 487...
485
	loop	.ll
487
	loop	.ll
Line 486... Line 488...
486
 
488
 
487
	popa
489
	popa
488
	ret
490
	ret
489
;------------------------------------------------------------------------------
-
 
490
iconlst	db ICONS_DAT,0
-
 
491
;------------------------------------------------------------------------------
491
;------------------------------------------------------------------------------
492
align 4
492
align 4
493
load_icon_list:
493
load_icon_list:
494
	mov	edi,icons_reserved	; clear reserved area
494
	mov	edi,icons_reserved	; clear reserved area
495
	mov	eax,32
495
	mov	eax,32
Line 537... Line 537...
537
	div	ebx
537
	div	ebx
538
	mov	[icons],eax
538
	mov	[icons],eax
539
	ret
539
	ret
540
;------------------------------------------------------------------------------
540
;------------------------------------------------------------------------------
541
align 4
541
align 4
542
positions	dd 3,16,47
-
 
543
str_lens	db 8,30,30
-
 
544
;------------------------------------------------------------------------------
-
 
545
align 4
-
 
546
read_string:
542
read_string:
547
	pusha
543
	pusha
548
	sub	eax,11
544
	sub	eax,11
549
	movzx	ecx,byte[str_lens+eax]
545
	movzx	ecx,byte[str_lens+eax]
550
	mov	[cur_str],ecx
546
	mov	[cur_str],ecx
Line 686... Line 682...
686
	mov	ecx,0xffffff
682
	mov	ecx,0xffffff
687
	mov	edx,text
683
	mov	edx,text
688
	mov	esi,47
684
	mov	esi,47
689
;--------------------------------------
685
;--------------------------------------
690
align 4
686
align 4
691
newline:
687
.newline:
692
	mov	ecx,[edx]
688
	mov	ecx,[edx]
693
	add	edx,4
689
	add	edx,4
694
	mcall
690
	mcall
695
	add	ebx,14
691
	add	ebx,14
696
	add	edx,47
692
	add	edx,47
697
	cmp	[edx],byte 'x'
693
	cmp	[edx],byte 'x'
698
	jne	newline
694
	jne	.newline
699
;--------------------------------------
695
;--------------------------------------
700
align 4
696
align 4
701
draw_btns:
697
draw_btns:
702
	mov	eax,0	; DRAW BUTTONS ON WINDOW AREA
698
	mov	eax,0	; DRAW BUTTONS ON WINDOW AREA
703
	mov	ebx,20 shl 16+25
699
	mov	ebx,20 shl 16+25
Line 741... Line 737...
741
	ror	ebx,16
737
	ror	ebx,16
742
	mov	bx,20
738
	mov	bx,20
743
	ror	ebx,16
739
	ror	ebx,16
744
	add	ecx,20 shl 16
740
	add	ecx,20 shl 16
745
	inc	ah
741
	inc	ah
746
	cmp	ah,8	;9
742
	cmp	ah,8
747
	jbe	newbline
743
	jbe	newbline
Line 748... Line 744...
748
 
744
 
749
	call	print_strings
745
	call	print_strings
750
	call	draw_icon
746
	call	draw_icon
Line 754... Line 750...
754
align 4
750
align 4
755
draw_icon:
751
draw_icon:
756
	mcall	13,<(33-20),(34*8+2)>,<(260-24),(37+15-2)>,0xffffff
752
	mcall	13,<(33-20),(34*8+2)>,<(260-24),(37+15-2)>,0xffffff
757
	mov	esi,[current_icon]
753
	mov	esi,[current_icon]
758
	add	esi,12
754
	add	esi,12
759
	call	atoi
755
	call	ASCII_to_icon_number
760
	push	eax
756
	push	eax
761
	cmp	eax,[cur_band]
757
	cmp	eax,[cur_band]
762
	jb	.nou
758
	jb	.nou
763
	sub	eax,[cur_band]
759
	sub	eax,[cur_band]
764
	cmp	eax,7
760
	cmp	eax,7
Line 770... Line 766...
770
	mov	eax,[esp]
766
	mov	eax,[esp]
771
;--------------------------------------
767
;--------------------------------------
772
align 4
768
align 4
773
.nou:
769
.nou:
774
	mov	eax,[cur_band]
770
	mov	eax,[cur_band]
775
	and	eax,0xfffffff8
-
 
776
	push	eax
771
	push	eax
777
	imul	eax,ICON_SIZE
772
	imul	eax,ICON_SIZE
778
	mov	ebx,[strip_file]
773
	mov	ebx,[strip_file]
779
	lea	ebx,[ebx+8+eax]
774
	add	ebx,eax
780
	mov	ecx,8
775
	mov	ecx,8
781
	mov	edx,(33-18) shl 16+238
776
	mov	edx,(33-18) shl 16+238
782
;--------------------------------------
777
;--------------------------------------
783
align 4
778
align 4
784
.nxt:
779
.nxt:
785
	push	ecx
780
	push	ecx
-
 
781
	pusha
-
 
782
	mov	ebp,0
786
	mcall	7,,<32,32>
783
	mcall	65,,<32,32>,,32
-
 
784
	popa
787
	pop	ecx
785
	pop	ecx
788
	add	ebx,ICON_SIZE
786
	add	ebx,ICON_SIZE
789
	add	edx,34 shl 16
787
	add	edx,34 shl 16
790
	loop	.nxt
788
	loop	.nxt
Line 804... Line 802...
804
	pop	ecx
802
	pop	ecx
805
	add	edx,(10*8+4)shl 16
803
	add	edx,(10*8+4)shl 16
806
	mcall	,,,,0xff0000
804
	mcall	,,,,0xff0000
807
	ret
805
	ret
808
;------------------------------------------------------------------------------
806
;------------------------------------------------------------------------------
809
; DATA AREA
-
 
810
bcolor dd 0x335599
-
 
811
;------------------------------------------------------------------------------
-
 
812
icon_table:
-
 
813
 times 4  db 'xxxx  xxxx'
-
 
814
 times 2  db '          '
-
 
815
 times 1  db '          '
-
 
816
 times 2  db 'xxxx  xxxx'
-
 
817
; times 1  db '          '
-
 
818
;------------------------------------------------------------------------------
-
 
819
icons_reserved:
-
 
820
	times 9  db '          '
-
 
821
;------------------------------------------------------------------------------
-
 
822
if lang eq ru
-
 
823
text:
-
 
824
	db 255,255,255,0,   '   ’…Š‘’                                       '
-
 
825
	db 255,255,255,0,   ' Žƒ€ŒŒ€                                     '
-
 
826
	db 255,255,255,0,   ' €€Œ…’›                                     '
-
 
827
	db 255,255,255,0,   '                 ˆŒ…ˆ’œ                     '
-
 
828
	db 255,255,255,0,   '      „Ž€‚ˆ’œ              “„€‹ˆ’œ            '
-
 
829
	db 0,0,0,0,         '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ   '
-
 
830
	db                  'x' ; <- END MARKER, DONT DELETE
-
 
831
 
-
 
832
add_text	db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ     ',0
-
 
833
rem_text	db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ       ',0
-
 
834
title		db 'Œ¥­¥¤¦¥à ¨ª®­®ª',0
-
 
835
 
-
 
836
else if lang eq ge
-
 
837
text:
-
 
838
	db 255,255,255,0,   '   TITLE                                       '
-
 
839
	db 255,255,255,0,   '  APP NAME                                     '
-
 
840
	db 255,255,255,0,   ' PARAMETER                                     '
-
 
841
	db 255,255,255,0,   '                ANWENDEN                       '
-
 
842
	db 255,255,255,0,   '     HINZUFUEGEN              ENTFERNEN        '
-
 
843
	db 0,0,0,0,         'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN       '
-
 
844
	db                  'x' ; <- END MARKER, DONT DELETE
-
 
845
 
-
 
846
add_text	db 'AUF UNBENUTZTE ICONPOSITION KLICKEN          ',0
-
 
847
rem_text	db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL    ',0
-
 
848
title		db 'Icon Manager',0
-
 
849
 
-
 
850
else
-
 
851
text:
-
 
852
	db 255,255,255,0,   '   TITLE                                       '
-
 
853
	db 255,255,255,0,   '  APP NAME                                     '
-
 
854
	db 255,255,255,0,   ' PARAMETERS                                    '
-
 
855
	db 255,255,255,0,   '                APPLY CHANGES                  '
-
 
856
	db 255,255,255,0,   '      ADD ICON              REMOVE ICON        '
-
 
857
	db 0,0,0,0,         'CLICK BUTTON ON ICON POSITION FOR EDIT         '
-
 
858
	db                  'x' ; <- END MARKER, DONT DELETE
-
 
859
add_text	db 'CLICK ON A NOT USED POSITION                 ',0
-
 
860
rem_text	db 'CLICK ICON POSITION; YOU WANT TO DELETE      ',0
-
 
861
title		db 'Icon Manager',0
-
 
862
 
-
 
863
end if
-
 
864
;------------------------------------------------------------------------------
-
 
865
arrows	db ''
-
 
866
;------------------------------------------------------------------------------
-
 
867
iconname:
-
 
868
	db ICON_APP,0
-
 
869
;------------------------------------------------------------------------------
-
 
870
icon_default:
-
 
871
	db 'AA-SYSXTREE-000-/RD/1/SYSXTREE                '
-
 
872
	db '-                              *'
-
 
873
	db 13,10
-
 
874
;------------------------------------------------------------------------------
-
 
875
rep_text:
-
 
876
if lang eq ru
-
 
877
	db '‡€—Šˆ    -     ˆ‡    , ‚›€ #'
-
 
878
else
-
 
879
	db 'ICONS     -     OF    , SELECTED'
-
 
880
end if
-
 
881
 
-
 
882
rep_text_len:
-
 
883
;------------------------------------------------------------------------------
-
 
884
align 4
-
 
885
get_bg_info:
-
 
886
	mcall	39,4
-
 
887
	mov	[bgrdrawtype],eax
-
 
888
 
-
 
889
	mcall	39,1	; get background size
-
 
890
	mov	[bgrxy],eax
-
 
891
 
-
 
892
	mov	ebx,eax
-
 
893
	shr	eax,16
-
 
894
	and	ebx,0xffff
-
 
895
	mov	[bgrx],eax
-
 
896
	mov	[bgry],ebx
-
 
897
	ret
-
 
898
;------------------------------------------------------------------------------
-
 
899
align 4
-
 
900
calc_icon_pos:
-
 
901
	movzx	eax,byte [ebp-20]	; x position
-
 
902
	sub	eax,'A'		;eax - number of letter
-
 
903
	cmp	eax,4
-
 
904
	jg	no_left
-
 
905
 
-
 
906
	shl	eax,6	;imul eax,64
-
 
907
	add	eax,16
-
 
908
	movzx	ebx,[warea.left]
-
 
909
	add	eax,ebx
-
 
910
	jmp	x_done
-
 
911
;--------------------------------------
-
 
912
align 4
-
 
913
no_left:
-
 
914
	sub	eax,9
-
 
915
	sal	eax,6	;imul eax,64
-
 
916
	sub	eax,16+52-1
-
 
917
	movzx	ebx,[warea.right]
-
 
918
	add	eax,ebx
-
 
919
;--------------------------------------
-
 
920
align 4
-
 
921
x_done:
-
 
922
	mov	[ebp-12],eax
-
 
923
	movzx	eax,byte [ebp-20+1]	; y position
-
 
924
	sub	eax,'A'		; eax - number of letter
-
 
925
	cmp	eax,4
-
 
926
	jg	no_up
-
 
927
 
-
 
928
	shl	eax,6		;imul eax,80
-
 
929
	add	eax,16
-
 
930
	movzx	ebx,[warea.top]
-
 
931
	add	eax,ebx
-
 
932
	jmp	y_done
-
 
933
;--------------------------------------
-
 
934
align 4
-
 
935
no_up:
-
 
936
	sub	eax,9
-
 
937
	shl	eax,6		;imul eax,80
-
 
938
	sub	eax,16-1
-
 
939
	movzx	ebx,[warea.bottom]
-
 
940
	add	eax,ebx
-
 
941
;--------------------------------------
-
 
942
align 4
-
 
943
y_done:
-
 
944
	mov	[ebp-8],eax
-
 
945
	ret
-
 
946
;--------------------------------------
-
 
947
align 4
-
 
948
;START2:
-
 
949
load_icon_list2:
-
 
950
	call	get_bg_info
-
 
951
 
-
 
952
	mcall	48,5
-
 
953
	mov	[warea.by_x],eax
-
 
954
	mov	[warea.by_y],ebx
-
 
955
 
-
 
956
	mcall	14
-
 
957
	add	eax,0x00010001
-
 
958
	mov	[scrxy],eax
-
 
959
;--------------------------------------
-
 
960
align 4
-
 
961
apply_changes2:
-
 
962
	mov	edi,[icons]
-
 
963
	mov	esi,icon_data
-
 
964
	mov	ebp,thread_stack+0x100	;0x5000	; threads stack starting point
-
 
965
;--------------------------------------
-
 
966
align 4
-
 
967
start_new:
-
 
968
	mov	eax,[esi]
-
 
969
	mov	[ebp-20],eax
-
 
970
	call	calc_icon_pos
-
 
971
 
-
 
972
	mov	edx,ebp
-
 
973
	mov	dword[ebp-4],esi
-
 
974
	mcall	51,1,thread
-
 
975
	add	ebp,0x100
-
 
976
; change to next thread if mutex is blocked
-
 
977
	mov	eax,68
-
 
978
	mov	ebx,1
-
 
979
;--------------------------------------
-
 
980
align 4
-
 
981
wait_thread_start:		;wait until thread draw itself first time
-
 
982
	cmp	[create_thread_event],bl	;mutex
-
 
983
	jz	wait_thread_end
-
 
984
	mcall
-
 
985
	jmp	wait_thread_start
-
 
986
;--------------------------------------
-
 
987
align 4
-
 
988
wait_thread_end:
-
 
989
	dec	[create_thread_event]	;reset event
-
 
990
	add	esi,REC_SIZE
-
 
991
	dec	edi
-
 
992
	jnz	start_new
-
 
993
;--------------------------------------
-
 
994
align 4
807
align 4
995
close:
808
close:
996
	or	eax,-1
809
	or	eax,-1
997
	mcall
810
	mcall
998
;------------------------------------------------------------------------------
811
;------------------------------------------------------------------------------
999
; esp-28 = start of thread stack
-
 
1000
; esp-24 = ???
-
 
1001
; esp-20 = 'AA-F' or...
-
 
1002
; esp-16 = ebp-4 - area of f. 15.6
-
 
1003
; esp-12 = ebp+0 = X
-
 
1004
; esp-8  = ebp+4 = Y
-
 
1005
; esp-4  = ebp+8 = adress of icon_data
812
; ICON PROCESSING MODE - START2 entering label
1006
;------------------------------------------------------------------------------
813
;------------------------------------------------------------------------------
1007
align 4
814
align 4
1008
thread:
815
START2:
1009
	sub	esp,12
-
 
1010
	mov	ebp,esp
-
 
1011
	sub	esp,16
-
 
1012
	call	draw_window2
816
	mcall	40,10000b	; only Event 5 - draw background
-
 
817
	
1013
	mov	[create_thread_event],1
818
	mcall	51,1,START_mouse_thread,stack_mouse_thread
1014
	mcall	40,010101b
-
 
1015
;------------------------------------------------------------------------------
819
;------------------------------------------------------------------------------
1016
align 4
820
align 4
1017
still2:
821
still2:
1018
	mcall	10
822
	mcall	10
1019
	cmp	eax,1
-
 
1020
	je	red2
-
 
Line 1021... Line 823...
1021
 
823
 
1022
	cmp	eax,3
-
 
Line -... Line 824...
-
 
824
	mcall	15,8
-
 
825
 
-
 
826
	mov	ecx,eax
1023
	je	button2
827
	shr	ecx,16
-
 
828
	mov	[x_left],ecx
-
 
829
	and	eax,0xffff
-
 
830
	mov	[x_right],eax
-
 
831
 
-
 
832
	mov	ecx,ebx
1024
	
833
	shr	ecx,16
-
 
834
	mov	[y_top],ecx
Line 1025... Line -...
1025
	call	get_bg_info
-
 
1026
	call	draw_icon2_1
-
 
1027
	
-
 
1028
	jmp	still2
-
 
1029
;------------------------------------------------------------------------------
-
 
1030
align 4
-
 
1031
red2:
-
 
1032
	mcall	14
-
 
1033
	add	eax,0x00010001
-
 
1034
	mov	[scrxy],eax
-
 
1035
	mcall	48,5
-
 
1036
	mov	[warea.by_x],eax
-
 
1037
	mov	[warea.by_y],ebx
-
 
1038
	add	ebp,+12
-
 
1039
	call	calc_icon_pos
-
 
1040
	add	ebp,-12
-
 
1041
	mcall	9,process_table,-1
-
 
1042
	mov	eax,[process_table+process_information.box.left]
-
 
1043
	cmp	eax,[ebp+0]
-
 
1044
	jne	@f
-
 
1045
	mov	eax,[process_table+process_information.box.top]
-
 
1046
	cmp	eax,[ebp+4]
-
 
1047
	je	.lp1
-
 
1048
;--------------------------------------
835
	and	ebx,0xffff
1049
align 4
-
 
1050
@@:
-
 
1051
	call	get_bg_info
-
 
1052
	mcall	67,[ebp+0],[ebp+4],51,51
-
 
1053
;--------------------------------------
-
 
1054
align 4
-
 
1055
.lp1:
-
 
1056
	call	draw_window2
-
 
1057
	jmp	still2
-
 
1058
;------------------------------------------------------------------------------
-
 
1059
align 4
-
 
1060
button2:
-
 
Line 1061... Line -...
1061
	mcall	17
-
 
1062
	cmp	ah, 2
-
 
1063
	jnz	still2
-
 
1064
 
-
 
1065
	mcall	9,process_table,-1
-
 
1066
	mov	ecx,[ebx+30]	; PID
-
 
1067
	mcall	18,21
-
 
1068
	mov	edx,eax		; SLOT
-
 
1069
	mcall	18,7
-
 
1070
	cmp	edx,eax	; compare with active SLOT
-
 
1071
	jne	@f
-
 
1072
	mov	ecx,edx
-
 
1073
	mcall	18,1	; set to down
-
 
1074
	call	draw_window2
836
	mov	[y_bottom],ebx
1075
;--------------------------------------
-
 
1076
align 4
837
 
1077
@@:
-
 
1078
	mov	esi,[ebp+8]
-
 
1079
	mov	ebx,1
-
 
1080
	mov	edi,finfo.path
-
 
1081
	call	fill_paths
-
 
1082
	inc	ebx
-
 
1083
	mov	edi,param_str
-
 
1084
	mov	dword[finfo_start+8],edi
-
 
1085
	call	fill_paths
838
	call	get_bg_info
1086
	cmp	byte[edi],0
839
 
1087
	jne	.no0
840
	mov	ecx,[icons]
-
 
841
	mov	ebx,icon_data
-
 
842
;--------------------------------------
1088
	and	dword[finfo_start+8],0
843
align 4
-
 
844
.start_new:
-
 
845
	push	ebx ecx
-
 
846
	mov	[adress_of_icon_data],ebx
-
 
847
	mov	eax,[ebx]
-
 
848
	call	calc_icon_pos
-
 
849
	mov	[current_X],ebx
-
 
850
	mov	[current_Y],eax
1089
;--------------------------------------
851
 
-
 
852
	call	draw_picture
1090
align 4
853
	pop	ecx ebx
1091
.no0:
854
	add	ebx,REC_SIZE
1092
	mov	ebx,finfo_start
855
	dec	ecx
1093
	mcall	70
856
	jnz	.start_new
1094
	jmp	still2
-
 
1095
;------------------------------------------------------------------------------
857
	jmp	still2
1096
align 4
-
 
1097
fill_paths:
-
 
1098
	push	esi edi
-
 
1099
	movzx	ecx,byte[str_lens+ebx]
-
 
1100
	add	esi,[positions+ebx*4]
-
 
1101
	push	esi
-
 
1102
	add	esi,ecx
-
 
1103
;--------------------------------------
-
 
1104
align 4
-
 
1105
.l1:
-
 
1106
	dec	esi
-
 
1107
	cmp	byte[esi],' '
-
 
1108
	jnz	.found
-
 
1109
	loop	.l1
-
 
1110
	pop	esi
-
 
1111
	jmp	.noms
858
;------------------------------------------------------------------------------	
1112
;--------------------------------------
859
align 4
1113
align 4
-
 
1114
.found:
-
 
1115
	lea	ecx,[esi+1]
-
 
1116
	pop	esi
-
 
1117
	sub	ecx,esi
-
 
1118
	rep	movsb
-
 
1119
;--------------------------------------
-
 
1120
align 4
860
draw_picture:
1121
.noms:
-
 
1122
	and	byte[edi],0
-
 
1123
	pop	edi esi
-
 
1124
	ret
-
 
1125
;--------------------------------------
861
	mov	eax,[current_X]
1126
align 4
-
 
1127
atoi:
-
 
1128
	push	esi
-
 
1129
	xor	eax,eax
-
 
1130
	xor	ebx,ebx
-
 
1131
;--------------------------------------
862
	cmp	eax,[x_right]
1132
align 4
863
	ja	.exit
1133
.nxt:
-
 
1134
	lodsb
864
 
1135
	cmp	al,'0'
865
	add	eax,52
1136
	jb	.done
-
 
1137
	cmp	al,'9'
866
	cmp	eax,[x_left]
1138
	ja	.done
-
 
1139
	sub	eax,'0'
-
 
1140
; multiply x10
867
	jb	.exit
1141
	shl	ebx,1		; multiply x2
-
 
1142
	lea	ebx,[ebx+ebx*4] ; multiply x5
-
 
1143
	add	ebx,eax
-
 
1144
	jmp	.nxt
-
 
1145
;--------------------------------------
-
 
1146
align 4
868
 
1147
.done:
-
 
1148
	pop	esi
-
 
1149
	mov	eax,ebx
-
 
1150
	ret
869
	mov	eax,[current_Y]
1151
;--------------------------------------
870
	cmp	eax,[y_bottom]
1152
align 4
871
	ja	.exit
1153
itoa:
872
 
1154
	add	esi,2
873
	add	eax,52
1155
	mov	ebx,10
-
 
1156
	mov	ecx,3
-
 
1157
;--------------------------------------
-
 
1158
align 4
-
 
1159
.l0:
-
 
1160
	xor	edx,edx
-
 
1161
	div	ebx
-
 
1162
	add	dl,'0'
-
 
1163
	mov	[esi],dl
-
 
1164
	dec	esi
-
 
1165
	loop	.l0
-
 
1166
	ret
-
 
1167
;------------------------------------------------------------------------------
-
 
1168
align 4
-
 
1169
draw_picture:
-
 
1170
	mcall	15,6
-
 
1171
	test	eax,eax
874
	cmp	eax,[y_top]
1172
	jnz	@f
-
 
1173
	mcall	68,1
-
 
1174
	jmp	draw_picture
-
 
1175
@@:
875
	jb	.exit
1176
	mov	[ebp-4],eax
876
;--------------------------------------
1177
	mov	[image],image_area
877
align 4
-
 
878
@@:
1178
 
879
	mov	edi,[adress_of_icon_data]	;[ebp+8]
1179
	mov	edi,[ebp+8]
-
 
1180
	lea	esi,[edi+12]
-
 
1181
	call	atoi
-
 
1182
	cmp	eax,[icon_count]
-
 
1183
	ja	toponly.ex
-
 
1184
;	imul	eax,(32*3*32)
-
 
1185
	lea	eax,[eax+eax*2]	; multiply x3
-
 
1186
	shl	eax,10		; multiply x1024
-
 
1187
	
-
 
1188
	mov	edi,[strip_file]
-
 
1189
	lea	edi,[eax+edi+8]
-
 
1190
	xor	ecx,ecx
-
 
1191
	mov	esi,edi
-
 
1192
 
880
	lea	esi,[edi+12]
1193
	mov	[pixpos],0
-
 
1194
;--------------------------------------
-
 
1195
; loop Y start
-
 
1196
align 4
881
	call	ASCII_to_icon_number
1197
new_line:	
-
 
1198
	push	ecx	; Y
882
; protect for icon area RAW size limit
1199
	xor	ebx,ebx
883
	cmp	eax,[icon_count]
1200
;--------------------------------------
-
 
1201
; loop X start
-
 
1202
align 4
-
 
1203
newb:
-
 
1204
	mov	ecx,[esp]
-
 
1205
	push	ebx	; X
-
 
1206
 
-
 
1207
	cmp	ebx,10
-
 
1208
	jb	yesbpix
-
 
1209
	cmp	ebx,42
-
 
1210
	jge	yesbpix
-
 
1211
	cmp	ecx,31	;2
-
 
1212
	jg	yesbpix
-
 
1213
 
-
 
1214
	push	esi
-
 
1215
	mov	esi,edi
-
 
1216
	add	esi,[pixpos]
-
 
1217
;--------------------------------------
-
 
1218
	add	[pixpos],3
-
 
1219
	mov	eax,[esi]
-
 
1220
	and	eax,0xffffff
-
 
1221
 
-
 
1222
	pop	esi
-
 
1223
 
-
 
1224
	cmp	eax,0
-
 
1225
	je	yesbpix
-
 
1226
	cmp	eax,0xfffcff	;f5f5f5
-
 
1227
	je	yesbpix
-
 
1228
	jmp	nobpix
-
 
1229
;--------------------------------------
-
 
1230
align 4
-
 
1231
yesbpix:
-
 
1232
stretch:
-
 
1233
	cmp	[bgrdrawtype],dword 2
-
 
1234
	jne	nostretch
-
 
1235
	mov	eax,[ebp+4]
-
 
1236
	add	eax,ecx
-
 
1237
	imul	eax,[bgry]
-
 
1238
	cdq
-
 
1239
	movzx	ebx,word [scrxy]
-
 
1240
	div	ebx
-
 
1241
	imul	eax,[bgrx]
-
 
1242
	push	eax
884
	jbe	@f
1243
	mov	eax,[ebp+0]
-
 
1244
	add	eax,[esp+4]
-
 
1245
	imul	eax,[bgrx]
-
 
1246
	cdq
-
 
1247
	movzx	ebx,word [scrxy+2]
-
 
1248
	div	ebx
885
;--------------------------------------
1249
	add	eax,[esp]
886
align 4
1250
	add	esp,4
-
 
1251
	jmp	notiled
-
 
1252
;--------------------------------------
-
 
1253
align 4
-
 
1254
nostretch:
-
 
1255
	cmp	[bgrdrawtype],dword 1
887
.exit:
1256
	jne	notiled
-
 
1257
	mov	eax,[ebp+4]
-
 
1258
	add	eax,ecx
-
 
1259
	cdq
-
 
1260
	movzx	ebx,word [bgrxy]
888
	ret
1261
	div	ebx
-
 
1262
	mov	eax,edx
889
;--------------------------------------
1263
	imul	eax,[bgrx]
890
align 4
1264
	push	eax
-
 
1265
	mov	eax,[ebp+0]
891
@@:
1266
	add	eax,[esp+4]
892
	push	eax
1267
	movzx	ebx,word [bgrxy+2]
893
	mcall	68,12,52*52*4+8
1268
	cdq
894
	mov	[draw_area],eax
-
 
895
	mov	ebx,52
1269
	div	ebx
896
	mov	[eax],ebx
1270
	mov	eax,edx
897
	mov	[eax+4],ebx
1271
	add	eax,[esp]
898
	pop	eax
-
 
899
 
1272
	add	esp,4
900
	shl	eax,12		; multiply x4096
1273
;--------------------------------------
901
	add	eax,[strip_file]
1274
align 4
902
	mov	esi,eax
-
 
903
 
1275
notiled:
904
	mov	edi,[draw_area]
1276
	lea	ecx,[eax+eax*2]
905
	add	edi,(52-32)/2*4+8
1277
	add	ecx,[ebp-4]
906
	mov	ebx,32
1278
	mov	eax,[ecx]
907
	cld
1279
;--------------------------------------
-
 
1280
align 4
-
 
1281
nobpix:
-
 
1282
	mov	edx,eax
-
 
1283
	mov	eax,[image]
-
 
1284
 
-
 
1285
	mov	[eax],dl
-
 
1286
	inc	eax
-
 
1287
	ror	edx,8
908
;--------------------------------------
1288
	
-
 
1289
	mov	[eax],dl
-
 
1290
	inc	eax
-
 
1291
	ror	edx,8
-
 
1292
	
-
 
1293
	mov	[eax],dl
-
 
1294
	
-
 
1295
	inc	eax
-
 
1296
	mov	[image],eax
-
 
1297
 
-
 
1298
	pop	ebx
-
 
1299
 
-
 
1300
	inc	ebx
-
 
1301
	
-
 
1302
	mov	eax,[yw]
-
 
1303
	inc	eax
-
 
Line -... Line 909...
-
 
909
align 4	
1304
	cmp	ebx,eax
910
.y:
1305
	jb	newb
911
	mov	ecx,32
1306
 
-
 
Line 1307... Line 912...
1307
	pop	ecx
912
	rep	movsd
1308
 
-
 
Line 1309... Line -...
1309
	inc	ecx
-
 
1310
	mov	eax,[ya]
-
 
1311
	add	[pixpos],eax
913
	
1312
 
-
 
1313
	cmp	[top],1
-
 
1314
	jne	notop
914
	add	edi,(52-32)*4
1315
 
-
 
1316
	cmp	ecx,38
-
 
1317
	je	toponly
-
 
1318
;--------------------------------------
-
 
1319
align 4
915
	dec	ebx
1320
notop:
916
	jnz	.y
1321
	cmp	ecx,52
-
 
1322
	jnz	new_line
-
 
1323
;--------------------------------------
-
 
1324
align 4
-
 
1325
toponly:
917
 
1326
	mcall	15,7,[ebp-4]
918
	call	draw_text
1327
	test	eax,eax
-
 
1328
	jnz	@f
-
 
1329
	mcall	68,1
-
 
1330
	jmp	toponly
919
	
1331
@@:
920
	mov	edx,[current_X]	;[ebp+0]
1332
	xor	edx,edx
921
	shl	edx,16
1333
	mcall	7,image_area,<52,52>
922
	add	edx,[current_Y]	;[ebp+4]
1334
;--------------------------------------
923
	mov	ebx,[draw_area]
1335
align 4	
924
	add	ebx,8
1336
.ex:
925
	mcall	25,,<52,52>
1337
	mov	[load_pic],0
926
	mcall	68,13,[draw_area]
1338
	ret
927
	ret
1339
;------------------------------------------------------------------------------
928
;------------------------------------------------------------------------------
1340
align 4
929
align 4
Line 1368... Line 957...
1368
	
957
	
1369
	mov	ebx,27 shl 16+40
958
	mov	ebx,27 shl 16+40
Line 1370... Line 959...
1370
	sub	ebx,eax
959
	sub	ebx,eax
-
 
960
	
1371
	
961
	xor	ecx,ecx		; black shade of text
-
 
962
	or	ecx,0x08000000	; redirect the output to the user area
-
 
963
	add	ebx,1 shl 16	;*65536+1
1372
	xor	ecx,ecx		; black shade of text
964
	
Line 1373... Line 965...
1373
	add	ebx,1 shl 16	;*65536+1
965
	mov	edi,[draw_area]
1374
	mcall	4,,,title,[tl]
966
	mcall	4,,,title,[tl]
Line 1396... Line 988...
1396
	dec	ebx
988
	dec	ebx
1397
	add	ebx,1 shl 16
989
	add	ebx,1 shl 16
1398
	mcall
990
	mcall
Line 1399... Line 991...
1399
 
991
 
1400
	inc	ebx
992
	inc	ebx
-
 
993
	mov	ecx,0xffffff		; white text
1401
	mcall	,,0xffffff
994
	or	ecx,0x08000000	; redirect the output to the user area
1402
	mov	[draw_pic],0
995
	mcall
1403
	ret
996
	ret
1404
;------------------------------------------------------------------------------
-
 
1405
;   *********************************************
-
 
1406
;   *******  WINDOW DEFINITIONS AND DRAW ********
-
 
1407
;   *********************************************
-
 
1408
align 4
-
 
1409
draw_window2:
-
 
1410
	mcall	12,1
-
 
1411
	; DRAW WINDOW
-
 
1412
	xor	eax,eax		; function 0 : define and draw window
-
 
1413
	mov	ebx,[ebp+0-2]
-
 
1414
	mov	ecx,[ebp+4-2]
-
 
1415
	mov	bx,[yw]		; [x start] *65536 + [x size]
-
 
1416
	mov	cx,51		; [y start] *65536 + [y size]
-
 
1417
	mov	edx,0x41000000	; color of work area RRGGBB,8->color gl
-
 
1418
	mcall
-
 
1419
	
-
 
1420
	mcall	8,51,50,0x40000002 ; button
-
 
1421
;--------------------------------------
997
;------------------------------------------------------------------------------
1422
align 4
998
align 4
-
 
999
ASCII_to_icon_number:
-
 
1000
;
1423
draw_icon2_1:
1001
; in:
-
 
1002
; esi - adress of icon ASCII text number (line start + 12)
-
 
1003
;
-
 
1004
; out:
-
 
1005
; eax - number of icon
-
 
1006
;
1424
; change to next thread if mutex is blocked
1007
	push	esi
1425
	mov	eax,68
1008
	xor	eax,eax
1426
	mov	ebx,1
1009
	xor	ebx,ebx
1427
;--------------------------------------
1010
;--------------------------------------
1428
align 4
1011
align 4
1429
draw_icon2:
1012
.next:
1430
	xchg	[load_pic],bl	;mutex
1013
	lodsb
1431
	test	bl,bl
1014
	cmp	al,'0'
1432
	je	draw_icon_end
1015
	jb	.done
-
 
1016
	cmp	al,'9'
-
 
1017
	ja	.done
-
 
1018
	sub	eax,'0'
-
 
1019
; multiply x10
-
 
1020
	shl	ebx,1		; multiply x2
-
 
1021
	lea	ebx,[ebx+ebx*4] ; multiply x5
1433
	mcall
1022
	add	ebx,eax
1434
	jmp	draw_icon2
1023
	jmp	.next
1435
;--------------------------------------
1024
;--------------------------------------
1436
align 4
1025
align 4
1437
draw_icon_end:
-
 
1438
; change to next thread if mutex is blocked
1026
.done:
1439
	mov	eax,68
1027
	pop	esi
-
 
1028
	mov	eax,ebx
1440
	mov	ebx,1
1029
	ret
1441
;--------------------------------------
1030
;------------------------------------------------------------------------------
1442
align 4
1031
align 4
1443
draw_icon_2:
1032
itoa:
1444
	xchg	[draw_pic],bl	;mutex
1033
	add	esi,2
1445
	test	bl,bl
-
 
1446
	je	draw_icon_end_2
1034
	mov	ebx,10
1447
	mcall
-
 
1448
	jmp	draw_icon_2
1035
	mov	ecx,3
1449
;--------------------------------------
1036
;--------------------------------------
-
 
1037
align 4
1450
align 4
1038
.l0:
-
 
1039
	xor	edx,edx
1451
draw_icon_end_2:
1040
	div	ebx
1452
	call	draw_picture
1041
	add	dl,'0'
-
 
1042
	mov	[esi],dl
1453
	call	draw_text
1043
	dec	esi
1454
	mcall	12,2
1044
	loop	.l0
1455
	ret
1045
	ret
1456
;------------------------------------------------------------------------------
1046
;------------------------------------------------------------------------------
1457
tl	dd 8
1047
align 4
1458
yw:	dd 51
1048
get_bg_info:
1459
ya	dd 0
1049
	mcall	39,1	; get background size
1460
cur_btn	dd 40
1050
	mov	[bgrxy],eax
1461
 
1051
 
-
 
1052
	mov	ebx,eax
-
 
1053
	shr	eax,16
1462
draw_pic	db 0
1054
	and	ebx,0xffff
1463
load_pic	db 0
1055
	mov	[bgrx],eax
Line -... Line 1056...
-
 
1056
	mov	[bgry],ebx
1464
create_thread_event	db 0
1057
	
-
 
1058
	mcall	48,5
Line 1465... Line 1059...
1465
 
1059
	mov	[warea.by_x],eax
1466
image	dd image_area
1060
	mov	[warea.by_y],ebx
-
 
1061
	
1467
 
1062
	mcall	14
1468
IncludeUGlobals
1063
	add	eax,0x00010001
1469
;------------------------------------------------------------------------------
1064
	mov	[scrxy],eax
1470
IM_END:
1065
	ret
1471
;------------------------------------------------------------------------------
1066
;------------------------------------------------------------------------------
1472
align 4
-
 
1473
bgrx	dd ?
1067
align 4
1474
bgry	dd ?
1068
calc_icon_pos:
1475
 
-
 
1476
bgrxy	dd ?
1069
; in:
1477
warea:
1070
; eax - dword [icon_position]
1478
 .by_x:
1071
; out:
1479
  .right	dw ?
1072
; eax - current Y
1480
  .left		dw ?
1073
; ebx - current X
1481
 .by_y:
1074
	push	eax
1482
  .bottom	dw ?
1075
	movzx	eax,al
Line 1483... Line 1076...
1483
  .top		dw ?
1076
	sub	eax,'A'		;eax - number of letter
1484
scrxy		dd ?
1077
	cmp	eax,4
1485
bgrdrawtype	dd ?
1078
	jg	no_left
1486
 
1079
 
1487
pixpos	dd ?
1080
	shl	eax,6	;imul eax,64
1488
top	dd ?
-
 
1489
icons	dd ?
-
 
1490
addr	dd ?
-
 
1491
cur_str		dd ?
-
 
1492
cur_band	dd ?
1081
	add	eax,16
1493
sel_icon1	rd 1
1082
	movzx	ebx,[warea.left]
-
 
1083
	add	eax,ebx
-
 
1084
	jmp	x_done
-
 
1085
;--------------------------------------
-
 
1086
align 4
-
 
1087
no_left:
1494
icon_count	rd 1
1088
	sub	eax,9
1495
strip_file	rd 1
1089
	sal	eax,6	;imul eax,64
1496
;------------------------------------------------------------------------------
1090
	sub	eax,16+52-1
-
 
1091
	movzx	ebx,[warea.right]
-
 
1092
	add	eax,ebx
-
 
1093
;--------------------------------------
-
 
1094
align 4
1497
align 4
1095
x_done:
-
 
1096
	mov	ebx,eax
-
 
1097
	pop	eax
1498
param_str	rb 31
1098
	push	ebx
-
 
1099
	movzx	eax,ah
-
 
1100
	sub	eax,'A'		; eax - number of letter
-
 
1101
	cmp	eax,4
-
 
1102
	jg	no_up
-
 
1103
 
-
 
1104
	shl	eax,6		;imul eax,80
1499
;------------------------------------------------------------------------------
1105
	add	eax,16
1500
align 4
1106
	movzx	ebx,[warea.top]
1501
process_table:
1107
	add	eax,ebx
-
 
1108
	jmp	y_done
-
 
1109
;--------------------------------------
1502
	rb 0x400
1110
align 4
-
 
1111
no_up:
-
 
1112
	sub	eax,9
1503
;------------------------------------------------------------------------------	
1113
	shl	eax,6		;imul eax,80
1504
align 4
1114
	sub	eax,16-1
-
 
1115
	movzx	ebx,[warea.bottom]
1505
icon_data:
1116
	add	eax,ebx
1506
	rb 0x1000
1117
;--------------------------------------
1507
;------------------------------------------------------------------------------
1118
align 4
1508
align 4
-
 
1509
	rb 0x1000
-
 
1510
stack_area:
1119
y_done:
1511
;------------------------------------------------------------------------------
1120
	pop	ebx
1512
align 4
-
 
1513
I_Param:
1121
	ret
1514
	rb 0x100	; max 256 
-
 
1515
;------------------------------------------------------------------------------
1122
;------------------------------------------------------------------------------
1516
align 4
1123
include 'mouse.inc'
-
 
1124
;------------------------------------------------------------------------------
1517
thread_stack:
1125
include 'data.inc'
1518
	rb 0x100*48	; max 48 icons
-
 
1519
;------------------------------------------------------------------------------
1126
;------------------------------------------------------------------------------
1520
align 4
1127
IM_END:
-
 
1128
;------------------------------------------------------------------------------