diff --git a/asm/src/code_08003FC4.s b/asm/src/code_08003FC4.s index d244179e..34d4b52f 100644 --- a/asm/src/code_08003FC4.s +++ b/asm/src/code_08003FC4.s @@ -621,23 +621,23 @@ _0800439C: .4byte gSpritePtrs _080043A0: .4byte gSpritePtrs _080043A4: .4byte gGFXSlots+4 - thumb_func_start CreateDrownFX -CreateDrownFX: @ 0x080043A8 + thumb_func_start CreateDrownFx +CreateDrownFx: @ 0x080043A8 movs r1, #0xb // FX_WATER_SPLASH b create_fx - thumb_func_start CreateLavaDrownFX -CreateLavaDrownFX: @ 0x080043AC + thumb_func_start CreateLavaDrownFx +CreateLavaDrownFx: @ 0x080043AC movs r1, #0xc // FX_LAVA_SPLASH b create_fx - thumb_func_start CreateSwampDrownFX -CreateSwampDrownFX: @ 0x080043AC + thumb_func_start CreateSwampDrownFx +CreateSwampDrownFx: @ 0x080043AC movs r1, #0x52 // FX_GREEN_SPLASH b create_fx - thumb_func_start CreatePitFallFX -CreatePitFallFX: @ 0x080043B4 + thumb_func_start CreatePitFallFx +CreatePitFallFx: @ 0x080043B4 movs r1, #0 // FX_FALL_DOWN create_fx: diff --git a/asm/src/code_080043E8.s b/asm/src/code_080043E8.s index 8442e031..6193ca01 100644 --- a/asm/src/code_080043E8.s +++ b/asm/src/code_080043E8.s @@ -62,10 +62,10 @@ sub_0800442E: @ 0x0800442E not_hazard: movs r0, #0 pop {r1, pc} -_0800444C: .4byte CreatePitFallFX -_08004450: .4byte CreateDrownFX -_08004454: .4byte CreateLavaDrownFX -_08004458: .4byte CreateSwampDrownFX +_0800444C: .4byte CreatePitFallFx +_08004450: .4byte CreateDrownFx +_08004454: .4byte CreateLavaDrownFx +_08004458: .4byte CreateSwampDrownFx thumb_func_start sub_0800445C sub_0800445C: @ 0x0800445C diff --git a/asm/src/enemy.s b/asm/src/enemy.s index d2dcd5ff..d8149fdf 100644 --- a/asm/src/enemy.s +++ b/asm/src/enemy.s @@ -71,7 +71,7 @@ _08001230: ldr r3, _0800135C @ =UpdateAnimationVariableFrames bx r3 _0800123E: - ldr r3, _08001360 @ =CreatePitFallFX + ldr r3, _08001360 @ =CreatePitFallFx bx r3 non_word_aligned_thumb_func_start GenericConfused @@ -155,9 +155,9 @@ _080012BA: gUnk_080012C8:: .4byte 0x00000000 _080012CC: .4byte sub_08001214 -_080012D0: .4byte CreateDrownFX -_080012D4: .4byte CreateLavaDrownFX -_080012D8: .4byte CreateSwampDrownFX +_080012D0: .4byte CreateDrownFx +_080012D4: .4byte CreateLavaDrownFx +_080012D8: .4byte CreateSwampDrownFx thumb_func_start sub_080012DC sub_080012DC: @ 0x080012DC @@ -241,7 +241,7 @@ _08001352: .align 2, 0 _08001358: .4byte gEnemyFunctions _0800135C: .4byte UpdateAnimationVariableFrames -_08001360: .4byte CreatePitFallFX +_08001360: .4byte CreatePitFallFx _08001364: .4byte 0x00001800 _08001368: .4byte gUnk_080012C8 _0800136C: .4byte gUnk_080012C8 diff --git a/data/scripts/CreateDustFromScript.inc b/data/scripts/CreateDustFromScript.inc index 859b127f..c4804328 100644 --- a/data/scripts/CreateDustFromScript.inc +++ b/data/scripts/CreateDustFromScript.inc @@ -1,5 +1,5 @@ thumb_func_start CreateDustFromScript CreateDustFromScript: push {lr} - bl CreateDust + bl CreateDeathFx pop {pc} diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok1.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok1.inc index bd05025c..d3c6348e 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok1.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok1.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectOctorok1 SetAnimation 0x0001 EndBlock WaitForSyncFlagAndClear 0x00000001 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok2.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok2.inc index 895d4380..769c3789 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok2.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok2.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectOctorok2 SetAnimation 0x0002 EndBlock WaitForSyncFlagAndClear 0x00000002 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok3.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok3.inc index a82a9f9a..55a985c4 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok3.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok3.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectOctorok3 SetAnimation 0x0000 EndBlock WaitForSyncFlagAndClear 0x00000004 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok4.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok4.inc index 6c524c65..7f233dbb 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok4.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectOctorok4.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectOctorok4 SetAnimation 0x0003 EndBlock WaitForSyncFlagAndClear 0x00000008 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite1.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite1.inc index b555f6a6..03dd568f 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite1.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite1.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectTektite1 SetAnimation 0x0000 EndBlock WaitForSyncFlagAndClear 0x00000001 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite2.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite2.inc index 0b83e353..fdfef66c 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite2.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite2.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectTektite2 SetAnimation 0x0000 EndBlock WaitForSyncFlagAndClear 0x00000002 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite3.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite3.inc index bc2a4e2f..dc4e6b22 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite3.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite3.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectTektite3 SetAnimation 0x0000 EndBlock WaitForSyncFlagAndClear 0x00000004 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite4.inc b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite4.inc index 517fb04b..8e8cd0ce 100644 --- a/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite4.inc +++ b/data/scripts/cutscene/outro/script_CutsceneMiscObjectTektite4.inc @@ -6,7 +6,7 @@ SCRIPT_START script_CutsceneMiscObjectTektite4 SetAnimation 0x0000 EndBlock WaitForSyncFlagAndClear 0x00000008 - Call CreateDust + Call CreateDeathFx DoPostScriptAction 0x0006 SCRIPT_END .2byte 0x0000 diff --git a/data/scripts/cutscene/outro/script_MinishEzloGoodbye.inc b/data/scripts/cutscene/outro/script_MinishEzloGoodbye.inc index 91afc910..1b7d5df7 100644 --- a/data/scripts/cutscene/outro/script_MinishEzloGoodbye.inc +++ b/data/scripts/cutscene/outro/script_MinishEzloGoodbye.inc @@ -39,7 +39,7 @@ SCRIPT_START script_MinishEzloGoodbye Wait 0x001e SetSyncFlag 0x00000020 StopBgm - Call CreateDust + Call CreateDeathFx Call sub_0806305C Call sub_080630A4 _0807EF3C 0x0000, 0x0020 diff --git a/include/affine.h b/include/affine.h new file mode 100644 index 00000000..1ea56c66 --- /dev/null +++ b/include/affine.h @@ -0,0 +1,21 @@ +#ifndef AFFINE_H +#define AFFINE_H + +#include "gba/types.h" + +typedef struct { + s16 x; + s16 y; + u16 _4; + u16 _6; + u16 _8; +} OAMCommand; +extern OAMCommand gOamCmd; + +extern void FlushSprites(void); +extern void CopyOAM(void); +extern void DrawEntities(void); +extern void sub_080ADA04(OAMCommand*, void*); +extern void DrawDirect(u32 spriteIndex, u32 frameIndex); + +#endif //AFFINE_H diff --git a/include/asm.h b/include/asm.h index b5c12e26..22c507c7 100644 --- a/include/asm.h +++ b/include/asm.h @@ -106,4 +106,18 @@ typedef struct { */ extern u32 FindValueForKey(u32 key, const KeyValuePair* keyValuePairList); +extern u32 GetTileIndex(u32 tilePos, u32 layer); +extern void LinearMoveDirectionOLD(struct Entity_*, u32, u32); +extern u16* DoTileInteraction(struct Entity_*, u32, u32, u32); +extern void UpdateCollisionLayer(struct Entity_*); +extern void sub_080028E0(struct Entity_*); +extern void SnapToTile(struct Entity_*); +extern u32 sub_0800419C(struct Entity_*, struct Entity_*, u32, u32); +extern u32 sub_080041DC(struct Entity_*, u32, u32); +extern void sub_080042BA(struct Entity_*, u32); +extern void sub_080042D0(struct Entity_*, u32, u16); +extern void sub_080044AE(struct Entity_*, u32, u32); +extern void sub_0800451C(struct Entity_*); +extern void sub_08004542(struct Entity_*); + #endif // ASM_H diff --git a/include/backgroundAnimations.h b/include/backgroundAnimations.h index 4c3ad5c8..180105f0 100644 --- a/include/backgroundAnimations.h +++ b/include/backgroundAnimations.h @@ -32,4 +32,7 @@ extern BgAnimation gBgAnimations[MAX_BG_ANIMATIONS]; extern const u16* const gUnk_080B755C[]; extern const u16 gUnk_080B77C0[]; +extern void LoadBgAnimations(u16*); +extern void ClearBgAnimations(void); + #endif // BACKGROUNDANIMATIONS_H diff --git a/include/beanstalkSubtask.h b/include/beanstalkSubtask.h index f7bebbaf..e89df836 100644 --- a/include/beanstalkSubtask.h +++ b/include/beanstalkSubtask.h @@ -28,4 +28,21 @@ void LoadMapData(MapDataDefinition* dataDefinition); */ void RenderMapLayerToSubTileMap(u16* tileMap, MapLayer* mapLayer); +extern void sub_0801AFE4(void); +extern void SetBGDefaults(void); + +typedef struct { + s16 tileIndex; + s16 tilePosOffset; +} TileData; + +/** + * @brief Sets multiple tiles at once + * + * @param tileData [u16 tileIndex, s16 positionOffset], ends with 0xffff + * @param basePosition the position the offsets in tileData are based on + * @param layer the tile layer + */ +extern void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer); + #endif // BEANSTALKSUBTASK_H diff --git a/include/collision.h b/include/collision.h index f2d50367..068c3ecd 100644 --- a/include/collision.h +++ b/include/collision.h @@ -67,4 +67,6 @@ u32 sub_080176E4(Entity*); extern const u8 gMapTileTypeToActTile[]; // actTile for tileType? +extern u32 sub_0801766C(Entity*); + #endif // COLLISION_H diff --git a/include/common.h b/include/common.h index 5f620c23..f9182284 100644 --- a/include/common.h +++ b/include/common.h @@ -143,4 +143,6 @@ typedef struct { u32 mapDataOffset; } DungeonLayout; +extern void sub_0801E104(void); + #endif // COMMON_H diff --git a/include/effects.h b/include/effects.h index 88f04fa4..99998c97 100644 --- a/include/effects.h +++ b/include/effects.h @@ -115,4 +115,23 @@ typedef enum { FX_6C } Effect; +Entity* CreateFx(Entity* parent, Effect type, u32 type2); +void CreateDeathFx(Entity* parent); +void CreateDeathFxAt(s32 xOff, s32 yOff, u32 layer); +void CreateDashFx(Entity* parent); +void CreateExplosionBrokenFx(Entity* parent); +void CreateWaterSplashFx(Entity* parent); +Entity* CreateRippleFx(Entity* parent); +void CreateRippleFxRandom(Entity* parent, s32 range); +Entity* CreateLargeRippleFx(Entity* parent); +void CreateLargeRippleFxRandom(Entity* parent, s32 minDistance, s32 maxDistance); +void CreateSparkleFx(Entity* parent); + +extern void CreateDrownFx(Entity*); +extern void CreateLavaDrownFx(Entity* parent); +extern void CreateSwampDrownFx(Entity* parent); +extern void CreatePitFallFx(Entity* parent); + +void CreateMagicSparklesFxAt(u32 baseX, u32 baseY, u32 layer); + #endif // EFFECTS_H diff --git a/include/enemy.h b/include/enemy.h index c799f058..08d51179 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -77,6 +77,11 @@ bool32 PlayerInRange(Entity*, u32, s32); void EnemyCopyParams(Entity*, Entity*); void GenericKnockback2(Entity*); +extern void sub_08001318(Entity*); + +extern void StealRupees(Entity*); +extern void EnemyDisableRespawn(Enemy*); + enum { /*0x00*/ OCTOROK, /*0x01*/ CHUCHU, diff --git a/include/enemy/armos.h b/include/enemy/armos.h new file mode 100644 index 00000000..03f5cceb --- /dev/null +++ b/include/enemy/armos.h @@ -0,0 +1,8 @@ +#ifndef ARMOS_H +#define ARMOS_H + +#include "gba/types.h" + +void Armos_SetFlagFromTransition(u32 armosId); + +#endif //ARMOS_H diff --git a/include/entity.h b/include/entity.h index ffde0674..de76f3b7 100644 --- a/include/entity.h +++ b/include/entity.h @@ -325,10 +325,7 @@ bool32 ProcessMovement0(Entity*); Entity* GetEmptyEntity(void); 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* CreateAuxPlayerEntity(void); -Entity* CreateFx(Entity* parent, u32 type, u32 type2); /// @} /** diff --git a/include/fileselect.h b/include/fileselect.h index 704fb1b1..5544c60d 100644 --- a/include/fileselect.h +++ b/include/fileselect.h @@ -1,9 +1,9 @@ #ifndef FILESELECT_H #define FILESELECT_H -#include "sound.h" #include "global.h" #include "save.h" +#include "message.h" typedef struct { /*0x00*/ u8 unk_0x0; @@ -23,19 +23,6 @@ static_assert(sizeof(ChooseFileState) == 0x30); // TODO: This occupies the same memory region as gMenu extern ChooseFileState gChooseFileState; -// typedef struct { -// u8 unk00 : 4; -// u8 unk04 : 4; -// u8 unk1; -// u8 charColor; -// u8 bgColor; -// u16 unk4; -// u16 unk6; -// u8* unk8; -// } struct_02036540; - -extern struct_020227E8 gUnk_020227E8[]; - typedef struct { /*0x00*/ u8 isTransitioning; /*0x01*/ u8 unk1; @@ -51,13 +38,9 @@ typedef struct { extern struct_02019EE0 gMapDataBottomSpecial; // TODO size: 0x8000 from ClearTileMaps? -extern void sub_08056FEC(u32, struct_020227E8*); extern u32 ShowTextBox(u32 textIndexOrPtr, const Font* font); extern void ClearTileMaps(void); extern void ResetSaveFile(u32); -extern WStruct* sub_0805F2C8(void); -extern u32 sub_0805F7DC(u32, WStruct*); -extern void sub_0805F300(WStruct*); extern void sub_08050A64(u32); extern void sub_08050AFC(u32); extern void sub_08050384(); diff --git a/include/functions.h b/include/functions.h index 5f16e8d5..e5b9e565 100644 --- a/include/functions.h +++ b/include/functions.h @@ -2,104 +2,8 @@ #define FUNCTIONS_H #include "global.h" -#include "entity.h" -#include "manager.h" -#include "physics.h" -#include "player.h" -#include "room.h" -#include "structures.h" -#include "script.h" -#include "map.h" -// Identified - to be sorted into header files -extern u32 CheckRegionOnScreen(u32, u32, u32, u32); -extern void CopyOAM(void); -extern void CreateLavaDrownFX(Entity*); -extern Entity* CreateGroundItem(Entity*, u32, u32); -extern Entity* CreateGroundItemWithFlags(Entity*, u32, u32, u32); -extern void CreatePitFallFX(Entity*); -extern void CreateMagicSparkles(u32, u32, u32); -extern void CreateMinishEntrance(u32 tile); -extern u32 CreateRandomItemDrop(Entity*, u32); -extern void DrawDirect(u32 spriteIndex, u32 frameIndex); -extern void DrawEntities(void); -extern void FlushSprites(void); -extern u32 GetTileIndex(u32 tilePos, u32 layer); -extern u32 GiveItem(u32, u32); -extern bool32 LoadFixedGFX(Entity*, u32); -extern void LoadResources(void); -extern bool32 LoadSwapGFX(Entity*, u16, u32); -extern void MenuFadeIn(u32, u32); -extern void SetDirtTile(u32); -/** - * @brief Sets multiple tiles at once - * - * @param tileData [u16 tileIndex, s16 positionOffset], ends with 0xffff - * @param basePosition the position the offsets in tileData are based on - * @param layer the tile layer - */ -extern void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer); -extern void TryLoadPrologueHyruleTown(void); -extern void UnloadGFXSlots(Entity*); -extern void UnloadOBJPalette(Entity*); -extern void UpdateDisplayControls(void); -extern void ClearBgAnimations(void); -extern void SetBGDefaults(void); - -// Unidentified -extern s32 sub_080012DC(Entity*); -extern void sub_08001318(Entity*); -extern void LinearMoveDirectionOLD(Entity*, u32, u32); -extern void sub_080028E0(Entity*); -extern u32 sub_080040A2(Entity*); -extern u32 sub_080040D8(Entity*, u8*, s32, s32); -extern void SnapToTile(Entity*); -extern u32 sub_0800419C(Entity*, Entity*, u32, u32); -extern u32 sub_080041DC(Entity*, u32, u32); -extern void sub_080042BA(Entity*, u32); -extern void sub_080042D0(Entity*, u32, u16); -extern void CreateDrownFX(Entity*); -extern u32 sub_0800445C(Entity*); -extern void sub_080044AE(Entity*, u32, u32); -extern u32 BounceUpdate(Entity*, u32); -extern void sub_0800451C(Entity*); -extern void sub_08004542(Entity*); -extern void sub_080085B0(Entity*); -extern u16* DoTileInteraction(Entity*, u32, u32, u32); -extern void UpdateCollisionLayer(Entity*); -extern u32 sub_0801766C(Entity*); -extern void sub_0801AFE4(void); -extern void UpdateUIElements(void); -extern void sub_0801E104(void); -extern void sub_08030118(u32); -extern void sub_0803C0AC(Entity*); -extern void EnemyDisableRespawn(Entity*); -extern u32 sub_0804A024(Entity*, u32, u32); -extern u32 IsMinishItem(u32); -extern void DisableRandomDrops(); -extern void EnableRandomDrops(void); -extern s32 sub_08056338(void); -extern void sub_080575C8(u32); -extern void sub_08057688(void); -extern void sub_080580B0(u32); -extern void sub_08058324(u32); -extern void sub_08059278(void); -extern void LoadStaticBackground(u32); -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_0806D0B0(Entity*); -extern bool32 DoApplicableTransition(u32, u32, u32, u32); -extern void DoExitTransitionWithType(const Transition* screenTransition, u32 transitionType); -extern void sub_080809D4(void); -extern void sub_08080CB4(Entity*); -extern u32 sub_0808288C(Entity*, u32, u32, u32); -extern bool32 sub_08083734(Entity*, u32); -extern void sub_08095C48(Entity*); -extern void sub_080A57F4(void); -extern void sub_080A71C4(u32, u32, u32, u32); -extern void sub_080ADD70(void); -extern void sub_080AF284(void); +extern u32 sub_0804A024(struct Entity_*, u32, u32); +extern void sub_0805EC60(struct Entity_*); #endif // FUNCTIONS_H diff --git a/include/game.h b/include/game.h index 3480b46b..20d8088c 100644 --- a/include/game.h +++ b/include/game.h @@ -3,7 +3,7 @@ #include "global.h" #include "area.h" -#include "structures.h" +#include "message.h" /** * Change the light level of the room. diff --git a/include/item.h b/include/item.h index ec20160d..5aa1913c 100644 --- a/include/item.h +++ b/include/item.h @@ -5,6 +5,12 @@ #include "entity.h" #include "player.h" +extern u32 GiveItem(u32, u32); +extern u32 CreateRandomItemDrop(Entity*, u32); +extern void DisableRandomDrops(); +extern void EnableRandomDrops(void); +extern u32 IsMinishItem(u32); + void CreateItemEntity(u32, u32, u32); extern void ExecuteItemFunction(ItemBehavior* this, u32 index); @@ -153,7 +159,11 @@ typedef enum { } Item; /** Slot that the item is equipped in. */ -typedef enum { EQUIP_SLOT_A, EQUIP_SLOT_B, EQUIP_SLOT_NONE } EquipSlot; +typedef enum { + EQUIP_SLOT_A, + EQUIP_SLOT_B, + EQUIP_SLOT_NONE, +} EquipSlot; /** Function used to create the item. */ typedef enum { diff --git a/include/kinstone.h b/include/kinstone.h index c50ba857..0c994b24 100644 --- a/include/kinstone.h +++ b/include/kinstone.h @@ -4,6 +4,7 @@ #include "global.h" #include "entity.h" +extern void CreateMinishEntrance(u32 tile); extern void sub_08018C58(u32); typedef enum { diff --git a/include/main.h b/include/main.h index f2a229ea..859f90ce 100644 --- a/include/main.h +++ b/include/main.h @@ -2,10 +2,10 @@ #define MAIN_H #include "global.h" -#include "structures.h" #include "room.h" #include "script.h" #include "screen.h" +#include "vram.h" /** File signature */ #define SIGNATURE 'MCZ3' @@ -158,6 +158,7 @@ extern void DemoTask(void); extern u8 gUnk_03003DE4[0xC]; extern u16 gPaletteBuffer[]; +extern u32 CheckRegionOnScreen(u32, u32, u32, u32); extern u32 CheckRegionsOnScreen(const u16* arr); #endif // MAIN_H diff --git a/include/manager/horizontalMinishPathBackgroundManager.h b/include/manager/horizontalMinishPathBackgroundManager.h index f67d4841..3835f6c2 100644 --- a/include/manager/horizontalMinishPathBackgroundManager.h +++ b/include/manager/horizontalMinishPathBackgroundManager.h @@ -11,4 +11,6 @@ typedef struct { u32 unk_3c; } HorizontalMinishPathBackgroundManager; +extern void sub_080580B0(u32); + #endif // HORIZONTALMINISHPATHBACKGROUNDMANAGER_H diff --git a/include/manager/hyruleTownTileSetManager.h b/include/manager/hyruleTownTileSetManager.h index 34a0e809..7e43bb2c 100644 --- a/include/manager/hyruleTownTileSetManager.h +++ b/include/manager/hyruleTownTileSetManager.h @@ -10,4 +10,6 @@ typedef struct { u8 gfxGroup2; } HyruleTownTileSetManager; +extern void TryLoadPrologueHyruleTown(void); + #endif // HYRULETOWNTILESETMANAGER_H diff --git a/include/manager/minishRaftersBackgroundManager.h b/include/manager/minishRaftersBackgroundManager.h index 1c746870..4c034ab1 100644 --- a/include/manager/minishRaftersBackgroundManager.h +++ b/include/manager/minishRaftersBackgroundManager.h @@ -9,4 +9,6 @@ typedef struct { u32 unk_3c; } MinishRaftersBackgroundManager; +extern void sub_08058324(u32); + #endif // MINISHRAFTERSBACKGROUNDMANAGER_H diff --git a/include/manager/miscManager.h b/include/manager/miscManager.h index a126937f..592f1878 100644 --- a/include/manager/miscManager.h +++ b/include/manager/miscManager.h @@ -12,4 +12,7 @@ typedef struct { u16 flag2; } MiscManager; +extern void sub_08059278(void); +extern void SetDirtTile(u32); + #endif // MISCMANAGER_H diff --git a/include/manager/staticBackgroundManager.h b/include/manager/staticBackgroundManager.h index f2cab28a..46e8ca0f 100644 --- a/include/manager/staticBackgroundManager.h +++ b/include/manager/staticBackgroundManager.h @@ -8,4 +8,6 @@ typedef struct { u32 field_0x20; } StaticBackgroundManager; +extern void LoadStaticBackground(u32); + #endif // STATICBACKGROUNDMANAGER_H diff --git a/include/manager/verticalMinishPathBackgroundManager.h b/include/manager/verticalMinishPathBackgroundManager.h index 34a80080..42e51b30 100644 --- a/include/manager/verticalMinishPathBackgroundManager.h +++ b/include/manager/verticalMinishPathBackgroundManager.h @@ -10,4 +10,7 @@ typedef struct { void* field_0x3c; } VerticalMinishPathBackgroundManager; +extern void sub_080575C8(u32); +extern void sub_08057688(void); + #endif // VERTICALMINISHPATHBACKGROUNDMANAGER_H diff --git a/include/message.h b/include/message.h index b25e9df5..ddbc473e 100644 --- a/include/message.h +++ b/include/message.h @@ -3,10 +3,54 @@ #include "global.h" #include "entity.h" -#include "structures.h" #define MESSAGE_ACTIVE 0x7f +typedef struct { + u8 unk00 : 1; + u8 unk01 : 3; + u8 unk04 : 4; + u8 unk1; + u8 charColor; + u8 bgColor; + u16 unk4; + u16 unk6; + void* unk8; +} WStruct; + +static_assert(sizeof(WStruct) == 12); + +typedef union { + char s[8]; + u32 w[2]; +} String8; + +extern String8 gUnk_020227E8[]; +extern u32 NumberToAscii(u32, String8*); +extern WStruct* sub_0805F2C8(void); +extern u32 sub_0805F7DC(u32, WStruct*); +extern void sub_0805F300(WStruct*); +extern void sub_0805F8E4(u32 r0, WStruct* r1); +extern s32 sub_08056338(void); + +typedef struct { + u16* dest; + void* gfx_dest; + void* buffer_loc; + u32 _c; + u16 gfx_src; + u8 width; + u8 right_align : 1; + u8 sm_border : 1; + u8 unused : 1; + u8 draw_border : 1; + u8 border_type : 4; + u8 fill_type; + u8 charColor; + u8 _16; + u8 stylized; +} Font; + typedef struct { u8 state; u8 unk; @@ -45,9 +89,11 @@ typedef struct { Token curToken; WStruct _50; char player_name[10]; - u8 _66[0x10]; - u8 _76; - u8 _77[0x11]; + u8 _66[2]; + String8 _68; + String8 _70; + String8 _78; + String8 _80; u8 msgStatus; u8 renderStatus; u8 newlineDelay; @@ -138,7 +184,7 @@ void MessageClose(void); void DispMessageFrame(u16*, s32, s32, u32); -void sub_08057044(u32, struct_020227E8*, u32); +void NumberToAsciiPad3Digits(u32, String8*, u32); typedef enum { TEXT_SAVE, diff --git a/include/npc.h b/include/npc.h index 525cc5d1..b3adc9f8 100644 --- a/include/npc.h +++ b/include/npc.h @@ -2,22 +2,7 @@ #define NPC_H #include "global.h" -#include "asm.h" -#include "common.h" - -#include "sound.h" -#include "effects.h" -#include "room.h" -#include "flags.h" -#include "physics.h" -#include "message.h" -#include "script.h" -#include "save.h" - #include "entity.h" -#include "player.h" - -#include "structures.h" typedef enum { DIALOG_ROOM_FLAG, diff --git a/include/npc/bigGoron.h b/include/npc/bigGoron.h new file mode 100644 index 00000000..b7279733 --- /dev/null +++ b/include/npc/bigGoron.h @@ -0,0 +1,8 @@ +#ifndef BIGGORON_H +#define BIGGORON_H + +#include "global.h" + +extern void sub_0806D0B0(struct Entity_*); + +#endif //BIGGORON_H diff --git a/include/object.h b/include/object.h index 67c000cf..e2f5855d 100644 --- a/include/object.h +++ b/include/object.h @@ -2,36 +2,8 @@ #define OBJECT_H #include "global.h" -#include "asm.h" -#include "common.h" - -#include "sound.h" -#include "flags.h" -#include "effects.h" -#include "room.h" -#include "physics.h" - +#include "definitions.h" #include "entity.h" -#include "player.h" - -void AddInteractablePedestal(Entity*); -void AddInteractableCheckableObject(Entity*); -void sub_0808C650(Entity*, u32); -u32 sub_0808C67C(void); -void sub_0808C688(void); -void SyncPlayerToPlatform(Entity*, bool32); -void UpdateRailMovement(Entity*, u16**, u16*); -void sub_080A2AF4(Entity*, s32, s32); -Entity* CreateLargeWaterTrace(Entity*); -void CreateSparkle(Entity*); - -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); typedef enum { GROUND_ITEM, @@ -230,6 +202,27 @@ typedef enum { LINK_ANIMATION, } Object; + +Entity* CreateLinkAnimation(Entity* parent, u32 type, u32 type2); +void ObjectInit(Entity* this); +u32 LoadObjectSprite(Entity* this, s32 type, const ObjectDefinition* definition); +Entity* CreateObject(Object id, u32 type, u32 type2); +Entity* CreateObjectWithParent(Entity* parent, Object id, u32 type, u32 type2); +extern Entity* CreateGroundItem(Entity*, u32 item, u32 subvalue); +extern Entity* CreateGroundItemWithFlags(Entity*, u32 item, u32 subvalue, u32 flags); +void SyncPlayerToPlatform(Entity* this, bool32 param_2); +void UpdateRailMovement(Entity* this, u16** param_2, u16* param_3); +Entity* CreateSpeechBubbleExclamationMark(Entity* parent, s32 offsetX, s32 offsetY); +Entity* CreateSpeechBubbleQuestionMark(Entity* parent, s32 offsetX, s32 offsetY); +Entity* CreateSpeechBubbleSleep(Entity* parent, s32 offsetX, s32 offsetY); + +void AddInteractablePedestal(Entity*); +void AddInteractableCheckableObject(Entity*); +void sub_0808C650(Entity*, u32); +u32 sub_0808C67C(void); +void sub_0808C688(void); + + void ItemOnGround(); void DeathFx(); void ItemForSale(); diff --git a/include/object/cutsceneMiscObject.h b/include/object/cutsceneMiscObject.h new file mode 100644 index 00000000..da8ee3e1 --- /dev/null +++ b/include/object/cutsceneMiscObject.h @@ -0,0 +1,8 @@ +#ifndef CUTSCENEMISCOBJECT_H +#define CUTSCENEMISCOBJECT_H + +#include "global.h" + +extern void sub_08095C48(struct Entity_*); + +#endif //CUTSCENEMISCOBJECT_H diff --git a/include/object/lockedDoor.h b/include/object/lockedDoor.h new file mode 100644 index 00000000..90a6c7cb --- /dev/null +++ b/include/object/lockedDoor.h @@ -0,0 +1,8 @@ +#ifndef LOCKEDDOOR_H +#define LOCKEDDOOR_H + +#include "global.h" + +extern bool32 sub_08083734(struct Entity_*, u32); + +#endif //LOCKEDDOOR_H diff --git a/include/object/pot.h b/include/object/pot.h new file mode 100644 index 00000000..4867586a --- /dev/null +++ b/include/object/pot.h @@ -0,0 +1,8 @@ +#ifndef POT_H +#define POT_H + +#include "global.h" + +extern u32 sub_0808288C(struct Entity_*, u32, u32, u32); + +#endif //POT_H diff --git a/include/physics.h b/include/physics.h index dc6460cc..9c1a8206 100644 --- a/include/physics.h +++ b/include/physics.h @@ -55,8 +55,11 @@ extern bool32 ProcessMovement4(Entity*); extern bool32 ProcessMovement5(Entity*); extern bool32 ProcessMovement6(Entity*); extern bool32 ProcessMovementInternal(Entity*, s32, s32, u32); +extern void sub_080AF284(void); extern const s16 gSineTable[64]; extern const s16 gCosineTable[256]; +extern u32 BounceUpdate(Entity*, u32); + #endif // PHYSICS_H diff --git a/include/player.h b/include/player.h index 05f550d3..956c98f7 100644 --- a/include/player.h +++ b/include/player.h @@ -609,6 +609,17 @@ typedef struct { /*0x18*/ Entity* field_0x18; } ItemBehavior; +typedef enum { ACTIVE_ITEM_0, ACTIVE_ITEM_1, ACTIVE_ITEM_2, ACTIVE_ITEM_LANTERN, MAX_ACTIVE_ITEMS } ActiveItemIndex; +/** + * Currently active items. + * 0: Active items? + * 1: Boots, Cape + * 2: would be used by CreateItem1 if gActiveItems[1] was already filled + * 3: Lamp + */ +extern ItemBehavior gActiveItems[MAX_ACTIVE_ITEMS]; +static_assert(sizeof(gActiveItems) == 0x70); + extern void (*const gPlayerItemFunctions[])(Entity*); typedef struct { @@ -778,6 +789,8 @@ bool32 HasSwordEquipped(); u32 GetPlayerPalette(bool32 use); void PlayerShrinkByRay(void); +extern void InitPlayerMacro(PlayerMacroEntry*); + // player.s extern u32 PlayerCheckNEastTile(); extern u32* DoTileInteractionHere(Entity*, u32); @@ -786,6 +799,7 @@ extern void sub_08008AC6(Entity*); extern void sub_08008926(Entity*); extern void sub_08008AC6(Entity*); extern void sub_08008AA0(Entity*); +extern void sub_080085B0(Entity*); // zelda.c void SetZeldaFollowTarget(Entity* target); diff --git a/include/playeritem.h b/include/playeritem.h index 3736cb31..40695872 100644 --- a/include/playeritem.h +++ b/include/playeritem.h @@ -1,6 +1,8 @@ #ifndef PLAYERITEM_H #define PLAYERITEM_H +#include "global.h" + typedef enum { PLAYER_ITEM_NONE, PLAYER_ITEM_SWORD, @@ -29,4 +31,6 @@ typedef enum { PLAYER_ITEM_CELL_OVERWRITE_SET2, } PlayerItem; +extern u32 sub_080040D8(struct Entity_*, u8*, s32, s32); + #endif // PLAYERITEM_H diff --git a/include/room.h b/include/room.h index c05a7b82..5abafd06 100644 --- a/include/room.h +++ b/include/room.h @@ -233,8 +233,6 @@ Entity* LoadRoomEntity(const EntityData*); void LoadRoomEntityList(const EntityData* listPtr); void* GetRoomProperty(u32 area, u32 room, u32 property); -bool32 LoadFixedGFX(Entity*, u32); -void UnloadGFXSlots(Entity*); void LoadSmallChestTile2(TileEntity*); void sub_0804B0B0(u32 arg0, u32 arg1); diff --git a/include/save.h b/include/save.h index bc966efc..6269380a 100644 --- a/include/save.h +++ b/include/save.h @@ -3,11 +3,22 @@ #include "global.h" #include "player.h" -#include "structures.h" #include "room.h" #define FILENAME_LENGTH 6 +typedef struct { + int signature; + u8 saveFileId; + u8 msg_speed; + u8 brightness; + u8 language; + u8 name[6]; + u8 invalid; + u8 initialized; +} SaveHeader; +#define gSaveHeader ((SaveHeader*)(0x2000000)) + typedef enum { SAVE_BUSY = 0, SAVE_OK = 1, diff --git a/include/screen.h b/include/screen.h index a1391401..5a69f44c 100644 --- a/include/screen.h +++ b/include/screen.h @@ -76,17 +76,6 @@ typedef struct { // /*0x78*/ u32 _78; } Screen; -typedef struct { - s16 x; - s16 y; - u16 _4; - u16 _6; - u16 _8; -} OAMCommand; - extern Screen gScreen; -extern OAMCommand gOamCmd; - -extern void sub_080ADA04(OAMCommand*, void*); #endif // SCREEN_H diff --git a/include/scroll.h b/include/scroll.h index 3f6d47b4..a100093c 100644 --- a/include/scroll.h +++ b/include/scroll.h @@ -2,8 +2,15 @@ #define SCROLL_H #include "global.h" +#include "transitions.h" + +extern bool32 DoApplicableTransition(u32, u32, u32, u32); +extern void DoExitTransitionWithType(const Transition* screenTransition, u32 transitionType); void UpdateIsDiggingCave(void); void sub_08080930(u32); +extern void sub_080809D4(void); +extern void sub_08080CB4(struct Entity_*); + #endif // SCROLL_H diff --git a/include/structures.h b/include/structures.h index 97233eea..68dd1f10 100644 --- a/include/structures.h +++ b/include/structures.h @@ -3,19 +3,6 @@ #include "global.h" #include "entity.h" -#include "player.h" - -typedef struct { - int signature; - u8 saveFileId; - u8 msg_speed; - u8 brightness; - u8 language; - u8 name[6]; - u8 invalid; - u8 initialized; -} SaveHeader; -#define gSaveHeader ((SaveHeader*)(0x2000000)) typedef struct { u8 unk_00; @@ -141,47 +128,6 @@ typedef struct { } HUD; extern HUD gHUD; -#define MAX_GFX_SLOTS 44 - -typedef enum { - GFX_SLOT_FREE, - GFX_SLOT_UNLOADED, // some sort of free? no longer in use? - GFX_SLOT_STATUS2, // some sort of free? - GFX_SLOT_FOLLOWER, // Set by SetGFXSlotStatus for the following slots - GFX_SLOT_RESERVED, // maybe ready to be loaded? - GFX_SLOT_GFX, - GFX_SLOT_PALETTE -} GfxSlotStatus; - -typedef enum { - GFX_VRAM_0, - GFX_VRAM_1, // uploaded to vram? - GFX_VRAM_2, - GFX_VRAM_3, // not yet uploaded to vram? -} GfxSlotVramStatus; - -typedef struct { - /*0x00*/ u8 status : 4; - /*0x00*/ u8 vramStatus : 4; // Whether the gfx was uploaded to the vram? - /*0x01*/ u8 slotCount; - /*0x02*/ u8 referenceCount; /**< How many entities use this gfx slot */ - /*0x03*/ u8 unk_3; - /*0x04*/ u16 gfxIndex; - /*0x06*/ u16 paletteIndex; - /*0x08*/ const void* palettePointer; -} GfxSlot; - -typedef struct { - /*0x00*/ u8 unk0; - /*0x01*/ u8 unk_1; - /*0x02*/ u8 unk_2; - /*0x03*/ u8 unk_3; - /*0x04*/ GfxSlot slots[MAX_GFX_SLOTS]; -} GfxSlotList; -extern GfxSlotList gGFXSlots; - -static_assert(sizeof(GfxSlotList) == 0x214); - typedef struct { u16 unk_00; u8 unk_02[0xE]; @@ -193,16 +139,6 @@ extern u16 gBG1Buffer[0x400]; extern u16 gBG2Buffer[0x400]; extern u16 gBG3Buffer[0x800]; -typedef enum { ACTIVE_ITEM_0, ACTIVE_ITEM_1, ACTIVE_ITEM_2, ACTIVE_ITEM_LANTERN, MAX_ACTIVE_ITEMS } ActiveItemIndex; -/** - * Currently active items. - * 0: Active items? - * 1: Boots, Cape - * 2: would be used by CreateItem1 if gActiveItems[1] was already filled - * 3: Lamp - */ -extern ItemBehavior gActiveItems[MAX_ACTIVE_ITEMS]; -static_assert(sizeof(gActiveItems) == 0x70); typedef struct { u8 event_priority; // system requested priority @@ -230,20 +166,6 @@ typedef struct { extern PauseMenuOptions gPauseMenuOptions; static_assert(sizeof(PauseMenuOptions) == 0x18); -typedef struct { - u8 unk00 : 1; - u8 unk01 : 3; - u8 unk04 : 4; - u8 unk1; - u8 charColor; - u8 bgColor; - u16 unk4; - u16 unk6; - void* unk8; -} WStruct; - -static_assert(sizeof(WStruct) == 12); - typedef struct { u8 unk0; u8 unk1; @@ -267,11 +189,6 @@ typedef struct { } OAMControls; extern OAMControls gOAMControls; -typedef struct { - union SplitWord _0; - union SplitWord _4; -} struct_020227E8; - typedef struct { s8 x; s8 y; @@ -318,24 +235,6 @@ typedef struct { extern SpritePtr gSpritePtrs[]; -typedef struct { - u16* dest; - void* gfx_dest; - void* buffer_loc; - u32 _c; - u16 gfx_src; - u8 width; - u8 right_align : 1; - u8 sm_border : 1; - u8 unused : 1; - u8 draw_border : 1; - u8 border_type : 4; - u8 fill_type; - u8 charColor; - u8 _16; - u8 stylized; -} Font; - typedef struct { u8 unk_0; u8 unk_1; @@ -351,11 +250,6 @@ typedef struct { extern struct_02018EB0 gUnk_02018EB0; -typedef struct { - s16 tileIndex; - s16 tilePosOffset; -} TileData; - typedef struct { /*0x00*/ bool8 isOnlyActiveFirstFrame; /**< Is the behavior for this item only created on the first frame */ /*0x01*/ u8 priority; diff --git a/include/subtask.h b/include/subtask.h index 90ba9f05..c1c4894f 100644 --- a/include/subtask.h +++ b/include/subtask.h @@ -117,4 +117,7 @@ extern const struct_gUnk_08128E94 gUnk_08128E94[]; #define DRAW_DIRECT_SPRITE_INDEX 0x1fb #endif +extern void MenuFadeIn(u32, u32); +extern void sub_080A71C4(u32, u32, u32, u32); + #endif // SUBTASK_H diff --git a/include/ui.h b/include/ui.h index 2a4994ee..669c29d1 100644 --- a/include/ui.h +++ b/include/ui.h @@ -4,6 +4,7 @@ #include "global.h" extern void DrawUIElements(void); +extern void UpdateUIElements(void); extern void CreateUIElement(u32, u32); extern void sub_0801C2F0(u32, u32); extern void sub_0801C25C(void); diff --git a/include/vram.h b/include/vram.h new file mode 100644 index 00000000..a3fde71c --- /dev/null +++ b/include/vram.h @@ -0,0 +1,53 @@ +#ifndef VRAM_H +#define VRAM_H + +#include "global.h" +#include "entity.h" + +#define MAX_GFX_SLOTS 44 + +typedef enum { + GFX_SLOT_FREE, + GFX_SLOT_UNLOADED, // some sort of free? no longer in use? + GFX_SLOT_STATUS2, // some sort of free? + GFX_SLOT_FOLLOWER, // Set by SetGFXSlotStatus for the following slots + GFX_SLOT_RESERVED, // maybe ready to be loaded? + GFX_SLOT_GFX, + GFX_SLOT_PALETTE +} GfxSlotStatus; + +typedef enum { + GFX_VRAM_0, + GFX_VRAM_1, // uploaded to vram? + GFX_VRAM_2, + GFX_VRAM_3, // not yet uploaded to vram? +} GfxSlotVramStatus; + +typedef struct { + /*0x00*/ u8 status : 4; + /*0x00*/ u8 vramStatus : 4; // Whether the gfx was uploaded to the vram? + /*0x01*/ u8 slotCount; + /*0x02*/ u8 referenceCount; /**< How many entities use this gfx slot */ + /*0x03*/ u8 unk_3; + /*0x04*/ u16 gfxIndex; + /*0x06*/ u16 paletteIndex; + /*0x08*/ const void* palettePointer; +} GfxSlot; + +typedef struct { + /*0x00*/ u8 unk0; + /*0x01*/ u8 unk_1; + /*0x02*/ u8 unk_2; + /*0x03*/ u8 unk_3; + /*0x04*/ GfxSlot slots[MAX_GFX_SLOTS]; +} GfxSlotList; +extern GfxSlotList gGFXSlots; + +static_assert(sizeof(GfxSlotList) == 0x214); + +extern bool32 LoadFixedGFX(Entity*, u32); +extern bool32 LoadSwapGFX(Entity*, u32, u32); +extern void UnloadGFXSlots(Entity*); +extern void sub_080ADD70(void); + +#endif //VRAM_H diff --git a/src/affine.c b/src/affine.c index 04c0be86..a7b71857 100644 --- a/src/affine.c +++ b/src/affine.c @@ -1,3 +1,4 @@ +#include "affine.h" #include "global.h" #include "structures.h" #include "main.h" diff --git a/src/backgroundAnimations.c b/src/backgroundAnimations.c index c944b205..827f42c3 100644 --- a/src/backgroundAnimations.c +++ b/src/backgroundAnimations.c @@ -8,7 +8,8 @@ #include "asm.h" #include "assets/gfx_offsets.h" #include "common.h" -#include "functions.h" +#include "structures.h" +#include "room.h" void LoadBgAnimationGfx(const BgAnimationGfx*); u32 GetBgAnimationTimer(const s32*); diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c index 6ad7f184..0131c684 100644 --- a/src/beanstalkSubtask.c +++ b/src/beanstalkSubtask.c @@ -4,7 +4,6 @@ #include "collision.h" #include "common.h" #include "fade.h" -#include "functions.h" #include "game.h" #include "item.h" #include "main.h" @@ -12,10 +11,16 @@ #include "manager/diggingCaveEntranceManager.h" #include "menu.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "scroll.h" #include "structures.h" #include "tiles.h" +#include "affine.h" +#include "subtask.h" extern void sub_0807C898(void); extern void sub_0805BB74(s32); diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c index b2004f1a..b903a5d4 100644 --- a/src/code_08049DF4.c +++ b/src/code_08049DF4.c @@ -1,7 +1,7 @@ #include "asm.h" #include "global.h" #include "entity.h" -#include "functions.h" + #include "map.h" #include "player.h" #include "room.h" diff --git a/src/collision.c b/src/collision.c index a13d28cf..7220bf5f 100644 --- a/src/collision.c +++ b/src/collision.c @@ -3,11 +3,13 @@ #include "common.h" #include "enemy.h" #include "entity.h" -#include "functions.h" -#include "game.h" +#include "structures.h" #include "global.h" #include "item.h" #include "object.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" #include "player.h" #include "save.h" #include "tiles.h" diff --git a/src/color.c b/src/color.c index 26afadf3..76f4c4db 100644 --- a/src/color.c +++ b/src/color.c @@ -7,6 +7,7 @@ #include "fileselect.h" #include "main.h" #include "physics.h" +#include "structures.h" extern Palette gUnk_02001A3C; diff --git a/src/common.c b/src/common.c index 8b7f3033..69e4d3df 100644 --- a/src/common.c +++ b/src/common.c @@ -4,7 +4,7 @@ #include "area.h" #include "asm.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "game.h" #include "global.h" #include "item.h" @@ -15,6 +15,7 @@ #include "save.h" #include "screen.h" #include "sound.h" +#include "subtask.h" #include "structures.h" extern u8 gUnk_03003DE0; @@ -97,9 +98,8 @@ typedef struct { u8 y; } PACKED DungeonMapObject; -// More like PrepareTileEntitesForDungeonMap or so -u32 DecToHex(u32 value) { +u32 EncodeBCD(u32 value) { u32 result; FORCE_REGISTER(u32 r1, r1); diff --git a/src/cutscene.c b/src/cutscene.c index ef5a0ef6..241c9235 100644 --- a/src/cutscene.c +++ b/src/cutscene.c @@ -8,14 +8,22 @@ #include "enemy.h" #include "fade.h" #include "fileselect.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "main.h" #include "menu.h" #include "npc.h" #include "object.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "room.h" #include "screen.h" +#include "subtask.h" +#include "beanstalkSubtask.h" #include "tiles.h" +#include "backgroundAnimations.h" +#include "manager/staticBackgroundManager.h" void sub_08051F78(void); void sub_08051FF0(void); diff --git a/src/debug.c b/src/debug.c index 6edbf3ee..c8a92ace 100644 --- a/src/debug.c +++ b/src/debug.c @@ -6,13 +6,14 @@ */ #include "common.h" -#include "functions.h" #include "game.h" #include "main.h" #include "menu.h" #include "message.h" #include "screen.h" #include "sound.h" +#include "save.h" +#include "structures.h" void sub_0805FA04(void); void sub_0805FA98(void); diff --git a/src/demo.c b/src/demo.c index aea3f7ea..a8934300 100644 --- a/src/demo.c +++ b/src/demo.c @@ -7,7 +7,6 @@ #include "common.h" #include "fileselect.h" -#include "functions.h" #include "game.h" #include "global.h" #include "main.h" @@ -15,6 +14,9 @@ #include "message.h" #include "screen.h" #include "menu.h" +#include "sound.h" +#include "affine.h" +#include "structures.h" void sub_080A30AC(void); void sub_080A2E40(void); diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 4e6854b9..7336487c 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -5,7 +5,8 @@ * @brief Acro Bandits enemy */ #include "enemy.h" -#include "functions.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/armos.c b/src/enemy/armos.c index fcdfeb7a..13b20c5b 100644 --- a/src/enemy/armos.c +++ b/src/enemy/armos.c @@ -4,14 +4,17 @@ * * @brief Armos enemy */ +#include "enemy/armos.h" #include "collision.h" #include "common.h" #include "enemy.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "global.h" #include "hitbox.h" #include "tiles.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; @@ -68,11 +71,11 @@ void sub_080300E8(void) { } } -void sub_08030118(u32 armosId) { +void Armos_SetFlagFromTransition(u32 armosId) { if (((gRoomTransition.armos_data.field_0xac >> armosId) & 1) != 0) { - SetLocalFlagByBank(FLAG_BANK_3, armosId + 0x67); + SetLocalFlagByBank(FLAG_BANK_3, armosId + AMOS_00_00); } else { - ClearLocalFlagByBank(FLAG_BANK_3, armosId + 0x67); + ClearLocalFlagByBank(FLAG_BANK_3, armosId + AMOS_00_00); } } diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c index bc6ff6d2..2b28fa1e 100644 --- a/src/enemy/ballChainSoldier.c +++ b/src/enemy/ballChainSoldier.c @@ -6,7 +6,8 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "room.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index 19603462..00a907d9 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -5,7 +5,8 @@ * @brief Beetle enemy */ #include "enemy.h" -#include "functions.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c index 68d229ed..fecaeeca 100644 --- a/src/enemy/bladeTrap.c +++ b/src/enemy/bladeTrap.c @@ -4,10 +4,10 @@ * * @brief Blade Trap enemy */ -#include "entity.h" #include "object.h" -#include "room.h" #include "sound.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index f1ae158b..131fe12f 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -7,9 +7,11 @@ #include "asm.h" #include "collision.h" #include "enemy.h" -#include "functions.h" #include "object.h" #include "sound.h" +#include "effects.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; @@ -177,7 +179,7 @@ void sub_0802C91C(BobombEntity* this) { sub_0802CBC4(this); } else { if ((super->timer & 0xf) == 8) { - CreateDustSmall(super); + CreateDashFx(super); } sub_0802CC18(this); } diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c index 5993dfb2..56fb23ed 100644 --- a/src/enemy/bombPeahat.c +++ b/src/enemy/bombPeahat.c @@ -9,6 +9,8 @@ #include "entity.h" #include "functions.h" #include "object.h" +#include "room.h" +#include "physics.h" #include "player.h" typedef struct { diff --git a/src/enemy/bombarossa.c b/src/enemy/bombarossa.c index 1190d281..bd9bd235 100644 --- a/src/enemy/bombarossa.c +++ b/src/enemy/bombarossa.c @@ -5,9 +5,10 @@ * @brief Bombarossa enemy */ #include "enemy.h" -#include "entity.h" #include "object.h" +#include "asm.h" #include "room.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c index b071ced4..d8319cc3 100644 --- a/src/enemy/bowMoblin.c +++ b/src/enemy/bowMoblin.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 71d1e578..54f6dd4d 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -6,14 +6,13 @@ */ #include "asm.h" #include "enemy.h" -#include "functions.h" -#include "game.h" #include "item.h" #include "kinstone.h" #include "message.h" #include "npc.h" #include "save.h" #include "tiles.h" +#include "vram.h" struct SalesOffering { u8 field_0x0; diff --git a/src/enemy/businessScrubPrologue.c b/src/enemy/businessScrubPrologue.c index 0f84737b..99f4e03b 100644 --- a/src/enemy/businessScrubPrologue.c +++ b/src/enemy/businessScrubPrologue.c @@ -4,9 +4,13 @@ * * @brief Business Scrub Prologue enemy */ +#include "object/cutsceneMiscObject.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "script.h" +#include "physics.h" +#include "room.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c index a17f4c96..14be99e2 100644 --- a/src/enemy/chaser.c +++ b/src/enemy/chaser.c @@ -6,6 +6,8 @@ */ #include "enemy.h" #include "functions.h" +#include "player.h" +#include "physics.h" extern void (*const Chaser_Functions[])(Entity*); extern void (*const gUnk_080CD298[])(Entity*); diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 7f3186bb..19b269c1 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -6,7 +6,7 @@ */ #include "asm.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "tiles.h" typedef struct { @@ -73,7 +73,7 @@ void Chuchu(ChuchuEntity* this) { /* ... */ break; case 2: - CreateDrownFX(super); + CreateDrownFx(super); return; } } diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c index a558134a..8511e2b7 100644 --- a/src/enemy/chuchuBoss.c +++ b/src/enemy/chuchuBoss.c @@ -5,9 +5,19 @@ * @brief Chuchu Boss enemy */ #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "structures.h" +#ifndef EU +#include "vram.h" +#endif typedef struct { u8 unk_00; diff --git a/src/enemy/cloudPiranha.c b/src/enemy/cloudPiranha.c index 389237c4..2e12cfb4 100644 --- a/src/enemy/cloudPiranha.c +++ b/src/enemy/cloudPiranha.c @@ -6,7 +6,7 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" +#include "room.h" #include "physics.h" #include "tiles.h" diff --git a/src/enemy/crow.c b/src/enemy/crow.c index 5c882480..3d4231c5 100644 --- a/src/enemy/crow.c +++ b/src/enemy/crow.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/enemy/cuccoAggr.c b/src/enemy/cuccoAggr.c index bf749082..220480c6 100644 --- a/src/enemy/cuccoAggr.c +++ b/src/enemy/cuccoAggr.c @@ -6,7 +6,9 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "room.h" +#include "player.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 03eb697f..bbb8f98c 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -5,7 +5,7 @@ * @brief Cucco Chick Aggr enemy */ #include "enemy.h" -#include "functions.h" +#include "player.h" void sub_08022A88(Entity*); void sub_08022AA4(Entity*); diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 6a7a17db..5a5c528b 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -5,7 +5,6 @@ * @brief Dark Nut enemy */ #include "enemy.h" -#include "functions.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 46972dc8..c7932157 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -5,9 +5,13 @@ * @brief Door Mimic enemy */ #include "enemy.h" -#include "functions.h" #include "sound.h" #include "tiles.h" +#include "object.h" +#include "asm.h" +#include "common.h" +#include "effects.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; @@ -51,7 +55,7 @@ void DoorMimic_OnCollision(DoorMimicEntity* this) { void DoorMimic_OnDeath(DoorMimicEntity* this) { SetTile(this->unk_7c, this->unk_7e, super->collisionLayer); CreateFx(super, FX_POT_SHATTER, 0); - EnemyDisableRespawn(super); + EnemyDisableRespawn((Enemy*)super); DeleteThisEntity(); } diff --git a/src/enemy/dust.c b/src/enemy/dust.c index 7fd8c6d0..071184db 100644 --- a/src/enemy/dust.c +++ b/src/enemy/dust.c @@ -9,9 +9,13 @@ #include "entity.h" #include "hitbox.h" #include "object.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" #include "physics.h" #include "player.h" -#include "room.h" typedef struct { Entity base; diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c index 4fe0acfa..71ff8276 100644 --- a/src/enemy/enemy4D.c +++ b/src/enemy/enemy4D.c @@ -6,7 +6,8 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 36156ce7..fdd4eb94 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -6,8 +6,9 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "player.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c index c7e561cd..50572ce1 100644 --- a/src/enemy/enemy64.c +++ b/src/enemy/enemy64.c @@ -6,8 +6,11 @@ */ #include "enemy.h" #include "fade.h" -#include "functions.h" +#include "scroll.h" +#include "physics.h" #include "tiles.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/enemyE.c b/src/enemy/enemyE.c index 56a9fe04..08beabb0 100644 --- a/src/enemy/enemyE.c +++ b/src/enemy/enemyE.c @@ -5,7 +5,6 @@ * @brief EnemyE enemy */ #include "enemy.h" -#include "functions.h" void sub_08023000(Entity*, int); diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c index cb7d8067..50d4d85e 100644 --- a/src/enemy/eyegore.c +++ b/src/enemy/eyegore.c @@ -6,9 +6,14 @@ */ #include "enemy.h" #include "fade.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "tiles.h" typedef struct { diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 13421100..c7283f9b 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -5,7 +5,9 @@ * @brief Falling Boulder enemy */ #include "enemy.h" -#include "functions.h" +#include "room.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index b35b8117..1d6b6b6d 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -5,7 +5,8 @@ * @brief Fireball Guy enemy */ #include "enemy.h" -#include "functions.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/flyingPot.c b/src/enemy/flyingPot.c index 9c7a8348..beabb8c2 100644 --- a/src/enemy/flyingPot.c +++ b/src/enemy/flyingPot.c @@ -6,7 +6,7 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "player.h" #include "room.h" #include "tiles.h" diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 2366f56d..6e05bdba 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -4,12 +4,15 @@ * * @brief Flying Skull enemy */ +#include "object/pot.h" #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "hitbox.h" #include "tiles.h" +#include "room.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index f835ec1f..f1b7877b 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -6,7 +6,7 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" +#include "player.h" #include "physics.h" typedef struct { diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index e0813e6d..3da47c9c 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -5,8 +5,12 @@ * @brief Gibdo enemy */ #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/enemy/gleerok.c b/src/enemy/gleerok.c index e88550f1..40e0eddf 100644 --- a/src/enemy/gleerok.c +++ b/src/enemy/gleerok.c @@ -6,10 +6,17 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "screen.h" +#include "structures.h" typedef struct { union SplitHWord unk0; diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index ea6a5db6..4d15d58d 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -6,8 +6,9 @@ */ #include "asm.h" #include "enemy/gyorg.h" -#include "functions.h" #include "room.h" +#include "player.h" +#include "physics.h" void GyorgChild_OnTick(GyorgChildEntity*); void GyorgChild_OnCollision(GyorgChildEntity*); diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c index e566c480..de4abc83 100644 --- a/src/enemy/gyorgFemale.c +++ b/src/enemy/gyorgFemale.c @@ -12,7 +12,8 @@ #include "sound.h" #include "assets/map_offsets.h" #include "game.h" -#include "functions.h" +#include "player.h" +#include "room.h" extern u8 gEntCount; extern u8 gMapDataTopSpecial[]; diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c index b9ff2671..423be91d 100644 --- a/src/enemy/gyorgFemaleEye.c +++ b/src/enemy/gyorgFemaleEye.c @@ -7,8 +7,8 @@ #include "enemy.h" #include "enemy/gyorg.h" #include "entity.h" -#include "functions.h" #include "player.h" +#include "room.h" void GyorgFemaleEye_OnTick(GyorgFemaleEyeEntity*); void GyorgFemaleEye_OnCollision(GyorgFemaleEyeEntity*); diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index d4d52e95..beccd977 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -8,7 +8,7 @@ #include "enemy.h" #include "enemy/gyorg.h" #include "fileselect.h" -#include "functions.h" +#include "physics.h" #include "player.h" // todo: wrong types diff --git a/src/enemy/gyorgMaleEye.c b/src/enemy/gyorgMaleEye.c index 03202469..e3f536fd 100644 --- a/src/enemy/gyorgMaleEye.c +++ b/src/enemy/gyorgMaleEye.c @@ -6,7 +6,8 @@ */ #include "enemy.h" #include "fade.h" -#include "functions.h" +#include "physics.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index 2f52e0ab..19479230 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -6,7 +6,9 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "object.h" +#include "asm.h" +#include "effects.h" extern void (*const HangingSeed_Functions[])(Entity*); extern void (*const gUnk_080CB588[])(Entity*); diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c index 9de3ac59..abe346ce 100644 --- a/src/enemy/helmasaur.c +++ b/src/enemy/helmasaur.c @@ -6,8 +6,12 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 40688bfe..8ca4ad09 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -5,7 +5,7 @@ * @brief keaton enemy */ #include "enemy.h" -#include "functions.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index ac2549fc..9436c709 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -9,6 +9,7 @@ #include "enemy.h" #include "entity.h" #include "object.h" +#include "sound.h" #include "physics.h" #include "player.h" #include "room.h" diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index 0a124fe5..5bee7fc3 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -8,6 +8,11 @@ #include "item.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" +#include "player.h" #include "save.h" typedef struct { @@ -145,7 +150,7 @@ void sub_08027F84(LikeLikeEntity* this) { super->action = 5; super->spriteSettings.draw = 1; InitializeAnimation(super, 0); - CreateDust(super); + CreateDeathFx(super); } } @@ -177,7 +182,7 @@ void sub_0802802C(LikeLikeEntity* this) { super->spriteSettings.draw = 0; super->direction = 0; super->timer = 0; - CreateDust(super); + CreateDeathFx(super); } } diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 7df20a7d..119fc0dd 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -5,8 +5,10 @@ * @brief Madderpillar enemy */ #include "enemy.h" -#include "functions.h" #include "hitbox.h" +#include "effects.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index a4ec8dd8..152e21aa 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -5,9 +5,14 @@ * @brief Mazaal Bracelet enemy */ #include "enemy.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct MazaalBraceletEntity_ { /*0x00*/ Entity base; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index 5078e29a..0e079d48 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -6,8 +6,13 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "roomid.h" #include "screen.h" diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 2f6f330f..e3e4e50d 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -5,11 +5,12 @@ * @brief Mazaal Macro enemy */ #include "enemy.h" -#include "functions.h" #include "screenTransitions.h" #include "script.h" #include "structures.h" #include "tiles.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/miniFireballGuy.c b/src/enemy/miniFireballGuy.c index 97365958..c80f57dc 100644 --- a/src/enemy/miniFireballGuy.c +++ b/src/enemy/miniFireballGuy.c @@ -5,7 +5,7 @@ * @brief Mini Fireball Guy enemy */ #include "enemy.h" -#include "functions.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c index 96d6a9cd..f53881dc 100644 --- a/src/enemy/moldorm.c +++ b/src/enemy/moldorm.c @@ -6,7 +6,7 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index f5e2dc05..ac84d386 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -6,8 +6,10 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "tiles.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c index e0d377f8..f2a85cd8 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -6,10 +6,18 @@ */ #include "enemy/octorokBoss.h" #include "collision.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "projectile.h" +#include "vram.h" #define IS_FROZEN(this) ((this)->bossPhase & 1) diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index 37bc230a..6b523e27 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -8,6 +8,12 @@ #include "enemy.h" #include "game.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "playeritem.h" #include "save.h" @@ -139,7 +145,7 @@ void nullsub_138(PestoEntity* this) { void sub_0802409C(PestoEntity* this) { super->health = 0; InitializeAnimation(super, super->animationState); - CreateDust(super); + CreateDeathFx(super); } void sub_080240B8(PestoEntity* this) { diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index cf40c24c..2abd938b 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -7,6 +7,12 @@ #include "collision.h" #include "enemy.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 72e18f8d..8872b928 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -6,6 +6,8 @@ */ #include "enemy.h" #include "player.h" +#include "asm.h" +#include "effects.h" extern void (*const RockChuchu_Functions[])(Entity*); extern void (*const gUnk_080CB960[])(Entity*); diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index ada5434e..7344e387 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -8,7 +8,12 @@ #include "entity.h" #include "hitbox.h" #include "object.h" -#include "room.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" +#include "player.h" +#include "vram.h" #include "save.h" typedef struct { @@ -275,7 +280,7 @@ void sub_08029770(RupeeLikeEntity* this) { InitializeAnimation(super, 2); super->child->spriteSettings.draw = TRUE; InitializeAnimation(super->child, 6); - CreateDust(super); + CreateDeathFx(super); } } diff --git a/src/enemy/spark.c b/src/enemy/spark.c index 79a65afe..69c4f75e 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -7,6 +7,9 @@ #include "collision.h" #include "enemy.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" extern void (*const Spark_Functions[])(Entity*); extern void (*const gUnk_080CD24C[])(Entity*); diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 271a4c23..2c40c235 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -5,7 +5,11 @@ * @brief Spear Moblin enemy */ #include "enemy.h" -#include "functions.h" +#include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index 4dcd1ec3..94b2085a 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -5,7 +5,8 @@ * @brief Spiked Beetle enemy */ #include "enemy.h" -#include "functions.h" +#include "player.h" +#include "physics.h" extern u32 sub_0804A024(Entity*, u32, u32); diff --git a/src/enemy/spinyBeetle.c b/src/enemy/spinyBeetle.c index ff5df9ae..c6fec3b0 100644 --- a/src/enemy/spinyBeetle.c +++ b/src/enemy/spinyBeetle.c @@ -6,8 +6,12 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index 72329b9f..8c8c3435 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -5,8 +5,8 @@ * @brief Spiny Chuchu enemy */ #include "enemy.h" -#include "functions.h" #include "hitbox.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 3a54a8c2..22cee8ce 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -6,8 +6,10 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "tiles.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index fc5c90bd..bc80e9f5 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -6,9 +6,12 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "save.h" typedef struct { @@ -49,7 +52,7 @@ void Takkuri_OnCollision(TakkuriEntity* this) { if (super->contactFlags & CONTACT_NOW) { if ((super->contactFlags & 0x7f) == 0) { u32 direction; - sub_0803C0AC(super); + StealRupees(super); COLLISION_OFF(super); direction = super->direction; if (!DirectionIsHorizontal(DirectionRoundUp(direction))) { @@ -307,8 +310,8 @@ void sub_0803BF70(TakkuriEntity* this) { GetNextFrame(super); } -void sub_0803C0AC(Entity* this) { - u32 index, rupeeType, rupees; +void StealRupees(Entity* this) { + u32 rupeeCount, rupeeType, rupees; Entity* entity; entity = sub_08049DF4(1); if (entity == NULL) @@ -317,22 +320,22 @@ void sub_0803C0AC(Entity* this) { rupees = gSave.stats.rupees; if (rupees >= 500) { rupeeType = ITEM_RUPEE20; - index = 5; + rupeeCount = 5; ModRupees(-100); } else if (rupees >= 100) { rupeeType = ITEM_RUPEE5; - index = 5; + rupeeCount = 5; ModRupees(-25); } else { rupeeType = ITEM_RUPEE1; - index = rupees; + rupeeCount = rupees; if (rupees >= 0x5) { - index = 5; + rupeeCount = 5; } - ModRupees(-index); + ModRupees(-rupeeCount); } - for (; index != 0; index--) { + for (; rupeeCount != 0; rupeeCount--) { Entity* obj = CreateObject(RUPEE_OBJECT, rupeeType, 0); if (obj) { diff --git a/src/enemy/tektite.c b/src/enemy/tektite.c index fbc4c756..eccb633c 100644 --- a/src/enemy/tektite.c +++ b/src/enemy/tektite.c @@ -6,7 +6,6 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/tektiteGolden.c b/src/enemy/tektiteGolden.c index 047b449f..4e0d8862 100644 --- a/src/enemy/tektiteGolden.c +++ b/src/enemy/tektiteGolden.c @@ -6,7 +6,6 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" #include "item.h" typedef struct { diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c index 2e1e9a34..60fe4802 100644 --- a/src/enemy/treeItem.c +++ b/src/enemy/treeItem.c @@ -5,9 +5,11 @@ * @brief Tree Item enemy */ #include "enemy.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; @@ -73,7 +75,7 @@ void TreeItem(TreeItemEntity* this) { break; } - EnemyDisableRespawn(super); + EnemyDisableRespawn((Enemy*)super); DeleteThisEntity(); } diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index 819decc9..9abcd5c9 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -6,9 +6,15 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "roomid.h" typedef struct { diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index 94e040be..e97acf52 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -6,8 +6,11 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" #include "player.h" typedef struct { @@ -72,7 +75,7 @@ void VaatiBall(VaatiBallEntity* this) { COLLISION_OFF(super); super->health = -1; ((VaatiBallEntity*)parent)->unk_80--; - CreateDust(super); + CreateDeathFx(super); SoundReq(SFX_1C3); } } diff --git a/src/enemy/vaatiEyesMacro.c b/src/enemy/vaatiEyesMacro.c index e1c11638..c4b4e475 100644 --- a/src/enemy/vaatiEyesMacro.c +++ b/src/enemy/vaatiEyesMacro.c @@ -5,7 +5,10 @@ * @brief Vaati Eyes Macro enemy */ #include "enemy.h" -#include "functions.h" +#include "room.h" +#include "player.h" +#include "physics.h" +#include "manager.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 71c84c44..0cf4f604 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -5,9 +5,10 @@ * @brief Vaati Projectile enemy */ #include "enemy.h" -#include "functions.h" #include "screenTransitions.h" #include "tiles.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 5463b4f0..b4135fec 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -6,7 +6,9 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 663133fe..132ec86e 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -5,8 +5,14 @@ * @brief Vaati Transfigured enemy */ #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/vaatiTransfiguredEye.c b/src/enemy/vaatiTransfiguredEye.c index c3e33442..7012dcd9 100644 --- a/src/enemy/vaatiTransfiguredEye.c +++ b/src/enemy/vaatiTransfiguredEye.c @@ -6,7 +6,6 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "message.h" #include "physics.h" diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 21f5c506..c351381e 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -6,11 +6,22 @@ */ #include "enemy/vaatiWrath.h" -#include "functions.h" #include "message.h" #include "object.h" -#include "save.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" +#include "vram.h" +#include "scroll.h" +#if defined USA || defined DEMO_USA || defined DEMO_JP +#include "save.h" +#endif void VaatiWrathType0PreAction(VaatiWrathEntity*); u32 sub_08041FCC(VaatiWrathEntity*); diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index f7782fd2..3fe49ccb 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -5,7 +5,8 @@ * @brief Vaati Wrath Eye enemy */ #include "enemy/vaatiWrath.h" -#include "functions.h" +#include "room.h" +#include "physics.h" void sub_080485D8(Entity*); void sub_080485FC(Entity*); diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index e48becaa..c111c740 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -6,7 +6,7 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" +#include "player.h" #include "screenTransitions.h" typedef struct { diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 63f14826..02d982b7 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -6,8 +6,9 @@ */ #include "area.h" #include "enemy.h" -#include "functions.h" +#include "physics.h" #include "screenTransitions.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index fb2d13e2..d6ba88e8 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -6,6 +6,11 @@ */ #include "enemy.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" #include "structures.h" diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index e5c4c5e5..1dc3c082 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -6,8 +6,11 @@ */ #include "collision.h" #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" +#include "player.h" #include "save.h" typedef struct { @@ -147,7 +150,7 @@ void sub_080336DC(WispEntity* this) { super->y.HALF.HI = this->unk_82; break; case 0x18: - CreateDust(super); + CreateDeathFx(super); break; case 0xc: super->spriteSettings.draw = TRUE; diff --git a/src/enemy/wizzrobeFire.c b/src/enemy/wizzrobeFire.c index 638b16cf..1699f9a1 100644 --- a/src/enemy/wizzrobeFire.c +++ b/src/enemy/wizzrobeFire.c @@ -6,7 +6,7 @@ */ #include "enemy/wizzrobe.h" #include "enemy.h" -#include "functions.h" +#include "player.h" extern void (*const WizzrobeFire_Functions[])(WizzrobeEntity*); extern void (*const WizzrobeFire_Actions[])(WizzrobeEntity*); diff --git a/src/enemy/wizzrobeIce.c b/src/enemy/wizzrobeIce.c index d9af54c3..71ce4d92 100644 --- a/src/enemy/wizzrobeIce.c +++ b/src/enemy/wizzrobeIce.c @@ -6,8 +6,11 @@ */ #include "enemy/wizzrobe.h" #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "player.h" extern void (*const WizzrobeIce_Functions[])(WizzrobeEntity*); extern void (*const WizzrobeIce_Actions[])(WizzrobeEntity*); diff --git a/src/enemy/wizzrobeWind.c b/src/enemy/wizzrobeWind.c index 91687000..eb01fd0c 100644 --- a/src/enemy/wizzrobeWind.c +++ b/src/enemy/wizzrobeWind.c @@ -8,8 +8,13 @@ #include "collision.h" #include "enemy.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" extern void (*const WizzrobeWind_Functions[])(WizzrobeEntity*); diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 35ff738d..e2356e4f 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -2,13 +2,16 @@ #include "enemy.h" #include "definitions.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "object/deathFx.h" #include "projectile.h" #include "save.h" +#include "vram.h" -extern void EnemyDisableRespawn(Entity*); extern void ReplaceMonitoredEntity(Entity*, Entity*); extern EnemyDefinition gEnemyDefinitions[]; @@ -210,7 +213,7 @@ void EnemyCreateDeathFX(Enemy* parent, u32 parentId, u32 fixedItem) { } else { int tmp = parent->base.gustJarState & 2; if (tmp == 0) { - EnemyDisableRespawn(&(parent->base)); + EnemyDisableRespawn((Enemy*)&(parent->base)); gSave.enemies_killed++; parent->base.gustJarState |= 2; parent->base.timer = 255; diff --git a/src/enterPortalSubtask.c b/src/enterPortalSubtask.c index e3e7021c..ddc00cbe 100644 --- a/src/enterPortalSubtask.c +++ b/src/enterPortalSubtask.c @@ -9,13 +9,17 @@ #include "area.h" #include "common.h" #include "entity.h" -#include "fileselect.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "main.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "subtask.h" +#include "affine.h" extern void ClearArmosData(void); extern void sub_080300C4(void); diff --git a/src/entity.c b/src/entity.c index a5b84baf..34ce01ae 100644 --- a/src/entity.c +++ b/src/entity.c @@ -4,6 +4,12 @@ #include "manager/diggingCaveEntranceManager.h" #include "message.h" #include "npc.h" +#include "vram.h" +#include "script.h" +#include "structures.h" +#include "room.h" +#include "player.h" +#include "physics.h" typedef struct Temp { void* prev; diff --git a/src/fade.c b/src/fade.c index f5b0cfa7..a9cd0a4d 100644 --- a/src/fade.c +++ b/src/fade.c @@ -1,6 +1,6 @@ #include "global.h" +#include "save.h" #include "structures.h" -#include "functions.h" #include "screen.h" #include "common.h" diff --git a/src/fileselect.c b/src/fileselect.c index 3257c807..2f873ee1 100644 --- a/src/fileselect.c +++ b/src/fileselect.c @@ -8,7 +8,6 @@ #include "common.h" #include "figurineMenu.h" -#include "functions.h" #include "game.h" #include "item.h" #include "kinstone.h" @@ -16,9 +15,16 @@ #include "menu.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "subtask.h" #include "ui.h" +#include "affine.h" +#include "structures.h" // copy, erase, start #define NUM_FILE_OPERATIONS 3 @@ -306,7 +312,7 @@ void CreateDialogBox(u32 arg0, u32 arg1) { sub_08050384(); MemCopy(&gUnk_080FC844, &var0, sizeof(gUnk_080FC844)); - sub_08056FEC(arg1, gUnk_020227E8); + NumberToAscii(arg1, &gUnk_020227E8[0]); var0.gfx_src |= gUnk_080FC85C[arg0][0] << 0xC; ShowTextBox(gUnk_080FC85C[arg0][1], &var0); sfx = gUnk_080FC85C[arg0][2]; diff --git a/src/game.c b/src/game.c index 34a9930c..e582ec17 100644 --- a/src/game.c +++ b/src/game.c @@ -6,36 +6,23 @@ */ #include "game.h" +#include "affine.h" #include "area.h" #include "asm.h" -#include "backgroundAnimations.h" #include "common.h" -#include "droptables.h" -#include "enemy.h" #include "entity.h" #include "fileselect.h" -#include "flags.h" -#include "functions.h" -#include "item.h" -#include "itemMetaData.h" -#include "itemMetaData.h" -#include "kinstone.h" +#include "structures.h" #include "main.h" #include "manager/diggingCaveEntranceManager.h" -#include "menu.h" #include "message.h" -#include "npc.h" -#include "object.h" -#include "player.h" #include "player.h" #include "room.h" -#include "roomid.h" #include "save.h" #include "screen.h" #include "sound.h" -#include "subtask.h" -#include "transitions.h" #include "ui.h" +#include "beanstalkSubtask.h" // Game task diff --git a/src/gameOverTask.c b/src/gameOverTask.c index c56f86b3..d753ff17 100644 --- a/src/gameOverTask.c +++ b/src/gameOverTask.c @@ -7,13 +7,13 @@ #include "common.h" #include "fade.h" #include "fileselect.h" -#include "functions.h" #include "game.h" #include "main.h" #include "menu.h" #include "save.h" #include "sound.h" #include "subtask.h" +#include "affine.h" typedef void(GameOverState)(void); diff --git a/src/gameUtils.c b/src/gameUtils.c index 4087bd32..19d39204 100644 --- a/src/gameUtils.c +++ b/src/gameUtils.c @@ -5,23 +5,25 @@ */ #include "area.h" #include "backgroundAnimations.h" -#include "enemy.h" #include "entity.h" #include "fade.h" #include "fileselect.h" -#include "functions.h" +#include "manager.h" #include "game.h" #include "item.h" -#include "itemMetaData.h" #include "main.h" -#include "menu.h" -#include "npc.h" #include "object.h" +#include "common.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "save.h" #include "screen.h" -#include "script.h" #include "sound.h" #include "ui.h" +#include "subtask.h" +#include "beanstalkSubtask.h" +#include "structures.h" u32 StairsAreValid(void); void ClearFlagArray(const u16*); @@ -76,11 +78,11 @@ void SetPopupState(u32 type, u32 choice_idx) { u32 fakematch; MemClear(gBG1Buffer, sizeof gBG1Buffer); - gUnk_020227E8[0]._0.WORD = 0xf; - gUnk_020227E8[1]._0.WORD = 0xf; - gUnk_020227E8[2]._0.WORD = 0xf; - gUnk_020227E8[3]._0.WORD = 0xf; - *(&gUnk_020227E8[choice_idx]._0.BYTES.byte0 + 1) = fakematch = 1; + gUnk_020227E8[0].w[0] = 0xf; + gUnk_020227E8[1].w[0] = 0xf; + gUnk_020227E8[2].w[0] = 0xf; + gUnk_020227E8[3].w[0] = 0xf; + *(gUnk_020227E8[choice_idx].s + 1) = fakematch = 1; MemCopy(&sDefaultFont, &font, sizeof font); opt = &sPopupOptions[type]; diff --git a/src/interrupts.c b/src/interrupts.c index a9aad690..9d824006 100644 --- a/src/interrupts.c +++ b/src/interrupts.c @@ -1,16 +1,18 @@ -#include "functions.h" #include "gba/m4a.h" #include "global.h" #include "main.h" #include "message.h" #include "object.h" +#include "common.h" +#include "effects.h" +#include "room.h" #include "player.h" #include "save.h" #include "screen.h" #include "sound.h" #include "structures.h" #include "ui.h" -#include "collision.h" +#include "asm.h" extern u8 gUnk_03003DE0; extern u8 gUnk_03000C30; @@ -304,7 +306,7 @@ static void HandlePlayerLife(Entity* this) { gSave.stats.picolyteType = 0; SoundReq(SFX_140); } else if ((gSave.stats.picolyteTimer & 0xf) == 0) { - CreateSparkle(this); + CreateSparkleFx(this); } if (gSave.stats.effect == 0) { diff --git a/src/item/itemBomb.c b/src/item/itemBomb.c index 90c66539..f3df6504 100644 --- a/src/item/itemBomb.c +++ b/src/item/itemBomb.c @@ -1,9 +1,7 @@ #include "item.h" #include "physics.h" #include "sound.h" -#include "functions.h" #include "playeritem.h" -#include "functions.h" void sub_08075FF8(ItemBehavior*, u32); void sub_08076488(ItemBehavior*, u32); diff --git a/src/item/itemBoomerang.c b/src/item/itemBoomerang.c index a9c6aaab..9eef3d3b 100644 --- a/src/item/itemBoomerang.c +++ b/src/item/itemBoomerang.c @@ -1,5 +1,5 @@ #include "item.h" -#include "functions.h" +#include "physics.h" void sub_08075D2C(ItemBehavior*, u32); void sub_08075D88(ItemBehavior*, u32); diff --git a/src/item/itemBow.c b/src/item/itemBow.c index 9b57e9c1..92b52f20 100644 --- a/src/item/itemBow.c +++ b/src/item/itemBow.c @@ -1,6 +1,6 @@ #include "item.h" -#include "functions.h" #include "save.h" +#include "physics.h" void sub_08075DF4(ItemBehavior*, u32); void sub_08075E40(ItemBehavior*, u32); diff --git a/src/item/itemGustJar.c b/src/item/itemGustJar.c index 40fdd034..fe5a0476 100644 --- a/src/item/itemGustJar.c +++ b/src/item/itemGustJar.c @@ -1,5 +1,4 @@ #include "entity.h" -#include "functions.h" #include "item.h" #include "playeritem.h" #include "tiles.h" diff --git a/src/item/itemJarEmpty.c b/src/item/itemJarEmpty.c index 90ec65ed..98615777 100644 --- a/src/item/itemJarEmpty.c +++ b/src/item/itemJarEmpty.c @@ -1,6 +1,6 @@ #include "item.h" #include "save.h" -#include "functions.h" +#include "physics.h" void sub_08077534(ItemBehavior*, u32); void sub_08077618(ItemBehavior*, u32); diff --git a/src/item/itemLantern.c b/src/item/itemLantern.c index af488bd1..8c67edc5 100644 --- a/src/item/itemLantern.c +++ b/src/item/itemLantern.c @@ -1,7 +1,10 @@ -#include "functions.h" #include "game.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "sound.h" extern s8 gUnk_08126EEC[]; diff --git a/src/item/itemMoleMitts.c b/src/item/itemMoleMitts.c index 8f535bdb..9732776d 100644 --- a/src/item/itemMoleMitts.c +++ b/src/item/itemMoleMitts.c @@ -1,8 +1,9 @@ - #include "effects.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" #include "sound.h" #include "tiles.h" diff --git a/src/item/itemOcarina.c b/src/item/itemOcarina.c index e5cea164..4cd8a621 100644 --- a/src/item/itemOcarina.c +++ b/src/item/itemOcarina.c @@ -1,8 +1,7 @@ -#include "functions.h" +#include "structures.h" #include "item.h" #include "sound.h" -extern void ResetPlayerVelocity(void); extern void CreateBird(Entity*); void OcarinaUse(ItemBehavior*, u32); void OcarinaUpdate(ItemBehavior*, u32); diff --git a/src/item/itemPacciCane.c b/src/item/itemPacciCane.c index 56d2592c..41994302 100644 --- a/src/item/itemPacciCane.c +++ b/src/item/itemPacciCane.c @@ -1,7 +1,7 @@ #include "global.h" #include "entity.h" #include "item.h" -#include "functions.h" +#include "physics.h" #include "playeritem.h" void sub_08076C98(ItemBehavior*, u32); diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c index fca72541..0697d70a 100644 --- a/src/item/itemPegasusBoots.c +++ b/src/item/itemPegasusBoots.c @@ -1,6 +1,5 @@ #include "asm.h" #include "effects.h" -#include "functions.h" #include "game.h" #include "item.h" #include "playeritem.h" diff --git a/src/item/itemRocsCape.c b/src/item/itemRocsCape.c index 60d290c1..8c3c3c01 100644 --- a/src/item/itemRocsCape.c +++ b/src/item/itemRocsCape.c @@ -1,4 +1,3 @@ -#include "functions.h" #include "item.h" #include "sound.h" diff --git a/src/item/itemShield.c b/src/item/itemShield.c index 2fa8f07c..5f358905 100644 --- a/src/item/itemShield.c +++ b/src/item/itemShield.c @@ -2,7 +2,7 @@ #include "entity.h" #include "item.h" #include "sound.h" -#include "functions.h" +#include "physics.h" void sub_08076D04(ItemBehavior*, u32); void sub_08076D34(ItemBehavior*, u32); diff --git a/src/item/itemSword.c b/src/item/itemSword.c index 95110349..4035df2f 100644 --- a/src/item/itemSword.c +++ b/src/item/itemSword.c @@ -1,6 +1,8 @@ -#include "functions.h" #include "item.h" #include "object.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "playeritem.h" #include "sound.h" diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c index c87c4838..1648b6a0 100644 --- a/src/item/itemTryPickupObject.c +++ b/src/item/itemTryPickupObject.c @@ -1,7 +1,9 @@ -#include "functions.h" +#include "physics.h" #include "item.h" #include "playeritem.h" #include "sound.h" +#include "structures.h" +#include "room.h" u32 sub_08077F64(ItemBehavior* arg0, u32 index); u32 sub_080789A8(void); diff --git a/src/itemUtils.c b/src/itemUtils.c index 1de52066..1ed84adc 100644 --- a/src/itemUtils.c +++ b/src/itemUtils.c @@ -9,8 +9,14 @@ #include "sound.h" #include "save.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "enemy.h" #include "message.h" +#include "structures.h" const Wallet gWalletSizes[] = { { 100, 0xf060 }, diff --git a/src/main.c b/src/main.c index d40d678e..a57a3ec7 100644 --- a/src/main.c +++ b/src/main.c @@ -6,13 +6,13 @@ #include "main.h" #include "common.h" -#include "functions.h" #include "game.h" #include "interrupts.h" #include "message.h" #include "save.h" #include "screen.h" #include "sound.h" +#include "structures.h" extern u32 gRand; diff --git a/src/manager/angryStatueManager.c b/src/manager/angryStatueManager.c index c24d026e..ad6744c6 100644 --- a/src/manager/angryStatueManager.c +++ b/src/manager/angryStatueManager.c @@ -6,10 +6,14 @@ */ #include "manager/angryStatueManager.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "asm.h" + +#include "sound.h" #include "room.h" +#include "player.h" + void sub_0805D11C(AngryStatueManager*); void AngryStatueManager_Init(AngryStatueManager*); void AngryStatueManager_Action1(AngryStatueManager*); diff --git a/src/manager/armosInteriorManager.c b/src/manager/armosInteriorManager.c index 98587f46..392e80ec 100644 --- a/src/manager/armosInteriorManager.c +++ b/src/manager/armosInteriorManager.c @@ -8,8 +8,8 @@ #include "common.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "sound.h" +#include "room.h" bool32 sub_0805C920(ArmosInteriorManager*); void ArmosInteriorManager_Init(ArmosInteriorManager*); diff --git a/src/manager/bombableWallManager.c b/src/manager/bombableWallManager.c index e0343063..18347fa1 100644 --- a/src/manager/bombableWallManager.c +++ b/src/manager/bombableWallManager.c @@ -7,10 +7,11 @@ #include "manager/bombableWallManager.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "game.h" #include "object.h" +#include "asm.h" #include "sound.h" +#include "room.h" #include "tiles.h" u32 BombableWallManager_GetBombableType(u32 tilePos, u32 layer); diff --git a/src/manager/bridgeManager.c b/src/manager/bridgeManager.c index 17e91f91..0070ed04 100644 --- a/src/manager/bridgeManager.c +++ b/src/manager/bridgeManager.c @@ -6,8 +6,8 @@ */ #include "manager/bridgeManager.h" #include "flags.h" -#include "functions.h" #include "sound.h" +#include "player.h" void BridgeManager_Init(BridgeManager*); void BridgeManager_Action1(BridgeManager*); diff --git a/src/manager/cloudOverlayManager.c b/src/manager/cloudOverlayManager.c index a9313b45..021da0f3 100644 --- a/src/manager/cloudOverlayManager.c +++ b/src/manager/cloudOverlayManager.c @@ -8,7 +8,7 @@ #include "area.h" #include "screen.h" #include "game.h" -#include "functions.h" +#include "room.h" void CloudOverlayManager_OnEnterRoom(CloudOverlayManager*); void CloudOverlayManager_OnExitRoom(CloudOverlayManager*); diff --git a/src/manager/cloudStaircaseTransitionManager.c b/src/manager/cloudStaircaseTransitionManager.c index d8a47d63..3926f1ed 100644 --- a/src/manager/cloudStaircaseTransitionManager.c +++ b/src/manager/cloudStaircaseTransitionManager.c @@ -7,7 +7,8 @@ #include "manager/cloudStaircaseTransitionManager.h" #include "asm.h" #include "common.h" -#include "functions.h" +#include "room.h" +#include "player.h" void CloudStaircaseTransitionManager_Main(CloudStaircaseTransitionManager* this) { if (super->action == 0) { diff --git a/src/manager/delayedEntityLoadManager.c b/src/manager/delayedEntityLoadManager.c index 0a13bf40..1509c95b 100644 --- a/src/manager/delayedEntityLoadManager.c +++ b/src/manager/delayedEntityLoadManager.c @@ -8,7 +8,11 @@ #include "room.h" #include "npc.h" #include "area.h" +#include "flags.h" +#include "script.h" +#include "save.h" #include "asm.h" +#include "object.h" typedef struct { Manager base; diff --git a/src/manager/diggingCaveEntranceManager.c b/src/manager/diggingCaveEntranceManager.c index ce428a2b..d7b37a73 100644 --- a/src/manager/diggingCaveEntranceManager.c +++ b/src/manager/diggingCaveEntranceManager.c @@ -7,11 +7,13 @@ #include "manager/diggingCaveEntranceManager.h" #include "area.h" #include "asm.h" -#include "functions.h" #include "player.h" #include "room.h" #include "scroll.h" #include "tiles.h" +#ifndef EU +#include "structures.h" +#endif void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*); void DiggingCaveEntranceManager_Init(DiggingCaveEntranceManager*); diff --git a/src/manager/enterRoomTextboxManager.c b/src/manager/enterRoomTextboxManager.c index 61276437..f456714c 100644 --- a/src/manager/enterRoomTextboxManager.c +++ b/src/manager/enterRoomTextboxManager.c @@ -8,10 +8,10 @@ #include "area.h" #include "common.h" #include "fileselect.h" -#include "functions.h" #include "game.h" #include "message.h" #include "screen.h" +#include "structures.h" const u16 gUnk_08108DE8[] = { 0, 0x70b, 0x70c, 0x70d, 0x70e, 0x70f, 0x710, 0x711, 0x712, 0x713, 0x714, 0x715, 0x716, 0x717, 0x718, 0x719, 0x71a, 0x71b, 0x71c, 0x71d, 0x71e, 0x71f, diff --git a/src/manager/entitySpawnManager.c b/src/manager/entitySpawnManager.c index 6303d998..f9868310 100644 --- a/src/manager/entitySpawnManager.c +++ b/src/manager/entitySpawnManager.c @@ -9,9 +9,9 @@ #include "manager/entitySpawnManager.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "room.h" #include "sound.h" +#include "player.h" void EntitySpawnManager_Main(EntitySpawnManager* this) { if (super->action == 0) { diff --git a/src/manager/ezloHintManager.c b/src/manager/ezloHintManager.c index eb2a666a..f5b93933 100644 --- a/src/manager/ezloHintManager.c +++ b/src/manager/ezloHintManager.c @@ -9,7 +9,7 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "player.h" static void EzloHintManager_Init(EzloHintManager*); static void EzloHintManager_Action1(EzloHintManager*); diff --git a/src/manager/flameManager.c b/src/manager/flameManager.c index a363ebe0..1132dc5a 100644 --- a/src/manager/flameManager.c +++ b/src/manager/flameManager.c @@ -8,9 +8,9 @@ */ #include "manager/flameManager.h" #include "asm.h" -#include "functions.h" #include "room.h" #include "tiles.h" +#include "player.h" void FlameManager_Main(FlameManager* this) { if (super->action == 0) { diff --git a/src/manager/goronMerchantShopManager.c b/src/manager/goronMerchantShopManager.c index ff1d1b56..f4004c8e 100644 --- a/src/manager/goronMerchantShopManager.c +++ b/src/manager/goronMerchantShopManager.c @@ -10,6 +10,7 @@ #include "flags.h" #include "item.h" #include "object.h" +#include "room.h" #include "object/itemForSale.h" typedef struct { diff --git a/src/manager/holeManager.c b/src/manager/holeManager.c index 3772ceb1..ced8e4b9 100644 --- a/src/manager/holeManager.c +++ b/src/manager/holeManager.c @@ -8,12 +8,14 @@ #include "common.h" #include "flags.h" #include "object.h" +#include "asm.h" +#include "player.h" #include "room.h" #include "screen.h" #include "game.h" #include "manager/lightManager.h" #include "assets/gfx_offsets.h" -#include "functions.h" +#include "structures.h" typedef enum { HOLE_TRANSITION_ABSOLUTE, diff --git a/src/manager/horizontalMinishPathBackgroundManager.c b/src/manager/horizontalMinishPathBackgroundManager.c index 1f07763f..7af97dde 100644 --- a/src/manager/horizontalMinishPathBackgroundManager.c +++ b/src/manager/horizontalMinishPathBackgroundManager.c @@ -8,7 +8,8 @@ #include "common.h" #include "screen.h" #include "game.h" -#include "functions.h" +#include "structures.h" +#include "room.h" void sub_08057F20(HorizontalMinishPathBackgroundManager*); void HorizontalMinishPathBackgroundManager_OnEnterRoom(HorizontalMinishPathBackgroundManager*); diff --git a/src/manager/hyruleTownTileSetManager.c b/src/manager/hyruleTownTileSetManager.c index 2d19ac6d..8fa8b77b 100644 --- a/src/manager/hyruleTownTileSetManager.c +++ b/src/manager/hyruleTownTileSetManager.c @@ -13,7 +13,7 @@ #include "tiles.h" #include "game.h" #include "assets/gfx_offsets.h" -#include "functions.h" +#include "player.h" void HyruleTownTileSetManager_UpdateLoadGfxGroups(HyruleTownTileSetManager*); void HyruleTownTileSetManager_OnEnterRoom(HyruleTownTileSetManager*); diff --git a/src/manager/lightLevelSetManager.c b/src/manager/lightLevelSetManager.c index 26350020..7aad3428 100644 --- a/src/manager/lightLevelSetManager.c +++ b/src/manager/lightLevelSetManager.c @@ -6,9 +6,11 @@ */ #include "manager/lightLevelSetManager.h" #include "flags.h" -#include "functions.h" #include "game.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "player.h" #include "room.h" #include "tiles.h" @@ -115,7 +117,7 @@ void LightLevelSetManager_Type3(LightLevelSetManager* this) { default: if (--this->field_0x22 == 0) { - CreateDustAt(*(s16*)&this->field_0x38, *(s16*)&this->field_0x3a, super->type2); + CreateDeathFxAt(*(s16*)&this->field_0x38, *(s16*)&this->field_0x3a, super->type2); ClearFlag(this->field_0x3e); RestorePrevTileEntity(this->field_0x20, super->type2); ChangeLightLevel(-super->timer); diff --git a/src/manager/lightManager.c b/src/manager/lightManager.c index cb96636d..a27d3b5a 100644 --- a/src/manager/lightManager.c +++ b/src/manager/lightManager.c @@ -7,7 +7,6 @@ #include "manager/lightManager.h" #include "area.h" #include "common.h" -#include "functions.h" #include "game.h" #include "main.h" #include "physics.h" diff --git a/src/manager/lightRayManager.c b/src/manager/lightRayManager.c index 65fd416b..93e21ddd 100644 --- a/src/manager/lightRayManager.c +++ b/src/manager/lightRayManager.c @@ -9,10 +9,12 @@ */ #include "manager/lightRayManager.h" #include "common.h" -#include "functions.h" #include "main.h" #include "screen.h" #include "game.h" +#include "structures.h" +#include "player.h" +#include "physics.h" extern void DisableVBlankDMA(void); diff --git a/src/manager/manager29.c b/src/manager/manager29.c index bd079e1c..ca3cd3a5 100644 --- a/src/manager/manager29.c +++ b/src/manager/manager29.c @@ -7,7 +7,8 @@ #include "manager/manager29.h" #include "asm.h" #include "flags.h" -#include "functions.h" +#include "room.h" +#include "player.h" bool32 sub_0805CF80(Manager29* this); void sub_0805CBD0(Manager29* this); diff --git a/src/manager/minishPortalManager.c b/src/manager/minishPortalManager.c index 2d13eb1e..74276e46 100644 --- a/src/manager/minishPortalManager.c +++ b/src/manager/minishPortalManager.c @@ -8,8 +8,9 @@ #include "area.h" #include "asm.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "common.h" +#include "effects.h" #include "player.h" #include "room.h" #include "sound.h" @@ -43,7 +44,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) { } } if (GetActTileAtRoomCoords(this->unk_38, this->unk_3a, super->timer) == ACT_TILE_61) { - CreateMagicSparkles(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y, + CreateMagicSparklesFxAt(this->unk_38 + gRoomControls.origin_x, this->unk_3a + gRoomControls.origin_y, super->timer); if (super->subtimer == 0) { super->subtimer = 1; @@ -57,7 +58,7 @@ void MinishPortalManager_Main(MinishPortalManager* this) { } } -void CreateMagicSparkles(u32 baseX, u32 baseY, u32 layer) { +void CreateMagicSparklesFxAt(u32 baseX, u32 baseY, u32 layer) { u32 r; int offsetX, offsetY; Entity* spark; diff --git a/src/manager/minishRaftersBackgroundManager.c b/src/manager/minishRaftersBackgroundManager.c index c3a9d629..183000af 100644 --- a/src/manager/minishRaftersBackgroundManager.c +++ b/src/manager/minishRaftersBackgroundManager.c @@ -8,7 +8,7 @@ #include "common.h" #include "room.h" #include "game.h" -#include "functions.h" +#include "structures.h" void MinishRaftersBackgroundManager_OnEnterRoom(MinishRaftersBackgroundManager*); void sub_08058210(MinishRaftersBackgroundManager*); diff --git a/src/manager/minishSizedEntranceManager.c b/src/manager/minishSizedEntranceManager.c index 3cac2f1f..a2bbf028 100644 --- a/src/manager/minishSizedEntranceManager.c +++ b/src/manager/minishSizedEntranceManager.c @@ -6,8 +6,8 @@ * screen. */ #include "manager/minishSizedEntranceManager.h" -#include "functions.h" #include "object.h" +#include "flags.h" #include "room.h" #include "asm.h" diff --git a/src/manager/minishVillageTileSetManager.c b/src/manager/minishVillageTileSetManager.c index 95cb7cc4..81c93ae8 100644 --- a/src/manager/minishVillageTileSetManager.c +++ b/src/manager/minishVillageTileSetManager.c @@ -10,7 +10,7 @@ #include "main.h" #include "game.h" #include "assets/gfx_offsets.h" -#include "functions.h" +#include "structures.h" void MinishVillageTileSetManager_OnEnterRoom(void*); bool32 MinishVillageTileSetManager_UpdateRoomGfxGroup(MinishVillageTileSetManager*); diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c index bcb7bce9..93889ec9 100644 --- a/src/manager/miscManager.c +++ b/src/manager/miscManager.c @@ -6,16 +6,23 @@ */ #include "manager/miscManager.h" #include "area.h" -#include "common.h" #include "flags.h" -#include "functions.h" #include "item.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" #include "player.h" #include "room.h" +#include "script.h" #include "sound.h" #include "tiles.h" +#include "scroll.h" +#include "subtask.h" +#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP) +#include "common.h" +#endif void MiscManager_Type0(MiscManager*); void MiscManager_Type1(MiscManager*); @@ -229,7 +236,7 @@ void MiscManager_Type5(MiscManager* this) { switch (super->action) { default: if (!--super->timer) { - CreateDustAt(this->x, this->y, super->type2); + CreateDeathFxAt(this->x, this->y, super->type2); RestorePrevTileEntity(TILE_LOCAL(this->x, this->y), super->type2); SoundReq(SFX_TASK_COMPLETE); DeleteThisEntity(); diff --git a/src/manager/moveableObjectManager.c b/src/manager/moveableObjectManager.c index 21756299..5cf898fa 100644 --- a/src/manager/moveableObjectManager.c +++ b/src/manager/moveableObjectManager.c @@ -9,6 +9,7 @@ #include "manager/moveableObjectManager.h" #include "flags.h" #include "room.h" +#include "object.h" void MoveableObjectManager_Main(MoveableObjectManager* this) { Entity* object = CreateObject(super->timer, super->type, super->type2); diff --git a/src/manager/pushableFurnitureManager.c b/src/manager/pushableFurnitureManager.c index f701bc42..260c0348 100644 --- a/src/manager/pushableFurnitureManager.c +++ b/src/manager/pushableFurnitureManager.c @@ -8,6 +8,7 @@ #include "flags.h" #include "object.h" +#include "player.h" #include "object/pushableFurniture.h" #include "room.h" diff --git a/src/manager/rollingBarrelManager.c b/src/manager/rollingBarrelManager.c index 303108a5..f8209f6e 100644 --- a/src/manager/rollingBarrelManager.c +++ b/src/manager/rollingBarrelManager.c @@ -15,7 +15,7 @@ #include "screen.h" #include "sound.h" #include "game.h" -#include "functions.h" +#include "asm.h" extern struct BgAffineDstData gUnk_02017AA0[]; extern struct BgAffineDstData gUnk_02017BA0[]; diff --git a/src/manager/secretManager.c b/src/manager/secretManager.c index ca2ec125..f0ec19e2 100644 --- a/src/manager/secretManager.c +++ b/src/manager/secretManager.c @@ -9,8 +9,8 @@ #include "manager/secretManager.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "sound.h" +#include "structures.h" void SecretManager_Type0_Action2(SecretManager*); void SecretManager_Type0(SecretManager*); diff --git a/src/manager/specialWarpManager.c b/src/manager/specialWarpManager.c index f62ac451..cba10388 100644 --- a/src/manager/specialWarpManager.c +++ b/src/manager/specialWarpManager.c @@ -6,7 +6,8 @@ */ #include "manager/specialWarpManager.h" #include "asm.h" -#include "functions.h" +#include "room.h" +#include "player.h" void SpecialWarpManager_Main(SpecialWarpManager* this) { u32 collisionLayer; diff --git a/src/manager/staticBackgroundManager.c b/src/manager/staticBackgroundManager.c index de3c8f3d..1ee959fe 100644 --- a/src/manager/staticBackgroundManager.c +++ b/src/manager/staticBackgroundManager.c @@ -8,7 +8,7 @@ #include "common.h" #include "screen.h" #include "game.h" -#include "functions.h" +#include "room.h" void StaticBackgroundManager_OnEnterRoom(StaticBackgroundManager*); void sub_0805B448(StaticBackgroundManager*); diff --git a/src/manager/templeOfDropletsManager.c b/src/manager/templeOfDropletsManager.c index dbdbc5cb..1c9987a5 100644 --- a/src/manager/templeOfDropletsManager.c +++ b/src/manager/templeOfDropletsManager.c @@ -8,10 +8,12 @@ #include "enemy.h" #include "flags.h" #include "object.h" +#include "common.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "sound.h" #include "game.h" -#include "functions.h" #include "structures.h" static const u16 gUnk_081085B8[] = { 0x1008, 0x1007, 0x1006, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, diff --git a/src/manager/tileChangeObserveManager.c b/src/manager/tileChangeObserveManager.c index 7a05a853..08b46b14 100644 --- a/src/manager/tileChangeObserveManager.c +++ b/src/manager/tileChangeObserveManager.c @@ -9,7 +9,6 @@ */ #include "manager/tileChangeObserveManager.h" #include "flags.h" -#include "functions.h" #include "room.h" void TileChangeObserveManager_Init(TileChangeObserveManager*); diff --git a/src/manager/tilePuzzleManager.c b/src/manager/tilePuzzleManager.c index 766e2c6d..2da91901 100644 --- a/src/manager/tilePuzzleManager.c +++ b/src/manager/tilePuzzleManager.c @@ -10,9 +10,10 @@ #include "manager/tilePuzzleManager.h" #include "asm.h" #include "flags.h" -#include "functions.h" #include "sound.h" #include "tiles.h" +#include "room.h" +#include "player.h" enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED }; diff --git a/src/manager/vaati3BackgroundManager.c b/src/manager/vaati3BackgroundManager.c index d2fb85ed..2b2e838b 100644 --- a/src/manager/vaati3BackgroundManager.c +++ b/src/manager/vaati3BackgroundManager.c @@ -10,7 +10,6 @@ #include "room.h" #include "screen.h" #include "game.h" -#include "functions.h" void Vaati3BackgroundManager_OnEnterRoom(Vaati3BackgroundManager*); diff --git a/src/manager/vaati3InsideArmManager.c b/src/manager/vaati3InsideArmManager.c index 579ce58b..43402c28 100644 --- a/src/manager/vaati3InsideArmManager.c +++ b/src/manager/vaati3InsideArmManager.c @@ -5,7 +5,6 @@ * @brief Manages the inside of the arms of Vaati3. */ #include "manager/vaati3InsideArmManager.h" -#include "functions.h" #include "screenTransitions.h" #include "sound.h" #include "structures.h" diff --git a/src/manager/vaati3StartManager.c b/src/manager/vaati3StartManager.c index 097f3afa..8804a640 100644 --- a/src/manager/vaati3StartManager.c +++ b/src/manager/vaati3StartManager.c @@ -8,14 +8,17 @@ #include "area.h" #include "enemy.h" #include "flags.h" -#include "functions.h" #include "message.h" #include "object.h" -#include "save.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "screenTransitions.h" #include "sound.h" -#include "structures.h" +#include "scroll.h" +#if !defined(EU) && !defined(JP) +#include "save.h" +#endif void sub_0805E094(void); void Vaati3StartManager_Type0(Vaati3StartManager*); diff --git a/src/manager/vaatiAppearingManager.c b/src/manager/vaatiAppearingManager.c index 6eabadd8..930c0bd5 100644 --- a/src/manager/vaatiAppearingManager.c +++ b/src/manager/vaatiAppearingManager.c @@ -7,11 +7,11 @@ #include "manager/vaatiAppearingManager.h" #include "area.h" #include "common.h" -#include "functions.h" #include "game.h" #include "main.h" #include "room.h" #include "screen.h" +#include "physics.h" void sub_0805D9D8(VaatiAppearingManager*); void VaatiAppearingManager_Action3(VaatiAppearingManager*); diff --git a/src/manager/verticalMinishPathBackgroundManager.c b/src/manager/verticalMinishPathBackgroundManager.c index c599eae0..a5d18429 100644 --- a/src/manager/verticalMinishPathBackgroundManager.c +++ b/src/manager/verticalMinishPathBackgroundManager.c @@ -6,9 +6,10 @@ */ #include "manager/verticalMinishPathBackgroundManager.h" #include "common.h" -#include "functions.h" #include "game.h" #include "screen.h" +#include "room.h" + extern void VerticalMinishPathBackgroundManager_OnEnterRoom(void*); extern void sub_0805754C(VerticalMinishPathBackgroundManager*); diff --git a/src/manager/waterfallBottomManager.c b/src/manager/waterfallBottomManager.c index a9e7196e..47000615 100644 --- a/src/manager/waterfallBottomManager.c +++ b/src/manager/waterfallBottomManager.c @@ -7,8 +7,9 @@ #include "manager/waterfallBottomManager.h" #include "asm.h" #include "entity.h" -#include "functions.h" +#include "player.h" #include "tiles.h" +#include "room.h" void WaterfallBottomManager_Main(WaterfallBottomManager* this) { SetTile(SPECIAL_TILE_20, TILE_POS(3, 23), LAYER_BOTTOM); diff --git a/src/manager/weatherChangeManager.c b/src/manager/weatherChangeManager.c index fdddd1d6..d5da1664 100644 --- a/src/manager/weatherChangeManager.c +++ b/src/manager/weatherChangeManager.c @@ -13,7 +13,9 @@ #include "screen.h" #include "sound.h" #include "game.h" -#include "functions.h" +#include "manager/staticBackgroundManager.h" +#include "player.h" +#include "structures.h" void WeatherChangeManager_OnEnterRoom(WeatherChangeManager*); void sub_08059608(WeatherChangeManager*); diff --git a/src/menu/figurineMenu.c b/src/menu/figurineMenu.c index 913f311c..cc3e84f8 100644 --- a/src/menu/figurineMenu.c +++ b/src/menu/figurineMenu.c @@ -8,19 +8,21 @@ #include "common.h" #include "flags.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "main.h" #include "menu.h" #include "message.h" #include "object.h" -#include "pauseMenu.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "player.h" #include "save.h" #include "screen.h" -#include "sound.h" #include "subtask.h" -#include "subtask2.h" #include "ui.h" +#include "affine.h" void sub_080A4DA8(u32); void sub_080A4B44(void); @@ -442,7 +444,6 @@ const struct_08128184 gUnk_08128184 = { 0xffu, }; -extern struct_020227E8 gUnk_020227E8[]; extern void ShowTextBox(u32, const struct_0812816C*); void sub_080A4BA0(u32 arg1, u32 arg2) { @@ -470,7 +471,7 @@ void sub_080A4BA0(u32 arg1, u32 arg2) { if (r5 <= 0 || maxFigurines < r5) { r5 = -1; } else { - sub_08057044(r5, gUnk_020227E8, 0x303030); + NumberToAsciiPad3Digits(r5, &gUnk_020227E8[0], 0x303030); if (FigurineMenu_isFigurineOwned(r5) == 0) { r5 += 0x8000; } else { diff --git a/src/menu/kinstoneMenu.c b/src/menu/kinstoneMenu.c index ee6d1bf9..3f53829b 100644 --- a/src/menu/kinstoneMenu.c +++ b/src/menu/kinstoneMenu.c @@ -8,13 +8,15 @@ #include "common.h" #include "enemy.h" #include "flags.h" -#include "functions.h" +#include "structures.h" #include "kinstone.h" #include "main.h" #include "menu.h" #include "message.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "physics.h" #include "room.h" #include "roomid.h" #include "save.h" @@ -22,6 +24,7 @@ #include "sound.h" #include "subtask.h" #include "ui.h" +#include "affine.h" extern u32 sub_08000E44(u32); extern void sub_080A3B74(void); diff --git a/src/menu/pauseMenu.c b/src/menu/pauseMenu.c index 940ed787..e3585520 100644 --- a/src/menu/pauseMenu.c +++ b/src/menu/pauseMenu.c @@ -7,7 +7,6 @@ #include "pauseMenu.h" #include "common.h" -#include "functions.h" #include "game.h" #include "item.h" #include "itemMetaData.h" @@ -21,6 +20,7 @@ #include "structures.h" #include "subtask.h" #include "ui.h" +#include "affine.h" extern void sub_080A4DB8(u32); @@ -28,6 +28,7 @@ void sub_080A5128(void); void sub_080A51D4(void); bool32 sub_080A51F4(void); void sub_080A5F48(u32, u32); +void sub_080A57F4(void); void Subtask_PauseMenu(void) { static Subtask* const pauseMenu_Variants[] = { diff --git a/src/menu/pauseMenuScreen6.c b/src/menu/pauseMenuScreen6.c index e36ef549..8883a1e3 100644 --- a/src/menu/pauseMenuScreen6.c +++ b/src/menu/pauseMenuScreen6.c @@ -6,13 +6,14 @@ #include "common.h" #include "fileselect.h" #include "flags.h" -#include "functions.h" #include "kinstone.h" #include "main.h" #include "menu.h" #include "pauseMenu.h" #include "save.h" #include "screen.h" +#include "affine.h" +#include "structures.h" typedef struct { u8 unk0; diff --git a/src/message.c b/src/message.c index ea3645e1..f7435451 100644 --- a/src/message.c +++ b/src/message.c @@ -3,10 +3,10 @@ #include "asm.h" #include "room.h" #include "common.h" -#include "functions.h" #include "message.h" #include "save.h" #include "ui.h" +#include "structures.h" #define MESSAGE_ADVANCE_KEYS (A_BUTTON | B_BUTTON | DPAD_ANY | R_BUTTON) #define MESSAGE_PRESS_ANY_ADVANCE_KEYS ((gInput.newKeys & MESSAGE_ADVANCE_KEYS) != 0) @@ -34,9 +34,8 @@ enum { extern void WriteBit(u32*, u32); extern bool32 sub_0805EF40(Token* tok, const u8*); extern void sub_0805F918(u32, u32, void*); -extern u32 DecToHex(u32, u8*, u32); +extern u32 EncodeBCD(u32); -u32 sub_08056FEC(u32, u8*); u32 GetCharacter(Token* tok); extern void sub_0805EEB4(Token* tok, u32 textIdx); u32 sub_0805F7DC(u32, WStruct*); @@ -221,9 +220,9 @@ static u32 MsgIdle(void) { return 0; } -extern u8 gUnk_020227DC, gUnk_020227E8, gUnk_020227F0, gUnk_020227F8, gUnk_02022800; +extern u8 gUnk_020227DC, gUnk_020227F0, gUnk_020227F8, gUnk_02022800; u8* const gUnk_08107BE0[] = { - &gUnk_020227DC, &gUnk_020227E8, &gUnk_020227F0, &gUnk_020227F8, &gUnk_02022800, + &gUnk_020227DC, (void*)&gUnk_020227E8, &gUnk_020227F0, &gUnk_020227F8, &gUnk_02022800, }; u32 MsgInit(void) { @@ -830,37 +829,52 @@ void sub_08056F88(u32 unk_1, u32 unk_2) { } static void sub_08056FBC(TextRender* ctb) { - sub_08056FEC(ctb->message.rupees, &ctb->_66[0x2]); - sub_08056FEC(ctb->message.field_0x14, &ctb->_66[0xa]); - sub_08056FEC(ctb->message.field_0x18, &ctb->_77[0x1]); - sub_08056FEC(ctb->message.field_0x1c, &ctb->_77[0x9]); + NumberToAscii(ctb->message.rupees, &ctb->_68); + NumberToAscii(ctb->message.field_0x14, &ctb->_70); + NumberToAscii(ctb->message.field_0x18, &ctb->_78); + NumberToAscii(ctb->message.field_0x1c, &ctb->_80); } -u32 sub_08056FEC(u32 this, u8* param_2) { - u32 uVar1; - int iVar2; - int iVar3; - int iVar4; - u8 local_1c[8]; +/** + * convert number to ascii string + * + * @param number number to convert + * @param string output string buffer (at least 8 bytes in size) + * @return number of character written (NOT including null terminator) +*/ +u32 NumberToAscii(u32 number, String8* string) { + int j; + int i; + int length; + u8 buffer[8]; + char * const output = string->s; - uVar1 = DecToHex(this, param_2, this); - uVar1 = uVar1 & 0xfffffff; - iVar4 = 0; + number = EncodeBCD(number) & 0xfffffff; + length = 0; do { - local_1c[iVar4++] = uVar1 & 0xf; - uVar1 = uVar1 / 16; - } while (uVar1 != 0); - for (iVar3 = 0, iVar2 = iVar4 - 1; iVar2 >= 0; iVar3++, iVar2--) { - param_2[iVar3] = local_1c[iVar2] | 0x30; + buffer[length++] = number & 0xf; + number = number >> 4; + } while (number != 0); + for (i = 0, j = length - 1; j >= 0; i++, j--) { + output[i] = buffer[j] | '0'; } - param_2[iVar3] = 0; - return iVar4; + output[i] = '\0'; + return length; } -void sub_08057044(u32 a1, struct_020227E8* a2, u32 a3) { - u32 z[2]; - u32 tmp = sub_08056FEC(a1, (u8*)z); - u32 first = z[0]; +/** + * converts number to ascii string, padding to 3 characters with specified filler + * filler will break if not '0' of ' ' + * filler should include no more than 3 characters and might break on small number with less + * + * @param number number to convert + * @param string output string buffer + * @param filler filler characters + */ +void NumberToAsciiPad3Digits(u32 number, String8* string, u32 filler) { + String8 z; + u32 tmp = NumberToAscii(number, &z); + u32 first = z.w[0]; first <<= 8 * (3 - tmp); - a2->_0.WORD = first | a3; + string->w[0] = first | filler; } diff --git a/src/movement.c b/src/movement.c index 3bd0d134..e6fd3ec8 100644 --- a/src/movement.c +++ b/src/movement.c @@ -8,7 +8,6 @@ #include "item.h" #include "physics.h" #include "transitions.h" -#include "functions.h" bool32 sub_080AF0C8(Entity*); diff --git a/src/npc.c b/src/npc.c index 1609e901..67f70a3d 100644 --- a/src/npc.c +++ b/src/npc.c @@ -2,6 +2,7 @@ #include "entity.h" #include "room.h" #include "npc.h" +#include "flags.h" extern u32 gUnk_020342F8; diff --git a/src/npc/anju.c b/src/npc/anju.c index 2e1b02bd..0670b221 100644 --- a/src/npc/anju.c +++ b/src/npc/anju.c @@ -7,6 +7,8 @@ #include "entity.h" #include "npc.h" #include "player.h" +#include "script.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 0729e1cc..97bdd677 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -5,13 +5,13 @@ * @brief Beedle NPC */ #include "entity.h" -#include "functions.h" #include "game.h" #include "item.h" #include "message.h" #include "npc.h" #include "room.h" #include "script.h" +#include "structures.h" typedef struct { Rect customHitbox; diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c index 9a134cfe..61c44d20 100644 --- a/src/npc/bigGoron.c +++ b/src/npc/bigGoron.c @@ -4,11 +4,19 @@ * * @brief BigGoron NPC */ -#include "functions.h" +#include "npc/bigGoron.h" #include "hitbox.h" #include "item.h" +#include "message.h" +#include "script.h" #include "npc.h" #include "screen.h" +#include "effects.h" +#include "save.h" +#include "common.h" +#include "sound.h" +#include "asm.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 58a0ed2c..41d97d4e 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -6,7 +6,7 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "game.h" #include "item.h" #include "message.h" @@ -15,6 +15,8 @@ #include "room.h" #include "save.h" #include "script.h" +#include "sound.h" +#include "effects.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/brocco.c b/src/npc/brocco.c index b4ab49e7..3f1c7379 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -7,7 +7,10 @@ #include "entity.h" #include "message.h" #include "npc.h" +#include "physics.h" #include "save.h" +#include "script.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/carlov.c b/src/npc/carlov.c index 07a9abb5..c95b4d69 100644 --- a/src/npc/carlov.c +++ b/src/npc/carlov.c @@ -8,6 +8,7 @@ #include "npc.h" #include "room.h" #include "sound.h" +#include "script.h" void Carlov(Entity* this) { if (this->action == 0) { diff --git a/src/npc/carpenter.c b/src/npc/carpenter.c index 690f6c67..bc969bb5 100644 --- a/src/npc/carpenter.c +++ b/src/npc/carpenter.c @@ -8,6 +8,10 @@ #include "item.h" #include "npc.h" #include "player.h" +#include "message.h" +#include "flags.h" +#include "script.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c index 2a47701a..a2de47c4 100644 --- a/src/npc/castleMaid.c +++ b/src/npc/castleMaid.c @@ -6,12 +6,13 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "manager.h" #include "message.h" #include "npc.h" #include "save.h" #include "script.h" +#include "asm.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index 5043c0f0..dd4db86d 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -7,11 +7,15 @@ #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "npc.h" #include "script.h" #include "sound.h" #include "tiles.h" +#include "asm.h" +#include "vram.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/cat.c b/src/npc/cat.c index 9adf40f1..0693e6a1 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -6,10 +6,11 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "message.h" #include "npc.h" #include "save.h" +#include "physics.h" +#include "manager.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/clothesRack.c b/src/npc/clothesRack.c index ddf8903d..83f463db 100644 --- a/src/npc/clothesRack.c +++ b/src/npc/clothesRack.c @@ -6,6 +6,9 @@ */ #include "npc.h" #include "tiles.h" +#include "room.h" +#include "flags.h" +#include "asm.h" void sub_0806DD90(Entity*); void sub_0806DEC8(Entity*); diff --git a/src/npc/cow.c b/src/npc/cow.c index 944d26b3..a43c8b9e 100644 --- a/src/npc/cow.c +++ b/src/npc/cow.c @@ -5,10 +5,12 @@ * @brief Cow NPC */ #include "entity.h" -#include "functions.h" +#include "message.h" #include "npc.h" #include "player.h" #include "sound.h" +#include "asm.h" +#include "manager.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/cucco.c b/src/npc/cucco.c index 54042add..e0be2aff 100644 --- a/src/npc/cucco.c +++ b/src/npc/cucco.c @@ -4,9 +4,12 @@ * * @brief Cucco NPC */ -#include "functions.h" +#include "message.h" #include "kinstone.h" #include "npc.h" +#include "sound.h" +#include "save.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/cuccoChick.c b/src/npc/cuccoChick.c index adf6eaf4..75cf0ede 100644 --- a/src/npc/cuccoChick.c +++ b/src/npc/cuccoChick.c @@ -4,8 +4,11 @@ * * @brief Cucco Chick NPC */ -#include "functions.h" +#include "message.h" #include "npc.h" +#include "sound.h" +#include "asm.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/dampe.c b/src/npc/dampe.c index 62a39909..b8d66f5d 100644 --- a/src/npc/dampe.c +++ b/src/npc/dampe.c @@ -13,6 +13,8 @@ #include "player.h" #include "room.h" #include "tiles.h" +#include "script.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/din.c b/src/npc/din.c index 604c03bb..63d27d04 100644 --- a/src/npc/din.c +++ b/src/npc/din.c @@ -4,9 +4,12 @@ * * @brief Din NPC */ -#include "entity.h" -#include "kinstone.h" #include "npc.h" +#include "kinstone.h" +#include "save.h" +#include "script.h" +#include "physics.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/dog.c b/src/npc/dog.c index 628e56d8..b9a188f8 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -6,10 +6,17 @@ */ #include "collision.h" #include "entity.h" -#include "functions.h" #include "item.h" #include "npc.h" #include "tiles.h" +#include "sound.h" +#include "flags.h" +#include "save.h" +#include "message.h" +#include "script.h" +#include "asm.h" +#include "physics.h" +#include "manager.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/drLeft.c b/src/npc/drLeft.c index c89760c5..0186c83c 100644 --- a/src/npc/drLeft.c +++ b/src/npc/drLeft.c @@ -4,9 +4,15 @@ * * @brief Dr Left NPC */ -#include "functions.h" +#include "physics.h" #include "item.h" +#include "message.h" #include "npc.h" +#include "flags.h" +#include "save.h" +#include "script.h" +#include "asm.h" +#include "structures.h" void sub_0806BFD8(Entity* this); diff --git a/src/npc/emma.c b/src/npc/emma.c index 7ff05e23..fa22a81d 100644 --- a/src/npc/emma.c +++ b/src/npc/emma.c @@ -5,7 +5,6 @@ * @brief Emma NPC */ #include "entity.h" -#include "functions.h" #include "screenTransitions.h" #include "script.h" diff --git a/src/npc/epona.c b/src/npc/epona.c index bec976fd..6cca50b8 100644 --- a/src/npc/epona.c +++ b/src/npc/epona.c @@ -5,10 +5,11 @@ * @brief Epona NPC */ #include "entity.h" -#include "functions.h" #include "message.h" #include "npc.h" #include "sound.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/ezlo.c b/src/npc/ezlo.c index c8012395..ba3532cd 100644 --- a/src/npc/ezlo.c +++ b/src/npc/ezlo.c @@ -5,6 +5,11 @@ * @brief Ezlo NPC */ #include "npc.h" +#include "physics.h" +#include "effects.h" +#include "player.h" +#include "script.h" +#include "asm.h" const u8 gUnk_08114134[]; const u8 gUnk_08114144[]; diff --git a/src/npc/farmers.c b/src/npc/farmers.c index f98b8ef2..9d5a2806 100644 --- a/src/npc/farmers.c +++ b/src/npc/farmers.c @@ -5,7 +5,7 @@ * @brief Farmers NPC */ #include "entity.h" -#include "functions.h" +#include "message.h" #include "npc.h" #include "script.h" diff --git a/src/npc/farore.c b/src/npc/farore.c index ae08c094..c56a91ea 100644 --- a/src/npc/farore.c +++ b/src/npc/farore.c @@ -4,9 +4,13 @@ * * @brief Farore NPC */ -#include "entity.h" #include "npc.h" #include "kinstone.h" +#include "save.h" +#include "player.h" +#include "script.h" +#include "physics.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/festari.c b/src/npc/festari.c index 8a13f80a..992d514c 100644 --- a/src/npc/festari.c +++ b/src/npc/festari.c @@ -5,8 +5,10 @@ * @brief Festari NPC */ #include "entity.h" -#include "functions.h" #include "npc.h" +#include "script.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/forestMinish.c b/src/npc/forestMinish.c index 7c602e2a..8a1013f4 100644 --- a/src/npc/forestMinish.c +++ b/src/npc/forestMinish.c @@ -4,13 +4,22 @@ * * @brief Forest Minish NPC */ -#include "functions.h" #include "item.h" #include "kinstone.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "flags.h" +#include "effects.h" +#include "physics.h" +#include "player.h" #include "playeritem.h" +#include "save.h" +#include "message.h" +#include "script.h" #include "structures.h" + typedef struct { /*0x00*/ Entity base; /*0x68*/ u8 fusionOffer; @@ -715,7 +724,7 @@ void sub_08060318(void) { for (i = 2; i >= 0; i--) { ent = FindEntityByID(PLAYER_ITEM, PLAYER_ITEM_BOMB, 2); if (ent != NULL) { - CreateDust(ent); + CreateDeathFx(ent); DeleteEntity(ent); } } diff --git a/src/npc/gentari.c b/src/npc/gentari.c index 968f71fc..91bd3d43 100644 --- a/src/npc/gentari.c +++ b/src/npc/gentari.c @@ -6,6 +6,9 @@ */ #include "entity.h" #include "npc.h" +#include "script.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 9282b35f..29f8dc09 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -5,11 +5,13 @@ * @brief Ghost Brothers NPC */ #include "entity.h" -#include "functions.h" #include "message.h" #include "npc.h" #include "save.h" +#include "script.h" #include "screen.h" +#include "structures.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/gina.c b/src/npc/gina.c index 0124c37e..11c8d10b 100644 --- a/src/npc/gina.c +++ b/src/npc/gina.c @@ -7,6 +7,11 @@ #include "entity.h" #include "npc.h" #include "player.h" +#include "script.h" +#include "physics.h" +#if defined(USA) || defined(DEMO_USA) +#include "flags.h" +#endif typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/gorman.c b/src/npc/gorman.c index 576ef99b..c1ea99d2 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -4,8 +4,13 @@ * * @brief Gorman NPC */ -#include "functions.h" +#include "player.h" #include "npc.h" +#include "asm.h" +#include "message.h" +#include "script.h" +#include "flags.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/goron.c b/src/npc/goron.c index a67b0e5f..389eb043 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -6,10 +6,13 @@ */ #include "effects.h" #include "entity.h" -#include "functions.h" #include "kinstone.h" #include "message.h" +#include "script.h" #include "npc.h" +#include "common.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index c9bd4d73..005cbaf1 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -6,11 +6,13 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "manager.h" #include "item.h" #include "message.h" #include "npc.h" #include "save.h" +#include "script.h" +#include "physics.h" static u32 GoronMerchant_GetSalePrice(Entity*); diff --git a/src/npc/gregal.c b/src/npc/gregal.c index f081280a..48cc43aa 100644 --- a/src/npc/gregal.c +++ b/src/npc/gregal.c @@ -5,9 +5,10 @@ * @brief Gregal NPC */ #include "entity.h" -#include "functions.h" #include "npc.h" #include "script.h" +#include "player.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/guard.c b/src/npc/guard.c index 760bb6b0..8acd58d6 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -6,13 +6,14 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "manager.h" #include "message.h" #include "npc.h" #include "player.h" #include "projectile.h" #include "room.h" #include "script.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/guardWithSpear.c b/src/npc/guardWithSpear.c index e4821138..b3ebce26 100644 --- a/src/npc/guardWithSpear.c +++ b/src/npc/guardWithSpear.c @@ -5,12 +5,18 @@ * @brief Guard with Spear NPC */ #include "entity.h" -#include "functions.h" #include "item.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "script.h" +#include "save.h" +#include "message.h" typedef struct { /*0x00*/ Entity base; @@ -132,7 +138,7 @@ void sub_08064198(GuardWithSpearEntity* this) { ProcessMovement0(super); if (sVar1 != super->y.HALF.HI) { if (0x140 < gPlayerEntity.base.speed && gRoomTransition.frameCount % 6 == 0) { - CreateDustSmall(super); + CreateDashFx(super); } this->unk_71 = 10; animationState = super->animationState = GetAnimationStateForDirection8(super->direction); @@ -154,7 +160,7 @@ void sub_08064198(GuardWithSpearEntity* this) { sVar1 = super->z.HALF.HI; super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI; if (sVar1 < 0 && gPlayerEntity.base.z.HALF.HI == 0) { - CreateDustSmall(super); + CreateDashFx(super); } } @@ -189,7 +195,7 @@ void sub_080642B8(GuardWithSpearEntity* this) { ProcessMovement0(super); if (sVar1 != super->x.HALF.HI) { if (0x140 < gPlayerEntity.base.speed && gRoomTransition.frameCount % 6 == 0) { - CreateDustSmall(super); + CreateDashFx(super); } this->unk_71 = 10; animationState = super->animationState = GetAnimationStateForDirection8(super->direction); @@ -211,7 +217,7 @@ void sub_080642B8(GuardWithSpearEntity* this) { sVar1 = super->z.HALF.HI; super->z.HALF.HI = gPlayerEntity.base.z.HALF.HI; if (sVar1 < 0 && gPlayerEntity.base.z.HALF.HI == 0) { - CreateDustSmall(super); + CreateDashFx(super); } } diff --git a/src/npc/hurdyGurdyMan.c b/src/npc/hurdyGurdyMan.c index eb271392..51600e21 100644 --- a/src/npc/hurdyGurdyMan.c +++ b/src/npc/hurdyGurdyMan.c @@ -5,9 +5,13 @@ * @brief Hurdy Gurdy Man NPC */ #include "entity.h" -#include "functions.h" +#include "message.h" #include "npc.h" #include "save.h" +#include "script.h" +#include "common.h" +#include "asm.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/kid.c b/src/npc/kid.c index 678ff84b..766d5814 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -4,10 +4,16 @@ * * @brief Kid NPC */ -#include "functions.h" #include "message.h" #include "npc.h" #include "tiles.h" +#include "save.h" +#include "common.h" +#include "asm.h" +#include "script.h" +#include "manager.h" +#include "structures.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index 1840e24e..d4a52aee 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -5,10 +5,12 @@ * @brief King Daltus NPC */ #include "entity.h" -#include "functions.h" #include "item.h" #include "npc.h" #include "script.h" +#include "message.h" +#include "flags.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/kingGustaf.c b/src/npc/kingGustaf.c index 48db93af..0a738bea 100644 --- a/src/npc/kingGustaf.c +++ b/src/npc/kingGustaf.c @@ -5,8 +5,8 @@ * @brief King Gustaf NPC */ #include "entity.h" -#include "functions.h" #include "screen.h" +#include "script.h" void KingGustaf(Entity* this) { s32 speed; diff --git a/src/npc/librari.c b/src/npc/librari.c index 7e2a69ba..fc8db45a 100644 --- a/src/npc/librari.c +++ b/src/npc/librari.c @@ -7,6 +7,9 @@ #include "entity.h" #include "item.h" #include "npc.h" +#include "flags.h" +#include "message.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/librarians.c b/src/npc/librarians.c index e19c3cc4..d53d6387 100644 --- a/src/npc/librarians.c +++ b/src/npc/librarians.c @@ -6,7 +6,6 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "item.h" #include "message.h" #include "script.h" diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c index 5eb4ea9d..7732485b 100644 --- a/src/npc/mailbox.c +++ b/src/npc/mailbox.c @@ -8,6 +8,7 @@ #include "entity.h" #include "message.h" #include "npc.h" +#include "player.h" void sub_08063280(Entity*); void sub_08063210(Entity*); diff --git a/src/npc/malon.c b/src/npc/malon.c index add79ace..a2a8fc9c 100644 --- a/src/npc/malon.c +++ b/src/npc/malon.c @@ -7,6 +7,8 @@ #include "entity.h" #include "npc.h" #include "script.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/mama.c b/src/npc/mama.c index fa20f7a2..e322a247 100644 --- a/src/npc/mama.c +++ b/src/npc/mama.c @@ -8,6 +8,8 @@ #include "npc.h" #include "save.h" #include "script.h" +#include "message.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/marcy.c b/src/npc/marcy.c index f7c56f54..a4d29146 100644 --- a/src/npc/marcy.c +++ b/src/npc/marcy.c @@ -6,7 +6,7 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "script.h" #include "item.h" #include "message.h" diff --git a/src/npc/mayorHagen.c b/src/npc/mayorHagen.c index 9f4aeb4c..89e42266 100644 --- a/src/npc/mayorHagen.c +++ b/src/npc/mayorHagen.c @@ -9,6 +9,11 @@ #include "item.h" #include "npc.h" #include "player.h" +#include "message.h" +#include "save.h" +#include "script.h" +#include "physics.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/melari.c b/src/npc/melari.c index 30c08445..e8d10481 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -6,6 +6,12 @@ */ #include "item.h" #include "npc.h" +#include "physics.h" +#include "effects.h" +#include "sound.h" +#include "script.h" +#include "message.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index 1532a424..fbcf9b8c 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -9,6 +9,8 @@ #include "item.h" #include "message.h" #include "npc.h" +#include "script.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/moblinLady.c b/src/npc/moblinLady.c index 1fa8d109..8ff54300 100644 --- a/src/npc/moblinLady.c +++ b/src/npc/moblinLady.c @@ -6,6 +6,7 @@ */ #include "entity.h" #include "npc.h" +#include "script.h" void MoblinLady(Entity* this) { if (this->action == 0) { diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index 4bbf89b9..8f471cba 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -6,11 +6,14 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "item.h" #include "message.h" #include "npc.h" #include "script.h" +#include "effects.h" +#include "sound.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/mutoh.c b/src/npc/mutoh.c index 5e09a1d0..407c6f16 100644 --- a/src/npc/mutoh.c +++ b/src/npc/mutoh.c @@ -11,6 +11,9 @@ #include "message.h" #include "npc.h" #include "player.h" +#include "save.h" +#include "physics.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/nayru.c b/src/npc/nayru.c index 5130dbf5..3b501723 100644 --- a/src/npc/nayru.c +++ b/src/npc/nayru.c @@ -4,9 +4,13 @@ * * @brief Nayru NPC */ -#include "entity.h" -#include "kinstone.h" #include "npc.h" +#include "kinstone.h" +#include "save.h" +#include "player.h" +#include "script.h" +#include "physics.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/npc23.c b/src/npc/npc23.c index acda02d4..cd3e67b0 100644 --- a/src/npc/npc23.c +++ b/src/npc/npc23.c @@ -5,11 +5,12 @@ * @brief NPC 23 */ #include "entity.h" -#include "functions.h" #include "message.h" #include "npc.h" #include "player.h" #include "structures.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/npc26.c b/src/npc/npc26.c index b3b5860b..0a4f4107 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -6,6 +6,8 @@ */ #include "entity.h" #include "npc.h" +#include "script.h" +#include "player.h" static void (*const gUnk_081106D4[])(Entity*); static void (*const gUnk_081106E0[])(Entity*); diff --git a/src/npc/npc4E.c b/src/npc/npc4E.c index 73dced19..3fd3da2e 100644 --- a/src/npc/npc4E.c +++ b/src/npc/npc4E.c @@ -6,17 +6,23 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "hitbox.h" #include "item.h" #include "kinstone.h" #include "npc.h" #include "object.h" +#include "common.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "save.h" #include "screenTransitions.h" #include "sound.h" #include "tiles.h" +#include "scroll.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/npc4F.c b/src/npc/npc4F.c index 3f9450a3..442f9868 100644 --- a/src/npc/npc4F.c +++ b/src/npc/npc4F.c @@ -5,6 +5,7 @@ * @brief NPC 4F */ #include "npc.h" +#include "asm.h" void NPC4F(Entity* this) { if (this->action == 0) { diff --git a/src/npc/npc5.c b/src/npc/npc5.c index 27c865d6..787bb16f 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -5,11 +5,16 @@ * @brief Unused Zelda follower NPC. */ #include "collision.h" -#include "functions.h" #include "hitbox.h" #include "message.h" #include "npc.h" #include "tiles.h" +#include "flags.h" +#include "common.h" +#include "physics.h" +#include "asm.h" +#include "room.h" +#include "player.h" #define kFollowDistance 32 // distance to follow player #define kPoiDistance 4 // point of interest distance diff --git a/src/npc/npc9.c b/src/npc/npc9.c index 99fcccb9..b8d04ce5 100644 --- a/src/npc/npc9.c +++ b/src/npc/npc9.c @@ -7,6 +7,7 @@ #include "entity.h" #include "message.h" #include "npc.h" +#include "player.h" void sub_08062AF0(Entity*); void sub_08062B14(Entity*); diff --git a/src/npc/percy.c b/src/npc/percy.c index a3a04a44..5f4e660d 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -5,10 +5,17 @@ * @brief Percy NPC */ #include "entity.h" -#include "functions.h" #include "item.h" #include "kinstone.h" +#include "message.h" #include "npc.h" +#include "save.h" +#include "script.h" +#include "common.h" +#include "asm.h" +#include "effects.h" +#include "flags.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/phonograph.c b/src/npc/phonograph.c index f10677d2..241f2947 100644 --- a/src/npc/phonograph.c +++ b/src/npc/phonograph.c @@ -8,10 +8,10 @@ #include "entity.h" #include "fileselect.h" #include "flags.h" -#include "functions.h" #include "message.h" #include "screen.h" #include "script.h" +#include "sound.h" typedef struct { /*0x00*/ Entity base; @@ -205,14 +205,14 @@ const static Font gUnk_081146B8 = { #ifdef EU void sub_0806EABC(PhonographEntity* this) { sub_08050384(); - sub_08057044(this->unk_68, gUnk_020227E8, 0x202020); + NumberToAsciiPad3Digits(this->unk_68, gUnk_020227E8, 0x202020); ShowTextBox(0x3302, &gUnk_081146B8); gScreen.bg0.updated = 1; } #else void sub_0806EABC(Entity* this, u32 param) { sub_08050384(); - sub_08057044(param, gUnk_020227E8, 0x202020); + NumberToAsciiPad3Digits(param, &gUnk_020227E8[0], 0x202020); ShowTextBox(0x3302, &gUnk_081146B8); gScreen.bg0.updated = 1; } diff --git a/src/npc/picolyteBottle.c b/src/npc/picolyteBottle.c index c384b53b..16170a02 100644 --- a/src/npc/picolyteBottle.c +++ b/src/npc/picolyteBottle.c @@ -5,15 +5,19 @@ * @brief Picolyte Bottle NPC */ #include "entity.h" -#include "functions.h" #include "hitbox.h" #include "kinstone.h" #include "message.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screenTransitions.h" #include "script.h" -#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/pina.c b/src/npc/pina.c index 26692def..592c4246 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -5,11 +5,14 @@ * @brief Pina NPC */ #include "entity.h" -#include "functions.h" #include "message.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "physics.h" +#include "player.h" #include "save.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/pita.c b/src/npc/pita.c index 804a0e38..3cfd55de 100644 --- a/src/npc/pita.c +++ b/src/npc/pita.c @@ -6,6 +6,11 @@ */ #include "item.h" #include "npc.h" +#include "message.h" +#include "flags.h" +#include "script.h" +#include "physics.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/postman.c b/src/npc/postman.c index 05f0d906..4a8bbb43 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -5,9 +5,14 @@ * @brief Postman NPC */ #include "entity.h" -#include "functions.h" #include "npc.h" #include "sound.h" +#include "effects.h" +#include "save.h" +#include "script.h" +#include "asm.h" +#include "message.h" +#include "physics.h" #include "structures.h" typedef struct { diff --git a/src/npc/rem.c b/src/npc/rem.c index d921f196..4298eccd 100644 --- a/src/npc/rem.c +++ b/src/npc/rem.c @@ -4,9 +4,16 @@ * * @brief Rem NPC */ -#include "functions.h" +#include "physics.h" #include "item.h" #include "npc.h" +#include "flags.h" +#include "sound.h" +#include "message.h" +#include "script.h" +#include "asm.h" +#include "structures.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/simon.c b/src/npc/simon.c index 480897ee..ddce95ea 100644 --- a/src/npc/simon.c +++ b/src/npc/simon.c @@ -6,8 +6,8 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "effects.h" #include "room.h" #include "screen.h" #include "screenTransitions.h" diff --git a/src/npc/sittingPerson.c b/src/npc/sittingPerson.c index c3da1060..b5eea94f 100644 --- a/src/npc/sittingPerson.c +++ b/src/npc/sittingPerson.c @@ -5,7 +5,13 @@ * @brief Sitting Person NPC */ #include "npc.h" -#include "functions.h" +#include "save.h" +#include "flags.h" +#include "asm.h" +#include "message.h" +#include "script.h" +#include "physics.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/smallTownMinish.c b/src/npc/smallTownMinish.c index bada8800..485b4db9 100644 --- a/src/npc/smallTownMinish.c +++ b/src/npc/smallTownMinish.c @@ -5,12 +5,13 @@ * @brief Small Town Minish NPC */ #include "entity.h" -#include "functions.h" #include "item.h" +#include "message.h" #include "npc.h" #include "player.h" #include "save.h" #include "script.h" +#include "structures.h" void SmallTownMinish(Entity* this) { static const Hitbox gUnk_081142FC = { -2, 1, { 0, 0, 0, 0 }, 6, 6 }; diff --git a/src/npc/smith.c b/src/npc/smith.c index 2210dede..f002c7fa 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -4,8 +4,16 @@ * * @brief Smith NPC */ -#include "functions.h" +#include "physics.h" #include "npc.h" +#include "sound.h" +#include "save.h" +#include "flags.h" +#include "effects.h" +#include "message.h" +#include "script.h" +#include "asm.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/stamp.c b/src/npc/stamp.c index 8051fe44..ef6c99c0 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -6,10 +6,12 @@ */ #include "effects.h" #include "entity.h" -#include "functions.h" #include "kinstone.h" #include "message.h" #include "npc.h" +#include "common.h" +#include "script.h" +#include "player.h" void sub_08062CA4(Entity*); void sub_08062BD4(Entity*); diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index d1971904..786e39e7 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -5,14 +5,21 @@ * @brief Stockwell NPC */ #include "entity.h" -#include "functions.h" #include "game.h" #include "item.h" #include "message.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "player.h" #include "room.h" #include "script.h" +#include "save.h" +#include "subtask.h" +#ifndef EU +#include "structures.h" +#endif #ifndef EU static const Rect gUnk_0810FDA0 = { 0, 8, 10, 16 }; diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index b48d2ec6..c6e51c21 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -5,10 +5,16 @@ * @brief Sturgeon NPC */ #include "entity.h" -#include "functions.h" #include "item.h" #include "npc.h" #include "object.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" +#include "message.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; @@ -148,7 +154,7 @@ void Sturgeon_Head(Entity* this) { void sub_08064C9C(Entity* this) { if ((this->timer != 0) && ((gRoomTransition.frameCount & 3U) == 0)) { - CreateDust(this); + CreateDeathFx(this); } } diff --git a/src/npc/syrup.c b/src/npc/syrup.c index 60083964..7609ffe1 100644 --- a/src/npc/syrup.c +++ b/src/npc/syrup.c @@ -4,9 +4,13 @@ * * @brief Syrup NPC */ -#include "functions.h" +#include "script.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/talon.c b/src/npc/talon.c index ddcd1977..c0558722 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -4,9 +4,12 @@ * * @brief Talon NPC */ -#include "functions.h" +#include "physics.h" #include "item.h" #include "npc.h" +#include "script.h" +#include "message.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/teachers.c b/src/npc/teachers.c index 89953855..605ae639 100644 --- a/src/npc/teachers.c +++ b/src/npc/teachers.c @@ -9,6 +9,8 @@ #include "player.h" #include "save.h" #include "script.h" +#include "message.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/tingleSiblings.c b/src/npc/tingleSiblings.c index 75abc4db..3dc599be 100644 --- a/src/npc/tingleSiblings.c +++ b/src/npc/tingleSiblings.c @@ -5,10 +5,17 @@ * @brief Tingle Siblings NPC */ #include "entity.h" -#include "functions.h" #include "item.h" #include "kinstone.h" #include "npc.h" +#include "flags.h" +#include "save.h" +#include "effects.h" +#include "common.h" +#include "message.h" +#include "script.h" +#include "asm.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index b0f3fc68..b97dee5f 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -6,10 +6,15 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "item.h" #include "npc.h" #include "tiles.h" +#include "flags.h" +#include "message.h" +#include "save.h" +#include "script.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index 8f8b34f1..1501b175 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -4,9 +4,16 @@ * * @brief Townsperson NPC */ -#include "functions.h" #include "item.h" #include "npc.h" +#include "save.h" +#include "script.h" +#include "flags.h" +#include "effects.h" +#include "asm.h" +#include "message.h" +#include "manager.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/vaati.c b/src/npc/vaati.c index d272f3d8..7b9017e0 100644 --- a/src/npc/vaati.c +++ b/src/npc/vaati.c @@ -5,9 +5,9 @@ * @brief Vaati NPC */ #include "entity.h" -#include "functions.h" #include "script.h" #include "sound.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/vaatiReborn.c b/src/npc/vaatiReborn.c index 82c349be..ffee2a4c 100644 --- a/src/npc/vaatiReborn.c +++ b/src/npc/vaatiReborn.c @@ -4,8 +4,11 @@ * * @brief Vaati Reborn NPC */ -#include "functions.h" #include "npc.h" +#include "sound.h" +#include "flags.h" +#include "message.h" +#include "physics.h" void VaatiRebornAction0(Entity* this); void VaatiRebornAction1(Entity* this); diff --git a/src/npc/wheaton.c b/src/npc/wheaton.c index 41eb8ac9..38b2585b 100644 --- a/src/npc/wheaton.c +++ b/src/npc/wheaton.c @@ -5,6 +5,8 @@ * @brief Wheaton NPC */ #include "npc.h" +#include "physics.h" +#include "script.h" void Wheaton(Entity* this) { static const Hitbox gUnk_0810C3C0 = { 0, 4, { 0, 0, 0, 0 }, 6, 12 }; diff --git a/src/npc/windTribespeople.c b/src/npc/windTribespeople.c index 521e850b..dfa257a3 100644 --- a/src/npc/windTribespeople.c +++ b/src/npc/windTribespeople.c @@ -7,6 +7,11 @@ #include "entity.h" #include "npc.h" #include "sound.h" +#include "script.h" +#include "message.h" +#include "flags.h" +#include "save.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/npc/zelda.c b/src/npc/zelda.c index e740296f..49a269bc 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -7,10 +7,14 @@ #include "npc/zelda.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "script.h" +#include "physics.h" #include "npc.h" #include "sound.h" #include "tiles.h" +#include "asm.h" +#include "room.h" +#include "player.h" void ZeldaFollower_Hide(Entity*, Entity*); void ZeldaFollower_Show(Entity*, Entity*); diff --git a/src/npc/zeldaFollower.c b/src/npc/zeldaFollower.c index 3e372423..28ce780f 100644 --- a/src/npc/zeldaFollower.c +++ b/src/npc/zeldaFollower.c @@ -7,7 +7,9 @@ #include "npc/zelda.h" #include "common.h" #include "entity.h" -#include "functions.h" +#include "asm.h" +#include "physics.h" +#include "player.h" extern s32 sub_080041E8(s32 x1, s32 y1, s32 x2, s32 y2); diff --git a/src/npcUtils.c b/src/npcUtils.c index 6866991c..e5a5318c 100644 --- a/src/npcUtils.c +++ b/src/npcUtils.c @@ -1,12 +1,16 @@ #include "global.h" #include "asm.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "definitions.h" #include "save.h" +#include "message.h" #include "npc.h" #include "kinstone.h" #include "hitbox.h" +#include "flags.h" +#include "common.h" +#include "vram.h" extern const NPCDefinition gNPCDefinitions[]; diff --git a/src/object.c b/src/object.c index 4f61cd10..6377e410 100644 --- a/src/object.c +++ b/src/object.c @@ -198,8 +198,6 @@ void (*const gObjectFunctions[])(Entity*) = { [LINK_ANIMATION] = LinkAnimation, }; -void ObjectInit(Entity*); - void ObjectUpdate(Entity* this) { if ((this->flags & ENT_DID_INIT) == 0 && this->action == 0) ObjectInit(this); diff --git a/src/object/ambientClouds.c b/src/object/ambientClouds.c index 7e885373..05e604ce 100644 --- a/src/object/ambientClouds.c +++ b/src/object/ambientClouds.c @@ -7,8 +7,8 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "player.h" void AmbientClouds_Init(Entity* this); void AmbientClouds_Action1(Entity* this); diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c index 0c150823..53d29d75 100644 --- a/src/object/backgroundCloud.c +++ b/src/object/backgroundCloud.c @@ -5,6 +5,9 @@ * @brief BackgroundCloud object */ #include "object.h" +#include "asm.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index 1add5b41..3dce7457 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -4,8 +4,12 @@ * * @brief Baker Oven object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c index 69a1ea77..dd694bc3 100644 --- a/src/object/barrelSpiderweb.c +++ b/src/object/barrelSpiderweb.c @@ -4,9 +4,17 @@ * * @brief Barrel Spiderweb object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "common.h" + +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" + +#include "player.h" void BarrelSpiderweb_Init(Entity*); void BarrelSpiderweb_Action1(Entity*); diff --git a/src/object/beanstalk.c b/src/object/beanstalk.c index e445d415..0b70aa06 100644 --- a/src/object/beanstalk.c +++ b/src/object/beanstalk.c @@ -4,9 +4,14 @@ * * @brief Beanstalk object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "tiles.h" +#include "vram.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/bedCover.c b/src/object/bedCover.c index a24189f5..10697f49 100644 --- a/src/object/bedCover.c +++ b/src/object/bedCover.c @@ -4,7 +4,7 @@ * * @brief Bed Cover object */ -#include "functions.h" +#include "script.h" #include "object.h" typedef struct { diff --git a/src/object/bench.c b/src/object/bench.c index 2b72fc56..8ca49a3c 100644 --- a/src/object/bench.c +++ b/src/object/bench.c @@ -6,9 +6,8 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" +#include "room.h" #include "player.h" -#include "sound.h" typedef struct { Entity base; diff --git a/src/object/bigBarrel.c b/src/object/bigBarrel.c index 74f13c50..4f7f99ee 100644 --- a/src/object/bigBarrel.c +++ b/src/object/bigBarrel.c @@ -10,9 +10,9 @@ #include "flags.h" #include "map.h" #include "object.h" +#include "sound.h" #include "room.h" #include "save.h" -#include "sound.h" #include "tiles.h" typedef struct { diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index 7cd09aa6..543f323f 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -8,6 +8,13 @@ #include "hitbox.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/bigPushableLever.c b/src/object/bigPushableLever.c index e7efcd56..1a01f69b 100644 --- a/src/object/bigPushableLever.c +++ b/src/object/bigPushableLever.c @@ -4,8 +4,12 @@ * * @brief Big Pushable Lever object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 6ee294ac..ded88e94 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -6,8 +6,11 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "effects.h" +#include "physics.h" +#include "player.h" +#include "asm.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/bird.c b/src/object/bird.c index 638d2c52..e7cd5218 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -5,13 +5,21 @@ * @brief Bird object */ #include "collision.h" -#include "functions.h" #include "game.h" #include "item.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "object/cutsceneOrchestrator.h" #include "save.h" +#include "subtask.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/blockPushed.c b/src/object/blockPushed.c index 85f45ce9..72b4a0a0 100644 --- a/src/object/blockPushed.c +++ b/src/object/blockPushed.c @@ -5,9 +5,14 @@ * @brief Block Pushed object */ #include "area.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "vram.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/board.c b/src/object/board.c index a05b42e4..ab757067 100644 --- a/src/object/board.c +++ b/src/object/board.c @@ -6,7 +6,6 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" #include "player.h" #include "room.h" #include "tiles.h" diff --git a/src/object/bollard.c b/src/object/bollard.c index 43286546..16dd4959 100644 --- a/src/object/bollard.c +++ b/src/object/bollard.c @@ -7,7 +7,6 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "room.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/book.c b/src/object/book.c index 9903ae37..ef4610a1 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -5,11 +5,17 @@ * @brief Book object */ #include "collision.h" -#include "functions.h" #include "item.h" #include "message.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/bossDoor.c b/src/object/bossDoor.c index 4c5084e8..91324598 100644 --- a/src/object/bossDoor.c +++ b/src/object/bossDoor.c @@ -4,10 +4,18 @@ * * @brief Boss Door object */ -#include "functions.h" +#include "object/lockedDoor.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "common.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/bush.c b/src/object/bush.c index a83a2aec..bd9c3a37 100644 --- a/src/object/bush.c +++ b/src/object/bush.c @@ -4,9 +4,13 @@ * * @brief Bush object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/button.c b/src/object/button.c index ace84517..e223f28c 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -4,9 +4,14 @@ * * @brief Button object */ -#include "functions.h" #include "tiles.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/cameraTarget.c b/src/object/cameraTarget.c index f327c414..7364ce96 100644 --- a/src/object/cameraTarget.c +++ b/src/object/cameraTarget.c @@ -6,9 +6,11 @@ */ #include "common.h" #include "entity.h" -#include "functions.h" +#include "player.h" #include "kinstone.h" #include "message.h" +#include "vram.h" +#include "structures.h" // typedef struct { // Entity base; diff --git a/src/object/carlovObject.c b/src/object/carlovObject.c index 23873a92..00536c0b 100644 --- a/src/object/carlovObject.c +++ b/src/object/carlovObject.c @@ -4,8 +4,15 @@ * * @brief Carlov Object object */ -#include "functions.h" +#include "object/lockedDoor.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { @@ -168,7 +175,7 @@ void CarlovObject_Type2Init(CarlovObjectEntity* this) { super->frameIndex = 1; } } - CreateDust(super); + CreateDeathFx(super); } void CarlovObject_Type2Action1(CarlovObjectEntity* this) { diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c index d6f3256f..582ecbac 100644 --- a/src/object/chestSpawner.c +++ b/src/object/chestSpawner.c @@ -6,11 +6,17 @@ */ #include "item.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "player.h" #include "screen.h" #include "tiles.h" #include "manager/lightManager.h" #include "structures.h" -#include "functions.h" +#include "beanstalkSubtask.h" typedef struct { /*0x00*/ Entity base; @@ -131,7 +137,7 @@ void ChestSpawner_Type2Action2(ChestSpawnerEntity* this) { break; default: sub_0800445C(super); - CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, 2); + CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, 2); if (--super->timer == 0) { super->timer = 8; tmp = ++super->subtimer; @@ -260,7 +266,7 @@ void ChestSpawner_Type0Action2(ChestSpawnerEntity* this) { break; default: SoundReq(SFX_SECRET); - CreateDust(super); + CreateDeathFx(super); break; } super->action = 3; @@ -281,7 +287,7 @@ void ChestSpawner_Type0Action3(ChestSpawnerEntity* this) { } else { super->action = 1; RestorePrevTileEntity(this->tilePos, super->collisionLayer); - CreateDust(super); + CreateDeathFx(super); } } } diff --git a/src/object/chuchuBossCutscene.c b/src/object/chuchuBossCutscene.c index 9c1287f2..59d02100 100644 --- a/src/object/chuchuBossCutscene.c +++ b/src/object/chuchuBossCutscene.c @@ -4,9 +4,12 @@ * * @brief Chuchu Boss Cutscene object */ -#include "functions.h" #include "menu.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" void ChuchuBossCutscene_Init(Entity*); void ChuchuBossCutscene_Action1(Entity*); diff --git a/src/object/chuchuBossStartParticle.c b/src/object/chuchuBossStartParticle.c index 286c414c..312b5839 100644 --- a/src/object/chuchuBossStartParticle.c +++ b/src/object/chuchuBossStartParticle.c @@ -4,8 +4,12 @@ * * @brief Chuchu Boss Start Particle object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/cloud.c b/src/object/cloud.c index 58d34f12..7521bdb4 100644 --- a/src/object/cloud.c +++ b/src/object/cloud.c @@ -4,8 +4,13 @@ * * @brief Cloud object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "structures.h" typedef struct { diff --git a/src/object/crackingGround.c b/src/object/crackingGround.c index fe8488c0..bd13dadf 100644 --- a/src/object/crackingGround.c +++ b/src/object/crackingGround.c @@ -4,8 +4,12 @@ * * @brief Cracking Ground object */ -#include "functions.h" +#include "asm.h" #include "object.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "player.h" void CrackingGround(Entity* this) { if (this->action == 0) { diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index b57c4c8c..e8f5a060 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -5,10 +5,16 @@ * @brief Crenel Bean Sprout object */ #include "asm.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; @@ -241,7 +247,7 @@ void CrenelBeanSprout_Action4(CrenelBeanSproutEntity* this) { if (--super->timer == 0) { super->action = 6; super->subAction = 0; - CreateDust(super); + CreateDeathFx(super); } } else { super->timer = 192; diff --git a/src/object/cuccoMinigame.c b/src/object/cuccoMinigame.c index ae866925..2b0d400e 100644 --- a/src/object/cuccoMinigame.c +++ b/src/object/cuccoMinigame.c @@ -8,10 +8,14 @@ #include "enemy.h" #include "entity.h" #include "fileselect.h" -#include "functions.h" #include "item.h" #include "npc.h" #include "object.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "script.h" #include "tiles.h" diff --git a/src/object/cutsceneMiscObject.c b/src/object/cutsceneMiscObject.c index 2427c370..d8ac6be7 100644 --- a/src/object/cutsceneMiscObject.c +++ b/src/object/cutsceneMiscObject.c @@ -4,12 +4,21 @@ * * @brief Cutscene Misc object */ +#include "object/cutsceneMiscObject.h" #include "area.h" -#include "functions.h" #include "item.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" +#include "scroll.h" #include "script.h" #include "tiles.h" @@ -188,7 +197,7 @@ void sub_08094B94(CutsceneMiscObjectEntity* this) { CopyPosition(&gPlayerEntity.base, e); e->z.HALF.HI = -48; ((CutsceneMiscObjectEntity*)e)->ctx = StartCutscene(e, &script_CutsceneMiscObjectTheLittleHat); - CreateDust(e); + CreateDeathFx(e); e->z.HALF.HI += 16; e->y.HALF.HI++; } diff --git a/src/object/cutsceneOrchestrator.c b/src/object/cutsceneOrchestrator.c index efc726a3..29312433 100644 --- a/src/object/cutsceneOrchestrator.c +++ b/src/object/cutsceneOrchestrator.c @@ -5,7 +5,7 @@ * @brief Cutscene Orchestrator object */ #include "entity.h" -#include "functions.h" +#include "script.h" #include "hitbox.h" void CutsceneOrchestrator(Entity* this) { diff --git a/src/object/deathFx.c b/src/object/deathFx.c index 2f51e110..a752fb53 100644 --- a/src/object/deathFx.c +++ b/src/object/deathFx.c @@ -7,9 +7,11 @@ #include "object/deathFx.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "item.h" +#include "physics.h" #include "global.h" #include "sound.h" +#include "vram.h" void sub_08081790(DeathFxObject* this); void DeathFx_Delete(DeathFxObject* this); diff --git a/src/object/dirtParticle.c b/src/object/dirtParticle.c index cfd0295a..1a038be5 100644 --- a/src/object/dirtParticle.c +++ b/src/object/dirtParticle.c @@ -4,8 +4,10 @@ * * @brief Dirt Particle object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/doubleBookshelf.c b/src/object/doubleBookshelf.c index c5a7386c..48fc4dcd 100644 --- a/src/object/doubleBookshelf.c +++ b/src/object/doubleBookshelf.c @@ -4,8 +4,13 @@ * * @brief Double Bookshelf object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/elementsBackground.c b/src/object/elementsBackground.c index f046d3b7..eaeb532f 100644 --- a/src/object/elementsBackground.c +++ b/src/object/elementsBackground.c @@ -5,7 +5,6 @@ * @brief Elements Background object */ #include "entity.h" -#include "functions.h" #include "screen.h" void ElementsBackground_Init(Entity*); diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c index ac39921b..b44b85b9 100644 --- a/src/object/enemyItem.c +++ b/src/object/enemyItem.c @@ -4,8 +4,11 @@ * * @brief Enemy Item object */ -#include "functions.h" +#include "scroll.h" #include "object.h" +#include "flags.h" +#include "physics.h" +#include "item.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/evilSpirit.c b/src/object/evilSpirit.c index bec6e328..7f74689a 100644 --- a/src/object/evilSpirit.c +++ b/src/object/evilSpirit.c @@ -1,7 +1,9 @@ #include "entity.h" -#include "functions.h" #include "flags.h" #include "object.h" +#include "asm.h" +#include "physics.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/object/ezloCap.c b/src/object/ezloCap.c index de1beb00..f342e00a 100644 --- a/src/object/ezloCap.c +++ b/src/object/ezloCap.c @@ -4,9 +4,13 @@ * * @brief Ezlo Cap object */ -#include "functions.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "script.h" +#include "player.h" +#include "vram.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/ezloCapFlying.c b/src/object/ezloCapFlying.c index 91c197a0..2d270232 100644 --- a/src/object/ezloCapFlying.c +++ b/src/object/ezloCapFlying.c @@ -4,8 +4,12 @@ * * @brief Ezlo Cap Flying object */ -#include "functions.h" +#include "asm.h" #include "object.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/fairy.c b/src/object/fairy.c index c544d561..430da8d9 100644 --- a/src/object/fairy.c +++ b/src/object/fairy.c @@ -5,10 +5,13 @@ * @brief Fairy object */ #include "collision.h" -#include "functions.h" #include "hitbox.h" -#include "item.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "physics.h" +#include "player.h" +#include "scroll.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/fan.c b/src/object/fan.c index f786981a..1d184cf6 100644 --- a/src/object/fan.c +++ b/src/object/fan.c @@ -7,10 +7,12 @@ #include "collision.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "asm.h" #include "object.h" -#include "player.h" #include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/object/fanWind.c b/src/object/fanWind.c index a33a58d7..631f3936 100644 --- a/src/object/fanWind.c +++ b/src/object/fanWind.c @@ -6,7 +6,8 @@ */ #include "collision.h" #include "entity.h" -#include "functions.h" +#include "room.h" +#include "physics.h" void FanWind(Entity* this) { u8* collisionData; diff --git a/src/object/figurineDevice.c b/src/object/figurineDevice.c index 6c553dc0..7bdf0124 100644 --- a/src/object/figurineDevice.c +++ b/src/object/figurineDevice.c @@ -6,13 +6,23 @@ */ #include "figurineMenu.h" #include "fileselect.h" -#include "functions.h" #include "item.h" #include "kinstone.h" #include "message.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" #include "tiles.h" +#include "subtask.h" +#ifndef EU +#include "script.h" +#endif typedef struct { /*0x00*/ Entity base; @@ -596,8 +606,8 @@ void sub_080882A8(FigurineDeviceEntity* this) { static const u16 gUnk_08120AE4[] = { TEXT_INDEX(TEXT_CARLOV, 0x18), TEXT_INDEX(TEXT_CARLOV, 0x19) }; u8* ptr; sub_08050384(); - sub_08057044(this->shells, gUnk_020227E8, 0x202020); - sub_08057044(this->chance, &gUnk_020227E8[1], 0x202020); + NumberToAsciiPad3Digits(this->shells, &gUnk_020227E8[0], 0x202020); + NumberToAsciiPad3Digits(this->chance, &gUnk_020227E8[1], 0x202020); ptr = (u8*)0x02000000; if (ptr[7] == 0) { ShowTextBox(gUnk_08120AE4[super->type2], (Font*)&gUnk_08120AB4); // TODO convert data diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index 3b01e789..aa82c7c1 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -5,11 +5,15 @@ * @brief File Screen Objects object */ #include "fileselect.h" -#include "functions.h" #include "main.h" #include "menu.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "flags.h" +#include "physics.h" #include "player.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/fireballChain.c b/src/object/fireballChain.c index af1aa68e..f9b08cbe 100644 --- a/src/object/fireballChain.c +++ b/src/object/fireballChain.c @@ -5,7 +5,7 @@ * @brief Fireball Chain object */ #include "entity.h" -#include "functions.h" +#include "physics.h" #include "global.h" #include "projectile.h" #include "projectile/winder.h" diff --git a/src/object/fireplace.c b/src/object/fireplace.c index 1bf536cf..2c3d3eed 100644 --- a/src/object/fireplace.c +++ b/src/object/fireplace.c @@ -4,8 +4,11 @@ * * @brief Fireplace object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/flame.c b/src/object/flame.c index d3d508f1..4fce1e8d 100644 --- a/src/object/flame.c +++ b/src/object/flame.c @@ -6,8 +6,11 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "sound.h" +#include "asm.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c index 3a260350..f9ec6f89 100644 --- a/src/object/floatingPlatform.c +++ b/src/object/floatingPlatform.c @@ -5,8 +5,10 @@ * @brief Floating Platform object */ #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/object/fourElements.c b/src/object/fourElements.c index a8514ec8..9e88cb0d 100644 --- a/src/object/fourElements.c +++ b/src/object/fourElements.c @@ -8,9 +8,13 @@ #include "hitbox.h" #include "message.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "player.h" #include "screen.h" +#include "scroll.h" #include "manager/lightManager.h" -#include "functions.h" +#include "script.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c index be88eb5f..b9d04b1c 100644 --- a/src/object/frozenOctorok.c +++ b/src/object/frozenOctorok.c @@ -5,9 +5,16 @@ * @brief Frozen Octorok object */ #include "enemy/octorokBoss.h" -#include "functions.h" #include "message.h" #include "object.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" +#include "vram.h" typedef struct { /*0x00*/ Entity base; @@ -219,7 +226,7 @@ void FrozenOctorok_Action1(FrozenOctorokEntity* this) { FrozenOctorok_Action1SubActions[super->subAction](this); if (super->subtimer != 0) { if ((gRoomTransition.frameCount & 7) == 0) { - CreateSparkle(super->child); + CreateSparkleFx(super->child); } if (this->unk_7e != 0) { super->child->zVelocity = super->child->zVelocity - (s16)this->unk_7e; diff --git a/src/object/frozenWaterElement.c b/src/object/frozenWaterElement.c index 848964b3..183fc31b 100644 --- a/src/object/frozenWaterElement.c +++ b/src/object/frozenWaterElement.c @@ -4,8 +4,14 @@ * * @brief Frozen Water Element object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/furniture.c b/src/object/furniture.c index ddcec22f..c8ff8961 100644 --- a/src/object/furniture.c +++ b/src/object/furniture.c @@ -5,9 +5,11 @@ * @brief Furniture object */ #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" #include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" enum { diff --git a/src/object/gentariCurtain.c b/src/object/gentariCurtain.c index 97c3aad0..65506287 100644 --- a/src/object/gentariCurtain.c +++ b/src/object/gentariCurtain.c @@ -7,7 +7,6 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "object.h" #include "room.h" #include "tiles.h" diff --git a/src/object/giantBookLadder.c b/src/object/giantBookLadder.c index cce94fad..d0d602c5 100644 --- a/src/object/giantBookLadder.c +++ b/src/object/giantBookLadder.c @@ -6,6 +6,8 @@ */ #include "map.h" #include "object.h" +#include "asm.h" +#include "room.h" #include "tiles.h" #include "game.h" diff --git a/src/object/giantLeaf.c b/src/object/giantLeaf.c index 6293a9d0..3dc3cda8 100644 --- a/src/object/giantLeaf.c +++ b/src/object/giantLeaf.c @@ -6,6 +6,8 @@ */ #include "map.h" #include "object.h" +#include "asm.h" +#include "room.h" void sub_0808D618(Entity* this); diff --git a/src/object/giantTwig.c b/src/object/giantTwig.c index 00beda17..eead81c1 100644 --- a/src/object/giantTwig.c +++ b/src/object/giantTwig.c @@ -4,8 +4,11 @@ * * @brief Giant Twig object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/gleerokParticle.c b/src/object/gleerokParticle.c index 7af41d2f..5cac9ce0 100644 --- a/src/object/gleerokParticle.c +++ b/src/object/gleerokParticle.c @@ -7,9 +7,9 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "physics.h" #include "player.h" #include "room.h" diff --git a/src/object/graveyardKey.c b/src/object/graveyardKey.c index 577d4b09..45549be8 100644 --- a/src/object/graveyardKey.c +++ b/src/object/graveyardKey.c @@ -9,10 +9,11 @@ #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "item.h" #include "player.h" #include "sound.h" +#include "scroll.h" typedef struct _struct_gUnk_08123FB0 { void (*const funcEnt)(Entity*); diff --git a/src/object/greatFairy.c b/src/object/greatFairy.c index 3099571c..366dff46 100644 --- a/src/object/greatFairy.c +++ b/src/object/greatFairy.c @@ -6,6 +6,12 @@ */ #include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "save.h" #include "screen.h" #include "script.h" diff --git a/src/object/guruguruBar.c b/src/object/guruguruBar.c index 40fa7d41..d6e9ebc0 100644 --- a/src/object/guruguruBar.c +++ b/src/object/guruguruBar.c @@ -4,9 +4,8 @@ * * @brief Guruguru Bar object */ -#include "entity.h" -#include "functions.h" #include "object.h" +#include "physics.h" #include "projectile.h" #include "room.h" diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index c04e6eaa..c32f6770 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -4,14 +4,23 @@ * * @brief Gyorg Boss object */ -#include "area.h" #include "enemy/gyorg.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "physics.h" +#include "player.h" #include "room.h" #include "screen.h" #include "screenTransitions.h" +#include "scroll.h" +#ifndef EU +#include "area.h" +#endif struct GyorgChildSpawns { s16 offsetX; diff --git a/src/object/heartContainer.c b/src/object/heartContainer.c index dce47c6b..732f9475 100644 --- a/src/object/heartContainer.c +++ b/src/object/heartContainer.c @@ -10,6 +10,7 @@ #include "functions.h" #include "item.h" #include "sound.h" +#include "scroll.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c index 9239c39f..0cdf073e 100644 --- a/src/object/hiddenLadderDown.c +++ b/src/object/hiddenLadderDown.c @@ -7,7 +7,7 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "room.h" #include "tiles.h" typedef struct { diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index a2d97301..2fc017d2 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -4,8 +4,12 @@ * * @brief Hittable Lever object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index 79ecf0d8..0e64d308 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -6,9 +6,11 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "main.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "player.h" #include "room.h" #include "script.h" #include "sound.h" diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c index f2a51b32..6648f24e 100644 --- a/src/object/houseDoorInterior.c +++ b/src/object/houseDoorInterior.c @@ -6,9 +6,10 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "player.h" #include "npc.h" #include "sound.h" +#include "asm.h" typedef struct { Entity base; diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index cb37efd5..228dda8d 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -6,10 +6,13 @@ */ #include "object/itemForSale.h" -#include "functions.h" #include "hitbox.h" -#include "kinstone.h" #include "message.h" +#include "scroll.h" +#include "asm.h" +#include "structures.h" +#include "room.h" +#include "player.h" typedef struct { u8 before[0x20]; diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c index fe61aa2a..e74438e4 100644 --- a/src/object/itemOnGround.c +++ b/src/object/itemOnGround.c @@ -8,11 +8,14 @@ #include "collision.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "scroll.h" #include "hitbox.h" #include "item.h" #include "itemMetaData.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/jailBars.c b/src/object/jailBars.c index dd4d7bcc..8644a134 100644 --- a/src/object/jailBars.c +++ b/src/object/jailBars.c @@ -6,7 +6,7 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "beanstalkSubtask.h" #include "room.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/japaneseSubtitle.c b/src/object/japaneseSubtitle.c index 11e7f85f..5a14192e 100644 --- a/src/object/japaneseSubtitle.c +++ b/src/object/japaneseSubtitle.c @@ -4,9 +4,9 @@ * * @brief Japanese Subtitle object */ -#include "entity.h" #include "menu.h" #include "object.h" +#include "asm.h" #include "physics.h" extern void sub_0806FB00(Entity*, u32, u32, u32); diff --git a/src/object/jarPortal.c b/src/object/jarPortal.c index 99341c30..9741c9d8 100644 --- a/src/object/jarPortal.c +++ b/src/object/jarPortal.c @@ -5,9 +5,15 @@ * @brief Jar Portal object */ #include "area.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "tiles.h" +#include "effects.h" typedef struct { /*0x00*/ Entity base; @@ -134,7 +140,7 @@ void sub_0808C01C(JarPortalEntity* this, u32 r1) { gArea.portal_mode = 3; } } - CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); + CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); if (super->subtimer == 0) { super->subtimer = 1; SoundReq(SFX_NEAR_PORTAL); diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c index dfd35e6a..000bc605 100644 --- a/src/object/keyStealingTakkuri.c +++ b/src/object/keyStealingTakkuri.c @@ -4,8 +4,14 @@ * * @brief Key Stealing Takkuri object */ -#include "functions.h" +#include "script.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/kinstoneSpark.c b/src/object/kinstoneSpark.c index b32609f2..afc05722 100644 --- a/src/object/kinstoneSpark.c +++ b/src/object/kinstoneSpark.c @@ -4,9 +4,11 @@ * * @brief Kinstone Fusion Particle object */ -#include "functions.h" +#include "script.h" #include "kinstone.h" #include "object.h" +#include "asm.h" +#include "sound.h" void sub_080A0ADC(Entity*); void sub_080A0AF0(Entity*); diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c index 8dcd7e67..b64d56d2 100644 --- a/src/object/ladderUp.c +++ b/src/object/ladderUp.c @@ -7,7 +7,6 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "player.h" #include "room.h" #include "sound.h" diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c index 5e806494..9624b606 100644 --- a/src/object/lavaPlatform.c +++ b/src/object/lavaPlatform.c @@ -4,9 +4,14 @@ * * @brief Lava Platform object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/lightDoor.c b/src/object/lightDoor.c index ebce1433..522084a0 100644 --- a/src/object/lightDoor.c +++ b/src/object/lightDoor.c @@ -4,8 +4,11 @@ * * @brief Light Door object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "room.h" +#include "physics.h" #include "screen.h" #include "tiles.h" diff --git a/src/object/lightRay.c b/src/object/lightRay.c index a48ffa53..6ad499d3 100644 --- a/src/object/lightRay.c +++ b/src/object/lightRay.c @@ -4,8 +4,11 @@ * * @brief Light Ray object */ -#include "functions.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "screen.h" typedef struct { diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index 250fd2ae..a8ed21cb 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -7,9 +7,9 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "physics.h" #include "room.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 9a7458b3..6da49a41 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -6,12 +6,19 @@ */ #include "object/lilypadLarge.h" #include "area.h" -#include "functions.h" #include "item.h" #include "object.h" -#include "map.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "scroll.h" +extern u32 sub_080040A2(Entity*); extern s8 gUnk_08126EE4[]; void LilypadLarge_Action1(LilypadLargeEntity*); @@ -119,7 +126,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) { if (super->subtimer == 0) { super->subtimer = 4; while (super->subtimer != 0) { - sub_080A2AF4(super, 8, 10); + CreateLargeRippleFxRandom(super, 8, 10); super->subtimer--; } super->subtimer = 1; @@ -194,7 +201,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) { } if ((gRoomTransition.frameCount & 0xfU) == 0) { - CreateLargeWaterTrace(super); + CreateLargeRippleFx(super); } sVar10 = super->x.WORD + this->unk_6c; uVar4 = super->y.WORD + this->unk_70; @@ -312,7 +319,7 @@ void LilypadLarge_Action1(LilypadLargeEntity* this) { } else { end: if ((gRoomTransition.frameCount & 0x1fU) == 0) { - sub_080A2AF4(super, 8, 10); + CreateLargeRippleFxRandom(super, 8, 10); } } sub_08085F48(this); @@ -403,7 +410,7 @@ void sub_08085B40(LilypadLargeEntity* this) { super->action = 1; super->subtimer = 4; while (super->subtimer != 0) { - sub_080A2AF4(super, 8, 10); + CreateLargeRippleFxRandom(super, 8, 10); super->subtimer--; } super->subtimer = 1; diff --git a/src/object/lilypadLargeFalling.c b/src/object/lilypadLargeFalling.c index d0b19b12..791f13dd 100644 --- a/src/object/lilypadLargeFalling.c +++ b/src/object/lilypadLargeFalling.c @@ -5,7 +5,6 @@ * @brief LilypadLargeFalling object */ #include "entity.h" -#include "functions.h" #include "object/lilypadLarge.h" void LilypadLargeFalling(Entity* this) { diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index 2d92e4f0..12696e21 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -4,8 +4,10 @@ * * @brief Lilypad Small object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/linkAnimation.c b/src/object/linkAnimation.c index 71e1a494..75054314 100644 --- a/src/object/linkAnimation.c +++ b/src/object/linkAnimation.c @@ -5,10 +5,13 @@ * @brief Link Animation object. This is used during "item get" sequences and * replaces the player entity for the duration. */ -#include "functions.h" #include "message.h" #include "object.h" +#include "physics.h" +#include "player.h" #include "object/linkAnimation.h" +#include "item.h" +#include "structures.h" typedef enum { ITEMGET_INIT, diff --git a/src/object/linkEmptyingBottle.c b/src/object/linkEmptyingBottle.c index 0b4200a7..93e35f16 100644 --- a/src/object/linkEmptyingBottle.c +++ b/src/object/linkEmptyingBottle.c @@ -5,9 +5,13 @@ * @brief Link Emptying Bottle object * Handles effects of using water, mineral water or a fairy in a bottle in PlayerItemBottle_UseOther. */ -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/linkFire.c b/src/object/linkFire.c index 1a12c93f..b208398f 100644 --- a/src/object/linkFire.c +++ b/src/object/linkFire.c @@ -4,8 +4,9 @@ * * @brief Link Fire object */ -#include "functions.h" #include "object.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/linkHoldingItem.c b/src/object/linkHoldingItem.c index 6e5bedd2..c0920698 100644 --- a/src/object/linkHoldingItem.c +++ b/src/object/linkHoldingItem.c @@ -4,12 +4,14 @@ * * @brief Link Holding Item object */ -#include "functions.h" +#include "scroll.h" #include "game.h" #include "item.h" #include "itemMetaData.h" #include "message.h" #include "object.h" +#include "sound.h" +#include "player.h" #include "save.h" typedef struct { diff --git a/src/object/litArea.c b/src/object/litArea.c index 93129db4..80332d9a 100644 --- a/src/object/litArea.c +++ b/src/object/litArea.c @@ -6,7 +6,6 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "room.h" #include "screen.h" diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index c1419e1d..5eaee228 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -4,16 +4,19 @@ * * @brief Looked Door object */ +#include "object/lockedDoor.h" #include "asm.h" -#include "common.h" +#include "room.h" #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "game.h" #include "hitbox.h" #include "sound.h" #include "tiles.h" +#include "vram.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/macroAcorn.c b/src/object/macroAcorn.c index 76773942..0fb1ac7b 100644 --- a/src/object/macroAcorn.c +++ b/src/object/macroAcorn.c @@ -7,6 +7,8 @@ #include "entity.h" #include "map.h" #include "object.h" +#include "asm.h" +#include "room.h" #include "physics.h" #include "tiles.h" diff --git a/src/object/macroBook.c b/src/object/macroBook.c index 2b43af8b..10270a6c 100644 --- a/src/object/macroBook.c +++ b/src/object/macroBook.c @@ -7,9 +7,10 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "player.h" #include "npc.h" #include "tiles.h" +#include "room.h" typedef struct { Entity base; diff --git a/src/object/macroMushroomStalk.c b/src/object/macroMushroomStalk.c index 45eb8fe0..185d1de1 100644 --- a/src/object/macroMushroomStalk.c +++ b/src/object/macroMushroomStalk.c @@ -5,10 +5,11 @@ * @brief Macro Mushroom Stalk object */ #include "area.h" -#include "entity.h" #include "main.h" #include "object.h" +#include "room.h" #include "sound.h" +#include "structures.h" void MacroMushroomStalk_Init(Entity*); void MacroMushroomStalk_Action1(Entity*); diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c index a313729b..76dbc3c7 100644 --- a/src/object/macroPlayer.c +++ b/src/object/macroPlayer.c @@ -8,8 +8,10 @@ #include "entity.h" #include "functions.h" #include "object.h" +#include "asm.h" #include "physics.h" #include "player.h" +#include "structures.h" typedef struct { Entity base; diff --git a/src/object/mask.c b/src/object/mask.c index d2b5c2a8..284c5c1f 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -4,9 +4,15 @@ * * @brief Mask object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "player.h" #include "tiles.h" +#include "item.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/mazaalBossObject.c b/src/object/mazaalBossObject.c index 9fc03361..1a487226 100644 --- a/src/object/mazaalBossObject.c +++ b/src/object/mazaalBossObject.c @@ -5,13 +5,15 @@ * @brief Mazaal Boss object */ #include "enemy.h" -#include "entity.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "flags.h" +#include "physics.h" #include "player.h" #include "room.h" #include "screen.h" +#include "scroll.h" +#include "script.h" #include "sound.h" extern u16 script_MazaalBossObjectMazaal[]; diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 58e01766..3281ff53 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -4,11 +4,12 @@ * * @brief Metal Door object */ +#include "object/lockedDoor.h" #include "asm.h" #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" +#include "physics.h" #include "hitbox.h" #include "room.h" #include "sound.h" @@ -28,7 +29,6 @@ typedef struct { /*0x86*/ u16 flag2; } MetalDoorEntity; -extern u32 sub_08083734(Entity*, u32); void sub_080A080C(MetalDoorEntity* this); void sub_080A0870(MetalDoorEntity* this); void MetalDoor_Init(MetalDoorEntity* this); diff --git a/src/object/minecart.c b/src/object/minecart.c index 6d101de6..207fa4dd 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -4,9 +4,14 @@ * * @brief Minecart object */ -#include "functions.h" +#include "collision.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/minecartDoor.c b/src/object/minecartDoor.c index a4ef3d59..274b34db 100644 --- a/src/object/minecartDoor.c +++ b/src/object/minecartDoor.c @@ -4,8 +4,14 @@ * * @brief Minecart Door object */ -#include "functions.h" +#include "object/lockedDoor.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c index 3692821b..dd602e0d 100644 --- a/src/object/mineralWaterSource.c +++ b/src/object/mineralWaterSource.c @@ -5,6 +5,8 @@ * @brief Mineral Water Source object */ #include "object.h" +#include "asm.h" +#include "physics.h" void MineralWaterSource_Init(Entity*); void MineralWaterSource_Action1(Entity*); diff --git a/src/object/minishEmoticon.c b/src/object/minishEmoticon.c index 147ca51d..40cb3a78 100644 --- a/src/object/minishEmoticon.c +++ b/src/object/minishEmoticon.c @@ -5,7 +5,8 @@ * @brief Minish Emoticon object */ #include "entity.h" -#include "functions.h" +#include "vram.h" +#include "player.h" void MinishEmoticon_Init(Entity*); void MinishEmoticon_Action1(Entity*); diff --git a/src/object/minishPortalCloseup.c b/src/object/minishPortalCloseup.c index e9ded723..ec7232f9 100644 --- a/src/object/minishPortalCloseup.c +++ b/src/object/minishPortalCloseup.c @@ -5,9 +5,10 @@ * @brief Minish Portal Closeup object */ #include "area.h" -#include "functions.h" #include "main.h" #include "object.h" +#include "common.h" +#include "room.h" #include "screen.h" #include "structures.h" diff --git a/src/object/minishPortalStone.c b/src/object/minishPortalStone.c index e4d92872..ba1699d5 100644 --- a/src/object/minishPortalStone.c +++ b/src/object/minishPortalStone.c @@ -5,9 +5,16 @@ * @brief Minish Portal Stone object */ #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "screen.h" +#include "beanstalkSubtask.h" #include "manager/lightManager.h" -#include "functions.h" +#include "effects.h" +#include "structures.h" typedef struct { /*0x00*/ Entity base; @@ -68,7 +75,7 @@ void MinishPortalStone_Action3(MinishPortalStoneEntity* this) { u32 tmp; SetPriorityTimer(30); sub_0800445C(super); - CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); + CreateMagicSparklesFxAt(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer); if (--super->timer == 0) { super->timer = 8; tmp = ++super->subtimer; diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index cbe61fc8..b7819429 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -4,9 +4,12 @@ * * @brief MinishSizedEntrance object */ -#include "functions.h" #include "game.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" +#include "vram.h" void MinishSizedEntrance_Action1(Entity*); void MinishSizedEntrance_Init(Entity*); diff --git a/src/object/minishVillageObject.c b/src/object/minishVillageObject.c index b7d09356..c42a598c 100644 --- a/src/object/minishVillageObject.c +++ b/src/object/minishVillageObject.c @@ -4,8 +4,12 @@ * * @brief Minish Village Object object */ -#include "functions.h" +#include "script.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" #include "screen.h" #include "tiles.h" diff --git a/src/object/moleMittsParticle.c b/src/object/moleMittsParticle.c index f83472bc..1d243967 100644 --- a/src/object/moleMittsParticle.c +++ b/src/object/moleMittsParticle.c @@ -5,8 +5,10 @@ * @brief Mole Mitts Particle object */ #include "area.h" -#include "functions.h" #include "object.h" +#include "room.h" +#include "player.h" +#include "item.h" void MoleMittsParticle_Init(Entity*); void MoleMittsParticle_Action1(Entity*); diff --git a/src/object/object1F.c b/src/object/object1F.c index 444f616a..bbe7e166 100644 --- a/src/object/object1F.c +++ b/src/object/object1F.c @@ -4,10 +4,10 @@ * * @brief Object1F object */ +#include "object.h" #include "asm.h" #include "effects.h" -#include "entity.h" -#include "functions.h" +#include "physics.h" #include "player.h" #include "tiles.h" diff --git a/src/object/object30.c b/src/object/object30.c index 3f31e5e3..8b4290a0 100644 --- a/src/object/object30.c +++ b/src/object/object30.c @@ -5,9 +5,11 @@ * @brief Object30 object */ #include "collision.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "scroll.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/object37.c b/src/object/object37.c index 35f32e93..14d3d89f 100644 --- a/src/object/object37.c +++ b/src/object/object37.c @@ -4,8 +4,10 @@ * * @brief Object37 object */ -#include "entity.h" -#include "functions.h" +#include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" #include "item.h" #include "save.h" diff --git a/src/object/object53.c b/src/object/object53.c index 737c8967..94cc73cd 100644 --- a/src/object/object53.c +++ b/src/object/object53.c @@ -4,9 +4,9 @@ * * @brief Object53 object */ +#include "object.h" #include "asm.h" -#include "entity.h" -#include "functions.h" +#include "effects.h" void Object53_Init(Entity*); void Object53_Action1(Entity*); diff --git a/src/object/object63.c b/src/object/object63.c index bbf74160..8557fb2f 100644 --- a/src/object/object63.c +++ b/src/object/object63.c @@ -4,10 +4,9 @@ * * @brief Object63 object */ -#include "asm.h" -#include "entity.h" -#include "functions.h" #include "object.h" +#include "physics.h" +#include "item.h" void Object63_Init(Entity*); void Object63_Action1(Entity*); diff --git a/src/object/object70.c b/src/object/object70.c index 605e074b..5064feb1 100644 --- a/src/object/object70.c +++ b/src/object/object70.c @@ -4,8 +4,10 @@ * * @brief Object70 object */ -#include "functions.h" +#include "asm.h" #include "object.h" +#include "effects.h" +#include "player.h" void Object70_Init(Entity*); void Object70_Action1(Entity*); diff --git a/src/object/objectA.c b/src/object/objectA.c index 6aa82e40..c0af01b5 100644 --- a/src/object/objectA.c +++ b/src/object/objectA.c @@ -6,11 +6,12 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "game.h" #include "hitbox.h" #include "object.h" +#include "effects.h" #include "room.h" +#include "player.h" #include "tiles.h" typedef struct { @@ -47,7 +48,7 @@ void ObjectA(ObjectAEntity* this) { } else if (super->interactType != INTERACTION_NONE) { SetTileType(this->unk_70, COORD_TO_TILE(super), super->collisionLayer); SetFlag(this->flag); - CreateDust(super); + CreateDeathFx(super); ModDungeonKeys(-1); DeleteThisEntity(); } diff --git a/src/object/objectA2.c b/src/object/objectA2.c index d73db1f5..f6e3c473 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -4,10 +4,13 @@ * * @brief Object A2 object */ -#include "functions.h" #include "menu.h" #include "object.h" -#include "structures.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "physics.h" +#include "save.h" void ObjectA2_Init(Entity*); void ObjectA2_Action1(Entity*); diff --git a/src/object/objectA8.c b/src/object/objectA8.c index 434e04c0..b1c68fb1 100644 --- a/src/object/objectA8.c +++ b/src/object/objectA8.c @@ -5,10 +5,15 @@ * @brief ObjectA8 object */ #include "collision.h" -#include "functions.h" #include "hitbox.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "scroll.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/objectBlockingStairs.c b/src/object/objectBlockingStairs.c index 76ff017f..014485da 100644 --- a/src/object/objectBlockingStairs.c +++ b/src/object/objectBlockingStairs.c @@ -8,8 +8,10 @@ #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/objectOnPillar.c b/src/object/objectOnPillar.c index f48d7bcd..3d7b8c56 100644 --- a/src/object/objectOnPillar.c +++ b/src/object/objectOnPillar.c @@ -4,9 +4,15 @@ * * @brief Object on Pillar object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/objectOnSpinyBeetle.c b/src/object/objectOnSpinyBeetle.c index 52c575ca..20db5ff0 100644 --- a/src/object/objectOnSpinyBeetle.c +++ b/src/object/objectOnSpinyBeetle.c @@ -4,8 +4,11 @@ * * @brief Object on Spiny Beetle object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index ed704166..39dc5cf4 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -4,9 +4,16 @@ * * @brief Octorok Boss Object object */ -#include "functions.h" #include "game.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct HelperStruct { u8 field_0x0; // [0,1,2,4] is later stored in super->subtimer diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c index bcf23fb2..4d48b1db 100644 --- a/src/object/palaceArchway.c +++ b/src/object/palaceArchway.c @@ -5,6 +5,8 @@ * @brief Palace Archway object */ #include "object.h" +#include "asm.h" +#include "room.h" #include "tiles.h" void PalaceArchway_Init(Entity*); diff --git a/src/object/paper.c b/src/object/paper.c index eb2af45d..05529683 100644 --- a/src/object/paper.c +++ b/src/object/paper.c @@ -4,9 +4,11 @@ * * @brief Paper object */ -#include "functions.h" #include "map.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" #include "tiles.h" void Paper_Init(Entity*); diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c index ca6bfcd5..cb9a0478 100644 --- a/src/object/pinwheel.c +++ b/src/object/pinwheel.c @@ -7,6 +7,14 @@ #include "entity.h" #include "flags.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; @@ -51,7 +59,7 @@ void Pinwheel_Init(PinwheelEntity* this) { void Pinwheel_Action1(PinwheelEntity* this) { if (CheckLocalFlag(this->flag) != 0) { super->action = 2; - CreateDust(super); + CreateDeathFx(super); } } void Pinwheel_Action2(PinwheelEntity* this) { diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 174b7a1d..f606108c 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -8,7 +8,7 @@ #include "collision.h" #include "effects.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "player.h" #include "room.h" #include "sound.h" diff --git a/src/object/pot.c b/src/object/pot.c index e61b94fd..8dda49f9 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -6,9 +6,12 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" +#include "object/pot.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" #include "object/itemOnGround.h" #include "player.h" #include "room.h" diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c index df373091..68c17a1d 100644 --- a/src/object/pressurePlate.c +++ b/src/object/pressurePlate.c @@ -5,9 +5,12 @@ * @brief Pressure Plate object */ #include "collision.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" typedef struct { Entity base; diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c index c8f9b086..f986123c 100644 --- a/src/object/pullableLever.c +++ b/src/object/pullableLever.c @@ -4,9 +4,12 @@ * * @brief Pullable Lever object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "physics.h" +#include "player.h" #include "sound.h" typedef struct { diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index 44d17deb..f8136808 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -4,10 +4,14 @@ * * @brief Pullable Mushroom object */ -#include "functions.h" #include "game.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c index b976bdcb..28e1f6bf 100644 --- a/src/object/pushableFurniture.c +++ b/src/object/pushableFurniture.c @@ -6,8 +6,13 @@ */ #include "object/pushableFurniture.h" -#include "functions.h" #include "tiles.h" +#include "flags.h" +#include "sound.h" +#include "asm.h" +#include "room.h" +#include "player.h" +#include "physics.h" extern const s16 gUnk_080B4488[]; diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c index 4ba81982..e059b866 100644 --- a/src/object/pushableGrave.c +++ b/src/object/pushableGrave.c @@ -4,9 +4,15 @@ * * @brief Pushable Grave object */ -#include "functions.h" +#include "beanstalkSubtask.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/pushableLever.c b/src/object/pushableLever.c index 592a51e2..fb523054 100644 --- a/src/object/pushableLever.c +++ b/src/object/pushableLever.c @@ -4,8 +4,12 @@ * * @brief Pushable Lever object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c index f58afa79..f2401fab 100644 --- a/src/object/pushableRock.c +++ b/src/object/pushableRock.c @@ -4,8 +4,12 @@ * * @brief Pushable Rock object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" #include "tiles.h" typedef struct { diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c index 35fbb3bd..bda7a547 100644 --- a/src/object/pushableStatue.c +++ b/src/object/pushableStatue.c @@ -5,10 +5,16 @@ * @brief Pushable Statue object */ #include "area.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" +#include "vram.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/railtrack.c b/src/object/railtrack.c index a775f6d3..2456f4c1 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -7,7 +7,6 @@ #include "asm.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "room.h" #include "sound.h" #include "tiles.h" diff --git a/src/object/rotatingTrapdoor.c b/src/object/rotatingTrapdoor.c index 3351b1d7..b6b5f587 100644 --- a/src/object/rotatingTrapdoor.c +++ b/src/object/rotatingTrapdoor.c @@ -6,7 +6,7 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" +#include "player.h" #include "room.h" #include "sound.h" diff --git a/src/object/rupee.c b/src/object/rupee.c index 49ff7835..22059aed 100644 --- a/src/object/rupee.c +++ b/src/object/rupee.c @@ -4,9 +4,10 @@ * * @brief Rupee object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "physics.h" void sub_08086A6C(Entity*); void Rupee_Init(Entity*); diff --git a/src/object/shrinkingHieroglyphs.c b/src/object/shrinkingHieroglyphs.c index c490b834..d8b34eea 100644 --- a/src/object/shrinkingHieroglyphs.c +++ b/src/object/shrinkingHieroglyphs.c @@ -5,9 +5,10 @@ * @brief Shrinking Hieroglyphs object */ #include "entity.h" -#include "functions.h" #include "player.h" #include "sound.h" +#include "vram.h" +#include "physics.h" typedef struct { Entity base; diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index 16178fa3..dfde7891 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -9,6 +9,12 @@ #include "hitbox.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "tiles.h" typedef struct { diff --git a/src/object/smoke.c b/src/object/smoke.c index 62b4d1ac..534d91c2 100644 --- a/src/object/smoke.c +++ b/src/object/smoke.c @@ -5,6 +5,8 @@ * @brief Smoke object */ #include "object.h" +#include "asm.h" +#include "physics.h" void Smoke_Type0(Entity*); void Smoke_Type1(Entity*); diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c index ac05de1f..52aef4f4 100644 --- a/src/object/smokeParticle.c +++ b/src/object/smokeParticle.c @@ -4,8 +4,11 @@ * * @brief Smoke Particle object */ -#include "functions.h" +#include "collision.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "room.h" #include "tiles.h" void SmokeParticle_Init(Entity*); diff --git a/src/object/specialFx.c b/src/object/specialFx.c index cdd72a0b..a580acfc 100644 --- a/src/object/specialFx.c +++ b/src/object/specialFx.c @@ -5,8 +5,14 @@ * @brief Special FX object */ #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" +#include "item.h" typedef struct { Entity base; diff --git a/src/object/stoneTablet.c b/src/object/stoneTablet.c index 99e45cbe..efd6bbfe 100644 --- a/src/object/stoneTablet.c +++ b/src/object/stoneTablet.c @@ -5,9 +5,9 @@ * @brief Stone Tablet object */ #include "entity.h" -#include "functions.h" #include "room.h" #include "tiles.h" +#include "beanstalkSubtask.h" void StoneTablet_Init(Entity*); void StoneTablet_Action1(Entity*); diff --git a/src/object/swordParticle.c b/src/object/swordParticle.c index f86879a0..d5232947 100644 --- a/src/object/swordParticle.c +++ b/src/object/swordParticle.c @@ -4,9 +4,13 @@ * * @brief Sword Particle object */ -#include "functions.h" #include "item.h" #include "object.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c index bc17266a..2afc5657 100644 --- a/src/object/swordsmanNewsletter.c +++ b/src/object/swordsmanNewsletter.c @@ -6,6 +6,7 @@ */ #include "entity.h" #include "message.h" +#include "player.h" extern void AddInteractableCheckableObject(Entity*); void SwordsmanNewsletter_Init(Entity*); diff --git a/src/object/thunderbolt.c b/src/object/thunderbolt.c index 543c08c4..312b1306 100644 --- a/src/object/thunderbolt.c +++ b/src/object/thunderbolt.c @@ -4,8 +4,11 @@ * * @brief Thunderbolt object */ -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/titleScreenObject.c b/src/object/titleScreenObject.c index dc94e9fc..fa199270 100644 --- a/src/object/titleScreenObject.c +++ b/src/object/titleScreenObject.c @@ -4,8 +4,8 @@ * * @brief Title Screen object */ -#include "functions.h" #include "object.h" +#include "asm.h" void TitleScreenObject_Type0(Entity*); void TitleScreenObject_Type1(Entity*); diff --git a/src/object/trapdoor.c b/src/object/trapdoor.c index 809643dd..1704c770 100644 --- a/src/object/trapdoor.c +++ b/src/object/trapdoor.c @@ -6,6 +6,10 @@ */ #include "item.h" #include "object.h" +#include "asm.h" +#include "flags.h" +#include "physics.h" +#include "player.h" void sub_08099ECC(Entity*); void Trapdoor_Init(Entity*); diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index 99d04565..da087e26 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -7,12 +7,13 @@ #include "effects.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "object.h" +#include "asm.h" #include "player.h" #include "room.h" #include "sound.h" #include "tiles.h" +#include "kinstone.h" typedef struct { /*0x00*/ Entity base; @@ -56,7 +57,7 @@ void TreeHidingPortal_Action1(TreeHidingPortalEntity* this) { if (sub_0800419C(super, &gPlayerEntity.base, 0x30, 0x30)) { if (CheckGlobalFlag(EZERO_1ST)) { if (((gRoomTransition.frameCount & 3) == 0)) { - CreateSparkle(super); + CreateSparkleFx(super); } } } diff --git a/src/object/treeThorns.c b/src/object/treeThorns.c index 3fe27355..3c7b9f06 100644 --- a/src/object/treeThorns.c +++ b/src/object/treeThorns.c @@ -7,6 +7,7 @@ #include "entity.h" #include "hitbox.h" #include "object.h" +#include "asm.h" #include "physics.h" #include "room.h" #include "tiles.h" diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c index b2b9def3..5198aeba 100644 --- a/src/object/unusedSkull.c +++ b/src/object/unusedSkull.c @@ -4,9 +4,13 @@ * * @brief Unused Skull object */ -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" #include "tiles.h" typedef struct { diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index dfd66d1b..9c263eea 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -4,10 +4,15 @@ * * @brief Warp Point object */ -#include "functions.h" #include "game.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/object/waterDropObject.c b/src/object/waterDropObject.c index 056afa57..b4dbec44 100644 --- a/src/object/waterDropObject.c +++ b/src/object/waterDropObject.c @@ -5,7 +5,6 @@ * @brief Water Drop object */ #include "entity.h" -#include "functions.h" void WaterDropObject(Entity* this) { u32 iVar2; diff --git a/src/object/waterElement.c b/src/object/waterElement.c index 6f55a27c..4ff3d9fa 100644 --- a/src/object/waterElement.c +++ b/src/object/waterElement.c @@ -4,7 +4,6 @@ * * @brief Water Element object */ -#include "functions.h" #include "object.h" void WaterElement_Init(Entity*); diff --git a/src/object/waterfallOpening.c b/src/object/waterfallOpening.c index c63c937a..a3986be0 100644 --- a/src/object/waterfallOpening.c +++ b/src/object/waterfallOpening.c @@ -6,11 +6,11 @@ */ #include "entity.h" #include "flags.h" -#include "functions.h" #include "menu.h" #include "room.h" #include "sound.h" #include "tiles.h" +#include "vram.h" typedef struct { Entity base; diff --git a/src/object/well.c b/src/object/well.c index 0e19e21a..9fa5860d 100644 --- a/src/object/well.c +++ b/src/object/well.c @@ -6,7 +6,6 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" #include "player.h" #include "room.h" #include "tiles.h" diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c index add24319..16dca27d 100644 --- a/src/object/whirlwind.c +++ b/src/object/whirlwind.c @@ -5,9 +5,14 @@ * @brief Whirlwind object */ #include "area.h" -#include "functions.h" +#include "script.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "physics.h" +#include "player.h" void Whirlwind_Init(Entity*); void Whirlwind_Action1(Entity*); diff --git a/src/object/whiteTriangleEffect.c b/src/object/whiteTriangleEffect.c index 2d7f24e3..ce12c336 100644 --- a/src/object/whiteTriangleEffect.c +++ b/src/object/whiteTriangleEffect.c @@ -4,8 +4,9 @@ * * @brief White Triangle Effect object */ -#include "functions.h" #include "object.h" +#include "common.h" +#include "room.h" #include "screen.h" typedef struct { diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c index 99b8572f..deac4c39 100644 --- a/src/object/windTribeFlag.c +++ b/src/object/windTribeFlag.c @@ -5,6 +5,7 @@ * @brief Wind Tribe Flag object */ #include "object.h" +#include "asm.h" void WindTribeFlag(Entity* this) { if (this->action == 0) { diff --git a/src/object/windTribeTeleporter.c b/src/object/windTribeTeleporter.c index 5a238478..70d84512 100644 --- a/src/object/windTribeTeleporter.c +++ b/src/object/windTribeTeleporter.c @@ -5,10 +5,15 @@ * @brief Wind Tribe Teleporter object */ #include "collision.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "sound.h" +#include "room.h" +#include "player.h" #include "screenTransitions.h" +#if defined(DEMO_JP) || defined(USA) || defined(DEMO_USA) +#include "flags.h" +#endif typedef struct { /*0x00*/ Entity base; diff --git a/src/object/windcrest.c b/src/object/windcrest.c index ad1b63a3..5ac537c0 100644 --- a/src/object/windcrest.c +++ b/src/object/windcrest.c @@ -6,7 +6,7 @@ */ #include "effects.h" #include "entity.h" -#include "functions.h" +#include "structures.h" #include "save.h" #include "script.h" #include "sound.h" diff --git a/src/objectUtils.c b/src/objectUtils.c index e00c62d4..54883afd 100644 --- a/src/objectUtils.c +++ b/src/objectUtils.c @@ -1,17 +1,18 @@ - -#include "global.h" #include "entity.h" #include "physics.h" #include "room.h" #include "object.h" -#include "functions.h" +#include "asm.h" +#include "effects.h" +#include "player.h" +#include "structures.h" #include "definitions.h" +#include "vram.h" #include "object/linkAnimation.h" #include "object/itemOnGround.h" extern const Hitbox* const gObjectHitboxes[]; -u32 LoadObjectSprite(Entity* this, s32 type, const ObjectDefinition* definition); extern const ObjectDefinition gObjectDefinitions[]; static Entity* CreateSpeechBubble(Entity*, u32, s32, s32); @@ -119,20 +120,20 @@ u32 LoadObjectSprite(Entity* this, s32 type, const ObjectDefinition* definition) return 2; } -Entity* CreateObject(u32 subtype, u32 form, u32 type2) { +Entity* CreateObject(Object id, u32 type, u32 type2) { Entity* entity = GetEmptyEntity(); if (entity != NULL) { entity->kind = OBJECT; - entity->id = subtype; - entity->type = form; + entity->id = id; + entity->type = type; entity->type2 = type2; AppendEntityToList(entity, 6); } return entity; } -Entity* CreateObjectWithParent(Entity* parent, u32 subtype, u32 form, u32 type2) { - Entity* entity = CreateObject(subtype, form, type2); +Entity* CreateObjectWithParent(Entity* parent, Object id, u32 type, u32 type2) { + Entity* entity = CreateObject(id, type, type2); if (entity != NULL) { entity->parent = parent; CopyPosition(parent, entity); @@ -141,15 +142,15 @@ Entity* CreateObjectWithParent(Entity* parent, u32 subtype, u32 form, u32 type2) return entity; } -Entity* CreateFx(Entity* parentEnt, u32 form, u32 parameter) { - return CreateObjectWithParent(parentEnt, SPECIAL_FX, form, parameter); +Entity* CreateFx(Entity* parentEnt, Effect type, u32 type2) { + return CreateObjectWithParent(parentEnt, SPECIAL_FX, type, type2); } -void CreateDust(Entity* parent) { +void CreateDeathFx(Entity* parent) { CreateFx(parent, FX_DEATH, 0); } -void CreateDustAt(s32 xOff, s32 yOff, u32 layer) { +void CreateDeathFxAt(s32 xOff, s32 yOff, u32 layer) { Entity* ent; ent = CreateObject(SPECIAL_FX, FX_DEATH, 0); @@ -160,32 +161,32 @@ void CreateDustAt(s32 xOff, s32 yOff, u32 layer) { } } -void CreateDustSmall(Entity* parent) { +void CreateDashFx(Entity* parent) { CreateFx(parent, FX_DASH, 0); } -void CreateExplosionBroken(Entity* parent) { +void CreateExplosionBrokenFx(Entity* parent) { CreateFx(parent, FX_6, 0); } -void CreateWaterSplash(Entity* parent) { +void CreateWaterSplashFx(Entity* parent) { CreateFx(parent, FX_WATER_SPLASH, 0); } -Entity* CreateGroundItem(Entity* parent, u32 form, u32 subtype) { +Entity* CreateGroundItem(Entity* parent, u32 item, u32 subvalue) { Entity* ent; - ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype); + ent = CreateObjectWithParent(parent, GROUND_ITEM, item, subvalue); if (ent != NULL) { ent->timer = 5; } return ent; } -Entity* CreateGroundItemWithFlags(Entity* parent, u32 form, u32 subtype, u32 flags) { +Entity* CreateGroundItemWithFlags(Entity* parent, u32 item, u32 subvalue, u32 flags) { Entity* ent; - ent = CreateObjectWithParent(parent, GROUND_ITEM, form, subtype); + ent = CreateObjectWithParent(parent, GROUND_ITEM, item, subvalue); if (ent != NULL) { ItemOnGroundEntity* this = (ItemOnGroundEntity*)ent; ent->timer = 5; @@ -194,7 +195,7 @@ Entity* CreateGroundItemWithFlags(Entity* parent, u32 form, u32 subtype, u32 fla return ent; } -Entity* CreateWaterTrace(Entity* parent) { +Entity* CreateRippleFx(Entity* parent) { Entity* ent; ent = CreateFx(parent, FX_RIPPLE, 0); @@ -204,12 +205,12 @@ Entity* CreateWaterTrace(Entity* parent) { return ent; } -void CreateRandomWaterTrace(Entity* parent, int range) { - s32 sVar1, sVar2, sVar3; +void CreateRippleFxRandom(Entity* parent, s32 range) { + s32 sVar1, sVar2; Entity* ent; u32 uVar3; - ent = CreateWaterTrace(parent); + ent = CreateRippleFx(parent); if (ent != NULL) { uVar3 = Random(); sVar1 = (int)uVar3 % (++range); @@ -228,7 +229,7 @@ void CreateRandomWaterTrace(Entity* parent, int range) { } } -Entity* CreateLargeWaterTrace(Entity* parent) { +Entity* CreateLargeRippleFx(Entity* parent) { Entity* ent = CreateFx(parent, FX_RIPPLE_LARGE, 0); if (ent != NULL) { ent->spritePriority.b0 = 7; @@ -236,22 +237,22 @@ Entity* CreateLargeWaterTrace(Entity* parent) { return ent; } -void sub_080A2AF4(Entity* parent, s32 param_2, s32 param_3) { +void CreateLargeRippleFxRandom(Entity* parent, s32 minDistance, s32 maxDistance) { Entity* entity; s32 radius; s32 angle; - entity = CreateLargeWaterTrace(parent); + entity = CreateLargeRippleFx(parent); if (entity != NULL) { angle = Random(); - radius = (angle % (param_3 - param_2 + 1)) + param_2; + radius = (angle % (maxDistance - minDistance + 1)) + minDistance; angle = angle >> 0x10 & 0xff; entity->x.WORD += FixedDiv(FixedMul(gSineTable[angle], radius << 8), 0x100) << 8; entity->y.WORD -= FixedDiv(FixedMul(gSineTable[angle + 0x40], radius << 8), 0x100) << 8; } } -void CreateSparkle(Entity* entity) { +void CreateSparkleFx(Entity* parent) { Entity* sparkle; u32 rand; s32 y; @@ -268,10 +269,10 @@ void CreateSparkle(Entity* entity) { if (4 < y) { y = -y; } - PositionRelative(entity, sparkle, x << 0x10, y << 0x10); - SortEntityAbove(entity, sparkle); - sparkle->spriteOffsetX = entity->spriteOffsetX; - sparkle->spriteOffsetY = entity->spriteOffsetY; + PositionRelative(parent, sparkle, x << 0x10, y << 0x10); + SortEntityAbove(parent, sparkle); + sparkle->spriteOffsetX = parent->spriteOffsetX; + sparkle->spriteOffsetY = parent->spriteOffsetY; } } diff --git a/src/physics.c b/src/physics.c index 99bc50df..d5b1a0a3 100644 --- a/src/physics.c +++ b/src/physics.c @@ -2,12 +2,13 @@ #include "asm.h" #include "color.h" #include "common.h" -#include "functions.h" +#include "structures.h" #include "physics.h" #include "player.h" #include "playeritem.h" #include "room.h" #include "sound.h" +#include "vram.h" const u8 gSpriteSortAboveTable[]; const u8 gSpriteSortBelowTable[]; diff --git a/src/player.c b/src/player.c index c394ea0d..6a7ef891 100644 --- a/src/player.c +++ b/src/player.c @@ -17,14 +17,19 @@ #include "main.h" #include "message.h" #include "object.h" +#include "effects.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "playeritem.h" #include "playerItem/playerItemBottle.h" #include "save.h" #include "screen.h" #include "screenTransitions.h" +#include "scroll.h" #include "sound.h" #include "tiles.h" +#include "structures.h" #define kGravityRate Q_8_8(32) #define kWalkSpeedSlopeSubtractor Q_8_8(0.3125) @@ -559,7 +564,7 @@ static void PlayerNormal(PlayerEntity* this) { if (gPlayerState.item == NULL) UpdateAnimationSingleFrame(super); if (gPlayerState.swim_state != 0 && (gRoomTransition.frameCount & 7) == 0) - CreateWaterTrace(super); + CreateRippleFx(super); return; } } diff --git a/src/playerItem.c b/src/playerItem.c index 266d12d0..c50b9160 100644 --- a/src/playerItem.c +++ b/src/playerItem.c @@ -1,5 +1,4 @@ #include "global.h" -#include "functions.h" #include "player.h" #include "playeritem.h" diff --git a/src/playerItem/playerItemBoomerang.c b/src/playerItem/playerItemBoomerang.c index bcc151a8..b5d12dd7 100644 --- a/src/playerItem/playerItemBoomerang.c +++ b/src/playerItem/playerItemBoomerang.c @@ -6,9 +6,12 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "item.h" +#include "room.h" #include "sound.h" +#include "vram.h" +#include "collision.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemBottle.c b/src/playerItem/playerItemBottle.c index 47eeed56..d02a133a 100644 --- a/src/playerItem/playerItemBottle.c +++ b/src/playerItem/playerItemBottle.c @@ -6,12 +6,16 @@ */ #include "playerItem/playerItemBottle.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "asm.h" +#include "physics.h" +#include "player.h" #include "save.h" #include "sound.h" #include "tiles.h" +#include "vram.h" +#include "collision.h" void PlayerItemBottle_UseEmptyBottle(Entity*); void PlayerItemBottle_Action1(PlayerItemBottleEntity*); diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index fec8aea4..827aa51f 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -7,12 +7,16 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "playeritem.h" #include "save.h" #include "sound.h" #include "tiles.h" +#include "vram.h" +#include "collision.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemDashSword.c b/src/playerItem/playerItemDashSword.c index 0256561c..f12237d2 100644 --- a/src/playerItem/playerItemDashSword.c +++ b/src/playerItem/playerItemDashSword.c @@ -5,8 +5,10 @@ * @brief Dash Sword Player Item */ #include "entity.h" -#include "functions.h" #include "player.h" +#include "vram.h" +#include "collision.h" +#include "asm.h" extern Entity* DoTileInteractionOffset(Entity*, u32, s32, s32); diff --git a/src/playerItem/playerItemFireRodProjectile.c b/src/playerItem/playerItemFireRodProjectile.c index c80c7894..698bf3a3 100644 --- a/src/playerItem/playerItemFireRodProjectile.c +++ b/src/playerItem/playerItemFireRodProjectile.c @@ -7,10 +7,12 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "physics.h" #include "playeritem.h" #include "sound.h" +#include "collision.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemGust.c b/src/playerItem/playerItemGust.c index 286c06f3..0ca4ef45 100644 --- a/src/playerItem/playerItemGust.c +++ b/src/playerItem/playerItemGust.c @@ -6,8 +6,10 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" +#include "collision.h" #include "object.h" +#include "room.h" +#include "physics.h" #include "player.h" #include "playeritem.h" diff --git a/src/playerItem/playerItemGustBig.c b/src/playerItem/playerItemGustBig.c index 7281139d..45b52c4a 100644 --- a/src/playerItem/playerItemGustBig.c +++ b/src/playerItem/playerItemGustBig.c @@ -4,13 +4,15 @@ * * @brief Gust Big Player Item */ +#include "playeritem.h" #include "asm.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "global.h" #include "player.h" #include "sound.h" #include "tiles.h" +#include "collision.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemGustJar.c b/src/playerItem/playerItemGustJar.c index 10cbca1b..3425e6e4 100644 --- a/src/playerItem/playerItemGustJar.c +++ b/src/playerItem/playerItemGustJar.c @@ -5,9 +5,10 @@ * @brief Gust Jar Player Item */ #include "entity.h" -#include "functions.h" #include "player.h" #include "sound.h" +#include "vram.h" +#include "asm.h" extern const u8* gUnk_08132714[]; // Anim index lists? // TODO spriteAnimations in here diff --git a/src/playerItem/playerItemHeldObject.c b/src/playerItem/playerItemHeldObject.c index 0783cd04..18013074 100644 --- a/src/playerItem/playerItemHeldObject.c +++ b/src/playerItem/playerItemHeldObject.c @@ -4,10 +4,11 @@ * * @brief Held Object Player Item */ +#include "object.h" #include "asm.h" #include "effects.h" -#include "entity.h" -#include "functions.h" +#include "physics.h" +#include "collision.h" #include "player.h" #include "sound.h" #include "tiles.h" diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 7c16acbc..fe6fccf6 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -5,10 +5,13 @@ * @brief Lantern Player Item */ #include "entity.h" -#include "functions.h" #include "item.h" #include "object.h" +#include "physics.h" #include "player.h" +#include "vram.h" +#include "asm.h" +#include "collision.h" void PlayerItemLantern_Init(Entity* this); void PlayerItemLantern_Action1(Entity* this); diff --git a/src/playerItem/playerItemPacciCane.c b/src/playerItem/playerItemPacciCane.c index a6ef2553..c4937aef 100644 --- a/src/playerItem/playerItemPacciCane.c +++ b/src/playerItem/playerItemPacciCane.c @@ -6,11 +6,11 @@ */ #include "common.h" #include "entity.h" -#include "functions.h" -#include "message.h" #include "save.h" #include "sound.h" #include "structures.h" +#include "vram.h" +#include "asm.h" void PlayerItemPacciCane_Action1(Entity*); void PlayerItemPacciCane_Init(Entity* this); diff --git a/src/playerItem/playerItemPacciCaneProjectile.c b/src/playerItem/playerItemPacciCaneProjectile.c index 251274c9..3e7aa03e 100644 --- a/src/playerItem/playerItemPacciCaneProjectile.c +++ b/src/playerItem/playerItemPacciCaneProjectile.c @@ -4,10 +4,14 @@ * * @brief Pacci Cane Projectile Player Item */ +#include "playeritem.h" #include "asm.h" #include "entity.h" -#include "functions.h" +#include "collision.h" #include "object.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "sound.h" #include "tiles.h" diff --git a/src/playerItem/playerItemShield.c b/src/playerItem/playerItemShield.c index 7df31ebd..f10623cc 100644 --- a/src/playerItem/playerItemShield.c +++ b/src/playerItem/playerItemShield.c @@ -6,10 +6,11 @@ */ #include "collision.h" #include "entity.h" -#include "functions.h" #include "player.h" #include "playeritem.h" #include "sound.h" +#include "vram.h" +#include "asm.h" const Hitbox gUnk_081271CC = { 0, 0, { 1, 0, 0, 1 }, 8, 8 }; diff --git a/src/playerItem/playerItemSpiralBeam.c b/src/playerItem/playerItemSpiralBeam.c index e381d594..8baeee41 100644 --- a/src/playerItem/playerItemSpiralBeam.c +++ b/src/playerItem/playerItemSpiralBeam.c @@ -7,8 +7,12 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" +#include "playeritem.h" +#include "physics.h" #include "sound.h" +#include "collision.h" +#include "room.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemSword.c b/src/playerItem/playerItemSword.c index 1bf1d9e7..d82e19c4 100644 --- a/src/playerItem/playerItemSword.c +++ b/src/playerItem/playerItemSword.c @@ -7,10 +7,14 @@ #include "asm.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "sound.h" #include "tiles.h" +#include "vram.h" +#include "collision.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItem/playerItemSwordBeam.c b/src/playerItem/playerItemSwordBeam.c index 4b110c43..8d04528b 100644 --- a/src/playerItem/playerItemSwordBeam.c +++ b/src/playerItem/playerItemSwordBeam.c @@ -4,14 +4,16 @@ * * @brief Sword Beam Player Item */ +#include "playeritem.h" #include "asm.h" -#include "common.h" #include "effects.h" #include "entity.h" -#include "functions.h" +#include "collision.h" #include "physics.h" #include "player.h" #include "sound.h" +#include "object.h" +#include "room.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/playerItemUtils.c b/src/playerItemUtils.c index 446bbdc7..42da7cff 100644 --- a/src/playerItemUtils.c +++ b/src/playerItemUtils.c @@ -1,10 +1,10 @@ #include "common.h" #include "entity.h" #include "flags.h" -#include "functions.h" #include "item.h" #include "message.h" #include "object.h" +#include "room.h" #include "player.h" #include "save.h" #include "sound.h" @@ -12,7 +12,6 @@ static Entity* GiveItemWithCutscene(u32, u32, u32); static void InitTileMessage(u32, u32); -Entity* CreateLinkAnimation(Entity*, u32, u32); void SetPlayerItemGetState(Entity*, u32, u32); void CreateItemEntity(u32 type, u32 type2, u32 delay) { diff --git a/src/playerUtils.c b/src/playerUtils.c index 312eca72..32236958 100644 --- a/src/playerUtils.c +++ b/src/playerUtils.c @@ -4,7 +4,7 @@ #include "collision.h" #include "common.h" #include "entity.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "global.h" #include "item.h" @@ -13,15 +13,21 @@ #include "manager/diggingCaveEntranceManager.h" #include "message.h" #include "object.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "physics.h" #include "player.h" #include "room.h" #include "save.h" #include "screen.h" #include "screenTransitions.h" +#include "scroll.h" #include "tileMap.h" #include "tiles.h" +#include "backgroundAnimations.h" -static void sub_08077E54(ItemBehavior* beh); +static void sub_08077E54(ItemBehavior* this); extern void sub_0800857C(Entity*); extern void InitDefaultPriority(Entity*); @@ -46,14 +52,10 @@ bool32 IsTryingToPickupObject(void); ItemBehavior* CreateItem(u32); u32 sub_080789A8(void); ItemBehavior* CreateItem1(u32); -void DeleteItemBehavior(ItemBehavior*, u32); bool32 sub_08079E90(u32); -void PlayerMinishSetNormalAndCollide(void); -void sub_08078D60(void); void* CreateItemGetPlayerItemWithParent(ItemBehavior*); u32 sub_08079FD4(Entity*, u32); void LoadRoomGfx(void); -SurfaceType GetSurfaceCalcType(Entity*, s32, s32); void sub_0807AAF8(Entity*, u32); void sub_0807A750(u32, u32, const u8*, u32); @@ -63,15 +65,12 @@ extern ItemBehavior* (*const gCreateItemsFuncs[])(Item); extern void UnregisterInteractTile(u32, u32); -extern const u8 gMapTileTypeToCollisionData[]; // collisionData for tileType? - extern u8 gUpdateVisibleTiles; bool32 sub_0807BF88(u32, u32, RoomResInfo*); void LoadRoomTileSet(void); -void ForceSetPlayerState(u32 framestate); InteractableObject* sub_080784E4(void); u32 sub_08079778(void); @@ -81,34 +80,27 @@ extern const KeyValuePair gMapActTileToSurfaceType[]; u32 sub_0807BEEC(u32 param_1, u32 param_2, u32 param_3); -bool32 sub_0807B434(u32 position, u32 layer); +bool32 sub_0807B434(u32 tilePos, u32 layer); void sub_0807B820(u32); void sub_0807B8A8(u32); void sub_0807B930(u32); -bool32 sub_0807B464(u32 param_1, u32 param_2); +bool32 sub_0807B464(u32 tilePos, u32 layer); void sub_0807B55C(u32, u32, u16*); void sub_0807B480(u32, u32); bool32 sub_0807B600(u32); -bool32 sub_0807B464(u32 tilePos, u32 param_2); - -bool32 sub_0807B464(u32 param_1, u32 param_2); - -extern void CreateRandomWaterTrace(Entity* parent, int range); void sub_08079520(Entity* this); bool32 ToggleDiving(Entity*); extern const u16* sub_0806FC50(u32 param_1, u32 param_2); -bool32 sub_08079F48(u32 param_1, u32 param_2); +bool32 sub_08079F48(u32 direction, u32 collisionData); extern void FillActTileForLayer(MapLayer* mapLayer); -extern u16 gUnk_080B77C0[]; - void sub_0807BFA8(void); void sub_0807C8B0(u16*, u32, u32); void sub_0807C69C(u8*, u32, u32); @@ -123,18 +115,7 @@ extern const u8 gMapTileTypeToCollisionData[]; // collisions for tiles > 0x4000 extern const u8 gMapSpecialTileToCollisionData[]; -extern u16 gUnk_080B77C0[]; - -void sub_0807BFA8(void); -void sub_0807C8B0(u16*, u32, u32); -void sub_0807C69C(u8*, u32, u32); -void sub_0807C460(void); -void sub_0807BBE4(void); -void CreateCollisionDataBorderAroundRoom(void); -void sub_0807C5F4(u16*, u16*); -void sub_0807C5B0(void); - -extern u8 gUnk_080082DC[]; +extern const u8 gUnk_080082DC[]; extern u32 sub_08004202(Entity*, u8*, u32); // This just reuses the first 12 bytes of gUnk_02022830 to store a MapDataDefinition there temporarily. @@ -154,9 +135,6 @@ u32 sub_0807A180(Entity*, Entity*, u32, u32); extern u32 gUsedPalettes; -extern void ClearBgAnimations(void); -extern void LoadBgAnimations(u16*); - void sub_0807BFA8(void); void UpdateActiveItems(PlayerEntity* this) { @@ -3090,11 +3068,11 @@ void PlayerUpdateSwimming(Entity* this) { } if (this->direction & DIR_NOT_MOVING_CHECK) { if ((gRoomTransition.frameCount & 0xf) == 0) { - CreateRandomWaterTrace(this, 4); + CreateRippleFxRandom(this, 4); } } else { if ((gRoomTransition.frameCount & 7) == 0) { - CreateWaterTrace(this); + CreateRippleFx(this); } } } @@ -3228,7 +3206,7 @@ void sub_0807B178(PlayerEntity* this) { void sub_0807B1A8(PlayerEntity* this) { gUnk_0811C298[this->unk_6e](this); if ((gRoomTransition.frameCount & 7) == 0) { - CreateSparkle(super); + CreateSparkleFx(super); } } diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index c47f0414..cf39a80c 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -7,8 +7,14 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" + +#include "sound.h" +#include "effects.h" +#include "physics.h" + +#include "player.h" extern void (*const ArrowProjectile_Functions[])(Entity*); extern void (*const ArrowProjectile_Actions[])(Entity*); @@ -95,7 +101,7 @@ void ArrowProjectile_Action3(Entity* this) { void ArrowProjectile_Action4(Entity* this) { if (GravityUpdate(this, Q_8_8(40.0)) == 0) { - CreateDust(this); + CreateDeathFx(this); DeleteThisEntity(); } else { if (--this->timer == 0) { diff --git a/src/projectile/ballAndChain.c b/src/projectile/ballAndChain.c index a727240a..fa1c5d0f 100644 --- a/src/projectile/ballAndChain.c +++ b/src/projectile/ballAndChain.c @@ -5,9 +5,9 @@ * @brief Ball and Chain Projectile */ #include "entity.h" -#include "functions.h" #include "hitbox.h" #include "projectile.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/boneProjectile.c b/src/projectile/boneProjectile.c index 336920a2..82bc43a4 100644 --- a/src/projectile/boneProjectile.c +++ b/src/projectile/boneProjectile.c @@ -7,7 +7,7 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const BoneProjectile_Functions[])(Entity*); extern void (*const BoneProjectile_Actions[])(Entity*); diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c index c5b4244f..468424b9 100644 --- a/src/projectile/cannonballProjectile.c +++ b/src/projectile/cannonballProjectile.c @@ -7,7 +7,7 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const CannonballProjectile_Functions[])(Entity*); extern void (*const CannonballProjectile_Actions[])(Entity*); @@ -65,13 +65,13 @@ void CannonballProjectile_Action2(Entity* this) { bool32 sub_080AB5F4(Entity* this) { switch (GetTileHazardType(this)) { case 1: - CreatePitFallFX(this); + CreatePitFallFx(this); return TRUE; case 2: - CreateDrownFX(this); + CreateDrownFx(this); return TRUE; case 3: - CreateLavaDrownFX(this); + CreateLavaDrownFx(this); return TRUE; } return FALSE; diff --git a/src/projectile/dekuSeedProjectile.c b/src/projectile/dekuSeedProjectile.c index f3b2f5e7..897fbace 100644 --- a/src/projectile/dekuSeedProjectile.c +++ b/src/projectile/dekuSeedProjectile.c @@ -7,7 +7,7 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const DekuSeedProjectile_Functions[])(Entity*); extern void (*const DekuSeedProjectile_Actions[])(Entity*); diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index a03009de..24b561f6 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -6,7 +6,6 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "physics.h" #include "player.h" #include "sound.h" diff --git a/src/projectile/fireProjectile.c b/src/projectile/fireProjectile.c index cd81f3d3..5cd9d922 100644 --- a/src/projectile/fireProjectile.c +++ b/src/projectile/fireProjectile.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const FireProjectile_Actions[])(Entity*); diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index 3fd4bbf5..6a8b0ca9 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -6,8 +6,9 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "player.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/guardLineOfSight.c b/src/projectile/guardLineOfSight.c index d117507c..caadc900 100644 --- a/src/projectile/guardLineOfSight.c +++ b/src/projectile/guardLineOfSight.c @@ -7,7 +7,7 @@ #include "asm.h" #include "collision.h" #include "entity.h" -#include "functions.h" +#include "room.h" #include "hitbox.h" #include "physics.h" #include "projectile.h" diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c index b3ee446d..73556f7e 100644 --- a/src/projectile/gyorgMaleEnergyProjectile.c +++ b/src/projectile/gyorgMaleEnergyProjectile.c @@ -6,7 +6,6 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "physics.h" #include "player.h" diff --git a/src/projectile/gyorgTail.c b/src/projectile/gyorgTail.c index a6f30104..e11b7daa 100644 --- a/src/projectile/gyorgTail.c +++ b/src/projectile/gyorgTail.c @@ -6,7 +6,6 @@ */ #include "asm.h" #include "entity.h" -#include "functions.h" #include "hitbox.h" #include "physics.h" #include "projectile.h" diff --git a/src/projectile/iceProjectile.c b/src/projectile/iceProjectile.c index 7a430b38..97898fa2 100644 --- a/src/projectile/iceProjectile.c +++ b/src/projectile/iceProjectile.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const IceProjectile_Actions[])(Entity*); diff --git a/src/projectile/keatonDagger.c b/src/projectile/keatonDagger.c index cf1fa109..90e89e05 100644 --- a/src/projectile/keatonDagger.c +++ b/src/projectile/keatonDagger.c @@ -8,7 +8,7 @@ #include "player.h" #include "physics.h" -extern void sub_0803C0AC(Entity*); +extern void StealRupees(Entity*); extern const Hitbox* const gUnk_08129998[]; @@ -21,7 +21,7 @@ void KeatonDagger(Entity* this) { parent = this->parent; if (((parent == NULL) || (parent->health == 0)) || (parent->next == NULL)) { if (((this->contactFlags & CONTACT_NOW) != 0) && (this->contactedEntity == &gPlayerEntity.base)) { - sub_0803C0AC(this); + StealRupees(this); } DeleteEntity(this); } else { diff --git a/src/projectile/lakituCloudProjectile.c b/src/projectile/lakituCloudProjectile.c index 8c0a11f2..d7284203 100644 --- a/src/projectile/lakituCloudProjectile.c +++ b/src/projectile/lakituCloudProjectile.c @@ -6,7 +6,8 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "player.h" +#include "physics.h" extern void SoundReqClipped(Entity*, u32); extern void sub_08079D84(void); diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 279ef9e9..912ce722 100644 --- a/src/projectile/lakituLightning.c +++ b/src/projectile/lakituLightning.c @@ -7,7 +7,7 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const LakituLightning_Functions[])(Entity*); extern void (*const LakituLightning_Actions[])(Entity*); diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 99ceb48b..4df4dc8d 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -6,11 +6,14 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" -#include "game.h" +#include "room.h" #include "hitbox.h" #include "physics.h" #include "tiles.h" +#include "player.h" +#ifndef EU +#include "game.h" +#endif typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 8ca0d67d..da2b3ffd 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -7,8 +7,9 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "projectile.h" +#include "player.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/removableDust.c b/src/projectile/removableDust.c index c6b7a5ff..c5617a61 100644 --- a/src/projectile/removableDust.c +++ b/src/projectile/removableDust.c @@ -6,8 +6,11 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "flags.h" +#include "player.h" #include "physics.h" #include "room.h" #include "tiles.h" diff --git a/src/projectile/rockProjectile.c b/src/projectile/rockProjectile.c index a2e75f11..4bfebb9b 100644 --- a/src/projectile/rockProjectile.c +++ b/src/projectile/rockProjectile.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const RockProjectile_Functions[])(Entity*); extern void (*const RockProjectile_Actions[])(Entity*); diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index 5e4e1a46..069e881b 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -6,9 +6,14 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "hitbox.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "flags.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { diff --git a/src/projectile/spikedRollers.c b/src/projectile/spikedRollers.c index bc641510..2c5b6298 100644 --- a/src/projectile/spikedRollers.c +++ b/src/projectile/spikedRollers.c @@ -5,7 +5,7 @@ * @brief Spiked Rollers Projectile */ #include "entity.h" -#include "functions.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index bbe7b728..4a4f1651 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const StalfosProjectile_Functions[])(Entity*); extern void (*const StalfosProjectile_Actions[])(Entity*); diff --git a/src/projectile/torchTrapProjectile.c b/src/projectile/torchTrapProjectile.c index 5176b451..b007037f 100644 --- a/src/projectile/torchTrapProjectile.c +++ b/src/projectile/torchTrapProjectile.c @@ -6,8 +6,7 @@ */ #include "collision.h" #include "enemy.h" -#include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const TorchTrapProjectile_Functions[])(Entity*); extern void (*const TorchTrapProjectile_Actions[])(Entity*); diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index dd3d1d0b..f56e1ba2 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -6,7 +6,6 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "physics.h" #include "player.h" diff --git a/src/projectile/v1EyeLaser.c b/src/projectile/v1EyeLaser.c index a79f5c94..f5f38f5f 100644 --- a/src/projectile/v1EyeLaser.c +++ b/src/projectile/v1EyeLaser.c @@ -5,8 +5,9 @@ * @brief V1 Eye Laser Projectile */ #include "entity.h" -#include "functions.h" #include "projectile.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/v1FireProjectile.c b/src/projectile/v1FireProjectile.c index bdf914bf..d15767ee 100644 --- a/src/projectile/v1FireProjectile.c +++ b/src/projectile/v1FireProjectile.c @@ -6,8 +6,9 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "player.h" +#include "room.h" +#include "physics.h" typedef struct { /*0x00*/ Entity base; diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index b96a2be5..fa77b2a6 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -6,8 +6,13 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" #include "object.h" +#include "asm.h" +#include "sound.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "tiles.h" typedef struct { @@ -56,7 +61,7 @@ void V2Projectile_OnCollision(V2ProjectileEntity* this) { } case 3: case 0x14: { - CreateDust(super); + CreateDeathFx(super); DeleteThisEntity(); break; } diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c index 2fe12fb2..51391304 100644 --- a/src/projectile/v3ElectricProjectile.c +++ b/src/projectile/v3ElectricProjectile.c @@ -7,7 +7,6 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" #include "physics.h" #include "player.h" diff --git a/src/projectile/v3HandProjectile.c b/src/projectile/v3HandProjectile.c index ff594836..b60057c4 100644 --- a/src/projectile/v3HandProjectile.c +++ b/src/projectile/v3HandProjectile.c @@ -6,8 +6,7 @@ */ #include "collision.h" #include "enemy.h" -#include "entity.h" -#include "functions.h" +#include "physics.h" #include "player.h" extern void (*const V3HandProjectile_Functions[])(Entity*); diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index abc6d35c..b6be41f3 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -7,7 +7,7 @@ #include "collision.h" #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const V3TennisBallProjectile_Functions[])(Entity*); extern void (*const V3TennisBallProjectile_Actions[])(Entity*); diff --git a/src/projectile/windProjectile.c b/src/projectile/windProjectile.c index 2682b104..3ad7a171 100644 --- a/src/projectile/windProjectile.c +++ b/src/projectile/windProjectile.c @@ -6,7 +6,7 @@ */ #include "enemy.h" #include "entity.h" -#include "functions.h" +#include "physics.h" extern void (*const WindProjectile_Actions[])(Entity*); diff --git a/src/projectile/winder.c b/src/projectile/winder.c index d8b5c5d8..032df7e5 100644 --- a/src/projectile/winder.c +++ b/src/projectile/winder.c @@ -9,8 +9,9 @@ #include "collision.h" #include "common.h" #include "entity.h" -#include "functions.h" +#include "physics.h" #include "projectile.h" +#include "room.h" extern s16 gUnk_080B4488[]; diff --git a/src/projectileUtils.c b/src/projectileUtils.c index e11be579..5eebb291 100644 --- a/src/projectileUtils.c +++ b/src/projectileUtils.c @@ -1,6 +1,7 @@ #include "entity.h" #include "definitions.h" -#include "functions.h" +#include "vram.h" +#include "room.h" extern const ProjectileDefinition gProjectileDefinitions[]; diff --git a/src/room.c b/src/room.c index a75c098a..61c2c707 100644 --- a/src/room.c +++ b/src/room.c @@ -4,11 +4,13 @@ #include "common.h" #include "enemy.h" #include "flags.h" -#include "functions.h" +#include "script.h" #include "game.h" #include "manager/bombableWallManager.h" #include "map.h" #include "object.h" +#include "asm.h" +#include "effects.h" #include "room.h" #include "tiles.h" diff --git a/src/roomInit.c b/src/roomInit.c index 81366256..68e812e8 100644 --- a/src/roomInit.c +++ b/src/roomInit.c @@ -7,14 +7,28 @@ #include "kinstone.h" #include "main.h" #include "object.h" +#include "asm.h" +#include "room.h" +#include "player.h" +#include "physics.h" #include "save.h" #include "screen.h" #include "screenTransitions.h" #include "sound.h" #include "tiles.h" #include "windcrest.h" +#include "enemy/armos.h" #include "manager/lightManager.h" -#include "functions.h" +#include "manager/hyruleTownTileSetManager.h" +#include "manager/staticBackgroundManager.h" +#include "manager/verticalMinishPathBackgroundManager.h" +#include "manager/horizontalMinishPathBackgroundManager.h" +#include "manager/minishRaftersBackgroundManager.h" +#include "manager/miscManager.h" +#include "npc/bigGoron.h" +#include "scroll.h" +#include "subtask.h" +#include "beanstalkSubtask.h" extern u32 sub_08060354(void); extern void MinishVillageTileSetManger_LoadInitialGfxGroup(void); @@ -46,7 +60,7 @@ u32 sub_unk3_ArmosInteriors_RuinsEntranceNorth(u32 arg0) { } void sub_StateChange_ArmosInteriors_RuinsEntranceNorth(void) { - sub_08030118(0); + Armos_SetFlagFromTransition(0); } u32 sub_unk3_ArmosInteriors_RuinsEntranceSouth(void) { @@ -54,7 +68,7 @@ u32 sub_unk3_ArmosInteriors_RuinsEntranceSouth(void) { } void sub_StateChange_ArmosInteriors_RuinsEntranceSouth(void) { - sub_08030118(1); + Armos_SetFlagFromTransition(1); } u32 sub_unk3_ArmosInteriors_RuinsLeft(void) { @@ -62,7 +76,7 @@ u32 sub_unk3_ArmosInteriors_RuinsLeft(void) { } void sub_StateChange_ArmosInteriors_RuinsLeft(void) { - sub_08030118(2); + Armos_SetFlagFromTransition(2); } u32 sub_unk3_ArmosInteriors_RuinsMiddleLeft(void) { @@ -70,7 +84,7 @@ u32 sub_unk3_ArmosInteriors_RuinsMiddleLeft(void) { } void sub_StateChange_ArmosInteriors_RuinsMiddleLeft(void) { - sub_08030118(3); + Armos_SetFlagFromTransition(3); } u32 sub_unk3_ArmosInteriors_RuinsMiddleRight(void) { @@ -78,7 +92,7 @@ u32 sub_unk3_ArmosInteriors_RuinsMiddleRight(void) { } void sub_StateChange_ArmosInteriors_RuinsMiddleRight(void) { - sub_08030118(4); + Armos_SetFlagFromTransition(4); } u32 sub_unk3_ArmosInteriors_RuinsRight(void) { @@ -86,7 +100,7 @@ u32 sub_unk3_ArmosInteriors_RuinsRight(void) { } void sub_StateChange_ArmosInteriors_RuinsRight(void) { - sub_08030118(5); + Armos_SetFlagFromTransition(5); } u32 sub_unk3_ArmosInteriors_6(void) { @@ -94,7 +108,7 @@ u32 sub_unk3_ArmosInteriors_6(void) { } void sub_StateChange_ArmosInteriors_6(void) { - sub_08030118(6); + Armos_SetFlagFromTransition(6); } u32 sub_unk3_ArmosInteriors_RuinsGrassPath(void) { @@ -102,7 +116,7 @@ u32 sub_unk3_ArmosInteriors_RuinsGrassPath(void) { } void sub_StateChange_ArmosInteriors_RuinsGrassPath(void) { - sub_08030118(7); + Armos_SetFlagFromTransition(7); } u32 sub_unk3_ArmosInteriors_8(void) { @@ -110,7 +124,7 @@ u32 sub_unk3_ArmosInteriors_8(void) { } void sub_StateChange_ArmosInteriors_8(void) { - sub_08030118(8); + Armos_SetFlagFromTransition(8); } u32 sub_unk3_ArmosInteriors_FortressOfWindsLeft(void) { @@ -118,7 +132,7 @@ u32 sub_unk3_ArmosInteriors_FortressOfWindsLeft(void) { } void sub_StateChange_ArmosInteriors_FortressOfWindsLeft(void) { - sub_08030118(9); + Armos_SetFlagFromTransition(9); gArea.dungeon_idx = 3; gArea.areaMetadata = AR_HAS_NO_ENEMIES | AR_HAS_MAP | AR_IS_DUNGEON | AR_HAS_KEYS; } @@ -128,7 +142,7 @@ u32 sub_unk3_ArmosInteriors_FortressOfWindsRight(void) { } void sub_StateChange_ArmosInteriors_FortressOfWindsRight(void) { - sub_08030118(10); + Armos_SetFlagFromTransition(10); gArea.dungeon_idx = 3; gArea.areaMetadata = AR_HAS_NO_ENEMIES | AR_HAS_MAP | AR_IS_DUNGEON | AR_HAS_KEYS; } diff --git a/src/save.c b/src/save.c index 46dcb0d3..b638d73e 100644 --- a/src/save.c +++ b/src/save.c @@ -3,7 +3,6 @@ #include "sound.h" #include "menu.h" #include "main.h" -#include "functions.h" #include "game.h" #include "fileselect.h" diff --git a/src/script.c b/src/script.c index bb2cfe75..fee3403d 100644 --- a/src/script.c +++ b/src/script.c @@ -1,14 +1,25 @@ #include "area.h" -#include "functions.h" #include "game.h" #include "item.h" #include "kinstone.h" #include "main.h" #include "npc.h" #include "object.h" +#include "asm.h" +#include "common.h" +#include "sound.h" +#include "flags.h" +#include "effects.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" +#include "scroll.h" #include "script.h" #include "ui.h" +#include "save.h" +#include "subtask.h" +#include "structures.h" void InitScriptExecutionContext(ScriptExecutionContext* context, Script* script); void sub_0807DE80(Entity*); diff --git a/src/scroll.c b/src/scroll.c index 408cbd6b..b3cd7953 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -6,12 +6,15 @@ #include "common.h" #include "effects.h" #include "entity.h" -#include "functions.h" #include "game.h" #include "kinstone.h" #include "manager/diggingCaveEntranceManager.h" #include "map.h" #include "object.h" +#include "sound.h" +#include "room.h" +#include "physics.h" +#include "player.h" #include "screen.h" #include "structures.h" #include "tileMap.h" @@ -964,7 +967,7 @@ void sub_08080CB4(Entity* this) { case 0x5c: case 0x62: if ((gRoomTransition.frameCount & 0xf) == 0) { - CreateSparkle(this); + CreateSparkleFx(this); } break; } diff --git a/src/staffroll.c b/src/staffroll.c index f0ff11ae..007049fb 100644 --- a/src/staffroll.c +++ b/src/staffroll.c @@ -14,6 +14,8 @@ #include "save.h" #include "screen.h" #include "subtask.h" +#include "sound.h" +#include "structures.h" typedef struct { /*0x00*/ Menu base; diff --git a/src/subtask.c b/src/subtask.c index ddccfff1..5fc61704 100644 --- a/src/subtask.c +++ b/src/subtask.c @@ -1,11 +1,6 @@ #include "common.h" #include "fileselect.h" -#include "flags.h" -#include "functions.h" #include "game.h" -#include "item.h" -#include "itemMetaData.h" -#include "kinstone.h" #include "main.h" #include "menu.h" #include "message.h" @@ -14,6 +9,8 @@ #include "subtask.h" #include "ui.h" #include "windcrest.h" +#include "affine.h" +#include "structures.h" extern Screen gUnk_03001020; extern u8 gPaletteBufferBackup[]; diff --git a/src/subtask/subtaskAuxCutscene.c b/src/subtask/subtaskAuxCutscene.c index f916ae62..f1c30af4 100644 --- a/src/subtask/subtaskAuxCutscene.c +++ b/src/subtask/subtaskAuxCutscene.c @@ -6,9 +6,7 @@ #include "area.h" #include "asm.h" #include "common.h" -#include "fileselect.h" -#include "flags.h" -#include "functions.h" +#include "structures.h" #include "game.h" #include "main.h" #include "menu.h" @@ -17,6 +15,7 @@ #include "screen.h" #include "sound.h" #include "subtask.h" +#include "affine.h" typedef void(AuxCutsceneState)(void); typedef void(CutsceneMainState)(void); diff --git a/src/subtask/subtaskFastTravel.c b/src/subtask/subtaskFastTravel.c index 40b1ca0f..1b297789 100644 --- a/src/subtask/subtaskFastTravel.c +++ b/src/subtask/subtaskFastTravel.c @@ -7,10 +7,12 @@ #include "subtask.h" #include "common.h" #include "menu.h" -#include "functions.h" #include "message.h" #include "sound.h" #include "save.h" +#include "affine.h" +#include "asm.h" +#include "structures.h" extern void (*const Subtask_FastTravel_Functions[])(void); void sub_080A6E70(void); diff --git a/src/subtask/subtaskLocalMapHint.c b/src/subtask/subtaskLocalMapHint.c index 357e3f7e..cd33365d 100644 --- a/src/subtask/subtaskLocalMapHint.c +++ b/src/subtask/subtaskLocalMapHint.c @@ -7,10 +7,12 @@ #include "menu.h" #include "subtask.h" #include "kinstone.h" -#include "functions.h" +#include "player.h" #include "screen.h" #include "sound.h" #include "common.h" +#include "affine.h" +#include "structures.h" void Subtask_LocalMapHint() { extern void (*const gUnk_08128F1C[])(void); diff --git a/src/subtask/subtaskMapHint.c b/src/subtask/subtaskMapHint.c index 1bbe2670..2ab6bead 100644 --- a/src/subtask/subtaskMapHint.c +++ b/src/subtask/subtaskMapHint.c @@ -5,7 +5,6 @@ * @brief Map Hint Subtask */ #include "menu.h" -#include "functions.h" #include "subtask.h" #include "common.h" #include "main.h" @@ -15,6 +14,7 @@ #include "fileselect.h" #include "kinstone.h" #include "game.h" +#include "affine.h" void sub_080A6438(); diff --git a/src/subtask/subtaskWorldEvent.c b/src/subtask/subtaskWorldEvent.c index 0c7c5b5b..ac8d52af 100644 --- a/src/subtask/subtaskWorldEvent.c +++ b/src/subtask/subtaskWorldEvent.c @@ -7,7 +7,7 @@ #include "asm.h" #include "common.h" #include "flags.h" -#include "functions.h" +#include "manager/hyruleTownTileSetManager.h" #include "game.h" #include "kinstone.h" #include "main.h" @@ -16,6 +16,7 @@ #include "room.h" #include "screen.h" #include "subtask.h" +#include "affine.h" void Subtask_WorldEvent_Update(void); diff --git a/src/text.c b/src/text.c index 29d9b93a..d15ce166 100644 --- a/src/text.c +++ b/src/text.c @@ -1,7 +1,6 @@ #include "global.h" #include "common.h" #include "structures.h" -#include "functions.h" #include "asm.h" #include "enemy.h" #include "message.h" diff --git a/src/title.c b/src/title.c index 238e11d1..c9ca4543 100644 --- a/src/title.c +++ b/src/title.c @@ -11,12 +11,17 @@ #include "common.h" #include "screen.h" #include "object.h" +#include "room.h" +#include "player.h" #include "message.h" -#include "functions.h" +#include "structures.h" #include "save.h" -#include "area.h" -#include "item.h" #include "game.h" +#include "affine.h" +#ifdef DEMO_JP +#include "item.h" +#include "flags.h" +#endif typedef struct { u8 filler0[0x4]; diff --git a/src/ui.c b/src/ui.c index 8c529f57..f7bd74c8 100644 --- a/src/ui.c +++ b/src/ui.c @@ -1,6 +1,5 @@ #include "area.h" #include "common.h" -#include "functions.h" #include "game.h" #include "global.h" #include "item.h" @@ -9,6 +8,7 @@ #include "save.h" #include "screen.h" #include "sound.h" +#include "affine.h" #include "structures.h" extern void sub_0805ECEC(u32, u32, u32, u32); diff --git a/src/vram.c b/src/vram.c index 68b1433c..02a186ac 100644 --- a/src/vram.c +++ b/src/vram.c @@ -1,5 +1,6 @@ #include "common.h" #include "fileselect.h" +#include "vram.h" #include "structures.h" extern u32 gFixedTypeGfxData[]; diff --git a/src/worldEvent/worldEvent10.c b/src/worldEvent/worldEvent10.c index 69d7691e..6074760a 100644 --- a/src/worldEvent/worldEvent10.c +++ b/src/worldEvent/worldEvent10.c @@ -7,6 +7,9 @@ #include "fade.h" #include "menu.h" #include "object.h" +#include "common.h" +#include "flags.h" +#include "room.h" #include "subtask.h" void WorldEvent_Beanstalk_0(void); diff --git a/src/worldEvent/worldEvent12.c b/src/worldEvent/worldEvent12.c index 3fa18c50..0cba9c61 100644 --- a/src/worldEvent/worldEvent12.c +++ b/src/worldEvent/worldEvent12.c @@ -12,6 +12,7 @@ #include "room.h" #include "script.h" #include "subtask.h" +#include "save.h" extern Script script_GormanFirstAppearance; const EntityData gUnk_080FF2C0[] = { diff --git a/src/worldEvent/worldEvent14.c b/src/worldEvent/worldEvent14.c index 249a7774..c6e4c462 100644 --- a/src/worldEvent/worldEvent14.c +++ b/src/worldEvent/worldEvent14.c @@ -12,6 +12,7 @@ #include "room.h" #include "script.h" #include "subtask.h" +#include "save.h" extern Script script_GhostBrotherKinstone; const EntityData gUnk_080FF17C[] = { diff --git a/src/worldEvent/worldEvent17.c b/src/worldEvent/worldEvent17.c index 0be153e6..4e6caf61 100644 --- a/src/worldEvent/worldEvent17.c +++ b/src/worldEvent/worldEvent17.c @@ -13,6 +13,11 @@ #include "subtask.h" #include "manager/bombableWallManager.h" #include "tiles.h" +#include "flags.h" +#include "sound.h" +#include "asm.h" +#include "effects.h" +#include "physics.h" // Called Goron Kinstone Fusion Script void sub_08054EB8(Entity* this, ScriptExecutionContext* context) { diff --git a/src/worldEvent/worldEvent19.c b/src/worldEvent/worldEvent19.c index 12437991..4e319336 100644 --- a/src/worldEvent/worldEvent19.c +++ b/src/worldEvent/worldEvent19.c @@ -5,12 +5,13 @@ * @brief World Event 19 */ #include "fade.h" -#include "functions.h" #include "menu.h" #include "npc.h" #include "room.h" #include "script.h" #include "subtask.h" +#include "manager/staticBackgroundManager.h" +#include "npc/bigGoron.h" extern Script script_BigGoronKinstone1; extern Script script_BigGoronKinstone2; diff --git a/src/worldEvent/worldEvent21.c b/src/worldEvent/worldEvent21.c index e5540fa9..2fc9625d 100644 --- a/src/worldEvent/worldEvent21.c +++ b/src/worldEvent/worldEvent21.c @@ -9,6 +9,7 @@ #include "npc.h" #include "room.h" #include "subtask.h" +#include "script.h" extern Script script_CarlovKinstone; const EntityData gUnk_080FF264[] = { diff --git a/src/worldEvent/worldEvent22.c b/src/worldEvent/worldEvent22.c index 3fc0a672..e26dd650 100644 --- a/src/worldEvent/worldEvent22.c +++ b/src/worldEvent/worldEvent22.c @@ -4,7 +4,7 @@ * * @brief World Event 22 */ -#include "functions.h" +#include "script.h" #include "menu.h" #include "npc.h" #include "room.h" diff --git a/src/worldEvent/worldEvent25.c b/src/worldEvent/worldEvent25.c index b50b5ce8..d24fa8dc 100644 --- a/src/worldEvent/worldEvent25.c +++ b/src/worldEvent/worldEvent25.c @@ -7,6 +7,7 @@ #include "fade.h" #include "menu.h" #include "object.h" +#include "room.h" #include "script.h" #include "subtask.h" diff --git a/src/worldEvent/worldEvent3.c b/src/worldEvent/worldEvent3.c index adb20f68..a40483f1 100644 --- a/src/worldEvent/worldEvent3.c +++ b/src/worldEvent/worldEvent3.c @@ -6,7 +6,6 @@ */ #include "fade.h" #include "flags.h" -#include "functions.h" #include "menu.h" #include "subtask.h" diff --git a/src/worldEvent/worldEvent4.c b/src/worldEvent/worldEvent4.c index 114cec1c..7280d2c4 100644 --- a/src/worldEvent/worldEvent4.c +++ b/src/worldEvent/worldEvent4.c @@ -6,7 +6,6 @@ */ #include "fade.h" #include "flags.h" -#include "functions.h" #include "kinstone.h" #include "menu.h" #include "screen.h" diff --git a/src/worldEvent/worldEvent6.c b/src/worldEvent/worldEvent6.c index bfc96630..fdc90450 100644 --- a/src/worldEvent/worldEvent6.c +++ b/src/worldEvent/worldEvent6.c @@ -7,6 +7,9 @@ #include "fade.h" #include "menu.h" #include "object.h" +#include "flags.h" +#include "effects.h" +#include "room.h" #include "sound.h" #include "subtask.h" diff --git a/src/worldEvent/worldEvent7.c b/src/worldEvent/worldEvent7.c index 601990ad..1984868d 100644 --- a/src/worldEvent/worldEvent7.c +++ b/src/worldEvent/worldEvent7.c @@ -7,6 +7,7 @@ #include "fade.h" #include "menu.h" #include "object.h" +#include "flags.h" #include "sound.h" #include "subtask.h"