Subversion Repositories Kolibri OS

Rev

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

Rev 411 Rev 485
Line 17... Line 17...
17
ICON_STRIP equ '/RD/1/ICONSTRP.GIF'
17
ICON_STRIP equ '/RD/1/ICONSTRP.GIF'
Line 18... Line 18...
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           ; title 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'
Line 53... Line 53...
53
    mov  esi,[current_icon]
53
    mov  esi,[current_icon]
54
    jmp  band
54
    jmp  band
55
still:
55
still:
Line 56... Line 56...
56
 
56
 
57
    mov  eax,10              ; wait here for event
57
    mov  eax,10              ; wait here for event
Line 58... Line 58...
58
    int  0x40
58
    mcall
59
 
59
 
60
    dec  eax                   ; redraw request ?
60
    dec  eax                   ; redraw request ?
61
    jz   red
61
    jz   red
Line 62... Line 62...
62
    dec  eax                   ; key in buffer ?
62
    dec  eax                   ; key in buffer ?
63
    jz   key
63
    jz   key
64
 
64
 
Line 65... Line 65...
65
  button:                    ; button
65
  button:                    ; button
Line 66... Line 66...
66
    mov  al,17              ; get id
66
    mov  al,17              ; get id
67
    int  0x40
67
    mcall
Line 137... Line 137...
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
    int 0x40
142
    mcall
Line 143... Line 143...
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
    int  0x40
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
    int  0x40
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
Line 169... Line 169...
169
    jne  newread
169
    jne  newread
Line 170... Line 170...
170
 
170
 
171
    mov  eax,18
171
    mov  eax,18
172
    mov  ebx,2
172
    mov  ebx,2
173
    mov  ecx,esi
173
    mov  ecx,esi
Line 174... Line 174...
174
    int  0x40
174
    mcall
Line 175... Line 175...
175
 
175
 
176
    jmp  newread2
176
    jmp  newread2
Line 204... Line 204...
204
        mov     ebx, finfo_start
204
        mov     ebx, finfo_start
205
        mov     dword [ebx+8], boot_str+6
205
        mov     dword [ebx+8], boot_str+6
206
        mov     esi, iconname
206
        mov     esi, iconname
207
        call    lst_path
207
        call    lst_path
208
        mov     eax, 70
208
        mov     eax, 70
209
        int     0x40
209
        mcall
210
    jmp   still
210
    jmp   still
Line 211... Line 211...
211
 
211
 
Line 212... Line 212...
212
  no_apply:
212
  no_apply:
Line 217... Line 217...
217
    mov  eax,4
217
    mov  eax,4
218
    mov  ebx,24*65536+250+8*14
218
    mov  ebx,24*65536+250+8*14
219
    mov  ecx,0xc0ff0000
219
    mov  ecx,0xc0ff0000
220
    mov  edx,add_text
220
    mov  edx,add_text
221
    mov  edi,0xffffff
221
    mov  edi,0xffffff
222
    int  0x40
222
    mcall
Line 223... Line 223...
223
 
223
 
224
    mov  eax,10
224
    mov  eax,10
225
    int  0x40
225
    mcall
226
    cmp  eax,3
226
    cmp  eax,3
227
    jne  still
227
    jne  still
228
    mov  eax,17
228
    mov  eax,17
229
    int  0x40
229
    mcall
230
    shr  eax,8
230
    shr  eax,8
231
    cmp  eax,40
231
    cmp  eax,40
232
    jb   no_f
232
    jb   no_f
233
    mov  edi,eax
233
    mov  edi,eax
Line 283... Line 283...
283
    mov  eax,4
283
    mov  eax,4
284
    mov  ebx,24*65536+250+8*14
284
    mov  ebx,24*65536+250+8*14
285
    mov  ecx,0xc0ff0000
285
    mov  ecx,0xc0ff0000
286
    mov  edx,rem_text
286
    mov  edx,rem_text
287
    mov  edi,0xffffff
287
    mov  edi,0xffffff
288
    int  0x40
288
    mcall
Line 289... Line 289...
289
 
289
 
290
    mov  eax,10
290
    mov  eax,10
291
    int  0x40
291
    mcall
292
    cmp  eax,3
292
    cmp  eax,3
293
    jne  no_f;ound
293
    jne  no_f;ound
294
    mov  eax,17
294
    mov  eax,17
295
    int  0x40
295
    mcall
296
    shr  eax,8
296
    shr  eax,8
297
    cmp  eax,40
297
    cmp  eax,40
298
    jb   red;no_f;ound
298
    jb   red;no_f;ound
Line 404... Line 404...
404
 
404
 
405
    mov  eax,13              ; clear text area
405
    mov  eax,13              ; clear text area
406
    mov  ebx,100*65536+180
406
    mov  ebx,100*65536+180
407
    mov  ecx,(278+12)*65536+40
407
    mov  ecx,(278+12)*65536+40
408
    mov  edx,0xffffff
408
    mov  edx,0xffffff
Line 409... Line 409...
409
    int  0x40
409
    mcall
410
 
410
 
411
          xor  edi,edi
