In graphics and animation, the point of origin is called the anchor point (confusingly, sometimes all handles on an object are called that too but i suspect this is a mispractice).
Sprite tables can be stored as relative to that anchor point, which means that by offsetting the whole table as such, you effectively move the anchorpoint.
Examples:
Code: Select all
someMetasprite:
.byte -8,-8,$ee,0
.byte 0,-8,$ef,0
.byte -8, 0,$fe,0
.byte 0, 0,$ff,0
implies a centered anchorpoint (could work for a topdowner, but is a bit unintuitive for a platformer).
Code: Select all
someOtherMetasprite:
.byte -8,-16,$ee,0
.byte 0,-16,$ef,0
.byte -8,-8,$fe,0
.byte 0,-8,$ff,0
implies a horizontally centered, but bottom-aligned anchorpoint. Pretty convenient for sprites that ought to turn around and check against ground often.
Code: Select all
metasprite3:
.byte 0, 0,$ee,0
.byte 8, 0,$ef,0
.byte 0, 8,$fe,0
.byte 8, 8,$ff,0
implies a top- and left-aligned anchorpoint. Practical for static overlays. I guess it could be convenient in that it can actually be drawn in the top-left corner of the screen w/o wraparound as well, but the utility isn't that great imo.
When doing static overlays you want to place on an absolute position on the screen, it helps to count in powers of 8 or 16. Example:
Code: Select all
;raw OAM data
.byte (8*8)-1,$01,$00,(8*6)
the parentheses are redundant but helps me decode visually what is going on: the sprite is on the 8th row, 6th column* the -1 is likely an adjustment for the render delay. This example is strictly on the grid, but you can add offsets after the parentheses as you need.
In absolute placement, you can't use 128 as a terminator, so you need to specify an absolute length of data to be deployed in OAM this way.
*(assuming 0*8) is read as the 0th row or column.
Last note... i don't agree with NESST's choice for ordering the sprite data. It had been simpler if it was written just like how OAM is structured. It could have represented this however it is most convenient in its interface, but forcing this shuffle on the output seems unnecessary.