Page 1 of 1
Clean transitions
Posted: Wed Aug 21, 2013 2:45 am
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
Posted: Wed Aug 21, 2013 7:33 am
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 ?
Posted: Wed Aug 21, 2013 9:35 am
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.
Posted: Wed Aug 21, 2013 11:39 am
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

Posted: Wed Aug 21, 2013 1:16 pm
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?
Posted: Wed Aug 21, 2013 1:19 pm
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.
Posted: Wed Aug 21, 2013 6:32 pm
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?
Posted: Wed Aug 21, 2013 9:19 pm
by Stef
SGDK only allow to set the turn rendering off bit, turn VDP off is done by test register i believe...