Subversion Repositories Kolibri OS

Rev

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

Rev 1751 Rev 2245
1
;********************************
1
;********************************
2
;*                              *
2
;*                              *
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
;  22.02.05 was modified for work with new multi-thread ICON.
8
;  22.02.05 was modified for work with new multi-thread ICON.
9
;  8.03.07 ïåðåõîä íà 70 ôóíêöèþ by SPraid
9
;  8.03.07 ïåðåõîä íà 70 ôóíêöèþ by SPraid
10
;******************************************************************************
10
;******************************************************************************
11
RAW_SIZE equ 350000
11
RAW_SIZE equ 350000
12
ICON_SIZE equ 32*32*3
12
ICON_SIZE equ 32*32*3
13
GIF_SIZE equ 45000
13
GIF_SIZE equ 45000
14
REC_SIZE equ 80
14
REC_SIZE equ 80
15
ICONS_DAT equ '/sys/ICONS.DAT'
15
ICONS_DAT equ '/sys/ICONS.DAT'
16
ICON_APP equ '/sys/ICON'
16
ICON_APP equ '/sys/ICON'
17
ICON_STRIP equ '/sys/ICONSTRP.GIF'
17
ICON_STRIP equ '/sys/ICONSTRP.GIF'
18
 
18
 
19
  use32
19
  use32
20
  org    0x0
20
  org    0x0
21
  db     'MENUET01'     ; 8 byte id
21
  db     'MENUET01'     ; 8 byte id
22
  dd     0x01           ; header version
22
  dd     0x01           ; header version
23
  dd     START          ; start of code
23
  dd     START          ; start of code
24
  dd     I_END          ; size of image
24
  dd     I_END          ; size of image
25
  dd     icon_data+0x30000        ; memory for app
25
  dd     icon_data+0x30000        ; memory for app
26
  dd     icon_data+0x30000        ; esp
26
  dd     icon_data+0x30000        ; esp
27
  dd     I_Param , 0x0  ; I_Param , I_Icon
27
  dd     I_Param , 0x0  ; I_Param , I_Icon
28
include  '../../../macros.inc'
28
include  '../../../macros.inc'
29
include  'lang.inc'
29
include  'lang.inc'
30
COLOR_ORDER equ MENUETOS
30
COLOR_ORDER equ MENUETOS
31
include  'gif_lite.inc'
31
include  'gif_lite.inc'
32
;include  'debug.inc'
32
;include  'debug.inc'
33
purge newline
33
purge newline
34
;******************************************************************************
34
;******************************************************************************
35
START:                       ; start of execution
35
START:                       ; start of execution
36
    mcall 70,finfo
36
    mcall 70,finfo
37
    cmp   ebx,GIF_SIZE
37
    cmp   ebx,GIF_SIZE
38
    ja    close
38
    ja    close
39
    mov   esi,gif_file
39
    mov   esi,gif_file
40
    mov   edi,strip_file
40
    mov   edi,strip_file
41
    mov   eax,icon_data
41
    mov   eax,icon_data
42
    call  ReadGIF
42
    call  ReadGIF
43
    mov  eax,dword[edi+4]
43
    mov  eax,dword[edi+4]
44
    shr  eax,5
44
    shr  eax,5
45
    mov  [icon_count],eax
45
    mov  [icon_count],eax
46
    call load_ic
46
    call load_ic
47
  boot_str:
47
  boot_str:
48
    cmp   [I_Param],dword 'BOOT'
48
    cmp   [I_Param],dword 'BOOT'
49
    je   load_icon_list2
49
    je   load_icon_list2
50
      call  load_icon_list
50
      call  load_icon_list
51
 red:
51
 red:
52
    call draw_window         ; at first, draw the window
52
    call draw_window         ; at first, draw the window
53
    mov  esi,[current_icon]
53
    mov  esi,[current_icon]
54
    jmp  band
54
    jmp  band
55
still:
55
still:
56
 
56
 
57
    mov  eax,10              ; wait here for event
57
    mov  eax,10              ; wait here for event
58
    mcall
58
    mcall
59
 
59
 
60
    dec  eax                   ; redraw request ?
60
    dec  eax                   ; redraw request ?
61
    jz   red
61
    jz   red
62
    dec  eax                   ; key in buffer ?
62
    dec  eax                   ; key in buffer ?
63
    jz   key
63
    jz   key
64
 
64
 
65
  button:                    ; button
65
  button:                    ; button
66
    mov  al,17              ; get id
66
    mov  al,17              ; get id
67
    mcall
67
    mcall
68
 
68
 
69
    shr  eax,8
69
    shr  eax,8
70
 
70
 
71
    cmp  eax,1               ; button id=1 ?
71
    cmp  eax,1               ; button id=1 ?
72
    je   close
72
    je   close
73
  noclose:
73
  noclose:
74
      mov  esi,[current_icon]
74
      mov  esi,[current_icon]
75
      add  esi,12
75
      add  esi,12
76
    mov  ebx,[cur_band];eax
76
    mov  ebx,[cur_band];eax
77
    cmp  eax,31
77
    cmp  eax,31
78
    jne  .no_back
78
    jne  .no_back
79
    add  ebx,8
79
    add  ebx,8
80
    mov  eax,[icon_count]
80
    mov  eax,[icon_count]
81
    cmp  eax,ebx
81
    cmp  eax,ebx
82
    jae  .drwic2
82
    jae  .drwic2
83
    xor  ebx,ebx
83
    xor  ebx,ebx
84
    jmp  .drwic2
84
    jmp  .drwic2
85
  .no_back:
85
  .no_back:
86
    cmp  eax,30
86
    cmp  eax,30
87
    jne  .no_side
87
    jne  .no_side
88
    test ebx,ebx
88
    test ebx,ebx
89
    jnz  .dec
89
    jnz  .dec
90
    mov  ebx,[icon_count]
90
    mov  ebx,[icon_count]
91
         and  ebx,0xfffffff8
91
         and  ebx,0xfffffff8
92
    add  ebx,8
92
    add  ebx,8
93
  .dec:
93
  .dec:
94
    sub  ebx,8
94
    sub  ebx,8
95
  .drwic2:
95
  .drwic2:
96
    mov  [cur_band],ebx
96
    mov  [cur_band],ebx
97
  .drwic1:
97
  .drwic1:
98
    call draw_icon
98
    call draw_icon
99
    jmp  still
99
    jmp  still
100
    .no_side:
100
    .no_side:
101
       cmp  eax,32
101
       cmp  eax,32
102
       jne  .no_ico
102
       jne  .no_ico
103
       push ebx
103
       push ebx
104
       mcall 37,1
104
       mcall 37,1
105
       pop  ebx
105
       pop  ebx
106
          shr  eax,16
106
          shr  eax,16
107
       sub  eax,33-19
107
       sub  eax,33-19
108
          mov  edi,34
108
          mov  edi,34
109
          xor  edx,edx
109
          xor  edx,edx
110
          div  edi
110
          div  edi
111
    lea  ecx,[ebx+eax]
111
    lea  ecx,[ebx+eax]
112
    cmp  ecx,[icon_count]
112
    cmp  ecx,[icon_count]
113
    jae  still
113
    jae  still
114
          mov  [sel_icon1],eax
114
          mov  [sel_icon1],eax
115
          mov  ecx,eax
115
          mov  ecx,eax
116
    add  eax,ebx
116
    add  eax,ebx
117
    call itoa
117
    call itoa
118
          jmp  .drwic1
118
          jmp  .drwic1
119
  .no_ico:
119
  .no_ico:
120
    cmp  eax,11
120
    cmp  eax,11
121
    jb   no_str
121
    jb   no_str
122
    cmp  eax,13
122
    cmp  eax,13
123
    jg   no_str
123
    jg   no_str
124
    call read_string
124
    call read_string
125
    jmp  still
125
    jmp  still
126
  no_str:
126
  no_str:
127
 
127
 
128
 
128
 
129
    cmp  eax,21              ; apply changes
129
    cmp  eax,21              ; apply changes
130
    jne  no_apply
130
    jne  no_apply
131
 
131
 
132
    ; (1) save list
132
    ; (1) save list
133
 
133
 
134
    mov  ebx,finfo							; Change by spraid
134
    mov  ebx,finfo							; Change by spraid
135
    mov  dword[ebx],2
135
    mov  dword[ebx],2
136
    mov  edx,REC_SIZE
136
    mov  edx,REC_SIZE
137
    imul edx,dword [icons]
137
    imul edx,dword [icons]
138
    mov  [ebx+12],edx
138
    mov  [ebx+12],edx
139
    mov  esi,iconlst
139
    mov  esi,iconlst
140
    call lst_path
140
    call lst_path
141
    mov eax,70
141
    mov eax,70
142
    mcall
142
    mcall
143
 
143
 
144
    ; (2) terminate all icons
144
    ; (2) terminate all icons
145
    mov  eax,9
145
    mov  eax,9
146
    mov  ebx,I_END
146
    mov  ebx,I_END
147
    or      ecx,-1
147
    or      ecx,-1
148
    mcall
148
    mcall
149
    mov  edi,[ebx+30]
149
    mov  edi,[ebx+30]
150
     newread2:
150
     newread2:
151
    mov  esi,1
151
    mov  esi,1
152
   newread:
152
   newread:
153
    inc  esi
153
    inc  esi
154
    mov  eax,9
154
    mov  eax,9
155
    mov  ebx,I_END
155
    mov  ebx,I_END
156
    mov  ecx,esi
156
    mov  ecx,esi
157
    mcall
157
    mcall
158
    cmp  edi,[ebx+30]
158
    cmp  edi,[ebx+30]
159
    je   newread
159
    je   newread
160
    cmp  esi,eax
160
    cmp  esi,eax
161
    jg   all_terminated
161
    jg   all_terminated
162
 
162
 
163
    mov  eax,[I_END+10]
163
    mov  eax,[I_END+10]
164
    and  eax,not 20202020h
164
    and  eax,not 20202020h
165
    cmp  eax,'@ICO'
165
    cmp  eax,'@ICO'
166
    jz   @f
166
    jz   @f
167
    cmp  eax,'ICON'
167
    cmp  eax,'ICON'
168
    jne  newread
168
    jne  newread
169
   @@:
169
   @@:
170
    mov  eax,51
170
    mov  eax,51
171
    cmp  eax,[I_END+42]
171
    cmp  eax,[I_END+42]
172
    jne  newread
172
    jne  newread
173
    cmp  eax,[I_END+46]
173
    cmp  eax,[I_END+46]
174
    jne  newread
174
    jne  newread
175
 
175
 
176
    mov  eax,18
176
    mov  eax,18
177
    mov  ebx,2
177
    mov  ebx,2
178
    mov  ecx,esi
178
    mov  ecx,esi
179
    mcall
179
    mcall
180
 
180
 
181
    jmp  newread2
181
    jmp  newread2
182
 
182
 
183
finfo_start:
183
finfo_start:
184
        dd      7
184
        dd      7
185
        dd      0
185
        dd      0
186
.params dd      0
186
.params dd      0
187
        dd      0
187
        dd      0
188
        dd      0
188
        dd      0
189
        db      0
189
        db      0
190
        dd      finfo.path
190
        dd      finfo.path
191
 
191
 
192
 
192
 
193
 
193
 
194
finfo:
194
finfo:
195
        dd 0
195
        dd 0
196
        dd 0
196
        dd 0
197
        dd 0
197
        dd 0
198
        dd GIF_SIZE
198
        dd GIF_SIZE
199
        dd gif_file
199
        dd gif_file
200
  .path:
200
  .path:
201
        db ICON_STRIP,0
201
        db ICON_STRIP,0
202
        rb 31-($-.path)
202
        rb 31-($-.path)
203
 
203
 
204
 
204
 
205
   all_terminated:
205
   all_terminated:
206
 
206
 
207
   apply_changes:
207
   apply_changes:
208
 
208
 
209
        mov     ebx, finfo_start
209
        mov     ebx, finfo_start
210
        mov     dword [ebx+8], boot_str+6
210
        mov     dword [ebx+8], boot_str+6
211
        mov     esi, iconname
211
        mov     esi, iconname
212
        call    lst_path
212
        call    lst_path
213
        mov     eax, 70
213
        mov     eax, 70
214
        mcall
214
        mcall
215
    jmp   still
215
    jmp   still
216
 
216
 
217
  no_apply:
217
  no_apply:
218
 
218
 
219
    cmp  eax,22                 ; user pressed the 'add icon' button
219
    cmp  eax,22                 ; user pressed the 'add icon' button
220
    jne  no_add_icon
220
    jne  no_add_icon
221
 
221
 
222
    mov  eax,4
222
    mov  eax,4
223
    mov  ebx,24*65536+250+8*14
223
    mov  ebx,24*65536+250+8*14
224
    mov  ecx,0xc0ff0000
224
    mov  ecx,0xc0ff0000
225
    mov  edx,add_text
225
    mov  edx,add_text
226
    mov  edi,0xffffff
226
    mov  edi,0xffffff
227
    mcall
227
    mcall
228
 
228
 
229
    mov  eax,10
229
    mov  eax,10
230
    mcall
230
    mcall
231
    cmp  eax,3
231
    cmp  eax,3
232
    jne  still
232
    jne  still
233
    mov  eax,17
233
    mov  eax,17
234
    mcall
234
    mcall
235
    shr  eax,8
235
    shr  eax,8
236
    cmp  eax,40
236
    cmp  eax,40
237
    jb   no_f
237
    jb   no_f
238
    mov  edi,eax
238
    mov  edi,eax
239
    sub  eax,40
239
    sub  eax,40
240
 
240
 
241
    xor  edx,edx  ; bcd -> 10
241
    xor  edx,edx  ; bcd -> 10
242
    mov  ebx,16
242
    mov  ebx,16
243
    div  ebx
243
    div  ebx
244
    imul eax,10
244
    imul eax,10
245
    add  eax,edx
245
    add  eax,edx
246
 
246
 
247
    mov  ebx,eax
247
    mov  ebx,eax
248
    add  ebx,icons_reserved
248
    add  ebx,icons_reserved
249
    cmp  [ebx],byte 'x'
249
    cmp  [ebx],byte 'x'
250
    je   no_f
250
    je   no_f
251
    mov  [ebx],byte 'x'
251
    mov  [ebx],byte 'x'
252
 
252
 
253
    mov  [cur_btn],edi
253
    mov  [cur_btn],edi
254
    xor  edx,edx
254
    xor  edx,edx
255
    mov  ebx,10
255
    mov  ebx,10
256
    div  ebx
256
    div  ebx
257
    add  eax,65
257
    add  eax,65
258
    add  edx,65
258
    add  edx,65
259
    mov  [icon_default+0],dl
259
    mov  [icon_default+0],dl
260
    mov  [icon_default+1],al
260
    mov  [icon_default+1],al
261
 
261
 
262
    inc  dword [icons]
262
    inc  dword [icons]
263
    mov  edi,[icons]
263
    mov  edi,[icons]
264
    dec  edi
264
    dec  edi
265
    imul edi,REC_SIZE
265
    imul edi,REC_SIZE
266
    add  edi,icon_data
266
    add  edi,icon_data
267
 
267
 
268
    mov  [current_icon],edi
268
    mov  [current_icon],edi
269
 
269
 
270
    mov  esi,icon_default
270
    mov  esi,icon_default
271
    mov  ecx,REC_SIZE
271
    mov  ecx,REC_SIZE
272
    cld
272
    cld
273
    rep  movsb
273
    rep  movsb
274
    mov  esi,[current_icon]
274
    mov  esi,[current_icon]
275
    jmp  band
275
    jmp  band
276
  no_f:
276
  no_f:
277
 
277
 
278
    call draw_btns;draw_window
278
    call draw_btns;draw_window
279
 
279
 
280
    jmp  still
280
    jmp  still
281
 
281
 
282
  no_add_icon:
282
  no_add_icon:
283
 
283
 
284
 
284
 
285
    cmp  eax,23                     ; user pressed the remove icon button
285
    cmp  eax,23                     ; user pressed the remove icon button
286
    jne  no_remove_icon
286
    jne  no_remove_icon
287
 
287
 
288
    mov  eax,4
288
    mov  eax,4
289
    mov  ebx,24*65536+250+8*14
289
    mov  ebx,24*65536+250+8*14
290
    mov  ecx,0xc0ff0000
290
    mov  ecx,0xc0ff0000
291
    mov  edx,rem_text
291
    mov  edx,rem_text
292
    mov  edi,0xffffff
292
    mov  edi,0xffffff
293
    mcall
293
    mcall
294
 
294
 
295
    mov  eax,10
295
    mov  eax,10
296
    mcall
296
    mcall
297
    cmp  eax,3
297
    cmp  eax,3
298
    jne  no_f;ound
298
    jne  no_f;ound
299
    mov  eax,17
299
    mov  eax,17
300
    mcall
300
    mcall
301
    shr  eax,8
301
    shr  eax,8
302
    cmp  eax,40
302
    cmp  eax,40
303
    jb   red;no_f;ound
303
    jb   red;no_f;ound
304
    sub  eax,40
304
    sub  eax,40
305
 
305
 
306
    xor  edx,edx
306
    xor  edx,edx
307
    mov  ebx,16
307
    mov  ebx,16
308
    div  ebx
308
    div  ebx
309
    imul eax,10
309
    imul eax,10
310
    add  eax,edx
310
    add  eax,edx
311
 
311
 
312
    mov  ebx,eax
312
    mov  ebx,eax
313
    add  ebx,icons_reserved
313
    add  ebx,icons_reserved
314
    cmp  [ebx],byte 'x'
314
    cmp  [ebx],byte 'x'
315
    jne  red
315
    jne  red
316
    mov  [ebx],byte ' '
316
    mov  [ebx],byte ' '
317
 
317
 
318
    xor  edx,edx
318
    xor  edx,edx
319
    mov  ebx,10
319
    mov  ebx,10
320
    div  ebx
320
    div  ebx
321
    shl  eax,8
321
    shl  eax,8
322
    mov  al,dl
322
    mov  al,dl
323
 
323
 
324
    add  eax,65*256+65
324
    add  eax,65*256+65
325
 
325
 
326
    mov  esi,icon_data
326
    mov  esi,icon_data
327
    mov  edi,REC_SIZE
327
    mov  edi,REC_SIZE
328
    imul edi,[icons]
328
    imul edi,[icons]
329
    add  edi,icon_data
329
    add  edi,icon_data
330
  news:
330
  news:
331
    cmp  word [esi],ax
331
    cmp  word [esi],ax
332
    je   foundi
332
    je   foundi
333
    add  esi,REC_SIZE
333
    add  esi,REC_SIZE
334
    cmp  esi,edi
334
    cmp  esi,edi
335
    jb   news
335
    jb   news
336
    jmp  red
336
    jmp  red
337
 
337
 
338
  foundi:
338
  foundi:
339
 
339
 
340
    mov  ecx,edi
340
    mov  ecx,edi
341
    sub  ecx,esi
341
    sub  ecx,esi
342
 
342
 
343
    mov  edi,esi
343
    mov  edi,esi
344
    add  esi,REC_SIZE
344
    add  esi,REC_SIZE
345
 
345
 
346
    cld
346
    cld
347
    rep  movsb
347
    rep  movsb
348
 
348
 
349
    dec  [icons]
349
    dec  [icons]
350
 
350
 
351
    mov  eax,icon_data
351
    mov  eax,icon_data
352
    mov  [current_icon],eax
352
    mov  [current_icon],eax
353
    movzx ebx,word[eax]
353
    movzx ebx,word[eax]
354
    sub  bx,'AA'
354
    sub  bx,'AA'
355
    shl  bl,4
355
    shl  bl,4
356
    shr  ebx,4
356
    shr  ebx,4
357
    add  ebx,40
357
    add  ebx,40
358
    mov  [cur_btn],ebx
358
    mov  [cur_btn],ebx
359
 
359
 
360
    jmp  red
360
    jmp  red
361
 
361
 
362
  no_remove_icon:
362
  no_remove_icon:
363
 
363
 
364
    cmp  eax,40                 ; user pressed button for icon position
364
    cmp  eax,40                 ; user pressed button for icon position
365
    jb   no_on_screen_button
365
    jb   no_on_screen_button
366
    mov  edi,eax
366
    mov  edi,eax
367
    sub  eax,40
367
    sub  eax,40
368
    mov  edx,eax
368
    mov  edx,eax
369
    shl  eax,4
369
    shl  eax,4
370
    and  edx,0xf
370
    and  edx,0xf
371
    mov  dh,ah
371
    mov  dh,ah
372
    add  edx,65*256+65
372
    add  edx,65*256+65
373
 
373
 
374
    mov  esi,icon_data
374
    mov  esi,icon_data
375
    mov  ecx,[icons]
375
    mov  ecx,[icons]
376
    cld
376
    cld
377
   findl1:
377
   findl1:
378
    cmp  dx,[esi]
378
    cmp  dx,[esi]
379
    je   foundl1
379
    je   foundl1
380
    add  esi,REC_SIZE
380
    add  esi,REC_SIZE
381
    loop findl1
381
    loop findl1
382
    jmp  still
382
    jmp  still
383
 
383
 
384
   foundl1:
384
   foundl1:
385
 
385
 
386
    mov  [current_icon],esi
386
    mov  [current_icon],esi
387
    mov  [cur_btn],edi
387
    mov  [cur_btn],edi
388
   band:
388
   band:
389
    add  esi,12
389
    add  esi,12
390
    call atoi
390
    call atoi
391
    and  eax,0xfffff8
391
    and  eax,0xfffff8
392
    mov  [cur_band],eax
392
    mov  [cur_band],eax
393
    call draw_btns
393
    call draw_btns
394
 
394
 
395
    jmp  still
395
    jmp  still
396
 
396
 
397
  no_on_screen_button:
397
  no_on_screen_button:
398
 
398
 
399
 
399
 
400
    jmp  still
400
    jmp  still
401
 
401
 
402
 
402
 
403
current_icon dd icon_data
403
current_icon dd icon_data
404
 
404
 
405
 
405
 
406
print_strings:
406
print_strings:
407
 
407
 
408
    pusha
408
    pusha
409
 
409
 
410
    mov  eax,13              ; clear text area
410
    mov  eax,13              ; clear text area
411
    mov  ebx,100*65536+180
411
    mov  ebx,100*65536+180
412
    mov  ecx,(278+12)*65536+40
412
    mov  ecx,(278+12)*65536+40
413
    mov  edx,0xffffff
413
    mov  edx,0xffffff
414
    mcall
414
    mcall
415
 
415
 
416
          xor  edi,edi
416
          xor  edi,edi
417
    mov  eax,4               ; icon text
417
    mov  eax,4               ; icon text
418
    mov  ebx,100*65536+278+14
418
    mov  ebx,100*65536+278+14
419
    mov  ecx,3
419
    mov  ecx,3
420
  .ll:
420
  .ll:
421
    push ecx
421
    push ecx
422
    mov  ecx,0x000000
422
    mov  ecx,0x000000
423
    mov  edx,[current_icon]
423
    mov  edx,[current_icon]
424
    add  edx,[positions+edi*4]
424
    add  edx,[positions+edi*4]
425
    movzx esi,byte[str_lens+edi]
425
    movzx esi,byte[str_lens+edi]
426
    inc  edi
426
    inc  edi
427
    mcall
427
    mcall
428
    add  ebx,14
428
    add  ebx,14
429
    pop  ecx
429
    pop  ecx
430
    loop .ll
430
    loop .ll
431
 
431
 
432
    popa
432
    popa
433
    ret
433
    ret
434
 
434
 
435
iconlst db ICONS_DAT,0
435
iconlst db ICONS_DAT,0
436
 
436
 
437
load_icon_list:
437
load_icon_list:
438
 
438
 
439
    mov   edi,icons_reserved   ; clear reserved area
439
    mov   edi,icons_reserved   ; clear reserved area
440
    mov   eax,32
440
    mov   eax,32
441
    mov   ecx,10*9
441
    mov   ecx,10*9
442
    cld
442
    cld
443
    rep   stosb
443
    rep   stosb
444
 
444
 
445
    mov   ecx,[icons]          ; set used icons to reserved area
445
    mov   ecx,[icons]          ; set used icons to reserved area
446
    mov   esi,icon_data
446
    mov   esi,icon_data
447
  ldl1:
447
  ldl1:
448
    movzx ebx,byte [esi+1]
448
    movzx ebx,byte [esi+1]
449
    sub   ebx,65
449
    sub   ebx,65
450
    imul  ebx,10
450
    imul  ebx,10
451
    movzx eax,byte [esi]
451
    movzx eax,byte [esi]
452
    add   ebx,eax
452
    add   ebx,eax
453
    sub   ebx,65
453
    sub   ebx,65
454
    add   ebx,icons_reserved
454
    add   ebx,icons_reserved
455
    mov   [ebx],byte 'x'
455
    mov   [ebx],byte 'x'
456
    add   esi,REC_SIZE
456
    add   esi,REC_SIZE
457
    loop  ldl1
457
    loop  ldl1
458
    ret
458
    ret
459
 
459
 
460
lst_path:
460
lst_path:
461
    mov   ecx,30
461
    mov   ecx,30
462
    mov   edi,finfo.path
462
    mov   edi,finfo.path
463
    rep   movsb
463
    rep   movsb
464
    ret
464
    ret
465
 
465
 
466
load_ic:
466
load_ic:
467
    mov   ebx,finfo
467
    mov   ebx,finfo
468
    mov   dword[ebx+12],48*REC_SIZE
468
    mov   dword[ebx+12],48*REC_SIZE
469
    mov   dword[ebx+16],icon_data
469
    mov   dword[ebx+16],icon_data
470
    mov   esi,iconlst
470
    mov   esi,iconlst
471
    call  lst_path
471
    call  lst_path
472
    mcall 70
472
    mcall 70
473
    lea   eax,[ebx+10]
473
    lea   eax,[ebx+10]
474
    xor   edx,edx
474
    xor   edx,edx
475
    mov   ebx,REC_SIZE
475
    mov   ebx,REC_SIZE
476
    div   ebx
476
    div   ebx
477
    mov   [icons],eax
477
    mov   [icons],eax
478
        ret
478
        ret
479
 
479
 
480
 
480
 
481
positions dd 3,16,47
481
positions dd 3,16,47
482
str_lens db 8,30,30
482
str_lens db 8,30,30
483
 
483
 
484
read_string:
484
read_string:
485
    pusha
485
    pusha
486
    sub  eax,11
486
    sub  eax,11
487
    movzx ecx,byte[str_lens+eax]
487
    movzx ecx,byte[str_lens+eax]
488
    mov  [cur_str],ecx
488
    mov  [cur_str],ecx
489
    mov  eax,[positions+eax*4]
489
    mov  eax,[positions+eax*4]
490
 
490
 
491
    mov  edi,[current_icon]
491
    mov  edi,[current_icon]
492
    add  edi,eax
492
    add  edi,eax
493
    mov  [addr],edi
493
    mov  [addr],edi
494
 
494
 
495
          add  edi,ecx
495
          add  edi,ecx
496
 
496
 
497
  .l1:
497
  .l1:
498
    dec  edi
498
    dec  edi
499
    cmp  byte[edi],' '
499
    cmp  byte[edi],' '
500
    jne  .found
500
    jne  .found
501
    mov  byte[edi],'_'
501
    mov  byte[edi],'_'
502
    loop .l1
502
    loop .l1
503
    dec  edi
503
    dec  edi
504
  .found:
504
  .found:
505
    inc  edi
505
    inc  edi
506
    push  edi
506
    push  edi
507
    call print_strings
507
    call print_strings
508
 
508
 
509
    pop  edi
509
    pop  edi
510
  f11:
510
  f11:
511
    mov  eax,10
511
    mov  eax,10
512
    mcall
512
    mcall
513
    cmp  eax,2
513
    cmp  eax,2
514
    jz   fbu
514
    jz   fbu
515
    jmp  rs_done
515
    jmp  rs_done
516
  fbu:
516
  fbu:
517
    mov  eax,2
517
    mov  eax,2
518
    mcall
518
    mcall
519
    shr  eax,8
519
    shr  eax,8
520
    cmp  eax,13
520
    cmp  eax,13
521
    je   rs_done
521
    je   rs_done
522
    cmp  eax,8
522
    cmp  eax,8
523
    jnz  nobsl
523
    jnz  nobsl
524
    cmp  edi,[addr]
524
    cmp  edi,[addr]
525
    jz   f11
525
    jz   f11
526
    dec  edi
526
    dec  edi
527
    mov  [edi],byte '_'
527
    mov  [edi],byte '_'
528
    call print_strings
528
    call print_strings
529
    jmp  f11
529
    jmp  f11
530
  nobsl:
530
  nobsl:
531
    cmp  eax,31
531
    cmp  eax,31
532
    jbe  f11
532
    jbe  f11
533
    mov  [edi],al
533
    mov  [edi],al
534
    call print_strings
534
    call print_strings
535
 
535
 
536
    inc  edi
536
    inc  edi
537
    mov  esi,[addr]
537
    mov  esi,[addr]
538
    add  esi,[cur_str]
538
    add  esi,[cur_str]
539
    cmp  esi,edi
539
    cmp  esi,edi
540
    jnz  f11
540
    jnz  f11
541
 
541
 
542
   rs_done:
542
   rs_done:
543
 
543
 
544
    mov  ecx,[addr]
544
    mov  ecx,[addr]
545
    add  ecx,[cur_str]
545
    add  ecx,[cur_str]
546
    sub  ecx,edi
546
    sub  ecx,edi
547
    mov  eax,32
547
    mov  eax,32
548
    cld
548
    cld
549
    rep  stosb
549
    rep  stosb
550
    call print_strings
550
    call print_strings
551
    popa
551
    popa
552
    ret
552
    ret
553
 
553
 
554
 key:                       ; key
554
 key:                       ; key
555
    mov  al,2               ; just read it and ignore
555
    mov  al,2               ; just read it and ignore
556
    mcall
556
    mcall
557
    jmp  still
557
    jmp  still
558
 
558
 
559
;   *********************************************
559
;   *********************************************
560
;   *******  WINDOW DEFINITIONS AND DRAW ********
560
;   *******  WINDOW DEFINITIONS AND DRAW ********
561
;   *********************************************
561
;   *********************************************
562
 
562
 
563
 
563
 
564
draw_window:
564
draw_window:
565
 
565
 
566
    mov  eax,12                    ; function 12:tell os about windowdraw
566
    mov  eax,12                    ; function 12:tell os about windowdraw
567
    mov  ebx,1                     ; 1, start of draw
567
    mov  ebx,1                     ; 1, start of draw
568
    mcall
568
    mcall
569
 
569
 
570
                                   ; DRAW WINDOW
570
                                   ; DRAW WINDOW
571
    xor  eax,eax
571
    xor  eax,eax
572
    mov  ebx,210*65536+300
572
    mov  ebx,210*65536+300
573
    mov  ecx,30*65536+390-14
573
    mov  ecx,30*65536+390-14
574
    mov  edx,0x14ffffff
574
    mov  edx,0x14ffffff
575
    mov  edi,title       ; WINDOW LABEL
575
    mov  edi,title       ; WINDOW LABEL
576
    mcall
576
    mcall
577
 
577
 
578
    mov  eax,13                    ; WINDOW AREA
578
    mov  eax,13                    ; WINDOW AREA
579
    mov  ebx,20*65536+260
579
    mov  ebx,20*65536+260
580
    mov  ecx,35*65536+200
580
    mov  ecx,35*65536+200
581
    mov  edx,0x3366cc
581
    mov  edx,0x3366cc
582
    mcall
582
    mcall
583
 
583
 
584
    mov  eax,38                    ; VERTICAL LINE ON WINDOW AREA
584
    mov  eax,38                    ; VERTICAL LINE ON WINDOW AREA
585
    mov  ebx,150*65536+150
585
    mov  ebx,150*65536+150
586
    mov  ecx,35*65536+235
586
    mov  ecx,35*65536+235
587
    mov  edx,0xffffff
587
    mov  edx,0xffffff
588
    mcall
588
    mcall
589
 
589
 
590
    mov  eax,38                    ; HOROZONTAL LINE ON WINDOW AREA
590
    mov  eax,38                    ; HOROZONTAL LINE ON WINDOW AREA
591
    mov  ebx,20*65536+280
591
    mov  ebx,20*65536+280
592
    mov  ecx,135*65536+135
592
    mov  ecx,135*65536+135
593
    mov  edx,0xffffff
593
    mov  edx,0xffffff
594
    mcall
594
    mcall
595
 
595
 
596
    mov  eax,8                     ; TEXT ENTER BUTTONS
596
    mov  eax,8                     ; TEXT ENTER BUTTONS
597
    mov  ebx,20*65536+72
597
    mov  ebx,20*65536+72
598
    mov  ecx,(275+1+14)*65536+13-2
598
    mov  ecx,(275+1+14)*65536+13-2
599
    mov  edx,11
599
    mov  edx,11
600
    mov  esi,[bcolor]
600
    mov  esi,[bcolor]
601
    mcall
601
    mcall
602
    inc  edx
602
    inc  edx
603
    add  ecx,14*65536
603
    add  ecx,14*65536
604
    mcall
604
    mcall
605
    inc  edx
605
    inc  edx
606
    add  ecx,14*65536
606
    add  ecx,14*65536
607
    mcall
607
    mcall
608
 
608
 
609
;    mov  eax,8                     ; APPLY AND SAVE CHANGES BUTTON
609
;    mov  eax,8                     ; APPLY AND SAVE CHANGES BUTTON
610
    mov  ebx,20*65536+259
610
    mov  ebx,20*65536+259
611
    mov  ecx,(329+2)*65536+15-4
611
    mov  ecx,(329+2)*65536+15-4
612
    mov  edx,21
612
    mov  edx,21
613
    mov  esi,[bcolor]
613
    mov  esi,[bcolor]
614
    mcall
614
    mcall
615
 
615
 
616
;    mov  eax,8                     ; ADD ICON BUTTON
616
;    mov  eax,8                     ; ADD ICON BUTTON
617
    mov  ebx,20*65536+129-2
617
    mov  ebx,20*65536+129-2
618
    add  ecx,14*65536
618
    add  ecx,14*65536
619
    inc  edx
619
    inc  edx
620
    mcall
620
    mcall
621
 
621
 
622
;    mov  eax,8                     ; REMOVE ICON BUTTON
622
;    mov  eax,8                     ; REMOVE ICON BUTTON
623
    add  ebx,(130+2)*65536
623
    add  ebx,(130+2)*65536
624
    inc  edx
624
    inc  edx
625
    mcall
625
    mcall
626
 
626
 
627
    mcall ,<20-14,8>,<260-23,32>,30+1 shl 30    ; IMAGE BUTTON
627
    mcall ,<20-14,8>,<260-23,32>,30+1 shl 30    ; IMAGE BUTTON
628
    inc  edx
628
    inc  edx
629
    add  ebx,(36*7+26) shl 16
629
    add  ebx,(36*7+26) shl 16
630
    mcall
630
    mcall
631
    add  edx,1+1 shl 29
631
    add  edx,1+1 shl 29
632
    mov  ebx,(33-19) shl 16+(34*8)
632
    mov  ebx,(33-19) shl 16+(34*8)
633
    mcall
633
    mcall
634
    mcall 4,<23-15,273-24>,0,arrows,1
634
    mcall 4,<23-15,273-24>,0,arrows,1
635
    add  ebx,(36*7+27)shl 16
635
    add  ebx,(36*7+27)shl 16
636
    add  edx,2
636
    add  edx,2
637
    mcall
637
    mcall
638
    dec  edx
638
    dec  edx
639
    mcall ,<120,250>
639
    mcall ,<120,250>
640
    lea  edx,[ebx+8 shl 16]
640
    lea  edx,[ebx+8 shl 16]
641
    mov  ecx,[icon_count]
641
    mov  ecx,[icon_count]
642
    mcall 47,0x30000,,,0
642
    mcall 47,0x30000,,,0
643
 
643
 
644
;;
644
;;
645
    mov  eax,4
645
    mov  eax,4
646
    mov  ebx,24*65536+250+14+14+14
646
    mov  ebx,24*65536+250+14+14+14
647
    mov  ecx,0xffffff
647
    mov  ecx,0xffffff
648
    mov  edx,text
648
    mov  edx,text
649
    mov  esi,47
649
    mov  esi,47
650
  newline:
650
  newline:
651
    mov  ecx,[edx]
651
    mov  ecx,[edx]
652
    add  edx,4
652
    add  edx,4
653
    mcall
653
    mcall
654
    add  ebx,14
654
    add  ebx,14
655
    add  edx,47
655
    add  edx,47
656
    cmp  [edx],byte 'x'
656
    cmp  [edx],byte 'x'
657
    jne  newline
657
    jne  newline
658
draw_btns:
658
draw_btns:
659
;;
659
;;
660
    mov  eax,0                     ; DRAW BUTTONS ON WINDOW AREA
660
    mov  eax,0                     ; DRAW BUTTONS ON WINDOW AREA
661
    mov  ebx,20*65536+25
661
    mov  ebx,20*65536+25
662
    mov  ecx,35*65536+19
662
    mov  ecx,35*65536+19
663
    mov  edi,icon_table
663
    mov  edi,icon_table
664
    mov  edx,40
664
    mov  edx,40
665
   newbline:
665
   newbline:
666
 
666
 
667
    cmp  [edi],byte 'x'
667
    cmp  [edi],byte 'x'
668
    jne  no_button
668
    jne  no_button
669
 
669
 
670
    mov  esi,0x5577cc
670
    mov  esi,0x5577cc
671
    cmp  [edi+90],byte 'x'
671
    cmp  [edi+90],byte 'x'
672
    jne  nores
672
    jne  nores
673
    mov  esi,0xcc5555
673
    mov  esi,0xcc5555
674
    cmp  edx,[cur_btn]
674
    cmp  edx,[cur_btn]
675
    jne  nores
675
    jne  nores
676
    mov  esi,0xe7e05a
676
    mov  esi,0xe7e05a
677
  nores:
677
  nores:
678
 
678
 
679
    push eax
679
    push eax
680
    mov  eax,8
680
    mov  eax,8
681
    mcall
681
    mcall
682
    pop  eax
682
    pop  eax
683
 
683
 
684
  no_button:
684
  no_button:
685
 
685
 
686
    add  ebx,26*65536
686
    add  ebx,26*65536
687
 
687
 
688
    inc  edi
688
    inc  edi
689
    inc  edx
689
    inc  edx
690
 
690
 
691
    inc  al
691
    inc  al
692
    cmp  al,9
692
    cmp  al,9
693
    jbe  newbline
693
    jbe  newbline
694
    mov  al,0
694
    mov  al,0
695
 
695
 
696
    add  edx,6
696
    add  edx,6
697
 
697
 
698
    ror  ebx,16
698
    ror  ebx,16
699
    mov  bx,20
699
    mov  bx,20
700
    ror  ebx,16
700
    ror  ebx,16
701
    add  ecx,20*65536
701
    add  ecx,20*65536
702
 
702
 
703
    inc  ah
703
    inc  ah
704
    cmp  ah,8;9
704
    cmp  ah,8;9
705
    jbe  newbline
705
    jbe  newbline
706
    call print_strings
706
    call print_strings
707
    call draw_icon
707
    call draw_icon
708
    mov  eax,12                    ; function 12:tell os about windowdraw
708
    mov  eax,12                    ; function 12:tell os about windowdraw
709
    mov  ebx,2                     ; 2, end of draw
709
    mov  ebx,2                     ; 2, end of draw
710
    mcall
710
    mcall
711
 
711
 
712
    ret
712
    ret
713
 
713
 
714
draw_icon:
714
draw_icon:
715
    mcall 13,<33-20,34*8+2>,<260-24,37+15-2>,0xffffff
715
    mcall 13,<33-20,34*8+2>,<260-24,37+15-2>,0xffffff
716
    mov  esi,[current_icon]
716
    mov  esi,[current_icon]
717
    add  esi,12
717
    add  esi,12
718
    call atoi
718
    call atoi
719
    push eax
719
    push eax
720
    cmp  eax,[cur_band]
720
    cmp  eax,[cur_band]
721
    jb   .nou
721
    jb   .nou
722
    sub  eax,[cur_band]
722
    sub  eax,[cur_band]
723
    cmp  eax,7
723
    cmp  eax,7
724
    ja   .nou
724
    ja   .nou
725
    imul eax,34 shl 16
725
    imul eax,34 shl 16
726
    lea  ebx,[eax+(33-19) shl 16]
726
    lea  ebx,[eax+(33-19) shl 16]
727
    mov  bx,34
727
    mov  bx,34
728
    mcall 13,,<236+35,3>,0xff0000
728
    mcall 13,,<236+35,3>,0xff0000
