Skip to content

Commit

Permalink
Merge branch 'pret:main' into PoketchData_Calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
TrainerRiley authored Mar 24, 2024
2 parents 39978b4 + 8f2dd8c commit 1a61214
Show file tree
Hide file tree
Showing 351 changed files with 1,067 additions and 1,055 deletions.
5 changes: 4 additions & 1 deletion include/constants/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

enum HeapId {
HEAP_ID_SYSTEM = 0,

HEAP_ID_SAVE,
HEAP_ID_DEBUG,
HEAP_ID_APPLICATION,

HEAP_ID_BATTLE = 5,
};

Expand Down
70 changes: 70 additions & 0 deletions include/constants/savedata/save_table.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ifndef POKEPLATINUM_CONSTANTS_SAVE_TABLE_H
#define POKEPLATINUM_CONSTANTS_SAVE_TABLE_H

enum SaveBlockID {
SAVE_BLOCK_ID_NORMAL = 0,
SAVE_BLOCK_ID_BOXES,

SAVE_BLOCK_ID_MAX
};

enum SaveTableEntryID {
SAVE_TABLE_ENTRY_SYSTEM = 0,
SAVE_TABLE_ENTRY_PLAYER,
SAVE_TABLE_ENTRY_PARTY,
SAVE_TABLE_ENTRY_BAG,
SAVE_TABLE_ENTRY_EVENTS,
SAVE_TABLE_ENTRY_POKETCH,
SAVE_TABLE_ENTRY_FIELD_PLAYER_STATE,
SAVE_TABLE_ENTRY_POKEDEX,
SAVE_TABLE_ENTRY_DAYCARE,
SAVE_TABLE_ENTRY_PAL_PAD,
SAVE_TABLE_ENTRY_MISC,
SAVE_TABLE_ENTRY_FIELD_OVERWORLD_STATE,
SAVE_TABLE_ENTRY_UNDERGROUND,
SAVE_TABLE_ENTRY_REGULATION_BATTLES,
SAVE_TABLE_ENTRY_IMAGE_CLIPS,
SAVE_TABLE_ENTRY_MAIL,
SAVE_TABLE_ENTRY_POFFINS,
SAVE_TABLE_ENTRY_RANDOM_GROUP,
SAVE_TABLE_ENTRY_JOURNAL,
SAVE_TABLE_ENTRY_TRAINER_CARD,
SAVE_TABLE_ENTRY_GAME_RECORDS,
SAVE_TABLE_ENTRY_BALL_SEALS,
SAVE_TABLE_ENTRY_CHATOT,
SAVE_TABLE_ENTRY_FRONTIER,
SAVE_TABLE_ENTRY_RIBBONS,
SAVE_TABLE_ENTRY_ENCOUNTERS,
SAVE_TABLE_ENTRY_GLOBAL_TRADE,
SAVE_TABLE_ENTRY_TV_BROADCAST,
SAVE_TABLE_ENTRY_RANKINGS,
SAVE_TABLE_ENTRY_WIFI_LIST,
SAVE_TABLE_ENTRY_WIFI_HISTORY,
SAVE_TABLE_ENTRY_MYSTERY_GIFT,
SAVE_TABLE_ENTRY_PAL_PARK_TRANSFER,
SAVE_TABLE_ENTRY_CONTESTS,
SAVE_TABLE_ENTRY_SENTENCE,
SAVE_TABLE_ENTRY_EMAIL,
SAVE_TABLE_ENTRY_WIFI_QUESTIONS,
SAVE_TABLE_ENTRY_PC_BOXES,

SAVE_TABLE_ENTRY_MAX
};

enum ExtraSaveTableEntryID {
EXTRA_SAVE_TABLE_ENTRY_HALL_OF_FAME = 0,
EXTRA_SAVE_TABLE_ENTRY_FRONTIER,
EXTRA_SAVE_TABLE_ENTRY_MY_RECORDINGS,
EXTRA_SAVE_TABLE_ENTRY_DL_RECORDINGS_0,
EXTRA_SAVE_TABLE_ENTRY_DL_RECORDINGS_1,
EXTRA_SAVE_TABLE_ENTRY_DL_RECORDINGS_2,

EXTRA_SAVE_TABLE_ENTRY_MAX
};

#define SAVE_PAGE_MAX 32
#define SAVE_SECTOR_SIZE (0x1000)

#define EXTRA_SAVE_TABLE_ENTRY_NONE 0xFFFFFFFF

#endif // POKEPLATINUM_CONSTANTS_SAVE_TABLE_H
27 changes: 27 additions & 0 deletions include/constants/savedata/savedata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef POKEPLATINUM_CONSTANTS_SAVEDATA_H
#define POKEPLATINUM_CONSTANTS_SAVEDATA_H

enum {
LOAD_RESULT_EMPTY,
LOAD_RESULT_OK,
LOAD_RESULT_CORRUPT,
LOAD_RESULT_ERROR,
};

enum {
SAVE_RESULT_PROCEED,
SAVE_RESULT_PROCEED_FINAL,
SAVE_RESULT_OK,
SAVE_RESULT_CORRUPT,
};

#define SECTOR_SIGNATURE 0x20060623

#define NORMAL_LOAD_CORRUPT (1 << 0)
#define NORMAL_LOAD_ERROR (1 << 1)
#define FRONTIER_LOAD_CORRUPT (1 << 2)
#define FRONTIER_LOAD_ERROR (1 << 3)
#define VIDEO_LOAD_CORRUPT (1 << 4)
#define VIDEO_LOAD_ERROR (1 << 5)

#endif // POKEPLATINUM_CONSTANTS_SAVEDATA_H
2 changes: 1 addition & 1 deletion include/overlay004/ov4_021D0D80.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV4_021D0D80_H
#define POKEPLATINUM_OV4_021D0D80_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay004/funcptr_ov4_021D1104.h"
#include "overlay004/funcptr_ov4_021D1120.h"
#include "overlay004/funcptr_ov4_021D113C.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay005/ov5_021E622C.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "struct_decls/struct_0203CDB0_decl.h"
#include "pokemon.h"
#include "struct_decls/struct_party_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

u8 ov5_021E6238(UnkStruct_02026310 * param0);
int ov5_021E6270(UnkStruct_02026310 * param0);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay006/battle_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "struct_decls/struct_0207D3C0_decl.h"
#include "struct_decls/struct_0207D99C_decl.h"
#include "struct_defs/struct_0209C370.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay006/struct_ov6_02240D5C_sub1.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay006/ov6_02246BF4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define POKEPLATINUM_OV6_02246BF4_H

#include "struct_decls/struct_0203CDB0_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

BOOL ov6_02246BF4(SaveData * param0, UnkStruct_0203CDB0 * param1);

Expand Down
2 changes: 1 addition & 1 deletion include/overlay006/ov6_022475B0.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV6_022475B0_H
#define POKEPLATINUM_OV6_022475B0_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

void ov6_022475B0(SaveData * param0);
int ov6_02247624(SaveData * param0);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay007/ov7_0224BE9C.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define POKEPLATINUM_OV7_0224BE9C_H

#include "struct_decls/struct_02018340_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay007/struct_ov7_0224BEFC_decl.h"

UnkStruct_ov7_0224BEFC * ov7_0224BE9C(u32 param0, SaveData * param1, BGL * param2);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay007/struct_ov7_0224D008.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "struct_decls/struct_0202CD88_decl.h"
#include "struct_decls/struct_020507E4_decl.h"
#include "struct_defs/struct_0205AA50.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay005/struct_ov5_021D30A8.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay023/ov23_02241F74.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "trainer_info.h"
#include "struct_decls/struct_02029894_decl.h"
#include "struct_decls/struct_0203CDB0_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay023/struct_ov23_0224271C_decl.h"
#include "overlay023/funcptr_ov23_022427DC.h"
#include "overlay023/funcptr_ov23_022431EC.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay023/ov23_0224B05C.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "strbuf.h"
#include "struct_decls/struct_02029894_decl.h"
#include "struct_decls/struct_0203CDB0_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay023/struct_ov23_0224271C_decl.h"

void ov23_0224B144(void * param0, UnkStruct_0203CDB0 * param1);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay023/ov23_02253598.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "trainer_info.h"
#include "struct_decls/struct_0202855C_decl.h"
#include "struct_decls/struct_020298B0_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay023/struct_ov23_02253598_decl.h"
#include "overlay023/funcptr_ov23_02253834.h"

Expand Down
2 changes: 1 addition & 1 deletion include/overlay025/ov25_02253CE0.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "struct_decls/struct_02018340_decl.h"
#include "struct_decls/struct_0203CDB0_decl.h"
#include "poketch_data.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay025/struct_ov25_02253CE0_decl.h"
#include "overlay025/funcptr_ov25_02254238.h"
#include "overlay025/funcptr_ov25_02254238_1.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay057/ov57_021D0F30.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV57_021D0F30_H
#define POKEPLATINUM_OV57_021D0F30_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

void ov57_021D0F30(int param0, SaveData * param1);
void ov57_021D0F44(int param0, SaveData * param1);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay059/ov59_021D2B44.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "struct_decls/struct_0202440C_decl.h"
#include "struct_decls/struct_0202E794_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

u32 ov59_021D2B44(const SaveData * param0);
u32 ov59_021D2B4C(const SaveData * param0);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay059/ov59_021D2F88.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV59_021D2F88_H
#define POKEPLATINUM_OV59_021D2F88_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay059/struct_ov59_021D30E0.h"

void ov59_021D30E0(SaveData * param0, UnkStruct_ov59_021D30E0 * param1);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay061/ov61_0222AE60.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "struct_decls/struct_02029C68_decl.h"
#include "struct_decls/struct_02030A80_decl.h"
#include "struct_decls/struct_020797DC_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay061/struct_ov61_0222AE80.h"
#include "overlay061/struct_ov61_0222AFC0.h"
#include "overlay061/struct_ov61_0222AFCC.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay062/ov62_02248408.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define POKEPLATINUM_OV62_02248408_H

#include "struct_decls/struct_0202F264_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay006/battle_params.h"

void ov62_02248408(BattleRecording * param0, BattleParams * param1, int param2);
Expand Down
2 changes: 1 addition & 1 deletion include/overlay062/struct_ov62_022349A8.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "message.h"
#include "struct_decls/struct_0200B358_decl.h"
#include "strbuf.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay061/struct_ov61_0222B138.h"
#include "overlay061/struct_ov61_0222B920.h"
#include "overlay062/funcptr_ov62_022349A8.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay062/struct_ov62_02241130.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV62_02241130_H
#define POKEPLATINUM_STRUCT_OV62_02241130_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay062/funcptr_ov62_022349A8.h"
#include "overlay062/struct_ov62_022349A8_sub2.h"

Expand Down
2 changes: 1 addition & 1 deletion include/overlay065/struct_ov65_0222EBE0_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "struct_decls/struct_0202B370_decl.h"
#include "struct_defs/struct_0205AA50.h"
#include "struct_defs/struct_0207DFAC.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay061/struct_ov61_0222C3B0.h"
#include "overlay065/struct_ov65_0222E99C.h"
#include "overlay065/struct_ov65_02234E50.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/ov66_0222DDF0.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define POKEPLATINUM_OV66_0222DDF0_H

#include "trainer_info.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"
#include "overlay066/struct_ov66_0222E294.h"
#include "overlay066/struct_ov66_0222E71C_decl.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/ov66_02230C44.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV66_02230C44_H
#define POKEPLATINUM_OV66_02230C44_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DCE0_sub1.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"
#include "overlay066/struct_ov66_02230C90_decl.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/ov66_022324F0.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_OV66_022324F0_H
#define POKEPLATINUM_OV66_022324F0_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

#include "overlay066/struct_ov66_022324F0.h"
#include "overlay066/struct_ov66_02232B20.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_0222DCE0.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_0222DCE0_H
#define POKEPLATINUM_STRUCT_OV66_0222DCE0_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DCE0_sub1.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02230E68.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02230E68_H
#define POKEPLATINUM_STRUCT_OV66_02230E68_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"
#include "overlay070/struct_ov70_02263910.h"

Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02230F50.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02230F50_H
#define POKEPLATINUM_STRUCT_OV66_02230F50_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"
#include "overlay066/struct_ov66_02231428.h"
#include "overlay066/struct_ov66_02231560.h"
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02231024.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02231024_H
#define POKEPLATINUM_STRUCT_OV66_02231024_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DCE0_sub1.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"

Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02231134.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02231134_H
#define POKEPLATINUM_STRUCT_OV66_02231134_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_02230DBC.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02231300.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02231300_H
#define POKEPLATINUM_STRUCT_OV66_02231300_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay066/struct_ov66_02231374.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef POKEPLATINUM_STRUCT_OV66_02231374_H
#define POKEPLATINUM_STRUCT_OV66_02231374_H

#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"
#include "overlay066/struct_ov66_0222DFF8_decl.h"

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion include/overlay081/struct_ov81_021D1610.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "trainer_info.h"
#include "struct_decls/struct_0202B628_decl.h"
#include "struct_defs/struct_0205AA50.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

typedef struct {
BGL * unk_00;
Expand Down
2 changes: 1 addition & 1 deletion include/overlay082/struct_ov82_0223B164.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "struct_decls/struct_0202AB28_decl.h"
#include "struct_decls/struct_0202B628_decl.h"
#include "struct_decls/struct_0207D3C0_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

typedef struct {
u8 padding_00[4];
Expand Down
2 changes: 1 addition & 1 deletion include/overlay088/struct_ov88_0223C370.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "struct_decls/struct_0203CDB0_decl.h"
#include "pokemon.h"
#include "struct_decls/struct_party_decl.h"
#include "struct_decls/struct_021C0794_decl.h"
#include "savedata.h"

typedef struct {
UnkStruct_0203CDB0 * unk_00;
Expand Down
Loading

0 comments on commit 1a61214

Please sign in to comment.