diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/event_data.h | 19 | ||||
-rw-r--r-- | include/party.h | 21 | ||||
-rw-r--r-- | include/pokemon.h | 3 | ||||
-rw-r--r-- | include/proto.h | 1 | ||||
-rw-r--r-- | include/save_block_2.h | 17 |
5 files changed, 44 insertions, 17 deletions
diff --git a/include/event_data.h b/include/event_data.h new file mode 100644 index 00000000..e1d46348 --- /dev/null +++ b/include/event_data.h @@ -0,0 +1,19 @@ +#ifndef GUARD_SCRIPT_STATE_H +#define GUARD_SCRIPT_STATE_H + +struct ScriptState +{ + u16 vars[288]; + u8 flags[364]; +}; + +u32 SavArray_Flags_sizeof(void); +void SavArray_Flags_init(struct ScriptState * state); +struct ScriptState * SavArray_Flags_get(struct SaveBlock2 * sav2); +BOOL CheckFlagInArray(struct ScriptState * state, u16 flag_id); +void SetFlagInArray(struct ScriptState * state, u16 flag_id); +void ClearFlagInArray(struct ScriptState * state, u16 flag_id); +u8 * GetFlagAddr(struct ScriptState * state, u16 flag_id); +u16 * GetVarAddr(struct ScriptState * state, u16 var_id); + +#endif //GUARD_SCRIPT_STATE_H diff --git a/include/party.h b/include/party.h index eca62239..2d06705c 100644 --- a/include/party.h +++ b/include/party.h @@ -2,19 +2,20 @@ #define POKEDIAMOND_PARTY_H #include "pokemon.h" +#include "save_block_2.h" BOOL PartyHasMon(struct PlayerParty * party_p, u16 species); int GetPartyCount(struct PlayerParty * party_p); struct Pokemon * GetPartyMonByIndex(struct PlayerParty * party_p, int idx); -u32 FUN_0206B8A4(void); -struct PlayerParty * FUN_0206B8AC(u32 heap_id); -void FUN_0206B8C0(struct PlayerParty * party); -void FUN_0206B8CC(struct PlayerParty * party, int count); -BOOL FUN_0206B900(struct PlayerParty * party, struct Pokemon * pokemon); -BOOL FUN_0206B938(struct PlayerParty * party, int pos); -void FUN_0206B9DC(struct PlayerParty * party, int pos, struct Pokemon * pokemon); -BOOL FUN_0206BA38(struct PlayerParty * party, int pos1, int pos2); -void FUN_0206BAD0(struct PlayerParty * src, struct PlayerParty * dest); -struct PlayerParty * FUN_0206BB1C(void * ptr); +u32 SavArray_Party_sizeof(void); +struct PlayerParty * SavArray_Party_alloc(u32 heap_id); +void SavArray_Party_init(struct PlayerParty * party); +void InitPartyWithMaxSize(struct PlayerParty * party, int count); +BOOL AddMonToParty(struct PlayerParty * party, struct Pokemon * pokemon); +BOOL RemoveMonFromParty(struct PlayerParty * party, int pos); +void ReplacePartySlotWithMon(struct PlayerParty * party, int pos, struct Pokemon * pokemon); +BOOL SwapSlotsInParty(struct PlayerParty * party, int pos1, int pos2); +void CopyPlayerParty(struct PlayerParty * src, struct PlayerParty * dest); +struct PlayerParty * SavArray_PlayerParty_get(struct SaveBlock2 * ptr); #endif //POKEDIAMOND_PARTY_H diff --git a/include/pokemon.h b/include/pokemon.h index 2387ef78..6148544f 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -9,7 +9,6 @@ #include "seals.h" #include "constants/pokemon.h" #include "string16.h" -#include "save_block_2.h" struct BaseStats { /* 0x00 */ u8 hp; @@ -199,6 +198,8 @@ struct PlayerParty struct Pokemon mons[PARTY_SIZE]; }; +#include "save_block_2.h" + void ZeroMonData(struct Pokemon * pokemon); void ZeroBoxMonData(struct BoxPokemon * boxmon); u32 SizeOfStructPokemon(void); diff --git a/include/proto.h b/include/proto.h index 506d0992..fb2f8a78 100644 --- a/include/proto.h +++ b/include/proto.h @@ -16,7 +16,6 @@ void FUN_02005E80(int); void FUN_02005E90(int, int, int, int); void FUN_020056AC(int, int, int, int, int); void FUN_020808AC(struct BoxPokemon *, int, int, int, int); -void * SavArray_get(void *, int); void StringExpandPlaceholders(u32 *, struct String *, struct String *); #endif //POKEDIAMOND_PROTO_H diff --git a/include/save_block_2.h b/include/save_block_2.h index ac5a2044..b086e566 100644 --- a/include/save_block_2.h +++ b/include/save_block_2.h @@ -1,18 +1,25 @@ #ifndef POKEDIAMOND_SAVE_BLOCK_2_H #define POKEDIAMOND_SAVE_BLOCK_2_H +#include "pokemon.h" + struct SaveBlock2 { - u16 playerName[OT_NAME_LENGTH + 1]; - u32 playerId; - u8 filler_14[4]; - u8 gender; - u8 padding[3]; + /* 0x00000 */ u16 playerName[OT_NAME_LENGTH + 1]; + /* 0x00010 */ u32 playerId; + /* 0x00014 */ u32 money; + /* 0x00018 */ u8 gender; + /* 0x00019 */ u8 origin; + /* 0x0001A */ u8 badges; + /* 0x0001B */ u8 avatar; + /* 0x0001C */ u8 filler_0001C[0x14]; + /* 0x00030 */ struct PlayerParty party; // TODO: finish this st ruct }; struct String * FUN_020239A0(struct SaveBlock2 *, u32 heap_id); u32 FUN_020239BC(struct SaveBlock2 *); u32 FUN_020239CC(struct SaveBlock2 *); +void * SavArray_get(struct SaveBlock2 *, int); #endif //POKEDIAMOND_SAVE_BLOCK_2_H |