Clean transitions

SGDK only sub forum

Moderator: Stef

Post Reply
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Clean transitions

Post by djcouchycouch »

Hi,

I'm struggling with figuring out the correct sequence of functions to call so that I can change the contents of background planes (switching from one level to another) without ugly flickering/glitching.

Right now, my steps are like so:

- wait for vsync
- VDP_setEnable(0)
- change the contents of the background planes to new level
- VDP_setEnable(1)

But this doesn't look right. There's always a split-second of the screen that's just filled with a solid background color. It's not a clean change from one level to the next.

What am I missing?

Thanks!
DJCC
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

If this is a complete level change, can't you use palette fade in/out to hide the data update ?
or you want to update your data in a single frame slice and it seems you run out of vram bandwidth in this case... how much you want to update and what is your delai to do the update ?
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch »

I'm replacing both background planes plus reloading the tiles in the vdp for the new planes plus the new sprites that are contained in the level section. So there's a fair amount of data.

I didn't think of turning all the palettes to black during the transition. I'll try that.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

Ok so in this case you can turn palette off temporary or directly turn VDP off as you did (this has the advantage of maximizing the bandwidth) except you need to wait vsync before turn it back on so you won't enable it at mid screen :)
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch »

Stef wrote:Ok so in this case you can turn palette off temporary or directly turn VDP off as you did (this has the advantage of maximizing the bandwidth) except you need to wait vsync before turn it back on so you won't enable it at mid screen :)
Se even with the VDP turned off, waiting for vblank still works?
TmEE co.(TM)
Very interested
Posts: 2452
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) »

There's "turn off VDP" and "turn off rendering" bits, you have to use the latter. VDP uses the backdrop color, like in blanking areas when rendering is off. Turning off VDP itself will result in loss of sync.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch »

TmEE co.(TM) wrote:There's "turn off VDP" and "turn off rendering" bits,
Which does VDP_setEnable() affect? Is there a function call for the other?
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef »

SGDK only allow to set the turn rendering off bit, turn VDP off is done by test register i believe...
Post Reply