Subversion Repositories Kolibri OS

Rev

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

Rev 9444 Rev 9530
Line 13... Line 13...
13
 
13
 
14
    include "DATA.INC"
14
    include "DATA.INC"
Line 15... Line 15...
15
    include "NAME.INC"
15
    include "NAME.INC"
16
 
-
 
17
    @use_library	 \
-
 
18
	    mem.Alloc,	 \
16
 
19
	    mem.Free,	 \
-
 
20
	    mem.ReAlloc, \
17
    @use_library \
-
 
18
        mem.Alloc, mem.Free, mem.ReAlloc, dll.Load
21
	    dll.Load
19
;================================================================================
22
;================================================================================
20
 
-
 
21
main:
-
 
22
; ==== Init ====
-
 
23
    mcall   SF_SYS_MISC, SSF_HEAP_INIT
-
 
24
    mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
23
main:
25
    call    LOAD_ICONS
24
; ==== Init ====
26
 
Line 25... Line 27...
25
    mcall   SF_SYSTEM, SSF_GET_ACTIVE_WINDOW
27
    mcall   SF_SYSTEM, SSF_GET_ACTIVE_WINDOW
Line 40... Line 42...
40
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.ashow_name, 0
42
    invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.ashow_name, 0
41
    mov     [dock_items.ashow], eax
43
    mov     [dock_items.ashow], eax
Line 42... Line 44...
42
 
44
 
Line 43... Line -...
43
    invoke  ini.sections, ini_data.file_name, sections_callback
-
 
44
 
-
 
45
; ==== Load colors ====
-
 
46
    mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, color
-
 
47
    or	    dword[color.bg],	0x10000000
-
 
48
    or	    dword[color.frame], 0x10000000
-
 
49
    or	    dword[color.text],	0x80000000
-
 
50
 
-
 
51
; ==== Config LibIMG ====
-
 
52
    mov     dword[fi.p00], SSF_GET_INFO
-
 
53
    mov     dword[fi.p16], buf_128
-
 
54
    mov     dword[fi.p21], img_data.file_name
-
 
55
 
-
 
56
    mcall   SF_FILE, fi
-
 
57
 
-
 
58
    mov     edx, [buf_128 + 32]
-
 
59
    imul    edx, 10
-
 
60
 
-
 
61
    stdcall mem.Alloc, edx
-
 
62
    mov     [img_data.rgb_object], eax
-
 
63
 
-
 
64
    mov     dword[fi.p00], SSF_READ_FILE
-
 
65
    mov     dword[fi.p12], edx
-
 
66
    m2m     dword[fi.p16], dword[img_data.rgb_object]
-
 
67
    mov     dword[fi.p21], img_data.file_name
-
 
68
 
-
 
69
    mcall   SF_FILE, fi
-
 
70
 
-
 
71
    cmp     ebx, 0xFFFFFFFF
-
 
72
    je	    @f
-
 
73
 
-
 
74
    stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
-
 
75
    mov     dword[img_data.object], eax
-
 
76
 
-
 
77
  ; === ALPHA ===
-
 
78
    mov     edi, eax
-
 
79
    add     edi, 8
-
 
80
    mov     edi, [edi]
-
 
81
    imul    edi, 128
-
 
82
    sub     edi, 4
-
 
83
 
-
 
84
    add     eax, 24
-
 
85
    mov     eax, [eax]
-
 
86
 .setalpha:
-
 
87
    mov     ebx, [eax + edi]
-
 
88
    shr     ebx, 24
-
 
89
    cmp     ebx, 0
-
 
90
    jne     .nonalpha
-
 
91
 
-
 
92
    mov     ecx, [color.bg]
-
 
93
    mov     [eax + edi], ecx
-
 
94
 .nonalpha:
-
 
95
    sub     edi, 4
-
 
96
    cmp     edi, 0
-
 
97
    jne     .setalpha
-
 
98
 
-
 
99
  ; === CONVERTING TO BGR
-
 
100
    stdcall dword[img.toRGB], dword[img_data.object], dword[img_data.rgb_object]
-
 
101
    stdcall dword[img.destroy], dword[img_data.object]
45
    invoke  ini.sections, ini_data.file_name, sections_callback
102
 
46
 
103
; ==== Config window ====
47
; ==== Config window ====
104
    mov     eax, dword[dock_items.location]
48
    mov     eax, dword[dock_items.location]
105
    and     eax, 1b
49
    and     eax, 1b
Line 157... Line 101...
157
    jmp     .set_hw
