home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / VGASYNC.ZOO / vgasync.asm next >
Assembly Source File  |  1992-03-27  |  2KB  |  94 lines

  1. ; VGASYNC - Force VGA sync polarities negative
  2. ; Copyright 1991, John B. Thiel, all rights reserved.
  3. ;
  4. ; Copyright abandoned, released to public domain - March, 1992
  5. ; by John B. Thiel (jbthiel@cse.ogi.edu)
  6. ;
  7. ;
  8. ;
  9. ; NAME
  10. ;    vgasync - Keep VGA sync polarities negative
  11. ;
  12. ; SYNOPSIS
  13. ;    detach vgasync
  14. ;
  15. ; DESCRIPTION
  16. ;    'vgasync' runs as a background process under OS/2 and periodically
  17. ; (re)sets the horizontal and vertical sync polarities of an (S)VGA card to
  18. ; negative sync.
  19. ;
  20. ;    Many (all?) SVGA cards change the polarities of the H and V sync
  21. ; signals to indicate to an assumed multisync monitor the current video mode
  22. ; (and implied scan frequencies). 'vgasync' allows older fixed-frequency
  23. ; monitors that require a fixed sync polarity to be used with such SVGA
  24. ; cards without requiring hardware modification of the sync signals.  With
  25. ; the addition of manual sync controls on the monitor and/or a means (eg.
  26. ; software drivers) of tweaking the VGA CRT control registers, a "fixed
  27. ; frequency" monitor can then display most of the SVGA extended video modes.
  28. ;
  29. ;    This program requires IOPL to run.
  30. ;
  31. ;
  32. ; $Log$
  33. ;
  34. ;
  35. ;
  36. ; Note: to effect transition to an IOPL segment -
  37. ;
  38. ; In the .def, the IOPL segments must NOT be "conforming". A conforming
  39. ; segment executes at the privilege level of the caller, which is precisely
  40. ; what we don't want when trying to allow a normal application (PL3) to
  41. ; execute IO (PL2).
  42. ;
  43. ; The transition to the IO segment must be effected via a "call" to
  44. ; effect the privilege transition through a call gate. A far jump will
  45. ; not work (general protection trap).
  46. ;
  47. ;
  48.  
  49.  
  50. INCLUDELIB doscalls.lib
  51.  
  52.  
  53. INCLUDE os2.inc
  54.  
  55.  
  56. .286
  57. .MODEL small
  58.  
  59. .DATA
  60.  
  61. delay    dd    1000        ; milliseconds delay
  62.  
  63. .CODE
  64.  
  65. start:
  66.  
  67.     call    far ptr setsync    ; call gate needed for PL transition
  68.  
  69.  
  70.  
  71. IOSEG SEGMENT WORD PUBLIC 'CODE'
  72. ASSUME CS:IOSEG
  73.  
  74.  
  75. setsync:
  76.  
  77.     mov    DX, 03cch    ;read VGA's Misc. Output Reg.
  78.     cli
  79.     in    AL, DX
  80.     or    AL, 0c0h    ;force negative VSYNC and HSYNC
  81.     mov    DX, 03c2h
  82.     out    DX, AL
  83.     sti
  84.  
  85.     @DosSleep [delay]
  86.     jmp    setsync
  87.  
  88.  
  89.  
  90. IOSEG ENDS
  91.  
  92.  
  93. END start            ; entry point is start
  94.