411
          xor  edi,edi
412
    mov  eax,4               ; icon text
412
    mov  eax,4               ; icon text
Line 417... Line 417...
417
    mov  ecx,0x000000
417
    mov  ecx,0x000000
418
    mov  edx,[current_icon]
418
    mov  edx,[current_icon]
419
    add  edx,[positions+edi*4]
419
    add  edx,[positions+edi*4]
420
    movzx esi,byte[str_lens+edi]
420
    movzx esi,byte[str_lens+edi]
421
    inc  edi
421
    inc  edi
422
    int  0x40
422
    mcall
423
    add  ebx,14
423
    add  ebx,14
424
    pop  ecx
424
    pop  ecx
425
    loop .ll
425
    loop .ll
Line 426... Line 426...
426
 
426
 
Line 502... Line 502...
502
    call print_strings
502
    call print_strings
Line 503... Line 503...
503
 
503
 
504
    pop  edi
504
    pop  edi
505
  f11:
505
  f11:
506
    mov  eax,10
506
    mov  eax,10
507
    int  0x40
507
    mcall
508
    cmp  eax,2
508
    cmp  eax,2
509
    jz   fbu
509
    jz   fbu
510
    jmp  rs_done
510
    jmp  rs_done
511
  fbu:
511
  fbu:
512
    mov  eax,2
512
    mov  eax,2
513
    int  0x40
513
    mcall
514
    shr  eax,8
514
    shr  eax,8
515
    cmp  eax,13
515
    cmp  eax,13
516
    je   rs_done
516
    je   rs_done
517
    cmp  eax,8
517
    cmp  eax,8
Line 546... Line 546...
546
    popa
546
    popa
547
    ret
547
    ret
Line 548... Line 548...
548
 
548
 
549
 key:                       ; key
549
 key:                       ; key
550
    mov  al,2               ; just read it and ignore
550
    mov  al,2               ; just read it and ignore
551
    int  0x40
551
    mcall
Line 552... Line 552...
552
    jmp  still
552
    jmp  still
553
 
553
 
554
;   *********************************************
554
;   *********************************************
Line 558... Line 558...
558
 
558
 
Line 559... Line 559...
559
draw_window:
559
draw_window:
560
 
560
 
561
    mov  eax,12                    ; function 12:tell os about windowdraw
561
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 562... Line 562...
562
    mov  ebx,1                     ; 1, start of draw
562
    mov  ebx,1                     ; 1, start of draw
563
    int  0x40
563
    mcall
564
 
564
 
565
                                   ; DRAW WINDOW
565
                                   ; DRAW WINDOW
566
    xor  eax,eax
566
    xor  eax,eax
567
    mov  ebx,210*65536+300
567
    mov  ebx,210*65536+300
568
    mov  ecx,30*65536+390-14
568
    mov  ecx,30*65536+390-14
Line 569... Line 569...
569
    mov  edx,0x13ffffff
569
    mov  edx,0x13ffffff
570
    mov  edi,header       ; WINDOW LABEL
570
    mov  edi,title       ; WINDOW LABEL
571
    int  0x40
571
    mcall
572
 
572
 
573
    mov  eax,13                    ; WINDOW AREA
573
    mov  eax,13                    ; WINDOW AREA
Line 574... Line 574...
574
    mov  ebx,20*65536+260
574
    mov  ebx,20*65536+260
575
    mov  ecx,35*65536+200
575
    mov  ecx,35*65536+200
576
    mov  edx,0x3366cc
576
    mov  edx,0x3366cc
577
    int  0x40
577
    mcall
578
 
578
 
Line 579... Line 579...
579
    mov  eax,38                    ; VERTICAL LINE ON WINDOW AREA
579
    mov  eax,38                    ; VERTICAL LINE ON WINDOW AREA
580
    mov  ebx,150*65536+150
580
    mov  ebx,150*65536+150
581
    mov  ecx,35*65536+235
581
    mov  ecx,35*65536+235
582
    mov  edx,0xffffff
582
    mov  edx,0xffffff
583
    int  0x40
583
    mcall
Line 584... Line 584...
584
 
584
 
585
    mov  eax,38                    ; HOROZONTAL LINE ON WINDOW AREA
585
    mov  eax,38                    ; HOROZONTAL LINE ON WINDOW AREA
586
    mov  ebx,20*65536+280
586
    mov  ebx,20*65536+280
587
    mov  ecx,135*65536+135
587
    mov  ecx,135*65536+135
588
    mov  edx,0xffffff
588
    mov  edx,0xffffff
589
    int  0x40
589
    mcall
590
 
590
 
591
    mov  eax,8                     ; TEXT ENTER BUTTONS
591
    mov  eax,8                     ; TEXT ENTER BUTTONS
592
    mov  ebx,20*65536+72
592
    mov  ebx,20*65536+72
593
    mov  ecx,(275+1+14)*65536+13-2
593
    mov  ecx,(275+1+14)*65536+13-2
594
    mov  edx,11
594
    mov  edx,11
595
    mov  esi,[bcolor]
595
    mov  esi,[bcolor]
