Difference between revisions of "Sonic Heroes/EXE Editing"
From Sonic Retro
(→EXE defined particle settings) |
(→EXE defined particle settings) |
||
Line 248: | Line 248: | ||
==EXE defined particle settings== | ==EXE defined particle settings== | ||
− | + | Almost all particles are usually stored in the *_ptcl.bin, but a few particle settings for other particles are only in the EXE where they are stored beyond 0x4DB60C. Each array entry is 0x18 bytes long as it follows this:<br> | |
<br> | <br> | ||
{{Grey|00 00 00 00}} {{red|48 6E 7C}} {{Grey|00 00 00 00 00}} {{Yellow|12}} {{Orange|01}} {{Grey|00 00}} {{Orange|0C}} {{Grey|00 00 00}} {{cyan|FF FF FF FF}} | {{Grey|00 00 00 00}} {{red|48 6E 7C}} {{Grey|00 00 00 00 00}} {{Yellow|12}} {{Orange|01}} {{Grey|00 00}} {{Orange|0C}} {{Grey|00 00 00}} {{cyan|FF FF FF FF}} |
Revision as of 03:43, 18 February 2017
SCHG: Sonic Heroes |
---|
Main Article |
Mechanic Editing |
DOL Editing |
Model Editing |
Collision Format Model Format |
Level Editing |
Camera Editing |
Particle Editing |
Particle Editing |
Sound Editing |
Music List |
SCHG How-Tos |
Custom Object Material Effect Tutorial |
The main EXE of the PC game is Tsonic_win.exe. The EXE is little endian. The pointer key is 0x400000; to find where a pointer points to, you must subtract that from its value.
Contents
Start/End Positions
Start Positions
List of single player start positions begins at 0x3C2FC8. Each level array has the first 4 bytes setting the level number at the first byte and five 0x1C entries for the four teams and Super Hard (although the Super Hard entry seems to be ignored, it uses Team Sonic's instead). Note that the level IDs used are not the same ones as the level and object lists, they are the ones used in RAM, for example Seaside Hill is 02
Start position entry:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Float | X Position |
0x04 | Float | Y Position |
0x08 | Float | Z Position |
0x0C | Word | Pitch (direction) |
0x14 | Byte | Mode 00: Normal 01: Running 02: Rail |
0x18 | Word | Hold time Time spent running |
Ending Positions
List of ending positions begins at 0x3C45B8. These are the places where each team does their victory animation and the results are displayed, after the mission is finished. Each level array has the first 4 bytes setting the level number at the first byte and five 0x14 entries for the four teams and Super Hard. This section has data for single player and multiplayer modes.
End position entry:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Float | X Position |
0x04 | Float | Y Position |
0x08 | Float | Z Position |
0x0C | Word | Camera pitch Angle from which the characters are seen |
0x0E | Word | ? (Always FF FF) |
0x10 | Long | Null |
Multiplayer Positions
List of multiplayer start positions begins at 0x3C5E18, after the ending positions. This section has data for the Team Battles and each multiplayer level. The entries are the same as single player start positions, but only have two position entries instead of 5, for the first and second players.
List of multiplayer "bragging" positions begins at 0x3C6380, after the multiplayer start positions. These are the positions where each team makes a comment to the other one, before the multiplayer match starts. This section only has data for each multiplayer level, not the Team Battles. The entries follow the same format as single player ending positions, with five entries.
Splines (incomplete)
Splines set path data for autoloops, rails and probably other path data. The arrays for each level are located in various different places in the EXE. What is known is that each level has a list of pointers. Each pointer points to a spline header, which is defined below. Each spline header points to its list of vertices.
A search reveals there are apparently 62 autoloops and 1075 rails in the entire game. It's possible that some paths are made of multiple splines though.
Grand Metropolis pointer list starts at 0x4B5B60. There are 12 pointers in it. It's not known what points to this list yet. The headers for the splines themselves are just before this pointer list.
Header entry:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Word | Always 01 00 |
0x02 | Word | Number of vertices |
0x04 | Float | Total length of spline |
0x08 | Pointer (Long) | Pointer to first vertex of spline |
0x0C | Pointer (Long) | Type of spline 0x433970 (Autoloop) 0x4343F0 (Rail) |
Point entry:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Long | Unknown flags (speed?) |
0x04 | Float | Distance to next point Last one is 0 |
0x08 | Float | X Position |
0x0C | Float | Y Position |
0x10 | Float | Z Position |
Tutorial Mode Team Defaults
Team Sonic is the default team used for the tutorial mode, but using another team for the tutorial mode requires the following codes to be replaced by the values.
Address (EXE) | Address (RAM) | Original Bytes | Replace With |
---|---|---|---|
50383 | 450383 | 89 1D 20 69 8D 00 | EB 5F 90 90 90 90 |
503E4 | 4503E4 | CC CC CC CC CC CC CC CC CC CC CC CC | C7 05 20 69 8D 00 00 00 00 00 EB 99 |
Once you have replaced the bytes, the
C7 05 20 69 8D 00 00 00 00 00 EB 99
Offset | Type | Description |
---|---|---|
0x06 | Byte | Team ID |
Replace the 6th byte with the following IDs to use for the tutorial stage.
ID | Team |
---|---|
00 | Team Sonic |
01 | Team Dark |
02 | Team Rose |
03 | Team Chaotix |
Field of view
The EXE provides perspective views using FOV for each type of camera in every mode. This list shows where the FOV codes are located in.
Address (EXE) | Address (RAM) | Type | FOV Type | Default (hex) | Default (dec.) | FOV Change | Notes/Warnings |
---|---|---|---|---|---|---|---|
21E5AC | 61E5AC | Float | In-game Aspect Ratio | 43961D3F | 0.615574 | Horizontal | Not used. |
21E5B8 | 61E5B8 | Float | In-game Aspect Ratio | 0000803E | 0.25 | Vertical | Same as above. |
21E5CE | 61E5CE | Float | In-game Aspect Ratio | 43969D3E | 0.307787 | Horizontal | |
21E5DA | 61E5DA | Float | In-game Aspect Ratio | 43961D3F | 0.615574 | Horizontal | If the float value is higher and being used in 2 Player battle, the camera will zoom in. |
21E5E4 | 61E5E4 | Float | In-game Aspect Ratio | 0000003F | 0.5 | Vertical | Same as above. |
25811A | 65811A | Float | Global FOV | 0000803F | 1 | Tied | Values lower than 3F800000 will decrease the plane clipping resulting an un-viewable state. The higher the FOV is, the more fog is introduced. |
EXE defined particle settings
Almost all particles are usually stored in the *_ptcl.bin, but a few particle settings for other particles are only in the EXE where they are stored beyond 0x4DB60C. Each array entry is 0x18 bytes long as it follows this:
00 00 00 00 48 6E 7C 00 00 00 00 00 12 01 00 00 0C 00 00 00 FF FF FF FF
Offset(s) | Type | Description | Notes |
---|---|---|---|
0x04 | 4 Bytes | Address? | Some offsets do not have this |
0x0C | Byte | Blend Mode | |
0x0D and 0x10 | Byte | Unknown | |
0x14 | 4 Bytes | Always FF FF FF FF |
The alpha blend types used for the particles such as the ones for the Hint Ring are logical bytes. A list of blend types are defined by the source code:
Bytes | Description |
---|---|
01 | Normal Alpha |
02 | Additive Alpha |
04 | Subtractive Alpha |
11 | Normal Alpha (Hint Ring) |
12 | Additive Alpha (Hint Ring) |
14 | Subtractive Alpha (Hint Ring) |
The following particle setting entries for each EXE generated particles used in the EXE are stored in the following addresses:
Particle | Address (EXE) | Address (RAM) | Default Value (0x0C) |
---|---|---|---|
Hint Ring Circles (Subtractive Layer) | 4DB60C | 8DB60C | 14 |
Hint Ring Circles (Additive Layer) | 4DB624 | 8DB624 | 12 |
Rain Drips | 4DB648 | 8DB648 | 02 |
Sparkles | 4DB660 | 8DB660 | 02 |
Super Hard Challenge
Default Teams
The team that is always loaded on Super Hard is Team Sonic, but it can be rearranged thanks to the guide of the said subject on wikiHow. To achieve whatever team you want to use for the mode, replace the following bytes with these as shown on the table below:
Address (EXE) | Address (RAM) | Original Bytes | Replace With |
---|---|---|---|
502D9 | 4502D9 | 89 1D 20 69 8D 00 | B3 00 EB 0B 90 90 |
502E8 | 4502E8 | 8D A4 24 00 00 00 00 90 | 89 1D 20 69 8D 00 EB EF |
After doing that, there should be one byte after B3 that can be replaceable with a team ID at 0x502D9:
B3 00 EB 0B 90 90
Offset | Type | Description |
---|---|---|
0x01 | Byte | Team ID |
The default value is 00 which loads Team Sonic by default. Replace the second byte with one of the IDs below to use a different team for Super Hard:
ID | Team |
---|---|
00 | Team Sonic |
01 | Team Dark |
02 | Team Rose |
03 | Team Chaotix |
Notes: There are certain parts of each level that requires Light Dash abilities for both "Espio" and "Amy" and Triangle Jump for "Amy" to be enabled and used before using teams "Rose" and "Chaotix". Refer to this hacking guide on how to enable these movesets for the two characters in wikiHow if needed. As for Team Chaotix, some levels have tasks that are not possible to achieve in-order to beat the level. It will use the same object layout as always regardless of any team loaded and they will use their own start and end positions the same way as the regular modes.
Mode Level list
A list of level ID numbers that are loaded when using Super Hard mode starts at 0x34F1F4 and ends at 0x34F22C. Each array of the section is in 4 Bytes and the first byte of it is the level ID. When used, the game will load the levels listed in the section of the EXE for the mode.
Super Hard Level ID Entry:
00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Byte | Level ID |
A list of default levels on Super Hard are in the following offsets set in the exe. Refer to the section "EXE and RAM" in the List of Levels for a list of level ID numbers you want to replace the default hex value with. Remember that you must convert the level ID from a decimal to a hexadecimal byte to apply the level you want the game to use when it reads the level ID on the list. Also, only 1 Player levels will work after loading, 2 Player stage IDs will crash the game.
Address (EXE) | Address (RAM) | Default Byte | Default Level |
---|---|---|---|
34F1F4 | 74F1F4 | 02 | Seaside Hill |
34F1F8 | 74F1F8 | 03 | Ocean Palace |
34F1FC | 74F1FC | 04 | Grand Metropolis |
34F200 | 74F200 | 05 | Power Plant |
34F204 | 74F204 | 06 | Casino Park |
34F208 | 74F208 | 07 | BINGO Highway |
34F20C | 74F20C | 08 | Rail Canyon |
34F210 | 74F210 | 09 | Bullet Station |
34F214 | 74F214 | 0A | Frog Forest |
34F218 | 74F218 | 0B | Lost Jungle |
34F21C | 74F21C | 0C | Hang Castle |
34F220 | 74F220 | 0D | Mystic Mansion |
34F224 | 74F224 | 0E | Egg Fleet |
34F228 | 74F228 | 0F | Final Fortress |
Material Functions
Colors
The EXE provides color effects for certain objects such as the trail and tornado effects for each player.
Color RGB Entry:
00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Byte | Red |
0x01 | Byte | Green |
0x02 | Byte | Blue |
0x03 | Byte | Alpha |
Custom RGB color codes can be generated using color wheel websites like Colblinder and Colorizer. If you're happy with the color you want to use for the effects, paste write it on the offset where you found the color code at.
Character Effects
This list shows the codes to the character effects that were found in the EXE.
Character | Effect Type | Address (EXE) | Address (RAM) | Default Hex |
---|---|---|---|---|
Amy | Trails | 4CF6AC | 8CF6AC | 7F0030FF |
Big | Trails | 4CF6B0 | 8CF6B0 | 40007FFF |
Charmy | Trails | 4CF6C0 | 8CF6C0 | 7F0000FF |
Cream | Trails | 4CF6B4 | 8CF6B4 | 7F4630FF |
Espio | Trails | 4CF6B8 | 8CF6B8 | 00507FFF |
Knuckles | Trails | 4CF698 | 8CF698 | 780C1EFF |
Omega | Trails | 4CF6A4 | 8CF6A4 | 30007FFF |
Rouge | Trails | 4CF6A8 | 8CF6A8 | 7F007FFF |
Shadow | Trails | 4CF6A0 | 8CF6A0 | 7F4000FF |
Sonic | Jump Balls | 4C729C | 8C729C | 005AAAFF |
Sonic | Trails | 4CF694 | 8CF694 | 002D55FF |
Tails | Trails | 4CF69C | 8CF69C | 7D520CFF |
Vector | Trails | 4CF6BC | 8CF6BC | 005000FF |
Material Opcodes
A number of code sections contain additional material/graphic codes that are rendered via Renderware engine that provides special effects to an object such as Espio's invisibility and Thundershoot electricity effects.
Function entry:
Regular Material function:
6A 00 6A 00
Offset | Type | Description |
---|---|---|
0x00 and 0x02 | Byte | Always 6A |
0x01 | Byte | Material value |
0x03 | Byte | Material function type |
4 Byte Material function:
68 00000000
Offset | Type | Description |
---|---|---|
0x00 | Byte | Always 68 |
0x01 | 4 Bytes | Material value |
A list of material types are implemented in the EXE.
Material type parameters | Alternative Material type parameters | Hexadecimal type | Description | Parameters | Call Address | Alternative Call Address | Example(s) | Notes |
---|---|---|---|---|---|---|---|---|
01 | Byte | Null | 00 | 0024C9B0 (EXE) 0064C9B0 (RAM) |
6A 00 6A 01 | Values upon "00" will crash the game. | ||
06 | 07 | Byte | Z-buffer testing | 00 = Disabled 01 = Enabled |
0024C9B0 (EXE) 0064C9B0 (RAM) |
00247980 (EXE) 00647980 (RAM) |
6A 00 6A 06 6A 00 6A 07 |
|
07 | Byte | Shading | 00 = rwSHADEMODEFLAT 01 = rwSHADEMODEGOURAUD |
0024C9B0 (EXE) 0064C9B0 (RAM) |
6A 02 6A 07 | |||
08 | 0E | Byte | Z-buffer writing | 00 = Disabled 01 = Enabled |
0024C9B0 (EXE) 0064C9B0 (RAM) |
00247980 (EXE) 00647980 (RAM) |
6A 01 6A 08 6A 01 6A 0E |
|
09 | Byte | Texture filtering | 01 = rwFILTERNEAREST 02 = rwFILTERLINEAR 03 = rwFILTERMIPNEAREST 04 = rwFILTERMIPLINEAR 05 = rwFILTERLINEARMIPNEAREST 06 = rwFILTERLINEARMIPLINEAR |
0024C9B0 (EXE) 0064C9B0 (RAM) |
6A 02 6A 09 | |||
0A & 0B | 13 & 14 | Byte | Source Blend Destination Blend |
01 = rwBLENDZERO 02 = rwBLENDONE 03 = rwBLENDSRCCOLOR 04 = rwBLENDINVSRCCOLOR 05 = rwBLENDSRCALPHA 06 = rwBLENDINVSRCALPHA 07 = rwBLENDDESTALPHA 08 = rwBLENDINVDESTALPHA 09 = rwBLENDDESTCOLOR 0A = rwBLENDINVDESTCOLOR 0B = rwBLENDSRCALPHASAT |
0024C9B0 (EXE) 0064C9B0 (RAM) |
00247980 (EXE) 00647980 (RAM) |
6A 05 6A 0A 6A 06 6A 0B 6A 05 6A 13 6A 06 6A 14 |
Models that are completely opaque will not be able to use the intended blend factors. To make any model use different alpha blending modes, change the byte in offset 0x248B1C from 74 to EB. |
0C | 1B | Byte | Vertex Alpha Enabling | 00 = Disabled 01 = Enabled |
0024C9B0 (EXE) 0064C9B0 (RAM) |
00247980 (EXE) 00647980 (RAM) |
6A 01 6A 0C | |
0E | Byte | Fog | 00 = Disabled 01 = Enabled |
0024C9B0 (EXE) 0064C9B0 (RAM) |
6A 00 6A 0E | |||
14 | 16 | Byte | Cull Mode | 01 = None 02 = Back 03 = Front |
0024C9B0 (EXE) 0064C9B0 (RAM) |
00247980 (EXE) 00647980 (RAM) |
6A 02 6A 14 6A 02 6A 16 |
|
18 | Byte | Alpha Testing Reference | 4 Byte Range: 00000000-FF000000 | 00247980 (EXE) 00647980 (RAM) |
68 C8000000 6A 18 | |||
19 | Byte | Alpha Testing | 01 = rwALPHATESTFUNCTIONNEVER 02 = rwALPHATESTFUNCTIONLESS 03 = rwALPHATESTFUNCTIONEQUAL 04 = rwALPHATESTFUNCTIONLESSEQUAL 05 = rwALPHATESTFUNCTIONGREATER 06 = rwALPHATESTFUNCTIONNOTEQUAL 07 = rwALPHATESTFUNCTIONGREATEREQUAL 08 = rwALPHATESTFUNCTIONALWAYS |
00247980 (EXE) 00647980 (RAM) |
6A 08 6A 19 | |||
AB000000 | 4 Bytes | Blend Equation | 01 = Add 02 = Subtract 03 = Reverse Subtract 04 = Min 05 = Max |
00247980 (EXE) 00647980 (RAM) |
6A 01 68 AB000000 |
Known Offsets
A list shows offsets for special material effects that were discovered in the EXE.
Addresses (EXE) | Addresses (RAM) | Materials | Default Parameter Values | Targeting Object | Notes |
---|---|---|---|---|---|
5D86 5D8F 5D98 5DA1 5DAA 5DB6 5DBF 5DC8 5DD1 5DDA 5DE3 5DEC |
405D86 405D8F 405D98 405DA1 405DAA 405DB6 405DBF 405DC8 405DD1 405DDA 405DE3 405DEC |
Z-writing Z-testing Shade Mode Texture Filtering Vertex Alpha Enabling Culling Unknown Material Unknown Material Fog Enabling Source Blend Destination Blend Null Material |
00 00 02 02 01 01 03 03 00 05 06 00 |
Black Screen Fade | |
1B838 1B844 1B84D 1B856 1B86D 1B878 1B881 |
41B838 41B844 41B84D 41B856 41B86D 41B878 41B881 |
Z-testing Z-writing Fog Enabling Culling Source Blend Destination Blend #1 Destination Blend #2 |
00 01 00 01 02 06 02 |
Screen Transition Effects | |
1BA94 1BA9E 1BAA9 1BAB3 1BACC 1BAD5 1BAD9 1BAE3 |
41BA94 41BA9E 41BAA9 41BAB3 41BACC 41BAD5 41BAD9 41BAE3 |
Z-testing Z-writing Fog Enabling Culling Source Blend #1 Destination Blend #1 Source Blend #2 Destination Blend #2 |
00 00 00 01 02 06 05 02 |
Warp Effects | The first two blend factor codes in offsets 1BACC (41BACC) and 1BAD5 (41BAD5) are for the blue switch effect that engulfs if the orb switch has been triggered. The other two are for the common warp effects. |
1E0A1 1E0AD 1E0B6 1E0BF 1E0C8 1E0D1 1E0DA 1E0E3 1E0EC 1E0F8 |
41E0A1 41E0AD 41E0B6 41E0BF 41E0C8 41E0D1 41E0DA 41E0E3 41E0EC 41E0F8 |
Z-testing Z-writing Fog Enabling Culling Vertex Alpha Enabling Source Blend Destination Blend Null Material Shade Mode Texture Filtering |
00 01 00 01 01 05 06 00 02 02 |
In-game HUD interface | |
1EAA9 1EAA9 |
41EAA9 41EAA9 |
Source Blend Destination Blend |
05 02 |
Key Sparkle Effect on HUD | |
22BA9 22BB2 22BBB 22BC4 22BE8 22BF1 22C06 22C1B |
422BA9 422BB2 422BBB 422BC4 422BE8 422BF1 422C06 422C1B |
Z-testing Z-writing Fog Enabling Culling Source Blend Destination Blend Unknown Material Texture Filtering |
01 01 00 01 05 06 03 02 |
2 Player Race HUD interface | |
2478F 247B0 247BC 2481E 24827 24830 |
42478F 4247B0 4247BC 42481E 424827 424830 |
Culling Unknown Material Vertex Alpha Enabling Source Blend Destination Blend Texture Filtering |
01 03 01 05 04 02 |
General Subtitles | |
247C5 247CE |
4247C5 4247CE |
Source Blend Destination Blend |
01 04 |
General Subtitle Drop Shadow | |
3131E 3132E 31381 313A9 313B9 2A4362 |
43131E 43132E 431381 4313A9 4313B9 6A4362 |
Source Blend #1 Destination Blend #1 Destination Blend #2 Source Blend #2 Destination Blend #3 Vertex Alpha Enabling |
05 02 04 05 06 01 |
Particle Effects | |
38AB7 38AF0 38AF9 38B05 38B0E 38B2F 38B38 38B55 |
438AB7 438AF0 438AF9 438B05 438B0E 438B2F 438B38 438B55 |
Vertex Alpha Enabling Z-testing Z-writing Fog Enabling Culling Source Blend Destination Blend Null Material |
01 00 01 00 01 05 06 00 |
Results Screen | |
4CA25 4CA2E 4CA37 4CA40 4CA49 4CA55 4CA5E 4CA67 4CA70 4CA79 4CA82 4CA8B |
44CA25 44CA2E 44CA37 44CA40 44CA49 44CA55 44CA5E 44CA67 44CA70 44CA79 44CA82 44CA8B |
Z-writing Z-testing Shade Mode Texture Filtering Vertex Alpha Enabling Culling Unknown Material Unknown Material Fog Enabling Source Blend Destination Blend Null Material |
00 00 02 02 01 01 03 03 00 05 06 00 |
Menu Interface | |
4EB79 4EB82 4EB8B 4EB94 4EB9D 4EBA9 4EBB2 4EBBB 4EBC4 4EBCD 4EBD6 |
44EB79 44EB82 44EB8B 44EB94 44EB9D 44EBA9 44EBB2 44EBBB 44EBC4 44EBCD 44EBD6 |
Z-writing Z-testing Shade Mode Texture Filtering Vertex Alpha Enabling Culling Unknown Material Unknown Material Fog Enabling Source Blend Destination Blend |
00 00 02 02 01 01 03 03 00 05 06 |
Now Loading text | |
5A007 5A010 5A019 5A022 |
45A007 45A010 45A019 45A022 |
Source Blend Destination Blend Culling Fog |
05 02 01 00 |
Triple Spring Rays | |
5EBC8 | 45EBC8 | Culling | 01 | Bobsled Player Marker | Displayed in 2 Player Bobsled Race. |
653A5 653AE 653B7 |
4653A5 4653AE 4653B7 |
Source Blend Destination Blend Culling |
02 02 01 |
Mystic Mansion Trolley Lights | |
6C369 6C372 6C37B 6C384 |
46C369 46C372 46C37B 46C384 |
Source Blend Destination Blend Culling Fog |
05 02 01 00 |
Checkpoint Rays | |
720A1 720AA 720B3 |
4720A1 4720AA 4720B3 |
Source Blend Destination Blend Culling |
05 02 01 |
Flower Rays | |
76404 7640D 76416 |
476404 47640D 476416 |
Source Blend Destination Blend Culling |
02 06 01 |
Hint Ring Question Mark | |
78361 7836A 78373 7838B |
478361 47836A 478373 47838B |
Source Blend Destination Blend Culling #1 Culling #2 |
05 06 03 02 |
Popped Item Balloon | |
7C04C 7C055 7C05E |
47C04C 47C055 47C05E |
Source Blend Destination Blend Fog Enabling |
02 02 00 |
Lasers | |
8AC09 8AC12 8AC1B |
48AC09 48AC12 48AC1B |
Source Blend Destination Blend Culling |
05 02 01 |
Target Switch Fade | |
8F265 8F26E 8F277 8F280 8F289 8F29C 8F2A5 |
48F265 48F26E 48F277 48F280 48F289 48F29C 48F2A5 |
Vertex Alpha Enabling Fog Enabling Z-writing Source Blend #1 Destination Blend #1 Source Blend #2 Destination Blend #2 |
01 00 00 05 02 05 06 |
Lens Flares | |
928CD 928D6 92906 9290F 9292A 92962 9296B |
4928CD 4928D6 492906 49290F 49292A 492962 49296B |
Culling Unknown Material Z-testing Z-writing Vertex Alpha Enabling Source Blend Destination Blend |
01 03 00 01 01 05 04 |
In-game Scene Subtitles | |
92918 92921 |
492918 492921 |
Source Blend Destination Blend |
01 04 |
In-game Scene Subtitle Drop Shadow | |
9656C 96575 |
49656C 496575 |
Source Blend Destination Blend |
05 02 |
Hermit Crab Fade | |
B394F | 4B394F | Fog Enabling | 00 | Power Plant Sky | |
B3A5F | 4B3A5F | Fog Enabling | 00 | Power Plant Clouds | |
C516C C5175 |
4C516C 4C5175 |
Source Blend Destination Blend |
05 02 |
Casino Chip Fade | |
C3D66 C3D6F C3D7B C3D84 C3D8D C3D96 |
4C3D66 4C3D6F 4C3D7B 4C3D84 4C3D8D 4C3D96 |
Z-writing Z-testing Shade Mode Texture filtering Vertex Alpha Enabling Culling |
00 00 02 02 01 01 |
Casino Slot Interface | |
EDAF0 EDAF9 EDB02 EDB0E EDB17 EDB43 EDB4C EDB9D EDBA6 EDBB4 |
4EDAF0 4EDAF9 4EDB02 4EDB0E 4EDB17 4EDB43 4EDB4C 4EDB9D 4EDBA6 4EDBB4 |
Z-testing Z-writing Fog Enabling Culling Vertex Alpha Blending Source Blend #1 Destination Blend #1 Source Blend #2 Destination Blend #2 Null Material |
00 00 00 01 01 05 06 08 09 00 |
Frog Rain Screen Effect | Two blend factor codes in offsets EDB43 (4EDB43) and EDB4C (4EDB4C) are for the Light Rain screen by the Green Frog and the other two blend factor codes in offsets EDB9D (4EDB9D) and EDBA6 (4EDBA6) are for the Dark Rain screen by the Black Frog. |
F9A6C F9A75 F9A7E |
4F9A6C 4F9A75 4F9A7E |
Source Blend Destination Blend Culling |
02 02 01 |
Torch Fire | |
FE89A FE8A3 |
4FE89A 4FE8A3 |
Source Blend Destination Blend |
05 02 |
Hang Castle Key Fade | |
FEE13 FEE1C FEE25 |
4FEE13 4FEE1C 4FEE25 |
Source Blend Destination Blend Culling |
02 02 01 |
Mystic Mansion Lights | |
FBC5A FBC63 |
4FBC5A 4FBC63 |
Source Blend Destination Blend |
05 06 |
Pumpkin Ghost Fade Effect | |
FBDBC FBDC5 FBDCE |
4FBDBC 4FBDC5 4FBDCE |
Source Blend Destination Blend Culling |
02 02 01 |
Pumpkin Ghost Light | |
101338 101341 10134A |
501338 501341 50134A |
Source Blend Destination Blend Culling |
02 02 01 |
Hang Castle Spider Lights | |
103401 103409 103412 |
503401 503409 503412 |
Source Blend Destination Blend Culling |
02 02 01 |
Teleporter Switch Glowing Symbols | |
107BE4 107BED 107BF6 |
507BE4 507BED 507BF6 |
Source Blend Destination Blend Culling |
05 02 01 |
Thunder lightening with skulls | |
176DD0 | 576DD0 | Fog Enabling | 00 | Grand Metropolis Clouds | Does not affect the clouds used in battle stages. |
188F4A 188F53 188F5C 188F65 |
588F4A 588F53 588F5C 588F65 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Chaotix Recital Lights | |
1D2B99 1D2BA2 1D2BAE 1D2BB7 1D2BC0 |
5D2B99 5D2BA2 5D2BAE 5D2BB7 5D2BC0 |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 02 01 00 |
Espio's Invisibility | |
1D2E3A 1D2E43 1D2E4C 1D2E58 1D2E61 |
5D2E3A 5D2E43 5D2E4C 5D2E58 5D2E61 |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 03 01 00 |
Super Sonic Glowing Effect | |
1D2EC5 1D2ECE 1D2ED7 1D2EE0 |
5D2EC5 5D2ECE 5D2ED7 5D2EE0 |
Source Blend Destination Blend Culling Vertex Alpha Enabling |
05 06 01 01 |
Super Sonic Power Team Blast | |
1D3126 | 5D3126 | Destination Blend | 02 | Super Sonic Power Team Blast Symbol Effect | |
1DCD3F 1DCD48 1DCD51 1DCD5F |
5DCD3F 5DCD48 5DCD51 5DCD5F |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot Enemy Stun Effect | |
1DDD9E 1DDDA7 1DDDB0 |
5DDD9E 5DDDA7 5DDDB0 |
Source Blend Destination Blend Culling |
05 02 01 |
Turtle Shoot Cannon Effect | |
22FA88 22FA91 22FA9A 22FAA6 22FAAF |
62FA88 62FA91 62FA9A 62FAA6 62FAAF |
Source Blend Destination Blend Culling Fog Vertex Alpha Enabling |
05 02 01 00 01 |
Character Jump Effects | |
231CC4 231CCD 231CD6 231CE2 231CEB |
631CC4 631CCD 631CD6 631CE2 631CEB |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 01 01 00 |
Quick Ascent Effect | |
2343F8 234401 23440A 234413 234437 23443B |
6343F8 634401 63440A 634413 634437 63443B |
Source Blend Destination Blend Culling Fog Enabling Z-testing #1 Z-testing #2 |
05 02 01 00 01 00 |
Colored Rocket Accel Effect | |
2387B4 2387BD 2387C6 2387CF |
6387B4 6387BD 6387C6 6387CF |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Light Streak Effects | |
2396AD 2396B6 2396BF 2396CB 2396D4 2396DD |
6396AD 6396B6 6396BF 6396CB 6396D4 6396DD |
Source Blend Destination Blend Culling Null Material Vertex Alpha Enabling Fog Enabling |
05 02 01 00 01 00 |
Character Trail Effects | |
23A9AB 23A9B4 23A9BD |
63A9AB 63A9B4 63A9BD |
Source Blend Destination Blend Culling |
05 02 01 |
Rainbow Rocket Accel Effect | |
23B763 23B76E 23B777 23B780 23B795 23B79E |
63B763 63B76E 63B777 63B780 63B795 63B79E |
Vertex Alpha Enabling Source Blend #1 Destination Blend #1 Blend Equation Source Blend #2 Destination Blend #2 |
01 05 02 03 01 04 |
Shadows for Objects | |
23D968 23D971 23D97A 23D983 |
63D968 63D971 63D97A 63D983 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot | |
23DE45 23DE4E 23DE57 23DE60 |
63DE45 63DE4E 63DE57 63DE60 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot Pipes | |
23E383 23E38C 23E395 62E3A1 23E3AA |
63E383 63E38C 63E395 63E3A1 63E3AA |
Source Blend Destination Blend Culling Unknown Material Fog Enabling |
05 02 01 02 00 |
Thundershoot Ring Collect Planes | |
23FE8B 23FF6C 23FF7E 23FF8A |
63FE8B 63FF6C 63FF7E 63FF8A |
Vertex Alpha Enabling Source Blend Destination Blend Culling Fog Enabling |
01 05 02 01 00 |
Colored Tornado Effect | |
23FEC5 23FEDA 23FEE3 23FEEC 23FEFD 23FF06 |
63FEC5 63FEDA 63FEE3 63FEEC 63FEFD 63FF06 |
Vertex Alpha Enabling Source Blend #1 Destination Blend #1 Blend Equation Source Blend #2 Destination Blend #2 |
01 05 02 03 01 04 |
Dark Tornado Effect | Used if the color of the tornado is colored black. Also, the blend factors below the jump opcode after the blend equation code are not used. |
245414 24543B 245488 245491 |
645414 64543B 645488 645491 |
Culling Vertex Alpha Enabling Source Blend Destination Blend |
01 01 05 04 |
FMV Subtitles | |
245429 245432 |
645429 645432 |
Source Blend Destination Blend |
01 04 |
FMV Subtitle Drop Shadow |
Material Flags
Somewhat like BSPs with identifiers stored in .ONE files, objects have their own material flags stored in the code. Objects that use material flags provide a rendering effect through the main rendering code sections when applied to an object after it appears. Examples of objects that use material flags are Energy paths and HEXAeco Signboards. Note that not all objects use material flags separately for each model loaded in the level. Unlike the opcodes that provide the graphic appearance for the object in their code sections, the modified flags require moving away from the object until it disappears or by quiting the level and returning in-order to take effect.
Flag offset pointer entry:
00 72 00 00
Offset | Type | Description |
---|---|---|
0x00 | Byte | Pointer flag |
0x01 | 3 bytes | Always 72 00 00 |
Flag entry:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | 4 Bytes | Usually model pointer |
0x04 | 4 Bytes | Pointer Sometimes uses the address for loaded models. |
0x09 | Byte | Flag |
Examples:
68 DA 77 00 00 00 00 00 14 00 00 00 00 00 00 00
D0 F8 76 00 28 3D A2 00 14 00 00 00 00 00 00 00
A list of identifier flags for objects are the following pointer and regular bytes:
Flag pointer:
Flag | Identifier | Description | Notes |
---|---|---|---|
54 | ?? | Invisible geometry | Usually used if the object set has individual material flags stored somewhere in the EXE and RAM or loads them for rendering the geometry. |
58 | DN | Sky model material | |
5C | O | Reflective material | |
60 | OS | Reflective floor material | |
64 | ON | Regular material | |
68 | ONS | Regular floor material | |
6C | ONW | Regular material without culling | |
70 | ONWS | Regular floor material without culling | |
74 | P | Alpha testing with reflective material | |
78 | PS | Alpha testing with reflective floor material | |
7C | PN | Alpha testing material | |
80 | PNS | Alpha testing floor material | |
84 | PNW | Alpha testing material without culling | |
88 | PNWS | Alpha testing floor material without culling | |
8C | DA | Alpha sky material | |
90 | AF | Alpha reflective material | |
94 | AFS | Alpha reflective floor material | |
98 | AFN | Alpha material | |
9C | AFNS | Alpha floor material | |
A0 | K | Additive alpha material | |
A4 | KW | Additive alpha material without culling | |
A8 | A | Alpha reflective material | |
AC | AS | Alpha reflective floor material | |
B0 | AN | Alpha material | |
B4 | ANS | Alpha floor material |
Individual flag ids:
Flag | Identifier | Description | Notes |
---|---|---|---|
00 | ?? | Usually used if the object set has individual material flags stored somewhere in the EXE and RAM. | |
01 | DN | Sky model material | |
02 | O | Reflective material | |
03 | OS | Reflective floor material | |
04 | ON | Regular material | |
05 | ONS | Regular floor material | |
06 | ONW | Regular material without culling | |
07 | ONWS | Regular floor material without culling | |
08 | P | Alpha testing with reflective material | |
09 | PS | Alpha testing with reflective floor material | |
0A | PN | Alpha testing material | |
0B | PNS | Alpha testing floor material | |
0C | PNW | Alpha testing material without culling | |
0D | PNWS | Alpha testing floor material without culling | |
0E | DA | Alpha sky material | |
0F | AF | Alpha reflective material | |
10 | AFS | Alpha reflective floor material | |
11 | AFN | Alpha material | |
12 | AFNS | Alpha floor material | |
13 | K | Additive alpha material | |
14 | KW | Additive alpha material without culling | |
15 | A | Alpha reflective material | |
16 | AS | Alpha reflective floor material | |
17 | AN | Alpha material | |
18 | ANS | Alpha floor material |
Known Offsets
A list below shows offsets found so far in the EXE for certain parts of the codes that apply material flags to objects.
Object | Addresses (EXE) | Addresses (RAM) | Models | Default byte values | Flag Type(s) | Notes |
---|---|---|---|---|---|---|
Arrow Light Sign Pads | 000B0659 000B0AB8 |
004B0659 004B0AB8 |
Pad Arrow Light |
64 A0 |
72 Pointer | |
Ball Bumpers | 3EB3F4 | 7EB3F4 | Green Star Balls | 04 | Byte ID | |
Barrier | 001822CF | 005822CF | Barrier Effect | A4 | 72 Pointer | |
Bingo Number Chips | 003F1228 003F1238 003F1248 003F1258 003F1268 003F1278 003F1288 003F1298 003F12A8 003F12B8 003F12C8 003F12D8 003F12E8 007F12F8 003F1308 003F1318 003F1328 003F1338 003F1348 |
007F1228 007F1238 007F1248 007F1258 007F1268 007F1278 007F1288 007F1298 007F12A8 007F12B8 007F12C8 007F12D8 007F12E8 007F12F8 007F1308 007F1318 007F1328 007F1338 007F1348 |
Yellow Chip Number 1 Orange Chip Number 2 Red Chip Number 3 Mint Chip Number 4 Lime Chip Number 5 Aqua Chip Number 6 Magenta Chip Number 7 Blue Chip Number 8 Purple Chip Number 9 Broken Pieces |
11 04 11 04 11 04 11 04 11 04 11 04 11 04 11 04 11 04 04 |
Byte ID | |
Big the Cat | 001BE454 | 005BE454 | Big the Cat | 5C | 72 Pointer | |
Blocks | 0009AFA1 | 0049AFA1 | Power Plant Blocks Seaside Hill/Ocean Palace Blocks |
64 | 72 Pointer | |
Broken Glass Pieces (Casino levels) | 000BB513 | 004BB513 | Glass Pieces | A4 | 72 Pointer | |
Butterflies | 000DD88C 000DD8BE |
004DD88C 004DD8BE |
Butterflies | 7C 7C |
72 Pointer | |
Casino Sky Object | 3EC10C | 7EC10C | Stage Sky | 01 | Byte ID | |
Character Models | 00181CD4 | 00581CD4 | Amy Rose Cream the Rabbit E-123 Omega Espio Knuckles Shadow Sonic |
5C | 72 Pointer | |
Charmy Bee | 001C64B4 | 005C64B4 | Charmy | 5C | 72 Pointer | |
Charmy Bee's Wings | 001C64E7 | 005C64E7 | Charmy's Wings | A8 | 72 Pointer | |
Dice | 3EB6C8 | 7EB6C8 | Red Dice | 03 | Byte ID | |
Egg Flapper Jet | 001E8B4A | 005E8B4A | Flapper Jet effect | A0 | 72 pointer | |
Energy Blocker for Road | 004B3938 004B3968 004B3978 004B3988 004B3998 004B39A8 |
008B3938 008B3968 008B3978 008B3988 008B3998 004B39A8 |
Pumper Base Left Pumper Right Pumper Flashing Light Laser Fence Broken Pieces |
04 04 04 13 13 04 |
Byte ID | |
Energy Lava | 003E63C4 003E63DC |
007E63C4 007E63DC |
Lava Lava Gradient |
04 13 |
Byte ID | |
Energy Path Objects | 00172D46 00172DA1 00173279 0017330B 0017399A |
00572D46 00572DA1 00573279 0057330B 0057399A |
Energy Fill Energy Energy Path Activator Energy Path Lights |
64 64 A0 A0 A4 |
72 Pointer | |
Energy Pipe Cover | 001740F1 00174130 |
005740F1 00574130 |
Energy Pipe Handles Pipe Glass |
64 64 |
72 Pointer | |
Fake Rings | 00183A5B | 00583A5B | Rings | 5C | 72 Pointer | |
Fireball Light Spots | 003E5CEC | 007E5CEC | Fireball Spot | 13 | Byte ID | |
Fireworks | 000B4AC3 | 004B4AC3 | Firework Effects | 14 | Byte opcode | Not used in the game. |
Fountain Wings | 000A470A 000A4747 |
004A470A 004A4747 |
Fountain Wing Waterfall |
7C A0 |
72 Pointer | |
Frogs | 00468A20 00468A44 |
00868A20 00868A44 |
Green Frog Black Frog |
04 04 |
Byte ID | |
Glass Object (Casino levels) | 003EB8B8 003EB8C8 003EB8D8 003EB8E8 003EB8F8 |
007EB8B8 007EB8C8 007EB8D8 007EB8E8 007EB8F8 |
Glass Wall Glass Floor Glass Piece #1 Glass Piece #2 Glass Piece #3 |
14 14 14 14 14 |
Byte ID | The destroyed Glass pieces mainly uses the 72 pointer, these three flags are less likely to be used. |
Glow in the Dark Mushrooms | 00468E28 | 00868E28 | Green and Pink Mushrooms | 0A | Byte ID | |
Grand Metropolis Clouds | 001769FD | 005769FD | Clouds | 0E | Byte Opcode | |
Grand Metropolis Door | 0016FCA7 00172D46 00172DA1 |
0056FCA7 00572D46 00572DA1 |
Door Energy Fill Energy |
64 64 64 |
72 Pointer | |
Grand Metropolis Lights | 00171B48 | 00571B48 | Red Lights | A0 | 72 Pointer | |
Hang Castle Clouds | 000F77A5 | 004F77A5 | Clouds | A4 | 72 Pointer | |
Hang Castle Doors | 000F8467 | 004F8467 | Doors | 60 | 72 Pointer | |
Hang Castle Flags | 000FA73F 000FA798 |
004FA73F 004FA798 |
Flag Poles Flags |
64 7C |
72 Pointer | |
Hang Castle Grass | 000FDF6D | 004FDF6D | Grass | 88 | 72 Pointer | |
Hang Castle Platforms | 00100804 00100804 |
00500797 00500804 |
Platform Base Floor |
60 60 |
72 Pointer | |
Hang Castle Trees | 00101A68 00101A76 |
00501A68 00501A76 |
Trunk Tree Bushes |
60 88 |
72 Pointer | |
HEXAeco Signboard | 004B446C 004B4484 004B449C |
008B446C 008B4484 008B449C |
Frame Sign Layer #1 Sign Layer #2 |
04 14 14 |
Byte ID | |
Hexagonal Satellite | 003E6AB8 003E6AD0 |
007E6AB8 007E6AD0 |
Handles Mirror |
04 03 |
Byte ID | |
Homing Attack Ring Effects | 00232560 | 00632560 | Ring Effect | A4 | 72 Pointer | |
Liftable Bridge | 0016D3EF | 0056D3EF | Lift Bridge | 7C | 72 Pointer | |
Miles "Tails" Prower | 001C63D4 | 005C63D4 | Tails | 5C | 72 Pointer | |
Miles "Tails" Prower's Fox Tails | 001C6407 | 005C6407 | Tails' Fox Tails | 5C | 72 Pointer | |
Mystic Mansion Doors | 00105E17 | 00505E17 | Doors | 60 | 72 Pointer | |
Mystic Mansion Platforms | 00106A77 00106AE2 |
00506A77 00506AE2 |
Platform Base Floor |
60 60 |
72 Pointer | |
Mystic Mansion Pocket Dimension Sphere | 00104EEA | 00504EEA | Pocket Dimension Sphere | A4 | 72 Pointer | |
Ocean Palace Turtle Legs | 000A2D27 000A3274 |
004A2D27 004A3274 |
Turtle Legs Water Waves |
64 B0 |
72 Pointer | |
Ocean Palace Waterfall | 000A671C | 004A671C | Waterfall | A0 | 72 Pointer | |
Orange Dash Arrows | 3EB660 3EB670 3EB680 |
7EB660 7EB670 7EB680 |
Dash Arrows | 14 14 14 |
Byte ID | |
Pinball Bumpers | 003EB450 003EB460 003EB470 003EB480 |
007EB450 007EB460 007EB470 007EB480 |
Bumpers | 04 04 04 04 |
Byte ID | |
Pinball Round Bumpers | 3EB39C | 7EB39C | Round Bumpers | 04 | Byte ID | |
Pinball Flippers | 003EB75C 003EB76C |
007EB75C 007EB76C |
Left Flipper Right Flipper |
04 04 |
Byte ID | |
Power Plant Clouds | 000A6B0E | 004A6B0E | Clouds | 0F | Byte opcode | Value is one value up from 0E in this offset and decremented by the opcode after this one resulting the byte "0E" after loading. You will need to add the material flag id by 01 for your desired material effect (Example:if the byte is 15, it will become 14 before the level loading finishes.) |
Power Plant Crane | 003E5C9C 003E5CB4 003E5CCC |
007E5C9C 007E5CB4 007E5CCC |
Cab Jib Guy Line Crane Jib |
04 06 0C |
Byte ID | |
Power Plant HEXAeco Glass Ball | 003E5BEC | 007E5BEC | Glass Ball | 17 | Byte ID | |
Power Plant Room Light | 003E69CC 003E69FC |
007E69CC 007E69FC |
Pentagon Frame Mint Light |
04 13 |
Byte ID | |
Quick Ascent Ring Effects | 00231F13 | 00631F13 | Ring Effects | A4 | 72 Pointer | |
Rail Canyon Rails | 000D5A4A 000D5B39 |
004D5A4A 004D5B39 |
Changable Rails | A0 | 72 Pointer | |
Rouge the Bat | 001C6444 | 005C6444 | Rouge | 5C | 72 Pointer | |
Rouge's Bat Wings | 001C6477 | 005C6477 | Rouge's Bat Wings | 5C | 72 Pointer | |
Seaside Hill Flags | 0009543A 0009547C |
0049543A 0049547C |
Flag Pole Flag |
64 7C |
72 Pointer | |
Skeleton Fan | 0010638D | 0050638D | Skeleton Hand Fan | 60 | 72 Pointer | |
Small Triangular Bumpers | 003EC120 003EC130 003EC140 003EC150 |
007EC120 007EC130 007EC140 007EC150 |
Triangular Bumpers | 04 04 04 04 |
Byte ID | |
Spiked Grass | 000FD7BE 000FD8CE |
004FD7BE 004FD8CE |
Red Grass Grass Spikes |
60 88 |
72 Pointer | |
Swinging Axes | 0010000C | 0050000C | Hang Castle Axes | 60 | 72 Pointer | |
Teleporter Switch | 00102D62 00103D38 |
00502D62 00503D38 |
Switch Ball Switch Pad/Inactive Switch |
60 60 |
72 Pointer | |
Torch Holder | 000F9C06 000F9C87 |
004F9C06 004F9C87 |
Torch Parts | 60 60 |
72 Pointer | |
Vector's Bubble Gum | 001BE5B7 | 005BE5B7 | Bubble Gum Ball | 5C | 72 Pointer | |
Vector's Bubble Gum Breath | 00185EB0 | 00585EB0 | Bubble Gum Ball | 5C | 72 Pointer | |
Vector the Crocodile | 001BE584 | 005BE584 | Vector | 5C | 72 Pointer | |
Water (Lost Jungle) | 00476EB4 | 00876EB4 | Pond Water | 13 | Byte ID |