diff options
author | Revo <projectrevotpp@hotmail.com> | 2020-08-20 01:39:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 01:39:17 -0400 |
commit | 4ed13afd18de6f0b94d35e83023094efcfec73f5 (patch) | |
tree | 1347c2688a313c4a70f3a205ab1cc79c496ed2fa /include/pokemon_storage_system.h | |
parent | 512d22cff9098f9c3636ca018355a851d011effc (diff) | |
parent | 3d2b7e5e5e3c43a8c5dc8c8ce255b0c53413048d (diff) |
Merge pull request #265 from PikalaxALT/pikalax_work
save.c, pokemon_storage_system.c
Diffstat (limited to 'include/pokemon_storage_system.h')
-rw-r--r-- | include/pokemon_storage_system.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h new file mode 100644 index 00000000..c9dc6f29 --- /dev/null +++ b/include/pokemon_storage_system.h @@ -0,0 +1,48 @@ +#ifndef POKEDIAMOND_POKEMON_STORAGE_SYSTEM_H +#define POKEDIAMOND_POKEMON_STORAGE_SYSTEM_H + +#include "pokemon.h" + +#define NUM_BOXES 18u +#define MONS_PER_BOX 30u +#define BOX_NAME_LENGTH 20u +#define NUM_DEFAULT_WALLPAPERS 16u +#define NUM_BONUS_WALLPAPERS 8u +#define NUM_WALLPAPERS ((u32)(NUM_DEFAULT_WALLPAPERS + NUM_BONUS_WALLPAPERS)) + +struct PCStorage +{ + /* 0x00000 */ u32 curBox; + /* 0x00004 */ struct BoxPokemon boxes[NUM_BOXES][MONS_PER_BOX]; + /* 0x11EE4 */ u16 names[NUM_BOXES][BOX_NAME_LENGTH]; + /* 0x121B4 */ u8 wallpapers[NUM_BOXES]; + /* 0x121C6 */ u8 unlockedWallpapers; + /* 0x121C7 */ u8 pad_byte; // suppresses mwcc warning +}; + +void PCStorage_init(struct PCStorage * pc); +u32 PCStorage_sizeof(void); +void PCStorage_InitializeBoxes(struct PCStorage * pc); +BOOL PCStorage_PlaceMonInFirstEmptySlotInAnyBox(struct PCStorage * pc, struct BoxPokemon * boxmon); +BOOL PCStorage_PlaceMonInBoxFirstEmptySlot(struct PCStorage * pc, int boxno, struct BoxPokemon * boxmon); +BOOL PCStorage_PlaceMonInBoxByIndexPair(struct PCStorage * pc, int boxno, int slotno, struct BoxPokemon * boxmon); +void PCStorage_DeleteBoxMonByIndexPair(struct PCStorage * pc, int boxno, int slotno); +int PCStorage_GetActiveBox(struct PCStorage * pc); +int PCStorage_FindFirstBoxWithEmptySlot(struct PCStorage * pc); +BOOL PCStorage_FindFirstEmptySlot(struct PCStorage * pc, int * boxno, int * slotno); +int PCStorage_CountMonsAndEggsInAllBoxes(struct PCStorage * pc); +void PCStorage_SetActiveBox(struct PCStorage * pc, int boxno); +u8 PCStorage_GetBoxWallpaper(struct PCStorage * pc, int boxno); +void PCStorage_SetBoxWallpaper(struct PCStorage * pc, int boxno, u8 wallpaper); +void PCStorage_GetBoxName(struct PCStorage * pc, int boxno, struct String * ret); +void PCStorage_SetBoxName(struct PCStorage * pc, int boxno, struct String * src); +int PCStorage_CountMonsAndEggsInBox(struct PCStorage * pc, int boxno); +int PCStorage_CountMonsInBox(struct PCStorage * pc, int boxno); +int PCStorage_CountMonsInAllBoxes(struct PCStorage * pc); +void PCStorage_SetBoxMonDataByIndexPair(struct PCStorage * pc, int boxno, int slotno, u32 attr, void * value); +struct BoxPokemon * PCStorage_GetMonByIndexPair(struct PCStorage * pc, int boxno, int slotno); +void PCStorage_UnlockBonusWallpaper(struct PCStorage * pc, int wallpaper); +BOOL PCStorage_IsBonusWallpaperUnlocked(struct PCStorage * pc, int wallpaper); +int PCStorage_CountUnlockedBonusWallpapers(struct PCStorage * pc); + +#endif //POKEDIAMOND_POKEMON_STORAGE_SYSTEM_H |