Actions

SCHG

Sonic Adventure DX: PC/EXE Editing

From Sonic Retro

SCHG: Sonic Adventure
Dreamcast
Gamecube
2004 PC
2010 PC


This page is about various things you can edit in the sonic.exe file.
Note: There are multiple versions of SADXPC. Some addresses may not work for your version. Make sure the values given match your exe before editing it! Addresses that only work for the US version will be marked with US. Addresses that only work for the European version will be marked with EU. These are not likely to work with the Japanese version.
Note: the cracked version is the same as the European version.
Note: to find these in RAM, add $400000.

Animation Swapping

Sonicretro-round.svg This short section needs expansion. You can help Sonic Retro by adding to it.

Sonic's Animations

List

Address (US) Address (EU) Description Default (dec.)
97A88 97AD8 Landing After Falling 1
9773F 9778F Landing After Jumping 2
916FF 9174F Idle 4
917F9 91849 Leaning forwards 7
91807 91857 Leaning back 8
95E46 95E96 Walking 1 9
95E2C 95E7C Walking 2 10
95BDA 95C2A Walking 3 11
95B44 95B94 Running 1 12
95C27 95C77 Running 2 13
95C77 95CC7 Jumping/Spindashing 14
951D3 95223 Rolling 15
92FE6 93036 Light Speed Attack 15
95B97 95BE7 Springing 16
978D9 97929 After Springing 17
94FDC 9502C Falling 18
92F7A 92FCA Jump Cancel 18
97CC0 97D10 After Jump Dash 18
9876B 987BB After Light Speed Attack 18
97298 972E8 Braking 20
975B3 97603 After Light Speed Dash 20
92F1C 92F6C Hurt 23
97F4B 97F9B Hurt Landing 24
9607F 960CF Floating 26
93053 930A3 Light Speed Dash 64
963FF 9644F Ladder 69
9B117 9B167 Jump Pad Flip 72
95CC7 95D17 Jump Pad Flight 73
984A3 984F3 Jump Pad Landing 74
961DB 9622B Victory 75
96595 965E5 Frozen 82
9675C 967AC Drowning 85
9BDC1 9BE11 Dying 87
Metal Sonic
95B3A 95B8A Running 1 146
95BEB 95C3B Running 2 13
95C3B 95C8B Jumping 14
Super Sonic
96743 96793 Start 134
9A475 9A4C5 Standing from Moving 134
9A560 9A5B0 Standing from Jumping 134
9A3B8 9A408 Jump Cancel 141
9A4B6 9A506 Falling 141
9A6D6 9A726 After Jump Dash 141
9A617 9A667 After Springing 140
94D25 94D75 Springing 139
94E02 94E52 Victory 143
9A3DE 9A42E Jumping 145
918A6 918F6 Moving 1 135
9188E 918DE Moving 2 136
91869 918B9 Moving 3 137
91842 91892 Moving 4 138

Tails' Animations

List

Address (US) Address (EU) Description Default (dec.)
5C0D1 5C121 Jumping 14
5F9BB 5FA0B Walking 1 9
5C1ED 5C23D Wind Path 11
5C1A7 5C1F7 Spring 17
5EC9F 5ECEF Downwards Spring 18
5CE93 5CEE3 Falling 19
5C1DA 5C22A Floating 33
5EB5C 5EBAC Flying 37
5C6D6 5C726 After Dash Hoop 37
5C725 5C775 Dash Hoop 41
5D702 5D752 Tail Attack 43

Knuckles' Animations

Address (US) Address (EU) Description Default(dec.)
7694A 7699A Jumping 14
7865D 786AD Gliding 1 51
786E9 78739 Gliding 2 (used for a second glide without landing) 51
7888E 788DE After Gliding 34
76E04 76554 Drowning 38

Action Swapping

Sonicretro-round.svg This short section needs expansion. You can help Sonic Retro by adding to it.

Sonic's Actions

List

Address (US) Address (EU) Description Default (dec.)
9ABE5 9AC35 Level Start 1
95063 950B3 Standing 1
94848 94898 After Hurt 1
9A83E 9A88E Walking/Running 2
979A1 979F1 Landing and moving 2
97774 977C4 Landing and moving after rolling 2
96EFA 96F4A Spindash 4
951C0 95210 Rolling 5
93049 93099 Light Speed Dash 6
95F11 95F61 Jumping 8
97CDB 97D2B After Homing Attack 8
94F8F 94FDF Falling After Rolling 8
96001 96051 Vertical Spring 9
96048 96098 Spring 10
92F6A 92FBA Jump Cancel 12
94FD3 95023 Falling 12
97843 97893 After Vertical Spring 12
978D0 97920 After Spring 12
97CB8 97D08 After Jump Dash 12
977B9 97809 Homing Attack/Jump Dash 14
92F12 92F62 Hurt 16
963F5 96445 Ladder 38
95E99 95EE9 Jumping from first Panel 40
98547 98597 Jumping from Panel 40
9849A 984EA Landing on Panel 41
9658D 965DD Frozen 43
92FDC 9302C Light Speed Attack 44
99522 99572 Running down building after falling 46
994B1 99501 Running down building after jumping 46
99393 993E3 Rolling down building 47
96353 963A3 Falling down building 48
9936B 993BB Jumping down building 49
9B47A 9B4CA Hit while running down building 50
9676D 967BD Dying 86
9AA29 9AA79 Debug Mode 87
Super Sonic
9673B 9678B Start 75
9A46D 9A4BD Standing from Moving 75
9A558 9A5A8 Standing from Jumping 75
94E38 94E88 After hitting Perfect Chaos 75
9A404 9A454 Moving 76
9A740 9A790 Landing and Moving 76
9A3AF 9A3FF Jump Cancel 78
9A4AE 9A4FE Falling 78
9A6CE 9A71E After Jump Dash 78
9A60E 9A65E After Springing 78
94D1D 94D6D Springing 79
9A5CD 9A61D Homing Attack 81
9A3D6 9A426 Jumping 82
9A75F 9A7AF After Homing Attack 82
94DFA 94E4A Victory 20
94EC2 94F12 Dying 86

Tails' Actions

List

Address (US) Address (EU) Description Default (dec.)
6186A 618BA Level Start 1
5CF1F 5CF6F Standing 1
5F7E9 5F839 After Tail Attack 1
5F9B3 5FA03 Walking/Running 2
5C1E3 5C233 Wind Path 3
73C29 73C79 Rolling 4
5C096 5C0E6 Jumping 6
5C19F 5C1EF Springing 8
5CE8B 5CEDB Falling 10
5A84A 5A89A Jump Cancel 10
5C1D2 5C222 Floating 10
5EC97 5ECE7 Downwards Spring 10
5EB54 5EBA4 Flying 15
5C6C8 5C718 After Dash Hoop 15
5D6FA 5D74A Tail Attack 20
5C717 5C767 Dash Hoop 61
5C2EE 5C33E Victory/Loss 62

Knuckles' Actions

List

Address (US) Address (EU) Description Default (dec.)
72145 72195 Maximum Heat Attack 18
73C80 73CD0 Punching 26
78652 786A2 Gliding 1 11

Physics

Locations

These are indexed by $5154E8 + (Character * $84).

Character Address
Sonic 5154E8
Eggman 51556C
Tails 5155F0
Knuckles 515674
Tikal 5156F8
Amy 51577C
Gamma 515800
Big 515884

Offsets

These are in the same locations as in RAM. These are all Floats except Hang Time, which is 4 Bytes, measured in frames.

