Subversion Repositories Kolibri OS

Rev

Rev 1741 | Blame | Last modification | View Log | Download | RSS feed

  1. ;------------------------------------------------------------------------------
  2. ; Display Test for KolibriOS
  3. ;------------------------------------------------------------------------------
  4. ; version:      0.41
  5. ; last update:  17/03/2012
  6. ; written by:   Marat Zakiyanov aka Mario79, aka Mario
  7. ; changes:      some optimisations and code refactoring
  8. ;------------------------------------------------------------------------------
  9. ; compiler:        FASM 1.50
  10. ; name:            Display Test
  11. ; version:         0.4
  12. ; original author: barsuk
  13.  
  14. ; <--- include all MeOS stuff --->
  15. include "lang.inc"
  16. include "../../../macros.inc"
  17.  
  18. ; <--- start of MenuetOS application --->
  19. MEOS_APP_START
  20.  
  21. ;include "..\..\..\debug.inc"
  22.  
  23.  
  24. ; <--- start of code --->
  25. CODE
  26.         mcall   37,4,cursor,2
  27.         or      eax, eax
  28.         jz      exit
  29.         mov     [cursorID], eax
  30. ;------------------------------------------------------------------------------
  31. redraw:
  32.         call    draw_window               ; at first create and draw the window
  33. ;------------------------------------------------------------------------------
  34. wait_event:                               ; main cycle
  35.         xor     ebx, ebx
  36.         mcall   10
  37.  
  38.         cmp     eax, 1                    ;   if event == 1
  39.         je       redraw                   ;     jump to redraw handler
  40.         cmp     eax, 2                    ;   else if event == 2
  41.         je       key                            ;       jump to key handler
  42.         cmp     eax, 3                    ;   else if event == 3
  43.         je       button                   ;     jump to button handler
  44.  
  45.         jmp     wait_event                 ;   else return to the start of main cycle
  46. ;------------------------------------------------------------------------------
  47. key:                                            ; key event handler
  48.         mcall   2                         ;   get key code
  49.  
  50.         cmp     ah, 27
  51.         jz      exit
  52.  
  53.         cmp     ah, 0x20
  54.         jz      next_test
  55.  
  56.         cmp     ah, 179                 ; ->
  57.         jz      next_test
  58.  
  59.         cmp     ah, 176                 ; <-
  60.         jz      prev_test
  61.  
  62.         cmp     ah, 'i'
  63.         jz      toggle_info
  64.  
  65.         cmp     ah, 'I'                 ;   ¢¤à㣠ã 祫  Š€‘‹ŽŠ ))
  66.         jz      toggle_info
  67.  
  68.         cmp     ah, 'c'
  69.         jz      toggle_cursor
  70.  
  71.         cmp     ah, 'C'
  72.         jz      toggle_cursor
  73.  
  74.         cmp     ah, 'd'
  75.         jz      redraw
  76.  
  77.         cmp     ah, 'D'
  78.         jz      redraw
  79.  
  80.         jmp     wait_event
  81. ;------------------------------------------------------------------------------
  82. next_test:
  83.         cmp     dword [test_done], 1
  84.         jz      wait_event
  85.  
  86.         inc     dword [test_num]
  87.         call    draw_window
  88.         jmp     wait_event
  89. ;------------------------------------------------------------------------------
  90. prev_test:
  91.         cmp     dword [test_num], ebx
  92.         jz      wait_event
  93.  
  94.         dec     dword [test_num]
  95.         mov     dword [test_done], ebx
  96.         call    draw_window
  97.         jmp     wait_event
  98. ;------------------------------------------------------------------------------
  99. toggle_info:
  100.         xor     dword [show_info], 1
  101.         call    draw_window
  102.         jmp     wait_event
  103. ;------------------------------------------------------------------------------
  104. toggle_cursor:
  105.         mov     eax, cursorVisible
  106.         cmp     dword [eax], 0
  107.         jz      .no_cursor
  108.  
  109.         mov     dword [eax], 0
  110.         mov     ecx, [cursorID]
  111.         jmp     .set
  112. ;--------------------------------------
  113. .no_cursor:
  114.         mov     dword [eax], 1
  115.         xor     ecx, ecx
  116. ;--------------------------------------
  117. .set:
  118.         mcall   37,5
  119.         mcall   18,15                   ; çâ®¡ë ®¡­®¢¨«áï
  120.         jmp     wait_event
  121. ;------------------------------------------------------------------------------
  122. button:                                  ; button event handler
  123.         mcall   17               ;   get button identifier
  124.         cmp     ah, 1
  125.         jne     wait_event                 ;   return if button id != 1
  126. ;--------------------------------------
  127. exit:
  128.         or       eax, -1                         ;   exit application
  129.         mcall
  130. ;------------------------------------------------------------------------------
  131. draw_window:
  132.         mcall   12,1
  133.  
  134.         ; ªãàá®à
  135.         ;mov     eax, 37
  136.         ;mov     ebx, 5
  137.         ;mov     ecx, cursorID
  138.         ;int     0x40
  139.  
  140.         mcall   14              ; screen size
  141.  
  142.         mov     ebx, eax
  143.         shr     ebx, 16
  144.         mov     ecx, eax
  145.         and     ecx, 0xffff
  146.         mov     [screenx], ebx
  147.         mov     [screeny], ecx
  148.  
  149.         inc     ebx
  150.         inc     ecx
  151.         xor     eax, eax                          ; create and draw the window
  152.         mov     edx, 0x01000000
  153.         mov     esi, edx
  154.         mcall
  155.         ; áâ¥à¥âì £à ­¨æë ®ª­ 
  156.         xor     edx, edx
  157.         mcall   13              ; £àã¡® â ª
  158.  
  159.         dec     ebx
  160.         dec     ecx
  161.  
  162.         mov     eax, [test_num]
  163.         mov     eax, [test_proc + eax*4]
  164.         or      eax, eax
  165.         jz      end_of_test
  166.         call    eax
  167.         jmp     exit_draw
  168. ;--------------------------------------
  169. end_of_test:
  170.         mcall   4,<8,8>,0xffffff,test_finish,test_finish.size
  171.         mov     dword [test_done], 1
  172.         jmp     no_info
  173. ;--------------------------------------
  174. exit_draw:
  175.         cmp     dword [show_info], 1
  176.         jnz     no_info
  177. ; á­®¢  à §¬¥àë íªà ­ 
  178.         mov     ebx, [screenx]
  179.         mov     ecx, [screeny]
  180. ; ᣥ­¥à¨âì áâà®çªã á à §à¥è¥­¨¥¬ íªà ­ . … ­ã¦­®, ¯®â®¬ã çâ® ¯¯æ
  181.         ; ¯àאַ㣮«ì­¨ª 200å40 á ¨­ä®©
  182.         mov     edx, 200
  183.         sub     ebx, edx
  184.         shl     ebx, 15
  185.         mov     bx, dx
  186.         mov     edx, 40
  187.         sub     ecx, edx
  188.         shl     ecx, 15
  189.         mov     cx, dx
  190.         mcall   13,,,0xffffff
  191.  
  192.         xor     edx, edx
  193.         add     ebx, 0x0000fffe         ; ®ç¥­ì 㤮¡­® :))))
  194.         add     ecx, 0x0000fffe
  195.         mcall
  196. ; ⥪áâ
  197.         shr     ecx, 16
  198.         mov     bx, cx
  199.         add     ebx, 0x00010001
  200.         mov     ecx, 0x80ffffff
  201.         mov     edx, [test_num]
  202.         mov     edx, [test_info + edx*4]
  203.         mcall   4
  204.  
  205.         add     ebx, 8
  206.         mcall   ,,,press_space
  207.  
  208.         add     ebx, 8
  209.         mcall   ,,,press_i
  210.  
  211.         add     ebx, 8
  212.         mcall   ,,,press_c
  213. ;--------------------------------------
  214. no_info:
  215.         mcall   12,2
  216.         ret
  217. ;------------------------------------------------------------------------------
  218. ; <---- procedures for various tests of display ----->
  219. ; in: ebx = screen_width, ecx = screen_height
  220. ;------------------------------------------------------------------------------
  221. lsz i_image_size, ru, "Image Size and Placement"
  222. db      0
  223. ;------------------------------------------------------------------------------
  224. t_image_size:
  225.         mov     esi, ebx
  226.         mov     edi, ecx
  227. ; 6 ®â१ª®¢
  228.         xor     ecx, ecx
  229.         mcall   38,,,0xffffff
  230.  
  231.         mov     ecx, edi
  232.         shl     ecx, 16
  233.         xor     ebx, ebx
  234.         mcall
  235.  
  236.         mov     ebx, esi
  237.         shl     ebx, 16
  238.         add     ecx, edi
  239.         mcall
  240.        
  241.         sub     ecx, edi
  242.         add     ebx, esi
  243.         mcall
  244. ; à ¬ª  £®â®¢ 
  245.         mov     ebx, esi
  246.         shl     ebx, 16
  247.         mov     ecx, edi
  248.         shl     ecx, 15
  249.         mov     cx, di
  250.         shr     cx, 1
  251.         mcall
  252.  
  253.         shr     ebx, 1
  254.         mov     bx, si
  255.         shr     bx, 1
  256.         mov     ecx, edi
  257.         shl     ecx, 16
  258.         mcall
  259.         ret
  260. ;------------------------------------------------------------------------------
  261. lsz i_grid, ru, "Grid"
  262. db      0
  263. ;------------------------------------------------------------------------------
  264. t_grid:
  265. ;       á¥âª  à §¬¥à®¬ ¢ 64 ¯¨ªá¥« 
  266.         mov     eax, 38
  267.         inc     ebx
  268.         inc     ecx
  269.         mov     esi, ebx
  270.         mov     edi, ecx
  271.         mov     edx, 0xffffff
  272.         mov     ebp, 0x00400040
  273. ;       £®à¨§®­â «ì­ë¥ «¨­¨¨
  274.         shl     ebx, 16
  275.         xor     ecx, ecx
  276. ;--------------------------------------
  277. grid_next_y:
  278.         mcall
  279.  
  280.         add     ecx, ebp
  281.         cmp     cx, di
  282.         jnae    grid_next_y
  283.         sub     ecx, 0x00010001
  284.         mcall
  285. ;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
  286.         mov     ecx, edi
  287.         shl     ecx, 16
  288.         xor     ebx, ebx
  289. ;--------------------------------------
  290. grid_next_x:
  291.         mcall
  292.         add     ebx, ebp
  293.         cmp     bx, si
  294.         jnae    grid_next_x
  295.         sub     ebx, 0x00010001
  296.         mcall
  297.         ret
  298. ;------------------------------------------------------------------------------
  299. lsz i_horstr, ru, "Horizontal Straightness"
  300. db      0
  301. ;------------------------------------------------------------------------------
  302. t_horstr:
  303.         mov     eax, 38
  304.         mov     edi, ecx
  305.         mov     edx, 0xffffff
  306.         mov     esi, ecx
  307.         inc     esi
  308.         shr     esi, 3
  309.         mov     ebp, esi
  310.         shl     ebp, 16
  311.         mov     bp, si
  312. ;       £®à¨§®­â «ì­ë¥ «¨­¨¨
  313.         shl     ebx, 16
  314.         mov     ecx, ebp
  315.         shr     ecx, 1
  316.         mov     cx, bp
  317.         shr     cx, 1
  318. ;--------------------------------------
  319. hor_next_y:
  320.         mcall
  321.         add     ecx, ebp
  322.         cmp     cx, di
  323.         jnae    hor_next_y
  324.         ret
  325. ;------------------------------------------------------------------------------
  326. lsz i_vertstr, ru, "Vertical Straightness",0
  327. db      0
  328. ;------------------------------------------------------------------------------
  329. t_vertstr:
  330.         mov     eax, 38
  331.         mov     edx, 0xffffff
  332.         mov     esi, ebx
  333.         shl     ecx, 16
  334.         mov     edi, esi
  335.         shr     edi, 3
  336.         mov     ebp, edi
  337.         shl     ebp, 16
  338.         mov     bp, di
  339.         mov     ebx, ebp
  340.         shr     ebx, 1
  341.         mov     bx, bp
  342.         shr     bx, 1
  343. ;--------------------------------------
  344. vert_next_x:
  345.         mcall
  346.         add     ebx, ebp
  347.         cmp     bx, si
  348.         jnae    vert_next_x
  349.         ret
  350. ;------------------------------------------------------------------------------
  351. lsz i_distort, ru, "Distortion",0
  352. db      0
  353. ;------------------------------------------------------------------------------
  354. t_distort:
  355.         mov     edx, 0xffffff
  356.         mov     esi, ebx
  357.         mov     edi, ecx
  358.         mov     ebp, 3
  359.         xor     ebx, ebx
  360. ;--------------------------------------
  361. dist_next:
  362.         push    ebp
  363.         mov     ebp, ebx
  364.         shl     ebx, 16
  365.         or      ebx, ebp
  366.  
  367.         mov     ecx, edi
  368.         shl     ecx, 16
  369.         or      ecx, ebp
  370.         mcall   38
  371.  
  372.         mov     ebx, esi
  373.         shl     ebx, 16
  374.         mov     bx, si
  375.         mcall
  376.  
  377.         mov     bx, bp
  378.         mov     ecx, ebp
  379.         shl     ecx, 16
  380.         or      ecx, ebp
  381.         mcall
  382.  
  383.         mov     ecx, edi
  384.         shl     ecx, 16
  385.         mov     cx, di
  386.         mcall
  387.  
  388.         mov     eax, 30
  389.         sub     esi, eax
  390.         sub     edi, eax
  391.         mov     ebx, ebp
  392.         add     ebx, eax
  393.         pop     ebp
  394.         dec     ebp
  395.         jnz     dist_next
  396.         ret
  397. ;------------------------------------------------------------------------------
  398. lsz i_horres, ru, "Horizontal Resolution",0
  399. db      0
  400. ;------------------------------------------------------------------------------
  401. t_horres:
  402.         mov     eax, 38
  403.         mov     edx, 0xffffff
  404.         mov     edi, ecx
  405.         shl     ecx, 16
  406.         mov     esi, ebx
  407.         xor     ebx, ebx
  408.         mov     edi, 0x003A003A
  409.         mov     ebp, 0x00030003
  410. ;--------------------------------------
  411. horres_next:
  412.         add     ebx, edi
  413.         mcall
  414.  
  415.         add     ebx, ebp
  416.         mcall
  417.  
  418.         add     ebx, ebp
  419.         mcall
  420.  
  421.         add     ebx, ebp
  422.         mcall
  423.  
  424.         add     ebx, ebp
  425.         mcall
  426.  
  427.         cmp     bx, si
  428.         jna     horres_next
  429.         ret
  430. ;------------------------------------------------------------------------------
  431. lsz i_vertres, ru, "Vertical Resolution",0
  432. db      0
  433. ;------------------------------------------------------------------------------
  434. t_vertres:
  435.         mov     eax, 38
  436.         mov     edx, 0xffffff
  437. ;       mov     esi, ebx
  438.         shl     ebx, 16
  439.         mov     edi, ecx
  440.         xor     ecx, ecx
  441.         mov     ebp, 0x00030003
  442.         mov     esi, 0x002A002A
  443. ;--------------------------------------
  444. vertres_next:
  445.         add     ecx, esi
  446.         mcall
  447.  
  448.         add     ecx, ebp
  449.         mcall
  450.  
  451.         add     ecx, ebp
  452.         mcall
  453.  
  454.         add     ecx, ebp
  455.         mcall
  456.  
  457.         add     ecx, ebp
  458.         mcall
  459.  
  460.         add     ecx, 0x00540054
  461.         cmp     cx, di
  462.         jna     vertres_next
  463.         ret
  464. ;------------------------------------------------------------------------------
  465. lsz i_moire, ru, "Moire Patterns",0
  466. db      0
  467. ;------------------------------------------------------------------------------
  468. t_moire:
  469.         mov     eax, 38
  470.         mov     edx, 0xffffff
  471.         mov     edi, ecx
  472.         shl     ecx, 16
  473.         mov     esi, ebx
  474.         xor     ebx, ebx
  475.         mov     ebp, 0x00030003
  476. ;--------------------------------------
  477. moire_next:
  478.         mcall
  479.         add     ebx, ebp
  480.         cmp     bx, si
  481.         jna     moire_next
  482.         ret
  483. ;------------------------------------------------------------------------------
  484. lsz i_revsharp, ru, "Reverse Video Sharpness",0
  485. db      0
  486. ;------------------------------------------------------------------------------
  487. t_revsharp:
  488.         mov     esi, ebx
  489.         mov     edi, ecx
  490.         shr     ecx, 1
  491.         mcall   13,,,0xffffff
  492. ;   ⥯¥àì - ¨­¢¥àá­ë¥ «¨­¨¨
  493.         mov     eax, 38
  494.         mov     ecx, edi
  495.         mov     edx, 0x01000000
  496.         xor     ebx, ebx
  497.         mov     ebp, 0x00010001
  498.         mov     edi, 0x003F003F
  499. ;--------------------------------------
  500. revsharp_next:
  501.         add     ebx, edi
  502.         mcall
  503.  
  504.         add     ebx, ebp
  505.         mcall
  506.  
  507.         add     ebx, ebp
  508.         mcall
  509.  
  510.         add     ebx, edi
  511.         sub     ebx, ebp
  512.         mcall
  513.  
  514.         cmp     bx, si
  515.         jna     revsharp_next
  516.         ret
  517. ;------------------------------------------------------------------------------
  518. lsz i_flicker, ru, "Flicker Severity",0
  519. db      0
  520. ;------------------------------------------------------------------------------
  521. t_flicker:
  522.         mcall   13,,,0xffffff
  523.         ret
  524. ;------------------------------------------------------------------------------
  525. lsz i_glare, ru, "Glare Severity",0
  526. db      0
  527. ;------------------------------------------------------------------------------
  528. t_glare:                ; ®¯â¨¬¨§¨à®¢ âì ­¥ç¥£®
  529.         ret
  530. ;------------------------------------------------------------------------------
  531. lsz i_interlace, ru, "Interlacing Detection",0
  532. db      0
  533. ;------------------------------------------------------------------------------
  534. t_interlace:
  535.         mov     edi, ecx
  536.         mov     eax, 38
  537.         mov     edx, 0xffffff
  538.         xor     ecx, ecx
  539.         mov     ebp, 0x00020002
  540. ;--------------------------------------
  541. interlace_next:
  542.         add     ecx, ebp
  543.         mcall
  544.         cmp     cx, di
  545.         jna     interlace_next
  546.         ret
  547. ;------------------------------------------------------------------------------
  548. lsz i_scrreg, ru, "Screen Regulation",0
  549. db      0
  550. ;------------------------------------------------------------------------------
  551. t_scrreg:
  552.         add     ebx, 0x0018FFCD ; +25 ª ­ ç «ã ¨ -50 ®â ¤«¨­ë
  553.         shr     ecx, 1
  554.         add     ecx, 0x0013FFEC ; +19 ª ­ ç «ã ¨ -19 ®â ¤«¨­ë
  555.         mcall   13,,,0xffffff
  556.         ret
  557. ;------------------------------------------------------------------------------
  558. lsz i_pricol, ru, "Primary Color Purity"
  559. db      0
  560. ;------------------------------------------------------------------------------
  561. t_pricol:
  562.         mov     esi, ebx
  563.         mov     edi, ecx
  564.  
  565.         shr     ebx, 4  ; /16
  566.         mov     ebp, ebx
  567.         shl     ebx, 16
  568.         mov     bx, bp
  569.         shl     ebp, 16
  570.         lea     ebp, [ebp + ebp * 4]            ; ebp *= 5
  571.  
  572.         mov     ecx, 0x00280000
  573.         mov     cx, di
  574.         sub     cx, 80
  575.         ;shr     cx, 1
  576.  
  577.         shl     bx, 2
  578.         mcall   13,,,0xff0000
  579.  
  580.         add     ebx, ebp
  581.         shr     edx, 8
  582.         mcall
  583.  
  584.         add     ebx, ebp
  585.         shr     edx, 8
  586.         mcall
  587.         ret
  588. ;------------------------------------------------------------------------------
  589. lsz i_colint, ru, "Color Intensity Gradient"
  590. db      0
  591. ;------------------------------------------------------------------------------
  592. t_colint:
  593.  
  594.         mov     esi, ebx
  595.         mov     edi, ecx
  596.  
  597. ;        mov     eax, ecx
  598. ;        shr     ecx, 2          ; end y coord
  599. ;        and     ecx, 0xffffff80         ; íâ® not 7F
  600. ;        shr     eax, 7                  ; / 128
  601. ;        mov     ebp, eax
  602. ;        mov     edx, eax
  603. ;        lea     eax, [eax + eax * 2]    ; eax *= 5
  604. ;        shl     ebp, 4
  605. ;        add     eax, ebp
  606.  
  607. ;        shl     eax, 16
  608. ;        add     ecx, eax
  609. ;        mov     edx, ebp
  610. ;        shl     ebp, 16
  611. ;        mov     bp, dx          ; ©  ¡®«ì­®©
  612.  
  613.         ; ï ­¥ ¯®­ï«, çâ® â ¬ ¤¥« «®áì, ¨ à¥è¨« ­ ¯¨á âì á­®¢  ®_Ž
  614.  
  615.         ; ­ ¤® §¤¥áì ᣥ­¥à¨âì ecx (­ ç «ì­ë© ᤢ¨£) ¨ ebp (è £ ¯® ã)
  616.  
  617.         mov     eax, edi
  618.         lea     eax, [eax + 2 * eax]
  619.         shr     eax, 5                  ; eax = 3/32 ¢ëá®âë
  620.         mov     ebp, eax
  621.         shl     ebp, 16
  622.         mov     bp, ax                  ; ebp = ax ¢ ®¡®¨å á«®¢ å
  623.  
  624.         mov     ebx, eax                ; á®åà ­¨¬ íâ® §­ ç¥­¨¥
  625.  
  626.         mov     eax, edi
  627.         inc     eax
  628.         shr     eax, 4          ; 3/16 ¢ëá®âë - ­ ç «ì­®¥ §­ ç¥­¨¥
  629.                                 ; ¢á¥£® ¯®«®áë § ©¬ãâ 3/4 ¢ëá®âë, ¨â®£® ¯® 3/32 ¢ëá®âë ­  ¯®«®áã (¤«ï ஢­®£® áç¥â )
  630.         lea     eax, [eax + eax * 2]
  631.         mov     ecx, eax
  632.         shl     ecx, 16
  633.         shr     ebx, 2
  634.         lea     ebx, [ebx + ebx * 2]    ; ebx = 3/4 ebx, â.¥. 3/4 ¢ëá®âë ¯®«®áë
  635.         add     eax, ebx
  636.         mov     cx, ax
  637.  
  638.         xor     edx, edx
  639.         mov     eax, 0xffff
  640.         div     esi
  641.         mov     edi, eax        ; edi = 64K/width
  642.  
  643.         mov     dword [color_index], 0
  644.         jmp     colint_next
  645. ;------------------------------------------------------------------------------
  646. color_table     dd      0x00ff0000, 0x0000ff00, 0x00ffff00, \
  647.                         0x000000ff, 0x00ff00ff, 0x0000ffff, 0x00ffffff
  648. color_index     dd      0
  649. ;------------------------------------------------------------------------------
  650. colint_next:
  651.         xor     edx, edx
  652.         xor     ebx, ebx
  653.         mov     eax, 38
  654. ;--------------------------------------
  655. colint_next_line:
  656.         push    edx
  657.         push    eax
  658.         movzx   eax, dh
  659.         shl     eax, 16
  660.         mov     dl, dh
  661.         or      edx, eax
  662.         mov     eax, [color_index]
  663.         mov     eax, [color_table + eax * 4]
  664.         and     edx, eax
  665.         pop     eax
  666.         mcall
  667.         pop     edx
  668.         add     ebx, 0x00010001
  669.         add     edx, edi
  670.         cmp     bx, si
  671.         jna     colint_next_line
  672.  
  673.         add     ecx, ebp
  674.         inc     dword [color_index]
  675.         cmp     dword [color_index], 7
  676.         jb      colint_next
  677.         ret
  678. ;------------------------------------------------------------------------------
  679. lsz i_colalign, ru, "Color Alignment Grid"
  680. db      0
  681. ;------------------------------------------------------------------------------
  682. t_colalign:
  683. ; ªà á­ ï á¥âª 
  684.         inc     ebx             ; â ª ­ã¦­®
  685.         inc     ecx
  686.         mov     esi, ebx
  687.         mov     edi, ecx
  688.         mov     edx, 0xff0000
  689. ;       £®à¨§®­â «ì­ë¥ «¨­¨¨
  690.         shl     ebx, 16
  691.         xor     ecx, ecx
  692.         push    edi
  693.         shr     edi, 3
  694.         mov     ebp, edi
  695.         shl     ebp, 16
  696.         mov     bp, di
  697.         pop     edi
  698.         mov     [yshift], ebp
  699.         mov     eax, 38
  700. ;--------------------------------------
  701. cgrid_next_y:
  702.         mcall
  703.         add     ecx, ebp
  704.         cmp     cx, di
  705.         jnae    cgrid_next_y
  706.         ; ¯®á«¥¤­ïï «¨­¨ï:
  707.         sub     ecx, 0x00010001
  708.         mcall
  709.  
  710. ;       ¢¥à⨪ «ì­ë¥ «¨­¨¨
  711.         mov     ecx, edi
  712.         shl     ecx, 16
  713.         xor     ebx, ebx
  714.         push    esi
  715.         shr     esi, 3
  716.         mov     ebp, esi
  717.         shl     ebp, 16
  718.         mov     bp, si
  719.         mov     [xshift], ebp
  720.         pop     esi
  721.         mov     eax, 38
  722. ;--------------------------------------
  723. cgrid_next_x:
  724.         mcall
  725.         add     ebx, ebp
  726.         cmp     bx, si
  727.         jnae    cgrid_next_x
  728.         ; ¯®á«¥¤­ïï «¨­¨ï
  729.         sub     ebx, 0x00010001
  730.         mcall
  731.         jmp     cgrid_green
  732. ;------------------------------------------------------------------------------
  733.         xshift  dd      0
  734.         yshift  dd      0
  735.         shift   dd      0
  736. ;------------------------------------------------------------------------------
  737. cgrid_green:
  738. ; §¥«¥­ë¥ «¨­¨¨: £®à¨§®­â «ì­ë¥
  739.         mov     edx, esi
  740.         shr     edx, 5
  741.         lea     eax, [edx + edx * 2]
  742.         shl     edx, 16
  743.         or      edx, eax
  744.         mov     [shift], edx
  745.         mov     eax, 38
  746.         mov     edx, 0x00ff00
  747.         xor     ecx, ecx
  748.         mov     ebp, [xshift]
  749. ;--------------------------------------
  750. ggrid_next_yy:
  751.         mov     ebx, [shift]
  752. ;--------------------------------------
  753. ggrid_next_yx:
  754.         mcall
  755.         add     ebx, ebp
  756.         cmp     bx, si
  757.         jnae    ggrid_next_yx
  758.         sub     ebx, 0x00010001
  759.         mcall
  760.  
  761.         add     ecx, [yshift]
  762.         cmp     cx, di
  763.         jnae    ggrid_next_yy
  764.         ; last row of lines
  765.         mov     ebx, [shift]
  766.         dec     ecx
  767. ;--------------------------------------
  768. ggrid_last_yx:
  769.         mcall
  770.         add     ebx, ebp
  771.         cmp     bx, si
  772.         jnae    ggrid_last_yx
  773.  
  774. ; ¨ ¢¥à⨪ «ì­ë¥
  775.         mov     edx, edi
  776.         shr     edx, 5
  777.         lea     eax, [edx + edx * 2]
  778.         shl     edx, 16
  779.         or      edx, eax
  780.         mov     [shift], edx
  781.  
  782.         mov     eax, 38
  783.         mov     edx, 0x00ff00
  784.         mov     ecx, [shift]
  785.         mov     ebp, [xshift]
  786. ;--------------------------------------
  787. ggrid_next_xy:
  788.         xor     ebx, ebx
  789. ;--------------------------------------
  790. ggrid_next_xx:
  791.         mcall
  792.  
  793.         add     ebx, ebp
  794.         cmp     bx, si
  795.         jnae    ggrid_next_xx
  796.         sub     ebx, 0x00010001
  797.         mcall
  798.  
  799.         add     ecx, [yshift]
  800.         cmp     cx, di
  801.         jnae    ggrid_next_xy
  802.         xor     ebx, ebx
  803.         dec     ecx
  804. ;--------------------------------------
  805. ggrid_last_xy:
  806.         ;int     0x40
  807.         ;add     ebx, ebp
  808.         ;cmp     bx, si
  809.         ;jnae    ggrid_last_xy
  810.         ret
  811. ;------------------------------------------------------------------------------
  812. lsz i_colsyn, ru, "Color Synchronization"
  813. db      0
  814. ;------------------------------------------------------------------------------
  815. t_colsyn:
  816.         inc     ebx
  817.         inc     ecx
  818.         mov     esi, ebx
  819.         mov     edi, ecx
  820.  
  821.         shr     ebx, 5
  822.         mov     eax, ebx
  823.         lea     ebx, [ebx + ebx * 4]
  824.         shl     ebx, 1                  ; 10/32
  825.         mov     ebp, ebx
  826.         shl     eax, 16
  827.         or      ebx, eax
  828.         shl     ebp, 16
  829.  
  830.         mov     edi, 0x0000ffff
  831.         add     ecx, 0x003FFF7F
  832.         mov     edx, edi
  833.         mcall   13
  834.  
  835.         mov     edx, 0x00ff0000
  836.         add     ebx, ebp
  837.         mcall
  838.  
  839.         mov     edx, edi
  840.         add     ebx, ebp
  841.         mcall
  842.         ret
  843. ;------------------------------------------------------------------------------
  844. ; <--- initialised data --->
  845. DATA
  846.         screenx         dd      0
  847.         screeny         dd      0
  848.  
  849.         test_num        dd      0
  850.         test_done       dd      0
  851.         show_info       dd      1
  852.         test_proc       dd      t_image_size, t_grid, t_horstr, t_vertstr,\
  853.                 t_distort, t_horres, t_vertres, t_moire, t_revsharp, \
  854.                 t_flicker, t_glare, t_interlace, t_scrreg, t_pricol, \
  855.                 t_colint, t_colalign, t_colsyn, 0
  856.         test_info       dd      i_image_size, i_grid, i_horstr, i_vertstr, \
  857.                 i_distort, i_horres, i_vertres, i_moire, i_revsharp, \
  858.                 i_flicker, i_glare, i_interlace, i_scrreg, i_pricol, \
  859.                 i_colint, i_colalign, i_colsyn, 0
  860.  
  861.         lsz press_space, ru, " ¦¬¨â¥ ¯à®¡¥« ¤«ï ¯à®¤®«¦¥­¨ï,"
  862.         db      0
  863.         lsz press_i, ru, "I ¤«ï ¯¥à¥ª«î祭¨ï ᢥ¤¥­¨©,"
  864.         db      0
  865.         lsz press_c, ru, "¨ C ¤«ï ¯¥à¥ª«î祭¨ï ªãàá®à "
  866.         db      0
  867.         lsz header, ru, "’¥áâ ¬®­¨â®à "
  868.         lsz test_finish, ru, "Š®­¥æ â¥áâ .  ¦¬¨â¥ ESC."
  869.  
  870.         cursor  dd 32*32 dup(0x00000000)        ; ¢á¥ à ¢­® ᮦ¬¥âáï
  871.  
  872.         cursorVisible   dd      1
  873.         cursorID        dd      0
  874. ;------------------------------------------------------------------------------
  875. ; <--- uninitialised data --->
  876. UDATA
  877. ;------------------------------------------------------------------------------
  878. MEOS_APP_END
  879. ; <--- end of MenuetOS application --->
  880. ;------------------------------------------------------------------------------
  881.