Line 596... Line 596...
596
    int  0x40
596
    mcall
597
    inc  edx
597
    inc  edx
598
    add  ecx,14*65536
598
    add  ecx,14*65536
599
    int  0x40
599
    mcall
600
    inc  edx
600
    inc  edx
601
    add  ecx,14*65536
601
    add  ecx,14*65536
Line 602... Line 602...
602
    int  0x40
602
    mcall
603
 
603
 
604
;    mov  eax,8                     ; APPLY AND SAVE CHANGES BUTTON
604
;    mov  eax,8                     ; APPLY AND SAVE CHANGES BUTTON
605
    mov  ebx,20*65536+259
605
    mov  ebx,20*65536+259
606
    mov  ecx,(329+2)*65536+15-4
606
    mov  ecx,(329+2)*65536+15-4
Line 607... Line 607...
607
    mov  edx,21
607
    mov  edx,21
608
    mov  esi,[bcolor]
608
    mov  esi,[bcolor]
609
    int  0x40
609
    mcall
610
 
610
 
Line 611... Line 611...
611
;    mov  eax,8                     ; ADD ICON BUTTON
611
;    mov  eax,8                     ; ADD ICON BUTTON
612
    mov  ebx,20*65536+129-2
612
    mov  ebx,20*65536+129-2
613
    add  ecx,14*65536
613
    add  ecx,14*65536
614
    inc  edx
614
    inc  edx
Line 643... Line 643...
643
    mov  edx,text
643
    mov  edx,text
644
    mov  esi,47
644
    mov  esi,47
645
  newline:
645
  newline:
646
    mov  ecx,[edx]
646
    mov  ecx,[edx]
647
    add  edx,4
647
    add  edx,4
648
    int  0x40
648
    mcall
649
    add  ebx,14
649
    add  ebx,14
650
    add  edx,47
650
    add  edx,47
651
    cmp  [edx],byte 'x'
651
    cmp  [edx],byte 'x'
652
    jne  newline
652
    jne  newline
653
draw_btns:
653
draw_btns:
Line 671... Line 671...
671
    mov  esi,0xe7e05a
671
    mov  esi,0xe7e05a
672
  nores:
672
  nores:
Line 673... Line 673...
673
 
673
 
674
    push eax
674
    push eax
675
    mov  eax,8
675
    mov  eax,8
676
    int  0x40
676
    mcall
Line 677... Line 677...
677
    pop  eax
677
    pop  eax
Line 678... Line 678...
678
 
678
 
Line 700... Line 700...
700
    jbe  newbline
700
    jbe  newbline
701
    call print_strings
701
    call print_strings
702
    call draw_icon
702
    call draw_icon
703
    mov  eax,12                    ; function 12:tell os about windowdraw
703
    mov  eax,12                    ; function 12:tell os about windowdraw
704
    mov  ebx,2                     ; 2, end of draw
704
    mov  ebx,2                     ; 2, end of draw
705
    int  0x40
705
    mcall
Line 706... Line 706...
706
 
706
 
Line 707... Line 707...
707
    ret
707
    ret
708
 
708
 
Line 776... Line 776...
776
      db 255,255,255,0,   ' €€Œ…’›                                     '
776
      db 255,255,255,0,   ' €€Œ…’›                                     '
777
      db 255,255,255,0,   '                 ˆŒ…ˆ’œ                     '
777
      db 255,255,255,0,   '                 ˆŒ…ˆ’œ                     '
778
      db 255,255,255,0,   '      „Ž€‚ˆ’œ              “„€‹ˆ’œ            '
778
      db 255,255,255,0,   '      „Ž€‚ˆ’œ              “„€‹ˆ’œ            '
779
      db 0,0,0,0,         '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ   '
779
      db 0,0,0,0,         '€†Œˆ’… € Ž‡ˆ–ˆž ˆŠŽŠˆ „‹Ÿ …„€Š’ˆŽ‚€ˆŸ   '
780
      db                  'x' ; <- END MARKER, DONT DELETE
780
      db                  'x' ; <- END MARKER, DONT DELETE
781
add_text             db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ     ',0
-
 
Line -... Line 781...
-
 
781
 
782
 
782
add_text               db '€†Œˆ’… € Ž‡ˆ–ˆž …ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ     ',0
783
rem_text             db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ       ',0
783
rem_text               db '€†Œˆ’… € Ž‡ˆ–ˆž ˆ‘Ž‹œ‡“…ŒŽ‰ ˆŠŽŠˆ       ',0
Line 784... Line 784...
784
header                 db 'Œ¥­¥¤¦¥à ¨ª®­®ª',0
784
title                 db 'Œ¥­¥¤¦¥à ¨ª®­®ª',0
785
 
785
 
786
else if lang eq ge
786
else if lang eq ge
787
  text:
787
  text:
788
      db 255,255,255,0,   '   TITLE                                       '
788
      db 255,255,255,0,   '   TITLE                                       '
789
      db 255,255,255,0,   '  APP NAME                                     '
789
      db 255,255,255,0,   '  APP NAME                                     '
