Question regarding PPU's pixel/scanline counters

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Question regarding PPU's pixel/scanline counters
by on (#75030)
I have 2 counters in my emulator that track the current pixel number and the current scanline number. Presently, these counters are _always_ running/counting no matter what. It just occurred to me today that maybe these counters should only be counting when either background/sprite rendering is enabled...? I haven't really thought too much about this, maybe it doesn't matter, maybe it does. Anyone have any ideas?

Thanks!!

Jonathon

by on (#75039)
I'm sure that they should always be running no matter what. It's not like the MMC3's scanline counter that watches for the A12 line which freezes when rendering is disabled.

Just make sure you have the even/odd prerender scanline behavior correct.

Also, a Game Boy is actually capable of stopping the screen, unlike the NES.

by on (#75046)
Yes you don't want to stop that. If you did you could get a game to lockup by having it turn off the screen and then wait for the VBL flag to be set to know when to reenable the screen. Atleast that's what I recall, it's been awhile.

by on (#75049)
Thanks a ton guys! Exactly what I wanted to know.

MottZilla wrote:
If you did you could get a game to lockup by having it turn off the screen and then wait for the VBL flag...

Haha, yeah, in hindsight that is a "duh" moment. Lol. Sorry! :)

Jonathon