summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/definitions.h2
-rw-r--r--include/effects.h2
-rw-r--r--include/entity.h24
-rw-r--r--include/fileScreen.h1
-rw-r--r--include/functions.h4
-rw-r--r--include/hitbox.h3
-rw-r--r--include/npc.h4
-rw-r--r--include/object.h4
-rw-r--r--include/player.h12
-rw-r--r--include/room.h4
-rw-r--r--include/structures.h2
11 files changed, 43 insertions, 19 deletions
diff --git a/include/definitions.h b/include/definitions.h
index 83c42b30..f2d631d9 100644
--- a/include/definitions.h
+++ b/include/definitions.h
@@ -114,7 +114,7 @@ typedef enum {
SPRITE_8,
SPRITE_9,
SPRITE_OBJECT4,
- SPRITE_OBJECT6,
+ SPRITE_EZLOCAP,
SPRITE_12,
SPRITE_13,
SPRITE_14,
diff --git a/include/effects.h b/include/effects.h
index 696ab9ab..95ad4105 100644
--- a/include/effects.h
+++ b/include/effects.h
@@ -115,4 +115,4 @@ typedef enum {
FX_6C,
} Effect;
-#endif // EFFECTS_H \ No newline at end of file
+#endif // EFFECTS_H
diff --git a/include/entity.h b/include/entity.h
index 8c54edf0..778a3f8e 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -5,6 +5,8 @@
#include "global.h"
#include "sprite.h"
+#define MAX_ENTITIES 71
+
typedef enum {
PLAYER = 1,
ENEMY = 3,
@@ -176,12 +178,23 @@ enum {
TILE((entity)->x.HALF.HI - (xOff), (entity)->y.HALF.HI - (yOff))
enum {
+ IdleNorth = 0x0,
+ IdleEast = 0x2,
+ IdleSouth = 0x4,
+ IdleWest = 0x6,
+};
+
+enum {
DirectionNorth = 0x00,
DirectionEast = 0x08,
DirectionSouth = 0x10,
DirectionWest = 0x18,
};
+#define AnimationStateTurnAround(expr) ((expr) ^ 0x4)
+#define AnimationStateIdle(expr) ((expr) & 0x6)
+#define AnimationStateWalk(expr) ((expr) & 0xe)
+
#define DirectionRound(expr) ((expr) & 0x18)
#define DirectionRoundUp(expr) DirectionRound((expr) + 4)
#define DirectionIsHorizontal(expr) ((expr) & 0x08)
@@ -194,7 +207,7 @@ enum {
#define Direction8Round(expr) ((expr) & 0x1c)
#define Direction8RoundUp(expr) Direction8Round((expr) + 2)
#define Direction8TurnAround(expr) (Direction8RoundUp(expr) ^ 0x10)
-#define Direction8ToAnimationState(expr) (Direction8RoundUp(expr) >> 2)
+#define Direction8ToAnimationState(expr) ((expr) >> 2)
#define Direction8FromAnimationState(expr) ((expr) << 2)
Entity* GetEmptyEntity(void);
@@ -270,11 +283,10 @@ void EraseAllEntities(void);
enum {
PRIO_MIN = 0,
PRIO_PLAYER = 1,
- PRIO_REQUESTED = 2,
- PRIO_MESSAGE = 2,
- PRIO_OVERRIDE_MESSAGE = 3,
- PRIO_PLAYER_EVENT = 6,
- PRIO_INITIALIZING = 7,
+ PRIO_MESSAGE = 2, /* do not block during message */
+ PRIO_NO_BLOCK = 3, /* do not block during entity requested priority */
+ PRIO_PLAYER_EVENT = 6, /* do not block during special player event */
+ PRIO_HIGHEST = 7, /* do not block EVER */
};
/**
diff --git a/include/fileScreen.h b/include/fileScreen.h
index fd4b7c7e..8cf2304b 100644
--- a/include/fileScreen.h
+++ b/include/fileScreen.h
@@ -12,6 +12,7 @@ typedef struct {
u16 timer;
u8 fillerA[0x26];
} ChooseFileState;
+static_assert(sizeof(ChooseFileState) == 0x30);
// TODO: This occupies the same memory region as gMenu
extern ChooseFileState gChooseFileState;
diff --git a/include/functions.h b/include/functions.h
index 58e54500..09926f5d 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -90,7 +90,7 @@ extern void sub_0804A720(Entity*);
extern u32 sub_080AEFE0(Entity*);
extern u32 sub_08049FA0(Entity*);
extern u32 sub_08049FDC(Entity*, u32);
-extern u32 sub_080041A0(Entity*, Entity*, u32, u32);
+extern u32 EntityInRectRadius(Entity*, Entity*, u32, u32);
extern u32 sub_08049EE4(Entity*);
extern void sub_08077E54(ItemBehavior*);
extern void sub_080042BA(Entity*, u32);
@@ -260,7 +260,7 @@ extern void sub_0800455E(Entity*);
extern u32* sub_08008790(Entity*, u32);
extern void sub_0804ACF8();
extern void sub_08073904(Entity*);
-extern u32 sub_08056134(void);
+extern u32 CheckHeaderValid(void);
extern void sub_08004484(Entity*, Entity*);
extern void sub_0805F8E4(u32 r0, WStruct* r1);
extern u32 sub_08002632(Entity*);
diff --git a/include/hitbox.h b/include/hitbox.h
index ce9c20e6..c9f7ef46 100644
--- a/include/hitbox.h
+++ b/include/hitbox.h
@@ -88,4 +88,5 @@ extern const Hitbox gUnk_080FD4E0;
extern const Hitbox gUnk_080FD3F4;
extern const Hitbox gUnk_080FD3FC;
extern const Hitbox gUnk_080FD43C;
-#endif \ No newline at end of file
+extern const Hitbox gPlayerHitbox;
+#endif
diff --git a/include/npc.h b/include/npc.h
index c30b628b..bf49ef0a 100644
--- a/include/npc.h
+++ b/include/npc.h
@@ -83,7 +83,7 @@ enum NPC {
/*0x4a*/ GREGAL,
/*0x4b*/ MAYOR_HAGEN,
/*0x4c*/ BIG_GORON,
- /*0x4d*/ EZLO_CAP,
+ /*0x4d*/ EZLO,
/*0x4e*/ NPC_UNK_4E,
/*0x4f*/ NPC_UNK_4F,
/*0x50*/ CLOTHES_RACK,
@@ -277,7 +277,7 @@ extern void Gregal_Fusion(Entity*);
extern void MayorHagen(Entity*);
extern void MayorHagen_Fusion(Entity*);
extern void BigGoron(Entity*);
-extern void EzloCap(Entity*);
+extern void Ezlo(Entity*);
extern void NPC4E(Entity*);
extern void NPC4E_Fusion(Entity*);
extern void NPC4F(Entity*);
diff --git a/include/object.h b/include/object.h
index dc2b6b43..029a88b2 100644
--- a/include/object.h
+++ b/include/object.h
@@ -11,7 +11,7 @@ typedef enum {
BUTTON,
OBJECT_4,
POT,
- OBJECT_6,
+ EZLO_CAP,
PUSHED_BLOCK,
LOCKED_DOOR,
OBJECT_9,
@@ -207,7 +207,7 @@ extern void ItemForSale(Entity*);
extern void Button(Entity*);
extern void Object4(Entity*);
extern void Pot(Entity*);
-extern void Object6(Entity*);
+extern void EzloCap(Entity*);
extern void BlockPushed(Entity*);
extern void LockedDoor(Entity*);
extern void Object9(Entity*);
diff --git a/include/player.h b/include/player.h
index e1ef7001..8512db67 100644
--- a/include/player.h
+++ b/include/player.h
@@ -63,8 +63,16 @@ typedef enum {
} PlayerControlMode;
enum PlayerFlags {
+ PL_BUSY = (1 << 0),
+ PL_DROWNING = (1 << 2),
PL_NO_CAP = (1 << 3),
+ PL_USE_PORTAL = (1 << 5),
PL_MINISH = (1 << 7),
+ PL_BURNING = (1 << 10),
+ PL_ROLLING = (1 << 18),
+ PL_IN_HOLE = (1 << 20),
+ PL_USE_LANTERN = (1 << 23),
+ PL_USE_OCARINA = (1 << 28),
};
typedef struct {
@@ -74,7 +82,7 @@ typedef struct {
/*0x05*/ u8 heldObject;
/*0x06*/ u8 pushedObject;
/*0x07*/ u8 field_0x7;
- /*0x08*/ u16 field_0x8;
+ /*0x08*/ u16 animation;
/*0x0a*/ u8 field_0xa;
/*0x0b*/ u8 keepFacing;
/*0x0c*/ u8 playerAction;
@@ -121,7 +129,7 @@ typedef struct {
/*0x40*/ u8 hurtType[64];
/*0x80*/ u16 field_0x80;
/*0x82*/ u8 field_0x82[9];
- /*0x8b*/ u8 field_0x8b;
+ /*0x8b*/ u8 controlMode;
/*0x8c*/ u32 field_0x8c;
/*0x90*/ union SplitWord field_0x90;
/*0x94*/ u32 field_0x94;
diff --git a/include/room.h b/include/room.h
index 8561da49..fc699fc5 100644
--- a/include/room.h
+++ b/include/room.h
@@ -60,8 +60,8 @@ typedef struct {
u8 field_0x3;
u8 field_0x4;
u8 filler1[1];
- u8 itemForSaleIndex;
- u8 field_0x7;
+ u8 shopItemType;
+ u8 shopItemType2;
u8 field_0x8;
u8 field_0x9;
u8 unk2;
diff --git a/include/structures.h b/include/structures.h
index 671e41ea..2073f1b0 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -32,7 +32,9 @@ typedef struct {
u8 listenForKeyPresses;
u8 field_0x6;
u8 field_0x7;
+ u8 pad[24];
} struct_02000010;
+static_assert(sizeof(struct_02000010) == 0x20);
extern struct_02000010 gUnk_02000010;