Neo Geo Sprite Documentation

This is how I layed out a tilemap using sprites. (The only way you can do tile maps on the NeoGeo, that I know of).
You'll probably want to refer to the Neo Geo documentation.
You may also want to download the source code for the demo.

move.w #$8010, $3c0000
Sets the 'VRAM' address for the writes. This is sprite $10 control block.

move.w #$200, $3c0004
Sets the address increment to $200. Causes each write to go to the correct location in the sprite table.

move.w #$0fff, $3c0002
Sets full zoom for the sprite. The NeoGeo only allows shrinking sprites, not zooming.

move.w #$fc0e, $3c0002 ; Normally $f80e
Sets the number of sprites in the block to 14. (Bits 0 to 5)
If bit 6 is set (it isn't in this case, it is below) This sprite block (bank) is attached to the previous bank. Sets the y position of the block. (7 to 15). ($fc0e >> 7 is 504.)
The Y positions are upside down. A Y position of 496 is even with the top of the screen ($f800), 504 is 8 pixels above the top of the screen.

move.w #$440, $3c0002
Sets the x position of the screen (Bits 7 to 15). ($440 >> 7 = 8)
X Positions are normal, I believe.

move.w #$8011, d1
This sets up the start of the next sprite. $8010 is sprite $10.
It's based on word addressing. $8011 is sprite 17.

move.w #18, d0
Creates 18 sprite banks or blocks.

SpriteMapLoop:
move.w d1, $3c0000
Sets the address of the memory to address ($8011 initially).

move.w #$0fff, $3c0002
Sets full zoom.

move.w #$40, $3c0002
Places this sprite bank to the right to the previous one. (No need for an x or y position).

add.w #1, d1
Increment to the next sprite. ($8012....)

dbra d0, SpriteMapLoop
Repeat. :)

This basically just lays the sprites out to create a tilemap, by creating 18 strips that are 16 sprites tall. It doesn't put in the tile values.

So you get something like..
18 strips
|
V
x.............x
..
..<-16 sprites
..
x

Even though I only use 14, I get a 'strip' that is 16 sprites tall. I'm not sure why this is.

You'll also notice when I fill the 'tilemap' I have to skip 16 sprites (64 bytes) to get to the tile to the right of the current tile.



Hosted by EmuVibes