101
    jmp     .set_hw
158
  @@:
102
  @@:
159
    mcall   SF_GET_SCREEN_SIZE
103
    mcall   SF_GET_SCREEN_SIZE
160
    shr     eax, 16
104
    shr     eax, 16
161
 .set_hw:
105
 .set_hw:
162
    mov     [win.width_opn], eax
106
    mov     [win.w_opn], eax
163
    mov     [win.width_hdn], eax
107
    mov     [win.w_hdn], eax
Line 164... Line 108...
164
 
108
 
Line 165... Line 109...
165
    ret
109
    ret
166
 
110
 
167
;-------------------------------------------------------------------------------
111
;-------------------------------------------------------------------------------
168
 .HORZ_X:
112
 .HORZ_X:
169
    mcall   SF_GET_SCREEN_SIZE
113
    mcall   SF_GET_SCREEN_SIZE
170
    shr     eax, 17
114
    shr     eax, 17
171
    mov     ecx, [win.width_opn]
115
    mov     ecx, [win.w_opn]
172
    shr     ecx, 1
116
    shr     ecx, 1
173
    sub     eax, ecx
117
    sub     eax, ecx
Line 174... Line 118...
174
    mov     [win.x_opn], eax
118
    mov     [win.x_opn], eax
Line 175... Line 119...
175
    mov     [win.x_hdn], eax
119
    mov     [win.x_hdn], eax
176
 
120
 
177
    ret
121
    ret
178
 
122
 
Line 179... Line 123...
179
;-------------------------------------------------------------------------------
123
;-------------------------------------------------------------------------------
Line 180... Line 124...
180
 .HORZ_HEIGHT:
124
 .HORZ_HEIGHT:
181
    mov     dword[win.height_hdn], 3
125
    mov     dword[win.h_hdn], 3
Line 200... Line 144...
200
 
144
 
Line 201... Line 145...
201
    ret
145
    ret
202
 
146
 
203
;-------------------------------------------------------------------------------
147
;-------------------------------------------------------------------------------
204
 .VERT_WIDTH:
148
 .VERT_WIDTH:
Line 205... Line 149...
205
    mov     dword[win.width_opn], BUTTON_SIZE
149
    mov     dword[win.w_opn], BUTTON_SIZE
Line 206... Line 150...
206
    mov     dword[win.width_hdn], 3
150
    mov     dword[win.w_hdn], 3
207
 
151
 
Line 235... Line 179...
235
    jmp     .set_vh
179
    jmp     .set_vh
236
  @@:
180
  @@:
237
    mcall   SF_GET_SCREEN_SIZE
181
    mcall   SF_GET_SCREEN_SIZE
238
    and     eax, 0xFFFF
182
    and     eax, 0xFFFF
239
 .set_vh:
183
 .set_vh:
240
    mov     [win.height_opn], eax
184
    mov     [win.h_opn], eax
241
    mov     [win.height_hdn], eax
185
    mov     [win.h_hdn], eax
Line 242... Line 186...
242
 
186
 
Line 243... Line 187...
243
    ret
187
    ret
244
 
188
 
245
;-------------------------------------------------------------------------------
189
;-------------------------------------------------------------------------------
246
 .VERT_Y:
190
 .VERT_Y:
247
    mcall   SF_GET_SCREEN_SIZE
191
    mcall   SF_GET_SCREEN_SIZE
Line 248... Line 192...
248
    and     eax, 0xFFFF
192
    and     eax, 0xFFFF
249
    shr     eax, 1
193
    shr     eax, 1
250
 
194
 
Line 251... Line 195...
251
    mov     esi, [win.height_opn]
195
    mov     esi, [win.h_opn]
252
    shr     esi, 1
196
    shr     esi, 1
Line 253... Line 197...
253
    sub     eax, esi
197
    sub     eax, esi
Line 254... Line 198...
254
 
198
 
255
    mov     [win.y_hdn], eax
199
    mov     [win.y_hdn], eax
256
    mov     [win.y_opn], eax
200
    mov     [win.y_opn], eax
257
 
201
 
Line 258... Line 202...
258
    ret
202
    ret
259
 
203
 
Line 260... Line 204...
260
;-------------------------------------------------------------------------------
204
;-------------------------------------------------------------------------------
261
 .SETDEF:
205
 .SETDEF:
Line 262... Line 206...
262
    mov     eax, [win.width_hdn]
206
    mov     eax, [win.w_hdn]
263
    mov     [win.width], eax
