I'm working on a new VGA object and I figured out pretty much that you need to have an exact frequency output to get all monitors to lock at 60Hz. That screen slowly fadding to white problem·that others have had comes actually from the fact that by trying to calculate the VGA frequency output with integer math·you do not get an exact result that is usable for the pixel clock.
So... I'm just going to use precomputed·values and then·use a different one for each clock frequency.
So far I have 80Mhz, 100Mhz, and 96Mhz as supported values. Are there any more popular clock frequencies that people use?
Honestly, I'd rather not hardcode this but... I need 64 bit math to get a proper result and I'm not really that good at breaking stuff up yet.
What I need to do is this....··((6,293,750 * 4,294,967,296) / clkfreq)
If I had 64 bit math the result would then come out to 337,893,130... The exact answer I need is 337,893,131 so I need to round up after the divide.
Thanks for your help,
Oh, and about the screen slowly fadding to white error. The reason this happens is because the pixel clock is not as high as it needs to be for the number of pixels you are pumping out to the screen. Because of this, each frame to the monitor is longer than it should be and the monitor will probably see like a 59Hz signal instad of 60Hz. This causes the monitor to basically get confused. So, you can fix the problem by either increasing the pixel clock frequency until it matches the number of pixels sent to the screen or you can reduce the number of pixels sent to the screen.
Post Edited (Kye) : 7/1/2010 6:22:16 PM GMT