Does input need to be polled every frame?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Does input need to be polled every frame?

Post by Pokun »

Not OAM decay but you just said the PPU goes batshit and corrupts parts of OAM if rendering is turned off while sprites are being evaluated. I assumed sprite evaluation isn't being done during vblank. In that case turning off rendering in vblank is the safe way to turn off rendering I thought. "The frames and NMI" also suggest doing this, although it doesn't explain exactly why (it says something about that the screen jumps if rendering is turned on outside of vblank).
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Does input need to be polled every frame?

Post by tokumaru »

Pokun wrote:you just said the PPU goes batshit and corrupts parts of OAM if rendering is turned off while sprites are being evaluated.
Ah, OK. This is a much bigger problem if rendering is being consistently turned off at a bad moment every frame, but one frame after transitions and such would hardly be noticeable. But you are right, delaying $2000/$2001 writes until vblank is the best practice. Not only you avoid any sprite corruption, but you also avoid displaying partial frames that may make the screen appear to "jump".
Post Reply