home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / hsc14ecr.zip / RETRACE.INC < prev    next >
Text File  |  1994-01-31  |  1KB  |  58 lines

  1. MASM
  2. COMMENT *
  3. ───────────────────────────────────────────────────────────────────────────────
  4.   Retrace.inc     Vertical and Horizontal retrace code (to sync to VGA)
  5. ───────────────────────────────────────────────────────────────────────────────
  6.   Revision 0.1a   Copyright 1993 Phil Carlisle
  7.  
  8.   Description -- Offers the usual Vertical Sync and Horixontal sync procs
  9.  
  10.   History
  11.  
  12. ───────────────────────────────────────────────────────────────────────────────
  13. *
  14.  
  15. WaitVsyncStart proc                  ; wait for vertical rt sync. start
  16.  
  17.         push    ax
  18.         push    dx
  19.  
  20.         mov     dx, 03dah
  21. @@11:
  22.         in      al,dx
  23.         test    al,08h
  24.         jnz     @@11
  25. @@22:
  26.         in      al,dx
  27.         test    al,08h
  28.         jz      @@22
  29.  
  30.         pop     dx
  31.         pop     ax
  32.         ret
  33. ENDP
  34.  
  35. ───────────────────────────────────────────────────────────────────────────────
  36.  
  37. WaitVsyncEnd    proc                    ; wait for vert. rt sync end
  38.  
  39.         pusha
  40.  
  41.         mov     dx,03dah                ; ie display enable period
  42. @@33:
  43.         in      al,dx
  44.         test    al,08h
  45.         jz     @@33
  46. @@44:
  47.         in      al,dx
  48.         test    al,08h
  49.         jnz      @@44
  50.  
  51.         popa
  52.         ret
  53. ENDP
  54.  
  55. ───────────────────────────────────────────────────────────────────────────────
  56.  
  57. IDEAL
  58.