retrace.asm 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ; $Id$
  2. ; MegaZeux
  3. ;
  4. ; Copyright (C) 1996 Greg Janson
  5. ; Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. ;
  7. ; This program is free software; you can redistribute it and/or
  8. ; modify it under the terms of the GNU General Public License as
  9. ; published by the Free Software Foundation; either version 2 of
  10. ; the License, or (at your option) any later version.
  11. ;
  12. ; This program is distributed in the hope that it will be useful,
  13. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ; General Public License for more details.
  16. ;
  17. ; You should have received a copy of the GNU General Public License
  18. ; along with this program; if not, write to the Free Software
  19. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ;
  21. ; RETRACE.ASM- Code to wait for the vertical retrace.
  22. ;
  23. Ideal
  24. include "retrace.inc"
  25. p186
  26. JUMPS
  27. include "model.inc"
  28. Codeseg
  29. ;
  30. ; Function- wait_retrace
  31. ;
  32. ; Waits for the vertical retrace start. Won't pick it up in the middle.
  33. ;
  34. proc wait_retrace far
  35. push ax dx
  36. mov dx,03DAh
  37. WaitNotVsync:
  38. in al,dx
  39. test al,08h
  40. jnz WaitNotVsync
  41. WaitVsync:
  42. in al,dx
  43. test al,08h
  44. jz WaitVsync
  45. pop dx ax
  46. ret
  47. endp wait_retrace
  48. ends
  49. end