summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-03-05 19:24:39 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2022-03-17 00:58:47 +0100
commit41ea9ab943d8be91d9e296d23cd1f2dd48d37d9d (patch)
tree4c17c549e48b887a18e74f8ec73d26a66892fbe1 /include
parent9749170b751c35c65d9fb05b9ce0426770d1bbb9 (diff)
Decompile some UI
Diffstat (limited to 'include')
-rw-r--r--include/functions.h6
-rw-r--r--include/structures.h83
2 files changed, 81 insertions, 8 deletions
diff --git a/include/functions.h b/include/functions.h
index 2ba07a82..b4e79f4d 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -28,9 +28,9 @@ extern Entity* CreatePlayerBomb(ItemBehavior*, u32);
extern u32 CreateRandomItemDrop(Entity*, u32);
extern void CreateSparkle(Entity*);
extern void DoPlayerAction(Entity*);
-extern void DrawDirect(u32, u32); // trampoline to sub_080B27F4
+extern void DrawDirect(u32, u32);
extern void DrawEntities(void);
-extern void DrawOAMCmd(void);
+extern void DrawUIElements(void);
extern void EnemyFunctionHandlerAfterCollision(Entity*, void (*const[])());
extern bool32 EntityWithinDistance(Entity*, s32, s32, s32);
extern void FlushSprites(void);
@@ -115,7 +115,7 @@ extern void sub_080171F0(void);
extern u32 sub_0801766C(Entity*);
extern void sub_0801AF18(const u8*, u32, u32);
extern void sub_0801AFE4(void);
-extern void sub_0801C1D4(void);
+extern void UpdateUIElements(void);
extern void sub_0801C25C(void);
extern void sub_0801E104(void);
extern void sub_08027870(Entity*);
diff --git a/include/structures.h b/include/structures.h
index b87b9672..12d15690 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -45,14 +45,87 @@ typedef struct {
} struct_020354C0;
extern struct_020354C0 gUnk_020354C0[0x20];
+#define MAX_UI_ELEMENTS 24
+
+typedef enum {
+ UI_ELEMENT_BUTTON_A,
+ UI_ELEMENT_BUTTON_B,
+ UI_ELEMENT_BUTTON_R,
+ UI_ELEMENT_ITEM_A,
+ UI_ELEMENT_ITEM_B,
+ UI_ELEMENT_TEXT_R,
+ UI_ELEMENT_HEART,
+ UI_ELEMENT_EZLONAGSTART,
+ UI_ELEMENT_EZLONAGACTIVE,
+ UI_ELEMENT_TEXT_A,
+ UI_ELEMENT_TEXT_B
+} UIElementType;
+
+/**
+ * @brief Floating UI element
+ */
+typedef struct {
+ u8 used : 1;
+ u8 unk_0_1 : 1;
+ u8 unk_0_2 : 2; // Load data into VRAM? 0: do not load, 1: ready to load 2: loaded
+ u8 unk_0_4 : 4;
+ u8 type; /**< @see UIElementType */
+ u8 type2; // Subtype
+ u8 buttonElementId; /**< Id of the button UI element this text is attached to */
+ u8 action;
+ u8 unk_5;
+ u8 unk_6;
+ u8 unk_7;
+ u8 unk_8;
+ u8 unk_9[3];
+ u16 x;
+ u16 y;
+ u8 frameIndex;
+ u8 duration;
+ u8 spriteSettings;
+ u8 frameSettings;
+ Frame* framePtr;
+ u8 unk_18;
+ u8 numTiles;
+ u16 unk_1a; // TODO oam id? VRAM target (element->unk_1a * 0x20 + 0x6010000)
+ u32* firstTile;
+} UIElement;
+
typedef struct {
- u8 filler0[0x1A];
- u16 rButtonX;
- u8 filler1C[0x4];
- u16 rButtonY;
+ u8 unk_0;
+ u8 unk_1;
+ u8 unk_2;
+ u8 health;
+ u8 maxHealth;
+ u8 unk_5;
+ u8 unk_6;
+ u8 unk_7;
+ u8 unk_8;
+ u8 unk_9;
+ u8 unk_a;
+ u8 unk_b;
+ u8 unk_c;
+ u8 unk_d;
+ u16 rupees;
+ u8 unk_10;
+ u8 unk_11;
+ u8 unk_12;
+ s8 unk_13;
+ s8 unk_14;
+ u8 unk_15;
+ u16 buttonX[3]; /**< X coordinates for the button UI elements */
+ u16 buttonY[3]; /**< Y coordinates for the button UI elements */
u8 filler22[0x2];
u8 ezloNagFuncIndex;
- u8 filler25[0x30F];
+ u8 filler25[7];
+ u8 unk_2c;
+ u8 unk_2d;
+ u8 unk_2e;
+ u8 unk_2f;
+ u8 unk_30[2];
+ u8 unk_32;
+ u8 unk_33;
+ UIElement elements[MAX_UI_ELEMENTS];
} struct_0200AF00;
extern struct_0200AF00 gUnk_0200AF00;