From Sonic Retro
|SCHG: Sonic Jam|
Texture Definitions start at $250A4 in MUSEUM.MUS.
These are basically a set of data, each 8 bytes long, that defines a texture. Pattern Addresses and Color Lookup Table addresses are in VDP1 Memory.
Here's its format:
|Pattern Address / 8||word|
|Width / 8||byte|
|Color Lookup Table Address / 8||word|
|Pattern Address / 8 (again?)||word|
For any who are savvy in VDP1 commands, this lines up with part of a Texture Draw command; the first word is CMDSRCA, the second is CMDSIZE, and the third is CMDCOLR.
Texture Pattern Data starts at $1AFC0 in SPRDATA.MUS.
Texture patterns are a string of data, wherein every 4 bits is one pixel. This of course means that you are limited to the 16 colors defined in this texture's color lookup table. The value of the 4 bits determines which color is used, with a value of $0 meaning the first color in the table is used, and a value of $F meaning the last color in the table is used.
The Saturn is capable of having different pattern modes; There's an 8 bits per-pixel mode, and a 16 bits per-pixel mode; It's yet to be confirmed if any of these textures use that.
Color Lookup Tables
Color Lookup Table Data starts at $0AFC0 in SPRDATA.MUS.
Each table is 32 bytes. Every word defines a single color.
This part needs some serious work; I'm not very sure about how this stuff works yet.
If bit $8000 is set, the color seems to be defined in RGB mode. Bits $4000-$0400 are blue, bits $0200-$20 are green, and bits $10-$1 are red.
If bit $8000 is not set, then something else seems to happen.