729
    mov  eax,[esp]
729
    mov  eax,[esp]
730
  .nou:
730
  .nou:
731
    mov  eax,[cur_band]
731
    mov  eax,[cur_band]
732
    and  eax,0xfffffff8
732
    and  eax,0xfffffff8
733
    push eax
733
    push eax
734
    imul eax,ICON_SIZE
734
    imul eax,ICON_SIZE
735
    lea  ebx,[strip_file+8+eax]
735
    lea  ebx,[strip_file+8+eax]
736
    mov  ecx,8
736
    mov  ecx,8
737
    mov  edx,(33-18) shl 16+238
737
    mov  edx,(33-18) shl 16+238
738
  .nxt:
738
  .nxt:
739
    push ecx
739
    push ecx
740
    mcall 7,,<32,32>
740
    mcall 7,,<32,32>
741
    pop  ecx
741
    pop  ecx
742
    add  ebx,ICON_SIZE
742
    add  ebx,ICON_SIZE
743
    add  edx,34 shl 16
743
    add  edx,34 shl 16
744
    loop .nxt
744
    loop .nxt
745
 
745
 
746
    mcall 4,<45,280-2>,0,rep_text,rep_text_len-rep_text
746
    mcall 4,<45,280-2>,0,rep_text,rep_text_len-rep_text
747
    lea  edx,[ebx+(8*5)shl 16]
747
    lea  edx,[ebx+(8*5)shl 16]
748
    pop  ecx
748
    pop  ecx
749
    mcall 47,0x30000,,,0xff
749
    mcall 47,0x30000,,,0xff
750
    add  ecx,7
750
    add  ecx,7
751
    add  edx,(3*8+4)shl 16
751
    add  edx,(3*8+4)shl 16
752
    mcall
752
    mcall
753
    mov  ecx,[icon_count]
753
    mov  ecx,[icon_count]
754
    add  edx,(5*8+4)shl 16
754
    add  edx,(5*8+4)shl 16
755
    mcall
755
    mcall
756
    pop  ecx
756
    pop  ecx
757
    add  edx,(10*8+4)shl 16
757
    add  edx,(10*8+4)shl 16
758
    mcall ,,,,0xff0000
758
    mcall ,,,,0xff0000
759
    ret
759
    ret
760
 
760
 
761
; DATA AREA
761
; DATA AREA
762
 
762
 
763
 
763
 
764
bcolor dd 0x335599
764
bcolor dd 0x335599
765
 
765
 
766
icon_table:
766
icon_table:
767
 
767
 
768
    times 4  db  'xxxx  xxxx'
768
    times 4  db  'xxxx  xxxx'
769
    times 2  db  '          '
769
    times 2  db  '          '
770
    times 1  db  '          '
770
    times 1  db  '          '
771
    times 2  db  'xxxx  xxxx'
771
    times 2  db  'xxxx  xxxx'
772
;    times 1  db  '          '
772
;    times 1  db  '          '
773
 
773
 
774
icons_reserved:
774
icons_reserved:
775
    times 9  db  '          '
775
    times 9  db  '          '
776
 
776
 
777
if lang eq ru
777
if lang eq ru
778
  text:
778
  text:
779
      db 255,255,255,0,   '   ’…Š‘’                                       '
779
      db 255,255,255,0,   '   ’…Š‘’                                       '
780
      db 255,255,255,0,   ' Žƒ€ŒŒ€                                     '
780
      db 255,255,255,0,   ' Žƒ€ŒŒ€                                     '
781
      db 255,255,255,0,   ' €€Œ…’›                                     '
781
      db 255,255,255,0,   ' €€Œ…’›                                     '
782
      db 255,255,255,0,   '                 ˆŒ…ˆ’œ                     '
782
      db 255,255,255,0,   '                 ˆŒ…ˆ’œ                     '
783
      db 255,255,255,0,   '      „Ž€‚ˆ’œ              “„€‹ˆ’œ            '
783
      db 255,255,255,0,   '      „Ž€‚ˆ’œ              “„€‹ˆ’œ            '
784
      db 0,0,0,0,         '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ   '
784
      db 0,0,0,0,         '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ   '
785
      db                  'x' ; <- END MARKER, DONT DELETE
785
      db                  'x' ; <- END MARKER, DONT DELETE
786
 
786
 
787
add_text               db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ     ',0
787
add_text               db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ     ',0
788
rem_text               db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ       ',0
788
rem_text               db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ       ',0
789
title                 db 'Œ¥­¥¤¦¥à ¨ª®­®ª',0
789
title                 db 'Œ¥­¥¤¦¥à ¨ª®­®ª',0
790
 
790
 
791
else if lang eq ge
791
else if lang eq ge
792
  text:
792
  text:
793
      db 255,255,255,0,   '   TITLE                                       '
793
      db 255,255,255,0,   '   TITLE                                       '
794
      db 255,255,255,0,   '  APP NAME                                     '
794
      db 255,255,255,0,   '  APP NAME                                     '
795
      db 255,255,255,0,   ' PARAMETER                                     '
795
      db 255,255,255,0,   ' PARAMETER                                     '
796
      db 255,255,255,0,   '                ANWENDEN                       '
796
      db 255,255,255,0,   '                ANWENDEN                       '
797
      db 255,255,255,0,   '     HINZUFUEGEN              ENTFERNEN        '
797
      db 255,255,255,0,   '     HINZUFUEGEN              ENTFERNEN        '
798
      db 0,0,0,0,         'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN       '
798
      db 0,0,0,0,         'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN       '
799
      db                  'x' ; <- END MARKER, DONT DELETE
799
      db                  'x' ; <- END MARKER, DONT DELETE
800
 
800
 
801
add_text               db 'AUF UNBENUTZTE ICONPOSITION KLICKEN          ',0
801
add_text               db 'AUF UNBENUTZTE ICONPOSITION KLICKEN          ',0
802
rem_text               db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL    ',0
802
rem_text               db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL    ',0
803
title                 db 'Icon Manager',0
803
title                 db 'Icon Manager',0
804
 
804
 
805
else
805
else
806
  text:
806
  text:
807
      db 255,255,255,0,   '   TITLE                                       '
807
      db 255,255,255,0,   '   TITLE                                       '
808
      db 255,255,255,0,   '  APP NAME                                     '
808
      db 255,255,255,0,   '  APP NAME                                     '
809
      db 255,255,255,0,   ' PARAMETERS                                    '
809
      db 255,255,255,0,   ' PARAMETERS                                    '
810
      db 255,255,255,0,   '                APPLY CHANGES                  '
810
      db 255,255,255,0,   '                APPLY CHANGES                  '
811
      db 255,255,255,0,   '      ADD ICON              REMOVE ICON        '
811
      db 255,255,255,0,   '      ADD ICON              REMOVE ICON        '
812
      db 0,0,0,0,         'CLICK BUTTON ON ICON POSITION FOR EDIT         '
812
      db 0,0,0,0,         'CLICK BUTTON ON ICON POSITION FOR EDIT         '
813
      db                  'x' ; <- END MARKER, DONT DELETE
813
      db                  'x' ; <- END MARKER, DONT DELETE
814
add_text               db 'CLICK ON A NOT USED POSITION                 ',0
814
add_text               db 'CLICK ON A NOT USED POSITION                 ',0
815
rem_text               db 'CLICK ICON POSITION; YOU WANT TO DELETE      ',0
815
rem_text               db 'CLICK ICON POSITION; YOU WANT TO DELETE      ',0
816
title                 db 'Icon Manager',0
816
title                 db 'Icon Manager',0
817
 
817
 
818
end if
818
end if
819
 
819
 
820
arrows db ''
820
arrows db ''
821
iconname:
821
iconname:
822
      db ICON_APP,0
822
      db ICON_APP,0
823
 
823
 
824
icon_default:
824
icon_default:
825
   db   'AA-SYSXTREE-000-/RD/1/SYSXTREE                '
825
   db   'AA-SYSXTREE-000-/RD/1/SYSXTREE                '
826
   db   '-                              *'
826
   db   '-                              *'
827
   db   13,10
827
   db   13,10
828
 
828
 
829
rep_text:
829
rep_text:
830
if lang eq ru
830
if lang eq ru
831
     db '‡€—Šˆ    -     ˆ‡    , ‚›€ #'
831
     db '‡€—Šˆ    -     ˆ‡    , ‚›€ #'
832
else
832
else
833
     db 'ICONS     -     OF    , SELECTED'
833
     db 'ICONS     -     OF    , SELECTED'
834
end if
834
end if
835
 
835
 
836
rep_text_len:
836
rep_text_len:
837
 
837
 
838
;//////////////////////////
838
;//////////////////////////
839
get_bg_info:
839
get_bg_info:
840
    mov  eax,39
840
    mov  eax,39
841
    mov  ebx,4
841
    mov  ebx,4
842
    mcall
842
    mcall
843
    mov  [bgrdrawtype],eax
843
    mov  [bgrdrawtype],eax
844
 
844
 
845
    mov  eax,39     ; get background size
845
    mov  eax,39     ; get background size
846
    mov  ebx,1
846
    mov  ebx,1
847
    mcall
847
    mcall
848
    mov  [bgrxy],eax
848
    mov  [bgrxy],eax
849
 
849
 
850
    mov  ebx,eax
850
    mov  ebx,eax
851
    shr  eax,16
851
    shr  eax,16
852
    and  ebx,0xffff
852
    and  ebx,0xffff
853
    mov  [bgrx],eax
853
    mov  [bgrx],eax
854
    mov  [bgry],ebx
854
    mov  [bgry],ebx
855
    ret
855
    ret
856
 
856
 
857
calc_icon_pos:
857
calc_icon_pos:
858
    movzx eax,byte [ebp-20]    ; x position
858
    movzx eax,byte [ebp-20]    ; x position
859
    sub  eax,'A'        ;eax - number of letter
859
    sub  eax,'A'        ;eax - number of letter
860
    cmp  eax,4
860
    cmp  eax,4
861
    jg     no_left
861
    jg     no_left
862
    shl  eax,6 ;imul eax,64
862
    shl  eax,6 ;imul eax,64
863
    add  eax,16
863
    add  eax,16
864
    movzx ebx,[warea.left]
864
    movzx ebx,[warea.left]
865
    add  eax,ebx
865
    add  eax,ebx
866
    jmp  x_done
866
    jmp  x_done
