Subversion Repositories Kolibri OS

Rev

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

Rev 633 Rev 1751
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
 
958
 
959
    mov  eax,10
959
    mov  eax,10
960
    mcall
960
    mcall
961
 
961
 
962
    cmp  eax,1
962
    cmp  eax,1
963
    je     red2
963
    je     red2
964
    cmp  eax,3
964
    cmp  eax,3
965
    je     button2
965
    je     button2
966
 
966
 
967
    call  get_bg_info
967
    call  get_bg_info
968
    mov   eax,5
968
    mov   eax,5
969
    mov   ebx,1
969
    mov   ebx,1
970
    call  draw_icon2
970
    call  draw_icon2
971
 
971
 
972
    jmp  still2
972
    jmp  still2
973
 
973
 
974
  red2:
974
  red2:
975
        mcall   14
975
        mcall   14
976
        add     eax,0x00010001
976
        add     eax,0x00010001
977
        mov     [scrxy],eax
977
        mov     [scrxy],eax
978
        mcall   48,5
978
        mcall   48,5
979
        mov     [warea.by_x],eax
979
        mov     [warea.by_x],eax
980
        mov     [warea.by_y],ebx
980
        mov     [warea.by_y],ebx
981
        add     ebp,+12
981
        add     ebp,+12
982
        call    calc_icon_pos
982
        call    calc_icon_pos
983
        add     ebp,-12
983
        add     ebp,-12
984
        mcall   9,I_END,-1
984
        mcall   9,I_END,-1
985
        mov     eax,[I_END+process_information.box.left]
985
        mov     eax,[I_END+process_information.box.left]
986
        cmp     eax,[ebp+0]
986
        cmp     eax,[ebp+0]
987
        jne     @f
987
        jne     @f
988
        mov     eax,[I_END+process_information.box.top]
988
        mov     eax,[I_END+process_information.box.top]
989
        cmp     eax,[ebp+4]
989
        cmp     eax,[ebp+4]
990
        je      .lp1
990
        je      .lp1
991
    @@: call    get_bg_info
991
    @@: call    get_bg_info
992
        mcall   67,[ebp+0],[ebp+4],51,51
992
        mcall   67,[ebp+0],[ebp+4],51,51
993
 
993
 
994
  .lp1: call    draw_window2
994
  .lp1: 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
 
-
 
1001
	cmp	ah, 2
1000
 
1002
	jnz	still2
1001
 
1003
 
1002
    mov  esi,[ebp+8]
1004
    mov  esi,[ebp+8]
1003
          mov  ebx,1
1005
          mov  ebx,1
1004
          mov  edi,finfo.path
1006
          mov  edi,finfo.path
1005
          call fill_paths
1007
          call fill_paths
1006
          inc  ebx
1008
          inc  ebx
1007
       mov  edi,param_str
1009
       mov  edi,param_str
1008
    mov  dword[finfo_start+8],edi
1010
    mov  dword[finfo_start+8],edi
1009
          call fill_paths
1011
          call fill_paths
1010
          cmp  byte[edi],0
1012
          cmp  byte[edi],0
1011
    jne  .no0
1013
    jne  .no0
1012
    and  dword[finfo_start+8],0
1014
    and  dword[finfo_start+8],0
1013
  .no0:
1015
  .no0:
1014
    mov  ebx,finfo_start
1016
    mov  ebx,finfo_start
1015
    mov  eax,70
1017
    mov  eax,70
1016
    mcall
1018
    mcall
1017
    jmp  still2
1019
    jmp  still2
1018
 
1020
 
1019
fill_paths:
1021
fill_paths:
1020
        push esi edi
1022
        push esi edi
1021
;        dps  '>'
1023
;        dps  '>'
1022
        movzx ecx,byte[str_lens+ebx]
1024
        movzx ecx,byte[str_lens+ebx]
1023
        add  esi,[positions+ebx*4]
1025
        add  esi,[positions+ebx*4]
1024
        push esi
1026
        push esi
1025
        add  esi,ecx
1027
        add  esi,ecx
1026
 
1028
 
1027
    .l1:
1029
    .l1:
1028
        dec  esi
1030
        dec  esi
1029
        cmp  byte[esi],' '
1031
        cmp  byte[esi],' '
1030
        jnz   .found
