summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2022-02-01 20:28:25 -0800
committerGitHub <noreply@github.com>2022-02-01 20:28:25 -0800
commitdcc3ac219204e181117e366a1fb082c1ff4aabdd (patch)
tree9354649cab3c0e3f12d5a84ac01793461fcbb2c2 /include
parentb455aaf0133f9bae4a08efab65d9d9f1bc5b506f (diff)
parent5824dc8467b41e064ddc7d5118b54cf1bf08e54d (diff)
Merge pull request #341 from Henny022p/subtask
Diffstat (limited to 'include')
-rw-r--r--include/enemy.h1
-rw-r--r--include/game.h33
-rw-r--r--include/kinstone.h13
-rw-r--r--include/menu.h77
-rw-r--r--include/room.h4
-rw-r--r--include/screen.h4
-rw-r--r--include/sound.h1
-rw-r--r--include/structures.h14
-rw-r--r--include/subtask.h48
9 files changed, 144 insertions, 51 deletions
diff --git a/include/enemy.h b/include/enemy.h
index f1e96b6f..2e04b2af 100644
--- a/include/enemy.h
+++ b/include/enemy.h
@@ -12,6 +12,7 @@
#include "entity.h"
#include "projectile.h"
+bool32 EnemyInit(Entity* this);
extern u32 GetNextFunction(Entity*);
extern void EnemyFunctionHandler(Entity*, EntityActionArray);
extern void sub_08001324(Entity*);
diff --git a/include/game.h b/include/game.h
index 2b4f950e..a0bf8a98 100644
--- a/include/game.h
+++ b/include/game.h
@@ -285,37 +285,4 @@ typedef enum {
GAMEMAIN_SUBTASK,
} EGameMainState;
-/** Subtasks override the game task for short periods */
-typedef enum {
- SUBTASK_EXIT,
- SUBTASK_PAUSEMENU,
- SUBTASK_EXIT2,
- SUBTASK_MAPHINT,
- SUBTASK_KINSTONEMENU,
- SUBTASK_AUXCUTSCENE, /* cutscene without presence of player */
- SUBTASK_PORTALCUTSCENE, /* player "falling" down portal cutscene */
- SUBTASK_FIGURINEMENU,
- SUBTASK_WORLDEVENT,
- SUBTASK_FASTTRAVEL,
- SUBTASK_LOCALMAPHINT,
-} ESubtask;
-
-typedef void(Subtask)(void);
-
-/** @name Subtask entrypoints */
-///@{
-/** Subtask entrypoint. */
-Subtask Subtask_Exit;
-Subtask Subtask_PauseMenu;
-Subtask Subtask_Exit;
-Subtask Subtask_MapHint;
-Subtask Subtask_KinstoneMenu;
-Subtask Subtask_AuxCutscene;
-Subtask Subtask_PortalCutscene;
-Subtask Subtask_FigurineMenu;
-Subtask Subtask_WorldEvent;
-Subtask Subtask_FastTravel;
-Subtask Subtask_LocalMapHint;
-///@}
-
#endif // GAME_H
diff --git a/include/kinstone.h b/include/kinstone.h
index 28b799dd..4d04b9c6 100644
--- a/include/kinstone.h
+++ b/include/kinstone.h
@@ -7,7 +7,7 @@ extern void sub_08018C58(u32);
typedef struct {
u8 unk[4];
- u32 unk2;
+ u8* unk2;
u32 unk4;
} Unk_struct;
extern Unk_struct gUnk_03003DF0[];
@@ -27,4 +27,15 @@ typedef struct {
static_assert(sizeof(FuseInfo) == 0x10);
extern FuseInfo gFuseInfo;
+typedef struct {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2;
+ u8 unk3;
+ u8 evt_type;
+ u8 unk5;
+ u8 _5[2];
+} struct_080C9CBC;
+extern struct_080C9CBC gUnk_080C9CBC[];
+
#endif // KINSTONE_H
diff --git a/include/menu.h b/include/menu.h
index e4c09e84..f590e999 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -44,9 +44,17 @@ typedef struct {
/*0x08*/ u16 transitionTimer;
/*0x0a*/ u16 field_0xa;
/*0x0c*/ u8* field_0xc;
- /*0x10*/ u8 focusCoords[2];
- /*0x12*/ u8 field_0x12;
- /*0x13*/ u8 unk13;
+} Menu;
+
+typedef struct {
+ /*0x00*/ Menu base;
+ /*0x10*/ union {
+ s32 i;
+ u16 h[2];
+ u8 a[4];
+ } unk10;
+ /*0x12*/ // u8 field_0x12;
+ /*0x13*/ // u8 unk13;
/*0x14*/ u8 unk14;
/*0x15*/ u8 unk15;
/*0x16*/ u8 unk16;
@@ -54,12 +62,67 @@ typedef struct {
/* */ // directly in the code. This happens when you take the address off the field with '&`.
/* */ // Perhaps they had a macro to cast this to different sized arrays.
/*0x17*/ u8 selectMtx;
- /*0x18*/ u8 filler18[0x12];
+ /*0x18*/ u16 unk18;
+ /*0x1a*/ union SplitHWord unk1a;
+ /*0x1c*/ u8 unk1c;
+ /*0x1s*/ u8 unk1d;
+ /*0x1e*/ u8 unk1e;
+ /*0x1f*/ s8 unk1f;
+ /*0x20*/ u8 unk20;
+ /*0x21*/ u8 unk21;
+ /*0x22*/ u8 filler22[6];
+ /*0x28*/ u8 unk28;
+ /*0x29*/ u8 unk29;
/*0x2a*/ u8 unk2a;
- /*0x2c*/ int field_0x2c;
-} Menu;
-static_assert(sizeof(Menu) == 0x30);
+ /*0x2b*/ u8 unk2b;
+ /*0x2c*/ s8 unk2c;
+ /*0x2d*/ u8 unk2d;
+ /*0x2e*/ union SplitHWord unk2e;
+} GenericMenu;
+static_assert(sizeof(GenericMenu) == 0x30);
+
+typedef struct {
+ /*0x00*/ Menu base;
+ /*0x10*/ union SplitWord unk10;
+ /*0x14*/ u8 filler14[4];
+ /*0x18*/ u16 unk18;
+ /*0x1a*/ u16 unk1a;
+ /*0x1c*/ u8 filler1c[14];
+ /*0x2a*/ u8 unk2a;
+ /*0x2b*/ u8 filler2b[1];
+ /*0x2c*/ s8 unk2c;
+ /*0x2d*/ u8 filler2d[2];
+ /*0x2f*/ s8 unk2f;
+} KinstoneMenu;
+
+typedef struct {
+ /*0x00*/ Menu base;
+ /*0x10*/ union {
+ u16 h[2];
+ u8 a[4];
+ } unk10;
+ /*0x14*/ u8 filler14[6];
+ /*0x1a*/ u8 unk1a;
+ /*0x1b*/ u8 filler1b[1];
+ /*0x1c*/ u8 unk1c;
+ /*0x1d*/ u8 unk1d;
+ /*0x1e*/ u8 unk1e;
+ /*0x1f*/ s8 unk1f;
+ /*0x20*/ u8 unk20;
+ /*0x21*/ u8 unk21;
+ /*0x22*/ u8 filler22[0xc];
+ /*0x2e*/ u16 unk2e;
+} FigurineMenu;
+
+typedef struct {
+ /*0x00*/ Menu base;
+ /*0x10*/ u8 items[17]; // unsure about size
+} PauseMenu;
extern Menu gMenu;
+#define gGenericMenu (*(GenericMenu*)&gMenu)
+#define gKinstoneMenu (*(KinstoneMenu*)&gMenu)
+#define gFigurineMenu (*(FigurineMenu*)&gMenu)
+#define gPauseMenu (*(PauseMenu*)&gMenu)
#endif
diff --git a/include/room.h b/include/room.h
index fb3d2630..1c0c5f82 100644
--- a/include/room.h
+++ b/include/room.h
@@ -125,8 +125,8 @@ typedef struct {
/* 0x0e */ s16 dungeon_y;
/* 0x10 */ u16 dungeon_map_x;
/* 0x12 */ u16 dungeon_map_y;
- /* 0x14 */ s16 overworld_map_x;
- /* 0x16 */ s16 overworld_map_y;
+ /* 0x14 */ u16 overworld_map_x;
+ /* 0x16 */ u16 overworld_map_y;
/* 0x18 */ u8 field_0x24[0x8];
} PlayerRoomStatus;
static_assert(sizeof(PlayerRoomStatus) == 0x20);
diff --git a/include/screen.h b/include/screen.h
index a5b05623..fe17b183 100644
--- a/include/screen.h
+++ b/include/screen.h
@@ -68,8 +68,8 @@ typedef struct {
} Screen;
typedef struct {
- u16 x;
- u16 y;
+ s16 x;
+ s16 y;
u16 _4;
u16 _6;
u16 _8;
diff --git a/include/sound.h b/include/sound.h
index 58462600..21cab9c3 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -6,6 +6,7 @@
#define NUM_BGM 99
void SoundReq(u32 sound);
+void SetBgmVolume(u32 volume);
extern void EnqueueSFX(u32);
void InitSound(void);
diff --git a/include/structures.h b/include/structures.h
index 16187958..eba95243 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -99,7 +99,19 @@ typedef struct {
} PriorityHandler;
extern PriorityHandler gPriorityHandler;
-extern u8 gUnk_02034490[];
+extern struct {
+ u8 unk0;
+ u8 unk1;
+ u8 unk2[0xf];
+ u8 unk11;
+ u8 unk12;
+ u8 unk13;
+ s8 unk14;
+ u8 unk15;
+ s8 unk16;
+ u8 unk17;
+} gUnk_02034490;
+static_assert(sizeof(gUnk_02034490) == 0x18);
typedef struct {
u8 unk0;
diff --git a/include/subtask.h b/include/subtask.h
index 185210d8..46412946 100644
--- a/include/subtask.h
+++ b/include/subtask.h
@@ -3,14 +3,52 @@
#include "global.h"
+/** Subtasks override the game task for short periods */
+typedef enum {
+ SUBTASK_EXIT,
+ SUBTASK_PAUSEMENU,
+ SUBTASK_EXIT2,
+ SUBTASK_MAPHINT,
+ SUBTASK_KINSTONEMENU,
+ SUBTASK_AUXCUTSCENE, /* cutscene without presence of player */
+ SUBTASK_PORTALCUTSCENE, /* player "falling" down portal cutscene */
+ SUBTASK_FIGURINEMENU,
+ SUBTASK_WORLDEVENT,
+ SUBTASK_FASTTRAVEL,
+ SUBTASK_LOCALMAPHINT,
+} ESubtask;
+
+typedef void(Subtask)(void);
+
+/** @name Subtask entrypoints */
+///@{
+/** Subtask entrypoint. */
+Subtask Subtask_Exit;
+Subtask Subtask_PauseMenu;
+Subtask Subtask_Exit;
+Subtask Subtask_MapHint;
+Subtask Subtask_KinstoneMenu;
+Subtask Subtask_AuxCutscene;
+Subtask Subtask_PortalCutscene;
+Subtask Subtask_FigurineMenu;
+Subtask Subtask_WorldEvent;
+Subtask Subtask_FastTravel;
+Subtask Subtask_LocalMapHint;
+///@}
+
// todo: separate headers for each subtask?
-extern void sub_080A4528(void);
extern void sub_080A4398(void);
-extern void sub_080A7114(u32);
-extern void sub_080A3B74(void);
-extern void sub_080A4054(void);
+extern void SetMenuType(u32);
extern void sub_080A4D34(void);
-extern u32 sub_080A4494(void);
+extern void sub_080A4E90(u8);
+extern void sub_080A4E84(u8);
+
+extern const struct {
+ u8 unk0;
+ u8 unk1;
+ u8 filler[2];
+ void (*func)(void);
+} gUnk_08128A38[];
#endif // SUBTASK_H