Actions

SCHG

Difference between revisions of "Sonic Jam/Models"

From Sonic Retro

m
Line 74: Line 74:
 
| Body||$3FD98
 
| Body||$3FD98
 
|}
 
|}
 +
 +
{{SCHGuides}}
 +
[[Category:SCHG: Sonic Jam]]

Revision as of 10:08, 18 February 2021

Models start at $3F908 in MUSEUM.MUS.

Model Format

Models generally consist of the following parts. There are some exceptions, but the general order stays the same.

Vertices

The first part are vertices, stored as a 3D vector.

Indexing Table

The second part is the indexing table for quads, using the vertices given. Indices are words, and jump by $08. The first vertex would be $0000; the second would be $0008. There's one for each quad.

Vertex Normals

The third, for objects that use Dynamic Gouraud Shading, are the vertex normals. These are normalized 3D vectors. As you'd expect, there's one for each vertex.

Draw Settings

After the above is the draw settings. There's one list of settings for each quad. Each list is 16 bytes long. Here's its format:

Description Length
Unknown. Highest bit seems to turn off backface culling. Byte
Unknown. Bits $1 and $2 affect depth testing in certain instances. Byte
Texture index. $0-$1DB. Word
CMDPMOD command for VDP1. Bit flags. Word
Unknown. Word
Static/Dynamic Gouraud Shading Table Index. Word
CMDCTRL command for VDP1. Bit flags. Word
Unknown. Word
Unknown. Word

Footer

This can vary from model to model, depending on which parts are present. For Sonic, this consists of the following:

  • Pointer to start of vertices (long), number of vertices (long)
  • Pointer to start of indexing table (long), number of quads (long)
  • Pointer to draw command (long)
  • Pointer to vertex normals (long)

Model Groups

Some models, such as Sonic and Tails, consist of multiple models in a group. After the last model in the group, there's a footer.

The first part of the footer is a list of addresses pointing to each model's footer.

The second part is a list of 3D Vectors, relative positions for each model. They correspond to the addresses given in the previous section.

Certain model groups have some seemingly unused data that appears before the footer. This data seems to correlate with how the model group parenting hierarchy is set up.

Model List

Here's the list of models in the game that I know of. Addresses given are pointers to footers, for both model groups and individual models.

Sonic $42620
Body $3FD98
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