1032
        jnz   .found
1031
        loop .l1
1033
        loop .l1
1032
  pop  esi
1034
  pop  esi
1033
  jmp  .noms
1035
  jmp  .noms
1034
    .found:
1036
    .found:
1035
        lea  ecx,[esi+1]
1037
        lea  ecx,[esi+1]
1036
        pop  esi
1038
        pop  esi
1037
        sub  ecx,esi
1039
        sub  ecx,esi
1038
        rep  movsb
1040
        rep  movsb
1039
 .noms:
1041
 .noms:
1040
        and  byte[edi],0
1042
        and  byte[edi],0
1041
;        call debug_outstr
1043
;        call debug_outstr
1042
;        dps  <'<',13,10>
1044
;        dps  <'<',13,10>
1043
        pop  edi esi
1045
        pop  edi esi
1044
        ret
1046
        ret
1045
 
1047
 
1046
atoi:
1048
atoi:
1047
        push esi
1049
        push esi
1048
        xor  eax,eax
1050
        xor  eax,eax
1049
        xor  ebx,ebx
1051
        xor  ebx,ebx
1050
  .nxt:
1052
  .nxt:
1051
    lodsb
1053
    lodsb
1052
    cmp  al,'0'
1054
    cmp  al,'0'
1053
    jb   .done
1055
    jb   .done
1054
    cmp  al,'9'
1056
    cmp  al,'9'
1055
    ja   .done
1057
    ja   .done
1056
    sub  eax,'0'
1058
    sub  eax,'0'
1057
    imul ebx,10
1059
    imul ebx,10
1058
    add  ebx,eax
1060
    add  ebx,eax
1059
    jmp  .nxt
1061
    jmp  .nxt
1060
  .done:
1062
  .done:
1061
      pop  esi
1063
      pop  esi
1062
      mov  eax,ebx
1064
      mov  eax,ebx
1063
        ret
1065
        ret
1064
 
1066
 
1065
itoa:
1067
itoa:
1066
        add  esi,2
1068
        add  esi,2
1067
    mov ebx,10
1069
    mov ebx,10
1068
    mov ecx,3
1070
    mov ecx,3
1069
  .l0:
1071
  .l0:
1070
    xor edx,edx
1072
    xor edx,edx
1071
    div ebx
1073
    div ebx
1072
    add dl,'0'
1074
    add dl,'0'
1073
    mov [esi],dl
1075
    mov [esi],dl
1074
    dec esi
1076
    dec esi
1075
    loop .l0
1077
    loop .l0
1076
        ret
1078
        ret
1077
 
1079
 
1078
draw_picture:
1080
draw_picture:
1079
    mov  [image],0x3000
1081
    mov  [image],0x3000
1080
    mov  edi,[ebp+8]
1082
    mov  edi,[ebp+8]
1081
    lea  esi,[edi+12]
1083
    lea  esi,[edi+12]
1082
    call atoi
1084
    call atoi
1083
          cmp  eax,[icon_count]
1085
          cmp  eax,[icon_count]
1084
          ja  toponly.ex
1086
          ja  toponly.ex
1085
          imul eax,(32*3*32)
1087
          imul eax,(32*3*32)
1086
          lea  edi,[eax+strip_file+8]
1088
          lea  edi,[eax+strip_file+8]
1087
    xor  ebx,ebx
1089
    xor  ebx,ebx
1088
    xor  ecx,ecx
1090
    xor  ecx,ecx
1089
    mov  esi,edi;strip_file+8+(32*3*32)*2
1091
    mov  esi,edi;strip_file+8+(32*3*32)*2
1090
 
1092
 
1091
    mov  [pixpos],0
1093
    mov  [pixpos],0
1092
  newb:
1094
  newb:
1093
    push ebx
1095
    push ebx
1094
    push ecx
1096
    push ecx
1095
 
1097
 
1096
    cmp  ebx,10
1098
    cmp  ebx,10
1097
    jb     yesbpix
1099
    jb     yesbpix
1098
    cmp  ebx,42
1100
    cmp  ebx,42
1099
    jge  yesbpix
1101
    jge  yesbpix
1100
    cmp  ecx,31;2
1102
    cmp  ecx,31;2
1101
    jg     yesbpix
1103
    jg     yesbpix
1102
 
1104
 
1103
    push esi
1105
    push esi
1104
    mov  esi,edi
1106
    mov  esi,edi
1105
    add  esi,[pixpos]
1107
    add  esi,[pixpos]
1106
 
1108
 
1107
no_correction_pixpos:
1109
no_correction_pixpos:
1108
    add  [pixpos],3
1110
    add  [pixpos],3
1109
    mov  eax,[esi]
1111
    mov  eax,[esi]
1110
    and  eax,0xffffff
1112
    and  eax,0xffffff
1111
 
1113
 
1112
    pop  esi
1114
    pop  esi
1113
 
1115
 
1114
    cmp eax,0
1116
    cmp eax,0
1115
    je    yesbpix
1117
    je    yesbpix
1116
    cmp eax,0xfffcff ;f5f5f5
1118
    cmp eax,0xfffcff ;f5f5f5
1117
    je    yesbpix
1119
    je    yesbpix
1118
    jmp nobpix
1120
    jmp nobpix
1119
 
1121
 
1120
  yesbpix:
1122
  yesbpix:
1121
 
1123
 
1122
  stretch:
1124
  stretch:
1123
    cmp   [bgrdrawtype],dword 2
1125
    cmp   [bgrdrawtype],dword 2
1124
    jne   nostretch
1126
    jne   nostretch
1125
    mov   eax,[ebp+4]
1127
    mov   eax,[ebp+4]
1126
    add   eax,ecx
1128
    add   eax,ecx
1127
    imul  eax,[bgry]
1129
    imul  eax,[bgry]
1128
    cdq
1130
    cdq
1129
    movzx ebx,word [scrxy]
1131
    movzx ebx,word [scrxy]
1130
    div   ebx
1132
    div   ebx
1131
    imul  eax,[bgrx]
1133
    imul  eax,[bgrx]
1132
    push  eax
1134
    push  eax
1133
    mov   eax,[ebp+0]
1135
    mov   eax,[ebp+0]
1134
    add   eax,[esp+8]
1136
    add   eax,[esp+8]
1135
    imul  eax,[bgrx]
1137
    imul  eax,[bgrx]
1136
    cdq
1138
    cdq
1137
    movzx ebx,word [scrxy+2]
1139
    movzx ebx,word [scrxy+2]
1138
    div   ebx
1140
    div   ebx
1139
    add   eax,[esp]
1141
    add   eax,[esp]
1140
    add   esp,4
1142
    add   esp,4
1141
 
1143
 
1142
    jmp   notiled
1144
    jmp   notiled
1143
 
1145
 
1144
  nostretch:
1146
  nostretch:
1145
 
1147
 
1146
    cmp   [bgrdrawtype],dword 1
1148
    cmp   [bgrdrawtype],dword 1
1147
    jne   notiled
1149
    jne   notiled
1148
    mov   eax,[ebp+4]
1150
    mov   eax,[ebp+4]
1149
    add   eax,ecx
1151
    add   eax,ecx
1150
    cdq
1152
    cdq
1151
    movzx ebx,word [bgrxy]
1153
    movzx ebx,word [bgrxy]
1152
    div   ebx
1154
    div   ebx
1153
    mov   eax,edx
1155
    mov   eax,edx
1154
    imul  eax,[bgrx]
1156
    imul  eax,[bgrx]
1155
    push  eax
1157
    push  eax
1156
    mov   eax,[ebp+0]
1158
    mov   eax,[ebp+0]
1157
    add   eax,[esp+8]
1159
    add   eax,[esp+8]
1158
    movzx ebx,word [bgrxy+2]
1160
    movzx ebx,word [bgrxy+2]
1159
    cdq
1161
    cdq
1160
    div   ebx
1162
    div   ebx
1161
    mov   eax,edx
1163
    mov   eax,edx
1162
    add   eax,[esp]
1164
    add   eax,[esp]
1163
    add   esp,4
1165
    add   esp,4
1164
 
1166
 
1165
  notiled:
1167
  notiled:
1166
 
1168
 
1167
    lea  ecx,[eax+eax*2]
1169
    lea  ecx,[eax+eax*2]
1168
    mov  eax,39
1170
    mov  eax,39
1169
    mov  ebx,2
1171
    mov  ebx,2
1170
    mcall
