FrankenGraphics
New member
I don't know if this also was fixed in versions more recent than 4.1.0, but either way - here's a fix for making screen transitions rock solid. Also marginally quicker (this difference is pretty much imperceptible, but anyway).
Previous problem:
When transiting between screens, you'll occasionally see the contents of the other nametable flash by for a frame, more often than not, depending on timing. That frame has nonsensical content from previous scrolling margin updates or screen flicks.
Explanation:
The original file makes the error that vBlank is always guaranteed before setting PPUMASK [$2001) to disable rendering. So it is doing a spinlock for the duration of up to a frame to pass until it can proceed to blanking out the screen. Normally, this wouldn't matter all that much. Trouble in our case is, the camera code has already decided that you'll be viewing the other nametable, which mostly contains scroll update garbage at this point. That's what you see flicker by for a single frame when transitioning.
Solution:
We'll simply disable rendering right at the start of the screen loading routine, so the player don't have any chance to get a glimpse of that garbage.
I also commented out 13 subroutine calls to WaitFrame since they were redundant at this point - rendering is already off all through the process so we don't need to wait for rendering to be turned off. all that would do is jump right back.
Installation guide:
1) Search and replace HandleScreenLoads.asm with the attached file.
!!: Note that the file may be present at several locations in your NESmaker folder. Replace the one that is relevant to your project (you can check this from your script settings).
Notes:
Note that if you want to implement smooth fadeins and fadeouts, handleUpdateSwitch is not the place to be doing it. You need to do it earlier; before the camera switches what nametable is viewed, and ideally after player object, monsters, and other objects have been locked or otherwise disabled.
edit: removed some typos and rephrased some bits for clarity.
Previous problem:
When transiting between screens, you'll occasionally see the contents of the other nametable flash by for a frame, more often than not, depending on timing. That frame has nonsensical content from previous scrolling margin updates or screen flicks.
Explanation:
The original file makes the error that vBlank is always guaranteed before setting PPUMASK [$2001) to disable rendering. So it is doing a spinlock for the duration of up to a frame to pass until it can proceed to blanking out the screen. Normally, this wouldn't matter all that much. Trouble in our case is, the camera code has already decided that you'll be viewing the other nametable, which mostly contains scroll update garbage at this point. That's what you see flicker by for a single frame when transitioning.
Solution:
We'll simply disable rendering right at the start of the screen loading routine, so the player don't have any chance to get a glimpse of that garbage.
I also commented out 13 subroutine calls to WaitFrame since they were redundant at this point - rendering is already off all through the process so we don't need to wait for rendering to be turned off. all that would do is jump right back.
Installation guide:
1) Search and replace HandleScreenLoads.asm with the attached file.
!!: Note that the file may be present at several locations in your NESmaker folder. Replace the one that is relevant to your project (you can check this from your script settings).
Notes:
Note that if you want to implement smooth fadeins and fadeouts, handleUpdateSwitch is not the place to be doing it. You need to do it earlier; before the camera switches what nametable is viewed, and ideally after player object, monsters, and other objects have been locked or otherwise disabled.
edit: removed some typos and rephrased some bits for clarity.