Offset Description Sonic Eggman Tails Knuckles Tikal Amy Gamma Big
0 Hang Time 60 60 60 60 60 60 60 60
4 Amount of grip on floor 2 3 1.5 2 2 1.5 2 2
8 Horizontal Speed Cap 16 16 16 16 16 16 16 5
C Vertical Speed Cap 16 16 16 16 16 16 16 8
10 Something to do with the maximum speed Sonic can accelerate to on his own? 3 3 2 2.5 3 0.05 2.5 1
14  ? 0.6 1 0.6 0.6 1 0.5 0.6 0.2
18 Initial Jump Speed 1.66 1.66 1.66 1.66 1.66 1.3 2 2
1C Spring Control? 3 3 3 3 3 3 3 3
20  ? 0.23 0.23 0.23 0.23 0.23 0.23 0.23 0.23
24 Rolling Cancel Speed 0.46 0.46 0.49 0.46 0.46 0.46 1 0.32
28 Rolling End Speed 1.39 1.39 1.39 1.39 1.39 1.39 2 1.39
2C Running 1 Speed 2.3 2.3 2.8 3.1 2.3 2.3 2.5 2.3
30 Minimum speed to get knocked back when hitting a wall. Also affects pushing speed? 3.7 3.7 3.7 3.7 3.7 3.7 3.7 3.7
34 Running 2 Speed 5.09 5.09 5.09 5.09 5.09 5.09 5.09 5.09
38 While jump is held, add this to speed. 0.076 0.076 0.076 0.076 0.076 0.013 0.09 0.1
3C Ground Acceleration? 0.05 0.06 0.06 0.05 0.06 0.045 0.06 0.08
40 Air Acceleration 0.031 0.031 0.031 0.031 0.031 0.031 0.031 0.031
44 Ground Deceleration -0.06 -0.06 -0.06 -0.06 -0.06 -0.06 -0.06 -0.08
48 Brake Speed -0.18 -0.18 -0.18 -0.18 -0.18 -0.18 -0.25 -0.18
4C Air Brake Speed -0.17 -0.17 -0.17 -0.17 -0.17 -0.17 -0.17 -0.17
50 Air Deceleration -0.028 -0.028 -0.028 -0.028 -0.028 -0.028 -0.028 -0.028
54 Rolling Deceleration -0.008 -0.008 -0.008 -0.008 -0.008 -0.008 -0.008 -0.04
58 Speed to add to normal gravity? -0.01 -0.01 -0.01 -0.01 -0.01 -0.01 -0.01 -0.01
5C Speed when Sonic hits something? -0.4 -0.4 -0.4 -0.4 -0.4 -0.4 -0.4 -0.4
60 Minimum speed before stopping (affects spindash charging and braking) -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1
64 Seems to affect movement on sloped surfaces -0.6 -0.6 -0.6 -0.6 -0.6 -0.6 -0.6 -0.6
68 Something related to acceleration on ground? Increase it to accelerate faster. -0.2825 -0.3375 -0.3375 -0.3375 -0.3375 -0.3375 -0.9 -0.2
6C  ? 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
70 Ripple Size? 4 8.5 3.5 4 4 3.5 4 9.5
74 Collision Size 10 18 9 11.4 10 10 21 17
78 Gravity (Multiplied by Gravity values) 0.08 0.08 0.08 0.08 0.08 0.04 0.1 0.135
7C Y Offset for camera 7 7 6 9 7 7 20 15
80 Y Offset 5.4 5.3 4.5 5.7 5 5 14 8

Other Values

Address (US) Address (EU) Description Default
92FEB 9303B Light Speed Attack V Speed 8
9306A 930BA Light Speed Dash H Speed 8
9439D 943ED Super Sonic's Rolling Deceleration -0.001
943A7 943F7 Super Sonic's Air Deceleration -0.002
943B1 94401 Super Sonic's Air Acceleration 0.05
943BB 9440B Super Sonic's Y Offset 6.4
94C2F 94C7F Jump Dash H Speed 5
96F23 96F73 Initial Spindash Speed 2
3DCB34 3DCB3C Max Spindash Speed 10
3DCCFC 3DCD04 Free Movement Speed 5
3DD550 3DD540 Spindash Speed Increment 0.4
3E007C 3E006C Water Multiplication 0.65

Object lists

