mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 22:44:30 +00:00
Move PlayState
to a new z64play.h
(#1966)
* ActorContext * frameadvance * SfxSource * GameOverContext * RoomContext * TransitionActorContext * fix bss * Move PlayState * Move play functions to new header * SAC_ENABLE * no longer needed * SAC_ENABLE again * z_demo being silly * comment * format headers * fix retail bss * actually fix bss * Cutscene_ProcessScript comment * bss again * Update src/code/z_demo.c Co-authored-by: cadmic <cadmic24@gmail.com> * rename to frame_advance and remove it from z64.h * move macros too * review * Rename SequenceContext to SceneSequences --------- Co-authored-by: cadmic <cadmic24@gmail.com>
This commit is contained in:
parent
2ce4742bf6
commit
d8f2e9abc6
32 changed files with 443 additions and 329 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
// For retail BSS ordering, the block number of D_8015BD7C
|
||||
// must be between 88 and 123 inclusive.
|
||||
#pragma increment_block_number 30
|
||||
#pragma increment_block_number 26
|
||||
|
||||
s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags);
|
||||
s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"
|
||||
|
||||
typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
|
||||
|
@ -7,6 +10,8 @@ typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
|
|||
typedef void (*ColChkVsFunc)(PlayState*, CollisionCheckContext*, Collider*, Collider*);
|
||||
typedef s32 (*ColChkLineFunc)(PlayState*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*);
|
||||
|
||||
#define SAC_ENABLE (1 << 0)
|
||||
|
||||
// For retail BSS ordering, the block number of sparkInit in CollisionCheck_BlueBlood
|
||||
// must be between 183 and 255 inclusive.
|
||||
#pragma increment_block_number 50
|
||||
|
@ -2358,10 +2363,6 @@ void CollisionCheck_ATTrisVsACTris(PlayState* play, CollisionCheckContext* colCh
|
|||
}
|
||||
}
|
||||
|
||||
#if OOT_DEBUG
|
||||
static s8 sBssDummy7;
|
||||
#endif
|
||||
|
||||
void CollisionCheck_ATTrisVsACQuad(PlayState* play, CollisionCheckContext* colChkCtx, Collider* atCol,
|
||||
Collider* acCol) {
|
||||
static Vec3f hitPos;
|
||||
|
|
|
@ -115,7 +115,7 @@ void* sUnusedEntranceCsList[] = {
|
|||
gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gMinuetCs, gIceCavernSerenadeCs, gTowerBarrierCs,
|
||||
};
|
||||
|
||||
#pragma increment_block_number 254
|
||||
#pragma increment_block_number 248
|
||||
|
||||
// Stores the frame the relevant cam data was last applied on
|
||||
u16 gCamAtSplinePointsAppliedFrame;
|
||||
|
@ -2229,11 +2229,15 @@ void CutsceneHandler_RunScript(PlayState* play, CutsceneContext* csCtx) {
|
|||
|
||||
csCtx->curFrame++;
|
||||
|
||||
if (OOT_DEBUG && R_USE_DEBUG_CUTSCENE) {
|
||||
#if OOT_DEBUG
|
||||
if (R_USE_DEBUG_CUTSCENE) {
|
||||
Cutscene_ProcessScript(play, csCtx, gDebugCutsceneScript);
|
||||
} else {
|
||||
Cutscene_ProcessScript(play, csCtx, play->csCtx.script);
|
||||
}
|
||||
#else
|
||||
Cutscene_ProcessScript(play, csCtx, play->csCtx.script);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "global.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
EffectContext sEffectContext;
|
||||
|
||||
EffectInfo sEffectInfoTable[] = {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info"
|
||||
|
||||
void EffectSs_InitInfo(PlayState* play, s32 tableSize) {
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#include "global.h"
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
#include "stdbool.h"
|
||||
|
||||
#include "padmgr.h"
|
||||
#include "macros.h"
|
||||
|
||||
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx) {
|
||||
frameAdvCtx->timer = 0;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "z64game_over.h"
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void GameOver_Init(PlayState* play) {
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
#include "global.h"
|
||||
#include "ultra64.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
#include "assets/objects/gameplay_keep/gameplay_keep.h"
|
||||
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"
|
||||
|
||||
// For retail BSS ordering, the block number of sLensFlareUnused must be lower
|
||||
// than the extern variables declared in the header (e.g. gLightningStrike)
|
||||
// while the block number of sNGameOverLightNode must be higher.
|
||||
#pragma increment_block_number 78
|
||||
#pragma increment_block_number 70
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ LIGHTNING_BOLT_START,
|
||||
|
@ -2069,30 +2072,30 @@ void Environment_PlaySceneSequence(PlayState* play) {
|
|||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, ((void)0, gSaveContext.forcedSeqId));
|
||||
}
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
} else if (play->sequenceCtx.seqId == NA_BGM_NO_MUSIC) {
|
||||
if (play->sequenceCtx.natureAmbienceId == NATURE_ID_NONE) {
|
||||
} else if (play->sceneSequences.seqId == NA_BGM_NO_MUSIC) {
|
||||
if (play->sceneSequences.natureAmbienceId == NATURE_ID_NONE) {
|
||||
return;
|
||||
}
|
||||
if (((void)0, gSaveContext.natureAmbienceId) != play->sequenceCtx.natureAmbienceId) {
|
||||
Audio_PlayNatureAmbienceSequence(play->sequenceCtx.natureAmbienceId);
|
||||
if (((void)0, gSaveContext.natureAmbienceId) != play->sceneSequences.natureAmbienceId) {
|
||||
Audio_PlayNatureAmbienceSequence(play->sceneSequences.natureAmbienceId);
|
||||
}
|
||||
} else if (play->sequenceCtx.natureAmbienceId == NATURE_ID_NONE) {
|
||||
} else if (play->sceneSequences.natureAmbienceId == NATURE_ID_NONE) {
|
||||
// "BGM Configuration"
|
||||
PRINTF("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", play->sequenceCtx.seqId,
|
||||
PRINTF("\n\n\nBGM設定game_play->sound_info.BGM=[%d] old_bgm=[%d]\n\n", play->sceneSequences.seqId,
|
||||
((void)0, gSaveContext.seqId));
|
||||
if (((void)0, gSaveContext.seqId) != play->sequenceCtx.seqId) {
|
||||
Audio_PlaySceneSequence(play->sequenceCtx.seqId);
|
||||
if (((void)0, gSaveContext.seqId) != play->sceneSequences.seqId) {
|
||||
Audio_PlaySceneSequence(play->sceneSequences.seqId);
|
||||
}
|
||||
} else if (((void)0, gSaveContext.save.dayTime) >= CLOCK_TIME(7, 0) &&
|
||||
((void)0, gSaveContext.save.dayTime) <= CLOCK_TIME(17, 10)) {
|
||||
if (((void)0, gSaveContext.seqId) != play->sequenceCtx.seqId) {
|
||||
Audio_PlaySceneSequence(play->sequenceCtx.seqId);
|
||||
if (((void)0, gSaveContext.seqId) != play->sceneSequences.seqId) {
|
||||
Audio_PlaySceneSequence(play->sceneSequences.seqId);
|
||||
}
|
||||
|
||||
play->envCtx.timeSeqState = TIMESEQ_FADE_DAY_BGM;
|
||||
} else {
|
||||
if (((void)0, gSaveContext.natureAmbienceId) != play->sequenceCtx.natureAmbienceId) {
|
||||
Audio_PlayNatureAmbienceSequence(play->sequenceCtx.natureAmbienceId);
|
||||
if (((void)0, gSaveContext.natureAmbienceId) != play->sceneSequences.natureAmbienceId) {
|
||||
Audio_PlayNatureAmbienceSequence(play->sceneSequences.natureAmbienceId);
|
||||
}
|
||||
|
||||
if (((void)0, gSaveContext.save.dayTime) > CLOCK_TIME(17, 10) &&
|
||||
|
@ -2108,8 +2111,8 @@ void Environment_PlaySceneSequence(PlayState* play) {
|
|||
|
||||
PRINTF("\n-----------------\n", ((void)0, gSaveContext.forcedSeqId));
|
||||
PRINTF("\n 強制BGM=[%d]", ((void)0, gSaveContext.forcedSeqId)); // "Forced BGM"
|
||||
PRINTF("\n BGM=[%d]", play->sequenceCtx.seqId);
|
||||
PRINTF("\n エンブ=[%d]", play->sequenceCtx.natureAmbienceId);
|
||||
PRINTF("\n BGM=[%d]", play->sceneSequences.seqId);
|
||||
PRINTF("\n エンブ=[%d]", play->sceneSequences.natureAmbienceId);
|
||||
PRINTF("\n status=[%d]", play->envCtx.timeSeqState);
|
||||
|
||||
Audio_SetEnvReverb(play->roomCtx.curRoom.echo);
|
||||
|
@ -2123,7 +2126,7 @@ void Environment_PlayTimeBasedSequence(PlayState* play) {
|
|||
|
||||
if (play->envCtx.precipitation[PRECIP_RAIN_MAX] == 0 && play->envCtx.precipitation[PRECIP_SOS_MAX] == 0) {
|
||||
PRINTF("\n\n\nNa_StartMorinigBgm\n\n");
|
||||
Audio_PlayMorningSceneSequence(play->sequenceCtx.seqId);
|
||||
Audio_PlayMorningSceneSequence(play->sceneSequences.seqId);
|
||||
}
|
||||
|
||||
play->envCtx.timeSeqState++;
|
||||
|
@ -2149,7 +2152,7 @@ void Environment_PlayTimeBasedSequence(PlayState* play) {
|
|||
|
||||
case TIMESEQ_EARLY_NIGHT_CRITTERS:
|
||||
if (play->envCtx.precipitation[PRECIP_RAIN_MAX] == 0 && play->envCtx.precipitation[PRECIP_SOS_MAX] == 0) {
|
||||
Audio_PlayNatureAmbienceSequence(play->sequenceCtx.natureAmbienceId);
|
||||
Audio_PlayNatureAmbienceSequence(play->sceneSequences.natureAmbienceId);
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_1, 1);
|
||||
}
|
||||
|
||||
|
@ -2586,10 +2589,10 @@ s32 Environment_IsForcedSequenceDisabled(void) {
|
|||
}
|
||||
|
||||
void Environment_PlayStormNatureAmbience(PlayState* play) {
|
||||
if (play->sequenceCtx.natureAmbienceId == NATURE_ID_NONE) {
|
||||
if (play->sceneSequences.natureAmbienceId == NATURE_ID_NONE) {
|
||||
Audio_PlayNatureAmbienceSequence(NATURE_ID_MARKET_NIGHT);
|
||||
} else {
|
||||
Audio_PlayNatureAmbienceSequence(play->sequenceCtx.natureAmbienceId);
|
||||
Audio_PlayNatureAmbienceSequence(play->sceneSequences.natureAmbienceId);
|
||||
}
|
||||
|
||||
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 1);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "quake.h"
|
||||
#include "terminal.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
#if OOT_DEBUG
|
||||
void* gDebugCutsceneScript = NULL;
|
||||
UNK_TYPE D_8012D1F4 = 0; // unused
|
||||
|
@ -451,8 +453,8 @@ void Play_Init(GameState* thisx) {
|
|||
|
||||
Interface_SetSceneRestrictions(this);
|
||||
Environment_PlaySceneSequence(this);
|
||||
gSaveContext.seqId = this->sequenceCtx.seqId;
|
||||
gSaveContext.natureAmbienceId = this->sequenceCtx.natureAmbienceId;
|
||||
gSaveContext.seqId = this->sceneSequences.seqId;
|
||||
gSaveContext.natureAmbienceId = this->sceneSequences.natureAmbienceId;
|
||||
func_8002DF18(this, GET_PLAYER(this));
|
||||
AnimTaskQueue_Update(this, &this->animTaskQueue);
|
||||
gSaveContext.respawnFlag = 0;
|
||||
|
|
|
@ -409,8 +409,8 @@ BAD_RETURN(s32) Scene_CommandUndefined9(PlayState* play, SceneCmd* cmd) {
|
|||
}
|
||||
|
||||
BAD_RETURN(s32) Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
play->sequenceCtx.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
|
||||
play->sceneSequences.seqId = cmd->soundSettings.seqId;
|
||||
play->sceneSequences.natureAmbienceId = cmd->soundSettings.natureAmbienceId;
|
||||
|
||||
if (gSaveContext.seqId == (u8)NA_BGM_DISABLED) {
|
||||
SEQCMD_RESET_AUDIO_HEAP(0, cmd->soundSettings.specId);
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "global.h"
|
||||
#include "quake.h"
|
||||
|
||||
#include "z64frame_advance.h"
|
||||
|
||||
#include "assets/scenes/indoors/miharigoya/miharigoya_scene.h"
|
||||
#include "assets/scenes/indoors/souko/souko_scene.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "z64sfx_source.h"
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void SfxSource_InitAll(PlayState* play) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue