-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathgame.c
115 lines (76 loc) · 2.51 KB
/
game.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include <game.h>
#include <wipe.h>
void StartupGame()
{
StartGame();
}
INCLUDE_ASM(const s32, "P2/game", func_00160090);
INCLUDE_ASM(const s32, "P2/game", search_level_by_load_data);
INCLUDE_ASM(const s32, "P2/game", search_level_by_id);
INCLUDE_ASM(const s32, "P2/game", PchzFriendlyFromWid);
INCLUDE_ASM(const s32, "P2/game", func_00160178);
INCLUDE_ASM(const s32, "P2/game", call_search_level_by_id);
INCLUDE_ASM(const s32, "P2/game", FFindLevel);
INCLUDE_ASM(const s32, "P2/game", func_001601D0);
INCLUDE_ASM(const s32, "P2/game", get_level_completion_by_id);
INCLUDE_ASM(const s32, "P2/game", tally_world_completion);
INCLUDE_ASM(const s32, "P2/game", get_game_completion__Fv);
INCLUDE_ASM(const s32, "P2/game", UnlockIntroCutsceneFromWid);
INCLUDE_ASM(const s32, "P2/game", DefeatBossFromWid);
INCLUDE_ASM(const s32, "P2/game", UnlockEndgameCutscenesFromFgs);
INCLUDE_ASM(const s32, "P2/game", PlayEndingFromCompletionFlags);
INCLUDE_ASM(const s32, "P2/game", InitGameState__FP2GS);
INCLUDE_ASM(const s32, "P2/game", FUN_00160650);
INCLUDE_ASM(const s32, "P2/game", SetupGame__FPci);
void UpdateGameState(float dt)
{
g_pgsCur->dt += dt;
g_pwsCur->dt += dt;
g_plsCur->dt += dt;
}
INCLUDE_ASM(const s32, "P2/game", LsFromWid);
INCLUDE_ASM(const s32, "P2/game", GrflsFromWid);
INCLUDE_ASM(const s32, "P2/game", UnloadGame__Fv);
INCLUDE_ASM(const s32, "P2/game", RetryGame__Fv);
void StartGame()
{
UnloadGame();
WipeToWorldWarp(D_00247AB0, OID_Nil, WIPEK_Fade);
}
INCLUDE_ASM(const s32, "P2/game", FUN_00160948);
INCLUDE_ASM(const s32, "P2/game", calculate_percent_completion);
void SetCcharm(int nParam)
{
g_pgsCur->ccharm = nParam;
}
INCLUDE_ASM(const s32, "P2/game", FCharmAvailable__Fv);
INCLUDE_ASM(const s32, "P2/game", func_00160C90);
int PfLookupDialog(LS *pls, OID oidDialog)
{
// todo figure out what these magic numbers represent
if (oidDialog - 0x33bU >= 0xc) {
return 0;
}
return -0xcd8 + (int)pls + (oidDialog * 4);
}
INCLUDE_ASM(const s32, "P2/game", clr_8_bytes_1);
void FUN_00160ce8(int param_1)
{
*(undefined4 *)(param_1 + 4) = 0;
}
void OnGameAlarmTriggered(GAME *pgame)
{
pgame->cAlarmsTriggered++;
}
void OnGameAlarmDisabled(GAME *pgame)
{
pgame->cAlarmsTriggered--;
}
INCLUDE_ASM(const s32, "P2/game", grfvault_something__Fv);
INCLUDE_ASM(const s32, "P2/game", GetBlueprintInfo);
int CcharmMost()
{
// Holdover from when there was a powerup that increased the charm limit
return 2;
}
INCLUDE_ASM(const s32, "P2/game", reload_post_death);