From b28f865051ab27862d14077a046f2eea6e72191e Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sun, 30 Jul 2023 23:51:54 +0200 Subject: Create new entity structs for Player Items --- include/enemy/octorokBoss.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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; -- cgit v1.2.3 From c63a86fbcac78c1773b31383a8837a508c649971 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sun, 30 Jul 2023 23:56:42 +0200 Subject: Create some enemy structs --- include/enemy.h | 164 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 82 insertions(+), 82 deletions(-) (limited to 'include') diff --git a/include/enemy.h b/include/enemy.h index ba1b828b..bc9f842b 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -156,108 +156,108 @@ typedef enum { /*0x66*/ ENEMY_66 } Enemy; -void Octorok(Entity*); -void Chuchu(Entity*); -void Leever(Entity*); -void Peahat(Entity*); -void Rollobite(Entity*); -void DarkNut(Entity*); -void HangingSeed(Entity*); -void Beetle(Entity*); -void Keese(Entity*); -void DoorMimic(Entity*); -void RockChuchu(Entity*); -void SpinyChuchu(Entity*); -void CuccoChickAggr(Entity*); -void Moldorm(Entity*); -void EnemyE(Entity*); -void Moldworm(Entity*); -void Sluggula(Entity*); -void Pesto(Entity*); -void Puffstool(Entity*); -void ChuchuBoss(Entity*); -void LikeLike(Entity*); -void SpearMoblin(Entity*); -void BusinessScrub(Entity*); -void RupeeLike(Entity*); -void Madderpillar(Entity*); -void WaterDrop(Entity*); -void WallMaster(Entity*); -void BombPeahat(Entity*); -void Spark(Entity*); -void Chaser(Entity*); -void SpikedBeetle(Entity*); -void SensorBladeTrap(Entity*); -void Helmasaur(Entity*); -void FallingBoulder(Entity*); -void Bobomb(Entity*); -void WallMaster2(Entity*); +void Octorok(); +void Chuchu(); +void Leever(); +void Peahat(); +void Rollobite(); +void DarkNut(); +void HangingSeed(); +void Beetle(); +void Keese(); +void DoorMimic(); +void RockChuchu(); +void SpinyChuchu(); +void CuccoChickAggr(); +void Moldorm(); +void EnemyE(); +void Moldworm(); +void Sluggula(); +void Pesto(); +void Puffstool(); +void ChuchuBoss(); +void LikeLike(); +void SpearMoblin(); +void BusinessScrub(); +void RupeeLike(); +void Madderpillar(); +void WaterDrop(); +void WallMaster(); +void BombPeahat(); +void Spark(); +void Chaser(); +void SpikedBeetle(); +void SensorBladeTrap(); +void Helmasaur(); +void FallingBoulder(); +void Bobomb(); +void WallMaster2(); void Gleerok(); -void VaatiEyesMacro(Entity*); -void Tektite(Entity*); +void VaatiEyesMacro(); +void Tektite(); void WizzrobeWind(); void WizzrobeFire(); void WizzrobeIce(); void Armos(); void Eyegore(); -void Rope(Entity*); -void SmallPesto(Entity*); -void AcroBandit(Entity*); -void BladeTrap(Entity*); -void Keaton(Entity*); -void Crow(Entity*); +void Rope(); +void SmallPesto(); +void AcroBandit(); +void BladeTrap(); +void Keaton(); +void Crow(); void Mulldozer(); -void Bombarossa(Entity*); -void Wisp(Entity*); -void SpinyBeetle(Entity*); -void MazaalHead(Entity*); -void MazaalMacro(Entity*); -void MazaalHand(Entity*); +void Bombarossa(); +void Wisp(); +void SpinyBeetle(); +void MazaalHead(); +void MazaalMacro(); +void MazaalHand(); void OctorokBoss(); -void FlyingPot(Entity*); -void Gibdo(Entity*); -void OctorokGolden(Entity*); -void TektiteGolden(Entity*); -void RopeGolden(Entity*); +void FlyingPot(); +void Gibdo(); +void OctorokGolden(); +void TektiteGolden(); +void RopeGolden(); void CloudPiranha(); -void ScissorsBeetle(Entity*); -void CuccoAggr(Entity*); +void ScissorsBeetle(); +void CuccoAggr(); void Stalfos(); -void FlyingSkull(Entity*); -void MazaalBracelet(Entity*); -void Takkuri(Entity*); -void BowMoblin(Entity*); -void Lakitu(Entity*); -void LakituCloud(Entity*); -void TorchTrap(Entity*); -void VaatiRebornEnemy(Entity*); -void VaatiProjectile(Entity*); -void BallChainSoldier(Entity*); +void FlyingSkull(); +void MazaalBracelet(); +void Takkuri(); +void BowMoblin(); +void Lakitu(); +void LakituCloud(); +void TorchTrap(); +void VaatiRebornEnemy(); +void VaatiProjectile(); +void BallChainSoldier(); void Enemy4D(); void Ghini(); -void VaatiTransfigured(Entity*); +void VaatiTransfigured(); void Enemy50(); -void VaatiWrath(Entity*); -void VaatiArm(Entity*); -void Dust(Entity*); -void VaatiBall(Entity*); -void Slime(Entity*); -void MiniSlime(Entity*); -void FireballGuy(Entity*); -void MiniFireballGuy(Entity*); -void VaatiTransfiguredEye(Entity*); -void BusinessScrubPrologue(Entity*); +void VaatiWrath(); +void VaatiArm(); +void Dust(); +void VaatiBall(); +void Slime(); +void MiniSlime(); +void FireballGuy(); +void MiniFireballGuy(); +void VaatiTransfiguredEye(); +void BusinessScrubPrologue(); void GyorgFemale(); void GyorgMale(); -void Curtain(Entity*); -void VaatiWrathEye(Entity*); +void Curtain(); +void VaatiWrathEye(); void GyorgChild(); void GyorgFemaleEye(); void GyorgMaleEye(); void GyorgFemaleMouth(); void Enemy64(); -void TreeItem(Entity*); -void Enemy66(Entity*); +void TreeItem(); +void Enemy66(); extern void (*const gUnk_080012C8[])(Entity*); -- cgit v1.2.3 From 33473d1d5bc818d47526f6a95c470e682b1b1530 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sat, 30 Dec 2023 18:12:05 +0100 Subject: Create new entity structs for enemies --- include/enemy/vaatiWrath.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/enemy/vaatiWrath.h (limited to 'include') diff --git a/include/enemy/vaatiWrath.h b/include/enemy/vaatiWrath.h new file mode 100644 index 00000000..83ba4bcc --- /dev/null +++ b/include/enemy/vaatiWrath.h @@ -0,0 +1,20 @@ +#ifndef VAATIWRATH_H +#define VAATIWRATH_H +#include "enemy.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unused1[5]; + /*0x6d*/ u8 unk_6d; + /*0x6e*/ u8 unused2[10]; + /*0x78*/ u8 unk_78; + /*0x79*/ u8 unk_79; + /*0x7a*/ u8 unused3[1]; + /*0x7b*/ u8 unk_7b; + /*0x7c*/ u16 unk_7c; + /*0x7e*/ u16 unk_7e; + /*0x80*/ u8 unused4[4]; + /*0x84*/ u8 unk_84; +} VaatiWrathEntity; + +#endif // VAATIWRATH_H -- cgit v1.2.3 From 3b87c0416294e830ad256226f315c6b416160493 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sat, 30 Dec 2023 18:26:19 +0100 Subject: Invert NENT_DEPRECATED define To define ENT_DEPRECATED in files that still need the old entity structs. --- include/entity.h | 2 +- include/object/deathFx.h | 2 +- include/object/linkAnimation.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/entity.h b/include/entity.h index 067e9ff4..42d77030 100644 --- a/include/entity.h +++ b/include/entity.h @@ -220,7 +220,7 @@ typedef struct Entity_ { /*0x62*/ u8 spriteOffsetX; /*0x63*/ s8 spriteOffsetY; /*0x64*/ void* myHeap; /**< Heap data allocated with #zMalloc. */ -#ifndef NENT_DEPRECATED +#ifdef ENT_DEPRECATED GENERIC_ENTITY_FIELDS #endif } Entity; diff --git a/include/object/deathFx.h b/include/object/deathFx.h index ba8c69dc..f8317f8c 100644 --- a/include/object/deathFx.h +++ b/include/object/deathFx.h @@ -1,7 +1,7 @@ #ifndef DEATHFX_H #define DEATHFX_H -#ifndef NENT_DEPRECATED +#ifdef ENT_DEPRECATED #error "deathFx.h requires new entities" #endif #include "entity.h" diff --git a/include/object/linkAnimation.h b/include/object/linkAnimation.h index 9fb2fad4..00e0ba94 100644 --- a/include/object/linkAnimation.h +++ b/include/object/linkAnimation.h @@ -1,7 +1,7 @@ #ifndef LINKANIMATION_H #define LINKANIMATION_H -#ifndef NENT_DEPRECATED +#ifdef ENT_DEPRECATED #error "linkAnimtion.h requires new entities" #endif #include "entity.h" -- cgit v1.2.3 From 5676cb7890facded77c5cf32c6017fbf12a4d386 Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sat, 30 Dec 2023 18:42:30 +0100 Subject: Use new entity structs in a few more files --- include/object/houseSign.h | 13 +++++++++++++ include/object/itemForSale.h | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 include/object/houseSign.h create mode 100644 include/object/itemForSale.h (limited to 'include') diff --git a/include/object/houseSign.h b/include/object/houseSign.h new file mode 100644 index 00000000..c437adee --- /dev/null +++ b/include/object/houseSign.h @@ -0,0 +1,13 @@ +#ifndef HOUSESIGN_H +#define HOUSESIGN_H + +#include "entity.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unused1[24]; + /*0x80*/ s16 unk_80; + /*0x82*/ s16 unk_82; +} HouseSignEntity; + +#endif // HOUSESIGN_H diff --git a/include/object/itemForSale.h b/include/object/itemForSale.h new file mode 100644 index 00000000..6f22e5e0 --- /dev/null +++ b/include/object/itemForSale.h @@ -0,0 +1,13 @@ +#ifndef ITEMFORSALE_H +#define ITEMFORSALE_H + +#include "object.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unk_68[0x18]; + /*0x80*/ u16 unk_80; + /*0x82*/ u16 unk_82; +} ItemForSaleEntity; + +#endif // ITEMFORSALE_H -- cgit v1.2.3 From a818f1b7041898d7eee28b5c1c455ba3225e063f Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:08:56 +0100 Subject: Use new entity struct for player --- include/entity.h | 7 ++----- include/new_player.h | 26 -------------------------- include/object/deathFx.h | 3 --- include/object/linkAnimation.h | 3 --- include/object/pushableFurniture.h | 25 +++++++++++++++++++++++++ include/player.h | 21 +++++++++++++++++++-- include/playerItem/playerItemBottle.h | 13 +++++++++++++ 7 files changed, 59 insertions(+), 39 deletions(-) delete mode 100644 include/new_player.h create mode 100644 include/object/pushableFurniture.h create mode 100644 include/playerItem/playerItemBottle.h (limited to 'include') diff --git a/include/entity.h b/include/entity.h index 42d77030..315e94db 100644 --- a/include/entity.h +++ b/include/entity.h @@ -220,9 +220,6 @@ typedef struct Entity_ { /*0x62*/ u8 spriteOffsetX; /*0x63*/ s8 spriteOffsetY; /*0x64*/ void* myHeap; /**< Heap data allocated with #zMalloc. */ -#ifdef ENT_DEPRECATED - GENERIC_ENTITY_FIELDS -#endif } Entity; typedef struct { @@ -248,8 +245,8 @@ typedef struct LinkedList { * to allow the iteration of all Entity's. */ extern LinkedList gEntityLists[9]; -extern Entity gAuxPlayerEntities[MAX_AUX_PLAYER_ENTITIES]; -extern Entity gEntities[MAX_ENTITIES]; +extern GenericEntity gAuxPlayerEntities[MAX_AUX_PLAYER_ENTITIES]; +extern GenericEntity gEntities[MAX_ENTITIES]; typedef void(EntityAction)(Entity*); typedef void (*EntityActionPtr)(Entity*); diff --git a/include/new_player.h b/include/new_player.h deleted file mode 100644 index bae1ed2f..00000000 --- a/include/new_player.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef NEW_PLAYER_H -#define NEW_PLAYER_H - -#include "entity.h" - -// TODO Use new player entity struct everywhere once it is fully discovered. - -typedef struct { - /*0x00*/ Entity base; - /*0x68*/ u32 unk_68; - /*0x6c*/ u8 unk_6c; - /*0x6d*/ u8 unk_6d; - /*0x6e*/ u8 unk_6e; - /*0x6f*/ u8 unk_6f; - /*0x70*/ Entity* unk_70; - /*0x74*/ Entity* unk_74; - /*0x78*/ u8 unk_78; - /*0x79*/ u8 unk_79; - /*0x7a*/ u16 unk_7a; - /*0x7c*/ u32 unk_7c; - /*0x80*/ u8 unk_80[8]; -} PlayerEntity; - -#define gNewPlayerEntity (*(PlayerEntity*)&gPlayerEntity) - -#endif // NEW_PLAYER_H diff --git a/include/object/deathFx.h b/include/object/deathFx.h index f8317f8c..4f14ea86 100644 --- a/include/object/deathFx.h +++ b/include/object/deathFx.h @@ -1,9 +1,6 @@ #ifndef DEATHFX_H #define DEATHFX_H -#ifdef ENT_DEPRECATED -#error "deathFx.h requires new entities" -#endif #include "entity.h" typedef struct { diff --git a/include/object/linkAnimation.h b/include/object/linkAnimation.h index 00e0ba94..781df520 100644 --- a/include/object/linkAnimation.h +++ b/include/object/linkAnimation.h @@ -1,9 +1,6 @@ #ifndef LINKANIMATION_H #define LINKANIMATION_H -#ifdef ENT_DEPRECATED -#error "linkAnimtion.h requires new entities" -#endif #include "entity.h" typedef struct { diff --git a/include/object/pushableFurniture.h b/include/object/pushableFurniture.h new file mode 100644 index 00000000..db693183 --- /dev/null +++ b/include/object/pushableFurniture.h @@ -0,0 +1,25 @@ +#ifndef PUSHABLEFURNITURE_H +#define PUSHABLEFURNITURE_H + +#include "object.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 unk_68[0x8]; + /*0x70*/ u16 unk_70; + /*0x72*/ u16 unk_72; + /*0x74*/ u16 unk_74; + /*0x76*/ u16 unk_76; + /*0x78*/ u8 unk_78[0x2]; + /*0x7a*/ u16 unk_7a; + /*0x7c*/ u16 unk_7c; + /*0x7e*/ u16 unk_7e; + /*0x80*/ u8 unk_80; + /*0x81*/ u8 unk_81; + /*0x82*/ u8 unk_82; + /*0x83*/ u8 unk_83; + /*0x84*/ u8 unk_84[0x2]; + /*0x86*/ u16 unk_86; +} PushableFurnitureEntity; + +#endif // PUSHABLEFURNITURE_H diff --git a/include/player.h b/include/player.h index 38e186e5..d22b8968 100644 --- a/include/player.h +++ b/include/player.h @@ -4,6 +4,23 @@ #include "global.h" #include "entity.h" +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ union SplitWord unk_68; + /*0x6c*/ u8 unk_6c; + /*0x6d*/ u8 unk_6d; + /*0x6e*/ u8 unk_6e; + /*0x6f*/ u8 unk_6f; + /*0x70*/ Entity* unk_70; + /*0x74*/ Entity* unk_74; + /*0x78*/ u8 unk_78; + /*0x79*/ u8 unk_79; + /*0x7a*/ u16 unk_7a; + /*0x7c*/ union SplitWord unk_7c; + /*0x80*/ union SplitWord unk_80; + /*0x84*/ union SplitWord unk_84; +} PlayerEntity; + enum PlayerActions { PLAYER_INIT, PLAYER_NORMAL, @@ -585,9 +602,9 @@ extern const u8 gQuiverSizes[]; extern Entity* gPlayerClones[]; extern PlayerState gPlayerState; -extern Entity gPlayerEntity; +extern PlayerEntity gPlayerEntity; -void DoPlayerAction(Entity*); +void DoPlayerAction(PlayerEntity*); bool32 CheckInitPauseMenu(void); void SetPlayerControl(PlayerControlMode mode); void ResetActiveItems(void); diff --git a/include/playerItem/playerItemBottle.h b/include/playerItem/playerItemBottle.h new file mode 100644 index 00000000..9055ee2f --- /dev/null +++ b/include/playerItem/playerItemBottle.h @@ -0,0 +1,13 @@ +#ifndef PLAYERITEMBOTTLE_H +#define PLAYERITEMBOTTLE_H + +#include "entity.h" + +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ u8 bottleIndex; /**< @see Item */ + /*0x69*/ u8 unused[6]; + /*0x6f*/ u8 bottleContent; /**< @see Item */ +} PlayerItemBottleEntity; + +#endif // PLAYERITEMBOTTLE_H -- cgit v1.2.3