Sonic Adventure DX: PC/Model Locations
From Sonic Retro
Template:SCHG SADX:PC This page is about models.
Model Locations
sonic.exe
Key=0x00400000
Dr. Eggman (Cutscenes)
Address | Description | Parent | Child | Sibling |
---|---|---|---|---|
49C830 | Root of Model | None | 49C734 | None |
CHRMODELS.DLL
Key=0x10000000
Sonic
Address | Description | Parent | Child | Sibling |
---|---|---|---|---|
55E76C | Tail | 55E7D0 | None | None |
55F330 | Left Shoe Toe | |||
55F948 | Left Shoe Heel | |||
560DD0 | Right Shoe Toe | |||
5613F8 | Right Shoe Heel | |||
563D0C | Right Arm Elbow | |||
565C34 | Eye Globe | |||
569594 | Head | 56998C | 565C34 | None |
5698F0 | Right Eye | |||
569CE8 | Left Eye | |||
56AD48 | Body | 56ADE4 | 569E20 | None |
56AF50 | Root of Model (No model data) | None | 56AF1C | None |
5812AC | Cutscene Head | |||
Rolling | ||||
5729CC | Root of Model (No model data) | None | 572998 | None |
Metal Sonic | ||||
58F808 | Head | 58FAAC | 58DB0C | None |
591068 | Root of Model (No model data) | None | 591034 | None |
Super Sonic | ||||
62C4CC | Head | 62C8C4 | 628B54 | None |
62DE88 | Root of Model (No model data) | None | 62DE54 | None |
Model Format
Remember: all pointers are 4 Bytes, and need to have a key subtracted from them to find the correct location in a file.
For sonic.exe, subtract 0x00400000.
For DLL files, subtract 0x10000000.
For the dreamcast version, subtract 0x0C900000.
As a rule, data sets occur in the reverse order that these pointers do. In a non-hacked model, the model data always starts with the material structs and goes down the file to the vertex struct, with the exception of the vertex struct. The verts occur right after the mesh struct and the normals are the last data set before the attach struct. The tools sonic team used strictly followed that rule, but the game can operate outside of that constraint so make sure your pointers are always accurate. A crashing game usually means a bad pointer!
Note: these are listed in the order they will appear in the file. However, it is likely that you will start at the OBJECT Struct.
MATERIAL Struct
The game loads as many of these structs as indicated in the attach struct. The format is as follows.
offset | Type | Description | Notes |
---|---|---|---|
0 | 4 Bytes | Diffuse Color | in BRGA format |
4 | 4 Bytes | Specular Color | in BRGA format |
8 | 4 Bytes | Unknown | |
C | Byte | Texture ID | |
D | 4 Bytes? | Unknown | |
11 | Byte | Unknown | |
12 | Byte | UV Clamping | |
13 | Byte | End of MATERIAL Struct | Always $94 |
POLY Struct
A byte indicating the number of strips to load, a byte indicating the direction to read the strips in, followed by an array of shorts indicating which vertices to use.
VColor Struct
An array of BGRA colors for each vertex in the strip.
UV Struct
An array of two shorts representing the U and V coordinates for each vertex in the strip.
MESH Struct
The game loads as many of these structs as indicated in the attach struct. The format is as follows.
offset | Type | Description | Notes |
---|---|---|---|
0 | Byte | Material ID | |
1 | Byte | Poly Type | $00 = Triangles, $40 = Quads, $C0 = Strips |
2 | Short | Poly Total | This is how many strips to load |
4 | Pointer | Polys | Read notes on poly data |
8 | Padding (0x8) | PNormal and Pattr | Unused by sadx, but are part of official sega model format |
10 | Pointer | Vertex Colors | |
14 | Pointer | UV Coordinates |
VERTEX Struct
A Float[3] for each vertex, times the total specified in the ATTACH Struct.
ATTACH Struct
Offset | Type | Description | Notes |
---|---|---|---|
0 | Pointer | Vertices | |
4 | Pointer | Normals | If this is null, the model doesn't use normals. |
8 | 4 Bytes | Vertex/Normal Total | |
C | Pointer | Meshes | |
10 | Pointer | Materials | |
14 | 2 Bytes | Mesh Total | |
16 | 2 Bytes | Material Total | |
18 | Float[3] | Center | |
24 | Float | Radius | |
28 | 4 Bytes | Null |
OBJECT Struct
Offset | Type | Description | Notes |
---|---|---|---|
0 | 4 Bytes | Flags | ??? |
4 | Pointer | Attach | |
8 | Float[3] | Position | |
14 | 4 Bytes[3] | Rotation | only read first 2 bytes of each |
20 | Float[3] | Scale | |
30 | Pointer | OBJECT Child | |
34 | Pointer | OBJECT Relate |
Animation Locations
CHRMODELS.DLL
Sonic
Address | Description |
---|---|
59F424 | Metal Sonic's Hover |
5C310C | Standing |
5D9674 | Spin |
Super Sonic | |
638ECC | Super Sonic Standing |
Animation Format
The format starts with two pointers, the first pointing to the model to use and the second pointing to the next section of the animation data.
The next section starts with a pointer to the data for each model piece followed by a 4 Byte total frame count, then two 2 byte values whose purpose is unknown.
The next section contains 0x10 bytes for each model piece.
Offset | Type | Description |
---|---|---|
0 | Pointer | Position Data |
4 | 4 Bytes | Position Data frame count |
8 | Pointer | Rotation Data |
C | 4 Bytes | Rotation Data frame count |
The position data contains 3 Float values for each frame, and the rotation data contains 3 4 Byte BAMS values for each frame. Frames that have no data will move at the same speed and direction as the previous frame.