Subversion Repositories Kolibri OS

Rev

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

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