Skip to content

Commit

Permalink
Merge pull request #312 from Viperio19/journal-documentation
Browse files Browse the repository at this point in the history
Journal documentation
  • Loading branch information
lhearachel authored Dec 5, 2024
2 parents 2ae37a0 + 1fe4215 commit ad4db9b
Show file tree
Hide file tree
Showing 59 changed files with 823 additions and 854 deletions.
2 changes: 1 addition & 1 deletion include/field/field_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct FieldSystem_t {
int unk_90;
RadarChain *chain;
BagCursor *unk_98;
Journal *journal;
JournalEntry *journalEntry;
UnkStruct_ov5_021EF300 *unk_A0;
UnkStruct_ov5_021E1608 *unk_A4;
UnkStruct_ov5_021EFB30 *unk_A8;
Expand Down
4 changes: 2 additions & 2 deletions include/field_battle_data_transfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct FieldBattleDTO {
UnkStruct_0206D140 *unk_10C;
BattleRecords battleRecords;
GameRecords *records;
Journal *journal;
JournalEntry *journalEntry;
UnkStruct_02027F8C *unk_124;
int background;
enum Terrain terrain;
Expand Down Expand Up @@ -87,7 +87,7 @@ void FieldBattleDTO_AddPokemonToBattler(FieldBattleDTO *dto, Pokemon *src, int b
void FieldBattleDTO_CopyPartyToBattler(FieldBattleDTO *dto, const Party *src, int battler);
void FieldBattleDTO_CopyTrainerInfoToBattler(FieldBattleDTO *dto, const TrainerInfo *src, int battler);
void FieldBattleDTO_CopyChatotCryToBattler(FieldBattleDTO *dto, const ChatotCry *src, int battler);
void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fieldSystem, SaveData *save, enum MapHeader mapHeaderID, Journal *journal, BagCursor *bagCursor, u8 *subscreenCursorOn);
void FieldBattleDTO_InitFromGameState(FieldBattleDTO *dto, const FieldSystem *fieldSystem, SaveData *save, enum MapHeader mapHeaderID, JournalEntry *journalEntry, BagCursor *bagCursor, u8 *subscreenCursorOn);
void FieldBattleDTO_Init(FieldBattleDTO *dto, const FieldSystem *fieldSystem);
void FieldBattleDTO_InitWithNormalizedMonLevels(FieldBattleDTO *dto, const FieldSystem *fieldSystem, int level);
void FieldBattleDTO_InitWithPartyOrder(FieldBattleDTO *dto, const FieldSystem *fieldSystem, const Party *party, const u8 *partyOrder);
Expand Down
143 changes: 91 additions & 52 deletions include/journal.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,99 @@
#include "savedata.h"
#include "trainer_info.h"

typedef struct Journal_t Journal;
#define POKEMON_CAUGHT 1
#define POKEMON_DEFEATED 2

enum JournalDataType {
JOURNAL_TITLE = 0,
JOURNAL_UNK_04,
JOURNAL_MON,
JOURNAL_TRAINER,
JOURNAL_UNK_1C,
};

typedef struct {
u32 year : 7;
u32 month : 4;
u32 week : 3;
u32 day : 5;
u32 mapID : 13;
} JournalEntryTitle;

typedef struct {
u8 battleResult;
u8 stringVariant : 2;
u8 timeOfDay : 4;
u8 gender : 2;
u16 species;
} JournalEntryMon;

typedef struct {
u16 unk_00_0 : 1;
u16 trainerID : 15;
u16 mapID;
} JournalEntryTrainer;

typedef struct {
JournalEntryTitle title;
u32 unk_04[4];
JournalEntryMon mon;
JournalEntryTrainer trainer;
u8 unk_1C[2][42];
} JournalEntry;

int Journal_SaveSize(void);
void Journal_Init10(Journal *param0);
Journal *SaveData_GetJournal(SaveData *param0);
Journal *Journal_GetSavedPage(Journal *param0, BOOL param1);
BOOL Journal_CheckOpenOnContinue(Journal *param0, BOOL param1);
void Journal_SaveData(Journal *param0, void *param1, u8 param2);
void *sub_0202BC58(u16 param0, u32 param1);
void *sub_0202BCE4(u32 param0);
void *sub_0202BCF0(u32 param0);
void *sub_0202BCFC(u32 param0);
void *sub_0202BD08(u32 param0);
void *sub_0202BD14(u32 param0);
void *sub_0202BD20(u32 param0);
void *sub_0202BD2C(u32 param0);
void *sub_0202BD38(u32 param0);
void *sub_0202BD44(u16 param0, u32 param1);
void *sub_0202BD58(u16 param0, u16 param1, u32 param2);
void *sub_0202BD70(u16 param0, u32 param1);
void *sub_0202BD84(u16 param0, u32 param1);
void *sub_0202BD98(u16 param0, u32 param1);
void *sub_0202BDAC(u16 param0, u32 param1);
void *sub_0202BDC0(u16 param0, u32 param1);
void *sub_0202BDD4(u32 param0);
void *sub_0202BDE0(u32 param0);
void *sub_0202BDEC(u16 param0, u32 param1);
void *sub_0202BE00(u8 param0, u16 param1, u32 param2);
void *sub_0202BE14(u32 param0);
void *sub_0202BE20(u32 param0);
void *sub_0202BE2C(u32 param0, u32 param1);
void *sub_0202BE4C(const PlayTime *playTime, u16 param1, u8 param2, u8 param3, u32 param4);
void *sub_0202BECC(const PlayTime *playTime, u16 param1, u8 param2, u8 param3, u32 param4);
void *sub_0202BF4C(u16 param0, u16 param1, u32 param2);
void *sub_0202BFCC(u16 *param0, u8 param1, u8 param2, u32 param3);
void *sub_0202C00C(u16 *param0, u8 param1, u8 param2, u32 param3);
void *sub_0202C04C(u16 *param0, u16 *param1, u8 param2, u8 param3, u8 param4, u32 param5);
void *sub_0202C0AC(u16 *param0, u8 param1, u8 param2, u32 param3);
void *sub_0202C0EC(u16 *param0, u8 param1, u32 param2);
void *sub_0202C11C(u16 *param0, u8 param1, u16 *param2, u8 param3, u32 param4);
void *sub_0202C168(u32 param0);
void *sub_0202C174(u16 *param0, u8 param1, u8 param2, u32 param3);
void *sub_0202C1B4(u32 param0);
void *sub_0202C1C0(u8 param0, u32 param1);
void *sub_0202C1E0(u32 param0);
void *sub_0202C1EC(u16 *param0, u8 param1, u16 *param2, u8 param3, u32 param4);
void *sub_0202C238(u32 param0);
void *sub_0202C244(u32 param0, u32 param1);
void *sub_0202C250(const u16 *param0, u8 param1, u32 param2, u32 param3);
void *sub_0202C280(int param0, u32 param1, u32 param2);
void sub_0202C2A4(Journal *param0, void *param1, u8 param2, u8 param3);
void sub_0202C5C4(TrainerInfo *param0, Journal *param1, u32 param2, u32 param3, u32 param4);
void Journal_Init10(JournalEntry *journalEntry);
JournalEntry *SaveData_GetJournal(SaveData *saveData);
JournalEntry *Journal_GetSavedPage(JournalEntry *journalEntry, BOOL journalAcquired);
BOOL Journal_CheckOpenOnContinue(JournalEntry *journalEntry, BOOL journalAcquired);
void JournalEntry_SaveData(JournalEntry *journalEntry, void *data, u8 dataType);
void *JournalEntry_CreateTitle(u16 mapID, u32 heapID);
void *sub_0202BCE4(u32 heapID);
void *sub_0202BCF0(u32 heapID);
void *sub_0202BCFC(u32 heapID);
void *sub_0202BD08(u32 heapID);
void *sub_0202BD14(u32 heapID);
void *sub_0202BD20(u32 heapID);
void *sub_0202BD2C(u32 heapID);
void *sub_0202BD38(u32 heapID);
void *sub_0202BD44(u16 defeatedGym, u32 heapID);
void *sub_0202BD58(u16 trainerType, u16 trainerID, u32 heapID);
void *sub_0202BD70(u16 trainerID, u32 heapID);
void *sub_0202BD84(u16 trainerID, u32 heapID);
void *sub_0202BD98(u16 mapID, u32 heapID);
void *sub_0202BDAC(u16 mapLabelTextID, u32 heapID);
void *sub_0202BDC0(u16 mapLabelTextID, u32 heapID);
void *sub_0202BDD4(u32 heapID);
void *sub_0202BDE0(u32 heapID);
void *sub_0202BDEC(u16 param0, u32 heapID);
void *sub_0202BE00(u8 param0, u16 param1, u32 heapID);
void *sub_0202BE14(u32 heapID);
void *sub_0202BE20(u32 heapID);
void *sub_0202BE2C(u32 heapID, u32 param1);
void *JournalEntry_CreateMonCaught(const PlayTime *playTime, u16 species, u8 gender, u8 timeOfDay, u32 heapID);
void *JournalEntry_CreateMonDefeated(const PlayTime *playTime, u16 species, u8 gender, u8 timeOfDay, u32 heapID);
void *JournalEntry_InitTrainer(u16 mapID, u16 trainerID, u32 heapID);
void *sub_0202BFCC(u16 *param0, u8 param1, u8 param2, u32 heapID);
void *sub_0202C00C(u16 *param0, u8 param1, u8 param2, u32 heapID);
void *sub_0202C04C(u16 *param0, u16 *param1, u8 param2, u8 param3, u8 param4, u32 heapID);
void *sub_0202C0AC(u16 *param0, u8 param1, u8 param2, u32 heapID);
void *sub_0202C0EC(u16 *trainerName, u8 trainerGender, u32 heapID);
void *sub_0202C11C(u16 *param0, u8 param1, u16 *param2, u8 param3, u32 heapID);
void *sub_0202C168(u32 heapID);
void *sub_0202C174(u16 *param0, u8 param1, u8 param2, u32 heapID);
void *sub_0202C1B4(u32 heapID);
void *sub_0202C1C0(u8 param0, u32 heapID);
void *sub_0202C1E0(u32 heapID);
void *sub_0202C1EC(u16 *param0, u8 param1, u16 *param2, u8 param3, u32 heapID);
void *sub_0202C238(u32 heapID);
void *sub_0202C244(u32 heapID, u32 param1);
void *sub_0202C250(const u16 *param0, u8 param1, u32 heapID, u32 param3);
void *sub_0202C280(int param0, u32 heapID, u32 param2);
void JournalEntry_GetData(JournalEntry *journalEntry, void *dest, u8 dataType, u8 page);
void sub_0202C5C4(TrainerInfo *trainerInfo, JournalEntry *journalEntry, u32 currMapID, u32 prevMapID, u32 heapID);
u32 sub_0202C6A4(u32 param0);
void sub_0202C704(Journal *param0, u32 param1, u32 param2);
void sub_0202C720(Journal *param0, u16 param1, u16 param2, u32 param3);
void sub_0202C704(JournalEntry *journalEntry, u32 mapID, u32 heapID);
void sub_0202C720(JournalEntry *journalEntry, u16 mapID, u16 trainerID, u32 heapID);

#endif // POKEPLATINUM_JOURNAL_H
2 changes: 1 addition & 1 deletion include/map_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BOOL MapHeader_IsTeleportAllowed(u32 param0);
BOOL MapHeader_IsOnMainMatrix(u32 param0);
BOOL MapHeader_IsPokemonCenter(u32 param0);
BOOL MapHeader_IsCave(u32 param0);
BOOL sub_0203A288(u32 param0);
BOOL MapHeader_IsBuilding(u32 param0);
BOOL MapHeader_IsOutdoors(u32 param0);
BOOL sub_0203A2C8(u32 param0);
BOOL MapHeader_IsUnionRoom(const u32 param0);
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 @@ -39,7 +39,7 @@ typedef struct {
TrainerInfo *unk_270;
void *unk_274;
Options *unk_278;
Journal *unk_27C;
JournalEntry *unk_27C;
GameRecords *records;
SaveData *unk_284;
VarsFlags *unk_288;
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 @@ -12,7 +12,7 @@
typedef struct {
BgConfig *unk_00;
Window unk_04[4];
Journal *unk_44;
JournalEntry *unk_44;
TrainerInfo *unk_48;
SaveData *unk_4C;
MessageLoader *unk_50;
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 @@ -17,7 +17,7 @@ typedef struct {
TrainerInfo *unk_10;
Bag *unk_14;
Options *unk_18;
Journal *unk_1C;
JournalEntry *unk_1C;
BOOL unk_20;
BOOL unk_24;
} UnkStruct_ov82_0223B164;
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 @@ -23,7 +23,7 @@ typedef struct {
SaveData *unk_10;
UnkStruct_0202C878 *unk_14;
Options *unk_18;
Journal *unk_1C;
JournalEntry *unk_1C;
GameRecords *records;
PokedexData *unk_24;
int unk_28;
Expand Down
2 changes: 1 addition & 1 deletion include/overlay104/struct_ov104_02230BE4.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ typedef struct {
void *unk_00;
const Options *unk_04;
SaveData *unk_08;
Journal *unk_0C;
JournalEntry *unk_0C;
BagCursor *unk_10;
int unk_14;
int unk_18;
Expand Down
12 changes: 0 additions & 12 deletions include/struct_defs/struct_0202BC58.h

This file was deleted.

12 changes: 0 additions & 12 deletions include/struct_defs/struct_0202BE38.h

This file was deleted.

10 changes: 0 additions & 10 deletions include/struct_defs/struct_0202BF4C.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/struct_defs/struct_0203DDFC.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

typedef struct {
UnkStruct_0205C22C *unk_00;
Journal *unk_04;
JournalEntry *unk_04;
Options *unk_08;
} UnkStruct_0203DDFC;

Expand Down
2 changes: 1 addition & 1 deletion include/struct_defs/struct_0203DE34.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct {
UnkStruct_0205C22C *unk_04;
Options *unk_08;
GameRecords *records;
Journal *unk_10;
JournalEntry *unk_10;
} UnkStruct_0203DE34;

#endif // POKEPLATINUM_STRUCT_0203DE34_H
2 changes: 1 addition & 1 deletion include/struct_defs/struct_0203E0FC.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef struct {
SaveData *unk_20;
Options *unk_24;
GameRecords *records;
Journal *unk_2C;
JournalEntry *unk_2C;
Bag *unk_30;
int unk_34;
int unk_38;
Expand Down
2 changes: 1 addition & 1 deletion include/struct_defs/struct_0209C194_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct {
UnkStruct_0205C22C *unk_0C;
Options *unk_10;
GameRecords *records;
Journal *unk_18;
JournalEntry *unk_18;
FieldSystem *fieldSystem;
} UnkStruct_0209C194_1;

Expand Down
2 changes: 1 addition & 1 deletion include/unk_02049D08.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void sub_0204A4C8(UnkStruct_0204AFC4 *param0, SaveData *param1);
u16 sub_0204A578(UnkStruct_0204AFC4 *param0);
BOOL sub_0204A57C(UnkStruct_0204AFC4 *param0);
void sub_0204A660(UnkStruct_0204AFC4 *param0, SaveData *param1);
void sub_0204A7A4(UnkStruct_0204AFC4 *param0, SaveData *param1, Journal *param2);
void sub_0204A7A4(UnkStruct_0204AFC4 *param0, SaveData *param1, JournalEntry *param2);
void sub_0204A8C8(UnkStruct_0204AFC4 *param0);
void sub_0204A97C(UnkStruct_0204AFC4 *param0);
u16 sub_0204A9E0(UnkStruct_0204AFC4 *param0, u16 param1);
Expand Down
2 changes: 1 addition & 1 deletion include/unk_020933F8.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ u32 sub_02094904(UnkStruct_02095C48 *param0);
void sub_02094A58(UnkStruct_02095C48 *param0, int param1);
BOOL sub_02094B1C(UnkStruct_02095C48 *param0);
void sub_02094BB4(UnkStruct_02095C48 *param0, int *param1, int *param2, int *param3, int *param4, int *param5);
void sub_02094C44(UnkStruct_02095C48 *param0, SaveData *param1, u32 param2, Journal *param3);
void sub_02094C44(UnkStruct_02095C48 *param0, SaveData *param1, u32 param2, JournalEntry *param3);
u16 sub_02094E98(UnkStruct_02095C48 *param0);
u16 sub_02094EA0(u32 param0, u32 *param1);

Expand Down
2 changes: 1 addition & 1 deletion res/text/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ message_bank_files = files(
'message_bank_unk_0363.gmm',
'message_bank_unk_0364.gmm',
'message_bank_unk_0365.gmm',
'message_bank_unk_0366.gmm',
'message_bank_journal_entries.gmm',
'message_bank_unk_0367.gmm',
'message_bank_battle_strings.gmm',
'message_bank_unk_0369.gmm',
Expand Down
Loading

0 comments on commit ad4db9b

Please sign in to comment.