From ffb4653b0d4fa45823262d58218e2dd7b0659557 Mon Sep 17 00:00:00 2001 From: theo3 Date: Sun, 27 Mar 2022 23:20:26 -0700 Subject: [PATCH] move function decls from player.c --- asm/non_matching/GetEmptyEntity.inc | 4 +- .../itemTryPickupObject/ItemPickupCheck.inc | 4 +- .../playerUtils/FreeCarryEntity.inc | 4 +- .../playerUtils/RegisterCarryEntity.inc | 4 +- asm/non_matching/playerUtils/sub_08078180.inc | 4 +- asm/non_matching/playerUtils/sub_080789A8.inc | 10 +- include/asm.h | 1 + include/coord.h | 5 + include/entity.h | 3 + include/functions.h | 5 - include/object.h | 2 +- include/player.h | 51 ++++- linker.ld | 4 +- src/coord.c | 16 +- src/enterPortalSubtask.c | 2 +- src/entity.c | 12 +- src/game.c | 7 +- src/interrupts.c | 4 +- src/menu/figurine_menu.c | 2 +- src/object/gentariCurtains.c | 5 +- src/object/minecart.c | 3 +- src/objectUtils.c | 11 +- src/player.c | 199 +++++++----------- src/playerItemUtils.c | 3 +- src/playerUtils.c | 25 +-- 25 files changed, 190 insertions(+), 200 deletions(-) diff --git a/asm/non_matching/GetEmptyEntity.inc b/asm/non_matching/GetEmptyEntity.inc index 4330be0a..36bc5910 100644 --- a/asm/non_matching/GetEmptyEntity.inc +++ b/asm/non_matching/GetEmptyEntity.inc @@ -48,7 +48,7 @@ _0805E6CC: .4byte gPlayerEntity _0805E6D0: .4byte gUpdateContext _0805E6D4: adds r4, #0x88 - ldr r0, _0805E738 @ =gCarryEntities + ldr r0, _0805E738 @ =gCarriedEntity cmp r4, r0 blo _0805E6A8 movs r0, #0 @@ -101,7 +101,7 @@ _0805E730: mov r8, r3 pop {r4, r5, r6, r7, pc} .align 2, 0 -_0805E738: .4byte gCarryEntities +_0805E738: .4byte gCarriedEntity _0805E73C: .4byte gEntityLists _0805E740: .4byte gUpdateContext .syntax divided diff --git a/asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc b/asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc index e355fe27..8b0b2e23 100644 --- a/asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc +++ b/asm/non_matching/itemTryPickupObject/ItemPickupCheck.inc @@ -33,7 +33,7 @@ _080761DE: blo _0807626E cmp r3, #2 bne _080762C0 - ldr r0, _0807622C @ =gCarryEntities + ldr r0, _0807622C @ =gCarriedEntity ldr r2, [r0, #8] ldrb r1, [r2, #0x16] movs r0, #0xf @@ -49,7 +49,7 @@ _080761DE: _08076220: .4byte gPlayerState _08076224: .4byte 0x00001201 _08076228: .4byte gPlayerEntity -_0807622C: .4byte gCarryEntities +_0807622C: .4byte gCarriedEntity _08076230: str r2, [r4, #0x18] strb r3, [r2, #0xc] diff --git a/asm/non_matching/playerUtils/FreeCarryEntity.inc b/asm/non_matching/playerUtils/FreeCarryEntity.inc index 2c604c70..adfdf51d 100644 --- a/asm/non_matching/playerUtils/FreeCarryEntity.inc +++ b/asm/non_matching/playerUtils/FreeCarryEntity.inc @@ -2,7 +2,7 @@ push {r4, r5, lr} adds r5, r0, #0 movs r4, #0 - ldr r0, _08078970 @ =gCarryEntities + ldr r0, _08078970 @ =gCarriedEntity ldrb r1, [r0, #2] adds r2, r0, #0 cmp r4, r1 @@ -13,7 +13,7 @@ subs r0, r1, #1 b _0807898C .align 2, 0 -_08078970: .4byte gCarryEntities +_08078970: .4byte gCarriedEntity _08078974: adds r4, #1 ldrb r3, [r2, #2] diff --git a/asm/non_matching/playerUtils/RegisterCarryEntity.inc b/asm/non_matching/playerUtils/RegisterCarryEntity.inc index 613f17dc..f007784a 100644 --- a/asm/non_matching/playerUtils/RegisterCarryEntity.inc +++ b/asm/non_matching/playerUtils/RegisterCarryEntity.inc @@ -1,7 +1,7 @@ .syntax unified push {lr} adds r3, r0, #0 - ldr r2, _08078950 @ =gCarryEntities + ldr r2, _08078950 @ =gCarriedEntity ldrb r0, [r2, #2] cmp r0, #0x1f bhi _0807894C @@ -16,5 +16,5 @@ _0807894C: pop {pc} .align 2, 0 -_08078950: .4byte gCarryEntities +_08078950: .4byte gCarriedEntity .syntax divided diff --git a/asm/non_matching/playerUtils/sub_08078180.inc b/asm/non_matching/playerUtils/sub_08078180.inc index 8086c11b..6588073b 100644 --- a/asm/non_matching/playerUtils/sub_08078180.inc +++ b/asm/non_matching/playerUtils/sub_08078180.inc @@ -124,7 +124,7 @@ _08078278: ldrb r0, [r0] cmp r0, #0xe beq _080782BC - ldr r1, _080782A0 @ =gCarryEntities + ldr r1, _080782A0 @ =gCarriedEntity ldrb r0, [r1, #1] movs r4, #9 cmp r0, #2 @@ -136,7 +136,7 @@ _08078278: movs r4, #8 b _080782B6 .align 2, 0 -_080782A0: .4byte gCarryEntities +_080782A0: .4byte gCarriedEntity _080782A4: adds r0, r5, #0 adds r0, #0xa8 diff --git a/asm/non_matching/playerUtils/sub_080789A8.inc b/asm/non_matching/playerUtils/sub_080789A8.inc index 4c9b058d..bb9a4674 100644 --- a/asm/non_matching/playerUtils/sub_080789A8.inc +++ b/asm/non_matching/playerUtils/sub_080789A8.inc @@ -2,14 +2,14 @@ push {r4, r5, r6, r7, lr} mov r7, r8 push {r7} - ldr r1, _080789BC @ =gCarryEntities + ldr r1, _080789BC @ =gCarriedEntity ldrb r0, [r1] cmp r0, #0 beq _080789C0 ldrb r0, [r1, #1] b _08078A88 .align 2, 0 -_080789BC: .4byte gCarryEntities +_080789BC: .4byte gCarriedEntity _080789C0: ldr r0, _08078A5C @ =gPlayerState ldr r0, [r0, #0x30] @@ -34,7 +34,7 @@ _080789E6: ldrb r0, [r0, #0x12] cmp r0, #0x12 beq _08078A56 - ldr r3, _08078A68 @ =gCarryEntities + ldr r3, _08078A68 @ =gCarriedEntity movs r0, #1 strb r0, [r3] ldrb r4, [r3, #2] @@ -80,7 +80,7 @@ _08078A2E: lsls r2, r2, #0x18 asrs r2, r2, #0x18 bl sub_080B1A0C - ldr r4, _08078A68 @ =gCarryEntities + ldr r4, _08078A68 @ =gCarriedEntity strh r0, [r4, #4] movs r1, #6 bl sub_0806FC24 @@ -93,7 +93,7 @@ _08078A56: _08078A5C: .4byte gPlayerState _08078A60: .4byte gPlayerEntity _08078A64: .4byte gUnk_080084BC -_08078A68: .4byte gCarryEntities +_08078A68: .4byte gCarriedEntity _08078A6C: .4byte gUnk_0811BFE0 _08078A70: .4byte gUnk_08007DF4 _08078A74: diff --git a/include/asm.h b/include/asm.h index a2c28581..d501bbd7 100644 --- a/include/asm.h +++ b/include/asm.h @@ -33,5 +33,6 @@ extern u32 sub_080086B4(u32, u32, u8*); extern u32 ResolveCollisionLayer(struct Entity_*); extern void sub_0800417E(struct Entity_*, u32); extern u32 sub_0800442E(struct Entity_*); +extern u32 sub_08007DD6(u32, const u16*); #endif // ASM_H diff --git a/include/coord.h b/include/coord.h index b8af7117..2c243c35 100644 --- a/include/coord.h +++ b/include/coord.h @@ -18,11 +18,16 @@ void sub_0806FA90(Entity*, Entity*, s32, s32); void SortEntityAbove(Entity* below_ent, Entity* above_ent); void SortEntityBelow(Entity* above_ent, Entity* below_ent); +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*); u32 sub_0806FCAC(Entity*, Entity*); +u32 sub_0806F854(Entity*, s32, s32); +u32 sub_0806F730(Entity*); extern const s16 gSineTable[64]; extern const s16 gCosineTable[256]; diff --git a/include/entity.h b/include/entity.h index 4f2cc3ca..3fbdb43d 100644 --- a/include/entity.h +++ b/include/entity.h @@ -288,6 +288,7 @@ Entity* CreateEnemy(u32 id, u32 type); Entity* CreateNPC(u32 id, u32 type, u32 type2); Entity* CreateObject(u32 id, u32 type, u32 type2); Entity* CreateObjectWithParent(Entity* parent, u32 id, u32 type, u32 type2); +Entity* CreateItemGetEntity(void); Entity* CreateFx(Entity* parent, u32 type, u32 type2); /// @} @@ -489,6 +490,8 @@ void ResetSystemPriority(void); * to allow the iteration of all Entity's. */ extern LinkedList gEntityLists[9]; +extern Entity gItemGetEntities[7]; +extern Entity gCarriedEntity; /** * Current number of entities. diff --git a/include/functions.h b/include/functions.h index 64e15113..acfa617d 100644 --- a/include/functions.h +++ b/include/functions.h @@ -78,7 +78,6 @@ extern void UnloadGFXSlots(Entity*); extern void UnloadOBJPalette(Entity*); extern void UpdateDisplayControls(void); extern void UpdateItemAnim(ItemBehavior*); -extern void UpdatePlayerMovement(void); // Unidentified extern void sub_08000148(u32, u32, u32); @@ -207,11 +206,8 @@ extern void sub_08078E84(Entity*, Entity*); extern void sub_08078FB0(Entity*); extern void sub_08079184(); extern void sub_0807919C(); -extern void sub_0807921C(); extern void sub_080792BC(s32, u32, u32); extern u32 sub_0807953C(void); -extern void sub_08079708(Entity*); -extern u32 sub_08079B24(void); extern void sub_08079BD8(Entity*); extern u32 sub_08079D48(); extern void sub_08079D84(void); @@ -219,7 +215,6 @@ extern bool32 sub_08079F8C(void); extern u32 sub_08079FC4(u32); extern void sub_0807A050(void); extern void sub_0807A5B8(u32); -extern u32 sub_0807A894(Entity*); extern void sub_0807A8D8(Entity*); extern void sub_0807AA80(Entity*); extern void sub_0807AABC(Entity*); diff --git a/include/object.h b/include/object.h index 7164e413..eb4582d4 100644 --- a/include/object.h +++ b/include/object.h @@ -14,7 +14,6 @@ #include "entity.h" #include "player.h" -extern void sub_0807879C(Entity*); extern void sub_080787C0(Entity*); extern void sub_080787B4(Entity*); extern void sub_0808C650(Entity*, u32); @@ -25,6 +24,7 @@ extern void sub_080A2BE4(Entity*, bool32); void CreateDust(Entity* parent); void CreateDustAt(s32, s32, u32); void CreateDustSmall(Entity* parent); +Entity* CreateWaterTrace(Entity*); Entity* CreateSpeechBubbleQuestionMark(Entity*, s32, s32); Entity* CreateSpeechBubbleExclamationMark(Entity*, s32, s32); Entity* CreateSpeechBubbleSleep(Entity*, s32, s32); diff --git a/include/player.h b/include/player.h index 1ec25ed8..fdb3d2d8 100644 --- a/include/player.h +++ b/include/player.h @@ -316,7 +316,7 @@ extern Entity* gPlayerClones[]; extern PlayerState gPlayerState; extern Entity gPlayerEntity; -u32 CheckPlayerInactive(void); +bool32 CheckInitPauseMenu(void); void SetPlayerControl(PlayerControlMode mode); void ResetPlayer(void); void ResetPlayerVelocity(void); @@ -331,19 +331,60 @@ void RegisterPlayerHitbox(void); void UpdateFloorType(void); void CreateEzloHint(u32, u32); +// game.c /** @see Item */ u32 IsItemEquipped(u32); /** @see Item */ u32 GetInventoryValue(u32); s32 ModHealth(s32 delta); void ModRupees(s32 delta); -void DeleteClones(void); -void sub_08077728(); -extern void sub_08077B20(); +// playerUtils.c +void DeleteClones(void); +void sub_08077728(u32); +void sub_08077B20(void); +void sub_08079E58(s32 speed, u32 direction); +void RespawnPlayer(void); +u32 GetSurfaceCalcType(Entity*, u32, u32); +void UpdatePlayerMovement(void); +void EnablePlayerDraw(Entity*); +void sub_080797EC(void); +void sub_08079258(void); +u32 sub_08079B24(void); +void sub_08079708(Entity*); +void sub_08079744(Entity*); +void sub_0807AE20(Entity*); +u32 sub_0807A894(Entity*); +u32 sub_080797C4(void); +void sub_08078F24(void); +void sub_0807B068(Entity*); +u32 sub_0807A2F8(u32); +void sub_08077698(/* PlayerEntity* */); +bool32 sub_0807A2B8(void); +u32 sub_08079550(void); +u32 sub_080782C0(void); +bool32 sub_080793E4(u32); +bool32 sub_08079C30(Entity*); +void sub_08077AEC(void); +bool32 CheckQueuedAction(void); +void UpdatePlayerSkills(void); +u32 sub_0807AC54(Entity*); +void sub_080792D8(void); +u32 sub_08078F74(Entity*); +void sub_0807879C(Entity*); +void sub_0807921C(); + +// player.s extern u32 PlayerCheckNEastTile(); extern u32* sub_08008790(Entity*, u32); -extern void sub_08079E58(s32 speed, u32 direction); +extern void UpdateIcePlayerVelocity(Entity*); +extern void sub_08008AC6(Entity*); +extern void sub_08008926(Entity*); +extern void sub_08008AC6(Entity*); +extern void sub_08008AA0(Entity*); + +// zelda.c +void SetZeldaFollowTarget(Entity*); #define COPY_FLAG_FROM_TO(base, src, dest) (base) = ((base) & ~(dest)) | (((dest) * ((base) & (src))) / src) diff --git a/linker.ld b/linker.ld index d9790a4b..5ec81484 100644 --- a/linker.ld +++ b/linker.ld @@ -175,9 +175,9 @@ SECTIONS { . = 0x000010A0; gRoomTransition = .; . = 0x00001150; gRand = .; . = 0x00001160; gPlayerEntity = .; - . = 0x000011E8; gUnk_030011E8 = .; + . = 0x000011E8; gItemGetEntities = .; . = 0x000015A0; gUnk_030015A0 = .; - . = 0x00003BE0; gCarryEntities = .; + . = 0x00003BE0; gCarriedEntity = .; . = 0x00003C70; gUnk_03003C70 = .; . = 0x00003D70; gEntityLists = .; . = 0x00003DB8; gCollidableCount = .; diff --git a/src/coord.c b/src/coord.c index 98f3f65e..fae242a2 100644 --- a/src/coord.c +++ b/src/coord.c @@ -20,13 +20,9 @@ extern s8 gUnk_08126EE4[]; extern const u16 gUnk_080046A4[]; extern const u16 gUnk_080047F6[]; -u32 sub_0806F58C(Entity*, Entity*); -u32 sub_0806FCA0(Entity*, Entity*); -extern u32 sub_08007DD6(u32, const u16*); -u32 PointInsideRadius(s32 x, s32 y, s32 radius); -extern void sub_0806FEE8(struct_gUnk_020000C0_1*, u32, u32, u32); -void sub_0806FEFC(struct_gUnk_020000C0_1*, Entity*); -bool32 sub_0807007C(struct_gUnk_020000C0*, u32); +static void sub_0806FEE8(struct_gUnk_020000C0_1*, u32, u32, u32); +static void sub_0806FEFC(struct_gUnk_020000C0_1*, Entity*); +static bool32 sub_0807007C(struct_gUnk_020000C0*, u32); void sub_0806F364(void) { gArea.filler[2] ^= 0x80; @@ -566,7 +562,7 @@ void sub_0806FEBC(Entity* ent, u32 param_2, Entity* param_3) { ptr->unk_00.unk1 = 1; } -void sub_0806FEE8(struct_gUnk_020000C0_1* this, u32 param_2, u32 param_3, u32 param_4) { +static void sub_0806FEE8(struct_gUnk_020000C0_1* this, u32 param_2, u32 param_3, u32 param_4) { this->unk_08.BYTES.byte0 = param_4; this->unk_02 = param_2; this->unk_04.BYTES.byte1 = param_3; @@ -574,7 +570,7 @@ void sub_0806FEE8(struct_gUnk_020000C0_1* this, u32 param_2, u32 param_3, u32 pa this->unk_00.unk0 = 1; } -void sub_0806FEFC(struct_gUnk_020000C0_1* this, Entity* ent) { +static void sub_0806FEFC(struct_gUnk_020000C0_1* this, Entity* ent) { this->unk_08.HALF.HI = ent->spriteVramOffset + this->unk_08.BYTES.byte0; this->unk_00.unk2 = 1; } @@ -650,7 +646,7 @@ void sub_0807000C(Entity* this) { } } -bool32 sub_0807007C(struct_gUnk_020000C0* this, u32 param_2) { +static bool32 sub_0807007C(struct_gUnk_020000C0* this, u32 param_2) { u8* ptr2; u8* ptr3; u32* spritePtr; diff --git a/src/enterPortalSubtask.c b/src/enterPortalSubtask.c index ad35d468..5898e758 100644 --- a/src/enterPortalSubtask.c +++ b/src/enterPortalSubtask.c @@ -36,7 +36,7 @@ void sub_0804AD6C(RoomControls*); void sub_080A71F4(ScreenTransitionData*); bool32 sub_0804ACA8(void); -bool32 IsEnterPortal(void) { +bool32 CheckInitPortal(void) { if (gArea.playShrinkSeq) { gMain.substate = GAMEMAIN_MINISHPORTAL; gArea.filler[8] = 0; diff --git a/src/entity.c b/src/entity.c index 7345650f..90d3afc2 100644 --- a/src/entity.c +++ b/src/entity.c @@ -231,7 +231,7 @@ void EraseAllEntities(void) { } extern Entity gUnk_030015A0[0x48]; -extern Entity gCarryEntities; +extern Entity gCarriedEntity; NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) { u8 flags_ip; @@ -262,7 +262,7 @@ NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) { ClearDeletedEntity(ptr); return ptr; } - } while (++ptr < &gCarryEntities); + } while (++ptr < &gCarriedEntity); flags_ip = 0; rv = NULL; @@ -293,16 +293,16 @@ NONMATCH("asm/non_matching/GetEmptyEntity.inc", Entity* GetEmptyEntity()) { } END_NONMATCH -extern Entity gUnk_030011E8[7]; +extern Entity gItemGetEntities[7]; -Entity* sub_0805E744(void) { - Entity* ent = gUnk_030011E8; +Entity* CreateItemGetEntity(void) { + Entity* ent = gItemGetEntities; do { if (ent->prev == NULL) { return ent; } - } while (++ent < &gUnk_030011E8[7]); + } while (++ent < &gItemGetEntities[7]); return NULL; } diff --git a/src/game.c b/src/game.c index 7baf9d5c..8b5ac8ac 100644 --- a/src/game.c +++ b/src/game.c @@ -98,10 +98,9 @@ extern void DeleteSleepingEntities(void); extern u32 UpdateLightLevel(void); extern void sub_080185F8(void); extern void UpdateDoorTransition(void); -extern bool32 IsEnterPortal(void); +extern bool32 CheckInitPortal(void); extern void UpdateCarriedObject(void); extern void DrawUI(void); -extern u32 CheckPlayerInactive(void); extern void CollisionMain(void); extern void sub_0805BB74(u32); extern void CreateZeldaFollower(void); @@ -402,7 +401,7 @@ static void GameMain_ChangeRoom(void) { } static void GameMain_Update(void) { - if (CheckPlayerInactive() || IsEnterPortal()) { + if (CheckInitPauseMenu() || CheckInitPortal()) { return; } sub_0805340C(); @@ -450,7 +449,7 @@ static void GameMain_Update(void) { } static void GameMain_BarrelUpdate(void) { - if (CheckPlayerInactive()) + if (CheckInitPauseMenu()) return; UpdateEntities(); diff --git a/src/interrupts.c b/src/interrupts.c index c52df16b..a21d6c5f 100644 --- a/src/interrupts.c +++ b/src/interrupts.c @@ -14,7 +14,7 @@ extern u8 gUnk_03003DE0; extern u8 gUnk_03000C30; extern u8 gUpdateVisibleTiles; -extern Entity gCarryEntities; +extern Entity gCarriedEntity; extern Entity* gPlayerClones[3]; extern u16 gUnk_080B2CD8[]; @@ -334,7 +334,7 @@ void sub_080171F0(void) { gPlayerState.mobility = 0; gPlayerState.speed_modifier = 0; gPlayerState.field_0xaa = 0; - MemClear(&gCarryEntities, 0x8c); + MemClear(&gCarriedEntity, 0x8c); gPlayerEntity.spriteOffsetY = gPlayerState.field_0x3f; gPlayerState.field_0x3f = 0; sub_0807B0C8(); diff --git a/src/menu/figurine_menu.c b/src/menu/figurine_menu.c index 9ac5b27f..3160d0e1 100644 --- a/src/menu/figurine_menu.c +++ b/src/menu/figurine_menu.c @@ -580,7 +580,7 @@ void sub_080A4D34(void) { gScreen.bg3.updated = 1; } -void sub_080A4D88(void) { +void InitPauseMenu(void) { MemClear(gUnk_020344A0, sizeof(gUnk_020344A0)); MenuFadeIn(1, 0); SetBgmVolume(0x80); diff --git a/src/object/gentariCurtains.c b/src/object/gentariCurtains.c index eed470dc..e5b1d0eb 100644 --- a/src/object/gentariCurtains.c +++ b/src/object/gentariCurtains.c @@ -26,9 +26,6 @@ void sub_080921BC(GentariCurtainEntity* this); void sub_080921F0(GentariCurtainEntity* this); void sub_08092214(GentariCurtainEntity* this); -extern Entity gUnk_030011E8[7]; -extern Entity gCarryEntities; - void GentariCurtain(Entity* this) { static void (*const actionFuncs[])(GentariCurtainEntity*) = { sub_08092050, @@ -93,7 +90,7 @@ void sub_080921BC(GentariCurtainEntity* this) { GenericEntity* pEVar1; GenericEntity* end; - pEVar1 = (GenericEntity*)gUnk_030011E8; + pEVar1 = (GenericEntity*)gItemGetEntities; end = pEVar1 + 0x4f; do { diff --git a/src/object/minecart.c b/src/object/minecart.c index c43d574e..146df90b 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -9,7 +9,6 @@ typedef struct { struct_030010EC* minecartData; } MinecartEntity; -extern u32 sub_08007DD6(u32, u32); extern void sub_08017744(Entity*); u32 sub_08091DDC(MinecartEntity*); @@ -22,7 +21,7 @@ void sub_08091C98(MinecartEntity*); void sub_08091CC8(MinecartEntity*); void sub_08091D90(MinecartEntity*); -extern const u32 gUnk_081223D8[]; +extern const u16* const gUnk_081223D8[]; void Minecart(Entity* this) { static void (*const actionFuncs[])(MinecartEntity*) = { diff --git a/src/objectUtils.c b/src/objectUtils.c index c4a93c17..aadc61c4 100644 --- a/src/objectUtils.c +++ b/src/objectUtils.c @@ -10,16 +10,13 @@ extern const Hitbox* const gObjectHitboxes[]; u32 LoadObjectSprite(Entity* this, s32 type, const ObjectDefinition* definition); extern const ObjectDefinition gObjectDefinitions[]; -extern Entity* sub_0805E744(void); -Entity* CreateWaterTrace(Entity*); - -Entity* CreateSpeechBubble(Entity*, u32, s32, s32); +static Entity* CreateSpeechBubble(Entity*, u32, s32, s32); Entity* sub_080A276C(Entity* parent, u32 type, u32 type2) { - Entity* e = sub_0805E744(); + Entity* e = CreateItemGetEntity(); if (e != NULL) { - e->id = 0xC1; + e->id = OBJECT_C1; e->kind = OBJECT; e->type = type; e->type2 = type2; @@ -340,7 +337,7 @@ Entity* CreateSpeechBubbleSleep(Entity* parent, s32 offsetX, s32 offsetY) { return CreateSpeechBubble(parent, 2, offsetX, offsetY); } -Entity* CreateSpeechBubble(Entity* parent, u32 type2, s32 xOffset, s32 yOffset) { +static Entity* CreateSpeechBubble(Entity* parent, u32 type2, s32 xOffset, s32 yOffset) { Entity* obj = CreateObject(THOUGHT_BUBBLE, 0, type2); if (obj != NULL) { CopyPosition(parent, obj); diff --git a/src/player.c b/src/player.c index 23250474..586f43e3 100644 --- a/src/player.c +++ b/src/player.c @@ -44,7 +44,7 @@ #define PULL_SPEED Q_8_8(0.5) #define PUSH_SPEED Q_8_8(0.5) -#define PIT_DAMAGE 0x2 +#define FALL_DAMAGE 2 #define DEFAULT_ANIM 0x100 @@ -66,7 +66,7 @@ static EntityAction sub_0807204C; static EntityAction sub_080720DC; static EntityAction PlayerPull; static EntityAction PlayerLava; -EntityAction PlayerWarp; +EntityAction PlayerWarp; // why is this defined in playerUtils.c? We may never know : ( static EntityAction sub_08072454; static EntityAction PlayerDrown; static EntityAction PlayerUsePortal; @@ -114,8 +114,8 @@ static EntityAction PortalStandUpdate; static EntityAction PortalActivateInit; static EntityAction PortalActivateUpdate; static EntityAction PortalShrinkInit; -/*static*/ EntityAction PortalShrinkUpdate; -/*static*/ EntityAction PortalEnterUpdate; +static EntityAction PortalShrinkUpdate; +static EntityAction PortalEnterUpdate; static EntityAction PortalUnknownUpdate; // PLAYER_TALKEZLO @@ -188,8 +188,8 @@ static EntityAction sub_08072C48; // PLAYER_08072C9C static EntityAction sub_08072CC0; static EntityAction sub_08072CFC; -/*static*/ EntityAction sub_08072D54; -/*static*/ EntityAction sub_08072F14; +static EntityAction sub_08072D54; +static EntityAction sub_08072F14; // PLAYER_CLIMB static EntityAction sub_08072F94; @@ -205,8 +205,8 @@ static EntityAction sub_080733BC; static EntityAction sub_08073468; static EntityAction sub_080734D4; static EntityAction sub_08073504; -/*static*/ EntityAction sub_08073584; -/*static*/ EntityAction sub_0807379C; +static EntityAction sub_08073584; +static EntityAction sub_0807379C; static EntityAction sub_080737BC; static EntityAction sub_0807380C; static EntityAction sub_08073884; @@ -227,7 +227,7 @@ static EntityAction sub_08073F4C; static EntityAction sub_08073FD0; static EntityAction sub_08074018; static EntityAction sub_08074060; -/*static*/ EntityAction sub_080740D8; +static EntityAction sub_080740D8; // PLAYER_08074C44 static EntityAction sub_08074C68; @@ -248,6 +248,8 @@ static EntityAction sub_0807513C; static EntityAction sub_0807518C; static EntityAction sub_080751B4; +// static helper functions +static void DoJump(Entity*); static void sub_080717F8(Entity*); static void reset_priority(void); static void break_out(Entity* this); @@ -258,60 +260,15 @@ static void hide(Entity*); static void conveyer_push(Entity*); static void sub_08074D34(Entity*, ScriptExecutionContext*); static void sub_08070BEC(Entity*, u32); +static void sub_08074808(Entity* this); // exports void SurfaceAction_Water(Entity*); void SurfaceAction_Ladder(Entity*); void SurfaceAction_AutoLadder(Entity*); -extern void sub_080A4D88(void); -extern void RespawnPlayer(void); -extern void sub_080797EC(void); -extern void UpdatePlayerMovement(void); -extern void sub_08079258(void); -extern void EnablePlayerDraw(Entity*); -extern u32 sub_08079B24(void); -extern void sub_08079708(Entity*); -extern u32 sub_0806F854(Entity*, s32, s32); +extern void InitPauseMenu(void); extern u32 UpdatePlayerCollision(void); -extern void sub_08079744(Entity*); -extern void sub_0807AE20(Entity*); -extern u32 sub_0807A894(Entity*); -extern u32 sub_080797C4(void); -extern void UpdateIcePlayerVelocity(Entity*); -extern void sub_08078F24(void); -extern void sub_0807B068(Entity*); -extern u32 sub_0807A2F8(u32); -extern u32 sub_0806F730(Entity*); -extern u32 sub_08007DD6(u32, const u16*); -extern u32 GetSurfaceCalcType(Entity*, u32, u32); -extern void sub_08074808(Entity* this); -extern void DoJump(Entity*); -extern void SetZeldaFollowTarget(Entity*); -u32 ItemIsSword(u32 item); -extern u32 sub_0807A2B8(void); -extern u32 sub_08079550(void); -extern u32 sub_080782C0(void); -extern u32 sub_080793E4(u32); -extern void sub_08008AC6(Entity*); -extern u32 sub_08079C30(Entity*); -extern void sub_08077AEC(void); -extern u32 RunQueuedAction(void); -extern void UpdatePlayerSkills(void); - -void sub_08077698(Entity*); -u32 sub_080782C0(void); -u32 UpdatePlayerCollision(void); -void sub_080797EC(void); -u32 sub_0807AC54(Entity*); -void sub_080792D8(void); -u32 sub_08078F74(Entity*); -void DoJump(Entity*); -void sub_08008926(Entity*); -void UpdatePlayerMovement(void); -void CreateWaterTrace(Entity*); -void sub_08008AC6(Entity*); -void sub_08008AA0(Entity*); extern ScreenTransitionData gUnk_0813AB58; extern ScreenTransitionData gUnk_0813AD88[]; @@ -322,12 +279,12 @@ extern u16 script_BedAtSimons; extern ScriptExecutionContext gPlayerScriptExecutionContext; -u32 CheckPlayerInactive(void) { +bool32 CheckInitPauseMenu(void) { u32 framestate; if (((gInput.newKeys & START_BUTTON) == 0 || gFadeControl.active || gUnk_02034490.unk0 || (gMessage.doTextBox & 0x7F) || gSave.stats.health == 0 || !gSave.fillerD0[34] || gPlayerState.controlMode != 0 || gPriorityHandler.priority_timer != 0)) { - return 0; + return FALSE; } framestate = gPlayerState.framestate == 0 ? gPlayerState.framestate_last : gPlayerState.framestate; @@ -337,10 +294,10 @@ u32 CheckPlayerInactive(void) { case PL_STATE_ITEMGET: case PL_STATE_DROWN: case PL_STATE_STAIRS: - return 0; + return FALSE; } - sub_080A4D88(); - return 1; + InitPauseMenu(); + return TRUE; } void DoPlayerAction(Entity* this) { @@ -382,6 +339,8 @@ void DoPlayerAction(Entity* this) { } static void PlayerInit(Entity* this) { + u32 equip_status; + gPlayerState.field_0x0[0] = 0xff; gPlayerState.startPosX = gPlayerEntity.x.HALF.HI; gPlayerState.startPosY = gPlayerEntity.y.HALF.HI; @@ -404,13 +363,14 @@ static void PlayerInit(Entity* this) { ResolveCollisionLayer(this); } - if (IsItemEquipped(ITEM_LANTERN_ON) != 2) { - sub_08077728(); + equip_status = IsItemEquipped(ITEM_LANTERN_ON); + if (equip_status != 2) { + sub_08077728(equip_status); } DeleteClones(); UpdatePlayerSkills(); - if (RunQueuedAction() == 0) { + if (CheckQueuedAction() == 0) { sub_0807921C(); UpdateFloorType(); if (gPlayerState.swim_state != 0) { @@ -457,7 +417,7 @@ static void PlayerNormal(Entity* this) { } sub_080085B0(this); this->hurtType = 0; - if (RunQueuedAction()) { + if (CheckQueuedAction()) { return; } if (!gPlayerState.swim_state && (gPlayerState.jump_status & 0xC0) == 0) { @@ -478,7 +438,7 @@ static void PlayerNormal(Entity* this) { UpdateFloorType(); } - if (RunQueuedAction()) { + if (CheckQueuedAction()) { return; } @@ -489,7 +449,7 @@ static void PlayerNormal(Entity* this) { } if ((gPlayerState.flags & (PL_USE_OCARINA | PL_FLAGS2)) == 0) { UpdateFloorType(); - RunQueuedAction(); + CheckQueuedAction(); } return; } @@ -527,7 +487,7 @@ static void PlayerNormal(Entity* this) { } sub_08077698(this); - if (RunQueuedAction()) + if (CheckQueuedAction()) return; sub_080792D8(); @@ -536,7 +496,7 @@ static void PlayerNormal(Entity* this) { } DoJump(this); - if (RunQueuedAction()) + if (CheckQueuedAction()) return; if (gPlayerState.jump_status) { @@ -665,7 +625,7 @@ static void PlayerFallUpdate(Entity* this) { RespawnPlayer(); gPlayerState.field_0xa = 0; this->iframes = 32; - ModHealth(-PIT_DAMAGE); + ModHealth(-FALL_DAMAGE); } } } @@ -709,12 +669,12 @@ static void PlayerBounceUpdate(Entity* this) { UpdatePlayerMovement(); UpdateFloorType(); - if (RunQueuedAction() || GravityUpdate(this, GRAVITY_RATE)) + if (CheckQueuedAction() || GravityUpdate(this, GRAVITY_RATE)) return; gPlayerState.jump_status = 0; - if (RunQueuedAction()) + if (CheckQueuedAction()) return; if (sub_08079D48() || gPlayerState.swim_state != 0) { @@ -758,7 +718,7 @@ static void sub_08070E9C(Entity* this) { sub_08070f24, }; - if (RunQueuedAction() != 0) { + if (CheckQueuedAction() != 0) { MessageClose(); } else { gPlayerState.field_0x27[0] = 4; @@ -843,17 +803,20 @@ static void PlayerItemGetInit(Entity* this) { static void PlayerItemGetUpdate(Entity* this) { UpdateAnimationSingleFrame(this); - if (this->frame != /* entire animation is a static frame */ 0) + if (this->frame != 0) /* entire animation is a static frame, wait for advance */ this->subAction = 2; } static void sub_08071038(Entity* this) { UpdateAnimationSingleFrame(this); - if (RunQueuedAction() || (gMessage.doTextBox & 0x7f)) + // player is still reading message + if (CheckQueuedAction() || (gMessage.doTextBox & 0x7f)) return; if (this->frame & ANIM_DONE) { + // remove the item + // is this actually deleted? this->child = NULL; this->knockbackDuration = 0; this->iframes = 248; @@ -908,7 +871,7 @@ static void PlayerJumpInit(Entity* this) { } static void sub_08071130(Entity* this) { - if (RunQueuedAction()) + if (CheckQueuedAction()) return; if (gPlayerState.sword_state == 0) { @@ -936,7 +899,7 @@ static void sub_08071130(Entity* this) { UpdateFloorType(); - if (RunQueuedAction()) + if (CheckQueuedAction()) return; if ((sub_08079D48() == 0) || (gPlayerState.swim_state != 0)) { @@ -1176,7 +1139,7 @@ static void PortalShrinkInit(Entity* this) { SoundReq(SFX_PLY_SHRINKING); } -void PortalShrinkUpdate(Entity* this) { +static void PortalShrinkUpdate(Entity* this) { static const u8 gUnk_0811BABC[] = { 1, 1, 1, 1, 2, 4, 8, 16, }; @@ -1251,7 +1214,7 @@ void PortalShrinkUpdate(Entity* this) { UpdateAnimationSingleFrame(this); } -/*static*/ void PortalEnterUpdate(Entity* this) { +static void PortalEnterUpdate(Entity* this) { if (this->actionDelay == 0) { if (GravityUpdate(this, GRAVITY_RATE)) return; @@ -1311,7 +1274,7 @@ static void PlayerTalkEzlo(Entity* this) { sub_08071A4C, }; - if (RunQueuedAction()) { + if (CheckQueuedAction()) { MessageClose(); reset_priority(); } else { @@ -1814,7 +1777,7 @@ static void sub_080720DC(Entity* this) { sub_08072168, }; - if (RunQueuedAction() == 0) + if (CheckQueuedAction() == 0) gUnk_0811BB60[this->subAction](this); } @@ -2103,7 +2066,7 @@ static void PlayerRollUpdate(Entity* this) { if (((gPlayerState.flags & (PL_ROLLING | PL_MOLDWORM_CAPTURED)) != PL_ROLLING) || ((gPlayerState.flags & PL_MOLDWORM_RELEASED) == 0 && (this->iframes != 0) && (this->bitfield & 0x80))) { gPlayerState.flags &= ~PL_ROLLING; - if (RunQueuedAction()) + if (CheckQueuedAction()) return; PlayerWaitForScroll(this); @@ -2118,7 +2081,7 @@ static void PlayerRollUpdate(Entity* this) { if ((gPlayerState.flags & PL_FLAGS2) == 0) { UpdateFloorType(); } - if (RunQueuedAction()) { + if (CheckQueuedAction()) { gPlayerState.flags &= ~PL_ROLLING; return; } @@ -2383,7 +2346,7 @@ static const u16* const sTileTable[] = { sTiles + 9, }; -void sub_08072D54(Entity* this) { +static void sub_08072D54(Entity* this) { u32 uVar2; UpdateAnimationSingleFrame(this); @@ -2463,7 +2426,7 @@ void sub_08072D54(Entity* this) { } } -/*static*/ void sub_08072F14(Entity* this) { +static void sub_08072F14(Entity* this) { if (--this->actionDelay != 0xff) { sub_0807921C(); } else { @@ -2477,7 +2440,7 @@ static void PlayerClimb(Entity* this) { sub_08073094, }; - if (!RunQueuedAction()) { + if (!CheckQueuedAction()) { gPlayerState.framestate = PL_STATE_CLIMB; gPlayerState.floor_type = GetSurfaceCalcType(this, 0, 0); sPlayerClimbStates[this->subAction](this); @@ -2562,7 +2525,7 @@ static void sub_08073094(Entity* this) { UpdateFloorType(); } - if (RunQueuedAction() == 0) { + if (CheckQueuedAction() == 0) { switch (gPlayerState.floor_type) { case SURFACE_AUTO_LADDER: case SURFACE_2C: @@ -2571,7 +2534,7 @@ static void sub_08073094(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frame & 0x40) { UpdateFloorType(); - if (!RunQueuedAction()) { + if (!CheckQueuedAction()) { this->subAction--; } } @@ -2588,7 +2551,7 @@ static void sub_08073094(Entity* this) { UpdateAnimationSingleFrame(this); if (this->frame & 0x40) { UpdateFloorType(); - if (!RunQueuedAction()) { + if (!CheckQueuedAction()) { this->subAction--; } } @@ -2694,7 +2657,7 @@ static void sub_0807332C(Entity* this) { SetPlayerActionNormal(); } else { gMain.substate = GAMEMAIN_CHANGEAREA; - *(&gMain.pauseInterval + 1) = 1; + gMain.pad = 1; SetFade(5, 8); } } @@ -2728,7 +2691,7 @@ static void PlayerParachute(Entity* this) { sub_08073468, sub_080734D4, sub_08073504, sub_08073584, sub_0807379C, sub_080737BC, sub_0807380C, sub_08073884, }; - if (!RunQueuedAction()) { + if (!CheckQueuedAction()) { UpdateFloorType(); this->spriteOrientation.flipY = 1; this->spriteRendering.b3 = 1; @@ -2780,21 +2743,7 @@ static void sub_08073504(Entity* this) { UpdateAnimationSingleFrame(this); } -static const u16 gUnk_0811BC28[] = { - 0x0708, - 0x071C, - 0x0718, - 0x0714, -}; - -static const u16 gUnk_0811BC30[] = { - 0x0708, - 0x0728, - 0x0724, - 0x0720, -}; - -void sub_08073584(Entity* this) { +static void sub_08073584(Entity* this) { u32 state, dir, idx; if ((gPlayerState.field_0x92 & 0x80) || this->iframes > 0 || gPlayerState.field_0x3c[0] || @@ -2852,6 +2801,13 @@ void sub_08073584(Entity* this) { idx = 0; state = gPlayerState.field_0xd >> 2; if (!this->field_0x86.HALF.HI || ((gPlayerState.field_0xd & 0x80) == 0 && this->animationState != state)) { + static const u16 sAnims1[] = { + 0x0708, + 0x071C, + 0x0718, + 0x0714, + }; + if ((gPlayerState.field_0xd & 0x80) == 0) { if (this->animationState != state) { if (this->animationState == (state ^ 4)) { @@ -2867,21 +2823,28 @@ void sub_08073584(Entity* this) { } } - if (gUnk_0811BC28[idx] == gPlayerState.animation) { + if (sAnims1[idx] == gPlayerState.animation) { if (gArea.locationIndex == 16) sub_080042BA(this, 2); else UpdateAnimationSingleFrame(this); } else { - gPlayerState.animation = gUnk_0811BC28[idx]; + gPlayerState.animation = sAnims1[idx]; } this->field_0x86.HALF.LO = idx; } else { + static const u16 sAnims2[] = { + 0x0708, + 0x0728, + 0x0724, + 0x0720, + }; + this->field_0x86.HALF.HI--; - if (gUnk_0811BC30[this->field_0x86.HALF.LO] == gPlayerState.animation) + if (sAnims2[this->field_0x86.HALF.LO] == gPlayerState.animation) UpdateAnimationSingleFrame(this); else - gPlayerState.animation = gUnk_0811BC30[this->field_0x86.HALF.LO]; + gPlayerState.animation = sAnims2[this->field_0x86.HALF.LO]; } if (--this->field_0x7c.WORD == -1) { @@ -2893,7 +2856,7 @@ void sub_08073584(Entity* this) { } } -/*static*/ void sub_0807379C(Entity* this) { +static void sub_0807379C(Entity* this) { if (this->z.HALF.HI > -32) { this->z.HALF.HI--; } else { @@ -2970,7 +2933,7 @@ void sub_08073884(Entity* this) { UpdateAnimationSingleFrame(this); } -void DoJump(Entity* this) { +static void DoJump(Entity* this) { static EntityAction* const sStates[] = { sub_08073924, sub_08073968, sub_080739EC, sub_08073A94, sub_08073B8C, sub_08073C30, }; @@ -2978,7 +2941,7 @@ void DoJump(Entity* this) { sStates[gPlayerState.jump_status & 7](this); } -void sub_08073924(Entity* this) { +static void sub_08073924(Entity* this) { if ((gPlayerState.flags & PL_ROLLING) == 0 && (this->z.HALF.HI & 0x8000) && !gPlayerState.field_0xa) { gPlayerState.jump_status = 0x40; gPlayerState.field_0xd = 0xff; @@ -3173,7 +3136,7 @@ static void sub_08073D20(Entity* this) { sub_08079708(this); return; } - if (!RunQueuedAction()) { + if (!CheckQueuedAction()) { DoJump(this); UpdateFloorType(); if (gPlayerState.jump_status) @@ -3182,7 +3145,7 @@ static void sub_08073D20(Entity* this) { gPlayerState.swim_state = 0; this->field_0x3c &= ~4; } - if (!RunQueuedAction() && this->subAction != 2) { + if (!CheckQueuedAction() && this->subAction != 2) { if ((gPlayerState.flags & PL_HIDDEN) == 0) { sub_080085B0(this); sub_080792D8(); @@ -3193,7 +3156,7 @@ static void sub_08073D20(Entity* this) { return; } if (sub_080782C0()) { - RunQueuedAction(); + CheckQueuedAction(); return; } COLLISION_ON(this); @@ -3631,7 +3594,7 @@ void SurfaceAction_Water(Entity* this) { } } -void sub_08074808(Entity* this) { +static void sub_08074808(Entity* this) { sub_08077AEC(); if (GetInventoryValue(ITEM_FLIPPERS) == 1) { if (!gPlayerState.swim_state) { @@ -3830,7 +3793,7 @@ static void sub_08074C44(Entity* this) { sub_080750F4, }; - if (!RunQueuedAction()) + if (!CheckQueuedAction()) gUnk_0811BC88[this->subAction](this); } diff --git a/src/playerItemUtils.c b/src/playerItemUtils.c index 2a9873db..09e822db 100644 --- a/src/playerItemUtils.c +++ b/src/playerItemUtils.c @@ -11,7 +11,6 @@ Entity* GiveItemWithCutscene(u32, u32, u32); Entity* sub_080A276C(Entity*, u32, u32); void sub_08078AF0(Entity*, u32, u32); -Entity* sub_0805E744(void); void sub_080A7D44(u32, u32); void CreateItemEntity(u32 type, u32 type2, u32 delay) { @@ -35,7 +34,7 @@ Entity* GiveItemWithCutscene(u32 type, u32 type2, u32 delay) { type = 87; type2 = 0; } - e = sub_0805E744(); + e = CreateItemGetEntity(); if (e != NULL) { e->type = type; e->type2 = type2; diff --git a/src/playerUtils.c b/src/playerUtils.c index d006bfd6..d879ff6f 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -19,12 +19,10 @@ extern void sub_080752E8(ItemBehavior* behavior, u32 arg1); // item.c extern void sub_0800857C(Entity*); extern void SetDefaultPriorityForKind(Entity*); extern void DoPlayerAction(Entity*); -extern Entity* sub_0805E744(); extern void sub_0809D738(Entity*); extern s32 Mod(s32, s32); extern void sub_08003FDE(Entity*, u32, u32, u32); extern u32 sub_080B1B84(u32, u32); -extern u32 sub_08007DD6(u32, const u16*); typedef struct { u8 unk0[4]; @@ -45,18 +43,15 @@ ItemBehavior* sub_0807794C(u32); u32 sub_080789A8(void); ItemBehavior* sub_080779EC(u32); void DeletePlayerItem(ItemBehavior*, u32); -void sub_08077AEC(void); bool32 sub_08079E90(u32); void sub_08079258(void); void sub_08078D60(void); void* sub_08077C54(ItemBehavior*); u32 sub_08079FD4(Entity*, u32); void LoadRoomGfx(void); -bool32 sub_080793E4(u32); u32 sub_0807A094(u32); u32 GetSurfaceCalcType(Entity*, u32, u32); void sub_0807AAF8(Entity*, u32); -bool32 sub_08079C30(Entity*); extern struct_0811BE48 gUnk_0811BE48[]; extern void (*const gUnk_0811C27C[])(Entity*); @@ -385,7 +380,7 @@ Entity* CreatePlayerItemWithParent(ItemBehavior* beh, u32 subtype) { void* sub_08077C54(ItemBehavior* unk) { GenericEntity* item; - item = (GenericEntity*)sub_0805E744(); + item = (GenericEntity*)CreateItemGetEntity(); if (item != NULL) { item->base.id = gUnk_0811BE48[unk->behaviorID].unk0[3]; item->base.kind = PLAYER_ITEM; @@ -426,7 +421,7 @@ Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) { Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) { GenericEntity* ent; - ent = (GenericEntity*)sub_0805E744(); + ent = (GenericEntity*)CreateItemGetEntity(); if (ent != NULL) { ent->base.flags = ENT_COLLIDE; ent->base.kind = PLAYER_ITEM; @@ -702,7 +697,7 @@ void ForceSetPlayerState(u32 framestate) { ASM_FUNC("asm/non_matching/playerUtils/sub_08078180.inc", void sub_08078180()) -ASM_FUNC("asm/non_matching/playerUtils/sub_080782C0.inc", void sub_080782C0()) +ASM_FUNC("asm/non_matching/playerUtils/sub_080782C0.inc", u32 sub_080782C0()) void sub_080784C8(void) { MemClear(&gUnk_03003DF0, 0x188); @@ -966,7 +961,7 @@ void sub_08078EE4(void) { gPlayerEntity.y.HALF.HI = gPlayerState.startPosY; } -bool32 RunQueuedAction(void) { +bool32 CheckQueuedAction(void) { if (gPlayerState.queued_action == 0) { return FALSE; } else { @@ -1131,7 +1126,7 @@ u32 sub_0807953C(void) { return gPlayerState.field_0x92 & tmp; } -ASM_FUNC("asm/non_matching/playerUtils/sub_08079550.inc", void sub_08079550()) +ASM_FUNC("asm/non_matching/playerUtils/sub_08079550.inc", u32 sub_08079550(void)) void sub_08079708(Entity* this) { gPlayerState.framestate = 0x12; @@ -1167,7 +1162,7 @@ void sub_08079744(Entity* this) { ASM_FUNC("asm/non_matching/playerUtils/sub_08079778.inc", void sub_08079778()) -ASM_FUNC("asm/non_matching/playerUtils/sub_080797C4.inc", void sub_080797C4()) +ASM_FUNC("asm/non_matching/playerUtils/sub_080797C4.inc", u32 sub_080797C4(void)) ASM_FUNC("asm/non_matching/playerUtils/sub_080797EC.inc", void sub_080797EC()) @@ -1339,7 +1334,7 @@ bool32 sub_0807A2B8(void) { } } -ASM_FUNC("asm/non_matching/playerUtils/sub_0807A2F8.inc", void sub_0807A2F8()) +ASM_FUNC("asm/non_matching/playerUtils/sub_0807A2F8.inc", u32 sub_0807A2F8(u32 a1)) ASM_FUNC("asm/non_matching/playerUtils/sub_0807A500.inc", void sub_0807A500()) @@ -1401,13 +1396,13 @@ ASM_FUNC("asm/non_matching/playerUtils/sub_0807AAF8.inc", void sub_0807AAF8(Enti ASM_FUNC("asm/non_matching/playerUtils/sub_0807AB44.inc", void sub_0807AB44()) -ASM_FUNC("asm/non_matching/playerUtils/sub_0807AC54.inc", void sub_0807AC54()) +ASM_FUNC("asm/non_matching/playerUtils/sub_0807AC54.inc", u32 sub_0807AC54(Entity* a)) ASM_FUNC("asm/non_matching/playerUtils/sub_0807ACCC.inc", void sub_0807ACCC(Entity* a)) ASM_FUNC("asm/non_matching/playerUtils/sub_0807ADB8.inc", void sub_0807ADB8()) -ASM_FUNC("asm/non_matching/playerUtils/sub_0807AE20.inc", void sub_0807AE20()) +ASM_FUNC("asm/non_matching/playerUtils/sub_0807AE20.inc", void sub_0807AE20(Entity* e)) void UpdatePlayerSkills(void) { gPlayerState.skills = SKILL_NONE; @@ -1472,7 +1467,7 @@ u32 sub_0807B014(void) { } } -void sub_0807B068(void) { +void sub_0807B068(Entity* entity) { if ((gPlayerState.dash_state | gPlayerState.field_0x3[1]) == 0) { if (gPlayerState.swim_state != 0) { if ((gPlayerState.swim_state & 0x80) != 0) {