Document some pokenav and region map
This commit is contained in:
1 parent
27c4329e45
commit
86354f1d50
65 files changed
+1477
-1453
No files matched your search
@@ -17,26 +17,24 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/rgb.h"
|
||||
|
||||
// Top Menu
|
||||
|
||||
struct Pokenav2Struct
|
||||
{
|
||||
bool32 (*callback)(void);
|
||||
bool32 (*isTaskActiveCB)(void);
|
||||
u32 loopedTaskId;
|
||||
u16 optionDescWindowId;
|
||||
u8 bg3ScrollTaskId;
|
||||
u8 cursorPos;
|
||||
bool8 otherIconsInMotion;
|
||||
u8 field_00d;
|
||||
bool8 pokenavAlreadyOpen;
|
||||
bool32 iconVisible[MAX_POKENAV_MENUITEMS];
|
||||
struct Sprite * field_028;
|
||||
struct Sprite * iconSprites[MAX_POKENAV_MENUITEMS][4];
|
||||
u16 bg1TilemapBuffer[0x400];
|
||||
};
|
||||
|
||||
static struct Pokenav2Struct * sub_81C9958(void);
|
||||
static bool32 sub_81C99FC(void);
|
||||
static u32 sub_81C9A10(s32 state);
|
||||
static struct Pokenav2Struct * OpenPokenavMenu(void);
|
||||
static bool32 GetCurrentLoopedTaskActive(void);
|
||||
static u32 LoopedTask_OpenMenu(s32 state);
|
||||
static u32 LoopedTask_MoveMenuCursor(s32 state);
|
||||
static u32 LoopedTask_OpenConditionMenu(s32 state);
|
||||
static u32 LoopedTask_ReturnToMainMenu(s32 state);
|
||||
@@ -337,59 +335,56 @@ static bool32 sub_81C98D4(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 sub_81C9924(void)
|
||||
bool32 OpenPokenavMenuInitial(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = sub_81C9958();
|
||||
struct Pokenav2Struct * state = OpenPokenavMenu();
|
||||
|
||||
if (unk == NULL)
|
||||
if (state == NULL)
|
||||
return FALSE;
|
||||
|
||||
unk->field_00d = 0;
|
||||
state->pokenavAlreadyOpen = FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool32 sub_81C9940(void)
|
||||
bool32 OpenPokenavMenuNotInitial(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = sub_81C9958();
|
||||
struct Pokenav2Struct * state = OpenPokenavMenu();
|
||||
|
||||
if (unk == NULL)
|
||||
if (state == NULL)
|
||||
return FALSE;
|
||||
|
||||
unk->field_00d = 1;
|
||||
state->pokenavAlreadyOpen = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct Pokenav2Struct * sub_81C9958(void)
|
||||
static struct Pokenav2Struct * OpenPokenavMenu(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = AllocSubstruct(2, sizeof(struct Pokenav2Struct));
|
||||
struct Pokenav2Struct * state = AllocSubstruct(2, sizeof(struct Pokenav2Struct));
|
||||
|
||||
if (unk != NULL)
|
||||
if (state != NULL)
|
||||
{
|
||||
unk->otherIconsInMotion = FALSE;
|
||||
unk->loopedTaskId = CreateLoopedTask(sub_81C9A10, 1);
|
||||
unk->callback = sub_81C99FC;
|
||||
state->otherIconsInMotion = FALSE;
|
||||
state->loopedTaskId = CreateLoopedTask(LoopedTask_OpenMenu, 1);
|
||||
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
|
||||
}
|
||||
|
||||
return unk;
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
void CreateMenuHandlerLoopedTask(s32 ltIdx)
|
||||
{
|
||||
struct Pokenav2Struct * unk = GetSubstructPtr(2);
|
||||
|
||||
unk->loopedTaskId = CreateLoopedTask(sMenuHandlerLoopTaskFuncs[ltIdx], 1);
|
||||
unk->callback = sub_81C99FC;
|
||||
struct Pokenav2Struct * state = GetSubstructPtr(2);
|
||||
state->loopedTaskId = CreateLoopedTask(sMenuHandlerLoopTaskFuncs[ltIdx], 1);
|
||||
state->isTaskActiveCB = GetCurrentLoopedTaskActive;
|
||||
}
|
||||
|
||||
bool32 sub_81C99C0(void)
|
||||
bool32 IsMenuHandlerLoopedTaskActive(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = GetSubstructPtr(2);
|
||||
|
||||
return unk->callback();
|
||||
struct Pokenav2Struct * state = GetSubstructPtr(2);
|
||||
return state->isTaskActiveCB();
|
||||
}
|
||||
|
||||
void sub_81C99D4(void)
|
||||
void FreeMenuHandlerSubstruct2(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = GetSubstructPtr(2);
|
||||
|
||||
@@ -400,14 +395,14 @@ void sub_81C99D4(void)
|
||||
FreePokenavSubstruct(2);
|
||||
}
|
||||
|
||||
static bool32 sub_81C99FC(void)
|
||||
static bool32 GetCurrentLoopedTaskActive(void)
|
||||
{
|
||||
struct Pokenav2Struct * unk = GetSubstructPtr(2);
|
||||
|
||||
return IsLoopedTaskActive(unk->loopedTaskId);
|
||||
}
|
||||
|
||||
static u32 sub_81C9A10(s32 state)
|
||||
static u32 LoopedTask_OpenMenu(s32 state)
|
||||
{
|
||||
struct Pokenav2Struct * unk = GetSubstructPtr(2);
|
||||
|
||||
@@ -466,12 +461,12 @@ static u32 sub_81C9A10(s32 state)
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
if (unk->field_00d)
|
||||
sub_81C7AC0(1);
|
||||
if (unk->pokenavAlreadyOpen)
|
||||
PokenavFadeScreen(1);
|
||||
else
|
||||
{
|
||||
PlaySE(SE_PN_ON);
|
||||
sub_81C7AC0(3);
|
||||
PokenavFadeScreen(3);
|
||||
}
|
||||
switch (GetPokenavMenuType())
|
||||
{
|
||||
@@ -741,7 +736,7 @@ static u32 LoopedTask_OpenPokenavFeature(s32 state)
|
||||
return LT_PAUSE;
|
||||
if (sub_81C8010())
|
||||
return LT_PAUSE;
|
||||
sub_81C7AC0(0);
|
||||
PokenavFadeScreen(0);
|
||||
return LT_INC_AND_PAUSE;
|
||||
case 3:
|
||||
if (IsPaletteFadeActive())
|
||||
|
||||
Reference in new issue
Block a user