diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/list_menu.h | 83 | ||||
-rw-r--r-- | include/main.h | 22 |
2 files changed, 101 insertions, 4 deletions
diff --git a/include/list_menu.h b/include/list_menu.h new file mode 100644 index 00000000..67b73893 --- /dev/null +++ b/include/list_menu.h @@ -0,0 +1,83 @@ +#ifndef POKEDIAMOND_LIST_MENU_H +#define POKEDIAMOND_LIST_MENU_H + +#define LIST_HEADER -3 +#define LIST_CANCEL -2 +#define LIST_NOTHING_CHOSEN -1 + +#define LIST_NO_MULTIPLE_SCROLL 0 +#define LIST_MULTIPLE_SCROLL_DPAD 1 +#define LIST_MULTIPLE_SCROLL_L_R 2 + +struct ListMenu; + +// TODO: Move to its own header, and fill it out +struct Window +{ + u8 * unk_00; + u8 unk_04; +}; + +// TODO: Move to its own header, and fill it out +struct ListMenuCursor +{ + // ??? +}; + +struct ListMenuItem +{ + const u16 * text; + s32 index; +}; + +// TODO: Document remaining fields. +// A lot of these are named based on similar fields in gen 3. +struct ListMenuTemplate +{ + struct ListMenuItem * items; + u8 filler_04[8]; + /*0x0C*/ struct Window * window; + /*0x10*/ u16 totalItems; + /*0x12*/ u16 maxShowed; + /*0x14*/ u8 header_X; + /*0x15*/ u8 item_X; + /*0x16*/ u8 cursor_X; + /*0x17*/ u8 upText_Y:4; + u8 cursorPal:4; + /*0x18*/ u8 fillValue:4; + u8 cursorShadowPal:4; + /*0x1A*/ u16 lettersSpacing:3; + u16 itemVerticalPadding:4; + u16 scrollMultiple:2; + u16 fontId:6; + /*0x1C*/ u8 filler_1C[4]; +}; + +struct ListMenu +{ + /*0x00*/ struct ListMenuTemplate template; + // ListMenuOverride from gen 3 + /*0x20*/ u8 cursorPal:4; + u8 fillValue:4; + /*0x21*/ u8 cursorShadowPal:4; + u8 unk_21_4:4; + /*0x22*/ u8 lettersSpacing:6; + /*0x23*/ u8 unk_23; + /*0x24*/ u8 fontId:7; + u8 enabled:1; + /*0x28*/ struct ListMenuCursor *cursor; + /*0x2c*/ u16 cursorPos; + /*0x2e*/ u16 itemsAbove; + /*0x30*/ u8 unk_30; + /*0x31*/ u8 unk_31; + /*0x32*/ u8 taskId; + /*0x33*/ u8 unk_33; + /*0x34*/ u8 heap_id; +}; + +THUMB_FUNC struct ListMenu * ListMenuInit(const struct ListMenuTemplate * template, u16 cursorPos, u16 itemsAbove, u32 heap_id); +THUMB_FUNC s32 ListMenu_ProcessInput(struct ListMenu * list); +THUMB_FUNC void DestroyListMenu(struct ListMenu * list, u16 * cursorPos, u16 * itemsAbove); +THUMB_FUNC void RedrawListMenu(struct ListMenu * list); + +#endif // POKEDIAMOND_LIST_MENU_H diff --git a/include/main.h b/include/main.h index 2e424e09..9227d9a8 100644 --- a/include/main.h +++ b/include/main.h @@ -84,8 +84,8 @@ struct Main u32 unk3C; u32 unk40; u32 unk44; - u32 unk48; - u32 unk4C; + u32 newKeys; + u32 newAndRepeatedKeys; s32 unk50; s32 unk54; s32 unk58; @@ -104,8 +104,22 @@ struct Main //extern struct UnkStruct_021C4918 gMain + 0x60; -extern struct Unk2106FA0 gBacklightTop; -extern struct Unk2106FA0 gBacklightTop_2; // same as the first one, it's referenced twice in the constant pool... +extern PMBackLightSwitch gBacklightTop; +extern s32 UNK_02016FA4; + +struct UnkStruct_02016FA8 +{ + FSOverlayID unk0; + struct UnkStruct_02006234 *unk4; + FSOverlayID unk8; + const struct Unk21DBE18 * unkC; + s32 unk10; + s32 unk14; + struct SaveBlock2 * unk18; + +}; + +extern struct UnkStruct_02016FA8 UNK_02016FA8; void NitroMain(void); |