Difference between revisions of "Sonic Adventure DX: PC/EXE Editing/Function List"
From Sonic Retro
MainMemory (talk | contribs) (This might be useful.) |
m (Text replacement - "{{SCHGuides}}" to "==References== <references /> {{SCHGuides}}") |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{SCHG | + | {{SCHG SA|3}} |
__NOTOC__ | __NOTOC__ | ||
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. | 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. | All values are in hex unless explicitly specified otherwise. | ||
− | {| class="prettytable" | + | {| class="prettytable" style="width:auto;" |
!Address||Size||Label||Description||Arguments||Returns | !Address||Size||Label||Description||Arguments||Returns | ||
|- | |- | ||
Line 19: | Line 19: | ||
| pointer to texture list header | | pointer to texture list header | ||
| Nothing | | Nothing | ||
+ | |- | ||
+ | | 74A0 | ||
+ | | 3A5 | ||
+ | | ProcessModelNode | ||
+ | | Renders a model, and any children/sibling models. | ||
+ | | pointer to [[SCHG:Sonic Adventure DX: PC/Model Editing#OBJECT Struct|OBJECT Struct]] for the model, int unknown, float unknown | ||
+ | | unknown | ||
|- | |- | ||
| B860 | | B860 | ||
Line 24: | Line 31: | ||
| ObjLoad | | ObjLoad | ||
| Loads an object. | | Loads an object. | ||
− | | unknown char | + | | char unknown, char unknown, pointer to object's code |
| pointer to [[SCHG:Sonic Adventure DX: PC/RAM Editing#Master Object Struct|master object struct]] for the loaded object, 0 if loading failed. | | pointer to [[SCHG:Sonic Adventure DX: PC/RAM Editing#Master Object Struct|master object struct]] for the loaded object, 0 if loading failed. | ||
|- | |- | ||
Line 33: | Line 40: | ||
| None | | None | ||
| Nothing | | 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 | | 144D0 | ||
Line 74: | Line 102: | ||
| Returns the current level and act values as a short. | | Returns the current level and act values as a short. | ||
| None | | None | ||
− | | act | (level << 8) | + | | act <nowiki>|</nowiki> (level << 8) |
|- | |- | ||
| 14670 | | 14670 | ||
Line 81: | Line 109: | ||
| Returns the previous level and act values as a short. | | Returns the previous level and act values as a short. | ||
| None | | None | ||
− | | prevact | (prevlevel << 8) | + | | prevact <nowiki>|</nowiki> (prevlevel << 8) |
|- | |- | ||
| 14690 | | 14690 | ||
Line 88: | Line 116: | ||
| Returns the next level and act values as a short. | | Returns the next level and act values as a short. | ||
| None | | None | ||
− | | nextact | (nextlevel << 8) | + | | nextact <nowiki>|</nowiki> (nextlevel << 8) |
|- | |- | ||
| 146B0 | | 146B0 | ||
| 27 | | 27 | ||
− | | | + | | LevelIsChaoGarden |
| Returns True (1) if the current level ID is 27, 28, 29, or 2A. | | Returns True (1) if the current level ID is 27, 28, 29, or 2A. | ||
| None | | None | ||
Line 117: | Line 145: | ||
| None | | None | ||
| Nothing | | 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 | | 23D70 | ||
Line 138: | Line 187: | ||
| None | | None | ||
| 1 if debug is enabled, 0 otherwise | | 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== | ||
+ | <references /> | ||
{{SCHGuides}} | {{SCHGuides}} | ||
− |
Latest revision as of 15:51, 24 March 2020
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