790
      db 255,255,255,0,   ' PARAMETER                                     '
790
      db 255,255,255,0,   ' PARAMETER                                     '
791
      db 255,255,255,0,   '                ANWENDEN                       '
791
      db 255,255,255,0,   '                ANWENDEN                       '
792
      db 255,255,255,0,   '     HINZUFUEGEN              ENTFERNEN        '
792
      db 255,255,255,0,   '     HINZUFUEGEN              ENTFERNEN        '
793
      db 0,0,0,0,         'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN       '
-
 
Line -... Line 793...
-
 
793
      db 0,0,0,0,         'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN       '
794
      db                  'x' ; <- END MARKER, DONT DELETE
794
      db                  'x' ; <- END MARKER, DONT DELETE
795
add_text             db 'AUF UNBENUTZTE ICONPOSITION KLICKEN         ',0
795
 
Line 796... Line 796...
796
 
796
add_text               db 'AUF UNBENUTZTE ICONPOSITION KLICKEN          ',0
797
rem_text             db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL',0
797
rem_text               db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL    ',0
798
header     db 'Icon Manager',0
798
title                 db 'Icon Manager',0
799
 
799
 
Line 805... Line 805...
805
      db 255,255,255,0,   '                APPLY CHANGES                  '
805
      db 255,255,255,0,   '                APPLY CHANGES                  '
806
      db 255,255,255,0,   '      ADD ICON              REMOVE ICON        '
806
      db 255,255,255,0,   '      ADD ICON              REMOVE ICON        '
807
      db 0,0,0,0,         'CLICK BUTTON ON ICON POSITION FOR EDIT         '
807
      db 0,0,0,0,         'CLICK BUTTON ON ICON POSITION FOR EDIT         '
808
      db                  'x' ; <- END MARKER, DONT DELETE
808
      db                  'x' ; <- END MARKER, DONT DELETE
809
add_text             db 'CLICK ON A NOT USED POSITION               ',0
809
add_text               db 'CLICK ON A NOT USED POSITION                 ',0
810
 
-
 
811
rem_text            db 'CLICK ICON POSITION; YOU WANT TO DELETE',0
810
rem_text               db 'CLICK ICON POSITION; YOU WANT TO DELETE      ',0
812
header     db 'Icon Manager',0
811
title                 db 'Icon Manager',0
Line 813... Line 812...
813
 
812
 
Line 814... Line 813...
814
end if
813
end if
815
 
814
 
Line 833... Line 832...
833
 
832
 
834
;//////////////////////////
833
;//////////////////////////
835
get_bg_info:
834
get_bg_info:
836
    mov  eax,39
835
    mov  eax,39
837
    mov  ebx,4
836
    mov  ebx,4
838
    int  0x40
837
    mcall
Line 839... Line 838...
839
    mov  [bgrdrawtype],eax
838
    mov  [bgrdrawtype],eax
840
 
839
 
841
    mov  eax,39     ; get background size
840
    mov  eax,39     ; get background size
842
    mov  ebx,1
841
    mov  ebx,1
Line 843... Line 842...
843
    int  0x40
842
    mcall
844
    mov  [bgrxy],eax
843
    mov  [bgrxy],eax
845
 
844
 
Line 858... Line 857...
858
    shl  eax,6 ;imul eax,64
857
    shl  eax,6 ;imul eax,64
859
    add  eax,16
858
    add  eax,16
860
    movzx ebx,[warea.left]
859
    movzx ebx,[warea.left]
861
    add  eax,ebx
860
    add  eax,ebx
862
    jmp  x_done
861
    jmp  x_done
-
 
862
 
863
  no_left:
863
  no_left:
864
    sub  eax,9
864
    sub  eax,9
865
    sal  eax,6 ;imul eax,64
865
    sal  eax,6 ;imul eax,64
866
    sub  eax,16+52-1
866
    sub  eax,16+52-1
867
    movzx ebx,[warea.right]
867
    movzx ebx,[warea.right]
868
    add  eax,ebx
868
    add  eax,ebx
869
  x_done:
869
  x_done:
870
;    mov  [xpos],eax
-
 
871
    mov  [ebp-12],eax
870
    mov  [ebp-12],eax
Line 872... Line 871...
872
 
871
 
873
    movzx eax,byte [ebp-20+1]  ; y position
872
    movzx eax,byte [ebp-20+1]  ; y position
874
    sub  eax,'A'        ; eax - number of letter
873
    sub  eax,'A'        ; eax - number of letter
Line 884... Line 883...
884
    shl  eax,6            ;imul eax,80
883
    shl  eax,6            ;imul eax,80
885
    sub  eax,16-1
884
    sub  eax,16-1
886
    movzx ebx,[warea.bottom]
885
    movzx ebx,[warea.bottom]
887
    add  eax,ebx
886
    add  eax,ebx
888
  y_done:
887
  y_done:
889
;    mov  [ypos],eax
-
 
890
    mov  [ebp-8],eax
888
    mov  [ebp-8],eax
891
    ret
889
    ret
Line 892... Line 890...
892
 
890
 
893
;START2:
891
;START2:
Line 897... Line 895...
897
        mcall   48,5
895
        mcall   48,5
898
        mov     [warea.by_x],eax
896
        mov     [warea.by_x],eax
899
        mov     [warea.by_y],ebx
897
        mov     [warea.by_y],ebx
Line 900... Line 898...
900
 
898
 
901
        mov     eax,14
899
        mov     eax,14
902
        int     0x40
900
        mcall
903
        add     eax,0x00010001
901
        add     eax,0x00010001
Line 904... Line 902...
904
        mov     [scrxy],eax
902
        mov     [scrxy],eax
Line 915... Line 913...
915
    call calc_icon_pos
913
    call calc_icon_pos
Line 916... Line 914...
916
 
914
 
917
    mov  eax,51
915
    mov  eax,51
918
    mov  ebx,1
916
    mov  ebx,1
919
    mov  ecx,thread
-
 
920
;    mov  edx,[thread_stack]
917
    mov  ecx,thread
921
    mov  edx,ebp
-
 
922
;    sub  edx,4
-
 
923
;    mov  [edx],esi
918
    mov  edx,ebp
924
    mov  dword[ebp-4],esi
919
    mov  dword[ebp-4],esi
925
    int  0x40
-
 
926
;    add  [thread_stack],0x100
920
    mcall
Line 927... Line 921...
927
    add  ebp,0x100
921
    add  ebp,0x100
928
 
922
 
929
    mov  eax,5
923
    mov  eax,5
930
    mov  ebx,1
924
    mov  ebx,1
931
wait_thread_start:         ;wait until thread draw itself first time
925
wait_thread_start:         ;wait until thread draw itself first time
932
    cmp  [create_thread_event],bl
926
    cmp  [create_thread_event],bl
933
    jz     wait_thread_end
927
    jz     wait_thread_end
934
    int  0x40
928
    mcall
935
    jmp  wait_thread_start
929
    jmp  wait_thread_start
Line 936... Line 930...
936
wait_thread_end:
930
wait_thread_end:
937
    dec  [create_thread_event]     ;reset event
931
    dec  [create_thread_event]     ;reset event
938
 
932
 
939
 
933
 
940
    add  esi,REC_SIZE
934
    add  esi,REC_SIZE
941
    dec  edi
935
    dec  edi
Line 942... Line 936...
942
    jnz  start_new
936
    jnz  start_new
943
  close:
937
  close:
944
    or     eax,-1
938
    or     eax,-1
945
    int  0x40
939
    mcall
946
 
940
 
947
thread:
941
thread:
948
;   pop  ebp ;ebp - address of our icon
942
;   pop  ebp ;ebp - address of our icon
949
    sub  esp,12
943
    sub  esp,12
950
    mov  ebp,esp
944
    mov  ebp,esp
951
    sub  esp,16
945
    sub  esp,16
Line 952... Line 946...
952
    call draw_window2
946
    call draw_window2
Line 953... Line 947...
953
    mov  [create_thread_event],1
947
    mov  [create_thread_event],1
954
    mov  eax,40
948
    mov  eax,40
Line 955... Line 949...
955
    mov  ebx,010101b
949
    mov  ebx,010101b
956
    int  0x40
950
    mcall
957
 
951
 
958
still2:
952
still2:
959
 
-
 
960
    mov  eax,10
-
 
Line 961... Line 953...
961
    int  0x40
953
 
962
 
954
    mov  eax,10
963
    cmp  eax,1
955
    mcall
964
    je     red2
956
 
Line 983... Line 975...
983
        mov     [warea.by_y],ebx
975
        mov     [warea.by_y],ebx
984
        add     ebp,+12
976
        add     ebp,+12
985
        call    calc_icon_pos
977
        call    calc_icon_pos
986
        add     ebp,-12
978
        add     ebp,-12
987
        mcall   9,I_END,-1
979
        mcall   9,I_END,-1
988
        mov     eax,[I_END+process_information.x_start]
980
        mov     eax,[I_END+process_information.box.left]
989
        cmp     eax,[ebp+0]
981
        cmp     eax,[ebp+0]
990
        jne     @f
982
        jne     @f
991
        mov     eax,[I_END+process_information.y_start]
983
        mov     eax,[I_END+process_information.box.top]
992
        cmp     eax,[ebp+4]
984
        cmp     eax,[ebp+4]
993
        je      .lp1
985
        je      .lp1
994
    @@: call    get_bg_info
986
    @@: call    get_bg_info
995
        mcall   67,[ebp+0],[ebp+4],51,51
987
        mcall   67,[ebp+0],[ebp+4],51,51
Line 996... Line 988...
996
 
988
 
997
  .lp1: call    draw_window2
989
  .lp1: call    draw_window2
Line 998... Line -...
998
        jmp     still2
-
 
999
 
-
 
1000
  key2:
-
 
1001
    mov  al,2
-
 
1002
    int  0x40
-
 
1003
 
-
 
1004
    jmp  still2
990
        jmp     still2
1005
 
991
 
1006
  button2:
992
  button2:
Line 1007... Line 993...
1007
    mov  al,17
993
    mov  al,17
1008
    int  0x40
994
    mcall
1009
 
995
 
Line 1018... Line 1004...
1018
          call fill_paths
1004
          call fill_paths
1019
          cmp  byte[edi],0
1005
          cmp  byte[edi],0
1020
    jne  .no0
1006
    jne  .no0
1021
    and  dword[finfo_start+8],0
1007
    and  dword[finfo_start+8],0
1022
  .no0:
1008
  .no0:
1023
;    lea  ebx,[ebp+19]
-
 
1024
    mov  ebx,finfo_start
1009
    mov  ebx,finfo_start
1025
    mov  eax,70
1010
    mov  eax,70
1026
    int  0x40
-
 
1027
;    dph  eax
-
 
1028
;    cmp  eax,1024
-
 
1029
;    jae  still2
1011
    mcall
1030
    jmp  still2
1012
    jmp  still2
Line 1031... Line 1013...
1031
 
1013
 
1032
fill_paths:
1014
fill_paths:
1033
        push esi edi
1015
        push esi edi
1034
;        dps  '>'
1016
;        dps  '>'
1035
        movzx ecx,byte[str_lens+ebx]
1017
        movzx ecx,byte[str_lens+ebx]
1036
        add  esi,[positions+ebx*4]
1018
        add  esi,[positions+ebx*4]
1037
        push esi
-
 
1038
;  mov  edx,esi
1019
        push esi
Line 1039... Line 1020...
1039
        add  esi,ecx
1020
        add  esi,ecx
1040
 
1021
 
1041
    .l1:
1022
    .l1:
Line 1075... Line 1056...
1075
      pop  esi
1056
      pop  esi
1076
      mov  eax,ebx
1057
      mov  eax,ebx
1077
        ret
1058
        ret
Line 1078... Line 1059...
1078
 
1059
 
1079
itoa:
-
 
1080
;        mov  esi,[current_icon]
1060
itoa:
1081
        add  esi,2
1061
        add  esi,2
1082
    mov ebx,10
1062
    mov ebx,10
1083
    mov ecx,3
1063
    mov ecx,3
1084
  .l0:
1064
  .l0:
1085
    xor edx,edx
1065
    xor edx,edx
1086
    div ebx
1066
    div ebx
1087
    add dl,'0'
1067
    add dl,'0'
1088
    mov [esi],dl
1068
    mov [esi],dl
1089
    dec esi
1069
    dec esi
1090
    loop .l0
-
 
1091
;    and byte[esi],0
1070
    loop .l0
Line 1092... Line 1071...
1092
        ret
1071
        ret
1093
 
1072
 
1094
draw_picture:
1073
draw_picture:
Line 1136... Line 1115...
1136
  yesbpix:
1115
  yesbpix:
Line 1137... Line 1116...
1137
 
1116
 
1138
  stretch:
1117
  stretch:
1139
    cmp   [bgrdrawtype],dword 2
1118
    cmp   [bgrdrawtype],dword 2
1140
    jne   nostretch
-
 
1141
;    mov   eax,[ypos]
1119
    jne   nostretch
1142
    mov   eax,[ebp+4]
1120
    mov   eax,[ebp+4]
1143
    add   eax,ecx
1121
    add   eax,ecx
1144
    imul  eax,[bgry]
1122
    imul  eax,[bgry]
1145
    cdq
1123
    cdq
1146
    movzx ebx,word [scrxy]
1124
    movzx ebx,word [scrxy]
1147
    div   ebx
1125
    div   ebx
1148
    imul  eax,[bgrx]
1126
    imul  eax,[bgrx]
1149
    push  eax
-
 
1150
;    mov   eax,[xpos]
1127
    push  eax
1151
    mov   eax,[ebp+0]
1128
    mov   eax,[ebp+0]
1152
    add   eax,[esp+8]
1129
    add   eax,[esp+8]
1153
    imul  eax,[bgrx]
1130
    imul  eax,[bgrx]
1154
    cdq
1131
    cdq
Line 1161... Line 1138...
1161
 
1138
 
Line 1162... Line 1139...
1162
  nostretch:
1139
  nostretch:
1163
 
1140
 
1164
    cmp   [bgrdrawtype],dword 1
-
 
1165
    jne   notiled
1141
    cmp   [bgrdrawtype],dword 1
1166
;    mov   eax,[ypos]
1142
    jne   notiled
1167
    mov   eax,[ebp+4]
1143
    mov   eax,[ebp+4]
1168
    add   eax,ecx
1144
    add   eax,ecx
1169
    cdq
1145
    cdq
1170
    movzx ebx,word [bgrxy]
1146
    movzx ebx,word [bgrxy]
1171
    div   ebx
1147
    div   ebx
1172
    mov   eax,edx
1148
    mov   eax,edx
1173
    imul  eax,[bgrx]
-
 
1174
    push  eax
1149
    imul  eax,[bgrx]
1175
;    mov   eax,[xpos]
1150
    push  eax
1176
    mov   eax,[ebp+0]
1151
    mov   eax,[ebp+0]
1177
    add   eax,[esp+8]
1152
    add   eax,[esp+8]
1178
    movzx ebx,word [bgrxy+2]
1153
    movzx ebx,word [bgrxy+2]
Line 1185... Line 1160...
1185
  notiled:
1160
  notiled:
Line 1186... Line 1161...
1186
 
1161
 
1187
    lea  ecx,[eax+eax*2]
1162
    lea  ecx,[eax+eax*2]
1188
    mov  eax,39
1163
    mov  eax,39
1189
    mov  ebx,2
1164
    mov  ebx,2
Line 1190... Line 1165...
1190
    int  0x40
1165
    mcall
Line 1191... Line 1166...
1191
 
1166
 
1192
  nobpix:
1167
  nobpix:
Line 1232... Line 1207...
1232
 
1207
 
1233
    mov  eax,7
1208
    mov  eax,7
1234
    mov  ebx,0x3000
1209
    mov  ebx,0x3000
1235
    mov  ecx,52 shl 16 + 52
1210
    mov  ecx,52 shl 16 + 52
1236
    xor  edx,edx
1211
    xor  edx,edx
1237
    int  0x40
1212
    mcall
1238
  .ex:
1213
  .ex:
1239
    mov  [load_pic],0
1214
    mov  [load_pic],0
Line 1240... Line 1215...
1240
    ret
1215
    ret
Line 1241... Line 1216...
1241
 
1216
 
1242
draw_text:
1217
draw_text:
1243
 
1218
 
1244
    mov  esi,[ebp+8]
1219
    mov  esi,[ebp+8]
1245
    add  esi,3
1220
    add  esi,3
1246
    push edi
1221
    push edi
1247
    mov  edi,header
1222
    mov  edi,title
1248
    mov  ecx,8
1223
    mov  ecx,8
1249
    cld
1224
    cld
1250
    rep  movsb
1225
    rep  movsb
1251
    pop  edi
1226
    pop  edi
1252
    mov   eax,header
1227
    mov   eax,title
1253
  news2:
1228
  news2:
1254
    cmp   [eax],byte 33
1229
    cmp   [eax],byte 33
1255
    jb      founde
1230
    jb      founde
1256
    inc   eax
1231
    inc   eax
1257
    cmp   eax,header+8;11
1232
    cmp   eax,title+8;11
1258
    jb      news2
1233
    jb      news2
Line 1259... Line 1234...
1259
   founde:
1234
   founde:
1260
    sub   eax,header
1235
    sub   eax,title
1261
    mov   [tl],eax
1236
    mov   [tl],eax
Line 1267... Line 1242...
1267
    mov   ebx,27*65536+40
1242
    mov   ebx,27*65536+40
1268
    sub   ebx,eax
1243
    sub   ebx,eax
Line 1269... Line 1244...
1269
 
1244
 
1270
    mov   eax,4
1245
    mov   eax,4
1271
    xor   ecx,ecx         ; black shade of text
1246
    xor   ecx,ecx         ; black shade of text
1272
    mov   edx,header
1247
    mov   edx,title
1273
    mov   esi,[tl]
1248
    mov   esi,[tl]
1274
    add   ebx,1 shl 16      ;*65536+1
1249
    add   ebx,1 shl 16      ;*65536+1
1275
    int   0x40
1250
    mcall
1276
    inc   ebx
1251
    inc   ebx
1277
    int   0x40
1252
    mcall
1278
    add   ebx,1 shl 16
1253
    add   ebx,1 shl 16
1279
    int   0x40
1254
    mcall
1280
    inc   ebx
1255
    inc   ebx
1281
    int   0x40
1256
    mcall
1282
    sub   ebx,1 shl 16
1257
    sub   ebx,1 shl 16
1283
    int   0x40
1258
    mcall
1284
    dec   ebx
1259
    dec   ebx
1285
    sub   ebx,1 shl 16
1260
    sub   ebx,1 shl 16
1286
    int   0x40
1261
    mcall
1287
    sub   ebx,1 shl 16
1262
    sub   ebx,1 shl 16
1288
    dec   ebx
1263
    dec   ebx
1289
    int   0x40
1264
    mcall
1290
    dec   ebx
1265
    dec   ebx
1291
    add   ebx,1 shl 16
1266
    add   ebx,1 shl 16
1292
    int   0x40
1267
    mcall
1293
    inc   ebx
1268
    inc   ebx
Line 1294... Line 1269...
1294
    mov   ecx,0xffffff
1269
    mov   ecx,0xffffff
1295
 
1270
 
1296
    int   0x40
1271
    mcall
Line 1297... Line 1272...
1297
    mov   [draw_pic],0
1272
    mov   [draw_pic],0
1298
    ret
1273
    ret
Line 1304... Line 1279...
1304
 
1279
 
Line 1305... Line 1280...
1305
draw_window2:
1280
draw_window2:
1306
 
1281
 
1307
    mov  eax,12            ; function 12:tell os about windowdraw
1282
    mov  eax,12            ; function 12:tell os about windowdraw
Line 1308... Line 1283...
1308
    mov  ebx,1               ; 1, start of draw
1283
    mov  ebx,1               ; 1, start of draw
1309
    int  0x40
1284
    mcall
1310
 
-
 
1311
                   ; DRAW WINDOW
1285
 
1312
    xor  eax,eax             ; function 0 : define and draw window
-
 
1313
;    mov  ebx,[xpos-2]
1286
                   ; DRAW WINDOW
1314
    mov  ebx,[ebp+0-2]
1287
    xor  eax,eax             ; function 0 : define and draw window
1315
;    mov  ecx,[ypos-2]
1288
    mov  ebx,[ebp+0-2]
1316
    mov  ecx,[ebp+4-2]
1289
    mov  ecx,[ebp+4-2]
1317
    add  ebx,[yw]           ; [x start] *65536 + [x size]
1290
    add  ebx,[yw]           ; [x start] *65536 + [x size]
Line 1318... Line 1291...
1318
    add  ecx,51            ; [y start] *65536 + [y size]
1291
    add  ecx,51            ; [y start] *65536 + [y size]
1319
    mov  edx,0x01000000        ; color of work area RRGGBB,8->color gl
1292
    mov  edx,0x01000000        ; color of work area RRGGBB,8->color gl
1320
    int  0x40
1293
    mcall
1321
 
1294
 
1322
    mov  eax,8      ; button
1295
    mov  eax,8      ; button
Line 1323... Line 1296...
1323
    mov  ebx,51
1296
    mov  ebx,51
1324
    mov  ecx,50
1297
    mov  ecx,50
1325
    mov  edx,0x40000001
1298
    mov  edx,0x40000001
1326
    int  0x40
1299
    mcall
1327
 
1300
 
1328
    mov  eax,5
1301
    mov  eax,5
1329
    mov  ebx,1
1302
    mov  ebx,1
1330
draw_icon2:
1303
draw_icon2:
1331
    xchg [load_pic],bl
1304
    xchg [load_pic],bl
Line 1332... Line 1305...
1332
    test bl,bl
1305
    test bl,bl
1333
    je     draw_icon_end
1306
    je     draw_icon_end
1334
    int  0x40
1307
    mcall
1335
    jmp  draw_icon2
1308
    jmp  draw_icon2
1336
draw_icon_end:
1309
draw_icon_end:
1337
 
1310
 
1338
    mov  eax,5
1311
    mov  eax,5
1339
    mov  ebx,1
1312
    mov  ebx,1
1340
draw_icon_2:
1313
draw_icon_2:
Line 1341... Line 1314...
1341
    xchg [draw_pic],bl
1314
    xchg [draw_pic],bl
1342
    test bl,bl
1315
    test bl,bl
1343
    je     draw_icon_end_2
1316
    je     draw_icon_end_2
1344
    int  0x40
1317
    mcall
Line 1345... Line 1318...
1345
    jmp  draw_icon_2
1318
    jmp  draw_icon_2
1346
draw_icon_end_2:
1319
draw_icon_end_2:
Line 1347... Line 1320...
1347
 
1320
 
1348
    mov  eax,9
1321
    mov  eax,9
1349
    mov  ebx,process_table
1322
    mov  ebx,process_table
Line 1350... Line 1323...
1350
    mov  ecx,-1
1323
    mov  ecx,-1
Line 1351... Line 1324...
1351
    int  0x40
1324
    mcall
1352
 
1325
 
1353
    call draw_picture
1326
    call draw_picture
1354
    call draw_text
1327
    call draw_text
Line 1355... Line -...
1355
 
-
 
1356
    mov  eax,12
-
 
1357
    mov  ebx,2
1328
 
1358
    int  0x40
1329
    mov  eax,12
1359
 
1330
    mov  ebx,2
Line 1360... Line 1331...
1360
    ret
1331
    mcall
1361
 
-
 
1362
tl        dd      8
-
 
1363
yw        dd     51
-
 
1364
ya        dd      0
-
 
Line 1365... Line 1332...
1365
cur_btn   dd 40
1332
 
Line 1366... Line 1333...
1366
 
1333
    ret
1367
;xpos       dd   15
1334
 
Line 1368... Line -...
1368
;ypos       dd  185
-
 
1369
draw_pic    db      0
-
 
1370
load_pic    db      0
1335
tl        dd      8
1371
create_thread_event db 0
1336
yw        dd     51
1372
 
1337
ya        dd      0
Line 1373... Line 1338...
1373
 
1338
cur_btn   dd 40
Line 1409... Line 1374...
1409
cur_band   dd ?
1374
cur_band   dd ?
1410
sel_icon1  rd 1
1375
sel_icon1  rd 1
1411
icon_count rd 1
1376
icon_count rd 1
1412
gif_file  rb  GIF_SIZE
1377
gif_file  rb  GIF_SIZE
1413
strip_file rb RAW_SIZE
1378
strip_file rb RAW_SIZE
1414
;I_Param:
-
 
1415
 
-
 
1416
; icon_data = I_END+256
-
 
Line 1417... Line 1379...
1417
 
1379