867
 
867
 
868
  no_left:
868
  no_left:
869
    sub  eax,9
869
    sub  eax,9
870
    sal  eax,6 ;imul eax,64
870
    sal  eax,6 ;imul eax,64
871
    sub  eax,16+52-1
871
    sub  eax,16+52-1
872
    movzx ebx,[warea.right]
872
    movzx ebx,[warea.right]
873
    add  eax,ebx
873
    add  eax,ebx
874
  x_done:
874
  x_done:
875
    mov  [ebp-12],eax
875
    mov  [ebp-12],eax
876
 
876
 
877
    movzx eax,byte [ebp-20+1]  ; y position
877
    movzx eax,byte [ebp-20+1]  ; y position
878
    sub  eax,'A'        ; eax - number of letter
878
    sub  eax,'A'        ; eax - number of letter
879
    cmp  eax,4
879
    cmp  eax,4
880
    jg     no_up
880
    jg     no_up
881
    shl  eax,6            ;imul eax,80
881
    shl  eax,6            ;imul eax,80
882
    add  eax,16
882
    add  eax,16
883
    movzx ebx,[warea.top]
883
    movzx ebx,[warea.top]
884
    add  eax,ebx
884
    add  eax,ebx
885
    jmp  y_done
885
    jmp  y_done
886
  no_up:
886
  no_up:
887
    sub  eax,9
887
    sub  eax,9
888
    shl  eax,6            ;imul eax,80
888
    shl  eax,6            ;imul eax,80
889
    sub  eax,16-1
889
    sub  eax,16-1
890
    movzx ebx,[warea.bottom]
890
    movzx ebx,[warea.bottom]
891
    add  eax,ebx
891
    add  eax,ebx
892
  y_done:
892
  y_done:
893
    mov  [ebp-8],eax
893
    mov  [ebp-8],eax
894
    ret
894
    ret
895
 
895
 
896
;START2:
896
;START2:
897
load_icon_list2:
897
load_icon_list2:
898
    call  get_bg_info
898
    call  get_bg_info
899
 
899
 
900
        mcall   48,5
900
        mcall   48,5
901
        mov     [warea.by_x],eax
901
        mov     [warea.by_x],eax
902
        mov     [warea.by_y],ebx
902
        mov     [warea.by_y],ebx
903
 
903
 
904
        mov     eax,14
904
        mov     eax,14
905
        mcall
905
        mcall
906
        add     eax,0x00010001
906
        add     eax,0x00010001
907
        mov     [scrxy],eax
907
        mov     [scrxy],eax
908
 
908
 
909
apply_changes2:
909
apply_changes2:
910
 
910
 
911
    mov  edi,[icons]
911
    mov  edi,[icons]
912
    mov  esi,icon_data
912
    mov  esi,icon_data
913
    mov  ebp,0x5000 ; threads stack starting point
913
    mov  ebp,0x5000 ; threads stack starting point
914
 
914
 
915
  start_new:
915
  start_new:
916
    mov eax,[esi]
916
    mov eax,[esi]
917
    mov [ebp-20],eax
917
    mov [ebp-20],eax
918
    call calc_icon_pos
918
    call calc_icon_pos
919
 
919
 
920
    mov  eax,51
920
    mov  eax,51
921
    mov  ebx,1
921
    mov  ebx,1
922
    mov  ecx,thread
922
    mov  ecx,thread
923
    mov  edx,ebp
923
    mov  edx,ebp
924
    mov  dword[ebp-4],esi
924
    mov  dword[ebp-4],esi
925
    mcall
925
    mcall
926
    add  ebp,0x100
926
    add  ebp,0x100
927
 
927
 
928
    mov  eax,5
928
    mov  eax,5
929
    mov  ebx,1
929
    mov  ebx,1
930
wait_thread_start:         ;wait until thread draw itself first time
930
wait_thread_start:         ;wait until thread draw itself first time
931
    cmp  [create_thread_event],bl
931
    cmp  [create_thread_event],bl
932
    jz     wait_thread_end
932
    jz     wait_thread_end
933
    mcall
933
    mcall
934
    jmp  wait_thread_start
934
    jmp  wait_thread_start
935
wait_thread_end:
935
wait_thread_end:
936
    dec  [create_thread_event]     ;reset event
936
    dec  [create_thread_event]     ;reset event
937
 
937
 
938
 
938
 
939
    add  esi,REC_SIZE
939
    add  esi,REC_SIZE
940
    dec  edi
940
    dec  edi
941
    jnz  start_new
941
    jnz  start_new
942
  close:
942
  close:
943
    or     eax,-1
943
    or     eax,-1
944
    mcall
944
    mcall
945
 
945
 
946
thread:
946
thread:
947
;   pop  ebp ;ebp - address of our icon
947
;   pop  ebp ;ebp - address of our icon
948
    sub  esp,12
948
    sub  esp,12
949
    mov  ebp,esp
949
    mov  ebp,esp
950
    sub  esp,16
950
    sub  esp,16
951
    call draw_window2
951
    call draw_window2
952
    mov  [create_thread_event],1
952
    mov  [create_thread_event],1
953
    mov  eax,40
953
    mov  eax,40
954
    mov  ebx,010101b
954
    mov  ebx,010101b
955
    mcall
955
    mcall
956
 
956
 
957
still2:
957
still2:
958
 
-
 
959
    mov  eax,10
958
    mov  eax,10
960
    mcall
959
    mcall
961
 
960
 
962
    cmp  eax,1
961
    cmp  eax,1
963
    je     red2
962
    je     red2
964
    cmp  eax,3
963
    cmp  eax,3
965
    je     button2
964
    je     button2
966
 
965
 
967
    call  get_bg_info
966
    call  get_bg_info
968
    mov   eax,5
967
    mov   eax,5
969
    mov   ebx,1
968
    mov   ebx,1
970
    call  draw_icon2
969
    call  draw_icon2
971
 
970
 
972
    jmp  still2
971
    jmp  still2
973
 
972
 
974
  red2:
973
  red2:
975
        mcall   14
974
        mcall   14
976
        add     eax,0x00010001
975
        add     eax,0x00010001
977
        mov     [scrxy],eax
976
        mov     [scrxy],eax
978
        mcall   48,5
977
        mcall   48,5
979
        mov     [warea.by_x],eax
978
        mov     [warea.by_x],eax
980
        mov     [warea.by_y],ebx
979
        mov     [warea.by_y],ebx
981
        add     ebp,+12
980
        add     ebp,+12
982
        call    calc_icon_pos
981
        call    calc_icon_pos
983
        add     ebp,-12
982
        add     ebp,-12
984
        mcall   9,I_END,-1
983
        mcall   9,I_END,-1
985
        mov     eax,[I_END+process_information.box.left]
984
        mov     eax,[I_END+process_information.box.left]
986
        cmp     eax,[ebp+0]
985
        cmp     eax,[ebp+0]
987
        jne     @f
986
        jne     @f
988
        mov     eax,[I_END+process_information.box.top]
987
        mov     eax,[I_END+process_information.box.top]
989
        cmp     eax,[ebp+4]
988
        cmp     eax,[ebp+4]
990
        je      .lp1
989
        je      .lp1
991
    @@: call    get_bg_info
990
    @@: call    get_bg_info
992
        mcall   67,[ebp+0],[ebp+4],51,51
991
        mcall   67,[ebp+0],[ebp+4],51,51
-
 
992
 
993
 
993
  .lp1:
994
  .lp1: call    draw_window2
994
	call    draw_window2
995
        jmp     still2
995
        jmp     still2
996
 
996
 
997
  button2:
997
  button2:
998
    mov  al,17
998
    mov  al,17
999
    mcall
999
    mcall
1000
 
1000
 
1001
	cmp	ah, 2
1001
	cmp	ah, 2
1002
	jnz	still2
1002
	jnz	still2
-
 
1003
 
-
 
1004
	mcall	9,I_END,-1
-
 
1005
	mov	ecx,[ebx+30]	; PID
-
 
1006
	mcall	18,21
-
 
1007
	mov	edx,eax	; SLOT
-
 
1008
	mcall	18,7
-
 
1009
	cmp	edx,eax	; compare with active SLOT
-
 
1010
	jne	@f
-
 
1011
	mov	ecx,edx
-
 
1012
	mcall	18,1	; set to down
-
 
1013
	call	draw_window2
-
 
1014
@@:
1003
 
1015
	
1004
    mov  esi,[ebp+8]
1016
    mov  esi,[ebp+8]
1005
          mov  ebx,1
1017
          mov  ebx,1
1006
          mov  edi,finfo.path
1018
          mov  edi,finfo.path
1007
          call fill_paths
1019
          call fill_paths
1008
          inc  ebx
1020
          inc  ebx
1009
       mov  edi,param_str
1021
       mov  edi,param_str
1010
    mov  dword[finfo_start+8],edi
1022
    mov  dword[finfo_start+8],edi
1011
          call fill_paths
1023
          call fill_paths
1012
          cmp  byte[edi],0
1024
          cmp  byte[edi],0
1013
    jne  .no0
1025
    jne  .no0
1014
    and  dword[finfo_start+8],0
1026
    and  dword[finfo_start+8],0
1015
  .no0:
1027
  .no0:
1016
    mov  ebx,finfo_start
1028
    mov  ebx,finfo_start
1017
    mov  eax,70
1029
    mov  eax,70
1018
    mcall
1030
    mcall
1019
    jmp  still2
1031
    jmp  still2
1020
 
1032
 
1021
fill_paths:
1033
fill_paths:
1022
        push esi edi
1034
        push esi edi
1023
;        dps  '>'
1035
;        dps  '>'
1024
        movzx ecx,byte[str_lens+ebx]
1036
        movzx ecx,byte[str_lens+ebx]
1025
        add  esi,[positions+ebx*4]
1037
        add  esi,[positions+ebx*4]
1026
        push esi
1038
        push esi
1027
        add  esi,ecx
1039
        add  esi,ecx
1028
 
1040
 
1029
    .l1:
1041
    .l1:
1030
        dec  esi
1042
        dec  esi
1031
        cmp  byte[esi],' '
1043
        cmp  byte[esi],' '
1032
        jnz   .found
1044
        jnz   .found
1033
        loop .l1
1045
        loop .l1
1034
  pop  esi
1046
  pop  esi
1035
  jmp  .noms
1047
  jmp  .noms
