home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / ibm / pc / misc / 12135 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.6 KB

  1. Path: sparky!uunet!usc!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!gateway
  2. From: wet!noah@well.sf.ca.us (Noah Spurrier)
  3. Subject: VGA Vertical Sync Problems.
  4. Message-ID: <m0mPmUK-000BvOC@wet.uucp>
  5. Newsgroups: comp.sys.ibm.pc.misc
  6. Lines: 43
  7. Date: 2 Sep 92 04:43:31 GMT
  8.  
  9.  
  10. Does anyone know how to create a vertical sync for VGA? I am trying to
  11. have a smooth color palette rotation, but the screen flickers. This is
  12. essentialy the same problem that you encounter when trying to do flicker-free
  13. animation... Standard VGA does not support IRQ2 as EGA does. My Card does have
  14. an IRQ2 option, but I want my software to be portable... I tired adding the
  15. following wait loop just before I update the palette, but I still get noise
  16. in the upper 1/4 of the screen.
  17.  
  18. void set_all_rgb_palette(unsigned char far * pal)
  19. {
  20.  /* If a Vert Blank was already in progress then wait for next one */
  21.  while (inportb (0x03da) & 0x08)
  22.    ;
  23.  
  24.  /* Wait for Vertical Scan to end. Vert Blank Starts after this */
  25.  while ( ! (inportb (0x03da) & 0x08))
  26.    ;
  27.  
  28.  _AH = 0x10;
  29.  _AL = 0x12;
  30.  _BX = 0;
  31.  _CX = 0x100;
  32.  _ES = FP_SEG (pal);
  33.  _DX = FP_OFF (pal);
  34.  geninterrupt (0x10);
  35. }
  36.  
  37. As you can se this uses Turbo-C psuedo register variables to about assembly.
  38. Port Location 3da & 8 is the bit that goes high when the VGA is currently
  39. in a Vertical Blank condition. My idea is to only update the palette while
  40. the Vertical Sync is blanked. Seems obvious, but it isn't perfect.
  41.  
  42. What to do?
  43.  
  44. Please Email and Reply post your responses... Or at least Email...
  45.  
  46. Thanks!
  47.  
  48. Noah@wet.UUCP
  49.  
  50. OOPSS... That's supposed to be  noah@wet.UUCP   No capital N in noah...
  51.  
  52.