diff --git a/include/functions.h b/include/functions.h new file mode 100644 index 00000000..16da6c58 --- /dev/null +++ b/include/functions.h @@ -0,0 +1,49 @@ +#ifndef FUNCTIONS_H +#define FUNCTIONS_H + +#include "global.h" +#include "entity.h" + +//Identified +extern u32 Random(void); +extern void PlaySFX(u32); +extern void UpdateSpriteOrderAndFlip(Entity*); +extern void LoadAnimation(Entity*, u32); +extern void ShowNPCDialogue(Entity*, u32*); +extern u32 UpdateFuseInteraction(Entity*); +extern void CopyPosition(Entity*, Entity*); +extern void PositionRelative(Entity*, Entity*, u32, u32); +extern void InitializeAnimation(Entity*, u32); +extern void DeleteEntity(Entity*); +extern u32 __modsi3(u32, u32); +extern void DoFade(u32, u32); + +//Unidentified +extern void sub_0806ED78(Entity*); +extern void sub_0806920C(Entity*); +extern void sub_080042B8(Entity*); +extern u32 sub_0805ACC0(Entity*); +extern u32 sub_0801E99C(Entity*); +extern void sub_0806924C(Entity*); +extern void sub_080AEF88(Entity*); +extern void sub_08078778(Entity*); +extern void sub_080787A8(Entity*, u32); +extern void sub_0806F118(Entity*); +extern void sub_080791D0(); +extern void sub_08087380(); +extern Entity* sub_080873AC(Entity*, u32, u32); +extern void sub_08004274(); +extern void sub_0805EC9C(); +extern void sub_0805EC60(); +extern void sub_080873D0(); +extern void sub_080045D4(); +extern void sub_0806F69C(); +extern void sub_0805E3A0(Entity*, u32); +extern void sub_0806D0B0(Entity*); +extern void sub_0807DD64(Entity*); +extern void sub_0807DDAC(Entity*, u32); +extern void sub_0807DDE4(Entity*); +extern void sub_0806D02C(Entity*); +extern Entity* sub_0805EB2C(u32, u32, u32, u32, u32); + +#endif \ No newline at end of file diff --git a/include/greatFairy.h b/include/greatFairy.h index 073f6a37..c9a968b0 100644 --- a/include/greatFairy.h +++ b/include/greatFairy.h @@ -1,24 +1,6 @@ #ifndef GREATFAIRY_H #define GREATFAIRY_H -extern u32 __modsi3(u32, u32); -extern void InitializeAnimation(Entity*, u32); -extern void sub_08087380(); -extern u32 CheckRoomFlag(); -extern Entity* sub_080873AC(Entity*, u32, u32); -extern void PositionRelative(); -extern void CopyPosition(); -extern void DoFade(); -extern void PlaySFX(); -extern void sub_08004274(); -extern void sub_0805EC9C(); -extern void sub_0805EC60(); -extern void sub_080873D0(); -extern void DeleteEntity(); -extern void sub_080045D4(); -extern void sub_0806F69C(); -extern u32 Random(); - extern void (*gGreatFairy[11])(Entity*); extern void (*gGreatFairyBehaviors[6])(Entity*); extern void (*gGreatFairyWings[3])(Entity*); diff --git a/include/random.h b/include/random.h deleted file mode 100644 index 8d0356b3..00000000 --- a/include/random.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef RANDOM_H -#define RANDOM_H - -extern u32 Random(void); - -extern u32 gRand; - -#endif \ No newline at end of file diff --git a/src/bell.c b/src/bell.c index 7dc1c864..a2690b13 100644 --- a/src/bell.c +++ b/src/bell.c @@ -1,12 +1,10 @@ #include "entity.h" #include "global.h" +#include "functions.h" extern void sub_080042B8(); extern void (*gUnk_08123384[])(Entity*); -extern void UpdateSpriteOrderAndFlip(Entity*); -extern void LoadAnimation(); - void sub_08097D78(Entity* ent) { gUnk_08123384[ent->action](ent); } diff --git a/src/bigGoron.c b/src/bigGoron.c index bc4da6bd..e025f6c0 100644 --- a/src/bigGoron.c +++ b/src/bigGoron.c @@ -1,20 +1,12 @@ #include "global.h" #include "entity.h" +#include "functions.h" +#include "link.h" extern void (*gUnk_081140D4[])(Entity*); extern u16 gUnk_081140CC[]; -extern Entity gLinkEntity; extern u32 gUnk_030010A0; -extern void sub_0805E3A0(Entity*, u32); -extern void sub_0806D0B0(Entity*); -extern void sub_0807DD64(Entity*); -extern void sub_0807DDAC(Entity*, u32); -extern void sub_0807DDE4(Entity*); -extern u32 Random(void); -extern void PlaySFX(u32); -extern void sub_0806D02C(Entity*); -extern Entity* sub_0805EB2C(u32, u32, u32, u32, u32); void sub_0806CF18(Entity* this) { gUnk_081140D4[this->entityType.parameter1](this); diff --git a/src/cloud.c b/src/cloud.c index 2cf8200f..c5ea662b 100644 --- a/src/cloud.c +++ b/src/cloud.c @@ -2,19 +2,16 @@ #include "entity.h" #include "room.h" #include "link.h" +#include "functions.h" +#include "flags.h" extern void sub_0809F7BC(Entity*); -extern void PlaySFX(u32); extern void sub_0809F814(u32); extern void sub_0809F7F4(Entity*); -extern void SetGlobalFlag(u32); extern void LoadRoomEntityList(); extern void DeleteThisEntity(); -extern u32 CheckRoomFlag(u32); extern void sub_08078A90(u32); extern void sub_08078B48(void); -extern u32 SetLocalFlag(u32); -extern u32 Random(void); extern void sub_0806F69C(Entity*); extern void (*gUnk_08124798[])(Entity*); extern void (*gUnk_081247A0[])(Entity*); @@ -26,8 +23,6 @@ extern void sub_0807BB68(u32*, u32, u32); extern u8 gUnk_02034490; extern u32 gUnk_030010A0; extern void* gUnk_080DD750; -extern Entity gLinkEntity; -extern LinkState gLinkState; extern u8 gUnk_081247C0[]; extern u16 gUnk_081247C8[]; extern u32 gUnk_081247D0; diff --git a/src/cow.c b/src/cow.c index 9dee1303..d8e4f832 100644 --- a/src/cow.c +++ b/src/cow.c @@ -1,26 +1,13 @@ #include "global.h" #include "entity.h" #include "link.h" +#include "functions.h" -extern void sub_0806ED78(Entity*); -extern void sub_0806920C(Entity*); -extern void sub_080042B8(Entity*); -extern u32 sub_0805ACC0(Entity*); -extern u32 sub_0801E99C(Entity*); -extern void sub_0806924C(Entity*); -extern void sub_080AEF88(Entity*); -extern void ShowNPCDialogue(Entity*, u32*); -extern void sub_08078778(Entity*); -extern void sub_080787A8(Entity*, u32); -extern void sub_0806F118(Entity*); -extern void sub_080791D0(); extern void (*gUnk_08111914[])(Entity*); extern void (*gUnk_08111928[])(Entity*); extern u32 gUnk_08111938[]; -extern void LoadAnimation(); -extern void PlaySFX(u32); -extern u32 Random(); -extern u32 UpdateFuseInteraction(Entity*); + + extern LinkState gLinkState; void sub_08068F98(Entity* ent) { diff --git a/src/greatFairy.c b/src/greatFairy.c index 3cb6b186..52717924 100644 --- a/src/greatFairy.c +++ b/src/greatFairy.c @@ -2,6 +2,8 @@ #include "entity.h" #include "room.h" #include "screen.h" +#include "functions.h" +#include "flags.h" #include "greatFairy.h" // Main diff --git a/tmc.ss1 b/tmc.ss1 new file mode 100644 index 00000000..4eb0aa76 Binary files /dev/null and b/tmc.ss1 differ diff --git a/tmc.ss2 b/tmc.ss2 new file mode 100644 index 00000000..adb0228c Binary files /dev/null and b/tmc.ss2 differ