diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2023-12-28 14:59:23 +0100 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2023-12-28 14:59:23 +0100 |
| commit | 768efa50b308be03737d7eae2a1069627ea48b79 (patch) | |
| tree | 447c266172ef82df68bfd6d4737acb499f2b1a9d /include | |
| parent | b6a94d5062076ce53a00609e1e661b9da9e7ee5b (diff) | |
| parent | dae4c669913c3dc4248291f2d843ac39525b2738 (diff) | |
Merge branch 'master' into tilemap-docs
Diffstat (limited to 'include')
| -rw-r--r-- | include/area.h | 10 | ||||
| -rw-r--r-- | include/asm.h | 2 | ||||
| -rw-r--r-- | include/common.h | 4 | ||||
| -rw-r--r-- | include/enemy.h | 8 | ||||
| -rw-r--r-- | include/enemy/octorokBoss.h | 2 | ||||
| -rw-r--r-- | include/functions.h | 1 | ||||
| -rw-r--r-- | include/global.h | 7 | ||||
| -rw-r--r-- | include/item.h | 1 | ||||
| -rw-r--r-- | include/kinstone.h | 18 | ||||
| -rw-r--r-- | include/npc.h | 121 | ||||
| -rw-r--r-- | include/npc/zelda.h | 20 | ||||
| -rw-r--r-- | include/object.h | 4 | ||||
| -rw-r--r-- | include/object/cutsceneOrchestrator.h | 12 | ||||
| -rw-r--r-- | include/object/itemOnGround.h | 18 | ||||
| -rw-r--r-- | include/object/lilypadLarge.h | 21 | ||||
| -rw-r--r-- | include/physics.h | 6 | ||||
| -rw-r--r-- | include/player.h | 189 | ||||
| -rw-r--r-- | include/projectile.h | 24 | ||||
| -rw-r--r-- | include/projectile/winder.h | 4 | ||||
| -rw-r--r-- | include/room.h | 20 | ||||
| -rw-r--r-- | include/save.h | 95 | ||||
| -rw-r--r-- | include/script.h | 4 | ||||
| -rw-r--r-- | include/sound.h | 4 | ||||
| -rw-r--r-- | include/tiles.h | 18 | ||||
| -rw-r--r-- | include/windcrest.h | 15 |
25 files changed, 478 insertions, 150 deletions
diff --git a/include/area.h b/include/area.h index 96b08ed3..a79949bc 100644 --- a/include/area.h +++ b/include/area.h @@ -7,6 +7,16 @@ #define MAX_ROOMS 64 +typedef enum { + PT_TREESTUMP, + PT_ROCK, + PT_2, + PT_DUNGEON, + PT_JAR, + PT_5, + PT_TOD, +} PortalTypes; + typedef struct { u16 pixel_width; u16 pixel_height; diff --git a/include/asm.h b/include/asm.h index 7208b375..5c9ce19b 100644 --- a/include/asm.h +++ b/include/asm.h @@ -20,7 +20,7 @@ extern void sub_08001290(struct Entity_*, u32); extern void GenericKnockback(struct Entity_*); extern u32 GetFuserId(struct Entity_*); extern u32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY); -extern u32 GravityUpdate(struct Entity_*, u32); +extern u32 GravityUpdate(struct Entity_* entity, u32 gravity); extern u32 CheckOnScreen(struct Entity_*); extern bool32 EntityInRectRadius(struct Entity_*, struct Entity_*, u32, u32); extern void UpdateAnimationVariableFrames(struct Entity_*, u32); diff --git a/include/common.h b/include/common.h index ea3a1e39..80b83839 100644 --- a/include/common.h +++ b/include/common.h @@ -120,8 +120,8 @@ void sub_0801E1EC(u32, u32, u32); void sub_0801DD58(u32, u32); void sub_0801E1B8(u32, u32); void AddKinstoneToBag(u32); -void sub_0801DFB4(struct Entity_*, u32, u32, u32); -u32 sub_0801E00C(void); +void InitializeFuseInfo(struct Entity_* entity, u32 textIndex, u32 cancelledTextIndex, u32 fusingTextIndex); +u32 PerformFuseAction(void); bool32 CheckFusionMapMarkerDisabled(u32); u32 sub_0801DB94(void); u32 GetRandomSharedFusion(u8*); diff --git a/include/enemy.h b/include/enemy.h index 8142c344..ba1b828b 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -13,6 +13,14 @@ #include "projectile.h" bool32 EnemyInit(Entity* this); +/** + * 0: _OnTick + * 1: _OnCollision + * 2: _OnKnockback + * 3: _OnDeath + * 4: _OnConfused + * 5: _OnGrabbed + */ u32 GetNextFunction(Entity*); void EnemyFunctionHandler(Entity*, EntityActionArray); void EnemyFunctionHandlerAfterCollision(Entity*, void (*const[])()); diff --git a/include/enemy/octorokBoss.h b/include/enemy/octorokBoss.h index d57c8665..afa140e2 100644 --- a/include/enemy/octorokBoss.h +++ b/include/enemy/octorokBoss.h @@ -20,7 +20,7 @@ typedef struct { static_assert(sizeof(OctorokBossHeap) == 0x30); struct OctorokBossEntity { - Entity base; + /*0x00*/ Entity base; /*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 e9647997..6553a8f8 100644 --- a/include/functions.h +++ b/include/functions.h @@ -91,7 +91,6 @@ extern void sub_0805EC60(Entity*); extern void InitPlayerMacro(PlayerMacroEntry*); extern u32* sub_0805F25C(u32); extern void sub_0805F8E4(u32 r0, WStruct* r1); -extern void sub_08060158(Entity*); extern void sub_0806D0B0(Entity*); extern bool32 sub_080806BC(u32, u32, u32, u32); extern void sub_0808091C(const ScreenTransitionData* screenTransition, u32 transitionType); diff --git a/include/global.h b/include/global.h index fbed1b4f..72df6769 100644 --- a/include/global.h +++ b/include/global.h @@ -143,4 +143,11 @@ union SplitHWord { /* forward decls */ struct Entity_; +/** + * bitset macros + */ + +#define BIT(bit) (1 << (bit)) +#define IS_BIT_SET(value, bit) ((value)&BIT(bit)) + #endif // GLOBAL_H diff --git a/include/item.h b/include/item.h index 20087141..ec20160d 100644 --- a/include/item.h +++ b/include/item.h @@ -6,7 +6,6 @@ #include "player.h" void CreateItemEntity(u32, u32, u32); -void sub_08081404(Entity*, u32); extern void ExecuteItemFunction(ItemBehavior* this, u32 index); extern void ItemDebug(ItemBehavior*, u32); diff --git a/include/kinstone.h b/include/kinstone.h index d99950d7..1159aedc 100644 --- a/include/kinstone.h +++ b/include/kinstone.h @@ -6,17 +6,27 @@ extern void sub_08018C58(u32); +typedef enum { + FUSION_STATE_0, // fusion was not yet started + FUSION_STATE_1, // failed? + FUSION_STATE_2, // successful? + FUSION_STATE_3, // fusion is being performed + FUSION_STATE_4, // player has closed the first messagebox + FUSION_STATE_5, // fusion declined by the player + FUSION_STATE_6, // Successful, but not yet finished? +} FusionState; + typedef struct { - u8 _0; + u8 fusionState; /** @see FusionState */ u8 action; u8 _2; u8 kinstoneId; u8 prevUpdatePriority; u8 _5; u16 textIndex; - u16 _8; - u16 _a; - Entity* ent; + u16 cancelledTextIndex; + u16 fusingTextIndex; + Entity* entity; } FuseInfo; static_assert(sizeof(FuseInfo) == 0x10); extern FuseInfo gFuseInfo; diff --git a/include/npc.h b/include/npc.h index 6b9e5cb5..525cc5d1 100644 --- a/include/npc.h +++ b/include/npc.h @@ -73,7 +73,7 @@ s32 GetFacingDirectionInRectRadius(Entity* ent, u32 x, u32 y); void sub_0806EE04(Entity* ent, void* a2, u32 a3); u32 sub_0806EE20(Entity* ent); s32 sub_0806F078(Entity* ent, s32 a2); -void sub_0806F118(Entity* ent); +void InitializeNPCFusion(Entity* ent); void MarkFuserDone(Entity* ent); void ShowNPCDialogue(Entity* ent, const Dialog* dia); @@ -85,7 +85,6 @@ void CollideFollowers(void); // TODO move? void AddInteractableWhenBigFuser(Entity* ent, u32 kinstoneId); -u32 sub_0806F5A4(u32); u32 GetFusionToOffer(Entity*); void AddInteractableWhenBigObject(Entity*); void sub_0807000C(Entity*); @@ -222,23 +221,23 @@ enum NPC { /*0x7f*/ NPC_NONE_39, }; -void Gentari(Entity*); +void Gentari(); void Gentari_Fusion(Entity*); -void Festari(Entity*); -void Festari_Fusion(Entity*); -void ForestMinish(Entity*); +void Festari(); +void Festari_Fusion(); +void ForestMinish(); void ForestMinish_Head(Entity*); void ForestMinish_Fusion(Entity*); -void Postman(Entity*); +void Postman(); void Postman_Fusion(Entity*); -void NPC5(Entity*); +void NPC5(); void Townsperson(Entity*); void Townsperson_Head(Entity*); void Townsperson_Fusion(Entity*); -void Kid(Entity*); +void Kid(); void Kid_Head(Entity*); void Kid_Fusion(Entity*); -void Guard(Entity*); +void Guard(); void Guard_Head(Entity*); void NPC9(Entity*); void Stamp(Entity*); @@ -246,90 +245,90 @@ void Maid(Entity*); void Maid_Head(Entity*); void Marcy(Entity*); void Wheaton(Entity*); -void Pita(Entity*); +void Pita(); void MinishEzlo(Entity*); void MinishEzlo_Head(Entity*); void Mailbox(Entity*); void Beedle(Entity*); void Beedle_Head(Entity*); -void Brocco(Entity*); +void Brocco(); void Brocco_Fusion(Entity*); -void SittingPerson(Entity*); +void SittingPerson(); void SittingPerson_Head(Entity*); void SittingPerson_Fusion(Entity*); -void Pina(Entity*); +void Pina(); void Pina_Fusion(Entity*); -void Din(Entity*); +void Din(); void Din_Fusion(Entity*); -void Nayru(Entity*); +void Nayru(); void Nayru_Fusion(Entity*); -void Farore(Entity*); +void Farore(); void Farore_Fusion(Entity*); -void Sturgeon(Entity*); +void Sturgeon(); void Sturgeon_Head(Entity*); void Sturgeon_Fusion(Entity*); void TingleSiblings(Entity*); void TingleSiblings_Fusion(Entity*); -void Stockwell(Entity*); -void Talon(Entity*); +void Stockwell(); +void Talon(); void Talon_Head(Entity*); void Talon_Fusion(Entity*); -void Malon(Entity*); +void Malon(); void Malon_Fusion(Entity*); -void Epona(Entity*); -void Epona_Fusion(Entity*); +void Epona(); +void Epona_Fusion(); void MilkCart(Entity*); -void GhostBrothers(Entity*); +void GhostBrothers(); void GhostBrothers_Fusion(Entity*); -void Smith(Entity*); +void Smith(); void Smith_Head(Entity*); void Smith_Fusion(Entity*); -void NPC23(Entity*); -void KingDaltus(Entity*); +void NPC23(); +void KingDaltus(); void KingDaltus_Fusion(Entity*); -void MinisterPotho(Entity*); +void MinisterPotho(); void MinisterPotho_Fusion(Entity*); void NPC26(Entity*); void Vaati(Entity*); void Zelda(Entity*); -void Mutoh(Entity*); +void Mutoh(); void Mutoh_Head(Entity*); void Mutoh_Fusion(Entity*); -void Carpenter(Entity*); +void Carpenter(); void Carpenter_Head(Entity*); void Carpenter_Fusion(Entity*); -void CastorWildsStatue(Entity*); +void CastorWildsStatue(); void CastorWildsStatue_Fusion(Entity*); -void Cat(Entity*); +void Cat(); void Cat_Fusion(Entity*); -void MountainMinish(Entity*); +void MountainMinish(); void MountainMinish_Head(Entity*); void MountainMinish_Fusion(Entity*); void ZeldaFollower(Entity*); void Melari(Entity*); void Melari_Head(Entity*); void Melari_Fusion(Entity*); -void BladeBrothers(Entity*); +void BladeBrothers(); void BladeBrothers_Fusion(Entity*); -void Cow(Entity*); -void Cow_Fusion(Entity*); -void Goron(Entity*); +void Cow(); +void Cow_Fusion(); +void Goron(); void Goron_Fusion(Entity*); void GoronMerchant(Entity*); -void Gorman(Entity*); +void Gorman(); void Gorman_Head(Entity*); -void Dog(Entity*); -void Dog_Head(Entity*); -void Dog_Fusion(Entity*); -void Syrup(Entity*); +void Dog(); +void Dog_Head(); +void Dog_Fusion(); +void Syrup(); void Syrup_Head(Entity*); -void Rem(Entity*); -void TownMinish(Entity*); -void TownMinish_Head(Entity*); +void Rem(); +void TownMinish(); +void TownMinish_Head(); void TownMinish_Fusion(Entity*); -void Librari(Entity*); +void Librari(); void Librari_Fusion(Entity*); -void Percy(Entity*); +void Percy(); void Percy_Head(Entity*); void Percy_Fusion(Entity*); void VaatiReborn(Entity*); @@ -343,26 +342,26 @@ void Dampe(Entity*); void Dampe_Fusion(Entity*); void DrLeft(Entity*); void KingGustaf(Entity*); -void Gina(Entity*); +void Gina(); void Gina_Fusion(Entity*); void Simon(Entity*); -void Anju(Entity*); -void Anju_Fusion(Entity*); -void Mama(Entity*); +void Anju(); +void Anju_Fusion(); +void Mama(); void Mama_Head(Entity*); void Mama_Fusion(Entity*); void Emma(Entity*); -void Teachers(Entity*); +void Teachers(); void Teachers_Head(Entity*); void Teachers_Fusion(Entity*); void WindTribespeople(Entity*); void WindTribespeople_Head(Entity*); void WindTribespeople_Fusion(Entity*); -void Gregal(Entity*); +void Gregal(); void Gregal_Fusion(Entity*); -void MayorHagen(Entity*); +void MayorHagen(); void MayorHagen_Fusion(Entity*); -void BigGoron(Entity*); +void BigGoron(); void Ezlo(Entity*); void NPC4E(Entity*); void NPC4E_Fusion(Entity*); @@ -370,18 +369,18 @@ void NPC4F(Entity*); void ClothesRack(Entity*); void PicolyteBottle(Entity*); void SmallTownMinish(Entity*); -void HurdyGurdyMan(Entity*); +void HurdyGurdyMan(); void HurdyGurdyMan_Head(Entity*); void HurdyGurdyMan_Fusion(Entity*); -void Cucco(Entity*); +void Cucco(); void Cucco_Fusion(Entity*); -void CuccoChick(Entity*); -void CuccoChick_Fusion(Entity*); +void CuccoChick(); +void CuccoChick_Fusion(); void FusionMenuNPC(Entity*); void FusionMenuNPC_Head(Entity*); void Phonograph(Entity*); -void NPC58(Entity*); -void NPC58_Head(Entity*); +void NPC58(); +void NPC58_Head(); extern void (*const gNPCFunctions[128][3])(Entity*); diff --git a/include/npc/zelda.h b/include/npc/zelda.h new file mode 100644 index 00000000..71579586 --- /dev/null +++ b/include/npc/zelda.h @@ -0,0 +1,20 @@ +#ifndef ZELDA_H +#define ZELDA_H + +#include "entity.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unused[24]; + /*0x80*/ u16 unk_80; +} ZeldaEntity; + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ s8 unk_68; + /*0x69*/ s8 unk_69; + /*0x6a*/ u8 unused[10]; + /*0x74*/ u16 unk_74; +} ZeldaFollowerEntity; + +#endif // ZELDA_H diff --git a/include/object.h b/include/object.h index 34160b18..67c000cf 100644 --- a/include/object.h +++ b/include/object.h @@ -134,7 +134,7 @@ typedef enum { EZLO_CAP_FLYING, GIANT_TWIG, OBJECT_63, - THUNDERBOLD, + THUNDERBOLT, LADDER_HOLE, WATER_DROP_OBJECT, GLEEROK_PARTICLE, @@ -330,7 +330,7 @@ void SwordsmanNewsletter(); void EzloCapFlying(); void GiantTwig(); void Object63(); -void Thunderbold(); +void Thunderbolt(); void LadderHoleInBookshelf(); void WaterDropObject(); void GleerokParticle(); diff --git a/include/object/cutsceneOrchestrator.h b/include/object/cutsceneOrchestrator.h new file mode 100644 index 00000000..d5ee110e --- /dev/null +++ b/include/object/cutsceneOrchestrator.h @@ -0,0 +1,12 @@ +#ifndef CUTSCENEORCHESTRATOR_H +#define CUTSCENEORCHESTRATOR_H + +#include "script.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unused1[28]; + /*0x84*/ ScriptExecutionContext* context; +} CutsceneOrchestratorEntity; + +#endif // CUTSCENEORCHESTRATOR_H diff --git a/include/object/itemOnGround.h b/include/object/itemOnGround.h new file mode 100644 index 00000000..47ab89a8 --- /dev/null +++ b/include/object/itemOnGround.h @@ -0,0 +1,18 @@ +#ifndef ITEMONGROUND_H +#define ITEMONGROUND_H + +#include "entity.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unk_68; + /*0x69*/ u8 unk_69; + /*0x6a*/ u8 unk_6a; + /*0x6b*/ u8 unused1[1]; + /*0x6c*/ u16 unk_6c; + /*0x6e*/ u16 unk_6e; + /*0x70*/ u8 unused2[22]; + /*0x86*/ u16 unk_86; +} ItemOnGroundEntity; + +#endif // ITEMONGROUND_H diff --git a/include/object/lilypadLarge.h b/include/object/lilypadLarge.h new file mode 100644 index 00000000..b3cb6192 --- /dev/null +++ b/include/object/lilypadLarge.h @@ -0,0 +1,21 @@ +#ifndef LILYPADLARGE_H +#define LILYPADLARGE_H + +#include "entity.h" + +typedef struct { + Entity base; + u8 unk_68[4]; + s32 unk_6c; + s32 unk_70; + s16 unk_74; + s16 unk_76; + union SplitWord unk_78; + union SplitWord unk_7c; + u8 unk_80[2]; + u16 unk_82; + u8 unk_84; + u8 unk_85; +} LilypadLargeEntity; + +#endif // LILYPADLARGE_H diff --git a/include/physics.h b/include/physics.h index 74cefa41..dc6460cc 100644 --- a/include/physics.h +++ b/include/physics.h @@ -25,7 +25,6 @@ bool32 EntityWithinDistance(Entity* entity, s32 x, s32 y, s32 distance); u32 sub_0806FCA0(Entity*, Entity*); u32 sub_0806F58C(Entity*, Entity*); u32 PointInsideRadius(s32 x, s32 y, s32 radius); -u32 sub_0806F5A4(u32 idx); bool32 sub_0806F3E4(Entity*); void LinearMoveUpdate(Entity*); bool32 sub_0806FD54(Entity*); @@ -35,7 +34,10 @@ u32 sub_0806F730(Entity*); bool32 sub_0806F520(Entity*); void sub_0806F4E8(Entity*); bool32 sub_0806FC80(Entity*, Entity*, s32); -u32 sub_0806F5B0(u32); +/** Maps the direction to an animation state 0 to 3. */ +u32 GetAnimationStateForDirection4(u32 direction); +/** Maps the direction to an animation state 0 to 8. */ +u32 GetAnimationStateForDirection8(u32 direction); u32 sub_0806F824(Entity*, Entity*, s32, s32); u32 sub_0806F948(Entity*); void sub_0806FBB4(Entity*); diff --git a/include/player.h b/include/player.h index eabc6cac..e0fd182c 100644 --- a/include/player.h +++ b/include/player.h @@ -96,6 +96,12 @@ typedef enum { } PlayerControlMode; typedef enum { + DIR_DIAGONAL = 0x4, + DIR_NOT_MOVING_CHECK = 0x80, + DIR_NONE = 0xff, +} PlayerDirections; + +typedef enum { PL_BUSY = 0x1, PL_FLAGS2 = 0x2, PL_DROWNING = 0x4, @@ -125,6 +131,8 @@ typedef enum { PL_SWORD_THRUST = 0x8000000, PL_USE_OCARINA = 0x10000000, PL_CLIMBING = 0x20000000, + PL_FLAGS40000000 = 0x40000000, + PL_FLAGS80000000 = 0x80000000, } PlayerFlags; enum PlayerItemId { @@ -201,7 +209,8 @@ typedef enum { SURFACE_AUTO_LADDER, SURFACE_CLIMB_WALL, SURFACE_2C, - SURFACE_2D // reuses SurfaceAction_Dust + SURFACE_2D, // reuses SurfaceAction_Dust + SURFACE_FF = 0xff, } SurfaceType; typedef enum { @@ -275,6 +284,174 @@ typedef enum { SWORD_MOVE_LOW_BEAM, } SwordMove; +typedef enum { + ANIM_DEFAULT = 0x100, + ANIM_WALK = 0x104, + ANIM_SWORD = 0x108, + ANIM_BOUNCE = 0x114, + ANIM_SPINATTACK = 0x124, + ANIM_GREATSPIN = 0x128, + ANIM_ROLLATTACK_SPIN = 0x12c, + ANIM_ROLLATTACK_SLIDE = 0x130, + ANIM_ROLLATTACK_END = 0x134, + ANIM_SHIELD_PULLOUT = 0x158, + ANIM_SHIELD_WALK = 0x160, + ANIM_SHIELD = 0x164, + ANIM_SWORD_CHARGE = 0x168, + ANIM_SWORD_CHARGE_WALK = 0x16c, + ANIM_SWORD_CHARGE_BUMP = 0x170, + ANIM_DOWN_THRUST = 0x174, + ANIM_FALL = 0x1b8, + ANIM_GET_ITEM_BIG = 0x1b9, + ANIM_FALL_MINISH = 0x1ba, + ANIM_DIE1 = 0x1bc, + ANIM_GET_WHITE_SWORD = 0x1e2, + ANIM_BOW_PULLOUT = 0x21c, + ANIM_TRAPPED = 0x25c, + ANIM_BOW_SHOOT = 0x27c, + ANIM_BOW_CHARGE = 0x280, + ANIM_BOW_WALK = 0x284, + ANIM_ROCS_CAPE = 0x288, + ANIM_SWIM_STILL = 0x28c, + ANIM_SWIM_MOVE = 0x290, + ANIM_FROZEN = 0x294, + ANIM_DASH = 0x298, + ANIM_ELECTROCUTED = 0x29c, + ANIM_ROLL = 0x2ac, + ANIM_DIE2 = 0x2bd, + ANIM_DIVE = 0x2be, + ANIM_IN_LAVA = 0x2c1, + ANIM_PORTAL = 0x2c2, + ANIM_PORTAL_SHRINK = 0x2c3, + ANIM_DROWN_RESPAWN = 0x2ce, + ANIM_CLIMB1_UP = 0x2cf, + ANIM_CLIMB2_UP = 0x2d0, + ANIM_CLIMB1_DOWN = 0x2d1, + ANIM_CLIMB2_DOWN = 0x2d2, + ANIM_CLIMB_FROM_TOP = 0x2d3, + ANIM_CLIMB_LEFT = 0x2d4, + ANIM_CLIMB_RIGHT = 0x2d5, + ANIM_CLIMB_TO_TOP = 0x2d6, + ANIM_BOTTLE_DRINK = 0x2df, + ANIM_GET_ITEM_SMALL = 0x2e0, + ANIM_PICKUP = 0x338, + ANIM_PUSH = 0x33c, + ANIM_PULL = 0x340, + ANIM_THROW = 0x344, + ANIM_CARRY = 0x348, + ANIM_PULL2 = 0x34c, + ANIM_CARRY_STAND = 0x350, + ANIM_GRAB = 0x378, + ANIM_FALL_ON_BACK = 0x3a0, + ANIM_LAUNCHED = 0x3c0, + ANIM_EZLO_SEARCH = 0x3c5, + ANIM_EZLO_APPEAR_LEFT = 0x3c6, + ANIM_EZLO_EYES_UP = 0x3c7, + ANIM_EZLO_HEAD_DOWN = 0x3c8, + ANIM_EZLO_LEAVE_LEFT = 0x3c9, + ANIM_EZLO_APPEAR_RIGHT = 0x3ca, + ANIM_EZLO_EYES_MIDDLE = 0x3cc, + ANIM_EZLO_LEAVE_RIGHT = 0x3cd, + ANIM_DEFAULT_NOCAP = 0x400, + ANIM_WALK_NOCAP = 0x404, + ANIM_SWORD_NOCAP = 0x408, + ANIM_SHIELD_PULLOUT_NOCAP = 0x40c, + ANIM_SHIELD_WALK_NOCAP = 0x410, + ANIM_SHIELD_NOCAP = 0x414, + ANIM_BOUNCE_NOCAP = 0x418, + ANIM_HOP_NOCAP = 0x41c, + ANIM_JUMP_NOCAP = 0x420, + ANIM_LAND_NOCAP = 0x424, + ANIM_ROLL_NOCAP = 0x438, + ANIM_DROWN_NOCAP = 0x44c, + ANIM_FALL_NOCAP = 0x458, + ANIM_DIE1_NOCAP = 0x459, + ANIM_DIE2_NOCAP = 0x45a, + ANIM_GET_ITEM_BIG_NOCAP = 0x45b, + ANIM_GET_ITEM_SMALL_NOCAP = 0x45e, + ANIM_GET_ITEM_SWORD = 0x45f, + ANIM_GUSTJAR_PULLOUT = 0x500, + ANIM_GUSTJAR_SUCK = 0x504, + ANIM_MOLEMITTS_FLOOR = 0x508, + ANIM_MOLEMITTS_DIG = 0x50c, + ANIM_GUSTJAR_END = 0x510, + ANIM_GUSTJAR_BLOW = 0x514, + ANIM_GUSTJAR_WALK = 0x518, + ANIM_MOLEMITTS_CLANG = 0x51c, + ANIM_MOLEMITTS_MISS = 0x520, + ANIM_GUSTJAR_524 = 0x524, + ANIM_ENTER_POT = 0x52c, + ANIM_IN_POT = 0x530, + ANIM_LANTERN_LIGHT = 0x600, + ANIM_LANTERN_ON = 0x604, + ANIM_LANTERN = 0x608, + ANIM_LANTERN_BURN = 0x60c, + ANIM_BOTTLE_POUR = 0x610, + ANIM_BOTTLE_SWING = 0x614, + ANIM_BOTTLE_SWING_END = 0x618, + ANIM_FALL_IN_HOLE = 0x61c, + ANIM_IN_HOLE = 0x620, + ANIM_SPRING_JUMP = 0x624, + ANIM_CANE = 0x628, + ANIM_PARACHUTE_ACTIVATE = 0x700, + ANIM_BOOMERANG_MAGIC = 0x704, + ANIM_PARACHUTE = 0x708, + ANIM_MINECART_PAUSE = 0x70c, + ANIM_MINECART = 0x710, + ANIM_PARACHUTE_TURN_RIGHT = 0x714, + ANIM_PARACHUTE_TURN_OPPOSITE = 0x718, + ANIM_PARACHUTE_TURN_LEFT = 0x71c, + ANIM_PARACHUTE_TURN2_RIGHT = 0x720, + ANIM_PARACHUTE_TURN2_OPPOSITE = 0x724, + ANIM_PARACHUTE_TURN2_LEFT = 0x728, + ANIM_DROWN = 0x72c, + ANIM_PARACHUTE_FALL = 0x730, + ANIM_PUT_ON_EZLO = 0x734, + ANIM_SLEEP = 0x736, + ANIM_WAKEUP = 0x737, + ANIM_PORTAL_ACTIVATE = 0x738, + ANIM_SLEEP_NOCAP = 0x73a, + ANIM_WAKEUP_NOCAP = 0x73b, + ANIM_GROW = 0x73c, + ANIM_HOP = 0x80c, + ANIM_JUMP = 0x810, + ANIM_BOOMERANG = 0x818, + ANIM_LAND = 0x820, + ANIM_MOLDWORM_CAPTURED = 0x8b0, + ANIM_GET_NEW_SWORD = 0x8bf, + ANIM_OCARINA = 0x8e1, + ANIM_GET_LAST_SWORD = 0x8e3, + ANIM_GET_NEWCAP = 0x8e4, + ANIM_PICKUP_NOCAP = 0x928, + ANIM_CARRY_STAND_NOCAP = 0x92c, + ANIM_THROW_NOCAP = 0x930, + ANIM_CARRY_NOCAP = 0x934, + ANIM_PUSH_NOCAP = 0x93c, + ANIM_PULL_START_NOCAP = 0x940, + ANIM_PULL_NOCAP = 0x944, + ANIM_GRAB_NOCAP = 0x948, + ANIM_FALL_IN_HOLE_NOCAP = 0x950, + ANIM_IN_HOLE_NOCAP = 0x954, + ANIM_SWORD_MINISH = 0xc00, + ANIM_WALK_MINISH = 0xc04, + ANIM_ROLL_MINISH = 0xc08, + ANIM_SWIM_MINISH = 0xc0c, + ANIM_DASH_MINISH = 0xc10, + ANIM_DASH_CHARGE_MINISH = 0xc14, + ANIM_BOUNCE_MINISH = 0xc18, + ANIM_DROWN_MINISH = 0xc19, + ANIM_DIE1_MINISH = 0xc1a, + ANIM_DIE2_MINISH = 0xc1b, + ANIM_DIVE_MINISH = 0xc1c, +} PlayerAnimation; + +typedef enum { + PAS_NORTH, + PAS_EAST, + PAS_SOUTH, + PAS_WEST, +} PlayerAnimationState; + typedef struct { /*0x00*/ u8 prevAnim; /*0x01*/ u8 grab_status; @@ -304,7 +481,8 @@ typedef struct { /*0x1c*/ u8 field_0x1c; /*0x1d*/ u8 gustJarSpeed; /*0x1e*/ u8 dash_state; - /*0x1f*/ u8 field_0x1f[3]; + /*0x1f*/ u8 field_0x1f[2]; + /*0x21*/ u8 bow_state; /*0x22*/ u16 tilePosition; /*0x24*/ u16 tileType; /*0x26*/ u8 swim_state; /**< Is the player swimming? 0x80 for diving */ @@ -354,20 +532,21 @@ typedef struct { /*0x05*/ u8 arrowCount; /*0x06*/ u8 bombBagType; /*0x07*/ u8 quiverType; - /*0x08*/ u8 filler[2]; + /*0x08*/ u8 figurineCount; + /*0x09*/ u8 _hasAllFigurines; /*0x0a*/ u8 charm; /*0x0b*/ u8 picolyteType; /*0x0c*/ u8 itemButtons[2]; /*0x0e*/ u8 bottles[4]; /*0x12*/ u8 effect; /*0x13*/ u8 hasAllFigurines; - /*0x14*/ u8 filler3[4]; + /*0x14*/ u8 filler14[4]; /*0x18*/ u16 rupees; /*0x1a*/ u16 shells; /*0x1c*/ u16 charmTimer; /*0x1e*/ u16 picolyteTimer; /*0x20*/ u16 effectTimer; - /*0x22*/ u8 filler4[6]; + /*0x22*/ u8 filler22[2]; } Stats; #define SLOT_A 0 diff --git a/include/projectile.h b/include/projectile.h index c8186e2b..529ff47c 100644 --- a/include/projectile.h +++ b/include/projectile.h @@ -16,31 +16,31 @@ void DirtBallProjectile(Entity*); void WindProjectile(Entity*); void FireProjectile(Entity*); void IceProjectile(Entity*); -void GleerokProjectile(Entity*); +void GleerokProjectile(); void KeatonDagger(Entity*); void GuardLineOfSight(Entity*); void ArrowProjectile(Entity*); void MazaalEnergyBeam(Entity*); -void OctorokBossProjectile(Entity*); +void OctorokBossProjectile(); void StalfosProjectile(Entity*); void LakituCloudProjectile(Entity*); void LakituLightning(Entity*); -void MandiblesProjectile(Entity*); -void RemovableDust(Entity*); -void SpiderWeb(Entity*); +void MandiblesProjectile(); +void RemovableDust(); +void SpiderWeb(); void TorchTrapProjectile(Entity*); void GuruguruBarProjectile(Entity*); -void V1DarkMagicProjectile(Entity*); -void BallAndChain(Entity*); -void V1FireProjectile(Entity*); +void V1DarkMagicProjectile(); +void BallAndChain(); +void V1FireProjectile(); void CannonballProjectile(Entity*); -void V1EyeLaser(Entity*); +void V1EyeLaser(); void Winder(Entity*); void SpikedRollers(Entity*); -void V2Projectile(Entity*); +void V2Projectile(); void V3HandProjectile(Entity*); -void V3ElectricProjectile(Entity*); -void GyorgTail(Entity*); +void V3ElectricProjectile(); +void GyorgTail(); void GyorgMaleEnergyProjectile(Entity*); void V3TennisBallProjectile(Entity*); diff --git a/include/projectile/winder.h b/include/projectile/winder.h index face0213..4f650feb 100644 --- a/include/projectile/winder.h +++ b/include/projectile/winder.h @@ -5,8 +5,8 @@ #define WINDER_NUM_SEGMENTS 8 typedef struct { - Entity base; - s16 positions[2 * WINDER_NUM_SEGMENTS]; + /*0x00*/ Entity base; + /*0x68*/ s16 positions[2 * WINDER_NUM_SEGMENTS]; } WinderEntity; #endif // WINDER_H diff --git a/include/room.h b/include/room.h index 388adeab..29e45967 100644 --- a/include/room.h +++ b/include/room.h @@ -135,7 +135,7 @@ typedef struct { /* 0x04 */ s16 start_pos_x; /* 0x06 */ s16 start_pos_y; /* 0x08 */ u8 layer; - /* 0x09 */ u8 field_0x15; + /* 0x09 */ u8 filler9; /* 0x0a */ u8 dungeon_area; /* 0x0b */ u8 dungeon_room; /* 0x0c */ s16 dungeon_x; @@ -144,7 +144,7 @@ typedef struct { /* 0x12 */ u16 dungeon_map_y; /* 0x14 */ u16 overworld_map_x; /* 0x16 */ u16 overworld_map_y; - /* 0x18 */ u8 field_0x24[8]; + /* 0x18 */ u8 filler18[8]; } PlayerRoomStatus; static_assert(sizeof(PlayerRoomStatus) == 0x20); @@ -157,8 +157,20 @@ typedef struct { /* 0x0a */ u16 stairs_idx; // seems to be a tile type @see MetaTileType, set in UpdateDoorTransition() /* 0x0c */ PlayerRoomStatus player_status; /* 0x2c */ u8 entity_update_type; // differentiates entity priority on kinstone menu? - /* 0x2d */ u8 field_0x2c[0x8]; + /* 0x2d */ u8 field2d; + /* 0x2e */ u8 location; + /* 0x2f */ u8 field2f; + /* 0x30 */ u8 field30; + /* 0x31 */ u8 field31; + /* 0x32 */ u8 field32; + /* 0x33 */ u8 field33; +#if defined(JP) || defined(EU) + /* 0x34 */ u8 hint_height; + /* 0x35 */ u8 field35; +#else + /* 0x34 */ u8 field35; /* 0x35 */ u8 hint_height; +#endif /* 0x36 */ u16 hint_idx; /* 0x38 */ u8 field_0x38; /* 0x39 */ u8 field_0x39; @@ -239,7 +251,7 @@ void* GetRoomProperty(u32 area, u32 room, u32 property); bool32 LoadFixedGFX(Entity*, u32); void UnloadGFXSlots(Entity*); -void sub_0804B3C4(TileEntity*); +void LoadSmallChestTile2(TileEntity*); void sub_0804B0B0(u32 arg0, u32 arg1); void DoExitTransition(const ScreenTransitionData* data); diff --git a/include/save.h b/include/save.h index 50c2dc3c..bc966efc 100644 --- a/include/save.h +++ b/include/save.h @@ -29,51 +29,68 @@ typedef enum { extern SaveResult HandleSave(u32 idx); /** + * Contains save data regarding kinstones + */ +typedef struct { + u8 unused[2]; /**< unused */ + u8 didAllFusions; /**< completed all 100 kinstone fusions */ + u8 fusedCount; /**< number of kinstones fused */ + u8 types[19]; /**< item id for each kinstone type present in kinstone bag */ + u8 amounts[19]; /**< amount of each kinstone type above */ + u8 filler[3]; /**< unused filler */ + u8 fuserProgress[128]; /**< indexed by fuser id, incremented after fusion */ + u8 fuserOffers[128]; /**< available kinstone fusion for each fuser */ + u8 fusedKinstones[13]; /**< bitfield for fused kinstones + * @see CheckKinstoneFused */ + u8 fusionUnmarked[13]; /**< bitfield for disabled fusion map markers + * @see CheckFusionMapMarkerDisabled */ +} KinstoneSave; + +/** * Contains all information about a save file. * The contents of this structure are read from and written to EEPROM. */ typedef struct { - /*0x000*/ u8 invalid; /**< File is invalid. */ - /*0x001*/ u8 initialized; /**< File is initialized. */ - /*0x002*/ u8 msg_speed; /**< Message speed. */ - /*0x003*/ u8 brightness; /**< Brightness. */ - /*0x004*/ u8 filler4[0x2]; - /*0x006*/ u8 saw_staffroll; - /*0x007*/ u8 unk7; // TODO rolling barrel state? - /*0x008*/ u8 global_progress; /**< @see UpdateGlobalProgress */ - /*0x009*/ u8 field_0x9[0x17]; - /*0x020*/ u16 field_0x20; - /*0x022*/ u8 field_0x22[0x1e]; - /*0x040*/ u32 windcrests; /**< Windcrest flags. bits 0 - 0x10: Visited area of the overworld. Above 0x18: windcrest - activated. */ - /*0x044*/ u8 filler44[0xC]; - /*0x050*/ u32 unk50; - /*0x054*/ u8 filler54[0x8]; - /*0x05C*/ u32 unk5C; - /*0x060*/ u32 areaVisitFlags[8]; /**< Area visit flags. */ - /*0x080*/ char name[FILENAME_LENGTH]; /**< Save file name. */ - /*0x086*/ u8 filler86[0x2]; + /*0x000*/ u8 invalid; /**< save file is invalid */ + /*0x001*/ u8 initialized; /**< save file is initialized */ + /*0x002*/ u8 msg_speed; /**< message speed setting */ + /*0x003*/ u8 brightness; /**< brightness setting */ + /*0x004*/ u8 filler4[2]; /**< unused filler */ + /*0x006*/ u8 saw_staffroll; /**< beat the game and watched the credits */ + /*0x007*/ u8 dws_barrel_state; /**< state of the big barrel in DWS, 0 or 2 */ + /*0x008*/ u8 global_progress; /**< @see UpdateGlobalProgress */ + /*0x009*/ u8 available_figurines; /**< figurines available to get */ + /*0x00A*/ u8 fillerA[22]; /**< unused filler */ + /*0x020*/ u16 map_hints; /**< bitmask, used by subtask MapHint */ + /*0x022*/ u8 filler22[30]; /**< unused filler */ + /*0x040*/ u32 windcrests; /**< upper 8 bit Windcrest flags @see WindcrestID + * lower bits used for other things */ + /*0x044*/ u8 filler44[12]; /**< unused filler */ + /*0x050*/ u32 enemies_killed; /**< number of enemies killed */ + /*0x054*/ u8 filler54[8]; /**< unused filler */ + /*0x05C*/ u32 items_bought; /**< number of items bought in stockwells shop */ + /*0x060*/ u32 areaVisitFlags[8]; /**< Area visit flags. */ + /*0x080*/ char name[FILENAME_LENGTH]; /**< Save file name. */ + /*0x086*/ u8 filler86[2]; /**< unused filler */ /*0x088*/ PlayerRoomStatus saved_status; /**< Player room status. */ /*0x0A8*/ Stats stats; /**< Player stats. */ - /*0x0D0*/ u8 fillerD0[34]; - /*0x0F2*/ u8 inventory[36]; - /*0x116*/ u8 didAllFusions; - /*0x117*/ u8 fusedKinstoneCount; - /*0x118*/ u8 kinstoneTypes[0x13]; // 0x65-0x75 for each kinstone type present in kinstone bag - /*0x12B*/ u8 kinstoneAmounts[0x13]; // amount of each kinstone type above - /*0x13E*/ u8 filler13E[3]; - /*0x141*/ u8 fuserProgress[128]; // indexed by fuser id, incremented after fusion - /*0x1C1*/ u8 fuserOffers[128]; // available kinstone fusion for each fuser - /*0x241*/ u8 fusedKinstones[13]; /**< Bitfield for fused kinstones. @see CheckKinstoneFused */ - /*0x24E*/ u8 fusionUnmarked[13]; /**< Bitfield for disabled fusion map markers. @see CheckFusionMapMarkerDisabled */ - /*0x25B*/ u8 filler25B; - /*0x25C*/ u8 flags[0x200]; /**< Flags. */ - /*0x45C*/ u8 dungeonKeys[0x10]; // TODO Indexed by dungeon id, keys per dungeon - /*0x46C*/ u8 dungeonItems[0x10]; // TODO items in the dungeon. 4: compass, 2: big key, 1: small key - /*0x47C*/ u8 dungeonWarps[0x10]; // TODO indexed by dungeon id, EnableDungeonWarp, IsDungeonWarpActive - /*0x48C*/ u32 timers[7]; - /*0x4A8*/ u32 demo_timer; /**< Demo timer. */ - /*0x4AC*/ u8 filler4ac[0x8]; + /*0x0CC*/ u8 fillerCC[2]; /**< unused filler */ + /*0x0D0*/ u8 figurines[36]; /**< figurine bitset */ + /*0x0F2*/ u8 inventory[34]; /**< 2 bit per item @see Item */ + /*0x114*/ KinstoneSave kinstones; /**< save data for kinstones @see KinstoneSave */ + /*0x25C*/ u8 flags[0x200]; /**< flags */ + /*0x45C*/ u8 dungeonKeys[0x10]; /**< indexed by dungeon id, keys per dungeon */ + /*0x46C*/ u8 dungeonItems[0x10]; /**< dungeon items 4: compass, 2: big key, 1: small key */ + /*0x47C*/ u8 dungeonWarps[0x10]; /**< indexed by dungeon id */ + /*0x48C*/ u32 darknut_timer; /**< timer for darknut fight before Vaati fight */ + /*0x490*/ u32 drug_kill_count; /**< "timer" enemy kill count when turning in the last drug quest item */ + /*0x494*/ u32 biggoron_timer; /**< timer for biggoron mirror shield */ + /*0x498*/ u32 vaati_timer; /**< timer for vaati wrath fight */ + /*0x49C*/ u32 timer4; /**< "timer4" unused */ + /*0x4A0*/ u32 timer5; /**< "timer5" unused */ + /*0x4A4*/ u32 timer6; /**< "timer6" unused */ + /*0x4A8*/ u32 demo_timer; /**< timer for US demo version playtime limit */ + /*0x4AC*/ u8 filler4ac[8]; /**< unused filler */ } SaveFile; /** diff --git a/include/script.h b/include/script.h index b708d945..6a0688d6 100644 --- a/include/script.h +++ b/include/script.h @@ -51,7 +51,7 @@ extern u32 GetNextScriptCommandHalfwordAfterCommandMetadata(u16*); void UnloadCutsceneData(Entity* entity); void StartPlayerScript(Script* script); -void sub_0807DD50(Entity* entity); +void InitScriptForNPC(Entity* entity); void sub_0807DD64(Entity* entity); void sub_0807DD80(Entity* entity, Script* script); void LookAt(Entity*, ScriptExecutionContext*, u32, u32); @@ -60,7 +60,7 @@ ScriptExecutionContext* StartCutscene(Entity* entity, Script* script); void ExecuteScriptForEntity(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*)); void HandlePostScriptActions(Entity* entity, ScriptExecutionContext* context); void HandleEntity0x82Actions(Entity* entity); -void sub_0807DD94(Entity*, void (*function)(Entity*, ScriptExecutionContext*)); +void ExecuteScriptAndHandleAnimation(Entity* entity, void (*postScriptCallback)(Entity*, ScriptExecutionContext*)); ScriptExecutionContext* CreateScriptExecutionContext(void); void InitScriptForEntity(Entity* entity, ScriptExecutionContext* context, Script* script); diff --git a/include/sound.h b/include/sound.h index f62768ad..749a1268 100644 --- a/include/sound.h +++ b/include/sound.h @@ -168,7 +168,7 @@ typedef enum { SFX_FALL_HOLE, SFX_86, SFX_PLY_DIE, - SFX_88, + SFX_GRAB, SFX_BARREL_RELEASE, SFX_BARREL_ENTER, SFX_BARREL_ROLL, @@ -295,7 +295,7 @@ typedef enum { SFX_PLACE_OBJ, SFX_105, SFX_106, - SFX_107, + SFX_ITEM_GLOVES_AIR, SFX_108, SFX_ITEM_GET, SFX_10A, diff --git a/include/tiles.h b/include/tiles.h index 8898fe07..594ea8ce 100644 --- a/include/tiles.h +++ b/include/tiles.h @@ -118,14 +118,14 @@ typedef enum { META_TILE_TYPE_113, // 0x71 META_TILE_TYPE_114, // 0x72 META_TILE_TYPE_115, // 0x73 CHEST - META_TILE_TYPE_116, // 0x74 + META_TILE_TYPE_116, // 0x74 CHEST_OPEN META_TILE_TYPE_117, // 0x75 - META_TILE_TYPE_118, // 0x76 - META_TILE_TYPE_119, // 0x77 - META_TILE_TYPE_120, // 0x78 - META_TILE_TYPE_121, // 0x79 - META_TILE_TYPE_122, // 0x7a - META_TILE_TYPE_123, // 0x7b + META_TILE_TYPE_118, // 0x76 TORCH + META_TILE_TYPE_119, // 0x77 TORCH_LIT + META_TILE_TYPE_120, // 0x78 PRESSURE_BUTTON + META_TILE_TYPE_121, // 0x79 PRESSURE_BUTTON_PRESSED + META_TILE_TYPE_122, // 0x7a PRESSURE_SQUARE + META_TILE_TYPE_123, // 0x7b PRESSURE_SQUARE_PRESSED META_TILE_TYPE_124, // 0x7c META_TILE_TYPE_125, // 0x7d META_TILE_TYPE_126, // 0x7e @@ -148,8 +148,8 @@ typedef enum { META_TILE_TYPE_143, // 0x8f META_TILE_TYPE_144, // 0x90 META_TILE_TYPE_145, // 0x91 - META_TILE_TYPE_146, // 0x92 - META_TILE_TYPE_147, // 0x93 + META_TILE_TYPE_146, // 0x92 STAIRS_UP + META_TILE_TYPE_147, // 0x93 STAIRS_DOWN META_TILE_TYPE_148, // 0x94 META_TILE_TYPE_149, // 0x95 META_TILE_TYPE_150, // 0x96 diff --git a/include/windcrest.h b/include/windcrest.h new file mode 100644 index 00000000..2c81c1e4 --- /dev/null +++ b/include/windcrest.h @@ -0,0 +1,15 @@ +#ifndef SAVEFILE_WINDCREST_H +#define SAVEFILE_WINDCREST_H + +typedef enum WindcrestID { + WINDCREST_MT_CRENEL = 24, + WINDCREST_VEIL_FALLS, + WINDCREST_CLOUD_TOPS, + WINDCREST_HYRULE_TOWN, + WINDCREST_LAKE_HYLIA, + WINDCREST_CASTOR_WILDS, + WINDCREST_SOUTH_HYRULE_FIELD, + WINDCREST_MINISH_WOODS, +} WindcrestID; + +#endif // SAVEFILE_WINDCREST_H |
