VDP_fadeIn question.
Moderator: Stef
VDP_fadeIn question.
Hi everyone! The problem is...
When I use VDP_fadeIn function for the first time, it works just fine. But at second and further times, this function works way-way faster. So fast, i need to times the value x10 to slow it down a bit. Is it a bug or just me?
When I use VDP_fadeIn function for the first time, it works just fine. But at second and further times, this function works way-way faster. So fast, i need to times the value x10 to slow it down a bit. Is it a bug or just me?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: VDP_fadeIn question.
Can we see your code ? can you try to isolate part of your code to see if it reproduces always ?
Re: VDP_fadeIn question.
Sure, here it is... https://www.dropbox.com/s/y8qcmk7q1ur2l ... e.rar?dl=1
Update - this bug is only active after button pressed. (see codescreen.c)
Update - this bug is only active after button pressed. (see codescreen.c)
Last edited by ronin68k on Wed Jun 21, 2017 4:47 pm, edited 2 times in total.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: VDP_fadeIn question.
Corrupted file ? I can't unpack the rar file..
Re: VDP_fadeIn question.
The rar unpacks just fine for me Stef. Also you can put dl=1 in the link for direct download.
I'm not sure what's going on with the fades.
I'm not sure what's going on with the fades.
Re: VDP_fadeIn question.
Here is the part of code. Once i press the button, VDP_fadeIn speeds up for the further and no matter how its called.
But before its called by controller (for example, sega screen with time out), it works fine.
Also, here is the zipped archive to try https://www.dropbox.com/s/ojy6f2cod7hgp ... c.zip?dl=1
But before its called by controller (for example, sega screen with time out), it works fine.
Code: Select all
if (changed & state & BUTTON_START)
{
VDP_fadeOut(0, 16, 30, FALSE);
Scene_CodeScreen();
}
Fixed link, thanksHik wrote:Also you can put dl=1 in the link for direct download.
Also, here is the zipped archive to try https://www.dropbox.com/s/ojy6f2cod7hgp ... c.zip?dl=1
Re: VDP_fadeIn question.
I think this has to do with the way you're calling the JOY_setEventHandler()
This might be making it loop in some strange way between Scene_CodeScreen() and the JOY_setEventHandler(Ctrl_CodeScreen) which is within the Scene_CodeScreen() is that a good idea...? I think you only need to set JOY_setEventHandler() initially and have it trigger things.
I think its not a good idea to have the JOY_setEventHandler() looping like that with processing within it..
It says in the documentation "It update controllers state at each V Blank period and fire event if a state change is detected."
Code: Select all
void Scene_CodeScreen()
{
...
JOY_setEventHandler(Ctrl_CodeScreen);
}
void Ctrl_CodeScreen(u16 joy, u16 changed, u16 state)
{
if (CheatCounter0...)
{
...
Scene_CodeScreen();
}
else if (changed & state & BUTTON_START)
{
...
Scene_CodeScreen();
}
}
I think its not a good idea to have the JOY_setEventHandler() looping like that with processing within it..
It says in the documentation "It update controllers state at each V Blank period and fire event if a state change is detected."
Re: VDP_fadeIn question.
Oh... well, im still newbie at programming, even tho i used SGDK long time ago, i code very rarely
Thanks for the reply <3
Thanks for the reply <3
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: VDP_fadeIn question.
Oh indeed, you're doing something insane here for sure ^^
also calling VDP_fadeIn() directly from the JOY callback is not a very good idea, at least call it with async parameter set to TRUE in this case
also calling VDP_fadeIn() directly from the JOY callback is not a very good idea, at least call it with async parameter set to TRUE in this case
Re: VDP_fadeIn question.
Yep, this is what i did and now i got rid of this bug.Stef wrote:at least call it with async parameter set to TRUE in this case
Thank you, guys. Getting programming skills is so much fun for me :3