Spyro 1 Reverse Engineering
Decompilation of functions from Spyro 1 into human readable C
 
Loading...
Searching...
No Matches
misc_game.c
Go to the documentation of this file.
1#include <common.h>
2#include <custom_types.h>
3
21{
22 int percentage;
23
24 percentage = ((_globalGemCount * 50) + (_globalDragonCount * 6000) + (_globalEggCount * 10000)) / 12000;
25 if (_globalGemCount > 12000) {
26 percentage = (_globalGemCount - 12000) / 100 + 100;
27 }
28 return percentage;
29}
30
31
47int SinScaled(uint param_1)
48{
49 uint uVar1;
50
51 uVar1 = (param_1 & 0xfff) >> 4;
52 if ((param_1 & 0xf) != 0) {
53 return ((int)((param_1 & 0xf) * ((int)_sinArray[uVar1 + 1] - (int)_sinArray[uVar1])) >>
54 4) + (int)_sinArray[uVar1];
55 }
56 return (int)_sinArray[uVar1];
57}
58
59 // end of reveresed_functions
unsigned int uint
short _globalGemCount
Total amount of global gems Address: 0x80075860.
int _globalEggCount
Total amount of global eggs Address: 0x80075810.
int _globalDragonCount
Total amount of global dragons Address: 0x80075750.
short _sinArray[256]
A scaled up sin lookup table Address: 0x8006cbf8.
int SinScaled(uint param_1)
Definition misc_game.c:47
int CalculateCompletionPercentage(void)
Returns the current completion percentage.
Definition misc_game.c:20