Spyro 1 Reverse Engineering
Decompilation of functions from Spyro 1 into human readable C
 
Loading...
Searching...
No Matches
spyro.h
Go to the documentation of this file.
1#ifndef SPYRO_H
2#define SPYRO_H
3
4#include "common.h"
5
6//*~~~~~~~~~
7//*Constants
8//*~~~~~~~~~
9
10typedef enum SpyroStates
11{
14 WALKING = 0x2,
15 END_WALK = 0x3,
16 PIVOT = 0x4,
17 JUMP = 0x5,
18 FLOP = 0x6,
20 ROLL_LEFT = 0x9,
22 CHARGE = 0xB,
23 BONK = 0xC,
26 GLIDE = 0xF,
28 WHIRLWIND = 0x11,
33 HURT_ROLL = 0x16,
38 HURT_YAW = 0x1B,
40 DROWNING = 0x1D,
41 DEATH_SPIN = 0x1E,
43 SUPERFLY = 0x20,
46 IDLE_SIT = 0x27,
47 SUPERCHARGE = 0x2C
49
54typedef struct Spyro
55{
56
57 struct Vec3 position; //? Spyro's position vector.
58
59 struct Angle_u8 RelativeSparxAngle; //? Something to do with sparx's rotation based on spyros angle I think.
60
61 char pad1;
64
65 char currentAnim; //? Spyros current animation.
66 char nextAnim; //? Spyros next animation.
67
72
73 char currentKeyfame; //? The current animation keyframe.
74 char nextKeyframe; //? The next animation keyframe.
75
83 char unkown3;
84
85
86 RGBA_u8 colorFilter; //? The color filter to apply to spyro. Used during fairy kiss, electric shock, etc.
87
89 short unkown4;
90 int pad2;
96 int pad3;
97 int pad4;
98 int pad5;
100
101 char animSpeed; //? The speed at which to play the animations.
102
113
114 int state; //? Spyro's current state.
115
116 int subState; //? Spyro's current substate.
117
118 int framesInCurrentState; //? The amount of frames spent in the current state. Used for calculations for jumping, boking, damage, time sensitive states, etc
119
122
124
125 int timer_framesIdle; //? The amount of frames you have spent idleing.
126
127 int timer_framesInAir; //? The amount of frames spyro has spent in the air.
128
129
142
143
144
145 struct Vec3 groundedChargeMomentum; //? Spyro's grounded charge momentum vector.
146
147 struct Vec3 walkingMomentum; //? Spyro's walking momentum vector.
148
149 struct Vec3 groundedChargeMomentum2; //? Spyro's groundedChargeMomentum vector again? Unsure.
150
151 struct Vec3 airMomentum; //? Spyro's air momentum vector.
152
159
161
162 struct Angle angle; //? Spyro's angle vector.
163
171
172 int walkingAcceleration; //? Spyro's walking acceleration.
173
176
177 int hasUsedGlide; //? bool for if Spyro has used glide or not yet, since can only use once in this game.
178
179 int isGliding; //? bool for if Spyro is currently gliding.
180
182
183 int isGrounded; //? bool for if Spyro is currently grounded.
184
185 int iFramesTimer; //? Timer for the amount of invincibility frames Spyro should have. Counts down to 0 every frame unless set every frame to a value.
186
187 int health; //? Spyro's health value. Sparx's color get's set based on this value.
188
189 int drownTimer; //? Timer for the amount of time left to drown I think, I didn't double check lol.
190
192
193 int isOverGoop; //? bool for if Spyro is currently over goop.
194
196
198
199 struct Vec3 lastGroundedPosition; //? Spyro's last grounded position vector.
200
204
206
210
211 SpyroHeadAngle TargetHeadAngle; //? Spyro's target head angle vector.
212
213 SpyroHeadAngle headAngle; //? Spyro's head angle vector.
214
218
224
228
231
232 int isMovementLocked; //? Value for if spyro can input or not. Counts down from any value to 0 every frame if not set every frame to a value manually.
233
235
257
258 int canSuperfly; //? bool for if Spyro can superfly or not.
259 int isOnSuperchargeGround; //? bool for if Spyro is on supercharge ground or not.
260
262
263 int rollMomentum; //? Spyro's roll momentum.
264 int pitchMomentum; //? Spyro's pitch momentum.
265
266
267}Spyro;
268
269//*~~~~~~~~~~~~~~~~~
270//*In Game Variables
271//*~~~~~~~~~~~~~~~~~
272
283extern Spyro _spyro;
284
285
286// All of these below can be accessed through the spyro struct above, but I figuerd it be helpful to have all these addresses labled for the documentation
287
292extern int _spyroXPosition;
293
298extern int _spyroYPosition;
299
304extern int _spyroZPosition;
305
310extern int _spyroAngleYaw;
311
316extern int _spyroAnglePitch;
317
322extern int _spyroAngleRoll;
323
330
336extern int _spyroState;
337
343extern int _spyroSubState;
344
351
357
363
369
374extern int _spyroAbsoluteMomentum;
375
381extern int _spyroHasUsedGlide;
382
387extern int _spyroIsGliding;
388
393extern int _spyroIsGrounded;
394
400extern int _spyroIFramesTimer;
401
407extern int _spyroHealth;
408
414extern int _spyroIsMovementLocked;
415
422extern int _spyroCanSuperFly;
423
430extern int _spyroIsOnSuperchargeGround; // end of labeled_global_variables
432
433#endif //SPYRO_H
int _spyroAbsoluteMomentum
Spyros absolute momentum as a scalar. Address: 0x80078b70.
int _spyroAnglePitch
Spyro's Pitch Rotation Angle Address: 0x80078b78.
Vec3 _spyroGroundedChargeMomentum
Spyros grouded charging momentum vector. Address: 0x80078b28.
int _spyroYPosition
Spyro's Y Position Coordinate Address: 0x80078A5C.
int _spyroIsMovementLocked
A timer that stops the player from being able to move spyro. Address: 0x80078c48.
int _spyroFramesInCurrentState
The amount of time in frames spent in the current state. Address: 0x80078ad8.
int _spyroHealth
Spyros current health Address: 0x80078bbc.
int _spyroAngleRoll
Spyro's Roll Rotation Angle Address: 0x80078b7C.
int _spyroZPosition
Spyro's Z Position Coordinate 0x80078A60.
int _spyroHasUsedGlide
bool for if Spyro has used his glide or not yet. Address: 0x80078ba8
int _spyroIsGliding
bool for if Spyro is currently gliding or not. Address: 0x80078bac
RGBA_u8 _spyroColorFilter
This is the color filter applied on top of spyro in RGBA format Address: 0x80078a80.
int _spyroCanSuperFly
A bool for if spyro can superfly currently. Address: 0x80078ca4.
Vec3 _spyroWalkingChargeMomentum
Spyros walking momentum vector. Address: 0x80078b34.
int _spyroAngleYaw
Spyro's Yaw Rotation Angle Address: 0x80078b74.
int _spyroSubState
This is spyro's current active sub-state. Address: 0x80078ad4.
int _spyroIFramesTimer
Timer for how many more frames spyro should have invulnerability. Address: 0x80078bb8.
int _spyroState
This is spyro's current active state. Address: 0x80078ad0s.
int _spyroIsOnSuperchargeGround
A bool for if spyro is currently on supercharge ground. Address: 0x80078ca8.
int _spyroXPosition
Spyro's X Position Coordinate Address: 0x80078A58.
Spyro _spyro
This is where the 1 instance of the spyro struct is. Address: 0x80078A58.
int _spyroIsGrounded
bool for if Spyro is currently grounded or not. Address: 0x80078bb4
Vec3 _spyroAirMomentum
Spyros air momentum vector. Address: 0x80078b4c.
SpyroStates
Definition spyro.h:11
@ DEATH_SQUISHED
Definition spyro.h:42
@ IDLE_LOOK_AROUND
Definition spyro.h:29
@ LEDGE_PEER
Definition spyro.h:24
@ SUPERCHARGE
Definition spyro.h:47
@ DROWNING
Definition spyro.h:40
@ JUMP
Definition spyro.h:17
@ PIVOT
Definition spyro.h:16
@ CHARGING_AIR
Definition spyro.h:31
@ SUPERFLY_ASCENDING
Definition spyro.h:44
@ CANNON_ROTATE
Definition spyro.h:37
@ ROLL_LEFT
Definition spyro.h:20
@ WHIRLWIND
Definition spyro.h:28
@ ROLL_DOWN_SLOPE
Definition spyro.h:30
@ SUPERFLY_DESCENDING
Definition spyro.h:45
@ BONK
Definition spyro.h:23
@ HURT_PITCH_LOW
Definition spyro.h:39
@ END_WALK
Definition spyro.h:15
@ IDLE_SIT
Definition spyro.h:46
@ CHARGING_AIR_SC_JUMP
Definition spyro.h:35
@ TRIANGLE_DROP
Definition spyro.h:27
@ WALKING
Definition spyro.h:14
@ HURT_SQUISHED
Definition spyro.h:36
@ UPHILL_WALK
Definition spyro.h:32
@ HURT_YAW
Definition spyro.h:38
@ BEGIN_WALK
Definition spyro.h:13
@ FLOP
Definition spyro.h:18
@ SUPERFLY
Definition spyro.h:43
@ DEATH_SPIN
Definition spyro.h:41
@ HURT_ZAPPED
Definition spyro.h:19
@ HURT_ROLL
Definition spyro.h:33
@ GLIDE
Definition spyro.h:26
@ HURT_PITCH_HIGH
Definition spyro.h:25
@ CHARGE
Definition spyro.h:22
@ IDLE_STANDING
Definition spyro.h:12
@ PULL_BACK_GLIDE
Definition spyro.h:34
@ ROLL_RIGHT
Definition spyro.h:21
Definition vector.h:58
This is the main Spyro struct.
Definition spyro.h:55
int unkown41
Definition spyro.h:238
int unkown6
Definition spyro.h:92
int unkown33
Definition spyro.h:201
int unkown54
Definition spyro.h:251
int isOnSuperchargeGround
Definition spyro.h:259
int unkown_angleRelated8
Definition spyro.h:153
int unkown39
Definition spyro.h:227
int maybe_smokeFlameStuff3
Definition spyro.h:221
int unkown49
Definition spyro.h:246
struct Vec3 airMomentum
Definition spyro.h:151
struct Vec3 position
Definition spyro.h:57
int maybe_smokeFlameStuff2
Definition spyro.h:220
int unkown51
Definition spyro.h:248
char unkown12
Definition spyro.h:105
int unkown25
Definition spyro.h:169
int unkown22
Definition spyro.h:166
int unkown23
Definition spyro.h:167
int subState
Definition spyro.h:116
char maybe_animSpeedRelatedDupe1
Definition spyro.h:81
int unkown_angleRelated6
Definition spyro.h:140
char currentAnim
Definition spyro.h:65
struct Vec3 groundedChargeMomentum2
Definition spyro.h:149
struct Vec3 lastGroundedPosition
Definition spyro.h:199
int maybe_tailRelated
Definition spyro.h:229
char maybe_AnimSpeedRelated
Definition spyro.h:80
int maybe_tailAnimRelated
Definition spyro.h:110
char maybe_keyframeDupe1
Definition spyro.h:76
char maybe_animSpeedRelatedDupe2
Definition spyro.h:82
int unkown_angleRelated
Definition spyro.h:131
int maybe_animUpdateRelated
Definition spyro.h:99
int unkown58
Definition spyro.h:255
int unkown_portalRelated
Definition spyro.h:136
int unkown57
Definition spyro.h:254
int unkown47
Definition spyro.h:244
struct Vec3 groundedChargeMomentum
Definition spyro.h:145
char nextKeyframe
Definition spyro.h:74
int unkown34
Definition spyro.h:202
int unkown13
Definition spyro.h:111
int turnAcceleration
Definition spyro.h:174
int unkown56
Definition spyro.h:253
int unkown50
Definition spyro.h:247
int maybe_headRollTransitionSpeed
Definition spyro.h:215
int unkown53
Definition spyro.h:250
int rollMomentum
Definition spyro.h:263
char maybe_currentAnimDupe
Definition spyro.h:68
int unkown_angleRelated7
Definition spyro.h:141
int unkown_angleRelated4
Definition spyro.h:134
int state
Definition spyro.h:114
int isMovementLocked
Definition spyro.h:232
struct Vec3 maybe_positionRelative
Definition spyro.h:123
short unkown4
Definition spyro.h:89
int unkown32
Definition spyro.h:197
int unkown43
Definition spyro.h:240
int unkown_angleRelated3
Definition spyro.h:133
int neutralJumpZPos
Definition spyro.h:181
int drownTimer
Definition spyro.h:189
int unkown16
Definition spyro.h:154
int unkown55
Definition spyro.h:252
int unkown37
Definition spyro.h:225
int unkown42
Definition spyro.h:239
short maybe_weirdDamageAnimRelated
Definition spyro.h:88
int unkown2
Definition spyro.h:63
int timer_framesIdle
Definition spyro.h:125
int pitchMomentum
Definition spyro.h:264
char maybe_nextAnimDupe2
Definition spyro.h:71
RGBA_u8 colorFilter
Definition spyro.h:86
char pad1
Definition spyro.h:61
char animSpeed
Definition spyro.h:101
int isGliding
Definition spyro.h:179
char unkown10
Definition spyro.h:103
SpyroHeadAngle TargetHeadAngle
Definition spyro.h:211
int maybe_speedRelated
Definition spyro.h:164
int timer_framesInAir
Definition spyro.h:127
int unkown_anim1
Definition spyro.h:108
int unkown21
Definition spyro.h:165
int unkown18
Definition spyro.h:156
int unkownOops
Definition spyro.h:236
int unkown_portalRelated2
Definition spyro.h:137
int maybe_pitchRelatedFlag
Definition spyro.h:261
int maybe_flameChargeTimerRelated
Definition spyro.h:209
int maybe_isFlaming
Definition spyro.h:207
struct Angle angle
Definition spyro.h:162
int isOverGoop
Definition spyro.h:193
int maybe_headPitchTransitionSpeed
Definition spyro.h:216
char nextAnim
Definition spyro.h:66
SpyroHeadAngle headAngle
Definition spyro.h:213
int maybe_glideAndWalkOffLedgeZMomentum
Definition spyro.h:158
int unkown38
Definition spyro.h:226
int unkown9
Definition spyro.h:95
int unkown46
Definition spyro.h:243
int framesInCurrentState
Definition spyro.h:118
char unkown11
Definition spyro.h:104
int unkown_angleRelated5
Definition spyro.h:135
int unkown1
Definition spyro.h:62
int hasUsedGlide
Definition spyro.h:177
int unkown15
Definition spyro.h:121
int unkown24
Definition spyro.h:168
int isGrounded
Definition spyro.h:183
int absoluteMomentum
Definition spyro.h:160
int maybe_superchargeRelated
Definition spyro.h:191
int unkown17
Definition spyro.h:155
int unkown_landingMomentumRelated
Definition spyro.h:139
int canSuperfly
Definition spyro.h:258
int maybe_headAnimRelated2
Definition spyro.h:109
int unkown35
Definition spyro.h:203
int unkown8
Definition spyro.h:94
int pad4
Definition spyro.h:97
int pad2
Definition spyro.h:90
int unkown45
Definition spyro.h:242
int maybe_drowningRelated
Definition spyro.h:195
int autoFlameRelated
Definition spyro.h:205
int health
Definition spyro.h:187
int maybe_smokeFlameStuff4
Definition spyro.h:222
int unkown40
Definition spyro.h:237
int unkown5
Definition spyro.h:91
char maybe_keyframeDupe2
Definition spyro.h:77
int unkown_portalRelated3
Definition spyro.h:138
int unkown_angleRelated2
Definition spyro.h:132
int unkown36
Definition spyro.h:208
int maybe_chargeTimerRelated
Definition spyro.h:230
int unkown52
Definition spyro.h:249
char currentKeyfame
Definition spyro.h:73
int maybe_animStateRelated
Definition spyro.h:106
int maybe_headYawTransitionSpeed
Definition spyro.h:217
char maybe_keyframeDupe4
Definition spyro.h:79
struct Angle_u8 RelativeSparxAngle
Definition spyro.h:59
int z_Acceleration
Definition spyro.h:175
int unkown59
Definition spyro.h:256
int walkingAcceleration
Definition spyro.h:172
int unkown14
Definition spyro.h:120
int pad5
Definition spyro.h:98
int unkown44
Definition spyro.h:241
int unkown7
Definition spyro.h:93
char unkown3
Definition spyro.h:83
char maybe_nextAnimDupe
Definition spyro.h:69
int maybe_headAnimRelated
Definition spyro.h:107
struct Vec3 walkingMomentum
Definition spyro.h:147
char maybe_currentAnimDupe2
Definition spyro.h:70
int unkown26
Definition spyro.h:170
char maybe_keyframeDupe3
Definition spyro.h:78
int iFramesTimer
Definition spyro.h:185
int maybe_smokeFlameStuff5
Definition spyro.h:223
int maybe_tailAnimRelated2
Definition spyro.h:112
int unkown_heightRelated
Definition spyro.h:130
int maybe_smokeFlameStuff1
Definition spyro.h:219
int unkown19
Definition spyro.h:157
int maybe_weirdResearchThis
Definition spyro.h:234
int unkown48
Definition spyro.h:245
int pad3
Definition spyro.h:96
Definition vector.h:9