|
Exactly how much can you get away with in VBLANK code? This answer could have various levels of precision, requiring ever more complex calculations...
Easy stuff first. There are 113.75 or so cycles per scanline, according to a post I found on NESEmDev. There are 20 scanlines in an NTSC VBLANK (NEStech 4.M). That gives you 2,275 cycles of computation.
So, if you've got a 6502 emulator with a cycle counter, you're home free, almost. The NES is a multiprocessor, and I don't have much information about how it relates to the PPU.
Do writes to register memory locations (especially $2005, $2006, $2007, or $4014) take longer than the normal 5 cycles? If so, how much?
My immediate goal is to work out exactly how many times you can write to VRAM per VBLANK without smiting yourself - since one would like very much to be able to change name tables and such "behind the back" of the player without disabling the display every time. If this data is actually known, that would also be much appreciated.
|