Actions

SCHG

Sonic Adventure DX: PC/EXE Editing/Function List

From Sonic Retro

SCHG: Sonic Adventure
Dreamcast
Gamecube
2004 PC
2010 PC


The following is a list of functions in the US version of sonic.exe. For the EU version, adding $50 to the address usually works. All values are in hex unless explicitly specified otherwise.

Address Size Label Description Arguments Returns
25B0 8AD CheckSettings Checks settings in sonicDX.ini and checks for CD in drive. None Nothing
3070 19 SetTextures Sets the texture list to use when drawing models. pointer to texture list header Nothing
74A0 3A5 ProcessModelNode Renders a model, and any children/sibling models. pointer to OBJECT Struct for the model, int unknown, float unknown unknown
B860 D5 ObjLoad Loads an object. char unknown, char unknown, pointer to object's code pointer to master object struct for the loaded object, 0 if loading failed.
C090 92D GameMode Runs different parts of the game based on the current game mode. None Nothing
F460 954 WriteControllerData Writes the data to the controller addresses Unknown Unknown
FDC0 156 Control Copies controller data to main array if the flags allow, determines which buttons can be used to attack None Unknown
143C0 52 LoadLevelObject Loads an object that runs the code for the level. None A pointer to the Master Object Struct for the object, or 0 if it failed to load.
144D0 C SetCharacter Sets the character value. short character ID Nothing
144E0 8 GetCurrentCharacterID Returns the ID of the current character. None Current character ID
14570 34 SetLevelAndAct Sets the level and act values, and stores the previous level and act values. char level, char act Nothing
145B0 1A SetNextLevelAndAct Sets the level and act to use for the next area. char level, char act Nothing
14610 35 GoToNextLevel Sets the current level and act to the next level and act, and stores the previous level and act. None Nothing
14650 13 GetLevelAndAct Returns the current level and act values as a short. None act | (level << 8)
14670 13 GetPrevLevelAndAct Returns the previous level and act values as a short. None prevact | (prevlevel << 8)
14690 13 GetNextLevelAndAct Returns the next level and act values as a short. None nextact | (nextlevel << 8)
146B0 27 LevelIsChaoGarden Returns True (1) if the current level ID is 27, 28, 29, or 2A. None True (1) or False (0)
147F0 D SetLevelEntrance Sets the level entrance number. char entrance number Nothing
14800 6 GetLevelEntrance Returns the level entrance number. None level entrance number
157C0 1BC CharLoad Loads all the characters for the level. None Nothing
20E90 55 UnloadCharTextures Unloads the textures for the selected character. int character unknown
21040 5D UnloadLevelTextures Unloads the textures for the selected level. short levelact unknown
21180 DC LoadPVM Loads a PVM. pointer to pvm name string, pointer to texture list header, int unknown, int unknown unknown
23D70 A9 PlaySound Plays a sound effect/voice clip. int ID, int unknown, int unknown, int unknown Unknown
25690 18 PlayMusic Plays a song. int song 0 if music is disabled, song if music is enabled
258F0 11 GetDebugMode Returns status of the debug mode flag. None 1 if debug is enabled, 0 otherwise
25AB0 A Set0Rings Sets rings to 0. None Nothing
25AC0 6 GetMarketRings Gets the number of rings in the Black Market. None number of rings
25AF0 8 ResetLives Resets the number of lives to 4. None Nothing
25B60 4F GiveLives Gives you the specified number of lives and plays the 1up sound. short lives Unknown
25BE0 6D AddRings Gives you the specified number of rings, and calls GiveLives if necessary. short rings Unknown
25CC0 7 GetRings Gets the number of rings you have. None number of rings
25FE0 9 GetLives Gets the number of lives you have None number of lives
25FF0 34 ResetTime Resets the clock to 0, or 3 minutes if you're Gamma. None Nothing
265D0 1B SetTime Sets the clock to a specific time. char minute, char second Nothing
265F0 1E SetTime2 Sets the clock to a specific time. char minute, char second, char frame Nothing
26640 45 AddSeconds Adds the specified number of seconds to the timer. int seconds number of seconds on the clock
26690 24 IsTime0 Tells you whether the current time is 0. None 1 (True) if all parts of the clock are 0, 0 (False) otherwise.
41970 1A GetCharacterID Gets the ID of the specified character, or the current character if the chosen character doesn't exist. char index a character ID
41E30 62 GiveMagneticBarrier Gives a magnetic barrier to the specified character. char character Unknown
41EA0 62 GiveBarrier Gives a barrier to the specified character. char character Unknown
41F10 67 GiveInvincibility Gives an invincibility powerup to the specified character. int character Unknown
7D940 109 LoadTailsOpponent Loads Tails' opponent for action stages. short character (must be 2), short loopnum (must be 1), short level (2,4,6,8 or 9) Nothing
7ED60 C4 Load2PTails Loads Tails as the second player. pointer to P1's master object struct pointer to Tails' AI object?
B6050 87 LoadCharBoss Loads a character for a boss fight. int bossnum (1=Sonic;2,3=Knuckles;4,5=Gamma) pointer to character object, 0 if loading failed

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