mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
sa1: reference stage.c from sa2
This commit is contained in:
1 parent
3d17f86417
commit
3c828fc907
18 files changed
+102
-1354
No files matched your search
@@ -293,6 +293,7 @@ typedef struct {
|
||||
} MaybeSuperSonic; /* size: 0x8C */
|
||||
#endif
|
||||
|
||||
void CreatePlayer(u32 UNUSED characterId, u32 levelId, Player *player);
|
||||
s32 SA2_LABEL(sub_8022F58)(u8 param0, Player *p);
|
||||
|
||||
extern Player gPlayer;
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
#include "constants/sa2/zones.h"
|
||||
#endif
|
||||
|
||||
#if (GAME == GAME_SA1)
|
||||
void ApplyGameStageSettingsAndStart(void);
|
||||
#elif (GAME == GAME_SA2)
|
||||
void ApplyGameStageSettings(void);
|
||||
void GameStageStart(void);
|
||||
#endif
|
||||
void CreateGameStage(void);
|
||||
void GoToNextLevel(void);
|
||||
|
||||
|
||||
@@ -275,6 +275,7 @@ SA2_C_FILES := \
|
||||
src/game/shared/stage/water_effects.c \
|
||||
src/game/shared/stage/spot_light_beam_task.c \
|
||||
src/game/shared/stage/camera.c \
|
||||
src/game/shared/stage/stage.c \
|
||||
src/game/sa1/ui/game_2_0.c \
|
||||
src/game/sa1/ui/game_2_1.c \
|
||||
src/game/sa1/ui/stage_results.c \
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
strh r6, [r0, #4]
|
||||
ldr r0, [r5]
|
||||
bl TaskDestroy
|
||||
bl ApplyGameStageSettings
|
||||
bl ApplyGameStageSettingsAndStart
|
||||
b _0806BCF6
|
||||
.align 2, 0
|
||||
_0806BC30: .4byte gCurTask
|
||||
|
||||
@@ -26,7 +26,7 @@ C_DECL(gUnknown_0868B6B8):
|
||||
|
||||
.global C_DECL(gUnknown_0868B6C4)
|
||||
C_DECL(gUnknown_0868B6C4):
|
||||
mPtr C_DECL(ApplyGameStageSettings)
|
||||
mPtr C_DECL(ApplyGameStageSettingsAndStart)
|
||||
mPtr C_DECL(sub_806A66C)
|
||||
mPtr C_DECL(sub_806A680)
|
||||
mPtr C_DECL(sub_806A68C)
|
||||
|
||||
+2
-2
@@ -113,7 +113,7 @@ SECTIONS {
|
||||
sa2/src/game/game.o(.text);
|
||||
sa2/src/game/dummy_task.o(.text);
|
||||
|
||||
src/game/shared/stage/stage.o(.text);
|
||||
sa2/src/game/shared/stage/stage.o(.text);
|
||||
sa2/src/game/shared/stage/camera.o(.text);
|
||||
sa2/src/game/shared/stage/terrain_collision.o(.text);
|
||||
sa2/src/game/shared/stage/mp_sprite_task.o(.text);
|
||||
@@ -344,7 +344,7 @@ SECTIONS {
|
||||
sa2/src/game/shared/multiplayer/communication_outcome.o(.rodata);
|
||||
sa2/src/game/shared/stage/amy_attack_heart_effect.o(.rodata);
|
||||
sa2/src/game/shared/stage/music_manager.o(.rodata);
|
||||
src/game/shared/stage/stage.o(.rodata);
|
||||
sa2/src/game/shared/stage/stage.o(.rodata);
|
||||
sa2/src/game/shared/stage/camera.o(.rodata);
|
||||
src/data/sa1/tilemap_table.o(.rodata);
|
||||
sa2/src/game/shared/stage/terrain_collision.o(.rodata);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -52,7 +52,7 @@ sa2/src/game/sa1/multiplayer/chao_message.o(.bss);
|
||||
sa2/src/game/dummy_task.o(.data);
|
||||
|
||||
. = 0x000058C0;
|
||||
src/game/shared/stage/stage.o(.data);
|
||||
sa2/src/game/shared/stage/stage.o(.data);
|
||||
|
||||
. = 0x000058D0; gStageBackgroundsRam = .;
|
||||
. = 0x000059D0; gCamera = .;
|
||||
|
||||
@@ -204,7 +204,7 @@ void SA2_LABEL(sub_8081200)(void)
|
||||
gMultiplayerPlayerTasks[i] = NULL;
|
||||
};
|
||||
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
#ifndef COLLECT_RINGS_ROM
|
||||
gStageFlags &= ~STAGE_FLAG__ACT_START;
|
||||
gPlayer.moveState &= ~MOVESTATE_IGNORE_INPUT;
|
||||
|
||||
@@ -828,7 +828,7 @@ void Task_SwitchToDemoInit(void)
|
||||
gGameMode = GAME_MODE_SINGLE_PLAYER;
|
||||
|
||||
CreateDemoManager();
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
}
|
||||
|
||||
void Task_SwitchToMainMenu(void)
|
||||
|
||||
@@ -260,7 +260,7 @@ void Task_801CD80()
|
||||
CreateUnusedLevelSelect();
|
||||
} else if ((gGameMode == 0) && (LOADED_SAVE->unlockedLevels[gSelectedCharacter] == 0)) {
|
||||
gCurrentLevel = 0;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
} else {
|
||||
CreateCourseSelect(0U);
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ void Task_805AAF8()
|
||||
if ((gGameMode == GAME_MODE_SINGLE_PLAYER) && (LOADED_SAVE->unlockedLevels[gSelectedCharacter] == 0)) {
|
||||
gCurrentLevel = 0;
|
||||
gMultiplayerCurrentLevel = 0;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -731,11 +731,11 @@ void Task_8062540()
|
||||
if (level == 0) {
|
||||
gCurrentLevel = 0;
|
||||
gMultiplayerCurrentLevel = 0;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
} else if ((u32)level < 19) {
|
||||
gCurrentLevel = level - 1;
|
||||
gMultiplayerCurrentLevel = gCurrentLevel;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
}
|
||||
|
||||
TaskDestroy(state->task18);
|
||||
@@ -840,11 +840,11 @@ void Task_80629E8()
|
||||
if (level == 0) {
|
||||
gCurrentLevel = 0;
|
||||
gMultiplayerCurrentLevel = 0;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
} else if (level < 19) {
|
||||
gCurrentLevel = state->level - 1;
|
||||
gMultiplayerCurrentLevel = gCurrentLevel;
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
}
|
||||
|
||||
TaskDestroy(state->task18);
|
||||
|
||||
@@ -523,7 +523,7 @@ void Task_80638B0(void)
|
||||
chaoHuntStageId = strc5C->unk55;
|
||||
gCurrentLevel = NUM_LEVEL_IDS_SP + chaoHuntStageId;
|
||||
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
TaskDestroy(strc5C->taskC);
|
||||
TaskDestroy(strc5C->task10);
|
||||
TaskDestroy(gCurTask);
|
||||
|
||||
@@ -835,7 +835,7 @@ void Task_8056AC8(void)
|
||||
gBgSpritesCount = 0;
|
||||
PAUSE_GRAPHICS_QUEUE();
|
||||
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
} else {
|
||||
TasksDestroyAll();
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ NONMATCH("asm/non_matching/game/sa1/ui/time_attack_records__Task_806BBC0.inc", v
|
||||
gBldRegs.bldCnt = 0;
|
||||
gBldRegs.bldY = 0;
|
||||
TaskDestroy(gCurTask);
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
return;
|
||||
}
|
||||
if (var_r7 == 0xD0) {
|
||||
|
||||
@@ -198,7 +198,7 @@ void Task_CreateSelectedTask(void)
|
||||
|
||||
if (levelId == LEVEL_INDEX(ZONE_1, ACT_1)) {
|
||||
gCurrentLevel = LEVEL_INDEX(ZONE_1, ACT_1);
|
||||
ApplyGameStageSettings();
|
||||
ApplyGameStageSettingsAndStart();
|
||||
} else if (levelId == 0xFF) {
|
||||
CreateStaffCredits();
|
||||
} else if (levelId == 0xFE) {
|
||||
|
||||
@@ -2,54 +2,108 @@
|
||||
#include "core.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/globals.h"
|
||||
#include "game/shared/stage/entities_manager.h"
|
||||
#include "game/shared/stage/music_manager.h"
|
||||
#include "game/shared/stage/palette_loader.h"
|
||||
#include "game/shared/stage/pause_menu.h"
|
||||
#include "game/shared/stage/rings_manager.h"
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/ui/game_over.h"
|
||||
#include "game/sa2/stage/cheese.h"
|
||||
#include "game/sa2/stage/player_controls.h"
|
||||
#include "game/sa2/stage/player_super_sonic.h"
|
||||
#include "game/sa2/stage/race_progress.h"
|
||||
|
||||
#include "game/shared/stage/screen_shake.h"
|
||||
#include "game/shared/stage/stage.h"
|
||||
#include "game/shared/stage/player.h"
|
||||
#include "game/shared/stage/camera.h"
|
||||
#include "game/sa2/ui/time_attack_lobby.h"
|
||||
#if (GAME == GAME_SA1)
|
||||
#include "game/time_over.h"
|
||||
#endif
|
||||
|
||||
#include "game/shared/stage/mp_finish.h"
|
||||
#include "game/shared/stage/mp_indicators.h"
|
||||
#include "game/sa2/collect_rings/time_display.h"
|
||||
#include "game/shared/stage/mp_event_mgr.h"
|
||||
#include "game/shared/stage/mp_player.h"
|
||||
#include "game/shared/stage/spot_lights_manager.h"
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
#if (GAME == GAME_SA1)
|
||||
#include "game/sa1/save.h"
|
||||
#include "game/sa1/ui/game_over.h"
|
||||
#include "game/sa1/ui/time_attack_lobby.h"
|
||||
#include "game/sa1/ui/time_over.h"
|
||||
#include "game/sa1/stage/mp_chao.h"
|
||||
#include "game/sa1/stage/player_controls.h"
|
||||
#include "game/sa1/parameters/stage.h"
|
||||
|
||||
#include "constants/sa1/characters.h"
|
||||
#include "constants/sa1/songs.h"
|
||||
#include "constants/sa1/zones.h"
|
||||
#elif (GAME == GAME_SA2)
|
||||
#include "game/sa2/save.h"
|
||||
#include "game/sa2/ui/game_over.h"
|
||||
#include "game/sa2/ui/time_attack_lobby.h"
|
||||
#include "game/sa2/stage/cheese.h"
|
||||
#include "game/sa2/stage/player_controls.h"
|
||||
#include "game/sa2/stage/player_super_sonic.h"
|
||||
#include "game/sa2/stage/race_progress.h"
|
||||
#include "game/sa2/collect_rings/time_display.h"
|
||||
|
||||
#include "constants/sa2/animations.h"
|
||||
#include "constants/sa2/characters.h"
|
||||
#include "constants/sa2/songs.h"
|
||||
#include "constants/sa2/zones.h"
|
||||
|
||||
#include "game/shared/stage/mp_event_mgr.h"
|
||||
#endif
|
||||
|
||||
#define BOSS_RINGS_DEFAULT_RESPAWN_COUNT 10
|
||||
|
||||
struct Task *gGameStageTask = NULL;
|
||||
|
||||
void Task_GameStage(void);
|
||||
|
||||
void TaskDestructor_GameStage(struct Task *);
|
||||
|
||||
void CreatePlayer(u32, u32, Player *);
|
||||
void CreateBossRunManager(u8);
|
||||
void TaskDestructor_GameStage(struct Task *t);
|
||||
void StageInit_CollectRings(void);
|
||||
|
||||
void SetupStageIntro(void);
|
||||
extern void CreateStageWaterTask(s32 waterLevel, u32 p1, u32 mask);
|
||||
#if (GAME == GAME_SA1)
|
||||
extern struct Task *CreateMultiplayerChao(u8, u8);
|
||||
extern struct Task *sub_80550F8(void);
|
||||
// stage_ui_z.c
|
||||
typedef struct Struct_sub_80550F8 {
|
||||
u8 filler0[0x27];
|
||||
bool8 screenBlank;
|
||||
} Struct_sub_80550F8; /* size: 0x28 */
|
||||
extern void CreateChaoHuntHUD();
|
||||
|
||||
void CreateStageWaterTask(u32, u32, u32);
|
||||
void StageInit_Zone1Act1(void);
|
||||
void StageInit_Zone1Act2(void);
|
||||
void StageInit_Zone2Act1(void);
|
||||
void StageInit_Zone2Act2(void);
|
||||
void StageInit_Zone3Act1(void);
|
||||
void StageInit_Zone3Act2(void);
|
||||
void StageInit_Zone4Act1(void);
|
||||
void StageInit_Zone4Act2(void);
|
||||
void StageInit_Zone5Act1(void);
|
||||
void StageInit_Zone5Act2(void);
|
||||
void StageInit_Zone6Act1(void);
|
||||
void StageInit_Zone6Act2(void);
|
||||
void StageInit_Zone7Act1(void);
|
||||
void StageInit_Zone7Act2(void);
|
||||
void StageInit_ForestChaoGarden(void);
|
||||
void StageInit_FactoryChaoGarden(void);
|
||||
void StageInit_PinballChaoGarden(void);
|
||||
void StageInit_SpaceChaoGarden(void);
|
||||
|
||||
const VoidFn sStageInitProcs[NUM_LEVEL_IDS] = {
|
||||
StageInit_Zone1Act1, StageInit_Zone1Act2, //
|
||||
StageInit_Zone2Act1, StageInit_Zone2Act2, //
|
||||
StageInit_Zone3Act1, StageInit_Zone3Act2, //
|
||||
StageInit_Zone4Act1, StageInit_Zone4Act2, //
|
||||
StageInit_Zone5Act1, StageInit_Zone5Act2, //
|
||||
StageInit_Zone6Act1, StageInit_Zone6Act2, //
|
||||
StageInit_Zone7Act1, StageInit_Zone7Act2, //
|
||||
StageInit_ForestChaoGarden, StageInit_FactoryChaoGarden, //
|
||||
StageInit_PinballChaoGarden, StageInit_SpaceChaoGarden,
|
||||
};
|
||||
#elif (GAME == GAME_SA2)
|
||||
// TODO: stage_intro.h
|
||||
extern void SetupStageIntro(void);
|
||||
// TODO: in boss run header
|
||||
extern void CreateBossRunManager(u8);
|
||||
|
||||
void StageInit_Zone1Act1(void);
|
||||
void StageInit_Zone3Act1(void);
|
||||
@@ -79,6 +133,7 @@ void StageInit_31(void);
|
||||
void StageInit_32(void);
|
||||
void StageInit_33(void);
|
||||
void StageInit_Dummy(void);
|
||||
|
||||
#ifndef COLLECT_RINGS_ROM
|
||||
// NOTE(Jace): Many of these call copies of the exact same procedure,
|
||||
// so for non-matching builds we could just exclude
|
||||
@@ -120,9 +175,7 @@ const VoidFn sStageInitProcs[NUM_LEVEL_IDS] = { StageInit_Zone1Act1,
|
||||
#else
|
||||
extern const VoidFn sStageInitProcs[NUM_LEVEL_IDS];
|
||||
#endif
|
||||
extern const s8 CollHeightMap_zone_1_act_1_fg[];
|
||||
extern const u8 CollTileRot_zone_1_act_1_fg[];
|
||||
extern const u8 CollFlags_zone_1_act_1_fg[];
|
||||
#endif
|
||||
|
||||
#ifndef COLLECT_RINGS_ROM
|
||||
#if (GAME == GAME_SA2)
|
||||
@@ -299,7 +352,7 @@ void CreateGameStage(void)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
StageInit_MPCollectRings();
|
||||
StageInit_CollectRings();
|
||||
}
|
||||
#elif (GAME == GAME_SA2)
|
||||
gSpikesUnknownTimer = 0;
|
||||
@@ -1020,7 +1073,7 @@ void StageInit_PinballChaoGarden(void)
|
||||
#endif
|
||||
|
||||
#if (GAME == GAME_SA1)
|
||||
void ApplyGameStageSettings(void)
|
||||
void ApplyGameStageSettingsAndStart(void)
|
||||
{
|
||||
gLevelScore = 0;
|
||||
gNumLives = 3;
|
||||
|
||||
Reference in new issue
Block a user