From 326cccc8769cd7d4b4754998e279e6da1300268a Mon Sep 17 00:00:00 2001 From: Oliver Bell Date: Sat, 25 Nov 2023 02:19:32 +0000 Subject: [PATCH] split up more game globals --- .vscode/settings.json | 10 +- include/constants/game_modes.h | 8 -- include/constants/zones.h | 3 + include/game/bosses/final_intro.h | 8 ++ include/game/dust_effect_braking.h | 14 ++- include/game/entity.h | 1 + include/game/game.h | 101 +----------------- include/game/game_7.h | 4 + include/game/multiplayer/finish.h | 5 +- include/game/multiplayer/player_unk_2.h | 17 +++ include/game/player.h | 11 -- include/game/save.h | 12 ++- include/game/special_stage/main.h | 2 - include/game/stage/camera.h | 1 + include/game/stage/player.h | 13 ++- include/game/stage/results.h | 4 + include/game/stage/stage.h | 10 ++ include/game/true_area_53/intro.h | 8 -- include/game/underwater_effects.h | 2 + include/game/water_effects.h | 30 +++++- include/sakit/entities_0.h | 18 ++++ include/sakit/globals.h | 8 ++ include/sakit/player.h | 4 + src/game/amy_attack_heart_effect.c | 1 + src/game/boost_effect.c | 1 + src/game/boost_mode_particles.c | 1 + src/game/bosses/boss_1.c | 4 + src/game/bosses/boss_5.c | 3 + src/game/bosses/common.c | 3 +- src/game/bosses/explosion_parts.c | 1 + src/game/bosses/final_intro.c | 3 +- src/game/countdown.c | 1 + src/game/course_select.c | 1 + src/game/cutscenes/level_endings.c | 2 + src/game/dust_effect_braking.c | 2 + src/game/dust_effect_spindash.c | 1 + src/game/enemies/flickey.c | 1 + src/game/enemies/geji_geji.c | 4 + src/game/enemies/gohla.c | 3 + src/game/enemies/hammerhead.c | 1 + src/game/enemies/kiki.c | 2 + src/game/enemies/kubinaga.c | 1 + src/game/enemies/kura_kura.c | 1 + src/game/enemies/madillo.c | 2 + src/game/enemies/mon.c | 1 + src/game/enemies/mouse.c | 1 + src/game/enemies/piko_piko.c | 3 + src/game/enemies/projectiles.c | 1 + src/game/enemies/spinner.c | 1 + src/game/enemies/straw.c | 1 + src/game/game.c | 5 + src/game/game_2.c | 2 + src/game/heart_particles_effect.c | 1 + src/game/interactables_1/booster.c | 1 + src/game/interactables_1/bouncy_bar.c | 1 + src/game/interactables_1/checkpoint.c | 1 + src/game/interactables_1/corkscrew.c | 1 + src/game/interactables_1/corkscrew_3d.c | 1 + src/game/interactables_1/decoration.c | 1 + src/game/interactables_1/gapped_loop.c | 1 + src/game/interactables_1/incline_ramp.c | 1 + src/game/interactables_1/platform_crumbling.c | 1 + src/game/interactables_1/rotating_handle.c | 1 + src/game/interactables_1/spikes.c | 3 + src/game/interactables_1/spring_bouncy.c | 1 + src/game/interactables_1/stage_goal.c | 1 + src/game/interactables_1/windmill.c | 1 + src/game/interactables_2/105.c | 3 + src/game/interactables_2/egg_utopia/cannon.c | 1 + .../egg_utopia/flying_handle.c | 1 + .../egg_utopia/gravity_toggle.c | 1 + .../interactables_2/egg_utopia/iron_ball.c | 4 + .../interactables_2/egg_utopia/launcher.c | 1 + src/game/interactables_2/egg_utopia/pole.c | 1 + .../egg_utopia/speeding_platform.c | 1 + src/game/interactables_2/hot_crater/crane.c | 1 + .../interactables_2/hot_crater/dash_ring.c | 1 + .../hot_crater/floating_spring.c | 1 + .../interactables_2/hot_crater/hook_rail.c | 1 + .../hot_crater/turn_around_bar.c | 1 + .../hot_crater/wind_up_stick.c | 1 + .../ice_paradise/big_snowball.c | 1 + .../ice_paradise/funnel_sphere.c | 1 + .../interactables_2/ice_paradise/half_pipe.c | 1 + .../ice_paradise/slowing_snow.c | 1 + .../music_plant/german_flute.c | 1 + .../music_plant/guitar_string.c | 1 + .../interactables_2/music_plant/keyboard.c | 1 + .../interactables_2/music_plant/note_block.c | 1 + .../interactables_2/music_plant/note_sphere.c | 1 + .../interactables_2/music_plant/pipe_horn.c | 1 + src/game/interactables_2/note_particle.c | 1 + .../interactables_2/notification_ring_bonus.c | 1 + .../sky_canyon/giant_propeller.c | 1 + .../sky_canyon/propeller_spring.c | 1 + .../sky_canyon/small_propeller.c | 4 +- .../sky_canyon/small_windmill.c | 1 + .../interactables_2/sky_canyon/whirlwind.c | 1 + src/game/interactables_2/special_ring.c | 1 + .../techno_base/arrow_platform.c | 1 + .../techno_base/bounce_block.c | 1 + .../techno_base/light_bridge.c | 1 + .../interactables_2/techno_base/light_globe.c | 1 + .../techno_base/spike_platform.c | 4 + src/game/item_tasks.c | 1 + src/game/multiboot/connection.c | 1 + src/game/multiplayer/finish.c | 1 + src/game/multiplayer/mode_select.c | 1 + src/game/multiplayer/player_unk_2.c | 1 + src/game/mystery_item_box.c | 3 + src/game/player_0.c | 2 +- src/game/player_3.c | 2 +- src/game/player_callbacks_0.c | 1 + src/game/player_callbacks_1.c | 4 +- src/game/race_progress.c | 7 +- src/game/rings_scatter.c | 1 + src/game/screen_shake.c | 1 + src/game/spark_effect.c | 1 + src/game/stage/background/callbacks.c | 1 + src/game/stage/background/zone_1.c | 3 +- src/game/stage/background/zone_1_boss.c | 1 + src/game/stage/background/zone_2.c | 2 +- src/game/stage/background/zone_2_boss.c | 4 +- src/game/stage/background/zone_3.c | 3 +- src/game/stage/background/zone_4.c | 3 +- src/game/stage/background/zone_5.c | 1 + src/game/stage/background/zone_6.c | 1 + src/game/stage/background/zone_6_2.c | 2 + src/game/stage/background/zone_7_1.c | 3 +- src/game/stage/background/zone_7_boss.c | 4 +- src/game/stage/background/zone_final.c | 2 + src/game/stage/background/zone_final_boss.c | 6 +- src/game/stage/boss_results_transition.c | 1 + src/game/stage/camera.c | 17 +-- src/game/stage/camera_destroy.c | 1 + src/game/stage/intro.c | 3 +- src/game/stage/results.c | 1 + src/game/stage/stage.c | 2 + src/game/time_attack/mode_select.c | 1 + src/game/trapped_animals.c | 1 + src/game/underwater_effects.c | 2 + src/game/unknown_effect.c | 2 + src/game/water_effects.c | 1 + src/sakit/collect_ring_effect.c | 1 + src/sakit/demo_manager.c | 1 + src/sakit/dust_cloud.c | 1 + src/sakit/enemy_defeat_score.c | 1 + src/sakit/interactables/044.c | 1 + src/sakit/interactables/grind_rail.c | 1 + src/sakit/interactables/pipe.c | 1 + src/sakit/interactables/platform.c | 1 + src/sakit/interactables/platform_square.c | 1 + src/sakit/interactables/platform_thin.c | 1 + src/sakit/interactables/ramp.c | 1 + src/sakit/interactables/slidy_ice.c | 1 + src/sakit/interactables/spring.c | 1 + src/sakit/item_box.c | 6 +- src/sakit/pause_menu.c | 4 + src/sakit/spot_light.c | 3 +- src/sakit/unknown_sprite.c | 1 + 160 files changed, 354 insertions(+), 181 deletions(-) create mode 100644 include/game/bosses/final_intro.h create mode 100644 include/game/multiplayer/player_unk_2.h delete mode 100644 include/game/player.h delete mode 100644 include/game/true_area_53/intro.h create mode 100644 include/sakit/entities_0.h diff --git a/.vscode/settings.json b/.vscode/settings.json index 4023cfefd..0325d0041 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -291,7 +291,15 @@ "zone_6.h": "c", "zone_final.h": "c", "pause_menu.h": "c", - "title_screen.h": "c" + "title_screen.h": "c", + "game_modes.h": "c", + "main.h": "c", + "unknown_task.h": "c", + "entities_0.h": "c", + "dust_cloud.h": "c", + "unknown_effect.h": "c", + "underwater_effects.h": "c", + "dust_effect_braking.h": "c" }, "asm-code-lens.donated": true, "editor.formatOnSave": true, diff --git a/include/constants/game_modes.h b/include/constants/game_modes.h index 613cf8ba9..52abcfc03 100644 --- a/include/constants/game_modes.h +++ b/include/constants/game_modes.h @@ -1,12 +1,4 @@ #ifndef GUARD_CONSTANTS_GAME_MODE_H #define GUARD_CONSTANTS_GAME_MODE_H -#define GAME_MODE_SINGLE_PLAYER 0 -#define GAME_MODE_TIME_ATTACK 1 -#define GAME_MODE_BOSS_TIME_ATTACK 2 - -#define GAME_MODE_MULTI_PLAYER 3 -#define GAME_MODE_TEAM_PLAY 4 -#define GAME_MODE_MULTI_PLAYER_COLLECT_RINGS 5 - #endif diff --git a/include/constants/zones.h b/include/constants/zones.h index 9b83bbe11..66486e270 100644 --- a/include/constants/zones.h +++ b/include/constants/zones.h @@ -54,4 +54,7 @@ #define IS_EXTRA_STAGE(lvl) ((lvl) == LEVEL_INDEX(ZONE_FINAL, ACT_TRUE_AREA_53)) #define IS_FINAL_OR_EXTRA_STAGE(lvl) ((IS_FINAL_STAGE(lvl)) || (IS_EXTRA_STAGE(lvl))) +#define ZONE_TIME_TO_INT(minutes, seconds) (((minutes * 60) + seconds) * 60) +#define MAX_COURSE_TIME (ZONE_TIME_TO_INT(10, 0)) + #endif // GUARD_ZONES_H \ No newline at end of file diff --git a/include/game/bosses/final_intro.h b/include/game/bosses/final_intro.h new file mode 100644 index 000000000..2527c57e9 --- /dev/null +++ b/include/game/bosses/final_intro.h @@ -0,0 +1,8 @@ +#ifndef GUARD_BOSSES_FINAL_INTRO_h +#define GUARD_BOSSES_FINAL_INTRO_h + +#include "global.h" + +void CreateTrueArea53Intro(void); + +#endif // GUARD_BOSSES_FINAL_INTRO_h diff --git a/include/game/dust_effect_braking.h b/include/game/dust_effect_braking.h index 1c0730c1d..1900f5e23 100644 --- a/include/game/dust_effect_braking.h +++ b/include/game/dust_effect_braking.h @@ -1,7 +1,17 @@ #ifndef GUARD_BRAKE_DUST_CLOUD_H #define GUARD_BRAKE_DUST_CLOUD_H -extern struct Task *CreateBrakingDustEffect(s32, s32); -extern void sub_801F754(void); +#include "core.h" + +struct Task *CreateBrakingDustEffect(s32, s32); +void sub_801F754(void); + +typedef struct { + s8 unk0; + u8 filler1[3]; + struct Task *t; +} UNK_30059D0; + +extern UNK_30059D0 gUnknown_030059D0; #endif // GUARD_BRAKE_DUST_CLOUD_H \ No newline at end of file diff --git a/include/game/entity.h b/include/game/entity.h index feed2a1c9..4b754c0aa 100644 --- a/include/game/entity.h +++ b/include/game/entity.h @@ -5,6 +5,7 @@ #include "gba/types.h" #include "sprite.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #define ENTITY_DATA_SIZE_SA1 4 diff --git a/include/game/game.h b/include/game/game.h index b69857743..4904115ff 100644 --- a/include/game/game.h +++ b/include/game/game.h @@ -15,45 +15,13 @@ #include "task.h" #include "sakit/globals.h" -#include "constants/game_modes.h" +#include "sakit/player.h" #include "constants/characters.h" -// TODO: force users to include player -#include "game/stage/player.h" - -#define ZONE_TIME_TO_INT(minutes, seconds) \ - (((minutes * 60) + seconds) * GBA_FRAMES_PER_SECOND) -#define MAX_COURSE_TIME (ZONE_TIME_TO_INT(10, 0)) - -#define TIME_RECORDS_PER_COURSE 3 - -// TODO: move to staging -#define NUM_MULTIPLAYER_SCORES 10 -#define MAX_MULTIPLAYER_SCORE 99 +#define SPECIAL_STAGE_REQUIRED_SP_RING_COUNT 7 void GameStart(void); -extern struct Task *gGameStageTask; - -typedef struct { - s8 unk0; - u8 filler1[3]; - struct Task *t; -} UNK_30059D0; - -extern UNK_30059D0 gUnknown_030059D0; - -// Copies of BG control regs for Multiplayer(?) -typedef struct { - u16 unk0; - u16 unk2; - u16 unk4; - u16 unk6; -} MultiPlayerBgCtrlRegs; /* size: 8 */ -extern MultiPlayerBgCtrlRegs *gUnknown_03005840; - -extern u8 gSmallAirBubbleCount; - struct MultiplayerPlayer { // TODO: Verify that this is Sprite! // (Used in Task_Item_Invincibility @ 0x0802AC60) @@ -73,35 +41,6 @@ struct MultiplayerPlayer { // Some sort of unused task variable extern struct Task *gDummyTask; -struct UNK_80D62D8 { - u8 unk0[28]; - u32 unk1C; - u32 unk20; - u8 unk24[12]; -}; - -typedef struct { - u16 pal[16 * 16]; -} WaterData; - -// Seems to be belonging to water effect -typedef struct { - /* 0x00 */ bool8 isActive; - /* 0x01 */ u8 unk1; - /* 0x01 */ u8 unk2; - /* 0x01 */ u8 unk3; - /* 0x04 */ s16 currentWaterLevel; - /* 0x06 */ s16 targetWaterLevel; - /* 0x08 */ u32 unk8; - /* 0x0C */ u32 mask; - - // t -> u16 palette[16*16] (additional "palette memory" for GUI stuff?) - /* 0x10 */ struct Task *t; /* size: 0x400 */ - /* 0x14 */ Sprite s; -} Water; - -extern Water gWater; - // TODO: find out what task is parent to IA typedef struct { u8 filler0[0x18]; @@ -123,15 +62,6 @@ typedef struct { /* 0x2C */ Sprite s; } TaskStrc_8011C98; /* size: 0x5C */ -struct Backgrounds { - Background unk0; - Background unk40; - Background unk80; - Background unkC0; -}; - -extern struct Backgrounds gStageBackgroundsRam; - // rodata extern const AnimId gPlayerCharacterIdleAnims[NUM_CHARACTERS]; @@ -150,28 +80,12 @@ extern const u8 gUnknown_08CB41C0[0x6a44]; extern const u8 gUnknown_08CBAC04[]; -// TODO: Might need to be moved out of this header? -void Player_SetMovestate_IsInScriptedSequence(void); -void Player_ClearMovestate_IsInScriptedSequence(void); - -void sub_802E164(s32, u16); - -void CreateTrueArea53Intro(void); - // Sweep anim -void sub_802E044(s32, u16); - -u16 CreateStageResults(u32, u16, u8); -void sub_8019F08(void); struct Task *CreateStageGoalBonusPointsAnim(s32, s32, u16); extern void Task_801F214(void); void sub_801F550(struct Task *); -void sub_80218E4(Player *); -void sub_8023B5C(Player *, s8); -void sub_8023260(Player *); - // HandlePlayerDestroy? extern bool32 sub_800C4FC(Sprite *, s32, s32, u8); @@ -193,17 +107,6 @@ s32 sub_801F07C(s32, s32, s32, s32, void *, Func801F100); s32 sub_801F100(s32, s32, s32, s32, Func801F100); -// TODO: Include header this belongs to -u32 sub_800C944(Sprite *, s32, s32); - -// TODO: Include header this belongs to -bool32 sub_800CA20(Sprite *s, s32 x, s32 y, u16 p3, Player *p); -bool32 sub_800C320(Sprite *s, s32 x, s32 y, u16 p3, Player *p); -bool32 sub_800C418(Sprite *s, s32 x, s32 y, u16 p3, Player *p); - -// Lose rings? -bool32 sub_800CBA4(Player *); - // TODO: Move this into the module sub_801F15C gets defined in, once it's decomped typedef struct { /* 0x00 */ s32 x; diff --git a/include/game/game_7.h b/include/game/game_7.h index ea01b1106..ad86698b7 100644 --- a/include/game/game_7.h +++ b/include/game/game_7.h @@ -1,6 +1,10 @@ #ifndef GUARD_GAME_7_H #define GUARD_GAME_7_H +#include "global.h" + +void sub_802E044(s32, u16); +void sub_802E164(s32, u16); void sub_802DBC0(u8 p0, u16 p1); void sub_802DCC8(u8 p0, u16 p1); void sub_802DDC4(u8 p0, u16 p1); diff --git a/include/game/multiplayer/finish.h b/include/game/multiplayer/finish.h index 588c256a7..4d167db6d 100644 --- a/include/game/multiplayer/finish.h +++ b/include/game/multiplayer/finish.h @@ -1,6 +1,9 @@ #ifndef GUARD_MULTIPLAYER_FINISH_H #define GUARD_MULTIPLAYER_FINISH_H -extern void sub_8019CCC(u8 sioId, u8 count); +#include "global.h" + +void sub_8019CCC(u8 sioId, u8 count); +void sub_8019F08(void); #endif // GUARD_MULTIPLAYER_FINISH_H diff --git a/include/game/multiplayer/player_unk_2.h b/include/game/multiplayer/player_unk_2.h new file mode 100644 index 000000000..b647b2a97 --- /dev/null +++ b/include/game/multiplayer/player_unk_2.h @@ -0,0 +1,17 @@ + + +#ifndef GUARD_MULTIPLAYER_PLAYER_UNK_2_H +#define GUARD_MULTIPLAYER_PLAYER_UNK_2_H + +#include "global.h" + +// Copies of BG control regs for Multiplayer(?) +typedef struct { + u16 unk0; + u16 unk2; + u16 unk4; + u16 unk6; +} MultiPlayerBgCtrlRegs; /* size: 8 */ +extern MultiPlayerBgCtrlRegs *gUnknown_03005840; + +#endif // GUARD_MULTIPLAYER_PLAYER_UNK_2_H diff --git a/include/game/player.h b/include/game/player.h deleted file mode 100644 index a82fbf0d9..000000000 --- a/include/game/player.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef GUARD_PLAYER_H -#define GUARD_PLAYER_H - -#include "global.h" -#include "game/game.h" - -extern s32 sub_802195C(Player *p, u8 *p1, s32 *out); -extern s32 sub_8021A34(Player *p, u8 *p1, s32 *out); -extern s32 sub_8021B08(Player *p, u8 *p1, s32 *out); - -#endif // GUARD_PLAYER_H diff --git a/include/game/save.h b/include/game/save.h index d522e3fe7..bd8239c8f 100644 --- a/include/game/save.h +++ b/include/game/save.h @@ -2,12 +2,20 @@ #define GUARD_SAVE_H #include "global.h" -#include "constants/zones.h" + +#include "sakit/globals.h" + #include "game/player_controls.h" -#include "game/game.h" +#include "constants/zones.h" +#include "constants/characters.h" #define PLAYER_NAME_END_CHAR 0xFFFF +#define NUM_MULTIPLAYER_SCORES 10 +#define MAX_MULTIPLAYER_SCORE 99 + +#define TIME_RECORDS_PER_COURSE 3 + struct MultiplayerScore { u32 playerId; u16 playerName[MAX_PLAYER_NAME_LENGTH]; diff --git a/include/game/special_stage/main.h b/include/game/special_stage/main.h index b6f08758a..a51bbd9fa 100644 --- a/include/game/special_stage/main.h +++ b/include/game/special_stage/main.h @@ -5,8 +5,6 @@ #include "sprite.h" #include "game/screen_fade.h" -#define SPECIAL_STAGE_REQUIRED_SP_RING_COUNT 7 - #define SPECIAL_STAGE_ZONE_SIZE 8 #define MIN_SPECIAL_STAGE_PLAYER_X 48 diff --git a/include/game/stage/camera.h b/include/game/stage/camera.h index 7ca9da450..d267ac0d8 100644 --- a/include/game/stage/camera.h +++ b/include/game/stage/camera.h @@ -10,6 +10,7 @@ extern const Background gStageCameraBgTemplates[4]; void UpdateCamera(void); +// TODO: Collision extern const u32 *gUnknown_030059C8; extern const u16 gUnknown_080D5964[][2]; diff --git a/include/game/stage/player.h b/include/game/stage/player.h index 05e871eb3..2a82cb3f8 100644 --- a/include/game/stage/player.h +++ b/include/game/stage/player.h @@ -2,11 +2,16 @@ #define GUARD_STAGE_PLAYER_H #include "sakit/player.h" -#include "constants/move_states.h" - -#define PLAYER_IS_ALIVE (!(gPlayer.moveState & MOVESTATE_DEAD)) -#define IS_ALIVE(player) (!(player->moveState & MOVESTATE_DEAD)) void InitializePlayer(Player *p); +void sub_80218E4(Player *); +void sub_8023B5C(Player *, s8); +void sub_8023260(Player *); +s32 sub_802195C(Player *p, u8 *p1, s32 *out); +s32 sub_8021A34(Player *p, u8 *p1, s32 *out); +s32 sub_8021B08(Player *p, u8 *p1, s32 *out); + +void Player_SetMovestate_IsInScriptedSequence(void); +void Player_ClearMovestate_IsInScriptedSequence(void); #endif // GUARD_STAGE_PLAYER_H diff --git a/include/game/stage/results.h b/include/game/stage/results.h index 8fe14c8cb..30db6024d 100644 --- a/include/game/stage/results.h +++ b/include/game/stage/results.h @@ -1,6 +1,10 @@ #ifndef GUARD_STAGE_RESULTS_H #define GUARD_STAGE_RESULTS_H +#include "global.h" + +u16 CreateStageResults(u32, u16, u8); + extern const u16 sAnimsGotThroughZoneAndActNames[11][3]; extern const u16 sStageResultsHeadlineTexts[5][3]; extern const u16 sAnimsGotThroughCharacterNames[5][3]; diff --git a/include/game/stage/stage.h b/include/game/stage/stage.h index 8ebe51728..79b1650b1 100644 --- a/include/game/stage/stage.h +++ b/include/game/stage/stage.h @@ -14,4 +14,14 @@ void ApplyGameStageSettings(void); void GameStageStart(void); void CreateGameStage(void); +struct Backgrounds { + Background unk0; + Background unk40; + Background unk80; + Background unkC0; +}; + +extern struct Task *gGameStageTask; +extern struct Backgrounds gStageBackgroundsRam; + #endif // GUARD_STAGE_H \ No newline at end of file diff --git a/include/game/true_area_53/intro.h b/include/game/true_area_53/intro.h deleted file mode 100644 index 81f258abb..000000000 --- a/include/game/true_area_53/intro.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef GUARD_TRUE_AREA_53_INTRO_h -#define GUARD_TRUE_AREA_53_INTRO_h - -#include "global.h" - -void CreateTrueArea53Intro(void); - -#endif // GUARD_TRUE_AREA_53_INTRO_h diff --git a/include/game/underwater_effects.h b/include/game/underwater_effects.h index 83cf95659..66dfd5fdd 100644 --- a/include/game/underwater_effects.h +++ b/include/game/underwater_effects.h @@ -8,4 +8,6 @@ struct Task *SpawnAirBubbles(s32 p0, s32 p1, s32 p2, s32 p3); struct Task *SpawnBubblesAfterDrowning(Player *p); bool32 RandomlySpawnAirBubbles(Player *p); +extern u8 gSmallAirBubbleCount; + #endif // GUARD_GAME_2_H \ No newline at end of file diff --git a/include/game/water_effects.h b/include/game/water_effects.h index b7cf29c9c..1546599ce 100644 --- a/include/game/water_effects.h +++ b/include/game/water_effects.h @@ -1,8 +1,32 @@ -#ifndef GUARD_PLAYER_UNKNOWN_1 -#define GUARD_PLAYER_UNKNOWN_1 +#ifndef GUARD_WATER_EFFECT_H +#define GUARD_WATER_EFFECT_H + +#include "core.h" + +typedef struct { + u16 pal[16 * 16]; +} WaterData; + +// Seems to be belonging to water effect +typedef struct { + /* 0x00 */ bool8 isActive; + /* 0x01 */ u8 unk1; + /* 0x01 */ u8 unk2; + /* 0x01 */ u8 unk3; + /* 0x04 */ s16 currentWaterLevel; + /* 0x06 */ s16 targetWaterLevel; + /* 0x08 */ u32 unk8; + /* 0x0C */ u32 mask; + + // t -> u16 palette[16*16] (additional "palette memory" for GUI stuff?) + /* 0x10 */ struct Task *t; /* size: 0x400 */ + /* 0x14 */ Sprite s; +} Water; + +extern Water gWater; extern void sub_8011328(void); extern void CreateRunOnWaterEffect(void); extern struct Task *CreateWaterfallSurfaceHitEffect(s16 x, s16 y); -#endif // GUARD_PLAYER_UNKNOWN_1 \ No newline at end of file +#endif // GUARD_WATER_EFFECT_H diff --git a/include/sakit/entities_0.h b/include/sakit/entities_0.h new file mode 100644 index 000000000..cb4c582a3 --- /dev/null +++ b/include/sakit/entities_0.h @@ -0,0 +1,18 @@ +#ifndef GUARD_STAGE_ENTITIES_0_H +#define GUARD_STAGE_ENTITIES_0_H + +#include "core.h" +#include "sakit/player.h" + +// TODO: Include header this belongs to +u32 sub_800C944(Sprite *, s32, s32); + +// TODO: Include header this belongs to +bool32 sub_800CA20(Sprite *s, s32 x, s32 y, u16 p3, Player *p); +bool32 sub_800C320(Sprite *s, s32 x, s32 y, u16 p3, Player *p); +bool32 sub_800C418(Sprite *s, s32 x, s32 y, u16 p3, Player *p); + +// Lose rings? +bool32 sub_800CBA4(Player *); + +#endif // GUARD_STAGE_ENTITIES_0_H diff --git a/include/sakit/globals.h b/include/sakit/globals.h index ec85b85f9..fec1b8fed 100644 --- a/include/sakit/globals.h +++ b/include/sakit/globals.h @@ -4,6 +4,14 @@ #include "multi_sio.h" #include "core.h" +#define GAME_MODE_SINGLE_PLAYER 0 +#define GAME_MODE_TIME_ATTACK 1 +#define GAME_MODE_BOSS_TIME_ATTACK 2 + +#define GAME_MODE_MULTI_PLAYER 3 +#define GAME_MODE_TEAM_PLAY 4 +#define GAME_MODE_MULTI_PLAYER_COLLECT_RINGS 5 + #define IS_SINGLE_PLAYER \ ((gGameMode == GAME_MODE_SINGLE_PLAYER) || (gGameMode == GAME_MODE_TIME_ATTACK) \ || (gGameMode == GAME_MODE_BOSS_TIME_ATTACK)) diff --git a/include/sakit/player.h b/include/sakit/player.h index cbcd67656..ffcba42aa 100644 --- a/include/sakit/player.h +++ b/include/sakit/player.h @@ -2,6 +2,10 @@ #define GUARD_SAKIT_PLAYER_H #include "core.h" +#include "constants/move_states.h" + +#define PLAYER_IS_ALIVE (!(gPlayer.moveState & MOVESTATE_DEAD)) +#define IS_ALIVE(player) (!(player->moveState & MOVESTATE_DEAD)) typedef struct { /*0x00 */ u16 unk0[6]; // might be [5] diff --git a/src/game/amy_attack_heart_effect.c b/src/game/amy_attack_heart_effect.c index a8e3617c8..b7329016d 100644 --- a/src/game/amy_attack_heart_effect.c +++ b/src/game/amy_attack_heart_effect.c @@ -3,6 +3,7 @@ #include "malloc_vram.h" #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/amy_attack_heart_effect.h" diff --git a/src/game/boost_effect.c b/src/game/boost_effect.c index 508b240c5..64a1ac1cc 100644 --- a/src/game/boost_effect.c +++ b/src/game/boost_effect.c @@ -4,6 +4,7 @@ #include "malloc_vram.h" #include "data/sprite_data.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/boost_effect.h" diff --git a/src/game/boost_mode_particles.c b/src/game/boost_mode_particles.c index 9c8fbcaad..fc6600dac 100644 --- a/src/game/boost_mode_particles.c +++ b/src/game/boost_mode_particles.c @@ -1,6 +1,7 @@ #include "global.h" #include "core.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sprite.h" #include "task.h" diff --git a/src/game/bosses/boss_1.c b/src/game/bosses/boss_1.c index ef974f01e..9629f4620 100644 --- a/src/game/bosses/boss_1.c +++ b/src/game/bosses/boss_1.c @@ -4,6 +4,8 @@ #include "malloc_vram.h" #include "trig.h" +#include "sakit/entities_0.h" + #include "game/game.h" #include "game/save.h" #include "game/player_actor.h" @@ -14,7 +16,9 @@ #include "game/time_attack/results.h" #include "game/cutscenes/level_endings.h" #include "game/stage/boss_results_transition.h" +#include "game/stage/player.h" #include "game/stage/camera.h" +#include "game/stage/results.h" #include "game/screen_fade.h" #include "game/screen_shake.h" diff --git a/src/game/bosses/boss_5.c b/src/game/bosses/boss_5.c index c5cb8d805..1e1371e96 100644 --- a/src/game/bosses/boss_5.c +++ b/src/game/bosses/boss_5.c @@ -4,11 +4,14 @@ #include "malloc_vram.h" #include "trig.h" +#include "sakit/entities_0.h" + #include "game/game.h" #include "game/save.h" #include "game/bosses/common.h" #include "game/bosses/eggmobile_escape_sequence.h" #include "game/player_callbacks_1.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/screen_fade.h" diff --git a/src/game/bosses/common.c b/src/game/bosses/common.c index ffd210aac..0e70062aa 100644 --- a/src/game/bosses/common.c +++ b/src/game/bosses/common.c @@ -2,7 +2,8 @@ #include "sprite.h" #include "task.h" #include "trig.h" -#include "game/game.h" + +#include "game/stage/player.h" #include "game/bosses/common.h" #include "game/bosses/boss_1.h" #include "game/bosses/boss_2.h" diff --git a/src/game/bosses/explosion_parts.c b/src/game/bosses/explosion_parts.c index 910e3bcf8..eb5586d7b 100644 --- a/src/game/bosses/explosion_parts.c +++ b/src/game/bosses/explosion_parts.c @@ -3,6 +3,7 @@ #include "task.h" #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/bosses/common.h" #include "game/bosses/boss_1.h" diff --git a/src/game/bosses/final_intro.c b/src/game/bosses/final_intro.c index a64ede2b4..ef339331a 100644 --- a/src/game/bosses/final_intro.c +++ b/src/game/bosses/final_intro.c @@ -1,12 +1,13 @@ #include "core.h" #include "game/game.h" #include "game/stage/stage.h" -#include "game/true_area_53/intro.h" +#include "game/bosses/final_intro.h" #include "task.h" #include "lib/m4a.h" #include "sprite.h" #include "trig.h" #include "game/math.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/countdown.c b/src/game/countdown.c index 7cc119932..0405a77d3 100644 --- a/src/game/countdown.c +++ b/src/game/countdown.c @@ -4,6 +4,7 @@ #include "task.h" #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_mp_actor.h" #include "lib/m4a.h" diff --git a/src/game/course_select.c b/src/game/course_select.c index 2e9ead836..752b8a115 100644 --- a/src/game/course_select.c +++ b/src/game/course_select.c @@ -13,6 +13,7 @@ #include "task.h" #include "malloc_vram.h" #include "game/multiplayer/multipak_connection.h" +#include "game/bosses/final_intro.h" #include "trig.h" #include "constants/tilemaps.h" diff --git a/src/game/cutscenes/level_endings.c b/src/game/cutscenes/level_endings.c index 51abde0e6..d37fb534f 100644 --- a/src/game/cutscenes/level_endings.c +++ b/src/game/cutscenes/level_endings.c @@ -10,7 +10,9 @@ #include "trig.h" #include "game/course_select.h" #include "game/save.h" +#include "game/stage/player.h" #include "game/stage/camera.h" +#include "game/stage/results.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/dust_effect_braking.c b/src/game/dust_effect_braking.c index ed620893f..bf3866d26 100644 --- a/src/game/dust_effect_braking.c +++ b/src/game/dust_effect_braking.c @@ -2,7 +2,9 @@ #include "core.h" #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" +#include "game/dust_effect_braking.h" #include "constants/animations.h" diff --git a/src/game/dust_effect_spindash.c b/src/game/dust_effect_spindash.c index 2b629695f..855a092e4 100644 --- a/src/game/dust_effect_spindash.c +++ b/src/game/dust_effect_spindash.c @@ -1,5 +1,6 @@ #include "global.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "core.h" #include "malloc_vram.h" diff --git a/src/game/enemies/flickey.c b/src/game/enemies/flickey.c index 98a88ba55..de7c2fc54 100644 --- a/src/game/enemies/flickey.c +++ b/src/game/enemies/flickey.c @@ -3,6 +3,7 @@ #include "game/entity.h" #include "game/game.h" #include "sakit/entities_manager.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "task.h" #include "sprite.h" diff --git a/src/game/enemies/geji_geji.c b/src/game/enemies/geji_geji.c index 493e23c29..1da1bbfdd 100644 --- a/src/game/enemies/geji_geji.c +++ b/src/game/enemies/geji_geji.c @@ -1,7 +1,11 @@ #include "global.h" + +#include "sakit/entities_0.h" + #include "game/game.h" #include "game/entity.h" #include "game/enemies/geji_geji.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "malloc_vram.h" #include "sprite.h" diff --git a/src/game/enemies/gohla.c b/src/game/enemies/gohla.c index a0f92bdf5..795263091 100644 --- a/src/game/enemies/gohla.c +++ b/src/game/enemies/gohla.c @@ -2,6 +2,9 @@ #include "game/game.h" #include "game/entity.h" #include "game/enemies/gohla.h" + +#include "sakit/entities_0.h" + #include "malloc_vram.h" #include "sprite.h" #include "trig.h" diff --git a/src/game/enemies/hammerhead.c b/src/game/enemies/hammerhead.c index cb954c8d7..60462d1fd 100644 --- a/src/game/enemies/hammerhead.c +++ b/src/game/enemies/hammerhead.c @@ -3,6 +3,7 @@ #include "task.h" #include "trig.h" #include "game/enemies/hammerhead.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" diff --git a/src/game/enemies/kiki.c b/src/game/enemies/kiki.c index d4998c083..98f62a729 100644 --- a/src/game/enemies/kiki.c +++ b/src/game/enemies/kiki.c @@ -3,6 +3,8 @@ #include "game/entity.h" #include "game/enemies/kiki.h" #include "sakit/entities_manager.h" +#include "sakit/entities_0.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "malloc_vram.h" #include "sprite.h" diff --git a/src/game/enemies/kubinaga.c b/src/game/enemies/kubinaga.c index c7836edf0..8b33777d3 100644 --- a/src/game/enemies/kubinaga.c +++ b/src/game/enemies/kubinaga.c @@ -6,6 +6,7 @@ #include "game/enemies/kubinaga.h" #include "sakit/entities_manager.h" #include "game/enemies/projectiles.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "trig.h" diff --git a/src/game/enemies/kura_kura.c b/src/game/enemies/kura_kura.c index 89058937a..72ff5b7f8 100644 --- a/src/game/enemies/kura_kura.c +++ b/src/game/enemies/kura_kura.c @@ -7,6 +7,7 @@ #include "game/entity.h" #include "game/enemies/kura_kura.h" #include "sakit/entities_manager.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/enemies/madillo.c b/src/game/enemies/madillo.c index 129de029f..39c22feac 100644 --- a/src/game/enemies/madillo.c +++ b/src/game/enemies/madillo.c @@ -3,6 +3,8 @@ #include "game/entity.h" #include "game/enemies/madillo.h" #include "sakit/entities_manager.h" +#include "sakit/entities_0.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/enemies/mon.c b/src/game/enemies/mon.c index de68cb8cd..330b01cb3 100644 --- a/src/game/enemies/mon.c +++ b/src/game/enemies/mon.c @@ -4,6 +4,7 @@ #include "game/entity.h" #include "game/enemies/mon.h" #include "sakit/entities_manager.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/enemies/mouse.c b/src/game/enemies/mouse.c index 1af488b17..7c3591d3c 100644 --- a/src/game/enemies/mouse.c +++ b/src/game/enemies/mouse.c @@ -3,6 +3,7 @@ #include "game/entity.h" #include "game/enemies/mouse.h" #include "sakit/entities_manager.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "malloc_vram.h" #include "sprite.h" diff --git a/src/game/enemies/piko_piko.c b/src/game/enemies/piko_piko.c index c39b6116f..b65e7d124 100644 --- a/src/game/enemies/piko_piko.c +++ b/src/game/enemies/piko_piko.c @@ -1,5 +1,8 @@ #include "global.h" #include "malloc_vram.h" + +#include "sakit/entities_0.h" + #include "game/entity.h" #include "constants/animations.h" diff --git a/src/game/enemies/projectiles.c b/src/game/enemies/projectiles.c index 8a437ee02..8ceaf2ced 100644 --- a/src/game/enemies/projectiles.c +++ b/src/game/enemies/projectiles.c @@ -1,6 +1,7 @@ #include "global.h" #include "game/entity.h" #include "game/enemies/projectiles.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "malloc_vram.h" #include "task.h" diff --git a/src/game/enemies/spinner.c b/src/game/enemies/spinner.c index 3a0a9a3b4..8e2d106e2 100644 --- a/src/game/enemies/spinner.c +++ b/src/game/enemies/spinner.c @@ -3,6 +3,7 @@ #include "task.h" #include "malloc_vram.h" #include "game/entity.h" +#include "sakit/entities_0.h" #include "sakit/entities_manager.h" #include "constants/animations.h" diff --git a/src/game/enemies/straw.c b/src/game/enemies/straw.c index ac2d61a07..db3807d19 100644 --- a/src/game/enemies/straw.c +++ b/src/game/enemies/straw.c @@ -7,6 +7,7 @@ #include "game/entity.h" #include "game/enemies/straw.h" #include "sakit/entities_manager.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/game.c b/src/game/game.c index bd059e548..9666ad341 100644 --- a/src/game/game.c +++ b/src/game/game.c @@ -11,7 +11,12 @@ #include "game/multiboot/connection.h" #include "game/rings_scatter.h" #include "sakit/entities_manager.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" +#include "game/water_effects.h" +#include "game/underwater_effects.h" +#include "game/dust_effect_braking.h" void GameStart(void) { diff --git a/src/game/game_2.c b/src/game/game_2.c index 724588063..97bcaf84a 100644 --- a/src/game/game_2.c +++ b/src/game/game_2.c @@ -4,8 +4,10 @@ #include "task.h" #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/stage/stage.h" +#include "game/water_effects.h" #include "constants/animations.h" diff --git a/src/game/heart_particles_effect.c b/src/game/heart_particles_effect.c index e4b6b18b0..4077d6c5b 100644 --- a/src/game/heart_particles_effect.c +++ b/src/game/heart_particles_effect.c @@ -2,6 +2,7 @@ #include "game/heart_particles_effect.h" #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sprite.h" diff --git a/src/game/interactables_1/booster.c b/src/game/interactables_1/booster.c index d53500904..db70c0321 100644 --- a/src/game/interactables_1/booster.c +++ b/src/game/interactables_1/booster.c @@ -6,6 +6,7 @@ #include "task.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sprite.h" #include "game/game.h" diff --git a/src/game/interactables_1/bouncy_bar.c b/src/game/interactables_1/bouncy_bar.c index addf09d92..9995506f7 100644 --- a/src/game/interactables_1/bouncy_bar.c +++ b/src/game/interactables_1/bouncy_bar.c @@ -4,6 +4,7 @@ #include "sprite.h" #include "game/entity.h" #include "malloc_vram.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/game.h" #include "lib/m4a.h" diff --git a/src/game/interactables_1/checkpoint.c b/src/game/interactables_1/checkpoint.c index 38bb8da76..6765cc01b 100644 --- a/src/game/interactables_1/checkpoint.c +++ b/src/game/interactables_1/checkpoint.c @@ -11,6 +11,7 @@ #include "game/game.h" #include "game/entity.h" #include "sakit/palette_loader.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/interactables_1/corkscrew.c b/src/game/interactables_1/corkscrew.c index 9a15a3e49..9fe3975c0 100644 --- a/src/game/interactables_1/corkscrew.c +++ b/src/game/interactables_1/corkscrew.c @@ -7,6 +7,7 @@ #include "sprite.h" #include "trig.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" diff --git a/src/game/interactables_1/corkscrew_3d.c b/src/game/interactables_1/corkscrew_3d.c index 0f6e435f5..d801af0e6 100644 --- a/src/game/interactables_1/corkscrew_3d.c +++ b/src/game/interactables_1/corkscrew_3d.c @@ -3,6 +3,7 @@ #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_controls.h" #include "task.h" diff --git a/src/game/interactables_1/decoration.c b/src/game/interactables_1/decoration.c index 990973403..073ec869e 100644 --- a/src/game/interactables_1/decoration.c +++ b/src/game/interactables_1/decoration.c @@ -4,6 +4,7 @@ #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" diff --git a/src/game/interactables_1/gapped_loop.c b/src/game/interactables_1/gapped_loop.c index 856722f2a..98629a82e 100644 --- a/src/game/interactables_1/gapped_loop.c +++ b/src/game/interactables_1/gapped_loop.c @@ -3,6 +3,7 @@ #include "task.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_1/gapped_loop.h" #include "sprite.h" diff --git a/src/game/interactables_1/incline_ramp.c b/src/game/interactables_1/incline_ramp.c index a59f2efad..1d1f7b24f 100644 --- a/src/game/interactables_1/incline_ramp.c +++ b/src/game/interactables_1/incline_ramp.c @@ -3,6 +3,7 @@ #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sprite.h" diff --git a/src/game/interactables_1/platform_crumbling.c b/src/game/interactables_1/platform_crumbling.c index e89090d54..9a33bfc36 100644 --- a/src/game/interactables_1/platform_crumbling.c +++ b/src/game/interactables_1/platform_crumbling.c @@ -6,6 +6,7 @@ #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "game/interactables_1/platform_crumbling.h" diff --git a/src/game/interactables_1/rotating_handle.c b/src/game/interactables_1/rotating_handle.c index b9fd6d040..c5e421522 100644 --- a/src/game/interactables_1/rotating_handle.c +++ b/src/game/interactables_1/rotating_handle.c @@ -3,6 +3,7 @@ #include "lib/m4a.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_controls.h" #include "game/interactables_1/rotating_handle.h" diff --git a/src/game/interactables_1/spikes.c b/src/game/interactables_1/spikes.c index a75752525..957cf5bb2 100644 --- a/src/game/interactables_1/spikes.c +++ b/src/game/interactables_1/spikes.c @@ -5,7 +5,10 @@ #include "lib/m4a.h" #include "malloc_vram.h" +#include "sakit/entities_0.h" + #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/interactables_1/spring_bouncy.c b/src/game/interactables_1/spring_bouncy.c index 347e6f601..29e6dc9c0 100644 --- a/src/game/interactables_1/spring_bouncy.c +++ b/src/game/interactables_1/spring_bouncy.c @@ -5,6 +5,7 @@ #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sprite.h" diff --git a/src/game/interactables_1/stage_goal.c b/src/game/interactables_1/stage_goal.c index 1edafdc27..eb669325f 100644 --- a/src/game/interactables_1/stage_goal.c +++ b/src/game/interactables_1/stage_goal.c @@ -6,6 +6,7 @@ #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_1/stage_goal.h" #include "game/multiplayer/unknown_1.h" diff --git a/src/game/interactables_1/windmill.c b/src/game/interactables_1/windmill.c index 996717ad5..229e8a39a 100644 --- a/src/game/interactables_1/windmill.c +++ b/src/game/interactables_1/windmill.c @@ -3,6 +3,7 @@ #include "sprite.h" #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_1/windmill.h" diff --git a/src/game/interactables_2/105.c b/src/game/interactables_2/105.c index d2ac991fc..ab89bc350 100644 --- a/src/game/interactables_2/105.c +++ b/src/game/interactables_2/105.c @@ -1,7 +1,10 @@ #include "global.h" #include "gba/types.h" +#include "sakit/entities_0.h" + #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sprite.h" diff --git a/src/game/interactables_2/egg_utopia/cannon.c b/src/game/interactables_2/egg_utopia/cannon.c index 8e8b7d16a..022d2dc78 100644 --- a/src/game/interactables_2/egg_utopia/cannon.c +++ b/src/game/interactables_2/egg_utopia/cannon.c @@ -1,6 +1,7 @@ #include "core.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/cannon.h" diff --git a/src/game/interactables_2/egg_utopia/flying_handle.c b/src/game/interactables_2/egg_utopia/flying_handle.c index 479189499..6587c77cf 100644 --- a/src/game/interactables_2/egg_utopia/flying_handle.c +++ b/src/game/interactables_2/egg_utopia/flying_handle.c @@ -2,6 +2,7 @@ #include "core.h" #include "task.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_controls.h" #include "game/interactables_2/egg_utopia/flying_handle.h" diff --git a/src/game/interactables_2/egg_utopia/gravity_toggle.c b/src/game/interactables_2/egg_utopia/gravity_toggle.c index 888e8a309..031af75df 100644 --- a/src/game/interactables_2/egg_utopia/gravity_toggle.c +++ b/src/game/interactables_2/egg_utopia/gravity_toggle.c @@ -1,4 +1,5 @@ #include "core.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/gravity_toggle.h" diff --git a/src/game/interactables_2/egg_utopia/iron_ball.c b/src/game/interactables_2/egg_utopia/iron_ball.c index cb0b07235..950b14f0f 100644 --- a/src/game/interactables_2/egg_utopia/iron_ball.c +++ b/src/game/interactables_2/egg_utopia/iron_ball.c @@ -3,6 +3,10 @@ #include "malloc_vram.h" #include "task.h" #include "trig.h" + +#include "sakit/entities_0.h" + +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/iron_ball.h" diff --git a/src/game/interactables_2/egg_utopia/launcher.c b/src/game/interactables_2/egg_utopia/launcher.c index cb0e68cd2..2c1c80448 100644 --- a/src/game/interactables_2/egg_utopia/launcher.c +++ b/src/game/interactables_2/egg_utopia/launcher.c @@ -4,6 +4,7 @@ #include "malloc_vram.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_controls.h" #include "game/entity.h" diff --git a/src/game/interactables_2/egg_utopia/pole.c b/src/game/interactables_2/egg_utopia/pole.c index 15efeaf9e..2476e7b5e 100644 --- a/src/game/interactables_2/egg_utopia/pole.c +++ b/src/game/interactables_2/egg_utopia/pole.c @@ -4,6 +4,7 @@ #include "game/player_controls.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/pole.h" diff --git a/src/game/interactables_2/egg_utopia/speeding_platform.c b/src/game/interactables_2/egg_utopia/speeding_platform.c index 473dbb7fc..262c0c3c1 100644 --- a/src/game/interactables_2/egg_utopia/speeding_platform.c +++ b/src/game/interactables_2/egg_utopia/speeding_platform.c @@ -7,6 +7,7 @@ #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/egg_utopia/speeding_platform.h" diff --git a/src/game/interactables_2/hot_crater/crane.c b/src/game/interactables_2/hot_crater/crane.c index cdbf4199f..bf6bcc846 100644 --- a/src/game/interactables_2/hot_crater/crane.c +++ b/src/game/interactables_2/hot_crater/crane.c @@ -7,6 +7,7 @@ #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/hot_crater/crane.h" diff --git a/src/game/interactables_2/hot_crater/dash_ring.c b/src/game/interactables_2/hot_crater/dash_ring.c index 9824d435c..1a935b9b6 100644 --- a/src/game/interactables_2/hot_crater/dash_ring.c +++ b/src/game/interactables_2/hot_crater/dash_ring.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "task.h" diff --git a/src/game/interactables_2/hot_crater/floating_spring.c b/src/game/interactables_2/hot_crater/floating_spring.c index d80b956cf..ebdd966a8 100644 --- a/src/game/interactables_2/hot_crater/floating_spring.c +++ b/src/game/interactables_2/hot_crater/floating_spring.c @@ -5,6 +5,7 @@ #include "trig.h" #include "lib/m4a.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/hot_crater/floating_spring.h" diff --git a/src/game/interactables_2/hot_crater/hook_rail.c b/src/game/interactables_2/hot_crater/hook_rail.c index 6df4bd552..59813480d 100644 --- a/src/game/interactables_2/hot_crater/hook_rail.c +++ b/src/game/interactables_2/hot_crater/hook_rail.c @@ -7,6 +7,7 @@ #include "game/entity.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/hot_crater/hook_rail.h" diff --git a/src/game/interactables_2/hot_crater/turn_around_bar.c b/src/game/interactables_2/hot_crater/turn_around_bar.c index 5a0f23215..b3eb9862e 100644 --- a/src/game/interactables_2/hot_crater/turn_around_bar.c +++ b/src/game/interactables_2/hot_crater/turn_around_bar.c @@ -1,6 +1,7 @@ #include "global.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/hot_crater/turn_around_bar.h" #include "task.h" diff --git a/src/game/interactables_2/hot_crater/wind_up_stick.c b/src/game/interactables_2/hot_crater/wind_up_stick.c index 573525429..af6fc540f 100644 --- a/src/game/interactables_2/hot_crater/wind_up_stick.c +++ b/src/game/interactables_2/hot_crater/wind_up_stick.c @@ -1,6 +1,7 @@ #include "global.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/hot_crater/wind_up_stick.h" #include "task.h" diff --git a/src/game/interactables_2/ice_paradise/big_snowball.c b/src/game/interactables_2/ice_paradise/big_snowball.c index 9f0d88c6a..9ea34f7c3 100644 --- a/src/game/interactables_2/ice_paradise/big_snowball.c +++ b/src/game/interactables_2/ice_paradise/big_snowball.c @@ -5,6 +5,7 @@ #include "trig.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "game/interactables_2/ice_paradise/big_snowball.h" diff --git a/src/game/interactables_2/ice_paradise/funnel_sphere.c b/src/game/interactables_2/ice_paradise/funnel_sphere.c index 77b067146..0566f437c 100644 --- a/src/game/interactables_2/ice_paradise/funnel_sphere.c +++ b/src/game/interactables_2/ice_paradise/funnel_sphere.c @@ -6,6 +6,7 @@ #include "lib/m4a.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/ice_paradise/funnel_sphere.h" diff --git a/src/game/interactables_2/ice_paradise/half_pipe.c b/src/game/interactables_2/ice_paradise/half_pipe.c index d7b05fdff..95eb71117 100644 --- a/src/game/interactables_2/ice_paradise/half_pipe.c +++ b/src/game/interactables_2/ice_paradise/half_pipe.c @@ -5,6 +5,7 @@ #include "game/game.h" #include "game/entity.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/ice_paradise/half_pipe.h" diff --git a/src/game/interactables_2/ice_paradise/slowing_snow.c b/src/game/interactables_2/ice_paradise/slowing_snow.c index 66125a79e..f74faa5bc 100644 --- a/src/game/interactables_2/ice_paradise/slowing_snow.c +++ b/src/game/interactables_2/ice_paradise/slowing_snow.c @@ -2,6 +2,7 @@ #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/ice_paradise/slowing_snow.h" diff --git a/src/game/interactables_2/music_plant/german_flute.c b/src/game/interactables_2/music_plant/german_flute.c index 7b5133346..407af5587 100644 --- a/src/game/interactables_2/music_plant/german_flute.c +++ b/src/game/interactables_2/music_plant/german_flute.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/note_particle.h" #include "game/interactables_2/music_plant/german_flute.h" diff --git a/src/game/interactables_2/music_plant/guitar_string.c b/src/game/interactables_2/music_plant/guitar_string.c index f83285be1..b46395bbd 100644 --- a/src/game/interactables_2/music_plant/guitar_string.c +++ b/src/game/interactables_2/music_plant/guitar_string.c @@ -7,6 +7,7 @@ #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/music_plant/guitar_string.h" diff --git a/src/game/interactables_2/music_plant/keyboard.c b/src/game/interactables_2/music_plant/keyboard.c index 6055dfe1c..52bc5a7c9 100644 --- a/src/game/interactables_2/music_plant/keyboard.c +++ b/src/game/interactables_2/music_plant/keyboard.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/note_particle.h" #include "game/interactables_2/music_plant/keyboard.h" diff --git a/src/game/interactables_2/music_plant/note_block.c b/src/game/interactables_2/music_plant/note_block.c index a38596491..121ecf48c 100644 --- a/src/game/interactables_2/music_plant/note_block.c +++ b/src/game/interactables_2/music_plant/note_block.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/note_particle.h" #include "game/interactables_2/music_plant/note_block.h" diff --git a/src/game/interactables_2/music_plant/note_sphere.c b/src/game/interactables_2/music_plant/note_sphere.c index e52ef7d0d..a050ae67b 100644 --- a/src/game/interactables_2/music_plant/note_sphere.c +++ b/src/game/interactables_2/music_plant/note_sphere.c @@ -8,6 +8,7 @@ #include "trig.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/note_particle.h" #include "game/interactables_2/music_plant/note_sphere.h" diff --git a/src/game/interactables_2/music_plant/pipe_horn.c b/src/game/interactables_2/music_plant/pipe_horn.c index 1764f0aae..d083eb79d 100644 --- a/src/game/interactables_2/music_plant/pipe_horn.c +++ b/src/game/interactables_2/music_plant/pipe_horn.c @@ -5,6 +5,7 @@ #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/music_plant/pipe_horn.h" diff --git a/src/game/interactables_2/note_particle.c b/src/game/interactables_2/note_particle.c index caa2d9e39..a20f8f834 100644 --- a/src/game/interactables_2/note_particle.c +++ b/src/game/interactables_2/note_particle.c @@ -3,6 +3,7 @@ #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sprite.h" diff --git a/src/game/interactables_2/notification_ring_bonus.c b/src/game/interactables_2/notification_ring_bonus.c index 30e119d5b..3bb963af3 100644 --- a/src/game/interactables_2/notification_ring_bonus.c +++ b/src/game/interactables_2/notification_ring_bonus.c @@ -2,6 +2,7 @@ #include "malloc_vram.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/multiboot/collect_rings/time_display.h" diff --git a/src/game/interactables_2/sky_canyon/giant_propeller.c b/src/game/interactables_2/sky_canyon/giant_propeller.c index 25e78e9f1..f33d3cd14 100644 --- a/src/game/interactables_2/sky_canyon/giant_propeller.c +++ b/src/game/interactables_2/sky_canyon/giant_propeller.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/sky_canyon/giant_propeller.h" #include "lib/m4a.h" diff --git a/src/game/interactables_2/sky_canyon/propeller_spring.c b/src/game/interactables_2/sky_canyon/propeller_spring.c index 5783cf585..cbec7d547 100644 --- a/src/game/interactables_2/sky_canyon/propeller_spring.c +++ b/src/game/interactables_2/sky_canyon/propeller_spring.c @@ -1,6 +1,7 @@ #include "global.h" #include "game/interactables_2/sky_canyon/propeller_spring.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/game.h" #include "trig.h" diff --git a/src/game/interactables_2/sky_canyon/small_propeller.c b/src/game/interactables_2/sky_canyon/small_propeller.c index 0ff038851..a81cc4c8c 100644 --- a/src/game/interactables_2/sky_canyon/small_propeller.c +++ b/src/game/interactables_2/sky_canyon/small_propeller.c @@ -3,7 +3,9 @@ #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" + #include "sprite.h" #include "task.h" #include "trig.h" @@ -11,7 +13,7 @@ #include "malloc_vram.h" #include "constants/animations.h" -#include "constants/move_states.h" +#include "constants/zones.h" /* This is the small propellers appearing in Sky Canyon, which you can run at while keeping a distance from them and increasing your speed. diff --git a/src/game/interactables_2/sky_canyon/small_windmill.c b/src/game/interactables_2/sky_canyon/small_windmill.c index e95698d3c..3ea1ca69a 100644 --- a/src/game/interactables_2/sky_canyon/small_windmill.c +++ b/src/game/interactables_2/sky_canyon/small_windmill.c @@ -4,6 +4,7 @@ #include "trig.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/sky_canyon/small_windmill.h" #include "lib/m4a.h" diff --git a/src/game/interactables_2/sky_canyon/whirlwind.c b/src/game/interactables_2/sky_canyon/whirlwind.c index 89ed1b717..06ebbbf03 100644 --- a/src/game/interactables_2/sky_canyon/whirlwind.c +++ b/src/game/interactables_2/sky_canyon/whirlwind.c @@ -5,6 +5,7 @@ #include "core.h" #include "task.h" #include "lib/m4a.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/techno_base/light_globe.h" #include "malloc_vram.h" diff --git a/src/game/interactables_2/special_ring.c b/src/game/interactables_2/special_ring.c index c78b30c38..5ef1cbbc9 100644 --- a/src/game/interactables_2/special_ring.c +++ b/src/game/interactables_2/special_ring.c @@ -3,6 +3,7 @@ #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/player_actor.h" #include "task.h" diff --git a/src/game/interactables_2/techno_base/arrow_platform.c b/src/game/interactables_2/techno_base/arrow_platform.c index beb169e11..31c71e28d 100644 --- a/src/game/interactables_2/techno_base/arrow_platform.c +++ b/src/game/interactables_2/techno_base/arrow_platform.c @@ -6,6 +6,7 @@ #include "lib/m4a.h" #include "game/game.h" #include "game/entity.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/interactables_2/techno_base/arrow_platform.h" #include "constants/animations.h" diff --git a/src/game/interactables_2/techno_base/bounce_block.c b/src/game/interactables_2/techno_base/bounce_block.c index 0cde727e7..deab4fd5d 100644 --- a/src/game/interactables_2/techno_base/bounce_block.c +++ b/src/game/interactables_2/techno_base/bounce_block.c @@ -1,6 +1,7 @@ #include "global.h" #include "game/interactables_2/music_plant/note_block.h" #include "trig.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/game.h" #include "lib/m4a.h" diff --git a/src/game/interactables_2/techno_base/light_bridge.c b/src/game/interactables_2/techno_base/light_bridge.c index a2e48da43..647d541ee 100644 --- a/src/game/interactables_2/techno_base/light_bridge.c +++ b/src/game/interactables_2/techno_base/light_bridge.c @@ -1,5 +1,6 @@ #include "global.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "game/interactables_2/techno_base/light_bridge.h" diff --git a/src/game/interactables_2/techno_base/light_globe.c b/src/game/interactables_2/techno_base/light_globe.c index c076f824f..428986a23 100644 --- a/src/game/interactables_2/techno_base/light_globe.c +++ b/src/game/interactables_2/techno_base/light_globe.c @@ -1,5 +1,6 @@ #include "global.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "core.h" diff --git a/src/game/interactables_2/techno_base/spike_platform.c b/src/game/interactables_2/techno_base/spike_platform.c index 1a3a3652e..3cabc40a0 100644 --- a/src/game/interactables_2/techno_base/spike_platform.c +++ b/src/game/interactables_2/techno_base/spike_platform.c @@ -4,7 +4,11 @@ #include "task.h" #include "trig.h" #include "lib/m4a.h" + +#include "sakit/entities_0.h" + #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "game/interactables_2/techno_base/spike_platform.h" diff --git a/src/game/item_tasks.c b/src/game/item_tasks.c index 93546315f..9f110604f 100644 --- a/src/game/item_tasks.c +++ b/src/game/item_tasks.c @@ -4,6 +4,7 @@ #include "task.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/item_tasks.h" diff --git a/src/game/multiboot/connection.c b/src/game/multiboot/connection.c index 882501311..514706a77 100644 --- a/src/game/multiboot/connection.c +++ b/src/game/multiboot/connection.c @@ -12,6 +12,7 @@ #include "game/multiboot/connection.h" #include "game/multiboot/collect_rings/results.h" #include "game/multiplayer/multipak_connection.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/multiplayer/mode_select.h" #include "game/rings_scatter.h" diff --git a/src/game/multiplayer/finish.c b/src/game/multiplayer/finish.c index f3e961e5b..2f3f72ef3 100644 --- a/src/game/multiplayer/finish.c +++ b/src/game/multiplayer/finish.c @@ -5,6 +5,7 @@ #include "malloc_vram.h" #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/multiplayer/finish.h" #include "game/save.h" diff --git a/src/game/multiplayer/mode_select.c b/src/game/multiplayer/mode_select.c index 7848a3e98..467b548c7 100644 --- a/src/game/multiplayer/mode_select.c +++ b/src/game/multiplayer/mode_select.c @@ -13,6 +13,7 @@ #include "game/screen_fade.h" #include "game/stage/boss_results_transition.h" #include "game/title_screen.h" +#include "game/game_7.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/multiplayer/player_unk_2.c b/src/game/multiplayer/player_unk_2.c index f2a73d643..83f9bb931 100644 --- a/src/game/multiplayer/player_unk_2.c +++ b/src/game/multiplayer/player_unk_2.c @@ -1,6 +1,7 @@ #include "global.h" #include "core.h" #include "game/game.h" +#include "game/multiplayer/player_unk_2.h" #include "constants/zones.h" diff --git a/src/game/mystery_item_box.c b/src/game/mystery_item_box.c index d4c5ec713..e3146768d 100644 --- a/src/game/mystery_item_box.c +++ b/src/game/mystery_item_box.c @@ -1,10 +1,13 @@ #include "core.h" #include "malloc_vram.h" #include "game/game.h" +#include "sakit/entities_0.h" + #include "game/entity.h" #include "game/mystery_item_box.h" #include "game/multiplayer/unknown_1.h" #include "sakit/dust_cloud.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "lib/m4a.h" diff --git a/src/game/player_0.c b/src/game/player_0.c index d65cda55f..ceeff3fd2 100644 --- a/src/game/player_0.c +++ b/src/game/player_0.c @@ -14,9 +14,9 @@ #include "game/stage/stage.h" #include "game/water_effects.h" #include "game/unknown_effect.h" +#include "game/multiplayer/player_unk_2.h" #include "constants/animations.h" -#include "constants/move_states.h" #include "constants/player_transitions.h" #include "constants/songs.h" diff --git a/src/game/player_3.c b/src/game/player_3.c index d2047c6bb..6cb277ffb 100644 --- a/src/game/player_3.c +++ b/src/game/player_3.c @@ -3,10 +3,10 @@ #include "game/game.h" #include "game/player_callbacks_1.h" #include "game/playerfn_cmds.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" -#include "constants/move_states.h" #include "constants/player_transitions.h" const u16 gUnknown_080D6736[115][2] = { diff --git a/src/game/player_callbacks_0.c b/src/game/player_callbacks_0.c index 0ae2d5073..0ffb394c0 100644 --- a/src/game/player_callbacks_0.c +++ b/src/game/player_callbacks_0.c @@ -9,6 +9,7 @@ #include "game/boost_effect.h" #include "game/player_callbacks_1.h" #include "game/playerfn_cmds.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/parameters/characters.h" diff --git a/src/game/player_callbacks_1.c b/src/game/player_callbacks_1.c index 4bff2f689..093a8e682 100644 --- a/src/game/player_callbacks_1.c +++ b/src/game/player_callbacks_1.c @@ -6,8 +6,8 @@ #include "game/heart_particles_effect.h" #include "sakit/music_manager.h" -#include "game/player.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/amy_attack_heart_effect.h" #include "game/boost_mode_particles.h" // incl. CreateBoostModeParticles @@ -16,8 +16,8 @@ #include "game/parameters/characters.h" #include "game/playerfn_cmds.h" #include "game/rings_scatter.h" -#include "game/special_stage/main.h" #include "game/time_attack/results.h" // for PlayerCB_80278D4 +#include "game/stage/results.h" #include "constants/animations.h" #include "constants/player_transitions.h" diff --git a/src/game/race_progress.c b/src/game/race_progress.c index c0c67c387..edaf1cf33 100644 --- a/src/game/race_progress.c +++ b/src/game/race_progress.c @@ -1,10 +1,11 @@ -#include "game/race_progress.h" #include "core.h" -#include "game/game.h" #include "task.h" #include "sprite.h" -#include "game/screen_fade.h" #include "malloc_vram.h" +#include "game/game.h" +#include "game/race_progress.h" +#include "game/stage/player.h" +#include "game/screen_fade.h" #include "constants/animations.h" #include "constants/zones.h" diff --git a/src/game/rings_scatter.c b/src/game/rings_scatter.c index a2f2dc3c9..5bc209a79 100644 --- a/src/game/rings_scatter.c +++ b/src/game/rings_scatter.c @@ -3,6 +3,7 @@ #include "trig.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/rings_scatter.h" #include "sakit/collect_ring_effect.h" diff --git a/src/game/screen_shake.c b/src/game/screen_shake.c index 8663c2109..b95e67cc1 100644 --- a/src/game/screen_shake.c +++ b/src/game/screen_shake.c @@ -2,6 +2,7 @@ #include "core.h" #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/screen_shake.h" diff --git a/src/game/spark_effect.c b/src/game/spark_effect.c index 5671b907f..c2c55d8b2 100644 --- a/src/game/spark_effect.c +++ b/src/game/spark_effect.c @@ -1,5 +1,6 @@ #include "global.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "core.h" #include "malloc_vram.h" diff --git a/src/game/stage/background/callbacks.c b/src/game/stage/background/callbacks.c index 8397dd065..c66464e70 100644 --- a/src/game/stage/background/callbacks.c +++ b/src/game/stage/background/callbacks.c @@ -2,6 +2,7 @@ #include "core.h" #include "game/game.h" #include "game/stage/background/zone_3.h" +#include "game/stage/player.h" #include "game/stage/camera.h" // Unused diff --git a/src/game/stage/background/zone_1.c b/src/game/stage/background/zone_1.c index 4d7a031af..7b08e8243 100644 --- a/src/game/stage/background/zone_1.c +++ b/src/game/stage/background/zone_1.c @@ -4,7 +4,8 @@ #include "sprite.h" #include "trig.h" #include "game/game.h" -#include "game/special_stage/main.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_1_boss.c b/src/game/stage/background/zone_1_boss.c index 5bf50d9ff..02c410abf 100644 --- a/src/game/stage/background/zone_1_boss.c +++ b/src/game/stage/background/zone_1_boss.c @@ -2,6 +2,7 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/stage/background/callbacks.h" diff --git a/src/game/stage/background/zone_2.c b/src/game/stage/background/zone_2.c index 7e1438ed8..7287a4826 100644 --- a/src/game/stage/background/zone_2.c +++ b/src/game/stage/background/zone_2.c @@ -3,7 +3,7 @@ #include "flags.h" #include "trig.h" #include "game/game.h" -#include "game/special_stage/main.h" +#include "game/stage/player.h" // (88.05%) https://decomp.me/scratch/ekyaq NONMATCH("asm/non_matching/game/stage/background/StageBgUpdate_Zone2Acts12.inc", diff --git a/src/game/stage/background/zone_2_boss.c b/src/game/stage/background/zone_2_boss.c index 958616657..e2427ca98 100644 --- a/src/game/stage/background/zone_2_boss.c +++ b/src/game/stage/background/zone_2_boss.c @@ -1,7 +1,7 @@ #include "global.h" #include "core.h" -#include "game/game.h" - +#include "sakit/globals.h" +#include "game/stage/player.h" #include "game/stage/background/zone_2.h" void StageBgUpdate_Zone2ActBoss(UNUSED s32 a, UNUSED s32 b) diff --git a/src/game/stage/background/zone_3.c b/src/game/stage/background/zone_3.c index dd238d801..8251bd181 100644 --- a/src/game/stage/background/zone_3.c +++ b/src/game/stage/background/zone_3.c @@ -2,8 +2,9 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/stage.h" #include "game/stage/background/callbacks.h" -#include "game/special_stage/main.h" +#include "game/stage/player.h" extern const Background gStageCameraBgTemplates[4]; diff --git a/src/game/stage/background/zone_4.c b/src/game/stage/background/zone_4.c index 4e9dd9ee5..e306a4c47 100644 --- a/src/game/stage/background/zone_4.c +++ b/src/game/stage/background/zone_4.c @@ -4,7 +4,8 @@ #include "animation_commands_bg.h" #include "game/game.h" #include "sakit/spot_light.h" -#include "game/special_stage/main.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_5.c b/src/game/stage/background/zone_5.c index 3da65ccd2..775447e28 100644 --- a/src/game/stage/background/zone_5.c +++ b/src/game/stage/background/zone_5.c @@ -2,6 +2,7 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/stage.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_6.c b/src/game/stage/background/zone_6.c index ce98c2dbd..9a0b36fa1 100644 --- a/src/game/stage/background/zone_6.c +++ b/src/game/stage/background/zone_6.c @@ -2,6 +2,7 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/stage.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_6_2.c b/src/game/stage/background/zone_6_2.c index 1f5ae2eca..2c475bc25 100644 --- a/src/game/stage/background/zone_6_2.c +++ b/src/game/stage/background/zone_6_2.c @@ -2,6 +2,8 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_7_1.c b/src/game/stage/background/zone_7_1.c index 082b56d00..f46972df0 100644 --- a/src/game/stage/background/zone_7_1.c +++ b/src/game/stage/background/zone_7_1.c @@ -4,7 +4,8 @@ #include "flags.h" #include "trig.h" #include "game/game.h" -#include "game/special_stage/main.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/stage/background/zone_7.h" diff --git a/src/game/stage/background/zone_7_boss.c b/src/game/stage/background/zone_7_boss.c index ad676923f..c8ff0436f 100644 --- a/src/game/stage/background/zone_7_boss.c +++ b/src/game/stage/background/zone_7_boss.c @@ -1,7 +1,7 @@ #include "global.h" #include "core.h" -#include "game/game.h" - +#include "sakit/globals.h" +#include "game/stage/player.h" #include "game/stage/background/zone_7.h" void StageBgUpdate_Zone7ActBoss(UNUSED s32 x, UNUSED s32 y) diff --git a/src/game/stage/background/zone_final.c b/src/game/stage/background/zone_final.c index 06144a52c..32269557d 100644 --- a/src/game/stage/background/zone_final.c +++ b/src/game/stage/background/zone_final.c @@ -3,6 +3,8 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/tilemaps.h" diff --git a/src/game/stage/background/zone_final_boss.c b/src/game/stage/background/zone_final_boss.c index 10bbed20d..45ccd18cc 100644 --- a/src/game/stage/background/zone_final_boss.c +++ b/src/game/stage/background/zone_final_boss.c @@ -1,8 +1,8 @@ #include "global.h" #include "core.h" #include "flags.h" -#include "game/game.h" - +#include "sakit/globals.h" +#include "game/stage/player.h" #include "game/stage/background/callbacks.h" void StageBgUpdate_ZoneFinalActXX(void) @@ -13,4 +13,4 @@ void StageBgUpdate_ZoneFinalActXX(void) gHBlankCallbacks[gNumHBlankCallbacks++] = HBlankCB_BgUpdateZoneFinalActXX; gFlags |= FLAGS_EXECUTE_HBLANK_CALLBACKS; -} \ No newline at end of file +} diff --git a/src/game/stage/boss_results_transition.c b/src/game/stage/boss_results_transition.c index 43fe8e515..cecd40118 100644 --- a/src/game/stage/boss_results_transition.c +++ b/src/game/stage/boss_results_transition.c @@ -6,6 +6,7 @@ #include "game/game.h" #include "game/player_actor.h" #include "game/save.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/cutscenes/level_endings.h" #include "game/screen_fade.h" diff --git a/src/game/stage/camera.c b/src/game/stage/camera.c index e3c4995cb..14766141b 100644 --- a/src/game/stage/camera.c +++ b/src/game/stage/camera.c @@ -5,6 +5,7 @@ #include "sakit/globals.h" +#include "game/stage/stage.h" #include "game/stage/camera.h" #include "game/stage/player.h" #include "game/stage/background/dummy.h" @@ -19,22 +20,8 @@ #include "constants/tilemaps.h" #include "constants/zones.h" -#include "constants/game_modes.h" #include "constants/characters.h" -// TODO: move to right place -struct Backgrounds { - Background unk0; - Background unk40; - Background unk80; - Background unkC0; -}; - -extern struct Backgrounds gStageBackgroundsRam; - -extern const CameraMain sStageBgUpdateFuncs[]; -extern const u32 *gCollisionTable[NUM_LEVEL_IDS]; - static void sub_801C708(s32, s32); void Task_801E0A8(void); void TaskDestructor_801E040(struct Task *); @@ -370,7 +357,7 @@ void InitCamera(u32 level) } if (gGameMode != GAME_MODE_MULTI_PLAYER_COLLECT_RINGS) { - gUnknown_030059C8 = gCollisionTable[level]; + gUnknown_030059C8 = (u32 *)gCollisionTable[level]; } else { gUnknown_030059C8 = *(u32 **)(EWRAM_START + 0x33004); } diff --git a/src/game/stage/camera_destroy.c b/src/game/stage/camera_destroy.c index f399c4fe7..18014e34a 100644 --- a/src/game/stage/camera_destroy.c +++ b/src/game/stage/camera_destroy.c @@ -2,6 +2,7 @@ #include "core.h" #include "flags.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/zones.h" diff --git a/src/game/stage/intro.c b/src/game/stage/intro.c index ee203ea96..919c74c7f 100644 --- a/src/game/stage/intro.c +++ b/src/game/stage/intro.c @@ -2,7 +2,8 @@ #include "flags.h" #include "malloc_vram.h" #include "trig.h" -#include "game/game.h" +#include "sakit/globals.h" +#include "game/stage/player.h" #include "game/player_actor.h" #include "game/game_7.h" #include "game/bosses/common.h" diff --git a/src/game/stage/results.c b/src/game/stage/results.c index 315afeb29..88938c7db 100644 --- a/src/game/stage/results.c +++ b/src/game/stage/results.c @@ -5,6 +5,7 @@ #include "task.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/stage.h" #include "game/course_select.h" #include "game/cutscenes/endings.h" diff --git a/src/game/stage/stage.c b/src/game/stage/stage.c index bd7088b57..3d8acd993 100644 --- a/src/game/stage/stage.c +++ b/src/game/stage/stage.c @@ -6,6 +6,7 @@ #include "game/save.h" #include "game/player_actor.h" #include "game/stage/stage.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sakit/entities_manager.h" #include "sakit/music_manager.h" @@ -18,6 +19,7 @@ #include "game/time_attack/lobby.h" #include "game/game_over.h" #include "game/player_controls.h" +#include "game/multiplayer/finish.h" #include "game/multiboot/collect_rings/time_display.h" diff --git a/src/game/time_attack/mode_select.c b/src/game/time_attack/mode_select.c index 918246168..9149ac03d 100644 --- a/src/game/time_attack/mode_select.c +++ b/src/game/time_attack/mode_select.c @@ -10,6 +10,7 @@ #include "game/time_attack/mode_select.h" #include "game/screen_fade.h" #include "game/title_screen.h" +#include "game/game_7.h" #include "constants/animations.h" #include "constants/songs.h" diff --git a/src/game/trapped_animals.c b/src/game/trapped_animals.c index 1b09848a3..61bf224cf 100644 --- a/src/game/trapped_animals.c +++ b/src/game/trapped_animals.c @@ -2,6 +2,7 @@ #include "trig.h" #include "game/game.h" #include "game/stage/ui.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/game/underwater_effects.c b/src/game/underwater_effects.c index 077fd1953..cc3790b0e 100644 --- a/src/game/underwater_effects.c +++ b/src/game/underwater_effects.c @@ -4,8 +4,10 @@ #include "sprite.h" #include "trig.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/underwater_effects.h" +#include "game/water_effects.h" #include "game/game_3.h" #include "constants/animations.h" diff --git a/src/game/unknown_effect.c b/src/game/unknown_effect.c index adc4dfb5d..cd3701f3b 100644 --- a/src/game/unknown_effect.c +++ b/src/game/unknown_effect.c @@ -1,6 +1,8 @@ #include "core.h" #include "game/game.h" +#include "sakit/entities_0.h" #include "game/unknown_effect.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "lib/m4a.h" diff --git a/src/game/water_effects.c b/src/game/water_effects.c index 7a9423a2f..b863ab5ef 100644 --- a/src/game/water_effects.c +++ b/src/game/water_effects.c @@ -5,6 +5,7 @@ #include "task.h" #include "game/game.h" #include "game/boost_effect.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "data/sprite_data.h" diff --git a/src/sakit/collect_ring_effect.c b/src/sakit/collect_ring_effect.c index 7dce1a13c..a5a6a7ad8 100644 --- a/src/sakit/collect_ring_effect.c +++ b/src/sakit/collect_ring_effect.c @@ -2,6 +2,7 @@ #include "task.h" #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sakit/collect_ring_effect.h" #include "sakit/rings_manager.h" diff --git a/src/sakit/demo_manager.c b/src/sakit/demo_manager.c index bd7c2dea4..f4bc34a6e 100644 --- a/src/sakit/demo_manager.c +++ b/src/sakit/demo_manager.c @@ -7,6 +7,7 @@ #include "lib/m4a.h" #include "sakit/demo_manager.h" +#include "sakit/player.h" // TODO: add headers for these into sakit // instead of including from the main game diff --git a/src/sakit/dust_cloud.c b/src/sakit/dust_cloud.c index fcc08c491..987ca6ffc 100644 --- a/src/sakit/dust_cloud.c +++ b/src/sakit/dust_cloud.c @@ -1,6 +1,7 @@ #include "global.h" #include "sprite.h" #include "task.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/game.h" diff --git a/src/sakit/enemy_defeat_score.c b/src/sakit/enemy_defeat_score.c index 8504fbd2f..db657b160 100644 --- a/src/sakit/enemy_defeat_score.c +++ b/src/sakit/enemy_defeat_score.c @@ -2,6 +2,7 @@ #include "sprite.h" #include "task.h" #include "malloc_vram.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/game.h" diff --git a/src/sakit/interactables/044.c b/src/sakit/interactables/044.c index f92a3de92..86eb11c4b 100644 --- a/src/sakit/interactables/044.c +++ b/src/sakit/interactables/044.c @@ -6,6 +6,7 @@ #include "game/game.h" #include "game/entity.h" #include "sakit/interactables/044.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/player_transitions.h" diff --git a/src/sakit/interactables/grind_rail.c b/src/sakit/interactables/grind_rail.c index 09fd50dad..56bf31257 100644 --- a/src/sakit/interactables/grind_rail.c +++ b/src/sakit/interactables/grind_rail.c @@ -4,6 +4,7 @@ #include "game/player_controls.h" #include "game/entity.h" #include "sakit/interactables/grind_rail.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "lib/m4a.h" diff --git a/src/sakit/interactables/pipe.c b/src/sakit/interactables/pipe.c index 7ef24416f..27ce3f927 100644 --- a/src/sakit/interactables/pipe.c +++ b/src/sakit/interactables/pipe.c @@ -7,6 +7,7 @@ #include "game/game.h" #include "game/entity.h" #include "sakit/interactables/pipe.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/player_transitions.h" diff --git a/src/sakit/interactables/platform.c b/src/sakit/interactables/platform.c index 4a091e666..57f36a7dc 100644 --- a/src/sakit/interactables/platform.c +++ b/src/sakit/interactables/platform.c @@ -6,6 +6,7 @@ #include "malloc_vram.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sakit/interactables/platform.h" diff --git a/src/sakit/interactables/platform_square.c b/src/sakit/interactables/platform_square.c index a9305b873..ffefac998 100644 --- a/src/sakit/interactables/platform_square.c +++ b/src/sakit/interactables/platform_square.c @@ -9,6 +9,7 @@ #include "game/game.h" #include "game/entity.h" #include "sakit/interactables/platform_square.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/sakit/interactables/platform_thin.c b/src/sakit/interactables/platform_thin.c index 4bcae016a..78d26de48 100644 --- a/src/sakit/interactables/platform_thin.c +++ b/src/sakit/interactables/platform_thin.c @@ -9,6 +9,7 @@ #include "game/entity.h" #include "sakit/interactables/platform_thin.h" #include "game/multiplayer/unknown_1.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/zones.h" diff --git a/src/sakit/interactables/ramp.c b/src/sakit/interactables/ramp.c index bee17a9e1..9a17e12a6 100644 --- a/src/sakit/interactables/ramp.c +++ b/src/sakit/interactables/ramp.c @@ -6,6 +6,7 @@ #include "malloc_vram.h" #include "game/player_controls.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sakit/interactables/ramp.h" diff --git a/src/sakit/interactables/slidy_ice.c b/src/sakit/interactables/slidy_ice.c index c08a68e31..475a12773 100644 --- a/src/sakit/interactables/slidy_ice.c +++ b/src/sakit/interactables/slidy_ice.c @@ -2,6 +2,7 @@ #include "task.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sakit/interactables/slidy_ice.h" diff --git a/src/sakit/interactables/spring.c b/src/sakit/interactables/spring.c index a0e9f77b0..d5f20a2bd 100644 --- a/src/sakit/interactables/spring.c +++ b/src/sakit/interactables/spring.c @@ -7,6 +7,7 @@ #include "lib/m4a.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "game/entity.h" #include "sakit/interactables/spring.h" diff --git a/src/sakit/item_box.c b/src/sakit/item_box.c index 30930f4ad..7be17d85a 100644 --- a/src/sakit/item_box.c +++ b/src/sakit/item_box.c @@ -5,11 +5,15 @@ #include "task.h" #include "trig.h" #include "lib/m4a.h" + +#include "sakit/entities_0.h" +#include "sakit/dust_cloud.h" + #include "game/game.h" #include "game/entity.h" #include "game/item_tasks.h" #include "game/multiplayer/unknown_1.h" -#include "sakit/dust_cloud.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "constants/animations.h" diff --git a/src/sakit/pause_menu.c b/src/sakit/pause_menu.c index b1fc82f8f..c9ba06cae 100644 --- a/src/sakit/pause_menu.c +++ b/src/sakit/pause_menu.c @@ -4,9 +4,13 @@ #include "core.h" #include "malloc_vram.h" + +#include "sakit/globals.h" + #include "game/save.h" #include "game/time_attack/lobby.h" #include "game/title_screen.h" +#include "game/water_effects.h" #include "constants/animations.h" #include "flags.h" diff --git a/src/sakit/spot_light.c b/src/sakit/spot_light.c index 3fca82603..689794919 100644 --- a/src/sakit/spot_light.c +++ b/src/sakit/spot_light.c @@ -3,9 +3,10 @@ #include "task.h" #include "trig.h" -#include "game/game.h" +#include "sakit/globals.h" #include "sakit/spot_light.h" #include "sakit/unknown_task.h" +#include "sakit/player.h" /* Spot Lights that appear in the background of Ice Paradise (seem to be the same as in Sonic Advance's Secret Base Zone) */ diff --git a/src/sakit/unknown_sprite.c b/src/sakit/unknown_sprite.c index 0dfb25212..e6b55d05a 100644 --- a/src/sakit/unknown_sprite.c +++ b/src/sakit/unknown_sprite.c @@ -1,5 +1,6 @@ #include "global.h" #include "game/game.h" +#include "game/stage/player.h" #include "game/stage/camera.h" #include "sprite.h" #include "task.h"