Actions

SCHG

Difference between revisions of "Sonic Jam/Textures"

From Sonic Retro

(Page Created.)
 
m (Color Lookup Tables)
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
 
Texture Definitions start at $250A4 in MUSEUM.MUS.
 
Texture Definitions start at $250A4 in MUSEUM.MUS.
  
These are basically a set of data, each 8 bytes long, that defines a texture. Here's its format:
+
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:
  
 
{|class="prettytable" style="width:auto;"
 
{|class="prettytable" style="width:auto;"
 
! Description||Size
 
! Description||Size
 
|-
 
|-
| VDP1 Address / 8 || word
+
| Pattern Address / 8 || word
 
|-
 
|-
 
| Width / 8 || byte
 
| Width / 8 || byte
Line 15: Line 17:
 
| Height || byte
 
| Height || byte
 
|-
 
|-
| Palette Lookup Table Address / 8 || word
+
| Color Lookup Table Address / 8 || word
 
|-
 
|-
| VDP1 Address / 8 (again?) || 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 Patterns==
 
==Texture Patterns==
Line 34: Line 38:
 
This part needs some serious work; I'm not very sure about how this stuff works yet.
 
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 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.
 
If bit $8000 is not set, then something else seems to happen.

Latest revision as of 09:32, 19 February 2021

SCHG: Sonic Jam
Main Article
Sonic World

Models
Animations
Textures
Sounds
RAM Editing

Texture Definitions

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:

Description Size
Pattern Address / 8 word
Width / 8 byte
Height 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 Patterns

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.

Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information