Moving sprites

From NeoGeo Development Wiki
Revision as of 21:39, 28 January 2011 by Furrtek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sprites can be moved individually if they're not stuck together, of by blocks otherwise.

Horizontal position

Their horizontal (X) position is set in VRAM, in SCB4. It's relative to the left screen border.

Example: write $0010 to $8402, puts sprite n°2 at 16 pixels from the left.

Vertical position

Their vertical (Y) position is set in VRAM, in SCB3. It's reversed (496-Y), but relative to the top screen border. A value of $1F0 sets the sprite to Y=0, $110 sets it at 224 (out of the visible area).

Example: write 496-14 ($1E2) to $8205, puts sprite n°5 at 14 pixels from the top.

Like every location in VRAM, these values can be updated mid-frame to create stretches.