-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from lhearachel/start-game
Document game_start overlay and relevant save blocks
- Loading branch information
Showing
207 changed files
with
2,228 additions
and
2,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,51 @@ | ||
#ifndef POKEPLATINUM_BERRY_DATA_H | ||
#define POKEPLATINUM_BERRY_DATA_H | ||
|
||
#include "struct_decls/struct_berry_data_decl.h" | ||
|
||
#include "narc.h" | ||
#include "strbuf.h" | ||
|
||
// These must be #defines for csv2bin | ||
#define FIRMNESS_VERY_SOFT 1 | ||
#define FIRMNESS_SOFT 2 | ||
#define FIRMNESS_HARD 3 | ||
#define FIRMNESS_VERY_HARD 4 | ||
#define FIRMNESS_SUPER_HARD 5 | ||
|
||
/* | ||
* Constructs a new NARC which contains an open FSFile to the berry data archive. | ||
* | ||
* @param heapID: ID of the heap to alloc from | ||
* | ||
* @returns: Pointer to the newly-allocated NARC | ||
*/ | ||
NARC *BerryData_NARC_ctor(u32 heapID); | ||
|
||
BerryData *sub_020973A8(NARC *param0, u32 param1, u32 param2); | ||
enum BerryAttribute { | ||
BERRYATTR_SIZE = 0, | ||
BERRYATTR_FIRMNESS, | ||
BERRYATTR_YIELD_CATEGORY, | ||
BERRYATTR_STAGE_DURATION, | ||
BERRYATTR_MOISTURE_DRAIN_RATE, | ||
BERRYATTR_SPICINESS, | ||
BERRYATTR_DRYNESS, | ||
BERRYATTR_SWEETNESS, | ||
BERRYATTR_BITTERNESS, | ||
BERRYATTR_SOURNESS, | ||
BERRYATTR_SMOOTHNESS, | ||
}; | ||
|
||
typedef struct BerryData { | ||
u16 size; | ||
u8 firmness; | ||
u8 yieldCategory; | ||
u8 stageDuration; | ||
u8 moistureDrainRate; | ||
u8 spiciness; | ||
u8 dryness; | ||
u8 sweetness; | ||
u8 bitterness; | ||
u8 sourness; | ||
u8 smoothness; | ||
} BerryData; | ||
|
||
/* | ||
* Closes the wrapped FSFile and returns the NARC allocation to the heap from whence it came. | ||
* | ||
* @param narc: Pointer to the NARC | ||
*/ | ||
NARC *BerryData_NARC_ctor(u32 heapID); | ||
BerryData *BerryData_LoadFromOpenNARC(NARC *narc, u32 memberIdx, u32 heapID); | ||
void BerryData_NARC_dtor(NARC *narc); | ||
|
||
/* | ||
* Creates a new buffer large enough to hold the data of the specified | ||
* NARC member in 'nuts_data.narc', then reads the data. | ||
* | ||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data | ||
* @param heapID: ID of the heap to alloc from | ||
* | ||
* @returns: Pointer to the allocated buffer which contains the data that was read. | ||
*/ | ||
BerryData *BerryData_LoadDataByNarcMemberIndex(u32 index, u32 heapID); | ||
|
||
/* | ||
* Creates a new buffer large enough to hold the data of the | ||
* specified berry, then reads the data from nuts_data.narc | ||
* | ||
* @param itemID: Item ID of the berry for which to read the data | ||
* @param heapID: ID of the heap to alloc from | ||
* | ||
* @returns: Pointer to the allocated buffer which contains the data that was read. | ||
*/ | ||
BerryData *BerryData_Load(u32 memberIdx, u32 heapID); | ||
BerryData *BerryData_LoadDataByItemID(u32 itemID, u32 heapID); | ||
|
||
/* | ||
* Retrieves the value of the specified attribute from a BerryData buffer | ||
* | ||
* @param berryData: Pointer to the buffer holding the berry data | ||
* @param attributeID: ID of the attribute to retrieve the value for | ||
* | ||
* @returns: The value of the specified attribute | ||
*/ | ||
u32 BerryData_GetAttribute(BerryData *berryData, u32 attributeID); | ||
|
||
/* | ||
* Creates a new string buffer large enough to hold the | ||
* name of the specified berry, then reads the string. | ||
* | ||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data | ||
* @param heapID: ID of the heap to alloc from | ||
* | ||
* @returns: Pointer to the allocated buffer which contains the string that was read. | ||
*/ | ||
Strbuf *BerryData_AllocAndGetName(u16 index, u32 heapID); | ||
|
||
/* | ||
* Creates a new string buffer large enough to hold the | ||
* description of the specified berry, then reads the string. | ||
* | ||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data | ||
* @param heapID: ID of the heap to alloc from | ||
* | ||
* @returns: Pointer to the allocated buffer which contains the string that was read. | ||
*/ | ||
Strbuf *BerryData_AllocAndGetDescription(u16 index, u16 heapID); | ||
Strbuf *BerryData_AllocAndGetName(u16 memberIdx, u32 heapID); | ||
Strbuf *BerryData_AllocAndGetDescription(u16 memberIdx, u16 heapID); | ||
|
||
#endif // POKEPLATINUM_BERRY_DATA_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#ifndef POKEPLATINUM_BERRY_PATCHES_H | ||
#define POKEPLATINUM_BERRY_PATCHES_H | ||
|
||
#include "constants/heap.h" | ||
|
||
#define MAX_BERRY_PATCHES 128 | ||
|
||
enum BerryGrowthStage { | ||
BERRY_GROWTH_STAGE_NONE = 0, | ||
BERRY_GROWTH_STAGE_PLANTED, | ||
BERRY_GROWTH_STAGE_SPROUTED, | ||
BERRY_GROWTH_STAGE_GROWING, | ||
BERRY_GROWTH_STAGE_BLOOMING, | ||
BERRY_GROWTH_STAGE_FRUIT, | ||
}; | ||
|
||
enum MulchType { | ||
MULCH_TYPE_NONE = 0, | ||
MULCH_TYPE_GROWTH, | ||
MULCH_TYPE_DAMP, | ||
MULCH_TYPE_STABLE, | ||
MULCH_TYPE_GOOEY, | ||
}; | ||
|
||
enum SoilMoisture { | ||
SOIL_VERY_DRY = 0, | ||
SOIL_DRY, | ||
SOIL_MOIST, | ||
}; | ||
|
||
typedef struct BerryPatch { | ||
u8 berryID; | ||
u8 growthStage; | ||
u16 stageMinutesRemaining; | ||
u16 moistureMinutesRemaining; | ||
u8 replantCount; | ||
u16 yield; | ||
u8 moistureRating; | ||
u8 yieldRating; | ||
u8 mulchType; | ||
u8 isGrowing; | ||
} BerryPatch; | ||
|
||
typedef struct BerryGrowthData { | ||
u8 stageDuration; | ||
u8 moistureDrainRate; | ||
u8 yieldCategory; | ||
} BerryGrowthData; | ||
|
||
void BerryPatches_Clear(BerryPatch *patches); | ||
void BerryPatches_Init(BerryPatch *patches, enum HeapId heapID, const u16 *initPatches, int initSize); | ||
BerryGrowthData *BerryGrowthData_Init(enum HeapId heapID); | ||
enum BerryGrowthStage BerryPatches_GetPatchGrowthStage(const BerryPatch *patches, int patchID); | ||
int BerryPatches_GetPatchBerryID(const BerryPatch *patches, int patchID); | ||
enum SoilMoisture BerryPatches_GetPatchMoisture(const BerryPatch *patches, int patchID); | ||
int BerryPatches_GetPatchYieldRating(const BerryPatch *patches, int patchID); | ||
void BerryPatches_PlantInPatch(BerryPatch *patches, int patchID, const BerryGrowthData *growthData, int berryID); | ||
void BerryPatches_ResetPatchMoisture(BerryPatch *patches, int patchID); | ||
BOOL BerryPatches_IsPatchGrowing(const BerryPatch *patches, int patchID); | ||
void BerryPatches_SetIsPatchGrowing(BerryPatch *patches, int patchID, BOOL isGrowing); | ||
enum MulchType BerryPatches_GetPatchMulchType(const BerryPatch *patches, int patchID); | ||
void BerryPatches_SetPatchMulchType(BerryPatch *patches, int patchID, enum MulchType mulchType); | ||
int BerryPatches_GetPatchYield(const BerryPatch *patches, int patchID); | ||
int BerryPatches_HarvestPatch(BerryPatch *patches, int patchID); | ||
void BerryPatches_ElapseMinutes(BerryPatch *patches, const BerryGrowthData *growthData, int minutesPassed); | ||
|
||
#endif // POKEPLATINUM_BERRY_PATCHES_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#ifndef POKEPLATINUM_CONSTANTS_STRING_H | ||
#define POKEPLATINUM_CONSTANTS_STRING_H | ||
|
||
#define MON_NAME_LEN 10 | ||
#define TRAINER_NAME_LEN 7 | ||
#define TABLET_NAME_LEN 10 | ||
#define MOVE_NAME_LEN 16 | ||
#define MON_NAME_LEN 10 | ||
#define TRAINER_NAME_LEN 7 | ||
#define TABLET_NAME_LEN 10 | ||
#define MOVE_NAME_LEN 16 | ||
#define UNION_GROUP_NAME_LEN 7 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.