Subversion Repositories Kolibri OS

Rev

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

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