A pointer list is at 574AF8, containing eight entries per level. To find the pointer you want, take $574AF8 + (((level * 8) + act) * 4). Remember to subtract $400000 from all pointers!

Now you will be at the list header, which is actually at the end of the list. The header is simple: the first 4 Bytes are the number of objects, and the next 4 bytes are a pointer to the start of the list.

The list consists of $14 bytes for each object, in the following format:

Offset Type Description
0 Byte First argument passed to ObjLoad
1 Byte Second argument passed to ObjLoad
2 2 Bytes Some setting related to the distance at which the object appears. The next value will only take effect if this is 1, otherwise the game will provide a value.
4 Float The distance from the player at which the object appears/disappears.
8 4 Bytes Unknown. Usually 0.
C 4 Bytes A pointer to the main subroutine for the object.
10 4 Bytes A pointer to the name of the object in ASCII text. Unused in the final, but used in the preview's SET Editor.

You should avoid editing these values unless you are absolutely sure of what you're doing, as incorrect arguments or pointers will likely crash the game. Instead, you should simply copy an entry from another level's list, and it will work as long as the proper textures are loaded.

Character Select

Characters

The characters are stored as an array of 2 byte values at 3EF6B4 (3EF6A4 in the EU version), in the order Sonic, Tails, Knuckles, Amy, Big, Gamma, (Super/Metal) Sonic.

Objects

The objects to load for each character at the character select screen are at 3F0788 (3F0778 in EU). All the data are pointers.

Offset Description
0 The address of the code for the object.
4 The address of the texture list to use for the object.
8 A pointer to some area in RAM. Function unknown.
C A pointer to four bytes worth of data. Function unknown.

Trial Mode levels

Starting at 3EF5EC/3EF5DC for Action Stages and 3EF624/3EF614 for Sub Games, it lists a pointer to a list of levels followed a by 4 byte count of the levels in the list. The lists themselves are simply a byte for the level and a byte for the act.

Level Start Arrays

Character Address # of entries
Sonic 50A5C8 72
Tails 50AB68 41
Knuckles 50AEA0 39
Big 50B1B0 35
Amy 50B470 41
Gamma 50B7A8 43

The end of the array is signaled by an entry with a level value of 0x2B.

Each entry is $14 bytes long, in the following format:

Offset Type Description
0 2 Bytes Level ID
2 2 Bytes Act ID
4 Float X Position
8 Float Y Position
C Float Z Position
10 4 Bytes Y Rotation

Misc. Code

This section is for code that doesn't fit into any of the above sections. To disable code, replace it with nop instructions ($90)
x86 Instruction Set Reference

Address (US) Address (EU) Bytes ASM Description Result when disabled
13D9E 13DEE C6 05 40 EF B0 03 00 mov byte ptr [03B0EF40],00 Show the HUD Allow hiding the HUD
25AB0 25B00 66 C7 05 E4 F0 B0 03 00 00 mov word ptr [03B0F0E4],0000 Set rings to 0 when hit Don't lose rings when hit
25B7E 25BCE 00 1d 34 ef b0 03 add [03b0ef34],bl add change to lives Can't lose or gain lives
25C03 25C53 66 89 0D E4 F0 B0 03 mov [03B0F0E4],ecx Ring collection Collecting rings doesn't add to total. Also disables Super Sonic's ring drain.
25CC0 25D10 66 A1 E4 F0 B0 03 mov ax,[03B0F0E4] Copy rings value when hit Always spill 20 rings and can't die when hit
496DD 4972D 80 7b 09 06

0f 85 cf 00 00 00

cmp byte ptr [ebx+09],06

jne 497b6

Test if you're playing as E-102 Gamma,

and branch if you aren't

NOP the jne, and everyone can walk on water.

Replace it with a jmp, and nobody can.

F6B02 F6B52 75 0a jne 000f6b0e End the level if you're playing as Tails in Emerald Coast part 2 Replace the jne with a jmp and Tails will be able to play this level.

Morph Targets

