Y U confuse me about VSync

SGDK only sub forum

Moderator: Stef

Post Reply
r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Y U confuse me about VSync

Post by r57shell »

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.
Image
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

I think you get it wrong, this is the code of the wait_VSync():

Code: Select all

    while (*pw & VDP_VBLANK_FLAG);
    while (!(*pw & VDP_VBLANK_FLAG));
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) !
r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell »

my bad. such a shame :).
remove thread, don't confuse anyone else :D.
I found another bug.
I'm making test rom, for testing vdp emulation and for hardware research, because noone has answers for my questions :).
Image
r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell »

Offtop: why joytest sample does not working under Exodus? :S
Image
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

The last time i tested it on real hardware it was working but i may have broken something :-/ Need to test that.
Post Reply