fsakura wrote:
So it means, data in 0x0200 - range is kind of meta data about sprite.
Yeah, you have to somehow tell the PPU what goes where, and this is how you do it for sprites. The $0200-$02FF range isn't mandatory though, any other memory page will work ($XX00-$XXFF), even if it's ROM, you just have to write the page number to $4014 when you do the DMA. Page $02 just happens to be popular for this specific purpose, but a few games are known to use other pages.
Quote:
and actual sprite is found by using 3rd attribute i.e. tile number. But how does PPU know which tile number corresponds to which part of the sprite (mario)?
You might be thinking of Mario as one sprite, but he's actually made from 4 or 8 sprites. The PPU has no idea that this group of 8x8 sprites forms a single game character, because it doesn't know the concept of a "game character". It knows 8x8-pixel squares and this is it. Your program is responsible for generating the OAM data for all 4 (or 8) small sprites that form the larger character.
This is why games often use a meta-sprite system. This way they can define groups of sprites with coordinates relative to an object's position in ROM, and a routine will take care of calculating the absolute positions of all sprites and writing the OAM data to RAM every frame. This might be more low level than you were expecting, but that's the NES for you. It provides a rudimentary video system for you to draw things, but it has absolutely no understanding of specific game concepts, it has no idea what the pictures it draws represent... most of the time you have to write your own code to simulate more complex structures, and translate those to the low level data the NES expects.
Quote:
Also, where does .incbin copy its data?
.incbin doesn't copy anything anywhere, it's an assembler directive that includes a binary file in your ROM. This makes the contents of the file accessible to the program, available to be used, but, yet again, your program is responsible for copying it to wherever you want or making use of it in place.
Almost nothing is automatic with the NES, nearly everything must be managed by code YOU write.