Disable these addresses to prevent crashes when editing the related models.

Address (US) Address (EU) Bytes ASM
Amy's head
85F0E 85F5E 89 50 04 mov [eax+04],edx
85C41 85C91 89 41 04 mov [ecx+04],eax
Amy's body
86400 86450 89 41 04 mov [ecx+04],eax
85F31 85F81 89 41 04 mov [ecx+04],eax
Big's head
8C9D8 8CA28 89 48 04 mov [eax+04],ecx
8C70E 8C75E 89 51 04 mov [ecx+04],edx
Big's fishing pole
913AB 913FB 89 4a 04 mov [edx+04],ecx
Big's power rod
91392 913E2 89 4a 04 mov [edx+04],ecx
Knuckles' head
73FB2 74002 89 48 04 mov [eax+04],ecx
73CC1 73D11 89 51 04 mov [ecx+04],edx
Knuckles' air head
73FC7 74017 89 48 04 mov [eax+04],ecx
73CD5 73D25 89 51 04 mov [ecx+04],edx
Knuckles' hands
726D3 72723 89 50 04 mov [eax+04],edx
726EA 7273A 89 41 04 mov [ecx+04],eax
72701 72751 89 4a 04 mov [edx+04],ecx
72719 72769 89 50 04 mov [eax+04],edx
72730 72780 89 41 04 mov [ecx+04],eax
72747 72797 89 4a 04 mov [edx+04],ecx
7275F 727AF 89 50 04 mov [eax+04],edx
72776 727C6 89 41 04 mov [ecx+04],eax
Knuckles' fighting gloves
72B4A 72B9A 89 50 04 mov [eax+04],edx
72B61 72BB1 89 41 04 mov [ecx+04],eax
72B78 72BC8 89 4a 04 mov [edx+04],ecx
72B90 72BE0 89 50 04 mov [eax+04],edx
72BA7 72BF7 89 41 04 mov [ecx+04],eax
72BBE 72C0E 89 4a 04 mov [edx+04],ecx
72BD6 72C26 89 50 04 mov [eax+04],edx
72BED 72C3D 89 41 04 mov [ecx+04],eax
Tails' body
622E4 62334 89 50 04 mov [eax+04],edx
Tails' body w/ badge
622B4 62304 89 41 04 mov [ecx+04],eax
Tails' flying body
622FB 6234B 89 41 04 mov [ecx+04],eax
Tails' flying body w/ badge
622CB 6231B 89 4a 04 mov [edx+04],ecx
Tails' head
5BB60 5BBB0 89 41 04 mov [ecx+04],eax
5B821 5B871 89 41 04 mov [ecx+04],eax
Tails' flying head
5BB74 5BBC4 89 4a 04 mov [edx+04],ecx
5B835 5B885 89 4a 04 mov [edx+04],ecx
Tails' tails
5BED3 5BF23 89 41 04 mov [ecx+04],eax
5DAB1 5DB01 89 50 04 mov [eax+04],edx
61389 613D9 89 4a 04 mov [edx+04],ecx
61325 61375 89 50 04 mov [eax+04],edx
5BEE7 5BF37 89 4a 04 mov [edx+04],ecx
5DACA 5DB1A 89 41 04 mov [ecx+04],eax
613A1 613F1 89 50 04 mov [eax+04],edx
61339 61389 89 41 04 mov [ecx+04],eax
Sonic's left toe
93711 93761 89 42 04 mov [edx+04],eax
9356D 935BD 89 42 04 mov [edx+04],eax
935E3 93533 89 48 04 mov [eax+04],ecx
Sonic's right toe
93722 93772 89 42 04 mov [edx+04],eax
936EA 9373A 89 42 04 mov [edx+04],eax
93657 936A7 89 51 04 mov [ecx+04],edx
936CD 9371D 89 42 04 mov [edx+04],eax
Sonic's head
93C5D 93CAD 89 51 04 mov [ecx+04],edx
937A1 937F1 89 51 04 mov [ecx+04],edx

References


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