For now I cannot show a piece of code since the same function works fine when not used with timed/irq code some I'm not suspecting the fade code as the issue but more something else affect the fade code while writing to the PPU.
It seems that in some situation, the fade in/out doesn't work well and after going to a few state (state = other screens, menu etc) and coming back to that place, it may stabilize and sometime shows properly. In other screen that doesn't ireq, that behavior doesn't occurs.
One thing that I found odd is in all screen, if I wait for the nmi to trigger the fade and use nmi to wait between frame it works fine except for the ones with IRQ. In those case, if I don't sync to the vblank, the fade often doesn't work at all. Quite an odd behavior. I'm not sure why the IRQ could cause thing to go out of whack, maybe it touches the PPU like for split the screen and happens at the same time as nmi? hmmm..
Now that I was able to improve my fade function by adding a frame with emphasis set, it looks a lot better except for those case when it start to fail.
Have anybody experienced similar behavior while using irq?
It seems that in some situation, the fade in/out doesn't work well and after going to a few state (state = other screens, menu etc) and coming back to that place, it may stabilize and sometime shows properly. In other screen that doesn't ireq, that behavior doesn't occurs.
One thing that I found odd is in all screen, if I wait for the nmi to trigger the fade and use nmi to wait between frame it works fine except for the ones with IRQ. In those case, if I don't sync to the vblank, the fade often doesn't work at all. Quite an odd behavior. I'm not sure why the IRQ could cause thing to go out of whack, maybe it touches the PPU like for split the screen and happens at the same time as nmi? hmmm..
Now that I was able to improve my fade function by adding a frame with emphasis set, it looks a lot better except for those case when it start to fail.
Have anybody experienced similar behavior while using irq?