207
    mov     [win.w], eax
Line 264... Line 208...
264
 
208
 
265
    mov     eax, [win.x_hdn]
209
    mov     eax, [win.x_hdn]
Line 266... Line 210...
266
    mov     [win.x], eax
210
    mov     [win.x], eax
267
 
211
 
Line 268... Line 212...
268
    mov     eax, [win.height_hdn]
212
    mov     eax, [win.h_hdn]
269
    mov     [win.height], eax
213
    mov     [win.h], eax
Line 270... Line 214...
270
 
214
 
271
    mov     eax, [win.y_hdn]
215
    mov     eax, [win.y_hdn]
Line 272... Line 216...
272
    mov     [win.y], eax
216
    mov     [win.y], eax
273
	
217
    
Line 274... Line 218...
274
    cmp     byte[dock_items.ashow],1
218
    cmp     byte[dock_items.ashow],1
Line 298... Line 242...
298
    mov     [win.sid], eax
242
    mov     [win.sid], eax
Line 299... Line 243...
299
 
243
 
300
    call    main_loop
244
    call    main_loop
301
;-------------------------------------------------------------------------------
245
;-------------------------------------------------------------------------------
302
exit:
-
 
303
    stdcall mem.Free, [img_data.rgb_object]
246
exit:
304
    mcall   SF_SYSTEM, SSF_TERMINATE_THREAD, [nwin.sid]
247
    mcall   SF_SYSTEM, SSF_TERMINATE_THREAD, [nwin.sid]
305
    mcall   SF_TERMINATE_PROCESS
248
    mcall   SF_TERMINATE_PROCESS
306
;-------------------------------------------------------------------------------
249
;-------------------------------------------------------------------------------
307
align 4
250
align 4
Line 324... Line 267...
324
    jmp     main_loop
267
    jmp     main_loop
325
;-------------------------------------------------------------------------------
268
;-------------------------------------------------------------------------------
326
DRAW_WINDOW:
269
DRAW_WINDOW:
327
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
270
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
Line -... Line 271...
-
 
271
    
-
 
272
    push    dword [sc.work]
-
 
273
    mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
-
 
274
    pop     eax
-
 
275
    cmp     dword [sc.work], eax
-
 
276
    je      @f
-
 
277
    call    LOAD_ICONS
328
 
278
  @@:
329
    mov     esi, [color.bg]
279
    mov     esi, [sc.work]
330
    or	    esi, 0x01000000
280
    or        esi, 0x01000000
Line 331... Line 281...
331
    mcall   SF_CREATE_WINDOW, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], , [color.frame]
281
    mcall   SF_CREATE_WINDOW, <[win.x], [win.w]>, <[win.y], [win.h]>, [sc.work], , [sc.work_dark]
332
 
282
 
333
    xor     edi, edi
283
    xor     edi, edi
334
  @@:
284
  @@:
Line 335... Line 285...
335
    cmp     edi, [dock_items.count]
285
    cmp     edi, [dock_items.count]
336
    je	    @f
286
    je        @f
337
 
287
 
338
    push    edi
288
    push    edi
339
    mov     eax, SF_DEFINE_BUTTON
289
    mov     eax, SF_DEFINE_BUTTON
340
    mov     edx, 0x60000002
290
    mov     edx, 0x60000002
341
    mov     esi, [color.bg]
291
    mov     esi, [sc.work]
342
    imul    edi, BUTTON_SIZE
292
    imul    edi, BUTTON_SIZE
343
    add     edi, 12
293
    add     edi, 12
Line 368... Line 318...
368
    shl     ebx, 16
318
    shl     ebx, 16
369
    add     ebx, 2
319
    add     ebx, 2
Line 370... Line 320...
370
 
320
 
371
    cmp     byte[win.isvert], 1
321
    cmp     byte[win.isvert], 1
372
    je	    .vert_draw_sep
322
    je      .vert_draw_sep
373
    mcall   , , <4,  36>, [color.frame]
323
    mcall   , , <4,  36>, [sc.work_dark]
374
    jmp     .end_inner_sep
324
    jmp     .end_inner_sep
375
 .vert_draw_sep:
325
 .vert_draw_sep:
376
    sub     ebx, 12 shl 16
326
    sub     ebx, 12 shl 16
377
    mov     ecx, ebx
327
    mov     ecx, ebx
378
    mcall   , <4, 36>, , [color.frame]
328
    mcall   , <4, 36>, , [sc.work_dark]
379
 .end_inner_sep:
329
 .end_inner_sep:
