2021-07-07 16:39:34 +00:00
|
|
|
#ifndef GUARD_SAVE_H
|
|
|
|
#define GUARD_SAVE_H
|
2021-02-21 19:13:55 +00:00
|
|
|
|
2022-12-25 19:29:29 +00:00
|
|
|
#include "game_options.h"
|
2021-03-30 18:11:51 +00:00
|
|
|
#include "play_time.h"
|
2021-03-23 17:11:10 +00:00
|
|
|
#include "exclusive_pokemon.h"
|
|
|
|
#include "rescue_team_info.h"
|
2021-06-10 03:54:21 +00:00
|
|
|
#include "pokemon.h"
|
2023-09-02 05:46:26 +00:00
|
|
|
#include "items.h"
|
2023-01-07 00:37:46 +00:00
|
|
|
#include "code_80958E8.h"
|
2021-02-21 19:13:55 +00:00
|
|
|
|
2021-05-15 23:59:55 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SAVE_COMPLETED,
|
|
|
|
SAVE_NOT_WRTTEN,
|
|
|
|
SAVE_FAILED
|
|
|
|
};
|
|
|
|
|
2021-06-10 03:54:21 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
READ_SAVE_VALID,
|
|
|
|
READ_SAVE_FAILED,
|
|
|
|
READ_SAVE_CHECKSUM_ERROR
|
|
|
|
};
|
|
|
|
|
2023-09-21 02:26:35 +00:00
|
|
|
// size: 0x57D4
|
|
|
|
struct UnkStruct_sub_8011DAC
|
|
|
|
{
|
2021-02-21 19:13:55 +00:00
|
|
|
u8 fill000[0x4];
|
|
|
|
u8 unk004[0x400];
|
2023-01-07 00:37:46 +00:00
|
|
|
u8 gameInternalName[0x10]; // has "POKE_DUNGEON__05"
|
|
|
|
u32 checksum;
|
2021-02-21 19:13:55 +00:00
|
|
|
u32 unk418;
|
|
|
|
u32 unk41C;
|
2021-06-10 03:54:21 +00:00
|
|
|
u32 RngState;
|
|
|
|
u32 savedRecruitedPokemon;
|
2021-02-21 19:13:55 +00:00
|
|
|
u32 unk428;
|
|
|
|
u8 fill42C[0x4];
|
2023-01-07 00:37:46 +00:00
|
|
|
u32 savedTeamInventory;
|
2021-06-10 03:54:21 +00:00
|
|
|
u32 savedRescueTeamInfo;
|
2021-05-15 23:59:55 +00:00
|
|
|
u32 savedFriendAreas;
|
2021-02-21 19:13:55 +00:00
|
|
|
u32 unk43C;
|
|
|
|
u32 unk440;
|
2023-01-07 00:37:46 +00:00
|
|
|
u32 savedMailInfo;
|
2021-02-21 19:13:55 +00:00
|
|
|
u8 unk448[0x538C];
|
2020-10-09 20:16:49 +00:00
|
|
|
};
|
|
|
|
|
2023-09-21 02:26:35 +00:00
|
|
|
// size: 0x5C
|
|
|
|
struct UnkStruct_203B184
|
|
|
|
{
|
2023-09-02 05:46:26 +00:00
|
|
|
/* 0x0 */ TeamInventory *MoneyItems;
|
|
|
|
/* 0x4 */ unkStruct_203B45C *recruitedPokemon;
|
2023-09-02 11:36:59 +00:00
|
|
|
/* 0x8 */ unkStruct_203B480 *unk8;
|
|
|
|
/* 0xC */ unkStruct_203B484 *unkC;
|
2020-11-02 05:23:32 +00:00
|
|
|
/* 0x10 */ u32 *unk10;
|
2023-09-02 11:36:59 +00:00
|
|
|
/* 0x14 */ unkStruct_203B48C *unk14;
|
2023-09-09 04:31:17 +00:00
|
|
|
/* 0x18 */ unkStruct_203B490 *mailInfo;
|
2021-03-23 17:11:10 +00:00
|
|
|
/* 0x1C */ struct RescueTeamData *RescueTeamInfo;
|
2023-09-01 05:14:34 +00:00
|
|
|
/* 0x20 */ struct unkStruct_203B494 *unk20;
|
2021-03-23 17:11:10 +00:00
|
|
|
/* 0x24 */ struct ExclusivePokemonData *ExclusivePokemon;
|
2021-06-10 03:54:21 +00:00
|
|
|
/* 0x28 */ bool8 *BoughtFriendAreas;
|
2023-09-02 11:43:05 +00:00
|
|
|
/* 0x2C */ GameOptions *gameOptions;
|
2021-02-21 19:13:55 +00:00
|
|
|
/* 0x30 */ struct PlayTimeStruct *playTime;
|
2020-10-09 20:16:49 +00:00
|
|
|
u32 unk34;
|
|
|
|
u32 unk38;
|
|
|
|
u32 unk3C;
|
|
|
|
u32 unk40;
|
|
|
|
u32 unk44;
|
|
|
|
u32 unk48;
|
|
|
|
u8 *unk04C;
|
|
|
|
u32 unk050;
|
|
|
|
u32 unk054;
|
2021-06-10 03:54:21 +00:00
|
|
|
u32 RngState;
|
2020-10-09 20:16:49 +00:00
|
|
|
};
|
|
|
|
|
2021-02-21 19:13:55 +00:00
|
|
|
u32 sub_8011C1C(void);
|
|
|
|
void sub_8011C28(u32 in);
|
|
|
|
s32 sub_8011C34(void);
|
|
|
|
void sub_8011C40(s32 in);
|
2023-01-07 00:37:46 +00:00
|
|
|
char *GetGameInternalName(void);
|
2021-02-21 19:13:55 +00:00
|
|
|
void sub_8011CA8(u32 *out, s32 size);
|
2021-05-15 23:59:55 +00:00
|
|
|
u32 ReadSaveFromPak(u32 *a);
|
2022-11-12 00:49:48 +00:00
|
|
|
u32 WriteSavetoPak(s32 *param_1, u32 param_2);
|
2021-02-21 19:13:55 +00:00
|
|
|
u32 sub_8011F9C(s32 *r0, u8 *dest, s32 size);
|
2021-09-24 05:49:43 +00:00
|
|
|
u32 sub_8011FA8(void);
|
2021-05-15 23:59:55 +00:00
|
|
|
bool8 IsSaveCorrupted(void);
|
2021-02-21 19:13:55 +00:00
|
|
|
void sub_8012284(void);
|
|
|
|
void sub_8012298(void);
|
|
|
|
void sub_80122A8(void);
|
|
|
|
|
|
|
|
void sub_8012298();
|
|
|
|
void sub_80122D0();
|
|
|
|
void sub_80122F4();
|
2021-05-23 21:19:35 +00:00
|
|
|
void InitializePlayerData();
|
2021-02-21 19:13:55 +00:00
|
|
|
void sub_80122A8();
|
|
|
|
|
|
|
|
u32 ReadSaveSector(s32 *a, u8 *dest, s32 size);
|
|
|
|
u32 WriteSaveSector(s32 *a, u8 *src, s32 size);
|
|
|
|
void CalculateChecksum(u8 *out, u32 size);
|
|
|
|
bool8 ValidateChecksum(u8 *in, u32 size);
|
|
|
|
|
2023-09-09 23:53:10 +00:00
|
|
|
s32 sub_80121D4(s32 *a, u8 *src, s32 size);
|
2023-09-07 08:11:25 +00:00
|
|
|
u32 sub_80121E0(u32);
|
|
|
|
|
|
|
|
#endif // GUARD_SAVE_H
|