1172
    mcall
1171
 
1173
 
1172
  nobpix:
1174
  nobpix:
1173
 
1175
 
1174
    pop  ecx
1176
    pop  ecx
1175
    pop  ebx
1177
    pop  ebx
1176
 
1178
 
1177
    mov  edx,eax
1179
    mov  edx,eax
1178
    mov  eax,[image]
1180
    mov  eax,[image]
1179
    mov  [eax],edx
1181
    mov  [eax],edx
1180
    mov  [eax],dl
1182
    mov  [eax],dl
1181
    inc  eax
1183
    inc  eax
1182
    ror  edx,8
1184
    ror  edx,8
1183
    mov  [eax],dl
1185
    mov  [eax],dl
1184
    inc  eax
1186
    inc  eax
1185
    ror  edx,8
1187
    ror  edx,8
1186
    mov  [eax],dl
1188
    mov  [eax],dl
1187
    inc  eax
1189
    inc  eax
1188
    mov  [image],eax
1190
    mov  [image],eax
1189
    inc  ebx
1191
    inc  ebx
1190
    mov  eax,[yw]
1192
    mov  eax,[yw]
1191
    inc  eax
1193
    inc  eax
1192
    cmp  ebx,eax
1194
    cmp  ebx,eax
1193
    jnz  newb
1195
    jnz  newb
1194
    xor  ebx,ebx
1196
    xor  ebx,ebx
1195
 
1197
 
1196
    inc  ecx
1198
    inc  ecx
1197
 
1199
 
1198
    mov  eax,[ya]
1200
    mov  eax,[ya]
1199
    add  [pixpos],eax
1201
    add  [pixpos],eax
1200
 
1202
 
1201
    cmp  [top],1
1203
    cmp  [top],1
1202
    jne  notop
1204
    jne  notop
1203
    cmp  ecx,38
1205
    cmp  ecx,38
1204
    je     toponly
1206
    je     toponly
1205
 
1207
 
1206
  notop:
1208
  notop:
1207
 
1209
 
1208
    cmp  ecx,52
1210
    cmp  ecx,52
1209
    jnz  newb
1211
    jnz  newb
1210
 
1212
 
1211
  toponly:
1213
  toponly:
1212
 
1214
 
1213
    mov  eax,7
1215
    mov  eax,7
1214
    mov  ebx,0x3000
1216
    mov  ebx,0x3000
1215
    mov  ecx,52 shl 16 + 52
1217
    mov  ecx,52 shl 16 + 52
1216
    xor  edx,edx
1218
    xor  edx,edx
1217
    mcall
1219
    mcall
1218
  .ex:
1220
  .ex:
1219
    mov  [load_pic],0
1221
    mov  [load_pic],0
1220
    ret
1222
    ret
1221
 
1223
 
1222
draw_text:
1224
draw_text:
1223
 
1225
 
1224
    mov  esi,[ebp+8]
1226
    mov  esi,[ebp+8]
1225
    add  esi,3
1227
    add  esi,3
1226
    push edi
1228
    push edi
1227
    mov  edi,title
1229
    mov  edi,title
1228
    mov  ecx,8
1230
    mov  ecx,8
1229
    cld
1231
    cld
1230
    rep  movsb
1232
    rep  movsb
1231
    pop  edi
1233
    pop  edi
1232
    mov   eax,title
1234
    mov   eax,title
1233
  news2:
1235
  news2:
1234
    cmp   [eax],byte 33
1236
    cmp   [eax],byte 33
1235
    jb      founde
1237
    jb      founde
1236
    inc   eax
1238
    inc   eax
1237
    cmp   eax,title+8;11
1239
    cmp   eax,title+8;11
1238
    jb      news2
1240
    jb      news2
1239
   founde:
1241
   founde:
1240
    sub   eax,title
1242
    sub   eax,title
1241
    mov   [tl],eax
1243
    mov   [tl],eax
1242
 
1244
 
1243
    mov   eax,[tl]
1245
    mov   eax,[tl]
1244
    lea   eax,[eax+eax*2]  ; eax *= char_width/2
1246
    lea   eax,[eax+eax*2]  ; eax *= char_width/2
1245
    shl   eax,16
1247
    shl   eax,16
1246
 
1248
 