1036
    .found:
1048
    .found:
1037
        lea  ecx,[esi+1]
1049
        lea  ecx,[esi+1]
1038
        pop  esi
1050
        pop  esi
1039
        sub  ecx,esi
1051
        sub  ecx,esi
1040
        rep  movsb
1052
        rep  movsb
1041
 .noms:
1053
 .noms:
1042
        and  byte[edi],0
1054
        and  byte[edi],0
1043
;        call debug_outstr
1055
;        call debug_outstr
1044
;        dps  <'<',13,10>
1056
;        dps  <'<',13,10>
1045
        pop  edi esi
1057
        pop  edi esi
1046
        ret
1058
        ret
1047
 
1059
 
1048
atoi:
1060
atoi:
1049
        push esi
1061
        push esi
1050
        xor  eax,eax
1062
        xor  eax,eax
1051
        xor  ebx,ebx
1063
        xor  ebx,ebx
1052
  .nxt:
1064
  .nxt:
1053
    lodsb
1065
    lodsb
1054
    cmp  al,'0'
1066
    cmp  al,'0'
1055
    jb   .done
1067
    jb   .done
1056
    cmp  al,'9'
1068
    cmp  al,'9'
1057
    ja   .done
1069
    ja   .done
1058
    sub  eax,'0'
1070
    sub  eax,'0'
1059
    imul ebx,10
1071
    imul ebx,10
1060
    add  ebx,eax
1072
    add  ebx,eax
1061
    jmp  .nxt
1073
    jmp  .nxt
1062
  .done:
1074
  .done:
1063
      pop  esi
1075
      pop  esi
1064
      mov  eax,ebx
1076
      mov  eax,ebx
1065
        ret
1077
        ret
1066
 
1078
 
1067
itoa:
1079
itoa:
1068
        add  esi,2
1080
        add  esi,2
1069
    mov ebx,10
1081
    mov ebx,10
1070
    mov ecx,3
1082
    mov ecx,3
1071
  .l0:
1083
  .l0:
1072
    xor edx,edx
1084
    xor edx,edx
1073
    div ebx
1085
    div ebx
1074
    add dl,'0'
1086
    add dl,'0'
1075
    mov [esi],dl
1087
    mov [esi],dl
1076
    dec esi
1088
    dec esi
1077
    loop .l0
1089
    loop .l0
1078
        ret
1090
        ret
1079
 
1091
 
1080
draw_picture:
1092
draw_picture:
1081
    mov  [image],0x3000
1093
    mov  [image],0x3000
1082
    mov  edi,[ebp+8]
1094
    mov  edi,[ebp+8]
1083
    lea  esi,[edi+12]
1095
    lea  esi,[edi+12]
1084
    call atoi
1096
    call atoi
1085
          cmp  eax,[icon_count]
1097
          cmp  eax,[icon_count]
1086
          ja  toponly.ex
1098
          ja  toponly.ex
1087
          imul eax,(32*3*32)
1099
          imul eax,(32*3*32)
1088
          lea  edi,[eax+strip_file+8]
1100
          lea  edi,[eax+strip_file+8]
1089
    xor  ebx,ebx
1101
    xor  ebx,ebx
1090
    xor  ecx,ecx
1102
    xor  ecx,ecx
1091
    mov  esi,edi;strip_file+8+(32*3*32)*2
1103
    mov  esi,edi;strip_file+8+(32*3*32)*2
1092
 
1104
 
1093
    mov  [pixpos],0
1105
    mov  [pixpos],0
1094
  newb:
1106
  newb:
1095
    push ebx
1107
    push ebx
1096
    push ecx
1108
    push ecx
1097
 
1109
 
1098
    cmp  ebx,10
1110
    cmp  ebx,10
1099
    jb     yesbpix
1111
    jb     yesbpix
1100
    cmp  ebx,42
1112
    cmp  ebx,42
1101
    jge  yesbpix
1113
    jge  yesbpix
1102
    cmp  ecx,31;2
1114
    cmp  ecx,31;2
1103
    jg     yesbpix
1115
    jg     yesbpix
1104
 
1116
 
1105
    push esi
1117
    push esi
1106
    mov  esi,edi
1118
    mov  esi,edi
1107
    add  esi,[pixpos]
1119
    add  esi,[pixpos]
1108
 
1120
 
1109
no_correction_pixpos:
1121
no_correction_pixpos:
1110
    add  [pixpos],3
1122
    add  [pixpos],3
1111
    mov  eax,[esi]
1123
    mov  eax,[esi]
1112
    and  eax,0xffffff
1124
    and  eax,0xffffff
1113
 
1125
 
1114
    pop  esi
1126
    pop  esi
1115
 
1127
 
1116
    cmp eax,0
1128
    cmp eax,0
1117
    je    yesbpix
1129
    je    yesbpix
1118
    cmp eax,0xfffcff ;f5f5f5
1130
    cmp eax,0xfffcff ;f5f5f5
1119
    je    yesbpix
1131
    je    yesbpix
1120
    jmp nobpix
1132
    jmp nobpix
1121
 
1133
 
1122
  yesbpix:
1134
  yesbpix:
1123
 
1135
 
1124
  stretch:
1136
  stretch:
1125
    cmp   [bgrdrawtype],dword 2
1137
    cmp   [bgrdrawtype],dword 2
1126
    jne   nostretch
1138
    jne   nostretch
1127
    mov   eax,[ebp+4]
1139
    mov   eax,[ebp+4]
1128
    add   eax,ecx
1140
    add   eax,ecx
1129
    imul  eax,[bgry]
1141
    imul  eax,[bgry]
1130
    cdq
1142
    cdq
1131
    movzx ebx,word [scrxy]
1143
    movzx ebx,word [scrxy]
1132
    div   ebx
1144
    div   ebx
1133
    imul  eax,[bgrx]
1145
    imul  eax,[bgrx]
1134
    push  eax
1146
    push  eax
1135
    mov   eax,[ebp+0]
1147
    mov   eax,[ebp+0]
1136
    add   eax,[esp+8]
1148
    add   eax,[esp+8]
1137
    imul  eax,[bgrx]
1149
    imul  eax,[bgrx]
1138
    cdq
1150
    cdq
1139
    movzx ebx,word [scrxy+2]
1151
    movzx ebx,word [scrxy+2]
1140
    div   ebx
1152
    div   ebx
1141
    add   eax,[esp]
1153
    add   eax,[esp]
1142
    add   esp,4
1154
    add   esp,4
1143
 
1155
 
1144
    jmp   notiled
1156
    jmp   notiled
1145
 
1157
 
1146
  nostretch:
1158
  nostretch:
1147
 
1159
 
1148
    cmp   [bgrdrawtype],dword 1
1160
    cmp   [bgrdrawtype],dword 1
1149
    jne   notiled
1161
    jne   notiled
1150
    mov   eax,[ebp+4]
1162
    mov   eax,[ebp+4]
1151
    add   eax,ecx
1163
    add   eax,ecx
1152
    cdq
1164
    cdq
1153
    movzx ebx,word [bgrxy]
1165
    movzx ebx,word [bgrxy]
1154
    div   ebx
1166
    div   ebx
1155
    mov   eax,edx
1167
    mov   eax,edx
1156
    imul  eax,[bgrx]
1168
    imul  eax,[bgrx]
1157
    push  eax
1169
    push  eax
1158
    mov   eax,[ebp+0]
1170
    mov   eax,[ebp+0]
1159
    add   eax,[esp+8]
1171
    add   eax,[esp+8]
1160
    movzx ebx,word [bgrxy+2]
1172
    movzx ebx,word [bgrxy+2]
1161
    cdq
1173
    cdq
1162
    div   ebx
1174
    div   ebx
1163
    mov   eax,edx
1175
    mov   eax,edx
1164
    add   eax,[esp]
1176
    add   eax,[esp]
1165
    add   esp,4
1177
    add   esp,4
1166
 
1178
 
1167
  notiled:
1179
  notiled:
1168
 
1180
 
1169
    lea  ecx,[eax+eax*2]
1181
    lea  ecx,[eax+eax*2]
1170
    mov  eax,39
1182
    mov  eax,39
1171
    mov  ebx,2
1183
    mov  ebx,2
1172
    mcall
1184
    mcall
1173
 
1185
 
1174
  nobpix:
1186
  nobpix:
1175
 
1187
 
1176
    pop  ecx
1188
    pop  ecx
1177
    pop  ebx
1189
    pop  ebx
1178
 
1190
 
1179
    mov  edx,eax
1191
    mov  edx,eax
1180
    mov  eax,[image]
1192
    mov  eax,[image]
1181
    mov  [eax],edx
1193
    mov  [eax],edx
1182
    mov  [eax],dl
1194
    mov  [eax],dl
1183
    inc  eax
1195
    inc  eax
1184
    ror  edx,8
1196
    ror  edx,8
1185
    mov  [eax],dl
1197
    mov  [eax],dl
1186
    inc  eax
1198
    inc  eax
1187
    ror  edx,8
1199
    ror  edx,8
1188
    mov  [eax],dl
1200
    mov  [eax],dl
1189
    inc  eax
1201
    inc  eax
1190
    mov  [image],eax
1202
    mov  [image],eax
1191
    inc  ebx
1203
    inc  ebx
1192
    mov  eax,[yw]
1204
    mov  eax,[yw]
1193
    inc  eax
1205
    inc  eax
1194
    cmp  ebx,eax
1206
    cmp  ebx,eax
1195
    jnz  newb
1207
    jnz  newb
1196
    xor  ebx,ebx
1208
    xor  ebx,ebx
1197
 
1209
 
1198
    inc  ecx
1210
    inc  ecx
1199
 
1211
 
1200
    mov  eax,[ya]
1212
    mov  eax,[ya]
1201
    add  [pixpos],eax
1213
    add  [pixpos],eax
1202
 
1214
 
1203
    cmp  [top],1
1215
    cmp  [top],1
1204
    jne  notop
1216
    jne  notop
1205
    cmp  ecx,38
1217
    cmp  ecx,38
1206
    je     toponly
1218
    je     toponly
1207
 
1219
 
1208
  notop:
1220
  notop:
1209
 
1221
 
1210
    cmp  ecx,52
1222
    cmp  ecx,52
1211
    jnz  newb
1223
    jnz  newb
1212
 
1224
 
1213
  toponly:
1225
  toponly:
1214
 
