free hosting   image hosting   hosting reseller   online album   e-shop   famous people 
Free Website Templates
Free Installer

SPRITE MAPPINGS GUIDE

Sprite Mappings Format - Sonic 2:

Sprite mappings define how the various 8x8 pixel tiles are arranged within a sprite, and follows this format:

NNNN - ( YY - SS - FF - TT - FF - TT - XXXX )

It's important to know that NNNN only appears once at the start of each sprite, and ( YY - SS - TTTT - ???? - XXXX ) will appear NNNN times. Now I'll describe the purpose of each of the different bytes.

NNNN:
The number of pieces which make up the sprite, and therefore the number of times ( YY - SS - TTTT - ???? - XXXX ) appears. A piece of sprite is not usually the same thing as an 8x8 tile.

YY:
The position of the sprite piece on the y-axis. YY increases as you move an item towards the bottom of the screen.

SS:
The size and shape of the sprite piece. 8x8 tiles are read from the VRAM and placed into differently-shaped rectangles:

SS = 00 SS = 01 SS = 02 SS = 03 SS = 04 SS = 05 SS = 0F
1
1
2
1
2
3
1
2
3
4
1 2
1 3
2 4
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16

It's easy to see what sizes 06-0E look like, and 0F is the largest sprite piece you can use.

FF:
This byte controls the mirroring and flipping of the sprite piece, and also which pallete line the sprite piece uses.

Value for FF Effect
+08 Flips the sprite fragment horizontally.
+10 Flips the sprite fragment vertically.
+20 Use default pallete line +1.
+40 Use default pallete line +2.
+60 Use default pallete line +3.
+80 Sprite fragment is always in the foreground (this effect is used for the rings/score/time display).

TT:
This controls which tiles in the VRAM are to be read. Normally, 00 is the first tile of the sprite you're dealing with.

FF - TT:
These two bytes are used for two-player mode, instead of FF - TT. The reason for this is that graphics are stored in the VRAM differently in two-player mode, so it's necessary for mappings to be able to cope with the differences.

XXXX:
The position of the sprite piece on the x-axis. XXXX increases as you move an item towards the right-hand-side of the screen.

If there's anything about mappings you don't understand, the best thing to do is open a savestate in Tile Layer Pro, and open the ROM in a hex editor, and try to work out how everything works by yourself.