gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Quick Fade Question

#888 - Epo - Sat Jan 11, 2003 8:29 pm

When I'm fading using REG_COLEY, in VisualBoy Adv there seems to be some tearing. I am waiting for the vblank, but that doesnt seem to work. Is there a way to avoid this tearing? Or is it just a VisualBoy Adv problem (I am not using a very fast computer, especially when it comes to graphics). I have not tried the fading on an actual GBA; I have no linker, yet.
So am I just doing the fading wrong, or is it just VBA's error?

Code:

// Fades in
void FadeIn (u32 nWait)
{
   s8 nIntensity;
   
   REG_BLDMOD = (1 | 2 | 4 | 8 | 16 | 32 | (192));
   
   for (nIntensity = 16; nIntensity >= 0; nIntensity--)
   { WaitForVBlank(); REG_COLEY = nIntensity; Sleep (nWait); }
}
[/code]

#892 - Splam - Sat Jan 11, 2003 9:37 pm

vboy problem..

vboy is trying to emulate a 60hz machine but has to refresh it's screen at the same speed as your monitor refresh (could be anything like 60,70,80 whatever hz) so it can't draw the emulated screen at preciesly the correct time. It is possible to do it better than vboy does but what's the point? it's just an emu ;)

#893 - satanicfreak2 - Sat Jan 11, 2003 10:04 pm

this isnt a problem w/ your rom... my games do this also but on real hardware there is no problem at all.

#919 - Epo - Sun Jan 12, 2003 6:07 am

Great! So does the hardware take care of the video refresh when working with the REG_xx registers? --> Should I just forget about waiting for the vblank when changing the REG_COLEY value?

Thanks!

#920 - jaymzjulian - Sun Jan 12, 2003 6:39 am

Epo wrote:
Great! So does the hardware take care of the video refresh when working with the REG_xx registers? --> Should I just forget about waiting for the vblank when changing the REG_COLEY value?


no, you still need to wait for vblank

-jj