SMB status bar Flicker

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
SMB status bar Flicker
by on (#30751)
I'm back! Opted to resurrect my emulator project after...years.

Anyway, when there is a lot of stuff going on in a SMB level (easiest to repro in 8-1 by throwing some fireballs with 3 goombas and a green turtle on-screen), I see the actual status bar flicker off to the side.

Investigation has shown that the NMI from one frame actually blends into the next, ending at roughly scanline 3 of the next frame. When the NMI ends, it reads from $2000 (clearing the vblank flag) and then writes to 2002 to re-enable NMI...however, the NMI won't fire because of the read from 2000 to clear it. Consequently, the horizonal scroll latch never gets set back to 0, so the status bar flicks to the side for a frame.

Is this correct behavior? Does this happen on a physical NES?

If not, can anyone think of what I might need to change to fix this behavior?

EDIT: This also reproduces in Nintendulator, so I suppose if it IS wrong, I'm at least in good company :)

by on (#30755)
Welcome.
yes, I've seen it happen on my NES.