VSync for me... it is such point in time, when you can do things invisible.
So, it is time, when you need to make fast changes on screen, and after such changes, you can do long calculations.
For example, WAIT_VSYNC in DirectDraw means wait period when you can fast blit screen, and it will be invisible.
So, this period is VBLANK. And for me, VDP_waitVSync() must wait VBLANK.
But in code in SGDK... I see opposite. It's wait for VBLANK OFF.
It is your sgdk, so do what you wanna do. Bug in my code is found.
Y U confuse me about VSync
Moderator: Stef
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
I think you get it wrong, this is the code of the wait_VSync():
Actually the first line is here in case you were already in VBlank when you called the method. What it does is that it actually wait until the end of VBlank then the second line is actually waiting until active period end and so you are sure to have a complete VBlank period when the method bring hand back to you.
waitVSync() is a very primitive method, i guess having it wrong in SGDK would end in many troubles in SGDK based codes (even in the SGDK samples) !
Code: Select all
while (*pw & VDP_VBLANK_FLAG);
while (!(*pw & VDP_VBLANK_FLAG));
waitVSync() is a very primitive method, i guess having it wrong in SGDK would end in many troubles in SGDK based codes (even in the SGDK samples) !