From ae29f35afdd7c79b08a729be689248359153f587 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 2 Mar 2018 16:34:31 +0100 Subject: start decompiling list menu --- include/list_menu.h | 36 ++++++++++++++++++++---------------- include/menu_indicators.h | 1 + 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/list_menu.h b/include/list_menu.h index 77d00bf97..d25549845 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -4,6 +4,10 @@ #define LIST_NOTHING_CHOSEN -1 #define LIST_B_PRESSED -2 +#define LIST_NO_MULTIPLE_SCROLL 0 +#define LIST_MULTIPLE_SCROLL_DPAD 1 +#define LIST_MULTIPLE_SCROLL_L_R 2 + // Exported type declarations // Exported RAM declarations @@ -20,27 +24,27 @@ struct ListMenuTemplate { const struct ListMenuItem *items; void (* moveCursorFunc)(u32, bool8, struct ListMenu *); - void (* unk_08)(u8, s32, u8); + void (* unk_08)(u8 windowId, s32 itemId, u8 y); u16 totalItems; u16 maxShowed; - u8 unk_10; + u8 windowId; u8 unk_11; u8 unk_12; u8 cursor_Y; - u32 upText_Y:4; // x1, x2, x4, x8 = xF - u32 cursorColor:4; // x10, x20, x40, x80 = xF0 - u32 fillColor:4; // x100, x200, x400, x800 = xF00 - u32 cursorShadowColor:4; // x1000, x2000, x4000, x8000 = xF000 - u32 unk_16_0:1; // x10000 - u32 spaceBetweenItems:6; // x20000, x40000, x80000, x100000, x200000, x400000 = x7E0000 - u32 unk_16_7:1; // x800000 - u32 unk_17_0:6; // x1000000, x2000000, x4000000, x8000000, x10000000, x20000000 = x3F000000 - u32 cursorKind:2; // x40000000, x80000000 + u8 upText_Y:4; // x1, x2, x4, x8 = xF + u8 cursorPal:4; // x10, x20, x40, x80 = xF0 + u8 fillPal:4; // x1, x2, x4, x8 = xF + u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0 + u8 lettersSpacing:3; + u8 unk_16_3:3; + u8 scrollMultiple:2; // x40, x80 = xC0 + u8 fontId:6; // x1, x2, x4, x8, x10, x20 = x3F + u8 cursorKind:2; // x40, x80 }; struct ListMenu { - struct ListMenuTemplate _template; + struct ListMenuTemplate template; u16 scrollOffset; u16 selectedRow; u8 unk_1C; @@ -53,10 +57,10 @@ extern struct ListMenuTemplate gMultiuseListMenuTemplate; // Exported ROM declarations -u8 ListMenuInit(struct ListMenuTemplate *template, u16 cursorPage, u16 cursorPosition); +u8 ListMenuInit(struct ListMenuTemplate *template, u16 scrollOffset, u16 selectedRow); s32 ListMenuHandleInputGetItemId(u8 listTaskId); -void sub_81AE860(u8 listTaskId, u16 *a1, u16 *a2); -void sub_81AE6C8(u8 listTaskId, u16 *a1, u16 *a2); -u8 ListMenuGetYCoordForPrintingArrowCursor(u8); +void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); +void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); +u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId); #endif //GUARD_LIST_MENU_H diff --git a/include/menu_indicators.h b/include/menu_indicators.h index b82e48725..b4cea11c7 100644 --- a/include/menu_indicators.h +++ b/include/menu_indicators.h @@ -18,5 +18,6 @@ u8 AddScrollIndicatorArrowPairParametrized(u8, u8, u8, u8, s32, u16, u16, u16 *) void RemoveScrollIndicatorArrowPair(u8); u8 AddScrollIndicatorArrowPair(const struct ArrowStruct*, void*); void sub_81AF15C(u8, u8, u8); +void ListMenuRemoveCursorObject(u8 taskId, u32 cursorKind); #endif //GUARD_MENU_INDICATORS_H -- cgit v1.2.3 From 87274b9eedfcc1881a82b826dec1a6d63858ff33 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 3 Mar 2018 01:02:07 +0100 Subject: more list menu work --- include/menu_indicators.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/menu_indicators.h b/include/menu_indicators.h index b4cea11c7..a099cffab 100644 --- a/include/menu_indicators.h +++ b/include/menu_indicators.h @@ -7,17 +7,31 @@ // Exported ROM declarations -struct ArrowStruct { +struct ArrowStruct +{ u8 unk0[6]; u16 unk6[4]; u8 unkE; }; +struct CursorStruct +{ + u8 unk0; + u8 unk1; + u16 unk2; + u16 unk4; + u16 unk6; + u16 unk8; + u8 unkA; +}; + void Task_ScrollIndicatorArrowPairOnMainMenu(u8); u8 AddScrollIndicatorArrowPairParametrized(u8, u8, u8, u8, s32, u16, u16, u16 *); void RemoveScrollIndicatorArrowPair(u8); u8 AddScrollIndicatorArrowPair(const struct ArrowStruct*, void*); void sub_81AF15C(u8, u8, u8); void ListMenuRemoveCursorObject(u8 taskId, u32 cursorKind); +void ListMenuUpdateCursorObject(u8 taskId, u16 x, u16 y, u32 cursorKind); +u8 ListMenuAddCursorObjectInternal(struct CursorStruct *cursor, u32 cursorKind); #endif //GUARD_MENU_INDICATORS_H -- cgit v1.2.3 From 18a92fdcc05c9bf46c4ff11006043cccf5eefcff Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 3 Mar 2018 14:58:41 +0100 Subject: list menu is decompiled --- include/list_menu.h | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/list_menu.h b/include/list_menu.h index d25549845..0aa66a524 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -8,9 +8,7 @@ #define LIST_MULTIPLE_SCROLL_DPAD 1 #define LIST_MULTIPLE_SCROLL_L_R 2 -// Exported type declarations - -// Exported RAM declarations +struct ListMenu; struct ListMenuItem { @@ -18,22 +16,20 @@ struct ListMenuItem s32 id; }; -struct ListMenu; - struct ListMenuTemplate { const struct ListMenuItem *items; - void (* moveCursorFunc)(u32, bool8, struct ListMenu *); + void (* moveCursorFunc)(s32, bool8, struct ListMenu *); void (* unk_08)(u8 windowId, s32 itemId, u8 y); u16 totalItems; u16 maxShowed; u8 windowId; u8 unk_11; u8 unk_12; - u8 cursor_Y; + u8 cursor_X; u8 upText_Y:4; // x1, x2, x4, x8 = xF u8 cursorPal:4; // x10, x20, x40, x80 = xF0 - u8 fillPal:4; // x1, x2, x4, x8 = xF + u8 fillValue:4; // x1, x2, x4, x8 = xF u8 cursorShadowPal:4; // x10, x20, x40, x80 = xF0 u8 lettersSpacing:3; u8 unk_16_3:3; @@ -53,14 +49,30 @@ struct ListMenu u8 unk_1F; }; -extern struct ListMenuTemplate gMultiuseListMenuTemplate; +struct UnknownListMenuWindowStruct +{ + u8 x; + u8 y; + u8 width; + u8 height; + u8 palNum; +}; -// Exported ROM declarations +extern struct ListMenuTemplate gMultiuseListMenuTemplate; -u8 ListMenuInit(struct ListMenuTemplate *template, u16 scrollOffset, u16 selectedRow); +s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); +u8 ListMenuInitWithWindows(struct ListMenuTemplate *listMenuTemplate, struct UnknownListMenuWindowStruct *arg1, u16 scrollOffset, u16 selectedRow); s32 ListMenuHandleInputGetItemId(u8 listTaskId); -void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); void DestroyListMenuTask(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); +void sub_81AE70C(u8 listTaskId); +void ChangeListMenuPals(u8 listTaskId, u8 cursorPal, u8 fillValue, u8 cursorShadowPal); +void ChangeListMenuCoords(u8 listTaskId, u8 x, u8 y); +s32 ListMenuTestInput(struct ListMenuTemplate *template, u32 scrollOffset, u32 selectedRow, u16 keys, u16 *newScrollOffset, u16 *newSelectedRow); +void ListMenuGetCurrentItemArrayId(u8 listTaskId, u16 *arrayId); +void ListMenuGetScrollAndRow(u8 listTaskId, u16 *scrollOffset, u16 *selectedRow); u16 ListMenuGetYCoordForPrintingArrowCursor(u8 listTaskId); +void sub_81AF028(u8 cursorPal, u8 fillValue, u8 cursorShadowPal); +void sub_81AF078(s32 arg0, u8 arg1, struct ListMenu *list); #endif //GUARD_LIST_MENU_H -- cgit v1.2.3