Page 1 of 1
Quick question about PPUSTATUS/PPUADDR
Posted: Thu Nov 13, 2008 10:04 pm
by SecretServiceDude
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?
Posted: Thu Nov 13, 2008 10:34 pm
by Dwedit
It all depends on what's going to get interrupted.
Posted: Thu Nov 13, 2008 10:37 pm
by SecretServiceDude
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?
Posted: Fri Nov 14, 2008 1:26 am
by Memblers
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.