Difference between revisions of "Sonic Heroes/DOL Editing"
From Sonic Retro
(→Overwriting Codes) |
(→Overwriting Codes) |
||
Line 63: | Line 63: | ||
|80 01 00 74 | |80 01 00 74 | ||
|4B ED 43 F5 | |4B ED 43 F5 | ||
+ | |- | ||
+ | |119928 | ||
+ | |38 A0 00 04 | ||
+ | |4B ED A6 81 | ||
|- | |- | ||
|19D1FC | |19D1FC |
Revision as of 07:11, 19 August 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 DOL of the GC game is Start.dol. This executable contains codes in different offsets for each region and version released in a variety of countries.
Contents
Aspect Ratio (In-complete)
As with the GameCube version of the game, it's default aspect is at 4:3 for most standard TVs. It can be tweaked by inseting codes in a specific address to read the specified aspect ratio float values and use for modern TV screens in their specific format such as with 16:9 and 21:9.
Injection Process
Address (NTSC-U) | Injectable Codes | Code Injection Length |
---|---|---|
4D8 | 81 C2 A7 28 91 C2 00 00 C2 22 00 00 EC 11 00 32 D0 03 00 04 48 1A 92 74 81 C2 A7 2C 91 C2 00 00 C2 22 00 00 EC 11 00 32 D0 03 00 0C 48 1A 92 64 | 0x30 |
508 | 81 C2 A7 28 3D E0 80 29 91 CF 06 A8 3D CE 80 00 91 CF 06 94 81 C2 A7 2C 91 CF 06 BC 91 CF 06 9C 38 A0 00 04 4E 80 00 20 3D E0 80 29 3D C0 3F 80 91 CF 06 9C 91 CF 06 A8 91 CF 06 BC 3D CE 80 00 91 CF 06 94 80 01 00 74 4E 80 00 20 | 0x4C |
554 | 3D E0 80 29 3D C0 3F 80 91 CF 06 9C 91 CF 06 A8 91 CF 06 BC 3D CE 80 00 91 CF 06 94 38 60 00 01 4E 80 00 20 | 0x24 |
5C0 | 3D E0 80 29 3D C0 3F 80 91 CF 06 9C 91 CF 06 A8 91 CF 06 BC 3D CE 80 00 91 CF 06 94 38 60 00 0A 4E 80 00 20 | 0x24 |
Overwriting Codes
In-order to make the codes jump to your injected codes, you will need to replace the bytes with the following to become effective.
Address (NTSC-U) | Original Bytes | Replace With |
---|---|---|
C60D8 | 38 A0 00 04 | 4B F2 DE D1 |
C60E0 | 38 60 00 01 | 4B F2 DF 15 |
C62B0 | 38 A0 00 04 | 4B F2 DC F9 |
C62B8 | 38 60 00 01 | 4B F2 DD 3D |
11E78C | 38 A0 00 04 | 4B ED 58 1D |
11E794 | 38 60 00 0A | 4B ED 58 CD |
11FBD4 | 38 A0 00 04 | 4B ED 43 D5 |
11FBDC | 80 01 00 74 | 4B ED 43 F5 |
119928 | 38 A0 00 04 | 4B ED A6 81 |
19D1FC | D0 03 00 04 | 4B E5 6D 7C |
19D204 | D0 03 00 0C | 4B E5 6D 8C |
Required Relocatable Editing
Some relocatables require code editing in-order to modify their orthographic scaling to match the game's aspect ratio.
The following relocatables require code modification to set the aspect ratio used by the game.
NTSC-U
Relocatable | Address | Original Bytes | Replace With |
---|---|---|---|
advertiseD.rel | 14688 14690 |
38 A0 00 04 80 01 00 74 |
4B 59 80 81 4B 59 80 A1 |
Final code writing
When in use, replace the zeros in the following addresses with your aspect float value.
Address (NTSC-U) | Aspect FOV Direction |
---|---|
29C5E8 | Horizontal |
29C5EC | Vertical |
The default float value is 1 (3F800000). To get the float value for the horizontal aspect, use a calculator to divide the width by the height (example: 1920 ÷ 1080 = 1.777777777777778), then get the original aspect by dividing a 4:3 resolution (example: 640 ÷ 480 = 1.333333333333333) and divide the original aspect float with yours (example: 1.333333333333333 ÷ 1.777777777777778 = 0.75) and then convert it to a big endian hex value and paste write it on the address before the vertical FOV. As for the vertical FOV, do the same thing but multiply the horizontal aspect ratio with 0.75 to get the vertical FOV multiplier, then multiply it again with multiplier you got before converting to a hex value.
Examples
Aspect (X) | Aspect (Y) | Ratio |
---|---|---|
3F800000 | 3F400000 | 1:1 (Vertical increase from 4:3) |
3F400000 | 3F100000 | 1:1 (Vertical increase from 16:9) |
3F400000 | 3F400000 | 4:3 (Vertical increase from 16:9) |
3F78FF39 | 3F800000 | 1.37:1 |
3F400000 | 3f456666 | 1.37:1 (Vertical increase from 16:9) |
3F555555 | 3F800000 | 16:10 |
3F400000 | 3F555555 | 16:10 (Vertical increase from 16:9) |
3F400000 | 3F800000 | 16:9 |
3F388127 | 3F800000 | 1.85:1 |
3F100000 | 3F800000 | 21:9 |
Frame Rates
The game sets the frame rate based on what the code tells the game to refresh the frames at while rendering.
The following frame rate IDs are available in this port of the game:
ID | Frames Per Second |
---|---|
00 | 60 |
01 | 30 |
02 | 30 (2x Speed) |
03 | 30 (3x Speed) |
Addresses
There are some addresses that set a frame rate for single and multiplayer modes.
Address (NTSC-U) | Default Value | Type |
---|---|---|
B6C7 | 01 | Multiplayer Frame Rate |
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:
RenderWare Material function:
38 60 00 00 38 80 00 00
Offset | Type | Description |
---|---|---|
0x04 | Byte | Material type |
0x08 | Byte | Material value |
See the EXE editing page for function parameter details.
Nintendo System Material function:
38 60 00 00 38 80 00 00 38 A0 00 00 38 c0 00 00
Offset | Type | Description |
---|---|---|
0x04, 0x08, 0x0C and 0x10 | Byte | Material type |
Offsets
A list shows offsets for special material effects that were discovered in the DOL. More codes that have been found and not already on the list will be added.
NTSC-U
Addresses (Final) | Materials | Default Parameter Values | Targeting Object | Notes |
---|---|---|---|---|
E357 E363 E36F E37B E3BB E3C7 |
Z-testing Z-writing Fog Enabling Culling Source Blend Destination Blend |
00 00 00 01 02 02 |
Warp Effects | |
E39F E3AB |
Source Blend Destination Blend |
02 06 |
Teleporter Switch Effect Blend Condition |
Material Flags
These are the following flags in the DOL files.
NTSC-U
Addresses (Final) | Models | Default byte values | Flag Type(s) | Notes |
---|---|---|---|---|
2D663 | Character Models | 58 | 72 Pointer | |
2D68F | Charmy's Wings (In-game) | A4 | 72 Pointer | |
2D69F | Character Flying Parts | 58 | 72 Pointer | |
FD433 | Barrier | A0 | 72 Pointer | |
FE02F | Homing Attack Ring Effects | A0 | 72 Pointer | |
FE827 | Quick Ascent Ring Effects | A0 | 72 Pointer |