380
    pop     ecx
330
    pop     ecx
381
    pop     ebx
331
    pop     ebx
Line 395... Line 345...
395
 .digend:
345
 .digend:
Line 396... Line 346...
396
 
346
 
397
    imul    ebx, edi, 4
347
    imul    ebx, edi, 4
398
    add     ebx, dock_items.icon
348
    add     ebx, dock_items.icon
399
    mov     ebx, [ebx]
-
 
400
    imul    ebx, ICON_SIZE_BGR
-
 
Line -... Line 349...
-
 
349
    mov     ebx, [ebx]
-
 
350
 
-
 
351
    push    edi
401
    add     ebx, [img_data.rgb_object]
352
    imul    ebx, 32*32*4
-
 
353
    add     ebx, [icons_inactive]
Line 402... Line 354...
402
 
354
    mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
403
    mcall   SF_PUT_IMAGE, , <32, 32>
355
    pop     edi 
404
 
356
 
Line 424... Line 376...
424
 
376
 
425
 ;.button_close:
377
 ;.button_close:
Line 426... Line 378...
426
 ;   jmp     exit
378
 ;   jmp     exit
427
 
379
 
428
 .button_dock:
380
 .button_dock:
Line 429... Line 381...
429
    mov     edi, [win.button_index]
381
    mov     edi, [win.btn_index]
Line 430... Line 382...
430
    imul    edi, 256
382
    imul    edi, 256
Line 460... Line 412...
460
    and     esi, 0xFFFF
412
    and     esi, 0xFFFF
Line 461... Line 413...
461
 
413
 
462
    cmp     edi, 0
414
    cmp     edi, 0
463
    jl	    wnd_hide
415
    jl        wnd_hide
464
    dec     edi
416
    dec     edi
465
    cmp     edi, [win.width]
417
    cmp     edi, [win.w]
466
    jg	    wnd_hide
418
    jg        wnd_hide
467
    cmp     esi, 0
419
    cmp     esi, 0
468
    jl	    wnd_hide
420
    jl        wnd_hide
469
    dec     esi
421
    dec     esi
470
    cmp     esi, [win.height]
422
    cmp     esi, [win.h]
Line 471... Line 423...
471
    jg	    wnd_hide
423
    jg        wnd_hide
Line 472... Line 424...
472
 
424
 
Line 495... Line 447...
495
 
447
 
496
 .set0:
448
 .set0:
Line 497... Line 449...
497
    mov     eax, 100
449
    mov     eax, 100
498
 
450
 
499
 .nxtcmp:
451
 .nxtcmp:
Line 500... Line 452...
500
    cmp     [win.button_index], eax
452
    cmp     [win.btn_index], eax
501
    je	    .nxt2
453
    je        .nxt2
Line 502... Line 454...
502
 
454
 
Line 503... Line 455...
503
    push    dword[win.button_index]
455
    push    dword[win.btn_index]
504
    pop     dword[win.prev_index]
456
    pop     dword[win.prev_index]
Line 505... Line 457...
505
 
457
 
506
    mov     [win.button_index], eax
458
    mov     [win.btn_index], eax
507
 
459
 
508
 ; ==== DRAW SELECTION ====
460
 ; ==== DRAW SELECTION ====
509
    call    DRAW_SELECTION
461
    call    DRAW_SELECTION
510
 
462
 
511
 .nxt2:
463
 .nxt2:
512
    mov     eax, [win.button_index]
464
    mov     eax, [win.btn_index]
513
    imul    eax, BUTTON_SIZE
465
    imul    eax, BUTTON_SIZE
514
    cmp     byte[win.isvert], 1
466
    cmp     byte[win.isvert], 1
515
    je	    .vert_name
467
    je        .vert_name
516
    add     eax, [win.x]
468
    add     eax, [win.x]
517
    mov     [nwin.x], eax
469
    mov     [nwin.x], eax
518
    mov     byte[nwin.change_shape], 1
470
    mov     byte[nwin.swap_shape], 1
519
    mcall   SF_DRAW_RECT, <0, [win.width]>, <[win.height], 1>, [color.frame]
471
    mcall   SF_DRAW_RECT, <0, [win.w]>, <[win.h], 1>, [sc.work_dark]
520
    jmp     .vert_end
472
    jmp     .vert_end
521
 .vert_name:
473
 .vert_name:
Line 522... Line 474...
522
    add     eax, [win.y]
474
    add     eax, [win.y]
523
    add     eax, 14
475
    add     eax, 14
524
    mov     [nwin.y], eax
476
    mov     [nwin.y], eax
Line 539... Line 491...
539
 
491
 
Line 540... Line 492...
540
    mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.sid]
492
    mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.sid]
Line 541... Line 493...
541
 
493
 
542
    mov     byte[win.state], 1
-
 
543
 
-
 
544
    mov     eax, [win.width_opn]
494
    mov     byte[win.state], 1
545
    mov     [win.width], eax
-
 
546
 
-
 
547
    mov     eax, [win.x_opn]
495
 
548
    mov     [win.x], eax
-
 
549
 
-
 
550
    mov     eax, [win.height_opn]
496
    m2m     dword [win.x], dword [win.x_opn]
551
    mov     [win.height], eax
-
 
552
 
-
 
Line 553... Line 497...
553
    mov     eax, [win.y_opn]
497
    m2m     dword [win.y], dword [win.y_opn]
554
    mov     [win.y], eax
498
    m2m     dword [win.w], dword [win.w_opn]
555
 
499
    m2m     dword [win.h], dword [win.h_opn]
Line 556... Line 500...
556
 
500
 
557
    cmp     byte[dock_items.ashow],1
501
    cmp     byte[dock_items.ashow],1
558
    je	   .change_nothing
502
    je       .change_nothing
559
    mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.width], [win.height]
503
    mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.w], [win.h]
Line 571... Line 515...
571
    mov     byte[nwin.close], 1
515
    mov     byte[nwin.close], 1
Line 572... Line 516...
572
 
516
 
Line 573... Line 517...
573
    mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.psid]
517
    mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.psid]
574
 
518
 
Line 575... Line 519...
575
    mov     byte[win.state], 0
519
    mov     byte[win.state], 0
576
    mov     byte[win.button_index], -1
520
    mov     byte[win.btn_index], -1
Line 577... Line 521...
577
 
521
 
578
    cmp     byte[dock_items.ashow],1
522
    cmp     byte[dock_items.ashow],1
579
    je	   .do_no_hide
-
 
580
 
523
    je       .do_no_hide
581
    mov     eax, [win.width_hdn]
-
 
582
    mov     [win.width], eax
-
 
583
 
524
 
584
    mov     eax, [win.x_hdn]
-
 
Line 585... Line -...
585
    mov     [win.x], eax
-
 
586
 
-
 
587
    mov     eax, [win.height_hdn]
-
 
588
    mov     [win.height], eax
525
    m2m     dword [win.x], dword [win.x_hdn]
Line 589... Line 526...
589
 
526
    m2m     dword [win.y], dword [win.y_hdn]
590
    mov     eax, [win.y_hdn]
527
    m2m     dword [win.w], dword [win.w_hdn]
591
    mov     [win.y], eax
528
    m2m     dword [win.h], dword [win.h_hdn]
592
 
529
 
Line 608... Line 545...
608
    jne     @f
545
    jne     @f
609
    xchg    ebx, ecx
546
    xchg    ebx, ecx
610
    sub     ecx, 0x000C0000
547
    sub     ecx, 0x000C0000
611
  @@:
548
  @@:
Line 612... Line 549...
612
 
549
 
Line 613... Line 550...
613
    mcall   SF_DRAW_RECT, , , [color.bg]
550
    mcall   SF_DRAW_RECT, , , [sc.work]
614
 
551
 
615
    mov     edx, ebx
552
    mov     edx, ebx
616
    shr     ecx, 16
553
    shr     ecx, 16
Line 617... Line 554...
617
    mov     dx, cx
554
    mov     dx,  cx
618
    add     edx, 0x00040004
555
    add     edx, 0x00040004
619
 
556
 
620
    mov     ebx, [win.prev_index]
557
    mov     ebx, [win.prev_index]
621
    imul    ebx, 4
558
    imul    ebx, 4
622
    add     ebx, dock_items.icon
559
    add     ebx, dock_items.icon
623
    mov     ebx, [ebx]
-
 
624
    imul    ebx, ICON_SIZE_BGR
560
    mov     ebx, [ebx]
Line 625... Line 561...
625
    add     ebx, [img_data.rgb_object]
561
    imul    ebx, 32*32*4
626
 
562
    add     ebx, [icons_inactive]
627
    mcall   SF_PUT_IMAGE, , <32, 32>
563
    mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
628
 
564
 
629
    mov     ebx, [win.button_index]
565
    mov     ebx, [win.btn_index]
630
    imul    ebx, BUTTON_SIZE
