Spyro 1 Reverse Engineering
Decompilation of functions from Spyro 1 into human readable C
 
Loading...
Searching...
No Matches
Decompiled Functions

Functions

byte CdStatus (void)
 Returns the status of the CD Drive.
 
void DrawPrimitive (void *primitive)
 Draws a ps1 primitive to the screen.
 
void DrawArrow (HudMobyInfo *hudMobyInfo, uint timer, int leftOrRightArrow)
 Draws a blinking arrow facing left or right.
 
void DrawTextbox (int xBound1, int xBound2, int yBound1, int yBound2)
 Draws a black textbox with a gold border. You can specify the bounds.
 
char * DrawTextCapitals (char *text, int *textInfo, int spacing, char color)
 Draws a text string to the screen (Only capital characters allowed)
 
int DrawTextAll (char *text, int *capitalTextInfo, int *lowercaseTextInfo, int spacing, char color)
 Draws a text string to the screen (Capital & Lowercase allowed)
 
void ExitInventoryMenu (void)
 Handles the required steps for exiting the inventory menu.
 
int CalculateCompletionPercentage (void)
 Returns the current completion percentage.
 
int SinScaled (uint param_1)
 
void Vec3Add (int *result, int *a, int *b)
 Adds vector 'a' and vector 'b' together, and stores the resulting vector in 'result'.
 
void Vec3Copy (int *dst, int *src)
 Copies the 'src' Vector to the 'dst' Vector.
 
void MatrixTranspose (uint *outputMatrix, uint *inputMatrix)
 

Detailed Description

Functions we have decompiled/reverse engineered to varying degrees.

Function Documentation

◆ CalculateCompletionPercentage()

int CalculateCompletionPercentage ( void  )

Returns the current completion percentage.

Returns the current completion percentage based on your gems, dragons, and eggs. (Except for when you are above 12000 gems.)

