Merge pull request #226 from DizzyEggg/decompile_list_menu

Decompile list menu
This commit is contained in:
Diegoisawesome
2018-03-09 15:49:36 -06:00
committed by GitHub
18 changed files with 792 additions and 1774 deletions

View File

@@ -4,9 +4,11 @@
#define LIST_NOTHING_CHOSEN -1
#define LIST_B_PRESSED -2
// Exported type declarations
#define LIST_NO_MULTIPLE_SCROLL 0
#define LIST_MULTIPLE_SCROLL_DPAD 1
#define LIST_MULTIPLE_SCROLL_L_R 2
// Exported RAM declarations
struct ListMenu;
struct ListMenuItem
{
@@ -14,33 +16,31 @@ struct ListMenuItem
s32 id;
};
struct ListMenu;
struct ListMenuTemplate
{
const struct ListMenuItem *items;
void (* moveCursorFunc)(u32, bool8, struct ListMenu *);
void (* unk_08)(u8, s32, u8);
void (* moveCursorFunc)(s32, bool8, struct ListMenu *);
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 cursor_X;
u8 upText_Y:4; // x1, x2, x4, x8 = xF
u8 cursorPal:4; // x10, x20, x40, x80 = xF0
u8 fillValue: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;
@@ -49,14 +49,30 @@ struct ListMenu
u8 unk_1F;
};
struct UnknownListMenuWindowStruct
{
u8 x;
u8 y;
u8 width;
u8 height;
u8 palNum;
};
extern struct ListMenuTemplate gMultiuseListMenuTemplate;
// Exported ROM declarations
u8 ListMenuInit(struct ListMenuTemplate *template, u16 cursorPage, u16 cursorPosition);
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 sub_81AE860(u8 listTaskId, u16 *a1, u16 *a2);
void sub_81AE6C8(u8 listTaskId, u16 *a1, u16 *a2);
u8 ListMenuGetYCoordForPrintingArrowCursor(u8);
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

View File

@@ -7,16 +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