home *** CD-ROM | disk | FTP | other *** search
/ The Equalizer BBS / equalizer-bbs-collection_2004.zip / equalizer-bbs-collection / DEMOSCENE-STUFF / UWLOADER.ZIP / VIDEO.MAC < prev   
Text File  |  1994-11-15  |  1KB  |  60 lines

  1. ;
  2. ;  Some nice port access macros I got from XLIB 6.0 ->
  3. ;
  4.  
  5. Out16 Macro Register, Value
  6.     IfDifI <Register>, <Dx>         ; If DX not setup
  7.         Mov     Dx, Register        ; then Select Register
  8.     EndIf
  9.     IfDifI <Value>, <Ax>            ; If AX not setup
  10.         Mov     Ax, Value           ; then Get Data Value
  11.     EndIf
  12.         Out     Dx, Ax              ; Set I/O Register(s)
  13. EndM
  14.  
  15. ; Macro to OUT a 8 bit value to an I/O Port
  16.  
  17. Out8 Macro Register, Value
  18.     IfDifI <Register>, <Dx>         ; If DX not setup
  19.         Mov     Dx, Register        ; then Select Register
  20.     EndIf
  21.     IfDifI <Value>, <Al>            ; If AL not Setup
  22.         Mov     Al, Value           ; then Get Data Value
  23.     EndIf
  24.         Out     Dx, Al              ; Set I/O Register
  25. EndM
  26.  
  27.  
  28. ;-----------------------------------------------------------------------
  29. ; Macro that waits for a VR, if one is not already in progress
  30.  
  31. WaitVRT Macro
  32.  
  33.     Mov     Dx,INPUT_1
  34. WaitVsync:
  35.     In      Al,Dx
  36.     Test    Al,08h
  37.     Jz      WaitVsync
  38.  
  39. EndM
  40.  
  41.  
  42. ;-----------------------------------------------------------------------
  43. ; Macro to wait for the vertical retrace trailing edge
  44.  
  45. WaitVsyncEnd Macro
  46.  
  47.     LOCAL WaitNotVsync,WaitVsync
  48.     mov     dx,INPUT_1
  49. WaitVsync2:
  50.     in      al,dx
  51.     test    al,08h
  52.     jz      WaitVsync2
  53. WaitNotVsync2:
  54.     in      al,dx
  55.     test    al,08h
  56.     jnz     WaitNotVsync2
  57.  
  58. endm
  59.  
  60.