From Sega Retro
|This article is too Mega Drive-specific.|
This is an old page originating from Sonic Retro and was originally designed to assist with Sonic the Hedgehog ROM hacking. The article should be modified to better reflect the scope of Sega Retro.
Block mappings are used to arrange large amounts of 8x8 tiles into larger tiles (16x16, followed by 128x128 or 256x256). These larger tiles are then arranged into the level layout.
- Sonic the Hedgehog
- Sonic the Hedgehog 2
- Sonic 3 & Knuckles
- Sonic CD
- Sonic Crackers
- Knuckles' Chaotix
16x16 tiles consist of four 8x8 tiles, arranged in the shape:
Each 8x8 tile is represented by one word, which, like all SEGA Genesis VDP pattern indices, is a bitmask of the form PCCY XAAA AAAA AAAA. P is the priority flag, CC is the palette line to use, X and Y indicate that the sprite should be flipped horizontally and vertically respectively, and AAA AAAA AAAA is the actual tile index, i.e. the VRAM offset of the pattern divided by $20.
128x128 tiles consist of sixty-four 16x16 tiles, arranged in the shape:
Each 16x16 tile has a two-byte value with the format SSTT YXII IIII IIII. SS is the solidity of the tile in the alternate collision layer - 00 means not solid, 01 means top solid, 10 means left/right/bottom solid, and 11 means all solid. TT is the solidity of the tile in the normal collision layer - 00 means not solid, 01 means top solid, 10 means left/right/bottom solid, and 11 means all solid. Y is the Y-flip flag, X is the X-flip flag, and II IIII IIII is the index of the 16x16 tile to use.
Similar to 128x128 tiles, except the data format is SSSY XIII IIII IIII Values for SSS are: