Subversion Repositories Kolibri OS

Rev

Rev 5160 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;=============================================================================
  2. ; Kolibri Graphics Benchmark 0.82
  3. ;--------------------------------------
  4. ; MGB - Menuet Graphics Benchmark 0.3
  5. ; Compile with FASM
  6. ;
  7. ;=============================================================================
  8. ; version:      0.82
  9. ; last update:  03/11/2014
  10. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  11. ; changes:      fix "benchmark GS selector" for 16bpp (support SVN r.5154)
  12. ;---------------------------------------------------------------------
  13. ; version:      0.81
  14. ; last update:  01/05/2014
  15. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  16. ; changes:      fix "benchmark GS selector" for some display sizes
  17. ;               (for example, 1366 by horizontal) and code optimization
  18. ;---------------------------------------------------------------------
  19. ; version:      0.8
  20. ; last update:  08/07/2013
  21. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  22. ; changes:      benchmark f4 with memory + f65
  23. ;---------------------------------------------------------------------
  24. ; version:      0.7
  25. ; last update:  05/04/2013
  26. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  27. ; changes:      benchmark GS selector - read screen area
  28. ;---------------------------------------------------------------------
  29. ; version:      0.6
  30. ; last update:  14/03/2013
  31. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  32. ; changes:      benchmark f36 - read screen area
  33. ;---------------------------------------------------------------------
  34. ; version:      0.5
  35. ; last update:  05/03/2013
  36. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  37. ; changes:      benchmark f73-blitter
  38. ;---------------------------------------------------------------------
  39. ; version:      0.4
  40. ; last update:  18/09//2010
  41. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  42. ; changes:      select path with OpenDialog,
  43. ;               use of Box_Lib and Proc_Lib,
  44. ;               support start with path for *.mgb file
  45. ;               optimization code and size of use memory
  46. ;---------------------------------------------------------------------
  47. ; Original author and copyrights holder:
  48. ;     Mikhail Lisovin a.k.a. Mihasik
  49. ;     lisovin@26.ru
  50. ;
  51. ; Disassembled with IDA 5.0.0.879:
  52. ;     http://www.datarescue.com/
  53. ; With use of 'ida.int' and 'kloader.ldw':
  54. ;     Eugene Grechnikov a.k.a. diamond
  55. ;     diamondz@land.ru
  56. ;     http://diamondz.land.ru/
  57. ;
  58. ; Modified for version 0.3:
  59. ;     Mike Semenako a.k.a mike.dld
  60. ;     mike.dld@gmail.com
  61. ;     http://www.mikedld.com/
  62. ;
  63. ;=============================================================================
  64.  
  65. org 0x0
  66. use32
  67.  
  68.         db 'MENUET01'
  69.         dd 1
  70.         dd start
  71.         dd IM_END
  72.         dd I_END        ;0x200000
  73.         dd stacktop     ;0x07FFF0
  74.         dd fname_buf
  75.         dd cur_dir_path
  76.  
  77. include '../../../config.inc'           ;for nightbuild
  78. include '..\..\..\macros.inc'
  79. include '..\..\..\proc32.inc'
  80. ;include '..\..\..\debug.inc'
  81. include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
  82. include '../../../develop/libraries/box_lib/load_lib.mac'
  83. include 'lang.inc'      ;language support
  84.         @use_library
  85. ;---------------------------------------------------------------------
  86. start:
  87.         mcall   68,11
  88.  
  89.         mcall   68,12,8+9*6*38*4        ; 7352
  90.         mov     [text_scren_buffer],eax
  91.  
  92.         mcall   68,12,8+9*6*38*4        ; 8216
  93.         mov     [text_scren_buffer2],eax
  94.        
  95. load_libraries l_libs_start,end_l_libs
  96.  
  97.         cmp     eax,-1
  98.         jz      close
  99. ;---------------------------------------------------------------------
  100.         mov     edi,filename_area
  101.         mov     esi,start_temp_file_name
  102.         call    copy_str_1
  103.  
  104.         mov     edi,comment_string_1
  105.         mov     esi,aComment1
  106.         call    copy_str_1
  107.  
  108.         mov     edi,comment_string_2
  109.         mov     esi,aComment2
  110.         call    copy_str_1
  111.  
  112.         mov     edi,fname_buf
  113.         cmp     [edi],byte 0
  114.         jne     @f
  115.         mov     esi,path4
  116.         call    copy_str_1
  117.         jmp     .OpenDialog
  118. @@:
  119.         call    locLoadFile
  120.         xor     dword [wFlags],1
  121. .OpenDialog:
  122. ;OpenDialog     initialisation
  123.         push    dword OpenDialog_data
  124.         call    [OpenDialog_Init]
  125. ;---------------------------------------------------------------------
  126.         mcall   40,0x80000027
  127. red:
  128.         call    draw_window
  129. still:
  130.         mcall   10
  131.         cmp     eax,1
  132.         jz      red
  133.         cmp     eax,2
  134.         jz      key
  135.         cmp     eax,3
  136.         jz      button
  137.         jmp     still
  138. ;---------------------------------------------------------------------
  139. copy_str_1:
  140.         xor     eax,eax
  141.         cld
  142. @@:
  143.         lodsb
  144.         stosb
  145.         test    eax,eax
  146.         jnz     @b
  147.         ret
  148. ;---------------------------------------------------------------------
  149. key:
  150.         mcall   2
  151.         cmp     ah,'t'
  152.         jz      ActionTest
  153.         cmp     ah,'c'
  154.         jz      ActionComment
  155.         cmp     ah,'p'
  156.         jz      ActionPattern
  157.         cmp     ah,'o'
  158.         jz      ActionOpen
  159.         cmp     ah,'s'
  160.         jz      ActionSave
  161.         jmp     still
  162. ;---------------------------------------------------------------------
  163. button:
  164.         mcall   17
  165.         cmp     ah,1
  166.         jnz     NotClose
  167. close:
  168.         mcall   -1
  169. NotClose:
  170.         cmp     ah,2
  171.         jnz     locNotTest
  172. ActionTest:
  173.         test    dword [wFlags],1
  174.         jnz     still
  175.         mcall   51,1,TestWndProc,thread_stack1
  176.         jmp     still
  177. ;---------------------------------------------------------------------
  178. locNotTest:
  179.         cmp     ah,3
  180.         jnz     NotComment
  181. ActionComment:
  182.         test    dword [wFlags],1
  183.         jnz     still
  184.         mcall   51,1,thread_comment,thread_stack2
  185.         jmp     still
  186. ;---------------------------------------------------------------------
  187. NotComment:
  188.         cmp     ah,4
  189.         jnz     NotPattern
  190. ActionPattern:
  191.         test    dword [wFlags],1
  192.         jnz     still
  193.         mov     esi,results_table
  194.         cld
  195. @@:
  196.         lodsd
  197.         mov     [esi],eax
  198.         add     esi,TEST_REC_SIZE-4
  199.         cmp     dword [esi+TEST_REC_SIZE-4],0
  200.         jne     @b
  201.         mov     esi,comment_string_1
  202.         mov     edi,comment_string_2
  203.         call    copy_str_1
  204.         call    DrawBars
  205.         jmp     still
  206. ;---------------------------------------------------------------------
  207. NotPattern:
  208.         cmp     ah,5
  209.         jnz     NotOpen
  210. ActionOpen:
  211.         test    dword [wFlags],1
  212.         jnz     still
  213.         mov     [OpenDialog_data.type],0 ; open
  214.         call    OpenDialog_Start_1
  215.         jne     still
  216.         call    locLoadFile
  217.         call    DrawBars
  218. .1:
  219.         xor     dword [wFlags],1
  220.         jmp     still
  221. ;---------------------------------------------------------------------
  222. OpenDialog_Start_1:
  223.         push    dword OpenDialog_data
  224.         call    [OpenDialog_Start]
  225.         cmp     [OpenDialog_data.status],1
  226.         ret
  227. ;---------------------------------------------------------------------
  228. NotOpen:
  229.         cmp     ah,6
  230.         jnz     still
  231. ActionSave:
  232.         test    dword [wFlags],1
  233.         jnz     still
  234.         mov     [OpenDialog_data.type],1 ; save
  235.         call    OpenDialog_Start_1
  236.         jne     still
  237.         call    locSaveFile
  238.         jmp     ActionOpen.1
  239. ;---------------------------------------------------------------------
  240. TestWndProc:
  241.         mcall   68,12,90*123*3
  242.         mov     [area_for_f36],eax
  243.         or      dword [wFlags],1
  244.         mov     esi,results_table+8
  245. align 4
  246. .next_test:
  247.         xor     edi,edi
  248.         mcall    26,9
  249.         inc     eax
  250.         mov     ecx,eax
  251.         add     eax,100
  252.         mov     [dwTestEndTime],eax
  253. align 4
  254. @@:
  255.         mcall    26
  256.         cmp     eax,ecx
  257.         jb      @r
  258. align 4
  259. @@:
  260.         push    esi edi
  261.         call    dword [esi]
  262.         pop     edi esi
  263.         inc     edi
  264.         mcall   26,9
  265.         cmp     eax,[dwTestEndTime]
  266.         jb      @b
  267.         mov     [esi-8],edi
  268.  
  269.         add     esi,TEST_REC_SIZE
  270.         cmp     dword [esi], testDrawPicture_f73
  271.         jnz     @f
  272.         call    prepare_f73
  273. @@:
  274.         cmp     dword [esi],0
  275.         jnz     .next_test
  276.         xor     dword [wFlags],1
  277.         mcall   68,13,[area_for_f36]
  278.         mcall   -1
  279. ;---------------------------------------------------------------------
  280. draw_window:
  281.         mcall   12,1
  282.         mcall   48,4
  283.         mov     ebx,100*65536+72*5+14
  284.         mov     ecx,80*65536+TESTS_NUM*LINE_HEIGHT+15+20+35
  285.         add     cx,ax
  286.         xor     eax,eax
  287.         xor     esi,esi
  288.         mcall   ,,,34000000h,,aCaption
  289.  
  290.         mov     eax,8
  291.         mov     ebx,050036h+12
  292.         mov     ecx,5*65536+20
  293.         mov     edx,2
  294.         mov     esi,0x00007F7F
  295. @@:
  296.         mcall
  297.         add     ebx,72*65536
  298.         inc     edx
  299.         cmp     edx,7
  300.         jb      @r
  301.  
  302.         mov     ecx,31
  303.         mov     edx,0x00007F7F
  304.         mov     esi,(72*5)/2
  305.         call    drawSeparator
  306.  
  307.         mcall   4,<27,12>,0x80DDEEFF,aButtonsText
  308.         call    DrawBars
  309.  
  310.         mov     ecx,TESTS_NUM*LINE_HEIGHT+15+21
  311.         mov     edx,0x00007F7F
  312.         mov     esi,(72*5)/2
  313.         call    drawSeparator
  314.         mcall   12,2
  315.         ret
  316. ;---------------------------------------------------------------------
  317. drawSeparator:
  318.         mov     eax,1
  319.         mov     ebx,3
  320. @@:
  321.         mcall
  322.         add     ebx,2
  323.         dec     esi
  324.         jnz     @b
  325.         ret
  326. ;---------------------------------------------------------------------
  327. align 4
  328. testDrawWindow:
  329.         xor     eax,eax
  330.         mcall   ,640145h,4F0190h,3000000h
  331.         ret
  332. ;---------------------------------------------------------------------
  333. align 4
  334. testDrawBar:
  335.         mcall   13,0A0064h,1E00FAh,6A73D0h
  336.         ret
  337. ;---------------------------------------------------------------------
  338. align 4
  339. testDrawPicture:
  340. ;       xor     ebx,ebx
  341.         mcall   7,[area_for_f36],<90,123>,<15,33>
  342.         ret
  343. ;---------------------------------------------------------------------
  344. prepare_f73:
  345.         mov     ecx, 90*123
  346.         mov     eax, params_f73.data
  347.         mov     ebx, [area_for_f36]
  348. @@:
  349.         mov     edx, [ebx]
  350.         and     edx, 0xFFFFFF
  351.         mov     [eax], edx
  352.         add     ebx, 3
  353.         add     eax, 4
  354.         dec     ecx
  355.         jnz     @b
  356.         ret
  357. align 4
  358. testDrawPicture_f73:
  359.         xor     ebx,ebx
  360.         mcall   73,,params_f73
  361.         ret
  362. ;---------------------------------------------------------------------
  363. align 4
  364. testGetScreen_f36:
  365.         xor     ebx,ebx
  366.         mcall   36,[area_for_f36],<90,123>,<15,33>
  367.         ret
  368. ;---------------------------------------------------------------------
  369. GS_start_x = 15
  370. GS_start_y = 33
  371. GS_size_x = 90
  372. GS_size_y = 123
  373. ;-----------------------------------------------------------------------------
  374. align 4
  375. testGetScreen_GS:
  376.         push    edi
  377.         mov     edi,[area_for_f36]
  378.  
  379.         mcall   61,2
  380.         cmp     eax,24
  381.         je      get_area_with_GS_24
  382.        
  383.         cmp     eax,16
  384.         je      get_area_with_GS_16
  385. ;-----------------------------------------------------------------------------
  386. align 4
  387. get_area_with_GS_32:
  388.         mcall   61,3
  389.         mov     ebx,eax
  390.  
  391.         mov     esi,GS_start_y
  392.         imul    esi,eax
  393.  
  394.         mov     eax,GS_start_x
  395.         shl     eax,2
  396.         add     esi,eax
  397.  
  398.         mov     ebp,GS_size_x
  399.         mov     eax,ebp
  400.         shl     eax,2
  401.         sub     ebx,eax
  402.  
  403.         mov     edx,GS_size_y
  404.         sub     esi,ebx
  405. ;--------------------------------------
  406. align 4
  407. .start_y:
  408.         add     esi,ebx
  409.         mov     ecx,ebp
  410. ;--------------------------------------
  411. align 4
  412. .start_x:
  413.         mov     eax,[gs:esi]
  414.         mov     [edi],eax
  415.         add     esi,4
  416.         add     edi,3
  417.  
  418.         dec     ecx
  419.         jnz     .start_x
  420.  
  421.         dec     edx
  422.         jnz     .start_y
  423.  
  424.         pop     edi
  425.         ret
  426. ;-----------------------------------------------------------------------------
  427. align 4
  428. get_area_with_GS_24:
  429.         mcall   61,3
  430.         mov     ebx,eax
  431.  
  432.         mov     esi,GS_start_y
  433.         imul    esi,eax
  434.  
  435.         mov     eax,GS_start_x
  436.         lea     eax,[eax*3]
  437.         add     esi,eax
  438.  
  439.         mov     ebp,GS_size_x
  440.         mov     eax,ebp
  441.         lea     eax,[eax*3]
  442.         sub     ebx,eax
  443.  
  444.         mov     edx,GS_size_y
  445.         sub     esi,ebx
  446. ;--------------------------------------
  447. align 4
  448. .start_y:
  449.         add     esi,ebx
  450.         mov     ecx,ebp
  451. ;--------------------------------------
  452. align 4
  453. .start_x:
  454.         mov     eax,[gs:esi]
  455.         mov     [edi],eax
  456.         add     esi,3
  457.         add     edi,3
  458.  
  459.         dec     ecx
  460.         jnz     .start_x
  461.  
  462.         dec     edx
  463.         jnz     .start_y
  464.  
  465.         pop     edi
  466.         ret
  467. ;-----------------------------------------------------------------------------
  468. align 4
  469. get_area_with_GS_16:
  470.         mcall   61,3
  471.         mov     ebx,eax
  472.  
  473.         mov     esi,GS_start_y
  474.         imul    esi,eax
  475.  
  476.         mov     eax,GS_start_x
  477.         shl     eax,1
  478.         add     esi,eax
  479.  
  480.         mov     ebp,GS_size_x
  481.         mov     eax,ebp
  482.         shl     eax,1
  483.         sub     ebx,eax
  484.  
  485.         mov     edx,GS_size_y
  486.         sub     esi,ebx
  487. ;--------------------------------------
  488. align 4
  489. .start_y:
  490.         add     esi,ebx
  491.         mov     ecx,ebp
  492. ;--------------------------------------
  493. align 4
  494. .start_x:
  495.         xor     eax,eax
  496.         mov     ax,[gs:esi]
  497.         shl     eax, 3
  498.         ror     eax, 8
  499.         shl     ax, 2
  500.         ror     eax, 8
  501.         shl     al, 3
  502.         rol     eax, 16
  503.         mov     [edi],eax
  504.         add     esi,2
  505.         add     edi,3
  506.  
  507.         dec     ecx
  508.         jnz     .start_x
  509.  
  510.         dec     edx
  511.         jnz     .start_y
  512.  
  513.         pop     edi
  514.         ret
  515. ;-----------------------------------------------------------------------------
  516. align 4
  517. testDrawVertLine:
  518.         mcall   38,<300,300>,<30,380>,1090207Fh
  519.         ret
  520. ;---------------------------------------------------------------------
  521. align 4
  522. testDrawHorzLine:
  523.         mcall   38,<30,300>,<380,380>,1090207Fh
  524.         ret
  525. ;---------------------------------------------------------------------
  526. align 4
  527. testDrawFreeLine:
  528.         mcall   38,<30,300>,<380,30>,1090207Fh
  529.         ret
  530. ;---------------------------------------------------------------------
  531. align 4
  532. testDrawText1:
  533.         mcall   4,<12,300>,0x0000AA66,aTestText,34
  534.         ret
  535. ;---------------------------------------------------------------------
  536. align 4
  537. testDrawText1m:
  538.         mov     eax,[text_scren_buffer]
  539.         mov     [eax],dword 6*34
  540.         mov     [eax+4],dword 9
  541.         mcall   4,<0,0>,0x0800AA66,aTestText,34,[text_scren_buffer]
  542.         xor     ebp,ebp
  543.         mov     ebx,[text_scren_buffer]
  544.         add     ebx,8
  545.         mcall   65,,<6*34,9>,<18,309>,32
  546.         ret
  547. ;---------------------------------------------------------------------
  548. align 4
  549. testDrawText2:
  550.         mcall   4,<27,315>,0x10E7B850,aTestText,34
  551.         ret
  552. ;---------------------------------------------------------------------
  553. align 4
  554. testDrawText2m:
  555.         mov     eax,[text_scren_buffer2]
  556.         mov     [eax],dword 6*38
  557.         mov     [eax+4],dword 9
  558.         mcall   4,<0,0>,0x18E7B850,aTestText,34,[text_scren_buffer2]
  559.         xor     ebp,ebp
  560.         mov     ebx,[text_scren_buffer2]
  561.         add     ebx,8
  562.         mcall   65,,<6*38,9>,<33,324>,32
  563.         ret
  564. ;---------------------------------------------------------------------
  565. align 4
  566. testDrawNumber:
  567.         mcall   47,0x80000,12345678,<42,333>,0x0E0B27B
  568.         ret
  569. ;---------------------------------------------------------------------
  570. align 4
  571. testDrawPixel:
  572.         mcall   1,100,100,0FFFFFFh
  573.         ret
  574. ;---------------------------------------------------------------------
  575. DrawBars:
  576.         mov     edi,results_table
  577.         mov     ebx,30+7
  578. .next_result:
  579.         cmp     dword[edi+TEST_REC_SIZE-4],0
  580.         je      .exit
  581.  
  582.         push    ebx
  583.         movzx   ecx,bx
  584.         add     ecx,-2
  585.         shl     ecx,16
  586.         mov     cx,LINE_HEIGHT
  587.         mov     ebx,0*65536+72*5+5
  588.         xor     edx,edx
  589.         mcall   13
  590.         pop     ebx
  591.  
  592.         and     ebx,0x0000FFFF
  593.         or      ebx,5*65536
  594.         mov     edx,[edi+TEST_REC_SIZE-4]
  595.         mcall   4,,0x8000CCCC
  596.  
  597.         push    '=' 0x00FFFF00 0x00FFFF7F 0x00FFFF7F
  598.         mov     eax,[edi+0]
  599.         cmp     eax,[edi+4]
  600.         je      @f
  601.         jb      .lp1
  602.         mov     dword[esp+0],0x007FFF7F
  603.         mov     dword[esp+4],0x00FF7F7F
  604.         mov     dword[esp+8],0x0000FF00
  605.         mov     byte[esp+12],'>'
  606. .lp1:
  607.         ja      @f
  608.         mov     dword[esp+0],0x00FF7F7F
  609.         mov     dword[esp+4],0x007FFF7F
  610.         mov     dword[esp+8],0x00FF0000
  611.         mov     byte[esp+12],'<'
  612. @@:
  613.         pop     ecx
  614.         call    int2str
  615.         add     ebx,(72*5-6*8*2-6-10-5)*65536 ; 196
  616.         mcall   4,,,textarea,8
  617.  
  618.         pop     ecx
  619.         mov     eax,[edi+4]
  620.         call    int2str
  621.         add     ebx,(6*8+6+10)*65536
  622.         mcall   4
  623.  
  624.         pop     ecx
  625.         add     ebx,(-6-5)*65536
  626.         mov     edx,esp
  627.         mov     esi,1
  628.         mcall
  629.         add     esp,4
  630.  
  631.         add     edi,TEST_REC_SIZE
  632.         add     bx,LINE_HEIGHT
  633.         jmp     .next_result
  634. .exit:
  635.         mov     ebx, 0*65536+72*5+5
  636.         mov     ecx, (TESTS_NUM*LINE_HEIGHT+15+25)*65536+26
  637.         xor     edx, edx
  638.         mcall   13
  639.  
  640.         mov     ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27)
  641.         mcall   4,,0x8000CCCC,aLeft
  642.  
  643.         add     ebx, (6*10)*65536
  644.         mcall   ,,0x80FFFF00,comment_string_1
  645.  
  646.         mov     ebx, 5*65536+(TESTS_NUM*LINE_HEIGHT+15+27+12)
  647.         mcall   ,,0x8000CCCC,aRight
  648.  
  649.         add     ebx, (6*10)*65536
  650.         mcall   ,,0x80FFFF00,comment_string_2
  651.         ret
  652. ;---------------------------------------------------------------------
  653. int2str:
  654.         push    eax ecx edx edi
  655.         mov     edi,textarea+7
  656.         mov     dword[textarea+0],'    '
  657.         mov     dword[textarea+4],'    '
  658.         mov     ecx,10
  659. @@:
  660.         xor     edx,edx
  661.         div     ecx
  662.         add     dl,'0'
  663.         mov     [edi],dl
  664.         dec     edi
  665.         or      eax,eax
  666.         jnz     @b
  667.         pop     edi edx ecx eax
  668.         ret
  669. ;---------------------------------------------------------------------
  670. thread_comment:
  671.         or      dword [wFlags],1
  672.         mcall   40,0x80000027
  673.         mov     esi,comment_string_1
  674.         cld
  675. @@:
  676.         lodsb
  677.         test    al,al
  678.         jne     @r
  679.         sub     esi,comment_string_1
  680.         mov     eax,esi
  681.         dec     eax
  682.         mov     edi, edit1
  683.         mov     [edi+48], eax   ;ed_size
  684.         mov     [edi+52], eax   ;ed_pos
  685. ;---------------------------------------------------------------------
  686. .red:
  687.         call .draw_window
  688. .still:
  689.         mcall   10      ; wait here for event
  690.         cmp     eax,1   ; redraw request ?
  691.         je      .red
  692.         cmp     eax,2   ; key in buffer ?
  693.         je      .key
  694.         cmp     eax,3   ; button in buffer ?
  695.         je      .button
  696.  
  697.         push    dword name_editboxes
  698.         call    [edit_box_mouse]
  699.         jmp     .still
  700. ;---------------------------------------------------------------------
  701. .key:           ; key
  702.         mcall   2
  703.         cmp     ah,13
  704.         je      .close  ;.close_with_open_file
  705.         cmp     ah,27
  706.         je      .close
  707.  
  708.         push    dword name_editboxes
  709.         call    [edit_box_key]
  710.         jmp     .still
  711. ;---------------------------------------------------------------------
  712. .button:                ; button
  713.         mcall   17
  714.         cmp     ah,1    ; button id=1 ?
  715.         jne     .still
  716. .close:
  717.         xor     dword [wFlags],1
  718.         mcall   -1
  719. ;---------------------------------------------------------------------
  720. .draw_window:
  721.         mcall   12,1
  722.         xor     eax,eax
  723.         xor     esi,esi
  724.         mcall   ,<100,300>,<100,80>,0x34780078,,aComment
  725.         push    dword name_editboxes
  726.         call    [edit_box_draw]
  727.         mcall   12,2
  728.         ret
  729. ;---------------------------------------------------------------------
  730. locLoadFile:
  731.         mov     [stFileInfoBlock], 0
  732.         or      dword [wFlags],1
  733.         mcall   70,stFileInfoBlock
  734.         mov     esi,mgb_data
  735.         mov     edi,results_table+4
  736.         cld
  737. @@:
  738.         cmp     dword[edi+TEST_REC_SIZE-8],0
  739.         je      @f
  740.         movsd
  741.         add     edi,TEST_REC_SIZE-4
  742.         jmp     @b
  743. @@:
  744.         mov     edi,comment_string_2
  745.         mov     ecx,44
  746.         rep     movsb
  747.         ret
  748. ;---------------------------------------------------------------------
  749. locSaveFile:
  750.         mov     [stFileInfoBlock], 2
  751.         or      dword [wFlags],1
  752.         mov     esi,results_table+4
  753.         mov     edi,mgb_data
  754.         cld
  755. @@:
  756.         cmp     dword[esi+TEST_REC_SIZE-8],0
  757.         je      @f
  758.         movsd
  759.         add     esi,TEST_REC_SIZE-4
  760.         jmp     @b
  761. @@:
  762.         mov     esi,comment_string_2
  763.         mov     ecx,44
  764.         rep     movsb
  765.         mcall   70,stFileInfoBlock
  766.         ret
  767. ;---------------------------------------------------------------------
  768. align 4
  769. stFileInfoBlock dd 0,0,0
  770. dwDataSize      dd TESTS_NUM*4+44       ;1
  771.                 dd mgb_data
  772.                 db 0
  773.                 dd fname_buf
  774. ;---------------------------------------------------------------------
  775. wFlags          dd 0
  776. ;---------------------------------------------------------------------
  777. align 4
  778. results_table dd \
  779.         ?,?,testDrawWindow,aDrawingWindow,\
  780.         ?,?,testDrawBar,aDrawingBar,\
  781.         ?,?,testGetScreen_f36,aGetScreenF36,\
  782.         ?,?,testGetScreen_GS,aGetScreen_GS,\
  783.         ?,?,testDrawPicture,aDrawingPicture,\
  784.         ?,?,testDrawPicture_f73,aDrawingPictF73,\
  785.         ?,?,testDrawVertLine,aDrawingVLine,\
  786.         ?,?,testDrawHorzLine,aDrawingHLine,\
  787.         ?,?,testDrawFreeLine,aDrawingFLine,\
  788.         ?,?,testDrawText1,aDrawingText1,\
  789.         ?,?,testDrawText1m,aDrawingText1m,\
  790.         ?,?,testDrawText2,aDrawingText2,\
  791.         ?,?,testDrawText2m,aDrawingText2m,\
  792.         ?,?,testDrawNumber,aDrawingNumber,\
  793.         ?,?,testDrawPixel,aDrawingPixel,\
  794.         0,0,0,0
  795. ;---------------------------------------------------------------------
  796. LINE_HEIGHT   = 13
  797. TEST_REC_SIZE = 16
  798. TESTS_NUM     = ($ - results_table) / TEST_REC_SIZE - 1
  799. ;---------------------------------------------------------------------
  800. if lang eq it
  801.         aDrawingWindow  db 'Window Of Type #3, 325x400 px',0
  802.         aDrawingBar     db 'Filled Rectangle, 100x250 px',0
  803.         aDrawingPicture db 'Picture, 90x123, px',0
  804.         aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0
  805.         aGetScreenF36   db 'Get a piece of screen f.36, 90x123, px',0
  806.         aGetScreen_GS   db 'Get a piece of screen GS, 90x123, px',0
  807.         aDrawingVLine   db 'Linea verticale, 350 px',0
  808.         aDrawingHLine   db 'Linea orizzontale, 270 px',0
  809.         aDrawingFLine   db 'Free-angled Line, 350 px',0
  810.         aDrawingText1   db 'Fixed-width Text, 34 chars',0
  811.         aDrawingText1m  db 'Fixed-width Text(m), 34 chars',0
  812.         aDrawingText2   db 'Proportional Text, 34 chars',0
  813.         aDrawingText2m  db 'Proportional Text(m), 34 chars',0
  814.         aDrawingNumber  db 'Decimal Number, 8 digits',0
  815.         aDrawingPixel   db 'Singolo pixel',0
  816.  
  817.         aTestText       db 'This is a 34-charachters test text'
  818.         aButtonsText    db 'Test      Commenti    Pattern+     Apri        Salva',0
  819.         aCaption        db 'Kolibri Graphical Benchmark 0.82',0
  820.  
  821.         aLeft   db 'Sinistra:',0
  822.         aRight  db 'Destra  :',0
  823.  
  824.         aComment1       db 'Attuale ',0
  825.         aComment2       db 'no pattern',0
  826.         aComment        db 'Commento',0
  827. else
  828.         aDrawingWindow  db 'Window Of Type #3, 325x400 px',0
  829.         aDrawingBar     db 'Filled Rectangle, 100x250 px',0
  830.         aDrawingPicture db 'Picture, 90x123, px',0
  831.         aDrawingPictF73 db 'Picture for Blitter, 90x123, px',0
  832.         aGetScreenF36   db 'Get a piece of screen f.36, 90x123, px',0
  833.         aGetScreen_GS   db 'Get a piece of screen GS, 90x123, px',0
  834.         aDrawingVLine   db 'Vertical Line, 350 px',0
  835.         aDrawingHLine   db 'Horizontal Line, 270 px',0
  836.         aDrawingFLine   db 'Free-angled Line, 350 px',0
  837.         aDrawingText1   db 'Fixed-width Text, 34 chars',0
  838.         aDrawingText1m  db 'Fixed-width Text(m), 34 chars',0
  839.         aDrawingText2   db 'Proportional Text, 34 chars',0
  840.         aDrawingText2m  db 'Proportional Text(m), 34 chars',0
  841.         aDrawingNumber  db 'Decimal Number, 8 digits',0
  842.         aDrawingPixel   db 'Single Pixel',0
  843.  
  844.         aTestText       db 'This is a 34-charachters test text'
  845.         aButtonsText    db 'Test      Comment+    Pattern+      Open        Save',0
  846.         aCaption        db 'Kolibri Graphical Benchmark 0.82',0
  847.  
  848.         aLeft   db 'Left    :',0
  849.         aRight  db 'Right   :',0
  850.  
  851.         aComment1       db 'current',0
  852.         aComment2       db 'no pattern',0
  853.         aComment        db 'Comment',0
  854. end if
  855. ;---------------------------------------------------------------------
  856. system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
  857. system_dir_ProcLib      db '/sys/lib/proc_lib.obj',0
  858. ;---------------------------------------------------------------------
  859. head_f_i:
  860. if lang eq it
  861.         head_f_l        db 'Errore Sistema',0
  862. else
  863.         head_f_l        db 'System error',0
  864. end if
  865.  
  866. err_message_found_lib1  db 'box_lib.obj - Not found!',0
  867. err_message_found_lib2  db 'proc_lib.obj - Not found!',0
  868.  
  869. err_message_import1     db 'box_lib.obj - Wrong import!',0
  870. err_message_import2     db 'proc_lib.obj - Wrong import!',0
  871. ;---------------------------------------------------------------------
  872. align 4
  873. l_libs_start:
  874.  
  875. library01  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
  876. err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
  877.  
  878. library02  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
  879. err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
  880.  
  881. end_l_libs:
  882. ;---------------------------------------------------------------------
  883. align 4
  884. OpenDialog_data:
  885. .type                   dd 1    ; Save
  886. .procinfo               dd procinfo     ;+4
  887. .com_area_name          dd communication_area_name      ;+8
  888. .com_area               dd 0    ;+12
  889. .opendir_pach           dd temp_dir_pach        ;+16
  890. .dir_default_pach       dd communication_area_default_pach      ;+20
  891. .start_path             dd open_dialog_path     ;+24
  892. .draw_window            dd draw_window  ;+28
  893. .status                 dd 0    ;+32
  894. .openfile_pach          dd fname_buf    ;+36
  895. .filename_area          dd filename_area        ;+40
  896. .filter_area            dd Filter
  897. .x:
  898. .x_size                 dw 420 ;+48 ; Window X size
  899. .x_start                dw 10 ;+50 ; Window X position
  900. .y:
  901. .y_size                 dw 320 ;+52 ; Window y size
  902. .y_start                dw 10 ;+54 ; Window Y position
  903.  
  904. communication_area_name:
  905.         db 'FFFFFFFF_open_dialog',0
  906. open_dialog_path:
  907. if __nightbuild eq yes
  908.         db '/sys/MANAGERS/opendial',0
  909. else
  910.         db '/sys/File Managers/opendial',0
  911. end if
  912. communication_area_default_pach:
  913.         db '/rd0/1/',0
  914.  
  915. Filter:
  916. dd      Filter.end - Filter
  917. .1:
  918. db      'MGB',0
  919. .end:
  920. db      0
  921.  
  922. start_temp_file_name:   db 'pattern.mgb',0
  923.  
  924. path4   db '/rd/1/pattern.mgb',0
  925. ;---------------------------------------------------------------------
  926. align 4
  927. params_f73:
  928. ; destination
  929. .offset_X_dest  dd 0    ; +0
  930. .offset_Y_dest  dd 0    ; +4
  931. .width_dest     dd 90   ; +8
  932. .height_dest    dd 123  ; +12
  933. ; source
  934. .offset_X_src   dd 0    ; +16
  935. .offset_Y_src   dd 0    ; +20
  936. .width_src      dd 90   ; +24
  937. .height_src     dd 123  ; +28
  938. ; other
  939. .pointer        dd .data; 90*4  ; +32
  940. .row_size       dd 90*4 ; +36
  941. ;---------------------------------------------------------------------
  942. align 4
  943. ProcLib_import:
  944. OpenDialog_Init         dd aOpenDialog_Init
  945. OpenDialog_Start        dd aOpenDialog_Start
  946. ;OpenDialog__Version    dd aOpenDialog_Version
  947.         dd 0
  948.         dd 0
  949. aOpenDialog_Init        db 'OpenDialog_init',0
  950. aOpenDialog_Start       db 'OpenDialog_start',0
  951. ;aOpenDialog_Version    db 'Version_OpenDialog',0
  952. ;---------------------------------------------------------------------
  953. align 4
  954. Box_lib_import:
  955. ;init_lib               dd a_init
  956. ;version_lib            dd a_version
  957.  
  958.  
  959. edit_box_draw           dd aEdit_box_draw
  960. edit_box_key            dd aEdit_box_key
  961. edit_box_mouse          dd aEdit_box_mouse
  962. ;version_ed             dd aVersion_ed
  963.  
  964. ;check_box_draw         dd aCheck_box_draw
  965. ;check_box_mouse        dd aCheck_box_mouse
  966. ;version_ch             dd aVersion_ch
  967.  
  968. ;option_box_draw        dd aOption_box_draw
  969. ;option_box_mouse       dd aOption_box_mouse
  970. ;version_op             dd aVersion_op
  971.  
  972. ;scrollbar_ver_draw     dd aScrollbar_ver_draw
  973. ;scrollbar_ver_mouse    dd aScrollbar_ver_mouse
  974. ;scrollbar_hor_draw     dd aScrollbar_hor_draw
  975. ;scrollbar_hor_mouse    dd aScrollbar_hor_mouse
  976. ;version_scrollbar      dd aVersion_scrollbar
  977.  
  978. ;dinamic_button_draw    dd aDbutton_draw
  979. ;dinamic_button_mouse   dd aDbutton_mouse
  980. ;version_dbutton        dd aVersion_dbutton
  981.  
  982. ;menu_bar_draw          dd aMenu_bar_draw
  983. ;menu_bar_mouse         dd aMenu_bar_mouse
  984. ;menu_bar_activate      dd aMenu_bar_activate
  985. ;version_menu_bar       dd aVersion_menu_bar
  986.  
  987. ;FileBrowser_draw       dd aFileBrowser_draw
  988. ;FileBrowser_mouse      dd aFileBrowser_mouse
  989. ;FileBrowser_key        dd aFileBrowser_key
  990. ;Version_FileBrowser    dd aVersion_FileBrowser
  991.  
  992. ;PathShow_prepare       dd sz_PathShow_prepare
  993. ;PathShow_draw          dd sz_PathShow_draw
  994. ;Version_path_show      dd szVersion_path_show
  995.                         dd 0
  996.                         dd 0
  997.  
  998. ;a_init                 db 'lib_init',0
  999. ;a_version              db 'version',0
  1000.  
  1001. aEdit_box_draw          db 'edit_box',0
  1002. aEdit_box_key           db 'edit_box_key',0
  1003. aEdit_box_mouse         db 'edit_box_mouse',0
  1004. ;aVersion_ed            db 'version_ed',0
  1005.  
  1006. ;aCheck_box_draw        db 'check_box_draw',0
  1007. ;aCheck_box_mouse       db 'check_box_mouse',0
  1008. ;aVersion_ch            db 'version_ch',0
  1009.  
  1010. ;aOption_box_draw       db 'option_box_draw',0
  1011. ;aOption_box_mouse      db 'option_box_mouse',0
  1012. ;aVersion_op            db 'version_op',0
  1013.  
  1014. ;aScrollbar_ver_draw    db 'scrollbar_v_draw',0
  1015. ;aScrollbar_ver_mouse   db 'scrollbar_v_mouse',0
  1016. ;aScrollbar_hor_draw    db 'scrollbar_h_draw',0
  1017. ;aScrollbar_hor_mouse   db 'scrollbar_h_mouse',0
  1018. ;aVersion_scrollbar     db 'version_scrollbar',0
  1019.  
  1020. ;aDbutton_draw          db 'dbutton_draw',0
  1021. ;aDbutton_mouse         db 'dbutton_mouse',0
  1022. ;aVersion_dbutton       db 'version_dbutton',0
  1023.  
  1024. ;aMenu_bar_draw         db 'menu_bar_draw',0
  1025. ;aMenu_bar_mouse                db 'menu_bar_mouse',0
  1026. ;aMenu_bar_activate     db 'menu_bar_activate',0
  1027. ;aVersion_menu_bar      db 'version_menu_bar',0
  1028.  
  1029. ;aFileBrowser_draw      db 'FileBrowser_draw',0
  1030. ;aFileBrowser_mouse     db 'FileBrowser_mouse',0
  1031. ;aFileBrowser_key       db 'FileBrowser_key',0
  1032. ;aVersion_FileBrowser   db 'version_FileBrowser',0
  1033.  
  1034. ;sz_PathShow_prepare    db 'PathShow_prepare',0
  1035. ;sz_PathShow_draw       db 'PathShow_draw',0
  1036. ;szVersion_path_show    db 'version_PathShow',0
  1037. ;---------------------------------------------------------------------
  1038. ; for EDITBOX
  1039. align 4
  1040. name_editboxes:
  1041. edit1 edit_box 200,10,30,0xffffff,0xbbddff,0,0,0,255,comment_string_1,mouse_dd,ed_focus+ed_always_focus,0
  1042. name_editboxes_end:
  1043. ;---------------------------------------------------------------------
  1044.  
  1045. IM_END:
  1046. align 4
  1047. mouse_dd        rd 1
  1048. area_for_f36    rd 1
  1049. dwTestEndTime   rd 1
  1050. dwMainPID       rd 1
  1051. ;-----------------------------------------------------------------------------
  1052. text_scren_buffer       rd 1
  1053. text_scren_buffer2      rd 1
  1054. ;---------------------------------------------------------------------
  1055. textarea:
  1056.         rb 8
  1057. ;---------------------------------------------------------------------
  1058. comment_string_1:
  1059.         rb 44
  1060. ;---------------------------------------------------------------------
  1061. comment_string_2:
  1062.         rb 44
  1063. ;---------------------------------------------------------------------
  1064. mgb_data:
  1065.         rb 100
  1066. ;---------------------------------------------------------------------
  1067. procinfo:
  1068.         rb 1024
  1069. ;---------------------------------------------------------------------
  1070. cur_dir_path:
  1071.         rb 4096
  1072. ;---------------------------------------------------------------------
  1073. library_path:
  1074.         rb 4096
  1075. ;---------------------------------------------------------------------
  1076. temp_dir_pach:
  1077.         rb 4096
  1078. ;---------------------------------------------------------------------
  1079. fname_buf:
  1080.         rb 4096
  1081. ;---------------------------------------------------------------------
  1082. filename_area:
  1083.         rb 256
  1084. ;---------------------------------------------------------------------
  1085. align 4
  1086.         rb 4096
  1087. thread_stack2:
  1088. ;---------------------------------------------------------------------
  1089. align 4
  1090.         rb 4096
  1091. thread_stack1:
  1092. ;---------------------------------------------------------------------
  1093. align 4
  1094.         rb 4096
  1095. stacktop:
  1096. params_f73.data rb 123*90*4
  1097. I_END:
  1098.