1247
    mov   ebx,27*65536+40
1249
    mov   ebx,27*65536+40
1248
    sub   ebx,eax
1250
    sub   ebx,eax
1249
 
1251
 
1250
    mov   eax,4
1252
    mov   eax,4
1251
    xor   ecx,ecx         ; black shade of text
1253
    xor   ecx,ecx         ; black shade of text
1252
    mov   edx,title
1254
    mov   edx,title
1253
    mov   esi,[tl]
1255
    mov   esi,[tl]
1254
    add   ebx,1 shl 16      ;*65536+1
1256
    add   ebx,1 shl 16      ;*65536+1
1255
    mcall
1257
    mcall
1256
    inc   ebx
1258
    inc   ebx
1257
    mcall
1259
    mcall
1258
    add   ebx,1 shl 16
1260
    add   ebx,1 shl 16
1259
    mcall
1261
    mcall
1260
    inc   ebx
1262
    inc   ebx
1261
    mcall
1263
    mcall
1262
    sub   ebx,1 shl 16
1264
    sub   ebx,1 shl 16
1263
    mcall
1265
    mcall
1264
    dec   ebx
1266
    dec   ebx
1265
    sub   ebx,1 shl 16
1267
    sub   ebx,1 shl 16
1266
    mcall
1268
    mcall
1267
    sub   ebx,1 shl 16
1269
    sub   ebx,1 shl 16
1268
    dec   ebx
1270
    dec   ebx
1269
    mcall
1271
    mcall
1270
    dec   ebx
1272
    dec   ebx
1271
    add   ebx,1 shl 16
1273
    add   ebx,1 shl 16
1272
    mcall
1274
    mcall
1273
    inc   ebx
1275
    inc   ebx
1274
    mov   ecx,0xffffff
1276
    mov   ecx,0xffffff
1275
 
1277
 
1276
    mcall
1278
    mcall
1277
    mov   [draw_pic],0
1279
    mov   [draw_pic],0
1278
    ret
1280
    ret
1279
 
1281
 
1280
;   *********************************************
1282
;   *********************************************
1281
;   *******  WINDOW DEFINITIONS AND DRAW ********
1283
;   *******  WINDOW DEFINITIONS AND DRAW ********
1282
;   *********************************************
1284
;   *********************************************
1283
 
1285
 
1284
 
1286
 
1285
draw_window2:
1287
draw_window2:
1286
 
1288
 
1287
    mov  eax,12            ; function 12:tell os about windowdraw
1289
    mov  eax,12            ; function 12:tell os about windowdraw
1288
    mov  ebx,1               ; 1, start of draw
1290
    mov  ebx,1               ; 1, start of draw
1289
    mcall
1291
    mcall
1290
 
1292
 
1291
                   ; DRAW WINDOW
1293
                   ; DRAW WINDOW
1292
    xor  eax,eax             ; function 0 : define and draw window
1294
    xor  eax,eax             ; function 0 : define and draw window
1293
    mov  ebx,[ebp+0-2]
1295
    mov  ebx,[ebp+0-2]
1294
    mov  ecx,[ebp+4-2]
1296
    mov  ecx,[ebp+4-2]
1295
    add  ebx,[yw]           ; [x start] *65536 + [x size]
1297
    add  ebx,[yw]           ; [x start] *65536 + [x size]
1296
    add  ecx,51            ; [y start] *65536 + [y size]
1298
    add  ecx,51            ; [y start] *65536 + [y size]
1297
    mov  edx,0x01000000        ; color of work area RRGGBB,8->color gl
1299
    mov  edx,0x41000000        ; color of work area RRGGBB,8->color gl
1298
    mcall
1300
    mcall
1299
 
1301
 
1300
    mov  eax,8      ; button
1302
    mov  eax,8      ; button
1301
    mov  ebx,51
1303
    mov  ebx,51
1302
    mov  ecx,50
1304
    mov  ecx,50
1303
    mov  edx,0x40000001
1305
    mov  edx,0x40000002
1304
    mcall
1306
    mcall
1305
 
1307
 
1306
    mov  eax,5
1308
    mov  eax,5
1307
    mov  ebx,1
1309
    mov  ebx,1
1308
draw_icon2:
1310
draw_icon2:
1309
    xchg [load_pic],bl
