Mario Kart 64
Loading...
Searching...
No Matches
save.h
Go to the documentation of this file.
1#ifndef SAVE_H
2#define SAVE_H
3
4#include <PR/os.h>
5#include <common_structs.h>
6
7/* define symbols */
8
9#define CONTROLLER_1 0
10#define CONTROLLER_2 1
11#define CONTROLLER_3 2
12#define CONTROLLER_4 3
13
14#define PFS_NO_ERROR 0 // controller pak no error return
15#define PFS_NO_PAK_INSERTED 1 // no pak pressent or wrong device inserted into the controller
16#define PFS_PAK_BAD_READ 2 // controller pak error while data transfer
17#define PFS_PAK_CORRUPTED 3 // controller pak has courrupted or has weird data
18#define PFS_FILE_OVERFLOW 4 // too many files written to in the controller pak
19#define PFS_INVALID_DATA -1 // bad arguments, game note does not exist, osPfsInit was not called
20// controller pak test functions
21#define PFS_NUM_FILES_ERROR -2
22#define PFS_FREE_BLOCKS_ERROR -3
23#define PFS_PAK_STATE_OK -4
24
25#define NO_PAK 0
26#define PAK 1
27#define PAK_NOT_INSERTED -1
28
29/* Function Prototypes */
30
31void func_800B45E0(s32);
33void func_800B46D0(void);
34void func_800B4728(s32);
42void load_save_data(void);
43void func_800B4A9C(s32);
44void validate_save_data(void);
45void populate_time_trial_record(u8* timeTrialRecord, u32 time, s32 characterId);
49s32 func_800B4F2C(void);
53void func_800B536C(s32);
54void func_800B5404(s32, s32);
59s32 func_800B555C(void);
60s32 func_800B557C(void);
61void func_800B559C(s32);
73s32 func_800B5F30(void);
74s32 func_800B6014(void);
80void func_800B6708(void);
81void func_800B6798(void);
85s32 func_800B6A68(void);
86
87/* data */
88// these might not be in this file, but for now...
89
90extern u32* D_800DC714;
92
93extern u16 gCompanyCode;
94extern u32 gGameCode; // osPfs gamecode
95extern s8 gControllerPak1State; // Current state of Controller Pak 1
96
97extern s8 sControllerPak2State; // Current state of the Controller Pak 2
98extern const u8 D_800F2E60[];
99extern const u8 gGameName[];
100extern const u8 gExtCode[];
101extern u16 D_80162DD6;
102extern s32 D_80162DE0;
103extern s32 D_80162DFC;
104extern OSPfs gControllerPak1FileHandle;
105extern OSPfs gControllerPak2FileHandle;
106extern OSPfsState pfsState[16];
107extern s32 pfsError[16];
110extern s8 D_8018EDE5;
111extern s8 D_8018EDE6;
112extern s8 D_8018EDE7;
113
114#endif /* CODE_800B045E0_H */
s32 func_800B639C(s32)
Definition save.c:820
s32 func_800B65F4(s32, s32)
Definition save.c:901
struct_8018EE10_entry D_8018EE10[]
Definition save.c:22
s32 func_800B5B2C(s32)
const u8 gExtCode[]
Definition save.c:38
void func_800B559C(s32)
Definition save.c:447
s32 gControllerPak1MaxWriteableFiles
Definition code_80091750.c:85
void update_save_data_backup(void)
Definition save.c:526
s32 func_800B5020(u32, s32)
Definition save.c:278
u16 D_80162DD6
Definition staff_ghosts.c:48
u8 compute_save_data_checksum_backup_1(void)
Definition save.c:539
void populate_time_trial_record(u8 *timeTrialRecord, u32 time, s32 characterId)
Definition save.c:227
s8 gControllerPak1State
Definition save.c:27
void write_save_data_grand_prix_points_and_sound_mode(void)
Definition save.c:50
u32 gGameCode
Definition save.c:26
void func_800B6798(void)
Definition save.c:943
s32 func_800B557C(void)
Definition save.c:443
s32 func_800B6014(void)
Definition save.c:725
s32 D_80162DFC
Definition staff_ghosts.c:58
s32 check_for_controller_pak(s32)
Definition save.c:568
s32 func_800B6178(s32)
Definition save.c:762
void func_800B4A9C(s32)
Definition save.c:153
void func_800B6708(void)
Definition save.c:930
s32 func_800B578C(s32)
s32 pfsError[16]
Definition code_80091750.c:83
s32 func_800B6088(s32)
Definition save.c:741
u8 compute_save_data_checksum_1(void)
Definition save.c:119
u8 func_800B68F4(s32)
s32 controller_pak_2_status(void)
Definition save.c:648
u8 func_800B54C0(s32, s32)
Definition save.c:401
u32 * D_800DC714
Definition staff_ghosts.c:63
s32 func_800B69BC(s32)
Definition save.c:988
s32 func_800B5888(s32)
Definition save.c:506
void load_save_data(void)
Definition save.c:136
s8 D_8018EDE5
u8 func_800B5508(s32, s32, s32)
Definition save.c:419
s32 func_800B64EC(s32)
Definition save.c:866
void func_800B536C(s32)
Definition save.c:362
s8 D_8018EDE7
u8 func_800B60E8(s32)
Definition save.c:751
void reset_save_data_grand_prix_points_and_sound_mode(void)
Definition save.c:90
void validate_save_data(void)
Definition save.c:200
u32 func_800B4DF4(u8 *)
Definition save.c:241
s32 D_80162DE0
Definition staff_ghosts.c:51
s32 func_800B63F0(s32)
Definition save.c:830
u8 func_800B6828(s32)
Definition save.c:962
s32 func_800B5530(s32)
Definition save.c:430
s8 D_8018EDE6
s32 func_800B4E24(s32)
Definition save.c:251
u16 gCompanyCode
Definition save.c:25
u8 func_800B54EC(s32, s32)
Definition save.c:406
u8 compute_save_data_checksum_2(void)
Definition save.c:131
s32 controller_pak_1_status(void)
Definition save.c:586
OSPfs gControllerPak2FileHandle
Definition code_80091750.c:81
s32 func_800B58C4(s32)
Definition save.c:511
s32 validate_save_data_checksum_backup(void)
Definition save.c:556
const u8 gGameName[]
Definition save.c:34
s32 func_800B5218(void)
s32 func_800B6A68(void)
Definition save.c:1004
u32 func_800B4EB4(s32, s32)
Definition save.c:258
OSPfsState pfsState[16]
Definition code_80091750.c:82
s8 sControllerPak2State
Definition save.c:28
void func_800B4728(s32)
Definition save.c:69
void func_800B46D0(void)
Definition save.c:57
s32 func_800B4FB0(s32)
Definition save.c:272
void func_800B5404(s32, s32)
Definition save.c:379
s32 func_800B6348(s32)
Definition save.c:810
u8 checksum_time_trial_records(s32)
Definition save.c:103
s32 func_800B4F2C(void)
Definition save.c:265
const u8 D_800F2E60[]
Definition save.c:32
s32 gControllerPak1NumFilesUsed
Definition code_80091750.c:84
s32 func_800B5F30(void)
Definition save.c:699
void func_800B45E0(s32)
Definition save.c:41
s32 func_800B555C(void)
Definition save.c:438
OSPfs gControllerPak1FileHandle
Definition code_80091750.c:80
u8 compute_save_data_checksum_backup_2(void)
Definition save.c:551
Definition common_structs.h:380
signed int s32
Definition ultratypes.h:15
unsigned int u32
Definition ultratypes.h:16
signed char s8
Definition ultratypes.h:11
unsigned short int u16
Definition ultratypes.h:14
unsigned char u8
Definition ultratypes.h:12