-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start Syncing HGSS Battle Loading - Preliminary cleanup #314
base: main
Are you sure you want to change the base?
Changes from all commits
b97f79c
c64cf90
856e02c
b5f5526
5a7b409
69425c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,48 +6,48 @@ | |
#include "pokemon.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Should we rename the files to |
||
#include "savedata.h" | ||
|
||
int PokedexData_SaveSize(void); | ||
PokedexData *PokedexData_Alloc(u32 heapID); | ||
void PokedexData_Copy(const PokedexData *src, PokedexData *dest); | ||
void PokedexData_Init(PokedexData *pokedexData); | ||
u16 PokedexData_CountCaught_National(const PokedexData *pokedexData); | ||
u16 PokedexData_CountSeen_National(const PokedexData *pokedexData); | ||
u16 PokedexData_CountSeen(const PokedexData *pokedexData); | ||
u16 PokedexData_CountCaught_Local(const PokedexData *pokedexData); | ||
u16 PokedexData_CountSeen_Local(const PokedexData *pokedexData); | ||
BOOL PokedexData_NationalDexCompleted(const PokedexData *pokedexData); | ||
BOOL PokedexData_LocalDexCompleted(const PokedexData *pokedexData); | ||
u16 PokedexData_NumCaught_National(const PokedexData *pokedexData); | ||
u16 PokedexData_NumCaught_Local(const PokedexData *pokedexData); | ||
BOOL PokedexData_HasCaughtSpecies(const PokedexData *pokedexData, u16 species); | ||
BOOL PokedexData_HasSeenSpecies(const PokedexData *pokedexData, u16 species); | ||
u32 PokedexData_GetForm_Spinda(const PokedexData *pokedexData, u8 formIndex); | ||
u32 PokedexData_DisplayedGender(const PokedexData *pokedexData, u16 species, int displaySecondary); | ||
u32 PokedexData_GetForm_Unown(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Unown(const PokedexData *pokedexData); | ||
u32 PokedexData_GetForm_Shellos(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Shellos(const PokedexData *pokedexData); | ||
u32 PokedexData_GetForm_Gastrodon(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Gastrodon(const PokedexData *pokedexData); | ||
u32 PokedexData_GetForm_Burmy(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Burmy(const PokedexData *pokedexData); | ||
u32 PokedexData_GetForm_Wormadam(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Wormadam(const PokedexData *pokedexData); | ||
u32 PokedexData_GetForm_Deoxys(const PokedexData *pokedexData, int formIndex); | ||
u32 PokedexData_NumFormsSeen_Deoxys(const PokedexData *pokedexData); | ||
void PokedexData_Encounter(PokedexData *pokedexData, Pokemon *pokemon); | ||
void PokedexData_Capture(PokedexData *pokedexData, Pokemon *pokemon); | ||
void PokedexData_ObtainNationalDex(PokedexData *pokedexData); | ||
BOOL PokedexData_IsNationalDexObtained(const PokedexData *pokedexData); | ||
BOOL PokedexData_CanDetectForms(const PokedexData *pokedexData); | ||
void PokedexData_TurnOnFormDetection(PokedexData *pokedexData); | ||
BOOL PokedexData_IsLanguageObtained(const PokedexData *pokedexData, u16 species, u32 languageIndex); | ||
void PokedexData_TurnOnLanguageDetection(PokedexData *pokedexData); | ||
BOOL PokedexData_CanDetectLanguages(const PokedexData *pokedexData); | ||
BOOL PokedexData_IsObtained(const PokedexData *pokedexData); | ||
void PokedexData_ObtainPokedex(PokedexData *pokedexData); | ||
PokedexData *SaveData_PokedexData(SaveData *saveData); | ||
u32 PokedexData_GetDisplayForm(const PokedexData *pokedexData, int species, int formIndex); | ||
u32 PokedexData_NumFormsSeen(const PokedexData *pokedexData, int species); | ||
int Pokedex_SaveSize(void); | ||
Pokedex *Pokedex_New(u32 heapID); | ||
void Pokedex_Copy(const Pokedex *src, Pokedex *dest); | ||
void Pokedex_Init(Pokedex *pokedex); | ||
u16 Pokedex_CountCaught_National(const Pokedex *pokedex); | ||
u16 Pokedex_CountSeen_National(const Pokedex *pokedex); | ||
u16 Pokedex_CountSeen(const Pokedex *pokedex); | ||
u16 Pokedex_CountCaught_Local(const Pokedex *pokedex); | ||
u16 Pokedex_CountSeen_Local(const Pokedex *pokedex); | ||
BOOL Pokedex_NationalDexCompleted(const Pokedex *pokedex); | ||
BOOL Pokedex_LocalDexCompleted(const Pokedex *pokedex); | ||
u16 Pokedex_NumCaught_National(const Pokedex *pokedex); | ||
u16 Pokedex_NumCaught_Local(const Pokedex *pokedex); | ||
BOOL Pokedex_HasCaughtSpecies(const Pokedex *pokedex, u16 species); | ||
BOOL Pokedex_HasSeenSpecies(const Pokedex *pokedex, u16 species); | ||
u32 Pokedex_GetForm_Spinda(const Pokedex *pokedex, u8 formIndex); | ||
u32 Pokedex_DisplayedGender(const Pokedex *pokedex, u16 species, int displaySecondary); | ||
u32 Pokedex_GetForm_Unown(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Unown(const Pokedex *pokedex); | ||
u32 Pokedex_GetForm_Shellos(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Shellos(const Pokedex *pokedex); | ||
u32 Pokedex_GetForm_Gastrodon(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Gastrodon(const Pokedex *pokedex); | ||
u32 Pokedex_GetForm_Burmy(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Burmy(const Pokedex *pokedex); | ||
u32 Pokedex_GetForm_Wormadam(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Wormadam(const Pokedex *pokedex); | ||
u32 Pokedex_GetForm_Deoxys(const Pokedex *pokedex, int formIndex); | ||
u32 Pokedex_NumFormsSeen_Deoxys(const Pokedex *pokedex); | ||
void Pokedex_Encounter(Pokedex *pokedex, Pokemon *pokemon); | ||
void Pokedex_Capture(Pokedex *pokedex, Pokemon *pokemon); | ||
void Pokedex_ObtainNationalDex(Pokedex *pokedex); | ||
BOOL Pokedex_IsNationalDexObtained(const Pokedex *pokedex); | ||
BOOL Pokedex_CanDetectForms(const Pokedex *pokedex); | ||
void Pokedex_TurnOnFormDetection(Pokedex *pokedex); | ||
BOOL Pokedex_IsLanguageObtained(const Pokedex *pokedex, u16 species, u32 languageIndex); | ||
void Pokedex_TurnOnLanguageDetection(Pokedex *pokedex); | ||
BOOL Pokedex_CanDetectLanguages(const Pokedex *pokedex); | ||
BOOL Pokedex_IsObtained(const Pokedex *pokedex); | ||
void Pokedex_ObtainPokedex(Pokedex *pokedex); | ||
Pokedex *SaveData_GetPokedex(SaveData *saveData); | ||
u32 Pokedex_GetDisplayForm(const Pokedex *pokedex, int species, int formIndex); | ||
u32 Pokedex_NumFormsSeen(const Pokedex *pokedex, int species); | ||
|
||
#endif // POKEPLATINUM_POKEDEX_DATA_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ enum PoketchScreenColor { | |
/** | ||
* @brief All of the Poketch's internally tracked data including settings, registered apps, and the data for some apps (eg. pedometer, alarm clock). | ||
*/ | ||
typedef struct PoketchData { | ||
typedef struct Poketch { | ||
u8 poketchEnabled : 1; | ||
u8 pedometerEnabled : 1; //!< Whether or not the pedometer is registered and will take step count updates. | ||
u8 dotArtModifiedByPlayer : 1; //!< Whether or not the dot art data has ever been modified by the user. This flag can never be set to FALSE. | ||
|
@@ -67,106 +67,106 @@ typedef struct PoketchData { | |
u16 icon; | ||
u32 form; | ||
} pokemonHistoryQueue[POKETCH_POKEMONHISTORY_MAX]; //!< The pokemon to display in the Pokemon History app | ||
} PoketchData; | ||
} Poketch; | ||
|
||
int Poketch_SaveSize(void); | ||
|
||
void Poketch_Init(PoketchData *poketchData); | ||
void Poketch_Init(Poketch *poketch); | ||
|
||
void PoketchData_Enable(PoketchData *poketchData); | ||
void PoketchData_Enable(Poketch *poketch); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Rename |
||
|
||
BOOL PoketchData_IsEnabled(PoketchData *poketchData); | ||
BOOL PoketchData_IsEnabled(Poketch *poketch); | ||
|
||
BOOL PoketchData_IsAppRegistered(PoketchData *poketchData, enum PoketchAppID appID); | ||
BOOL PoketchData_IsAppRegistered(Poketch *poketch, enum PoketchAppID appID); | ||
|
||
BOOL PoketchData_RegisterApp(PoketchData *poketchData, enum PoketchAppID appID); | ||
BOOL PoketchData_RegisterApp(Poketch *poketch, enum PoketchAppID appID); | ||
|
||
enum PoketchAppID PoketchData_CurrentAppID(const PoketchData *poketchData); | ||
enum PoketchAppID PoketchData_CurrentAppID(const Poketch *poketch); | ||
|
||
/** | ||
* Sets the current Poketch app to the next registered app, skipping unregistered App IDs and wrapping around if necessary. | ||
*/ | ||
int PoketchData_IncrementAppID(PoketchData *poketchData); | ||
int PoketchData_IncrementAppID(Poketch *poketch); | ||
|
||
/** | ||
* Sets the current Poketch app to the previous registered app, skipping unregistered App IDs and wrapping around if necessary. | ||
*/ | ||
int PoketchData_DecrementAppID(PoketchData *poketchData); | ||
int PoketchData_DecrementAppID(Poketch *poketch); | ||
|
||
u32 PoketchData_CurrentScreenColor(const PoketchData *poketchData); | ||
u32 PoketchData_CurrentScreenColor(const Poketch *poketch); | ||
|
||
/** | ||
* Sets the Poketch's color setting with values from the PoketchScreenColor enum above. | ||
* This function asserts that the given value is less than POKETCH_SCREEN_COLOR_MAX. | ||
*/ | ||
void PoketchData_SetScreenColor(PoketchData *poketchData, u32 screenColor); | ||
void PoketchData_SetScreenColor(Poketch *poketch, u32 screenColor); | ||
|
||
u32 PoketchData_StepCount(const PoketchData *poketchData); | ||
u32 PoketchData_StepCount(const Poketch *poketch); | ||
|
||
/** | ||
* Overwrites the current step count. This function will not do anything unless the Pedometer app is registered. | ||
*/ | ||
void PoketchData_SetStepCount(PoketchData *poketchData, u32 value); | ||
void PoketchData_SetStepCount(Poketch *poketch, u32 value); | ||
|
||
BOOL PoketchData_IsAlarmSet(const PoketchData *poketchData); | ||
BOOL PoketchData_IsAlarmSet(const Poketch *poketch); | ||
|
||
void PoketchData_AlarmTime(const PoketchData *poketchData, u32 *hour, u32 *minute); | ||
void PoketchData_AlarmTime(const Poketch *poketch, u32 *hour, u32 *minute); | ||
|
||
void PoketchData_SetAlarm(PoketchData *poketchData, BOOL enabled, u32 hour, u32 minute); | ||
void PoketchData_SetAlarm(Poketch *poketch, BOOL enabled, u32 hour, u32 minute); | ||
|
||
/** | ||
* Marks the given date on the Calendar app as highlighted. | ||
* Passing this function a new month will change the month on the calendar and clear all days except the given one. | ||
*/ | ||
void PoketchData_SetCalendarMark(PoketchData *poketchData, u32 month, u32 day); | ||
void PoketchData_SetCalendarMark(Poketch *poketch, u32 month, u32 day); | ||
|
||
/** | ||
* Clears the mark on the given date on the Calendar app. | ||
* Passing this function a new month will change the month on the calendar and clear every day. | ||
*/ | ||
void PoketchData_ClearCalendarMark(PoketchData *poketchData, u32 month, u32 day); | ||
void PoketchData_ClearCalendarMark(Poketch *poketch, u32 month, u32 day); | ||
|
||
BOOL PoketchData_CalendarMarked(const PoketchData *poketchData, u32 month, u32 day); | ||
BOOL PoketchData_CalendarMarked(const Poketch *poketch, u32 month, u32 day); | ||
|
||
/** | ||
* Sets the location of a map marker. Asserts that index is less than POKETCH_MAPMARKER_COUNT. | ||
*/ | ||
void PoketchData_SetMapMarker(PoketchData *poketchData, int index, u8 x, u8 y); | ||
void PoketchData_SetMapMarker(Poketch *poketch, int index, u8 x, u8 y); | ||
|
||
/** | ||
* Gets the location of a map marker. Asserts that index is less than POKETCH_MAPMARKER_COUNT. | ||
*/ | ||
void PoketchData_MapMarkerPos(const PoketchData *poketchData, int index, u8 *x, u8 *y); | ||
void PoketchData_MapMarkerPos(const Poketch *poketch, int index, u8 *x, u8 *y); | ||
|
||
/** | ||
* Checks whether or not the Dot Art data has been modified at any point. | ||
* This will return FALSE until PoketchData_ModifyDotArtData is called, at which point it will always return TRUE. | ||
*/ | ||
BOOL PoketchData_DotArtModified(const PoketchData *poketchData); | ||
BOOL PoketchData_DotArtModified(const Poketch *poketch); | ||
|
||
void PoketchData_CopyDotArtData(const PoketchData *poketchData, u8 *dst); | ||
void PoketchData_CopyDotArtData(const Poketch *poketch, u8 *dst); | ||
|
||
void PoketchData_ModifyDotArtData(PoketchData *poketchData, const u8 *src); | ||
void PoketchData_ModifyDotArtData(Poketch *poketch, const u8 *src); | ||
|
||
/** | ||
* Adds a new Pokemon to the end of the Pokemon History list. | ||
*/ | ||
void PoketchData_PokemonHistoryEnqueue(PoketchData *poketchData, const BoxPokemon *boxPokemon); | ||
void PoketchData_PokemonHistoryEnqueue(Poketch *poketch, const BoxPokemon *boxPokemon); | ||
|
||
int PoketchData_PokemonHistorySize(const PoketchData *poketchData); | ||
int PoketchData_PokemonHistorySize(const Poketch *poketch); | ||
|
||
/** | ||
* Gets the species and icon info of a given index in the Pokemon History. | ||
* This function asserts that index is less than POKETCH_POKEMONHISTORY_MAX. | ||
*/ | ||
void PoketchData_PokemonHistorySpeciesAndIcon(const PoketchData *poketchData, int index, int *species, int *icon); | ||
void PoketchData_PokemonHistorySpeciesAndIcon(const Poketch *poketch, int index, int *species, int *icon); | ||
|
||
/** | ||
* Gets the form info of a given index in the pokemon history. | ||
* This function asserts that index is less than POKETCH_POKEMONHISTORY_MAX. | ||
*/ | ||
u32 PoketchData_PokemonHistoryForm(const PoketchData *poketchData, int index); | ||
u32 PoketchData_PokemonHistoryForm(const Poketch *poketch, int index); | ||
|
||
PoketchData *SaveData_PoketchData(SaveData *saveData); | ||
Poketch *SaveData_PoketchData(SaveData *saveData); | ||
|
||
#endif // POKEPLATINUM_POKETCH_DATA_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Rename the ASM macros without the
ScrCmd_
prefix.Also, if you could document the arguments on the macro, that would be much appreciated. 🙏