Subversion Repositories Kolibri OS

Rev

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