Subversion Repositories Kolibri OS

Rev

Rev 2469 | Rev 2476 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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