1311
    xchg [load_pic],bl
1310
    test bl,bl
1312
    test bl,bl
1311
    je     draw_icon_end
1313
    je     draw_icon_end
1312
    mcall
1314
    mcall
1313
    jmp  draw_icon2
1315
    jmp  draw_icon2
1314
draw_icon_end:
1316
draw_icon_end:
1315
 
1317
 
1316
    mov  eax,5
1318
    mov  eax,5
1317
    mov  ebx,1
1319
    mov  ebx,1
1318
draw_icon_2:
1320
draw_icon_2:
1319
    xchg [draw_pic],bl
1321
    xchg [draw_pic],bl
1320
    test bl,bl
1322
    test bl,bl
1321
    je     draw_icon_end_2
1323
    je     draw_icon_end_2
1322
    mcall
1324
    mcall
1323
    jmp  draw_icon_2
1325
    jmp  draw_icon_2
1324
draw_icon_end_2:
1326
draw_icon_end_2:
1325
 
1327
 
1326
    mov  eax,9
1328
    mov  eax,9
1327
    mov  ebx,process_table
1329
    mov  ebx,process_table
1328
    mov  ecx,-1
1330
    mov  ecx,-1
1329
    mcall
1331
    mcall
1330
 
1332
 
1331
    call draw_picture
1333
    call draw_picture
1332
    call draw_text
1334
    call draw_text
1333
 
1335
 
1334
    mov  eax,12
1336
    mov  eax,12
1335
    mov  ebx,2
1337
    mov  ebx,2
1336
    mcall
1338
    mcall
1337
 
1339
 
1338
    ret
1340
    ret
1339
 
1341
 
1340
tl        dd      8
1342
tl        dd      8
1341
yw        dd     51
1343
yw        dd     51
1342
ya        dd      0
1344
ya        dd      0
1343
cur_btn   dd 40
1345
cur_btn   dd 40
1344
 
1346
 
1345
draw_pic    db      0
1347
draw_pic    db      0
1346
load_pic    db      0
1348
load_pic    db      0
1347
create_thread_event db 0
1349
create_thread_event db 0
1348
 
1350
 
1349
 
1351
 
1350
image          dd  0x3000
1352
image          dd  0x3000
1351
 
1353
 
1352
I_Param:
1354
I_Param:
1353
 
1355
 
1354
 icon_data = I_END+0x1400
1356
 icon_data = I_END+0x1400
1355
 process_table = I_END+0x2400
1357
 process_table = I_END+0x2400
1356
 
1358
 
1357
bgrx dd ?
1359
bgrx dd ?
1358
bgry dd ?
1360
bgry dd ?
1359
param_str rb 31
1361
param_str rb 31
1360
 
1362
 
1361
;//////////////////////////
1363
;//////////////////////////
1362
 
1364
 
1363
bgrxy        dd    ?
1365
bgrxy        dd    ?
1364
warea:
1366
warea:
1365
 .by_x:
1367
 .by_x:
1366
  .right  dw ?
1368
  .right  dw ?
1367
  .left   dw ?
1369
  .left   dw ?
1368
 .by_y:
1370
 .by_y:
1369
  .bottom dw ?
1371
  .bottom dw ?
1370
  .top    dw ?
1372
  .top    dw ?
1371
scrxy        dd    ?
1373
scrxy        dd    ?
1372
bgrdrawtype  dd    ?
1374
bgrdrawtype  dd    ?
1373
 
1375
 
1374
pixpos dd    ?
1376
pixpos dd    ?
1375
top      dd ?
1377
top      dd ?
1376
icons dd ?
1378
icons dd ?
1377
addr  dd ?
1379
addr  dd ?
1378
cur_str    dd ?
1380
cur_str    dd ?
1379
cur_band   dd ?
1381
cur_band   dd ?
1380
sel_icon1  rd 1
1382
sel_icon1  rd 1
1381
icon_count rd 1
1383
icon_count rd 1
1382
gif_file  rb  GIF_SIZE
1384
gif_file  rb  GIF_SIZE
1383
strip_file rb RAW_SIZE
1385
strip_file rb RAW_SIZE
1384
 
1386
 
1385
IncludeUGlobals
1387
IncludeUGlobals
1386
 
1388
 
1387
I_END:
1389
I_END: