Difference between revisions of "Sonic Heroes/EXE Editing"
From Sonic Retro
(Adding another graphic offset found in the executable.) |
(→Material Functions) |
||
Line 201: | Line 201: | ||
==Material Functions== | ==Material Functions== | ||
+ | ===Colors=== | ||
+ | The EXE provides color effects for certain objects such as the trail and tornado effects for each player. | ||
+ | |||
+ | Color RGB Entry:<br> | ||
+ | {{grey|00}} {{yellow|00}} {{cyan|00}} | ||
+ | {| class="prettytable" | ||
+ | !Offset||Type||Description | ||
+ | |- | ||
+ | | {{grey|0x00}} | ||
+ | | {{grey|Byte}} | ||
+ | | {{grey|Blue}} | ||
+ | |- | ||
+ | | {{yellow|0x01}} | ||
+ | | {{yellow|Byte}} | ||
+ | | {{yellow|Green}} | ||
+ | |- | ||
+ | | {{cyan|0x02}} | ||
+ | | {{cyan|Byte}} | ||
+ | | {{cyan|Red}} | ||
+ | |} | ||
+ | |||
+ | Custom RGB color codes can be generated using color wheel websites like [http://www.color-blindness.com/color-name-hue/ Colblinder] and [http://colorizer.org/ 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 a number of codes to the character effects that were found in the EXE. | ||
+ | {| class="prettytable" | ||
+ | !Character||Effect Type||Offset||RAM Offset||Default Hex | ||
+ | |- | ||
+ | |Sonic | ||
+ | |Trails | ||
+ | |4C729C | ||
+ | |8C729C | ||
+ | |005AAAFF | ||
+ | |} | ||
===Material Opcodes=== | ===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. | 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. |
Revision as of 08:25, 16 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 |
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.
Offsets | RAM Offsets | 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. |
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
Offset | Type | Description |
---|---|---|
0x00 | Byte | Blue |
0x01 | Byte | Green |
0x02 | Byte | Red |
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 a number of codes to the character effects that were found in the EXE.
Character | Effect Type | Offset | RAM Offset | Default Hex |
---|---|---|---|---|
Sonic | Trails | 4C729C | 8C729C | 005AAAFF |
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.
Offsets | RAM Offsets | Materials | Default Parameter Values | Targeting Object | Notes |
---|---|---|---|---|---|
00405D86 00405D8F 00405D98 00405DA1 00405DAA 00405DB6 00405DBF 00405DC8 00405DD1 00405DDA 00405DE3 00405DEC |
00405D86 00405D8F 00405D98 00405DA1 00405DAA 00405DB6 00405DBF 00405DC8 00405DD1 00405DDA 00405DE3 00405DEC |
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 | |
0001B838 0001B844 0001B84D 0001B856 0041B86D 0001B878 0001B881 |
0041B838 0041B844 0041B84D 0041B856 0041B86D 0041B878 0041B881 |
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 | |
0001BA94 0001BA9E 0001BAA9 0001BAB3 0001BACC 0001BAD5 0001BAD9 0001BAE3 |
0041BA94 0041BA9E 0041BAA9 0041BAB3 0041BACC 0041BAD5 0041BAD9 0041BAE3 |
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. |
0001E0A1 0001E0AD 0001E0B6 0001E0BF 0001E0C8 0001E0D1 0001E0DA 0001E0E3 0001E0EC 0001E0F8 |
0041E0A1 0041E0AD 0041E0B6 0041E0BF 0041E0C8 0041E0D1 0041E0DA 0041E0E3 0041E0EC 0041E0F8 |
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 | |
0001EAA9 0001EAA9 |
0041EAA9 0041EAA9 |
Source Blend Destination Blend |
05 02 |
Key Sparkle Effect on HUD | |
00022BA9 00022BB2 00022BBB 00022BC4 00022BE8 00022BF1 00022C06 00022C1B |
00422BA9 00422BB2 00422BBB 00422BC4 00422BE8 00422BF1 00422C06 00422C1B |
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 | |
0002478F 000247B0 000247BC 0002481E 00024827 00024830 |
0042478F 004247B0 004247BC 0042481E 00424827 00424830 |
Culling Unknown Material Vertex Alpha Enabling Source Blend Destination Blend Texture Filtering |
01 03 01 05 04 02 |
General Subtitles | |
000247C5 000247CE |
004247C5 004247CE |
Source Blend Destination Blend |
01 04 |
General Subtitle Drop Shadow | |
0003131E 0003132E 00031381 000313A9 000313B9 002A4362 |
0043131E 0043132E 00431381 004313A9 004313B9 006A4362 |
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 | |
00038AB7 00038AF0 00038AF9 00038B05 00038B0E 00038B2F 00038B38 00038B55 |
00438AB7 00438AF0 00438AF9 00438B05 00438B0E 00438B2F 00438B38 00438B55 |
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 | |
0004CA25 0004CA2E 0004CA37 0004CA40 0004CA49 0004CA55 0004CA5E 0004CA67 0004CA70 0004CA79 0004CA82 0004CA8B |
0044CA25 0044CA2E 0044CA37 0044CA40 0044CA49 0044CA55 0044CA5E 0044CA67 0044CA70 0044CA79 0044CA82 0044CA8B |
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 | |
0004EB79 0004EB82 0004EB8B 0004EB94 0004EB9D 0004EBA9 0004EBB2 0004EBBB 0004EBC4 0004EBCD 0004EBD6 |
0044EB79 0044EB82 0044EB8B 0044EB94 0044EB9D 0044EBA9 0044EBB2 0044EBBB 0044EBC4 0044EBCD 0044EBD6 |
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 | |
0005A007 0005A010 0005A019 0005A022 |
0045A007 0045A010 0045A019 0045A022 |
Source Blend Destination Blend Culling Fog |
05 02 01 00 |
Triple Spring Rays | |
0005EBC8 | 0045EBC8 | Culling | 01 | Bobsled Player Marker | Displayed in 2 Player Bobsled Race. |
000653A5 000653AE 000653B7 |
004653A5 004653AE 004653B7 |
Source Blend Destination Blend Culling |
02 02 01 |
Mystic Mansion Trolley Lights | |
0006C369 0006C372 0006C37B 0006C384 |
0046C369 0046C372 0046C37B 0046C384 |
Source Blend Destination Blend Culling Fog |
05 02 01 00 |
Checkpoint Rays | |
000720A1 000720AA 000720B3 |
004720A1 004720AA 004720B3 |
Source Blend Destination Blend Culling |
05 02 01 |
Flower Rays | |
00076404 0007640D 00076416 |
00476404 0047640D 00476416 |
Source Blend Destination Blend Culling |
02 06 01 |
Hint Ring Question Mark | |
00078361 0007836A 00078373 0007838B |
00478361 0047836A 00478373 0047838B |
Source Blend Destination Blend Culling #1 Culling #2 |
05 06 03 02 |
Popped Item Balloon | |
0007C04C 0007C055 0007C05E |
0047C04C 0047C055 0047C05E |
Source Blend Destination Blend Fog Enabling |
02 02 00 |
Lasers | |
0008AC09 0008AC12 0008AC1B |
0048AC09 0048AC12 0048AC1B |
Source Blend Destination Blend Culling |
05 02 01 |
Target Switch Fade | |
0008F265 0008F26E 0008F277 0008F280 0008F289 0008F29C 0008F2A5 |
0048F265 0048F26E 0048F277 0048F280 0048F289 0048F29C 0048F2A5 |
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 | |
000928CD 000928D6 00092906 0009290F 0009292A 00092962 0009296B |
004928CD 004928D6 00492906 0049290F 0049292A 00492962 0049296B |
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 | |
00092918 00402921 |
00492918 00492921 |
Source Blend Destination Blend |
01 04 |
In-game Scene Subtitle Drop Shadow | |
0009656C 00096575 |
0049656C 00496575 |
Source Blend Destination Blend |
05 02 |
Hermit Crab Fade | |
000C516C 000C5175 |
004C516C 004C5175 |
Source Blend Destination Blend |
05 02 |
Casino Chip Fade | |
000C3D66 000C3D6F 000C3D7B 000C3D84 000C3D8D 000C3D96 |
004C3D66 004C3D6F 004C3D7B 004C3D84 004C3D8D 004C3D96 |
Z-writing Z-testing Shade Mode Texture filtering Vertex Alpha Enabling Culling |
00 00 02 02 01 01 |
Casino Slot Interface | |
000EDAF0 000EDAF9 000EDB02 000EDB0E 000EDB17 000EDB43 000EDB4C 000EDB9D 000EDBA6 000EDBB4 |
004EDAF0 004EDAF9 004EDB02 004EDB0E 004EDB17 004EDB43 004EDB4C 004EDB9D 004EDBA6 004EDBB4 |
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. |
000F9A6C 000F9A75 000F9A7E |
004F9A6C 004F9A75 004F9A7E |
Source Blend Destination Blend Culling |
02 02 01 |
Torch Fire | |
000FE89A 000FE8A3 |
004FE89A 004FE8A3 |
Source Blend Destination Blend |
05 02 |
Hang Castle Key Fade | |
000FEE13 000FEE1C 000FEE25 |
004FEE13 004FEE1C 004FEE25 |
Source Blend Destination Blend Culling |
02 02 01 |
Mystic Mansion Lights | |
000FBC5A 000FBC63 |
004FBC5A 004FBC63 |
Source Blend Destination Blend |
05 06 |
Pumpkin Ghost Fade Effect | |
000FBDBC 000FBDC5 000FBDCE |
004FBDBC 004FBDC5 004FBDCE |
Source Blend Destination Blend Culling |
02 02 01 |
Pumpkin Ghost Light | |
00501338 00501341 0050134A |
00501338 00501341 0050134A |
Source Blend Destination Blend Culling |
02 02 01 |
Hang Castle Spider Lights | |
00103401 00103409 00103412 |
00503401 00503409 00503412 |
Source Blend Destination Blend Culling |
02 02 01 |
Teleporter Switch Glowing Symbols | |
00107BE4 00107BED 00107BF6 |
00507BE4 00507BED 00507BF6 |
Source Blend Destination Blend Culling |
05 02 01 |
Thunder lightening with skulls | |
00188F4A 00188F53 00188F5C 00188F65 |
00588F4A 00588F53 00588F5C 00588F65 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Chaotix Recital Lights | |
001D2B99 001D2BA2 001D2BAE 001D2BB7 001D2BC0 |
005D2B99 005D2BA2 005D2BAE 005D2BB7 005D2BC0 |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 02 01 00 |
Espio's Invisibility | |
001D2E3A 001D2E43 001D2E4C 001D2E58 001D2E61 |
005D2E3A 005D2E43 005D2E4C 005D2E58 005D2E61 |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 03 01 00 |
Super Sonic Glowing Effect | |
001D2EC5 001D2ECE 001D2ED7 001D2EE0 |
005D2EC5 005D2ECE 005D2ED7 005D2EE0 |
Source Blend Destination Blend Culling Vertex Alpha Enabling |
05 06 01 01 |
Super Sonic Power Team Blast | |
001D3126 | 005D3126 | Destination Blend | 02 | Super Sonic Power Team Blast Symbol Effect | |
001DCD3F 001DCD48 001DCD51 001DCD5F |
005DCD3F 005DCD48 005DCD51 005DCD5F |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot Enemy Stun Effect | |
001DDD9E 001DDDA7 001DDDB0 |
005DDD9E 005DDDA7 005DDDB0 |
Source Blend Destination Blend Culling |
05 02 01 |
Turtle Shoot Cannon Effect | |
0022FA88 0022FA91 0022FA9A 0022FAA6 0022FAAF |
0062FA88 0062FA91 0062FA9A 0062FAA6 0062FAAF |
Source Blend Destination Blend Culling Fog Vertex Alpha Enabling |
05 02 01 00 01 |
Character Jump Effects | |
00231CC4 00231CCD 00231CD6 00231CE2 00231CEB |
00631CC4 00631CCD 00631CD6 00631CE2 00631CEB |
Source Blend Destination Blend Culling Vertex Alpha Enabling Fog Enabling |
05 02 01 01 00 |
Quick Ascent Effect | |
002343F8 00234401 0023440A 00234413 00234437 0023443B |
006343F8 00634401 0063440A 00634413 00634437 0063443B |
Source Blend Destination Blend Culling Fog Enabling Z-testing #1 Z-testing #2 |
05 02 01 00 01 00 |
Colored Rocket Accel Effect | |
002387B4 002387BD 002387C6 002387CF |
006387B4 006387BD 006387C6 006387CF |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Light Streak Effects | |
002396AD 002396B6 002396BF 002396CB 002396D4 002396DD |
006396AD 006396B6 006396BF 006396CB 006396D4 006396DD |
Source Blend Destination Blend Culling Null Material Vertex Alpha Enabling Fog Enabling |
05 02 01 00 01 00 |
Character Trail Effects | |
0023A9AB 0023A9B4 0023A9BD |
0063A9AB 0063A9B4 0063A9BD |
Source Blend Destination Blend Culling |
05 02 01 |
Rainbow Rocket Accel Effect | |
0023B763 0023B76E 0023B777 0023B780 0023B795 0023B79E |
0063B763 0063B76E 0063B777 0063B780 0063B795 0063B79E |
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 | |
0023D968 0023D971 0023D97A 0023D983 |
0063D968 0063D971 0063D97A 0063D983 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot | |
0023DE45 0023DE4E 0023DE57 0023DE60 |
0063DE45 0063DE4E 0063DE57 0063DE60 |
Source Blend Destination Blend Culling Fog Enabling |
05 02 01 00 |
Thundershoot Pipes | |
0023E383 0023E38C 0023E395 0062E3A1 0023E3AA |
0063E383 0063E38C 0063E395 0063E3A1 0063E3AA |
Source Blend Destination Blend Culling Unknown Material Fog Enabling |
05 02 01 02 00 |
Thundershoot Ring Collect Planes | |
0023FE8B 0023FF6C 0023FF7E 0023FF8A |
0063FE8B 0063FF6C 0063FF7E 0063FF8A |
Vertex Alpha Enabling Source Blend Destination Blend Culling Fog Enabling |
01 05 02 01 00 |
Colored Tornado Effect | |
0023FEC5 0023FEDA 0023FEE3 0023FEEC 0023FEFD 0023FF06 |
0063FEC5 0063FEDA 0063FEE3 0063FEEC 0063FEFD 0063FF06 |
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. |
00245414 0024543B 00245488 00245491 |
00645414 0064543B 00645488 00645491 |
Culling Vertex Alpha Enabling Source Blend Destination Blend |
01 01 05 04 |
FMV Subtitles | |
00245429 00245432 |
00645429 00645432 |
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.
Flag offset pointer entry:
00 72 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Byte | Pointer flag |
0x01 | 4 bytes | Always 72 00 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. |
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 | Offset(s) | RAM Offsets | Models | Default byte values | Flag Type(s) | Notes |
---|---|---|---|---|---|---|
Arrow Light Sign Pads | 000B0659 000B0AB8 |
004B0659 004B0AB8 |
Pad Arrow Light |
64 A0 |
72 Pointer | |
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 | |
Broken Glass Pieces (Casino levels) | 000BB513 | 004BB513 | Glass Pieces | A4 | 72 Pointer | |
Butterflies | 000DD88C 000DD8BE |
004DD88C 004DD8BE |
Butterflies | 7C 7C |
72 Pointer | |
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 | |
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 | |
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 | |
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 | |
Homing Attack Ring Effects | 00232560 | 00632560 | Ring Effect | A4 | 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 Waterfall | 000A671C | 004A671C | Waterfall | A0 | 72 Pointer | |
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.) |
Rail Canyon Rails | 000D5A4A 000D5B39 |
004D5A4A 004D5B39 |
Changable Rails | A0 | 72 Pointer | |
Quick Ascent Ring Effects | 00231F13 | 00631F13 | Ring Effects | A4 | 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 | |
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 |