Returns
int - The current completion percentage.
Note
Function: CalculateCompletionPercentage
Original Address: 0x8002BB20
Hook File: calculate_completion_percentage.s
Prototype: misc_game.h
Amount of instructions: Same Amount (https://decomp.me/scratch/8Lz9x)

Definition at line 20 of file misc_game.c.

◆ CdStatus()

byte CdStatus ( void  )

Returns the status of the CD Drive.

Returns
byte - The CD drive status.
Note
Function: CdStatus
Original Address: 0x80063a8c
Hook File: cd_status.s
Prototype: cd.h
Amount of instructions: Same Amount (https://decomp.me/scratch/C9fPW)

Definition at line 21 of file cd.c.

◆ DrawArrow()

void DrawArrow ( HudMobyInfo *  hudMobyInfo,
uint  timer,
int  leftOrRightArrow 
)

Draws a blinking arrow facing left or right.

Fills out full moby struct into the pointer to the hud moby buffer

Parameters
void*hudMobyInfo - pointer to basic info about the arrow you want to draw (x, y, size)
uinttimer - timer that counts every frame to be used for the pre-determined 16 frame intervals.
intleftOrRightArrow - 0 for right, 1 for left
Note
Function: DrawArrow
Original Address: 0x80018534
Hook File: draw_arrow.s
Prototype: draw_stuff.h
Amount of instructions: Same Amount (https://decomp.me/scratch/IvMFp)

Definition at line 55 of file draw_stuff.c.

◆ DrawPrimitive()

void DrawPrimitive ( void *  primitive)

Draws a ps1 primitive to the screen.

Places a primitive struct ptr into the array of primitives to be drawn every frame (Somewhat unsure)

Parameters
void*hudMobyInfo - pointer to basic info about the arrow you want to draw (x, y, size)
Note
Function: DrawPrimitve
Original Address: 0x800168dc
Hook File: draw_primitive.s
Prototype: draw_stuff.h
Amount of instructions: Same Amount (https://decomp.me/scratch/wd3wE)

Definition at line 22 of file draw_stuff.c.

◆ DrawTextAll()

int DrawTextAll ( char *  text,
int *  capitalTextInfo,
int *  lowercaseTextInfo,
int  spacing,
char  color 
)

Draws a text string to the screen (Capital & Lowercase allowed)

Fills out a moby struct in the hud mobys array, using arguments for ASCII text

Parameters
char*text - text to be drawn.
int*capitalTextInfo - pointer to the desired location and size of the text.
int*lowercaseextInfo - pointer to the desired spacing and size of lowercase text.
intspacing - how much space between characters.
charcolor - color.
Note
Function: DrawTextAll
Original Address: 0x800181AC
Hook File: draw_text_all_hook.s
Prototype: n/a
See also
DrawTextCapitals()

Definition at line 89 of file draw_text.c.

◆ DrawTextbox()

void DrawTextbox ( int  xBound1,
int  xBound2,
int  yBound1,
int  yBound2 
)

Draws a black textbox with a gold border. You can specify the bounds.

Calls Draw primitive with the interesting hack they use for the alpha channel to achieve the black background, and also 4 draw lines for the border.

Parameters
intxBound1 - the first x boundry of the box
intxBound2 - the second x boundry of the box
intyBound1 - the first y boundry of the box
intyBound2 - the second y boundry of the box
Note
Function: DrawTextbox
Original Address: 0x8001860C
Hook File: draw_textbox.s
Prototype: draw_stuff.h
Amount of instructions: MORE IN MODDERN GCC (https://decomp.me/scratch/MrfVL)

Definition at line 94 of file draw_stuff.c.

◆ DrawTextCapitals()

char * DrawTextCapitals ( char *  text,
int *  textInfo,
int  spacing,
char  color 
)

Draws a text string to the screen (Only capital characters allowed)

Fills out a moby struct in the hud mobys array, using arguments for Capital ASCII text

Parameters
char*text - text to be drawn.
int*textInfo - pointer to the desired location and size of the text.
intspacing - how much space between characters.
charcolor - color.
Note
Function: DrawTextCapitals
Original Address: 0x80017fe4
Hook File: draw_text_capitals_hook.s
Prototype: n/a
See also
DrawTextAll()

Definition at line 22 of file draw_text.c.

◆ ExitInventoryMenu()

void ExitInventoryMenu ( void  )

Handles the required steps for exiting the inventory menu.

Places texture back into vram, sets gamestate to gameplay, resets hud timers, continues music, etc

Note
Function: ExitInventoryMenu
Original Address: 0x8002c7bc
Hook File: exit_inventory_menu.s
Prototype: menus.h
Amount of instructions: Same Amount (https://decomp.me/scratch/HuLXz)

Definition at line 17 of file menus.c.

◆ MatrixTranspose()

void MatrixTranspose ( uint *  outputMatrix,
uint *  inputMatrix 
)
Parameters
uint*outputMatrix
uint*inputMatrix
Note

Definition at line 68 of file vector.c.

◆ SinScaled()

int SinScaled ( uint  param_1)
Parameters
uint-
Returns
Note
Function: SinScaled
Original Address: 0x8002BB20
Hook File: sin_scaled.s
Prototype: misc_game.h
Amount of instructions: Same Amount (https://decomp.me/scratch/qiaz2)
See also
_sinArray

Definition at line 47 of file misc_game.c.

◆ Vec3Add()

void Vec3Add ( int *  result,
int *  a,
int *  b 
)

Adds vector 'a' and vector 'b' together, and stores the resulting vector in 'result'.

Parameters
int*result - The resulting vector.
int*a - The first vector to add.
int*b - The second vector to add.
Note
Function: Vec3Add
Original Address: 0x80017758
Hook File: vec3_add.s
Prototype: vector.h
Amount of instructions: Same Amount (https://decomp.me/scratch/8OigK)

Definition at line 20 of file vector.c.

◆ Vec3Copy()

void Vec3Copy ( int *  dst,
int *  src 
)

Copies the 'src' Vector to the 'dst' Vector.

Parameters
int*src - The source vector.
int*dst - The destination vector.
Note
Function: Vec3Copy
Original Address: 0x80017700
Hook File: vec3_copy.s
Prototype: vector.h
Amount of instructions: Same Amount (https://decomp.me/scratch/ycHxN)

Definition at line 47 of file vector.c.