1226
 
1215
    mov  eax,7
1227
    mov  eax,7
1216
    mov  ebx,0x3000
1228
    mov  ebx,0x3000
1217
    mov  ecx,52 shl 16 + 52
1229
    mov  ecx,52 shl 16 + 52
1218
    xor  edx,edx
1230
    xor  edx,edx
1219
    mcall
1231
    mcall
1220
  .ex:
1232
  .ex:
1221
    mov  [load_pic],0
1233
    mov  [load_pic],0
1222
    ret
1234
    ret
1223
 
1235
 
1224
draw_text:
1236
draw_text:
1225
 
1237
 
1226
    mov  esi,[ebp+8]
1238
    mov  esi,[ebp+8]
1227
    add  esi,3
1239
    add  esi,3
1228
    push edi
1240
    push edi
1229
    mov  edi,title
1241
    mov  edi,title
1230
    mov  ecx,8
1242
    mov  ecx,8
1231
    cld
1243
    cld
1232
    rep  movsb
1244
    rep  movsb
1233
    pop  edi
1245
    pop  edi
1234
    mov   eax,title
1246
    mov   eax,title
1235
  news2:
1247
  news2:
1236
    cmp   [eax],byte 33
1248
    cmp   [eax],byte 33
1237
    jb      founde
1249
    jb      founde
1238
    inc   eax
1250
    inc   eax
1239
    cmp   eax,title+8;11
1251
    cmp   eax,title+8;11
1240
    jb      news2
1252
    jb      news2
1241
   founde:
1253
   founde:
1242
    sub   eax,title
1254
    sub   eax,title
1243
    mov   [tl],eax
1255
    mov   [tl],eax
1244
 
1256
 
1245
    mov   eax,[tl]
1257
    mov   eax,[tl]
1246
    lea   eax,[eax+eax*2]  ; eax *= char_width/2
1258
    lea   eax,[eax+eax*2]  ; eax *= char_width/2
1247
    shl   eax,16
1259
    shl   eax,16
1248
 
1260
 
1249
    mov   ebx,27*65536+40
1261
    mov   ebx,27*65536+40
1250
    sub   ebx,eax
1262
    sub   ebx,eax
1251
 
1263
 
1252
    mov   eax,4
1264
    mov   eax,4
1253
    xor   ecx,ecx         ; black shade of text
1265
    xor   ecx,ecx         ; black shade of text
1254
    mov   edx,title
1266
    mov   edx,title
1255
    mov   esi,[tl]
1267
    mov   esi,[tl]
1256
    add   ebx,1 shl 16      ;*65536+1
1268
    add   ebx,1 shl 16      ;*65536+1
1257
    mcall
1269
    mcall
1258
    inc   ebx
1270
    inc   ebx
1259
    mcall
1271
    mcall
1260
    add   ebx,1 shl 16
1272
    add   ebx,1 shl 16
1261
    mcall
1273
    mcall
1262
    inc   ebx
1274
    inc   ebx
1263
    mcall
1275
    mcall
1264
    sub   ebx,1 shl 16
1276
    sub   ebx,1 shl 16
1265
    mcall
1277
    mcall
1266
    dec   ebx
1278
    dec   ebx
1267
    sub   ebx,1 shl 16
1279
    sub   ebx,1 shl 16
1268
    mcall
1280
    mcall
1269
    sub   ebx,1 shl 16
1281
    sub   ebx,1 shl 16
1270
    dec   ebx
1282
    dec   ebx
1271
    mcall
1283
    mcall
1272
    dec   ebx
1284
    dec   ebx
1273
    add   ebx,1 shl 16
1285
    add   ebx,1 shl 16
1274
    mcall
1286
    mcall
1275
    inc   ebx
1287
    inc   ebx
1276
    mov   ecx,0xffffff
1288
    mov   ecx,0xffffff
1277
 
1289
 
1278
    mcall
1290
    mcall
1279
    mov   [draw_pic],0
1291
    mov   [draw_pic],0
1280
    ret
1292
    ret
1281
 
1293
 
1282
;   *********************************************
1294
;   *********************************************
1283
;   *******  WINDOW DEFINITIONS AND DRAW ********
1295
;   *******  WINDOW DEFINITIONS AND DRAW ********
1284
;   *********************************************
1296
;   *********************************************
1285
 
1297
 
1286
 
1298
 
1287
draw_window2:
1299
draw_window2:
1288
 
1300
 
1289
    mov  eax,12            ; function 12:tell os about windowdraw
1301
    mov  eax,12            ; function 12:tell os about windowdraw
1290
    mov  ebx,1               ; 1, start of draw
1302
    mov  ebx,1               ; 1, start of draw
1291
    mcall
1303
    mcall
1292
 
1304
 
1293
                   ; DRAW WINDOW
1305
                   ; DRAW WINDOW
1294
    xor  eax,eax             ; function 0 : define and draw window
1306
    xor  eax,eax             ; function 0 : define and draw window
1295
    mov  ebx,[ebp+0-2]
1307
    mov  ebx,[ebp+0-2]
1296
    mov  ecx,[ebp+4-2]
1308
    mov  ecx,[ebp+4-2]
1297
    add  ebx,[yw]           ; [x start] *65536 + [x size]
1309
    add  ebx,[yw]           ; [x start] *65536 + [x size]
1298
    add  ecx,51            ; [y start] *65536 + [y size]
1310
    add  ecx,51            ; [y start] *65536 + [y size]
1299
    mov  edx,0x41000000        ; color of work area RRGGBB,8->color gl
1311
    mov  edx,0x41000000        ; color of work area RRGGBB,8->color gl
1300
    mcall
1312
    mcall
1301
 
1313
 
1302
    mov  eax,8      ; button
1314
    mov  eax,8      ; button
1303
    mov  ebx,51
1315
    mov  ebx,51
1304
    mov  ecx,50
1316
    mov  ecx,50
1305
    mov  edx,0x40000002
1317
    mov  edx,0x40000002
1306
    mcall
1318
    mcall
1307
 
1319
 
1308
    mov  eax,5
1320
    mov  eax,5
1309
    mov  ebx,1
1321
    mov  ebx,1
1310
draw_icon2:
1322
draw_icon2:
1311
    xchg [load_pic],bl
1323
    xchg [load_pic],bl
1312
    test bl,bl
1324
    test bl,bl
1313
    je     draw_icon_end
1325
    je     draw_icon_end
1314
    mcall
1326
    mcall
1315
    jmp  draw_icon2
1327
    jmp  draw_icon2
1316
draw_icon_end:
1328
draw_icon_end:
1317
 
1329
 
1318
    mov  eax,5
1330
    mov  eax,5
1319
    mov  ebx,1
1331
    mov  ebx,1
1320
draw_icon_2:
1332
draw_icon_2:
1321
    xchg [draw_pic],bl
1333
    xchg [draw_pic],bl
1322
    test bl,bl
1334
    test bl,bl
1323
    je     draw_icon_end_2
1335
    je     draw_icon_end_2
1324
    mcall
1336
    mcall
1325
    jmp  draw_icon_2
1337
    jmp  draw_icon_2
1326
draw_icon_end_2:
1338
draw_icon_end_2:
1327
 
1339
 
1328
    mov  eax,9
1340
    mov  eax,9
1329
    mov  ebx,process_table
1341
    mov  ebx,process_table
1330
    mov  ecx,-1
1342
    mov  ecx,-1
1331
    mcall
1343
    mcall
1332
 
1344
 
1333
    call draw_picture
1345
    call draw_picture
1334
    call draw_text
1346
    call draw_text
1335
 
1347
 
1336
    mov  eax,12
1348
    mov  eax,12
1337
    mov  ebx,2
1349
    mov  ebx,2
1338
    mcall
1350
    mcall
1339
 
1351
 
1340
    ret
1352
    ret
1341
 
1353
 
1342
tl        dd      8
1354
tl        dd      8
1343
yw        dd     51
1355
yw        dd     51
1344
ya        dd      0
1356
ya        dd      0
1345
cur_btn   dd 40
1357
cur_btn   dd 40
1346
 
1358
 
1347
draw_pic    db      0
1359
draw_pic    db      0
1348
load_pic    db      0
1360
load_pic    db      0
1349
create_thread_event db 0
1361
create_thread_event db 0
1350
 
1362
 
1351
 
1363
 
1352
image          dd  0x3000
1364
image          dd  0x3000
1353
 
1365
 
1354
I_Param:
1366
I_Param:
1355
 
-
 
1356
 icon_data = I_END+0x1400
1367
 icon_data = I_END+0x1400
1357
 process_table = I_END+0x2400
1368
 process_table = I_END+0x2400
1358
 
1369
 
1359
bgrx dd ?
1370
bgrx dd ?
1360
bgry dd ?
1371
bgry dd ?
1361
param_str rb 31
1372
param_str rb 31
1362
 
1373
 
1363
;//////////////////////////
1374
;//////////////////////////
1364
 
1375
 
1365
bgrxy        dd    ?
1376
bgrxy        dd    ?
1366
warea:
1377
warea:
1367
 .by_x:
1378
 .by_x:
1368
  .right  dw ?
1379
  .right  dw ?
1369
  .left   dw ?
1380
  .left   dw ?
1370
 .by_y:
1381
 .by_y:
1371
  .bottom dw ?
1382
  .bottom dw ?
1372
  .top    dw ?
1383
  .top    dw ?
1373
scrxy        dd    ?
1384
scrxy        dd    ?
1374
bgrdrawtype  dd    ?
1385
bgrdrawtype  dd    ?
1375
 
1386
 
1376
pixpos dd    ?
1387
pixpos dd    ?
1377
top      dd ?
1388
top      dd ?
1378
icons dd ?
1389
icons dd ?
1379
addr  dd ?
1390
addr  dd ?
1380
cur_str    dd ?
1391
cur_str    dd ?
1381
cur_band   dd ?
1392
cur_band   dd ?
1382
sel_icon1  rd 1
1393
sel_icon1  rd 1
1383
icon_count rd 1
1394
icon_count rd 1
1384
gif_file  rb  GIF_SIZE
1395
gif_file  rb  GIF_SIZE
1385
strip_file rb RAW_SIZE
1396
strip_file rb RAW_SIZE
1386
 
1397
 
1387
IncludeUGlobals
1398
IncludeUGlobals
1388
 
1399
 
1389
I_END:
1400
I_END: