Hacker News new | ask | show | jobs
by mrkstu 3072 days ago
What is going on with Mega Man? The other games look relatively atomic but Mega Man has obvious dependencies spanning memory locations...
4 comments

Most NES games have separate program and graphics data, stored in 2 physical ROM chips on the cartridge. The CPU and Picture-Processing-Unit (PPU) have separate memory maps; one chip will be mapped into the CPU's area, and one into the PPU's. Some games (like MegaMan and Legend of Zelda) have RAM connected to the PPU, instead of a ROM chip, and the graphics are stored with the program data. This lets the developer store (or generate, like in the game "Elite") images alongside program code, and transfer to the PPU as needed.

So I'd wonder if a pattern like that is characteristic of the game switching transmitting graphic tiles to the PPU.

It's shuffling the order of its 256-byte sprite buffer each frame to implement sprite flicker, which is done because the NES can only render 8 sprites per scanline.
Nice! I knew about sprite shuffling and wondered how it would look here but didn't realize that was what was going on in this particular case.
It looks like perhaps it has some sort of scene graph that it re-scans on every frame - probably not to redraw the screen because games have been pretty smart about that for a long time, but perhaps to check collisions between objects / particles. Then again, this is NES, so who knows!
I don't see Mega Man on the linked page -- is it somewhere else?