align pokenav task funcs and update some pokenav menu bg gfx files

This commit is contained in:
Evan 2020-10-11 08:50:58 -06:00
parent 2b2be90a52
commit f4909b4d96
11 changed files with 55 additions and 54 deletions

View File

Before

Width:  |  Height:  |  Size: 141 B

After

Width:  |  Height:  |  Size: 141 B

View File

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

View File

@ -122,7 +122,7 @@ enum
POKENAV_REGION_MAP, POKENAV_REGION_MAP,
POKENAV_CONDITION_PARTY, POKENAV_CONDITION_PARTY,
POKENAV_CONDITION_SEARCH_RESULTS, POKENAV_CONDITION_SEARCH_RESULTS,
POKENAV_MENU_CONDITION_GRAPH_FROM_SEARCH, // opening condition graph from search list POKENAV_CONDITION_GRAPH_FROM_SEARCH, // opening condition graph from search list
POKENAV_RETURN_CONDITION_SEARCH, //return to search list from condition graph POKENAV_RETURN_CONDITION_SEARCH, //return to search list from condition graph
POKENAV_MATCH_CALL, POKENAV_MATCH_CALL,
POKENAV_RIBBONS_MON_LIST, POKENAV_RIBBONS_MON_LIST,

View File

@ -142,7 +142,7 @@ const struct PokenavCallbacks PokenavMenuCallbacks[15] =
.free1 = FreeSearchResultSubstruct1, .free1 = FreeSearchResultSubstruct1,
.free2 = FreeSearchResultSubstruct2, .free2 = FreeSearchResultSubstruct2,
}, },
[POKENAV_MENU_CONDITION_GRAPH_FROM_SEARCH - POKENAV_MENU_IDS_START] = [POKENAV_CONDITION_GRAPH_FROM_SEARCH - POKENAV_MENU_IDS_START] =
{ {
.init = PokenavCallback_Init_ConditionGraphFromSearch, .init = PokenavCallback_Init_ConditionGraphFromSearch,
.callback = GetPartyConditionCallback, .callback = GetPartyConditionCallback,

View File

@ -139,7 +139,7 @@ struct Pokenav7Struct
u8 filler2[0x38ac - 0x2909]; u8 filler2[0x38ac - 0x2909];
}; };
extern s8 GetMonMarkIndex(void); // This function's declaration here is different than its definition in pokenav_unk_6. u8/s8 extern s8 GetMonMarkIndex(void); // This function's declaration here is s8 vs. u8 in pokenav_conditions_1.c
u32 LoopedTask_OpenPartyConditionGraph(s32 state); u32 LoopedTask_OpenPartyConditionGraph(s32 state);
u32 GetPartyConditionLoopedTaskActive(void); u32 GetPartyConditionLoopedTaskActive(void);

View File

@ -29,7 +29,7 @@ struct PokenavSub7
s32 boxId; s32 boxId;
s32 monId; s32 monId;
u32 conditionDataId; u32 conditionDataId;
u32 unk18; u32 returnFromGraph;
u32 isPartyCondition; u32 isPartyCondition;
struct PokenavSub18 *monList; struct PokenavSub18 *monList;
}; };
@ -45,7 +45,7 @@ struct PokenavSub8
static u32 HandleConditionSearchInput_WaitSetup(struct PokenavSub7 *structPtr); static u32 HandleConditionSearchInput_WaitSetup(struct PokenavSub7 *structPtr);
static u32 HandleConditionSearchInput(struct PokenavSub7 *structPtr); static u32 HandleConditionSearchInput(struct PokenavSub7 *structPtr);
static u32 sub_81CF0B8(struct PokenavSub7 *structPtr); static u32 OpenConditionGraphFromSearchList(struct PokenavSub7 *structPtr);
static u32 ReturnToConditionSearchList(struct PokenavSub7 *structPtr); static u32 ReturnToConditionSearchList(struct PokenavSub7 *structPtr);
static u32 GetConditionSearchLoopedTask(s32 state); static u32 GetConditionSearchLoopedTask(s32 state);
static u32 BuildPartyMonSearchResults(s32 state); static u32 BuildPartyMonSearchResults(s32 state);
@ -140,7 +140,7 @@ bool32 PokenavCallback_Init_ConditionSearch(void)
structPtr->callback = HandleConditionSearchInput_WaitSetup; structPtr->callback = HandleConditionSearchInput_WaitSetup;
structPtr->loopedTaskId = CreateLoopedTask(GetConditionSearchLoopedTask, 1); structPtr->loopedTaskId = CreateLoopedTask(GetConditionSearchLoopedTask, 1);
structPtr->unk18 = 0; structPtr->returnFromGraph = 0;
structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()]; structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()];
return TRUE; return TRUE;
} }
@ -154,7 +154,7 @@ bool32 PokenavCallback_Init_ReturnToMonSearchList(void)
structPtr->monList = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST); structPtr->monList = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_LIST);
structPtr->callback = HandleConditionSearchInput; structPtr->callback = HandleConditionSearchInput;
structPtr->unk18 = 1; structPtr->returnFromGraph = 1;
structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()]; structPtr->conditionDataId = sSearchMonDataIds[GetSelectedConditionSearch()];
return TRUE; return TRUE;
} }
@ -200,7 +200,7 @@ static u32 HandleConditionSearchInput(struct PokenavSub7 *structPtr)
{ {
structPtr->monList->currIndex = GetSelectedPokenavListIndex(); structPtr->monList->currIndex = GetSelectedPokenavListIndex();
structPtr->isPartyCondition = 1; structPtr->isPartyCondition = 1;
structPtr->callback = sub_81CF0B8; structPtr->callback = OpenConditionGraphFromSearchList;
return CONDITION_SEARCH_FUNC_SELECT_MON; return CONDITION_SEARCH_FUNC_SELECT_MON;
} }
return CONDITION_SEARCH_FUNC_NONE; return CONDITION_SEARCH_FUNC_NONE;
@ -211,15 +211,15 @@ static u32 ReturnToConditionSearchList(struct PokenavSub7 *structPtr)
return POKENAV_CONDITION_SEARCH_MENU; return POKENAV_CONDITION_SEARCH_MENU;
} }
static u32 sub_81CF0B8(struct PokenavSub7 *structPtr) static u32 OpenConditionGraphFromSearchList(struct PokenavSub7 *structPtr)
{ {
return POKENAV_MENU_CONDITION_GRAPH_FROM_SEARCH; return POKENAV_CONDITION_GRAPH_FROM_SEARCH;
} }
static u32 sub_81CF0C0(void) static u32 sub_81CF0C0(void)
{ {
struct PokenavSub7 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS); struct PokenavSub7 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_CONDITION_SEARCH_RESULTS);
return structPtr->unk18; return structPtr->returnFromGraph;
} }
static struct PokenavMonList * GetSearchResultsMonDataList(void) static struct PokenavMonList * GetSearchResultsMonDataList(void)
@ -339,7 +339,7 @@ static u32 sub_81CF278(s32 state)
ptr->monList->monData[i].data = i + 1; ptr->monList->monData[i].data = i + 1;
} }
} }
ptr->unk18 = 1; ptr->returnFromGraph = 1;
return LT_FINISH; return LT_FINISH;
} }