566
    imul    ebx, BUTTON_SIZE
Line 637... Line 573...
637
    jne     @f
573
    jne     @f
638
    xchg    ebx, ecx
574
    xchg    ebx, ecx
639
    sub     ecx, 0x000C0000
575
    sub     ecx, 0x000C0000
640
  @@:
576
  @@:
Line 641... Line 577...
641
 
577
 
Line 642... Line 578...
642
    mcall   SF_DRAW_RECT, , , [color.bt]
578
    mcall   SF_DRAW_RECT, , , [sc.work_button]
643
 
579
 
644
    mov     edx, ebx
580
    mov     edx, ebx
645
    shr     ecx, 16
581
    shr     ecx, 16
Line 646... Line 582...
646
    mov     dx, cx
582
    mov     dx, cx
647
    add     edx, 0x00040004
583
    add     edx, 0x00040004
648
 
584
 
649
    mov     ecx, [win.button_index]
585
    mov     ebx, [win.btn_index]
650
    imul    ecx, 4
586
    imul    ebx, 4
651
    add     ecx, dock_items.icon
587
    add     ebx, dock_items.icon
-
 
588
    mov     ebx, [ebx]
652
    mov     ecx, [ecx]
589
    imul    ebx, 32*32*4
-
 
590
    add     ebx, [icons_active]
-
 
591
    mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
-
 
592
    
-
 
593
    ret
-
 
594
;-------------------------------------------------------------------------------
653
    imul    ecx, ICON_SIZE_BGR
595
proc icon32cpy uses ecx edx edi esi, dest:dword, src:dword, len:dword, bgcol:dword
-
 
596
    mov     edi, [dest] 
654
    add     ecx, [img_data.rgb_object]
597
    mov     esi, [src] 
-
 
598
    mov     ecx, [len]
655
 
599
    mov     edx, [bgcol]
-
 
600
.loop: 
-
 
601
    m2m     dword [edi], dword [esi]
656
    mov     ebx, sel_img
602
    cmp     dword [edi], 0
657
 
603
    jne     @f
658
    mov     edi, 0
604
    mov     dword [edi], edx 
659
  @@:
605
   @@:
660
    mov     al, byte[ecx + 2]
606
    add     edi, 4
661
    shl     eax, 8
607
    add     esi, 4
662
    mov     al, byte[ecx + 1]
608
    sub     ecx, 4
-
 
609
    cmp     ecx, 4
-
 
610
    jg      .loop
-
 
611
 
-
 
612
    ret 
663
    shl     eax, 8
613
endp
-
 
614
;-------------------------------------------------------------------------------
-
 
615
LOAD_ICONS:
-
 
616
    mov     esi, 0 ; esi is a counter of mem_open attempts
664
    mov     al, byte[ecx + 0]
617
  @@:
665
 
618
    ; try to open shr memory, if failed then make 5 attempts more
666
    or	    eax, 0x10000000
619
    mcall   SF_SYS_MISC, SSF_MEM_OPEN,icons_resname ; 0 = SHM_READ
667
    cmp     eax, [color.bg]
-
 
668
    jne     .notbg
-
 
669
    mov     eax, [color.bt]
620
    cmp     eax,0
670
 .notbg:
621
    jne     @f
671
 
622
    inc     esi
672
    mov     byte[ebx + 0], al
623
    cmp     esi,10
-
 
624
    je      exit
673
    shr     eax, 8
625
    mcall   SF_SLEEP, 70
-
 
626
    jmp     @b
674
    mov     byte[ebx + 1], al
627
  @@:
675
    shr     eax, 8
628
    mov     [shr_icons_ptr], eax
-
 
629
    mov     [shr_icons_len], edx
676
    mov     byte[ebx + 2], al
630
    
Line -... Line 631...
-
 
631
    mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_active]
-
 
632
    mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
677
 
633
    mov     [icons_active], eax
Line 678... Line 634...
678
    add     ebx, 3
634
    
679
    add     ecx, 3
635
    mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_inactive]
Line 680... Line 636...
680
 
636
    mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
Line 681... Line 637...
681
    add     edi, 3
637
    mov     [icons_inactive], eax  
682
 
638
    
683
    cmp     edi, 1024 * 3
639
    stdcall icon32cpy, [icons_inactive], [shr_icons_ptr], [shr_icons_len], [sc.work]
684
    jne     @b
640
    stdcall icon32cpy, [icons_active],   [shr_icons_ptr], [shr_icons_len], [sc.work_button]