Reliable Vsync Needed


Arch Deviant

Still Fresh
Joined
Dec 14, 2006
Messages
12
Location
Colchester
Website
Visit site
Hi,

Did first bit of code today (whooo hooo), running on Firmware 2.10 and have come across the vsync issue. I nicked DZZ's code:

void WaitForVSync()
{
while(g_pusRegs[0x1182>>1]&(1<<4))
;
}

According to the demo thread this doesnt work on v2.0 (or 2.1 it looks like as well). I cant find a modified bit of code to do a vsync and after looking around it seems to be a common and COMPLICATED issue.

I dont want to use SDL_Flip because I dont want to flip buffers in my code. (yet).

Is there a ready built answer or do I have to code a
what is your firmware?
do DZZ's code for <2.0 and an alternative for >2.0?

cheers all
 
Mudi posted on Dec 30 2006 at 11:28 PM said:
What? I hadn't heard that doesn't work on fw2.0... :huh:

According to DZZ...

Dzz posted on May 12 2006 at 03:39 AM said:
...* In version 2.0 of the firmware, the VSync signal changed polarity. The code now figures out which polarity to use.
...

Unfortunately none of the links provided from this point on in the thread seem to work... :( so I can't find the modified code but DZZ obviously sussed it out (bows down)
 
Last edited by a moderator:
Ahh, so it's the same register, just inverse polarity. Yeah, look for an edge like squidge says :)
 
Mudi posted on Dec 31 2006 at 01:24 AM said:
Ahh, so it's the same register, just inverse polarity. Yeah, look for an edge like squidge says :)

edge?
do you mean keep polling the register till it changes value?
 
Last edited by a moderator:
hm, i use the same code to slow my app down to the correct refresh rate, works fine on 2.0 here. ... at least i think it does
 
Vimacs posted on Dec 31 2006 at 05:34 PM said:
hm, i use the same code to slow my app down to the correct refresh rate, works fine on 2.0 here. ... at least i think it does

maybe its just me then :) just sits in an endless while loop on mine (firmware 2.10)
 
Last edited by a moderator:
Arch Deviant posted on Dec 31 2006 at 03:51 PM said:
Mudi posted on Dec 31 2006 at 01:24 AM said:
Ahh, so it's the same register, just inverse polarity. Yeah, look for an edge like squidge says :)

edge?
do you mean keep polling the register till it changes value?

Yeah, "edge" is a technical term meaning changing from one state to another.

So rather than waiting for a certain value, just wait until the vblank bit changes state.
 
Last edited by a moderator:
Back
Top