View File

@ -81,14 +81,14 @@ static void InitMenuOptionGlow(void);
static void Task_CurrentMenuOptionGlow(u8 taskId); static void Task_CurrentMenuOptionGlow(u8 taskId);
static void SetMenuOptionGlow(void); static void SetMenuOptionGlow(void);
static const u16 sPokenavBgDotsPal[] = INCBIN_U16("graphics/pokenav/bg.gbapal"); static const u16 sPokenavBgDotsPal[] = INCBIN_U16("graphics/pokenav/bg_dots.gbapal");
static const u32 sPokenavBgDotsTiles[] = INCBIN_U32("graphics/pokenav/bg.4bpp.lz"); static const u32 sPokenavBgDotsTiles[] = INCBIN_U32("graphics/pokenav/bg_dots.4bpp.lz");
static const u32 sPokenavBgDotsTilemap[] = INCBIN_U32("graphics/pokenav/bg.bin.lz"); static const u32 sPokenavBgDotsTilemap[] = INCBIN_U32("graphics/pokenav/bg.bin.lz");
static const u16 sPokenavDeviceBgPal[] = INCBIN_U16("graphics/pokenav/outline.gbapal"); static const u16 sPokenavDeviceBgPal[] = INCBIN_U16("graphics/pokenav/device_outline.gbapal");
static const u32 sPokenavDeviceBgTiles[] = INCBIN_U32("graphics/pokenav/outline.4bpp.lz"); static const u32 sPokenavDeviceBgTiles[] = INCBIN_U32("graphics/pokenav/device_outline.4bpp.lz");
static const u32 sPokenavDeviceBgTilemap[] = INCBIN_U32("graphics/pokenav/outline_map.bin.lz"); static const u32 sPokenavDeviceBgTilemap[] = INCBIN_U32("graphics/pokenav/device_outline_map.bin.lz");
static const u16 gUnknown_08620104[] = INCBIN_U16("graphics/pokenav/blue_light.gbapal"); static const u16 sMatchCallBlueLightPal[] = INCBIN_U16("graphics/pokenav/blue_light.gbapal");
static const u32 gUnknown_08620124[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz"); static const u32 sMatchCallBlueLightTiles[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz");
static const struct BgTemplate sPokenavMainMenuBgTemplates[] = { static const struct BgTemplate sPokenavMainMenuBgTemplates[] = {
{ {
@ -118,7 +118,8 @@ static const struct BgTemplate sPokenavMainMenuBgTemplates[] = {
} }
}; };
static const LoopedTask sMenuHandlerLoopTaskFuncs[] = { static const LoopedTask sMenuHandlerLoopTaskFuncs[] =
{
[POKENAV_MENU_FUNC_NONE] = NULL, [POKENAV_MENU_FUNC_NONE] = NULL,
[POKENAV_MENU_FUNC_MOVE_CURSOR] = LoopedTask_MoveMenuCursor, [POKENAV_MENU_FUNC_MOVE_CURSOR] = LoopedTask_MoveMenuCursor,
[POKENAV_MENU_FUNC_OPEN_CONDITION] = LoopedTask_OpenConditionMenu, [POKENAV_MENU_FUNC_OPEN_CONDITION] = LoopedTask_OpenConditionMenu,
@ -138,7 +139,7 @@ static const struct CompressedSpriteSheet sPokenavOptionsSpriteSheets[] =
.tag = 0x0003 .tag = 0x0003
}, },
{ {
.data = gUnknown_08620124, .data = sMatchCallBlueLightTiles,
.size = 0x0100, .size = 0x0100,
.tag = 0x0001 .tag = 0x0001
} }
@ -151,7 +152,7 @@ static const struct SpritePalette sPokenavOptionsSpritePalettes[] =
{gPokenavOptions_Pal + 0x20, 6}, {gPokenavOptions_Pal + 0x20, 6},
{gPokenavOptions_Pal + 0x30, 7}, {gPokenavOptions_Pal + 0x30, 7},
{gPokenavOptions_Pal + 0x40, 8}, {gPokenavOptions_Pal + 0x40, 8},
{gUnknown_08620104, 3}, {sMatchCallBlueLightPal, 3},
{} {}
}; };