summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHenny022p <info@henny022.de>2021-03-02 10:35:40 +0100
committerHenny022p <info@henny022.de>2021-03-02 10:35:40 +0100
commitdebbe46aec3558e856c735da7b36b849e48f5a28 (patch)
tree05cd5aea9a5fcc56b390547151bb271c2bf87d39 /include
parent87efc440657cc22cb2e6cb12c0bb175a7f105297 (diff)
parentaced3eab78f590366b44f3576bc68914d0691091 (diff)
merge PR 4
Diffstat (limited to 'include')
-rw-r--r--include/audio.h4
-rw-r--r--include/entity.h30
-rw-r--r--include/functions.h28
-rw-r--r--include/gba/macro.h11
-rw-r--r--include/gba/syscall.h15
-rw-r--r--include/greatFairy.h2
-rw-r--r--include/main.h8
-rw-r--r--include/manager.h1
-rw-r--r--include/npc.h1
-rw-r--r--include/object.h197
-rw-r--r--include/player.h15
-rw-r--r--include/save.h2
-rw-r--r--include/screen.h20
-rw-r--r--include/script.h4
14 files changed, 271 insertions, 67 deletions
diff --git a/include/audio.h b/include/audio.h
index 3690de89..0f1a1b40 100644
--- a/include/audio.h
+++ b/include/audio.h
@@ -145,7 +145,7 @@ typedef enum {
SFX_VO_MINISH2,
SFX_VO_MINISH3,
SFX_VO_MINISH4,
-
+
SFX_REM_SLEEP = 0xCC,
SFX_TASK_COMPLETE,
SFX_KEY_APPEAR,
@@ -183,7 +183,7 @@ typedef enum {
SFX_APPARATE,
SFX_F8,
SFX_TELEPORTER,
-
+
SFX_ITEM_BOMB_EXPLODE = 0xFD,
SFX_HIT,
diff --git a/include/entity.h b/include/entity.h
index d1593d1d..a1dd6d93 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -5,6 +5,16 @@
#include "global.h"
#include "sprite.h"
+typedef enum {
+ PLAYER = 1,
+ ENEMY = 3,
+ PROJECTILE = 4,
+ OBJECT = 6,
+ NPC = 7,
+ PLAYER_ITEM = 8,
+ MANAGER = 9,
+} EntityType;
+
typedef struct {
void* entity1;
void* entity2;
@@ -12,19 +22,12 @@ typedef struct {
} UnkStruct;
typedef struct {
- u8 type;
- u8 subtype;
- u8 form;
- u8 parameter;
-} EntityType;
-
-typedef struct {
s8 offset_x;
s8 offset_y;
u8 unk2[4];
u8 width;
u8 height;
-} BoundingBox;
+} Hitbox;
typedef struct {
s8 offset_x;
@@ -34,12 +37,15 @@ typedef struct {
u8 height;
u8 depth;
u8 unknown2[3];
-} BoundingBox3D;
+} Hitbox3D;
typedef struct Entity {
/*0x00*/ struct Entity* prev;
/*0x04*/ struct Entity* next;
- /*0x08*/ EntityType entityType;
+ /*0x08*/ u8 kind; // was: type
+ /*0x09*/ u8 id; // was: subtype
+ /*0x0a*/ u8 type; // was: form
+ /*0x0b*/ u8 type2; // was: parameter
/*0x0c*/ u8 action;
/*0x0d*/ u8 previousActionFlag;
/*0x0e*/ u8 actionDelay;
@@ -112,7 +118,7 @@ typedef struct Entity {
/*0x44*/ u8 field_0x44;
/*0x45*/ u8 currentHealth;
/*0x46*/ u16 field_0x46;
- /*0x48*/ BoundingBox* boundingBox;
+ /*0x48*/ Hitbox* hitbox;
/*0x4c*/ struct Entity* field_0x4c;
/*0x50*/ struct Entity* parent;
/*0x54*/ struct Entity* attachedEntity;
@@ -132,7 +138,7 @@ typedef struct Entity {
/*0x60*/ u16 spriteVramOffset;
/*0x62*/ u8 spriteOffsetX;
/*0x63*/ s8 spriteOffsetY;
- /*0x64*/ u32* otherEntity;
+ /*0x64*/ u32* myHeap;
/*0x68*/ union SplitHWord field_0x68;
/*0x6a*/ union SplitHWord field_0x6a;
/*0x6c*/ union SplitHWord field_0x6c;
diff --git a/include/functions.h b/include/functions.h
index 58941869..9d190498 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -12,7 +12,7 @@
// Identified - to be sorted into header files
extern u32 Random(void);
-extern void PlaySFX(u32);
+extern void SoundReq(u32);
extern void ShowNPCDialogue(Entity*, Dialog*);
extern u32 UpdateFuseInteraction();
extern void DeleteEntity(Entity*);
@@ -20,7 +20,7 @@ extern u32 __modsi3(u32, u32);
extern void DoFade(u32, u32);
extern u32 GetInventoryValue(u32);
extern u32 CheckKinstoneFused(u32);
-extern void ForceEquipItem(u8, u8);
+extern void ForceEquipItem(u32, u8);
extern void LoadRoomEntityList();
void CopyPosition(Entity*, Entity*);
extern void ResolveEntityOnTop(Entity*, Entity*);
@@ -32,7 +32,7 @@ extern Entity* CreatePlayerItem(u32, u32, u32, u32);
extern Entity* GetEmptyEntity(void);
extern u32 GetTileTypeByPos(s32 x, s32 y, u32 layer);
extern u32 GetTileType(u32 pos, u32 layer);
-extern void _DmaZero(void* src, u32 count);
+extern void MemClear32(void* src, u32 count);
extern void EraseAllEntities(void);
extern void SetTile(u32, u32, u32);
extern void SetDirtTile(u32);
@@ -42,15 +42,15 @@ extern void UpdateAnimationVariableFrames(Entity*, u32);
extern void CopyPositionAndSpriteOffset(Entity*, Entity*);
extern u8* GetSpriteSubEntryOffsetDataPointer(u32, u32);
extern u32 LoadFixedGFX(Entity*, u32);
-extern void _DmaFill32(u32, void*, u32);
+extern void MemFill32(u32, void*, u32);
extern Entity* CreateItemEntity(u32, u32, u32);
-void _DmaCopy(const void* src, void* dst, u32 size);
+void MemCopy(const void* src, void* dst, u32 size);
extern u32 ProcessMovement(Entity*);
extern Entity* FindEntityInListBySubtype(u32, u32, u32);
extern Entity* FindEntityInListByForm(u32, u32, u32, u32, u32);
-extern void _DmaZero(void*, u32);
+extern void MemClear32(void*, u32);
extern void MenuFadeIn(u32, u32);
-extern void LoadAssetAsync(const void*, u32, u32);
+extern void LoadResourceAsync(const void*, u32, u32);
extern void LoadPaletteGroup(u32);
extern void TryLoadPrologueHyruleTown(void);
extern Manager* GetEmptyManager(void);
@@ -226,7 +226,7 @@ extern void sub_0804A7D4(Entity*);
extern void sub_08033744(Entity*);
extern void sub_0800417E(Entity*, u32);
extern void sub_080784C8();
-extern void sub_08017640();
+extern void RegisterPlayerHitbox();
extern u32 sub_0808288C(Entity*, u32, u32, u32);
extern void sub_0806FDA0(Entity*);
extern void sub_080AE008(Entity*, u32, u32);
@@ -283,10 +283,10 @@ extern void sub_0801E00C();
extern void sub_08050038(u32);
extern void sub_080500F4(u32);
extern void sub_08050110(u32, u32, u32, u32);
-extern u32 sub_08052734(); //has Dungeon Map?
-extern u32 sub_08052764(); //has Dungeon Compass?
-extern u32 sub_0805279C(); //has Dungeon Big Key?
-extern u32 sub_080527CC(); //num Dungeon small keys?
+extern u32 sub_08052734(); // has Dungeon Map?
+extern u32 sub_08052764(); // has Dungeon Compass?
+extern u32 sub_0805279C(); // has Dungeon Big Key?
+extern u32 sub_080527CC(); // num Dungeon small keys?
extern u32 sub_08053FE0();
extern void sub_08078790(Entity*, u32);
extern void sub_080788E0(Entity*);
@@ -311,8 +311,8 @@ extern u32 sub_08056134(void);
extern void sub_08004484(Entity*, Entity*);
extern void sub_080564C8(u32);
extern void sub_08056F70(void);
-extern void sub_08056C68(void);
-extern void sub_08056D70(void);
+extern void DeleteWindow(void);
+extern void CreateWindow(void);
extern void sub_0805EEB4(u8*, u32, u32);
extern void sub_08056FBC(void*);
extern void sub_08056C54(u32);
diff --git a/include/gba/macro.h b/include/gba/macro.h
index 2fa1abb2..b08ed921 100644
--- a/include/gba/macro.h
+++ b/include/gba/macro.h
@@ -167,11 +167,12 @@
#define DmaClear16Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 16)
#define DmaClear32Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 32)
-#define DmaWait(DmaNo) \
-{ \
- vu32 *(DmaCntp) = (vu32 *)REG_ADDR_DMA##DmaNo; \
- while (DmaCntp[2] & (DMA_ENABLE << 16)) ; \
-}
+#define DmaWait(DmaNo) \
+ { \
+ vu32*(DmaCntp) = (vu32*)REG_ADDR_DMA##DmaNo; \
+ while (DmaCntp[2] & (DMA_ENABLE << 16)) \
+ ; \
+ }
#define IntrEnable(flags) \
{ \
diff --git a/include/gba/syscall.h b/include/gba/syscall.h
index d319a9fe..0c07bcbb 100644
--- a/include/gba/syscall.h
+++ b/include/gba/syscall.h
@@ -11,17 +11,18 @@
#define RESET_REGS 0x80
#define RESET_ALL 0xFF
-#define SystemCall(x) { asm("svc " #x); }
+#define SystemCall(x) \
+ { asm("svc " #x); }
extern void SoundBiasReset();
extern void SoundBiasSet();
-#define Stop() \
-{ \
- SoundBiasReset(); \
- SystemCall(3); \
- SoundBiasSet(); \
-}
+#define Stop() \
+ { \
+ SoundBiasReset(); \
+ SystemCall(3); \
+ SoundBiasSet(); \
+ }
void SoftReset(u32 resetFlags);
diff --git a/include/greatFairy.h b/include/greatFairy.h
index f3eb845e..31a37c99 100644
--- a/include/greatFairy.h
+++ b/include/greatFairy.h
@@ -11,7 +11,7 @@ extern Entity* GreatFairy_CreateForm(Entity*, u32, u32);
extern void PositionRelative();
extern void CopyPosition();
extern void DoFade();
-extern void PlaySFX();
+extern void SoundReq();
extern void GetNextFrame();
extern void sub_0805EC9C();
extern void sub_0805EC60();
diff --git a/include/main.h b/include/main.h
index 55e7b341..6ab823a6 100644
--- a/include/main.h
+++ b/include/main.h
@@ -74,7 +74,7 @@ typedef struct {
} UI;
static_assert(sizeof(UI) == 0x3b4);
-extern Main gUnk_03001000;
+extern Main gMain;
extern UI gUnk_02032EC0;
void InitScreen();
@@ -84,16 +84,16 @@ extern void sub_0807CE90(void);
extern void sub_080560B8(void);
extern void sub_08056208(void);
extern void sub_0804FFE4(void);
-extern void sub_08056418(void);
+extern void MessageInitialize(void);
extern void sub_080ADD30(void);
extern void InitScreen(u32);
-extern void sub_08016E78(void);
+extern void PrepNextFrame(void);
extern void ReadKeyInput(void);
extern void DoSoftReset(void);
extern void sub_08056260(void);
extern void VBlankIntrWait();
-extern void sub_08056458(void);
+extern void MessageUpdate(void);
extern void sub_08050154(void);
extern void sub_080A3480(void);
diff --git a/include/manager.h b/include/manager.h
index a0d8eb1c..f292baf2 100644
--- a/include/manager.h
+++ b/include/manager.h
@@ -193,5 +193,4 @@ extern void sub_0805E0FC();
void (*const gManagerFunctions[58])();
-
#endif
diff --git a/include/npc.h b/include/npc.h
index 024a9a43..b27a82f9 100644
--- a/include/npc.h
+++ b/include/npc.h
@@ -172,7 +172,6 @@ extern void NPC58_Head(Entity*);
extern u32 UpdateFuseInteraction(Entity*);
-
void (*const gNPCFunctions[128][3])(Entity*);
#endif
diff --git a/include/object.h b/include/object.h
index 5480a8a2..465ef064 100644
--- a/include/object.h
+++ b/include/object.h
@@ -4,6 +4,203 @@
#include "global.h"
#include "entity.h"
+typedef enum {
+ GROUND_ITEM,
+ DEATH_FX,
+ SHOP_ITEM,
+ BUTTON,
+ OBJECT_4,
+ POT,
+ OBJECT_6,
+ PUSHED_BLOCK,
+ LOCKED_DOOR,
+ OBJECT_9,
+ OBJECT_A,
+ OBJECT_B,
+ CHEST_SPAWNER,
+ OBJECT_D,
+ OBJECT_E,
+ SPECIAL_FX,
+ OBJECT_10,
+ OBJECT_11,
+ OBJECT_12,
+ RAILTRACK,
+ LILYPAD_LARGE,
+ OBJECT_15,
+ FLOATING_PLATFORM,
+ OBJECT_17,
+ EVIL_SPIRIT,
+ HOUSE_DOOR_EXT,
+ OBJECT_1A,
+ GREAT_FAIRY,
+ OBJECT_1C,
+ OBJECT_1D,
+ OBJECT_1E,
+ OBJECT_1F,
+ OBJECT_20,
+ OBJECT_21,
+ FIGURINE_DEVICE,
+ EYE_SWITCH,
+ OBJECT_24,
+ BIG_BARREL,
+ OBJECT_26,
+ PUSHABLE_STATUE,
+ OBJECT_28,
+ OBJECT_29,
+ OBJECT_2A,
+ OBJECT_2B,
+ BEANSTALK,
+ SMOKE,
+ PUSHABLE_ROCK,
+ HITTABLE_LEVER,
+ OBJECT_30,
+ OBJECT_31,
+ PULLABLE_MUSHROOM,
+ BOLLARD,
+ WARP_POINT,
+ OBJECT_35,
+ OBJECT_36,
+ OBJECT_37,
+ JAR_PORTAL,
+ BOSS_DOOR,
+ OBJECT_3A,
+ PORTAL_MUSHROOM_STALKS,
+ PORTAL_FALLING_PLAYER,
+ OBJECT_3D,
+ OBJECT_3E,
+ GIANT_LEAF,
+ FAIRY,
+ LADDER_UP,
+ OBJECT_42,
+ OBJECT_43,
+ OBJECT_44,
+ OBJECT_45,
+ GIANT_BOOK_LADDER,
+ HEART_CONTAINER,
+ FILE_SCREEN_OBJECTS,
+ OBJECT_49,
+ BACKGROUND_CLOUD,
+ OBJECT_4B,
+ PUSHABLE_FURNITURE,
+ FURNITURE,
+ MINISH_SIZED_ENTRANCE,
+ ARCHWAY,
+ GIANT_ROCK,
+ OBJECT_51,
+ OBJECT_52,
+ OBJECT_53,
+ PULLABLE_LEVER,
+ MINECART,
+ THOUGHT_BUBBLE,
+ HIDDEN_LADDER_DOWN,
+ GENTARI_CURTAIN,
+ LAVA_PLATFORM,
+ OBJECT_5A,
+ OBJECT_5B,
+ MASK,
+ HOUSE_DOOR_INT,
+ WHIRLWIND,
+ OBJECT_BLOCKING_STAIRS,
+ SWORDSMAN_NEWSLETTER,
+ OBJECT_61,
+ GIANT_TWIG,
+ OBJECT_63,
+ OBJECT_64,
+ LADDER_HOLE,
+ OBJECT_66,
+ OBJECT_67,
+ OBJECT_68,
+ OBJECT_69,
+ OBJECT_6A,
+ CRENAL_BEAN_SPROUT,
+ MINECART_DOOR,
+ OBJECT_ON_PILLAR,
+ MINERAL_WATER_SOURCE,
+ MINISH_SIZED_ARCHWAY,
+ OBJECT_70,
+ PUSHABLE_GRAVE,
+ OBJECT_72,
+ LILYPAD_SMALL,
+ OBJECT_74,
+ OBJECT_75,
+ OBJECT_76,
+ BELL,
+ HUGE_DECORATION,
+ OBJECT_79,
+ STEAM,
+ PUSHABLE_LEVER,
+ HUGE_SHOES,
+ OBJECT_ON_BEETLE,
+ OBJECT_7E,
+ PICO_BLOOM,
+ OBJECT_80,
+ OBJECT_81,
+ BIG_VORTEX,
+ BIG_PUSHABLE_LEVER,
+ SMALL_ICE_BLOCK,
+ BIG_ICE_BLOCK,
+ OBJECT_86,
+ OBJECT_87,
+ HUGE_BOOK,
+ OBJECT_89,
+ OBJECT_8A,
+ OBJECT_8B,
+ BOOK,
+ FIREPLACE,
+ OBJECT_8E,
+ FROZEN_WATER_ELEMENT,
+ OBJECT_90,
+ OBJECT_91,
+ BAKER_OVEN,
+ OBJECT_93,
+ WIND_TRIBE_FLAG,
+ BIRD,
+ OBJECT_96,
+ OBJECT_97,
+ OBJECT_98,
+ OBJECT_99,
+ HUGE_ACORN,
+ OBJECT_9B,
+ TREE_HIDING_PORTAL,
+ LIGHTABLE_SWITCH,
+ OBJECT_9E,
+ FAN,
+ OBJECT_A0,
+ PALACE_ARCHWAY,
+ OBJECT_A2,
+ CLOUD,
+ MINISH_LIGHT,
+ OBJECT_A5,
+ OBJECT_A6,
+ OBJECT_A7,
+ OBJECT_A8,
+ OBJECT_A9,
+ WATERFALL_OPENING,
+ OBJECT_AB,
+ FOUR_ELEMENTS,
+ OBJECT_AD,
+ FLOATING_BLOCK,
+ OBJECT_AF,
+ METAL_DOOR,
+ JAIL_BARS,
+ OBJECT_B2,
+ OBJECT_B3,
+ OBJECT_B4,
+ OBJECT_B5,
+ OBJECT_B6,
+ WELL,
+ WIND_TRIBE_TELEPORTER,
+ OBJECT_B9,
+ OBJECT_BA,
+ WINDCREST,
+ LIT_AREA,
+ OBJECT_BD,
+ PINWHEEL,
+ OBJECT_BF,
+ ENEMY_ITEM,
+ OBJECT_C1,
+} Object;
+
extern void ItemOnGround(Entity*);
extern void DeathFx(Entity*);
extern void ItemForSale(Entity*);
diff --git a/include/player.h b/include/player.h
index f1f08f6f..e9d96665 100644
--- a/include/player.h
+++ b/include/player.h
@@ -33,8 +33,9 @@ typedef struct {
/*0x30*/ union {
/* */ u32 all;
/* */ struct {
- /* */ u32 filler9 : 2;
+ /* */ u32 unk1 : 1;
/* */ u32 unk2 : 1;
+ /* */ u32 unk4 : 1;
/* */ u32 noMinishCap : 1;
/* */ u32 pullingState : 1;
/* */ u32 windyState : 1;
@@ -87,17 +88,19 @@ typedef struct {
/*0x05*/ u8 arrowCount;
/*0x06*/ u8 bombBagType;
/*0x07*/ u8 quiverType;
- /*0x08*/ u8 filler[4];
+ /*0x08*/ u8 filler[2];
+ /*0x0a*/ u8 charm;
+ /*0x0b*/ u8 unkB;
/*0x0c*/ u8 itemOnA;
/*0x0d*/ u8 itemOnB;
/*0x0e*/ u8 bottles[4];
- /*0x12*/ u8 floorType;
+ /*0x12*/ u8 effect;
/*0x13*/ u8 filler3[5];
/*0x18*/ u16 rupees;
/*0x1a*/ u16 field_0x1a;
- /*0x1c*/ u16 field_0x1c;
- /*0x1e*/ u16 field_0x1e;
- /*0x20*/ u16 field_0x20;
+ /*0x1c*/ u16 charmTimer;
+ /*0x1e*/ u16 unkTimer;
+ /*0x20*/ u16 effectTimer;
/*0x22*/ u8 filler4[4];
} Stats;
diff --git a/include/save.h b/include/save.h
index 83ef1e3f..eaf1eaf5 100644
--- a/include/save.h
+++ b/include/save.h
@@ -11,7 +11,7 @@
typedef enum {
SAVE_BUSY = 0,
- SAVE_OK = 1,
+ SAVE_OK = 1,
SAVE_ERROR = -1,
} SaveResult;
diff --git a/include/screen.h b/include/screen.h
index b1e5fff7..e6462de1 100644
--- a/include/screen.h
+++ b/include/screen.h
@@ -12,30 +12,28 @@ typedef struct {
typedef struct {
u16 bg0Control;
- u16 bg1Control;
- u16 bg2Control;
- u16 bg3Control;
u16 bg0xOffset;
u16 bg0yOffset;
+ u16 bg0Updated;
+ void* bg0Tilemap;
+ u16 bg1Control;
u16 bg1xOffset;
u16 bg1yOffset;
- u16 bg2xOffset;
- u16 bg2yOffset;
- void* unk_14;
+ u16 bg1Updated;
+ void* bg1Tilemap;
} BgSettings;
typedef struct {
u16 bg2Control;
u16 bg2xOffset;
u16 bg2yOffset;
- u16 unk;
- u16 unk2;
- u16 unk3;
+ u16 bg2Updated;
+ void* bg2Tilemap;
u16 bg3Control;
s16 bg3xOffset;
s16 bg3yOffset;
- u16 unk4;
- void* unk5;
+ u16 bg3Updated;
+ void* bg3Tilemap;
} BgAffSettings;
typedef struct {
diff --git a/include/script.h b/include/script.h
index 93b7554c..9abc5291 100644
--- a/include/script.h
+++ b/include/script.h
@@ -31,6 +31,6 @@ extern void StartPlayerScript(u16*);
extern void sub_0807DEDC(Entity*, ScriptExecutionContext*, u32, u32);
extern ScriptExecutionContext* StartCutscene(Entity*, u16*);
-extern void sub_0807DDAC(Entity*, void(*function)(Entity*, ScriptExecutionContext*));
-extern void sub_0807DD94(Entity*, void(*function)(Entity*, ScriptExecutionContext*));
+extern void sub_0807DDAC(Entity*, void (*function)(Entity*, ScriptExecutionContext*));
+extern void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*));
#endif