This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Quick question about PPUSTATUS/PPUADDR

Quick question about PPUSTATUS/PPUADDR
by on (#40040)
Assuming you always write to PPUADDR in pairs, is it sufficient to reset the VRAM address latch by reading PPUSTATUS just once near the beginning of NMI?

Or should you always reset the latch before writing to PPUADDR to be safe?

by on (#40041)
It all depends on what's going to get interrupted.

by on (#40042)
Suppose all the writes to PPUDATA occur in NMI, and IRQs are disabled. Nothing would get interrupted at that point, right? In that case, is it safe to reset the latch just the one time?

by on (#40045)
Yes, it's safe to reset it just once. If your NMI has the potential to be long enough, you may want to make sure it doesn't interrupt itself, but I doubt it's a problem.

I've seen very few games, actually only one I can think of, that always read PPUSTATUS before setting the address. Myself, I read it in every NMI.