Cutscene Documentation (z_eventmgr.c OK) (#1164)

* begin cutscene docs

* more docs

* more docs

* z_eventmgr.c OK

Co-authored-by: Thar0 <Thar0@users.noreply.github.com>

* cutscene camera

* commands WIP

* more docs

* merge master

* csId, oof

* more cleanup

* more docs, csCam

* more cleanup

* more docs

* more

* cleanup functions.h

* better misc cmd docs

* apply discord discussions

* small adjustment

* more cleanup

* more docs

* more cleanup

* more cs cam docs

* small fix

* cmd cleanup

* small cleanup

* better match, thanks anon

* remove last return

* PR suggestions, small cleanup

* next PR review

* rm internal funcs from functions.h

* more PR

* add comment

* csCam interp typedef handler

* cleanup, scene cmd

* missed an enum use

* ActorCutscene -> CutsceneManager, PR Suggestions

* more PR Suggestions

* more actorCutscene cleanup

* R_USE_DEBUG_CUTSCENE

* more small docs

* move functions to cutscene.h

* PlayerCsId

* fix bss

* missed some function headers

* more scene cleanup

* more scene cleanup

* missed one

* CS_SPAWN_FLAGS

* wrong usage of macro

* more cleanup

* name last cs transition types

* IsNext bool

* update namefixer

* fix namefixer

* more cleanup

* add comment

* fixed enums for motion blur

* consistent cutscene lists

* cutscene entry func consistent

* PR Suggestion

* fig review

* fix additionalCsId name in actor

* more pr review

* bss

---------

Co-authored-by: Thar0 <Thar0@users.noreply.github.com>
Co-authored-by: angie <angheloalf95@gmail.com>
This commit is contained in:
engineer124 2023-04-20 03:52:00 +10:00 committed by GitHub
parent 543c38ae06
commit 9d25fad407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
390 changed files with 7327 additions and 5600 deletions

View File

@ -722,7 +722,7 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx);
void func_800BA798(PlayState* play, ActorContext* actorCtx);
void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play);
Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params);
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 cutscene, u32 halfDaysBits, Actor* parent);
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s32 params, u32 csId, u32 halfDaysBits, Actor* parent);
Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params);
void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx);
void Enemy_StartFinishingBlow(PlayState* play, Actor* actor);
@ -1064,23 +1064,6 @@ s32 Actor_TrackPlayerSetFocusHeight(PlayState* play, Actor* actor, Vec3s* headRo
s32 Actor_TrackPlayer(PlayState* play, Actor* actor, Vec3s* headRot, Vec3s* torsoRot, Vec3f focusPos);
void SaveContext_Init(void);
void Cutscene_Init(PlayState* play, CutsceneContext* csCtx);
void Cutscene_Start(PlayState* play, CutsceneContext* csCtx);
void Cutscene_End(PlayState* play, CutsceneContext* csCtx);
void Cutscene_Update1(PlayState* play, CutsceneContext* csCtx);
void Cutscene_Update2(PlayState* play, CutsceneContext* csCtx);
void func_800EDBE0(PlayState* play);
void func_800EDDB0(PlayState* play);
void Cutscene_LoadCutsceneData(PlayState* play, u8 csIndex);
void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 actorActionIndex);
void Cutscene_ActorTranslateAndYaw(Actor* actor, PlayState* play, s32 actorActionIndex);
void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex);
void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 actorActionIndex);
s32 Cutscene_GetSceneLayer(PlayState* play);
s32 Cutscene_GetActorActionIndex(PlayState* play, u16 actorActionCmd);
s32 Cutscene_CheckActorAction(PlayState* play, u16 actorActionCmd);
u8 Cutscene_IsPlaying(PlayState* play);
void GetItem_Draw(PlayState* play, s16 drawId);
void SoundSource_InitAll(PlayState* play);
@ -1090,35 +1073,6 @@ void SoundSource_PlaySfxEachFrameAtFixedWorldPos(PlayState* play, Vec3f* worldPo
u16 QuestHint_GetTatlTextId(PlayState* play);
u16 Text_GetFaceReaction(PlayState* play, u32 reactionSet);
void EnvFlags_UnsetAll(PlayState* play);
void EnvFlags_Set(PlayState* play, s16 flag);
void EnvFlags_Unset(PlayState* play, s16 flag);
s32 EnvFlags_Get(PlayState* play, s16 flag);
s16 func_800F1460(s16 param_1);
ActorCutscene* ActorCutscene_GetCutsceneImpl(s16 index);
void ActorCutscene_Init(PlayState* play, ActorCutscene* cutscenes, s32 num);
void func_800F15D8(Camera* camera);
void ActorCutscene_ClearWaiting(void);
// void ActorCutscene_ClearNextCutscenes(void);
// void ActorCutscene_MarkNextCutscenes(void);
// void ActorCutscene_End(void);
s16 ActorCutscene_Update(void);
void ActorCutscene_SetIntentToPlay(s16 index);
s16 ActorCutscene_GetCanPlayNext(s16 index);
s16 ActorCutscene_StartAndSetUnkLinkFields(s16 index, Actor* actor);
s16 ActorCutscene_StartAndSetFlag(s16 index, Actor* actor);
s16 ActorCutscene_Start(s16 index, Actor* actor);
s16 ActorCutscene_Stop(s16 index);
s16 ActorCutscene_GetCurrentIndex(void);
ActorCutscene* ActorCutscene_GetCutscene(s16 index);
s16 ActorCutscene_GetAdditionalCutscene(s16 index);
s16 ActorCutscene_GetLength(s16 index);
s32 func_800F2138(s32 arg0);
s32 func_800F2178(s16 arg0);
s16 ActorCutscene_GetCurrentSubCamId(s16 index);
s16 func_800F21CC(void);
s32 func_800F22C4(s16 param_1, Actor* actor);
void ActorCutscene_SetReturnCamera(s16 index);
s32 func_800F3940(PlayState* play);
// void func_800F39B4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
@ -1776,8 +1730,8 @@ void Scene_Command09(PlayState* play, SceneCmd* cmd);
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd);
void Scene_CommandEchoSetting(PlayState* play, SceneCmd* cmd);
void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd);
void Scene_CommandCutsceneScriptList(PlayState* play, SceneCmd* cmd);
void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd);
void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd);
void Scene_CommandMiniMap(PlayState* play, SceneCmd* cmd);
void Scene_Command1D(PlayState* play, SceneCmd* cmd);
void Scene_CommandMiniMapCompassInfo(PlayState* play, SceneCmd* cmd);
@ -1957,27 +1911,6 @@ void Message_FindCreditsMessage(PlayState* play, u16 textId);
void func_8015E7EC(PlayState* play, UNK_PTR puParm2);
// void func_8015F8A8(UNK_TYPE4 ctxt);
// void func_80161180(void);
s32 func_8016119C(Camera* camera, DbCameraUnkStruct* arg1);
// void func_8016122C(void);
// void func_801612B8(void);
s32 func_80161998(u8* cmd, DbCameraUnkStruct* arg1);
// s32 func_80161BAC(void);
void func_80161BE0(s16 arg0);
void func_80161C0C(void);
// void func_80161C20(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80161E4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801620CC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_8016237C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5, UNK_TYPE4 param_6);
// void func_801623E4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801624EC(void);
// void func_8016253C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801629BC(void);
// void func_80162A50(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80162FF8(void);
// void func_801631DC(void);
// void func_80163334(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80163660(void);
void* KaleidoManager_FaultAddrConv(void* address, void* param);
void KaleidoManager_LoadOvl(KaleidoMgrOverlay* ovl);
void KaleidoManager_ClearOvl(KaleidoMgrOverlay* ovl);
@ -2070,7 +2003,7 @@ s32 FrameAdvance_IsEnabled(GameState* thisx);
s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw);
s32 Play_IsUnderwater(PlayState* this, Vec3f* pos);
s32 Play_IsDebugCamEnabled(void);
void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId);
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId);
void Play_FillScreen(GameState* thisx, s16 fillScreenOn, u8 red, u8 green, u8 blue, u8 alpha);
void Play_Init(GameState* thisx);
@ -2560,7 +2493,7 @@ OcarinaStaff* AudioOcarina_GetRecordingStaff(void);
OcarinaStaff* AudioOcarina_GetPlayingStaff(void);
OcarinaStaff* AudioOcarina_GetPlaybackStaff(void);
void AudioOcarina_TerminaWallGenerateNotes(void);
void AudioOcarina_PlayLongScarecrowAfterCredits(void);
void AudioOcarina_PlayLongScarecrowSong(void);
void Audio_Update(void);
void AudioSfx_SetProperties(u8 bankId, u8 entryIndex, u8 channelIndex);

View File

@ -166,4 +166,7 @@ extern RegEditor* gRegEditor;
#define R_ITEM_ICON_WIDTH(i) VREG(76 + i)
#define R_ITEM_BTN_WIDTH(i) VREG(80 + i)
// Name inferred from OoT. Set to true to manually set play->csCtx.script
#define R_USE_DEBUG_CUTSCENE dREG(95)
#endif

View File

@ -431,19 +431,9 @@ extern EffectShieldParticleInit shieldParticleInitWood;
// extern UNK_TYPE2 D_801BB0FC;
// extern UNK_TYPE1 D_801BB100;
extern u8 D_801BB12C;
extern u8 gOpeningEntranceIndex;
// extern UNK_TYPE1 D_801BC41E;
extern ActorCutscene actorCutscenesGlobalCutscenes[8];
extern s16 actorCutsceneCurrent;
extern s16 actorCutsceneCurrentLength;
extern s16 actorCutsceneEnding;
extern s16 actorCutsceneCurrentCamera;
extern Actor* actorCutsceneCurrentCutsceneActor;
// extern UNK_TYPE4 actorCutsceneStartMethod;
extern PlayState* actorCutscenesPlayState;
extern s16 actorCutsceneReturnCamera;
extern s16 D_801BD8C6;
extern ActorCutscene sGlobalCutsceneList[8];
extern GameStateOverlay gGameStateOverlayTable[];
extern s32 gGraphNumGameStates;
// extern UNK_TYPE2 D_801BDA70;
@ -764,7 +754,7 @@ extern s32 gDbgCamEnabled;
// extern UNK_TYPE2 sQuakeIndex;
// extern UNK_TYPE2 sIsCameraUnderwater;
extern Input* D_801D0D60;
// extern UNK_TYPE2 D_801D0D64;
// extern UNK_TYPE2 sPlayerCsIdToCsCamId;
// extern UNK_TYPE1 D_801D0D7A;
// extern UNK_TYPE1 D_801D0D80;
// extern UNK_TYPE1 D_801D11F4;
@ -2335,14 +2325,14 @@ extern SaveContext gSaveContext;
// extern UNK_TYPE1 D_801F48C8;
extern UNK_TYPE D_801F4DDC;
extern u8 D_801F4DE0;
extern s16 D_801F4DE2;
extern u8 gDisablePlayerCsModeStartPos;
extern s16 gDungeonBossWarpSceneId;
extern ActorCutscene* actorCutscenes;
extern s16 actorCutsceneCount;
extern u8 actorCutsceneWaiting[16];
extern ActorCutscene* sSceneCutsceneList;
extern s16 sSceneCutsceneCount;
extern u8 sWaitingCutsceneList[16];
// extern UNK_TYPE1 D_801F4E08;
extern u8 actorCutsceneNextCutscenes[16];
extern u8 sNextCutsceneList[16];
// extern UNK_TYPE1 D_801F4E20;
extern u8 D_801F4E30;
// extern UNK_TYPE1 D_801F4E31;
@ -2420,7 +2410,7 @@ extern s16 D_801F4E7A;
// extern UNK_TYPE1 D_801F6B1E;
// extern UNK_TYPE1 D_801F6B20;
// extern UNK_TYPE1 D_801F6B22;
// extern UNK_TYPE4 D_801F6B50;
// extern UNK_TYPE4 sCurCsCamera;
// extern UNK_TYPE1 D_801F6B58;
extern void (*sKaleidoScopeUpdateFunc)(PlayState* play);
extern void (*sKaleidoScopeDrawFunc)(PlayState* play);

View File

@ -87,19 +87,6 @@ typedef enum {
/* 4 */ EQUIP_SLOT_A
} EquipSlot;
typedef struct {
/* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority
/* 0x2 */ s16 length;
/* 0x4 */ s16 csCamSceneDataId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from scene
/* 0x6 */ s16 unk6;
/* 0x8 */ s16 additionalCutscene;
/* 0xA */ u8 sound;
/* 0xB */ u8 unkB;
/* 0xC */ s16 unkC;
/* 0xE */ u8 unkE;
/* 0xF */ u8 letterboxSize;
} ActorCutscene; // size = 0x10
typedef struct {
/* 0x0 */ s8 segment;
/* 0x2 */ s16 type;
@ -647,7 +634,7 @@ typedef struct PlayState {
/* 0x18790 */ void (*unk_18790)(struct PlayState* play, s16 arg1);
/* 0x18794 */ PlayerItemAction (*unk_18794)(struct PlayState* play, Player* player, ItemId itemId);
/* 0x18798 */ s32 (*setPlayerTalkAnim)(struct PlayState* play, PlayerAnimationHeader* talkAnim, AnimationMode animMode);
/* 0x1879C */ s16 playerActorCsIds[10];
/* 0x1879C */ s16 playerCsIds[PLAYER_CS_ID_MAX];
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f projectionMtxFDiagonal;
/* 0x187FC */ MtxF billboardMtxF;
@ -678,7 +665,7 @@ typedef struct PlayState {
/* 0x1887F */ u8 transitionType; // fadeTransition
/* 0x18880 */ u8 unk_18880;
/* 0x18884 */ CollisionCheckContext colChkCtx;
/* 0x18B20 */ u16 envFlags[20];
/* 0x18B20 */ u16 cutsceneFlags[20];
/* 0x18B48 */ u8 curSpawn;
/* 0x18B49 */ u8 unk_18B49;
/* 0x18B4A */ u8 transitionMode;
@ -797,35 +784,4 @@ enum fram_mode {
FRAM_MODE_STATUS
};
typedef struct {
/* 0x00 */ UNK_TYPE1 unk_00[0x14];
/* 0x14 */ s16 unk_14;
/* 0x16 */ s16 unk_16;
/* 0x18 */ s16 unk_18;
/* 0x1A */ UNK_TYPE1 unk_1A[0x3];
/* 0x0C */ u8 unk_1D;
/* 0x1E */ UNK_TYPE1 unk_1E[0xC];
/* 0x2A */ s16 unk_2A;
/* 0x1E */ UNK_TYPE1 unk_2C[0x1];
/* 0x2D */ u8 unk_2D;
/* 0x2E */ UNK_TYPE1 unk_2E[2];
} DbCameraUnkSubStruct; // size = 0x30
typedef struct {
/* 0x00 */ s16 unk_00;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s16 unk_08;
/* 0x0A */ s16 unk_0A;
/* 0x0C */ s16 unk_0C;
/* 0x0E */ UNK_TYPE1 unk_0E[0x02];
/* 0x10 */ DbCameraUnkSubStruct unk_10;
/* 0x40 */ DbCameraUnkSubStruct unk_40;
/* 0x70 */ UNK_PTR unk_70;
/* 0x74 */ UNK_PTR unk_74;
/* 0x78 */ UNK_PTR unk_78;
/* 0x7C */ Camera* camera;
} DbCameraUnkStruct; // size = 0x80
#endif

View File

@ -174,7 +174,7 @@ typedef struct Actor {
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
/* 0x020 */ s16 halfDaysBits; // Bitmask indicating which half-days this actor is allowed to not be killed(?) (TODO: not sure how to word this). If the current halfDayBit is not part of this mask then the actor is killed when spawning the setup actors
/* 0x024 */ PosRot world; // Position/rotation in the world
/* 0x038 */ s8 cutscene;
/* 0x038 */ s8 csId; // ActorCutscene index, see `CutsceneId`
/* 0x039 */ u8 audioFlags; // Another set of flags? Seems related to sfx or bgm
/* 0x03C */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot
/* 0x050 */ u16 sfxId; // Id of sound effect to play. Plays when value is set, then is cleared the following update cycle

View File

@ -1319,7 +1319,7 @@ typedef struct {
/* 0x0C */ f32 unk_0C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
/* 0x18 */ VecSph unk_18; // sp18-1C-20--24-26-28 // CutsceneCameraPoint?
/* 0x18 */ VecSph unk_18;
/* 0x20 */ s16 unk_20;
/* 0x22 */ s16 timer;
} Demo4ReadWriteData; // size = 0x24

File diff suppressed because it is too large Load Diff

View File

@ -5,13 +5,19 @@
#include "z64cutscene.h"
/**
* Cutscene scripts are arrays of `CutsceneData` words, including bit-packed integers and floats.
*/
/**
* Marks the beginning of a cutscene script.
*
* ARGS
* s32 totalEntries (e), s32 endFrame (n)
* s32 totalEntries (e), s32 frameCount (n)
* FORMAT
* eeeeeeee nnnnnnnn
* size = 0x8
*/
#define CS_BEGIN_CUTSCENE(totalEntries, endFrame) { CMD_W(totalEntries) }, { CMD_W(endFrame) }
#define CS_BEGIN_CUTSCENE(totalEntries, frameCount) { CMD_W(totalEntries) }, { CMD_W(frameCount) }
/**
@ -21,83 +27,83 @@
* 0000000A eeeeeeee
* size = 0x8
*/
#define CS_TEXT_LIST(entries) { CS_CMD_TEXTBOX }, { CMD_W(entries) }
#define CS_TEXT_LIST(entries) { CS_CMD_TEXT }, { CMD_W(entries) }
/**
* ARGS
* s16 messageId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o),
* s16 textId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o),
* s16 topOptionBranch (y), s16 bottomOptionBranch (n)
* FORMAT
* iiiissss eeeeoooo yyyynnnn
* size = 0xC
*/
#define CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \
{ CMD_HH(messageId, startFrame) }, { CMD_HH(endFrame, type) }, { CMD_HH(topOptionBranch, bottomOptionBranch) }
#define CS_TEXT(textId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \
{ CMD_HH(textId, startFrame) }, { CMD_HH(endFrame, type) }, { CMD_HH(topOptionBranch, bottomOptionBranch) }
/**
* ARGS
* s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
* s16 textId (i), s16 startFrame (s), s16 endFrame (e),
* s16 topOptionBranch (y), s16 bottomOptionBranch (n)
* FORMAT
* iiiissss eeee0000 yyyynnnn
* size = 0xC
*/
#define CS_TEXT_DEFAULT(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_DEFAULT, topOptionBranch, bottomOptionBranch)
#define CS_TEXT_DEFAULT(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_DEFAULT, topOptionBranch, bottomOptionBranch)
/**
* ARGS
* s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
* s16 textId (i), s16 startFrame (s), s16 endFrame (e),
* s16 topOptionBranch (y), s16 bottomOptionBranch (n)
* FORMAT
* iiiissss eeee0001 yyyynnnn
* size = 0xC
*/
#define CS_TEXT_TYPE_1(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_1, topOptionBranch, bottomOptionBranch)
#define CS_TEXT_TYPE_1(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_1, topOptionBranch, bottomOptionBranch)
/**
* ARGS
* s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 messageId (i)
* s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 textId (i)
* FORMAT
* oooossss eeee0002 iiiiFFFF
* size = 0xC
*/
#define CS_TEXT_LEARN_SONG(ocarinaSongAction, startFrame, endFrame, messageId) \
CS_TEXT_DISPLAY_TEXTBOX(ocarinaSongAction, startFrame, endFrame, CS_TEXTBOX_TYPE_LEARN_SONG, messageId, 0xFFFF)
#define CS_TEXT_OCARINA_ACTION(ocarinaSongAction, startFrame, endFrame, textId) \
CS_TEXT(ocarinaSongAction, startFrame, endFrame, CS_TEXT_OCARINA_ACTION, textId, 0xFFFF)
/**
* ARGS
* s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
* s16 textId (i), s16 startFrame (s), s16 endFrame (e),
* s16 topOptionBranch (y), s16 bottomOptionBranch (n)
* FORMAT
* iiiissss eeee0003 yyyynnnn
* size = 0xC
*/
#define CS_TEXT_TYPE_3(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_3, topOptionBranch, bottomOptionBranch)
#define CS_TEXT_TYPE_3(textId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
CS_TEXT(textId, startFrame, endFrame, CS_TEXT_TYPE_3, topOptionBranch, bottomOptionBranch)
/**
* If Player has all 4 bosses' remains then alternativeMessageId is used, otherwise defaultMessageId is used
* If Player has all 4 bosses' remains then alternativeTextId is used, otherwise defaultTextId is used
* ARGS
* s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a)
* s16 defaultTextId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeTextId (a)
* FORMAT
* ddddssss eeee0004 aaaaFFFF
* size = 0xC
*/
#define CS_TEXT_BOSSES_REMAINS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \
CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_BOSSES_REMAINS, alternativeMessageId, 0xFFFF)
#define CS_TEXT_BOSSES_REMAINS(defaultTextId, startFrame, endFrame, alternativeTextId) \
CS_TEXT(defaultTextId, startFrame, endFrame, CS_TEXT_TYPE_BOSSES_REMAINS, alternativeTextId, 0xFFFF)
/**
* If Player has every non-transformation mask then alternativeMessageId is used, otherwise defaultMessageId is used
* If Player has every non-transformation mask then alternativeTextId is used, otherwise defaultTextId is used
* ARGS
* s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a)
* s16 defaultTextId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeTextId (a)
* FORMAT
* ddddssss eeee0005 aaaaFFFF
* size = 0xC
*/
#define CS_TEXT_ALL_NORMAL_MASKS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \
CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS, alternativeMessageId, 0xFFFF)
#define CS_TEXT_ALL_NORMAL_MASKS(defaultTextId, startFrame, endFrame, alternativeTextId) \
CS_TEXT(defaultTextId, startFrame, endFrame, CS_TEXT_TYPE_ALL_NORMAL_MASKS, alternativeTextId, 0xFFFF)
/**
* ARGS
@ -107,22 +113,57 @@
* size = 0xC
*/
#define CS_TEXT_NONE(startFrame, endFrame) \
CS_TEXT_DISPLAY_TEXTBOX(0xFFFF, startFrame, endFrame, CS_TEXTBOX_TYPE_NONE, 0xFFFF, 0xFFFF)
CS_TEXT(0xFFFF, startFrame, endFrame, CS_TEXT_TYPE_NONE, 0xFFFF, 0xFFFF)
/**
* ARGS
* s32 entries (e)
* s32 numBytes (b)
* FORMAT
* 0000005A eeeeeeee
* 0000005A bbbbbbbb
* size = 0x8
*/
#define CS_CAMERA_LIST(entries) { CS_CMD_CAMERA }, { CMD_W(entries) }
#define CS_CAM_SPLINE_LIST(numBytes) { CS_CMD_CAMERA_SPLINE }, { CMD_W(numBytes) }
// TODO: Camera command macros. Requieres func_80161998 being decomped
/**
* ARGS
* s16 numEntries (e), s16 duration (d)
* FORMAT
* Capital U is Unused
* eeeeUUUU UUUUdddd
* size = 0x8
*/
#define CS_CAM_SPLINE(numEntries, unused0, unused1, duration) \
{ CMD_HH(numEntries, unused0) }, { CMD_HH(unused1, duration) }
/**
* ARGS
* u8 interpType (i), u8 weight (2), s16 duration (d), Vec3s pos (x/y/z), s16 relativeTo (r)
* FORMAT
* ii22dddd xxxxyyyy zzzzrrrr
* size = 0xC
*/
#define CS_CAM_POINT(interpType, weight, duration, posX, posY, posZ, relativeTo) \
{ CMD_BBH(interpType, weight, duration) }, { CMD_HH(posX, posY) }, { CMD_HH(posZ, relativeTo) }
/**
* ARGS
* s16 roll (r), s16 fov (f)
* FORMAT
* Capital U is Unused
* UUUUrrrr ffffUUUU
* size = 0x8
*/
#define CS_CAM_MISC(unused0, roll, fov, unused1) \
{ CMD_HH(unused0, roll) }, { CMD_HH(fov, unused1) }
// First half-word is read from as `numEntries` in `CS_CAM_SPLINE()`
#define CS_CAM_END() { CMD_HH(0xFFFF, 4) }
/**
* Declares a list of `CS_MISC` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
@ -132,36 +173,46 @@
#define CS_MISC_LIST(entries) { CS_CMD_MISC }, { CMD_W(entries) }
/**
* Various miscellaneous commands.
* @see `CutsceneMiscType` enum for the different types of commands.
* @note setting `endFrame` to same value as `startFrame` will not behave as expected.
* For commands that only need to last one frame, set `endFrame` to `startFrame + 1`.
*
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* uuuussss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_MISC(unk, startFrame, endFrame, unk_06) \
{ CMD_HH(unk, startFrame) }, { CMD_HH(endFrame, unk_06) }
#define CS_MISC(type, startFrame, endFrame, unused0) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, unused0) }
/**
* Declares a list of `CS_LIGHT_SETTING` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
* 00000097 eeeeeeee
* size = 0x8
*/
#define CS_LIGHTING_LIST(entries) { CS_CMD_SET_LIGHTING }, { CMD_W(entries) }
#define CS_LIGHT_SETTING_LIST(entries) { CS_CMD_LIGHT_SETTING }, { CMD_W(entries) }
/**
* Changes the environment lights to the specified setting.
* The lighting change will take place immediately with no blending.
*
* ARGS
* s16 setting (m), s16 startFrame (s), s16 endFrame (e)
* s16 setting (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_LIGHTING(setting, startFrame, endFrame) \
{ CMD_HH(setting, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_LIGHT_SETTING(lightSetting, startFrame, endFrame) \
{ CMD_BBH(0, (lightSetting + 1), startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -171,18 +222,18 @@
* 00000098 eeeeeeee
* size = 0x8
*/
#define CS_SCENE_TRANS_FX_LIST(entries) { CS_CMD_SCENE_TRANS_FX }, { CMD_W(entries) }
#define CS_TRANSITION_LIST(entries) { CS_CMD_TRANSITION }, { CMD_W(entries) }
/**
* ARGS
* s16 transitionType (m), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_SCENE_TRANS_FX(transitionType, startFrame, endFrame) \
{ CMD_HH(transitionType, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_TRANSITION(type, startFrame, endFrame) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -190,20 +241,20 @@
* s32 entries (e)
* FORMAT
* 00000099 eeeeeeee
* size = 0x08
* size = 0x8
*/
#define CS_MOTIONBLUR_LIST(entries) { CS_CMD_MOTIONBLUR }, { CMD_W(entries) }
#define CS_MOTION_BLUR_LIST(entries) { CS_CMD_MOTION_BLUR }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_MOTIONBLUR(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_MOTION_BLUR(type, startFrame, endFrame) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -213,18 +264,18 @@
* 0000009A eeeeeeee
* size = 0x8
*/
#define CS_GIVETATL_LIST(entries) { CS_CMD_GIVETATL }, { CMD_W(entries) }
#define CS_GIVE_TATL_LIST(entries) { CS_CMD_GIVE_TATL }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 giveTatl (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_GIVETATL(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_GIVE_TATL(giveTatl, startFrame, endFrame) \
{ CMD_HH(giveTatl, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -234,75 +285,66 @@
* 0000009B eeeeeeee
* size = 0x8
*/
#define CS_FADESCREEN_LIST(entries) { CS_CMD_FADESCREEN }, { CMD_W(entries) }
#define CS_TRANSITION_GENERAL_LIST(entries) { CS_CMD_TRANSITION_GENERAL }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e),
* s16 type (t), s16 startFrame (s), s16 endFrame (e),
* u8 red (r), u8 green (g), blue (b)
* FORMAT
* Capital U is Unused
* mmmmssss eeeerrgg bbUUUUUU
* ttttssss eeeerrgg bbUUUUUU
* size = 0x0C
*/
#define CS_FADESCREEN(base, startFrame, endFrame, red, green, blue) \
{ CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 0000009C eeeeeeee
* size = 0x8
*/
#define CS_FADESEQ_LIST(entries) { CS_CMD_FADESEQ }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU UUUUUUUU
* size = 0x0C
*/
#define CS_FADESEQ(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) }
#define CS_TRANSITION_GENERAL(type, startFrame, endFrame, red, green, blue) \
{ CMD_HH(type, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) }
/**
* Declares a list of `CS_TIME` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
* 0000009D eeeeeeee
* size = 0x8
*/
#define CS_TIME_LIST(entries) { CS_CMD_SETTIME }, { CMD_W(entries) }
#define CS_TIME_LIST(entries) { CS_CMD_TIME }, { CMD_W(entries) }
/**
* Sets the time of day.
* Both the day time and skybox time are set by this command.
* @note `endFrame` is not used in the implementation of the command, so its value does not matter
*
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m)
* s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m)
* FORMAT
* Capital U is Unused
* uuuussss eeeehhmm UUUUUUUU
* UUUUssss eeeehhmm UUUUUUUU
* size = 0xC
*/
#define CS_TIME(unk, startFrame, endFrame, hour, min, unused) \
{ CMD_HH(unk, startFrame) }, { CMD_HBB(endFrame, hour, min) }, { CMD_W(unused) }
#define CS_TIME(unused0, startFrame, endFrame, hour, min) \
{ CMD_HH(unused0, startFrame) }, { CMD_HBB(endFrame, hour, min) }, { CMD_W(0) }
/**
* Declares a list of `CS_ACTOR_CUE` entries.
*
* ARGS
* s32 cmdType (c), s32 entries (e)
* FORMAT
* cccccccc eeeeeeee
* size = 0x8
*/
#define CS_ACTOR_ACTION_LIST(cmdType, entries) { CMD_W(cmdType) }, { CMD_W(entries) }
#define CS_ACTOR_CUE_LIST(cmdType, entries) { CMD_W(cmdType) }, { CMD_W(entries) }
/**
* Defines a cue that an actor can listen for.
* The actor can choose whether or not to use the position and rotation data supplied to it.
* The cue `id` is a number that has an actor-specific meaning.
*
* ARGS
* s16 npcAction (a), s16 startFrame (s), s16 endFrame (e),
* s16 id (a), s16 startFrame (s), s16 endFrame (e),
* s16 rotX (u), s16 rotY (v), s16 rotZ (w),
* s32 startX (i), s32 startY (j), s32 startZ (k),
* s32 endX (l), s32 endY (m), s32 endZ (n),
@ -311,25 +353,29 @@
* aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
* size = 0x30
*/
#define CS_ACTOR_ACTION(npcAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
{ CMD_HH(npcAction, startFrame) }, { CMD_HH(endFrame, rotX) }, { CMD_HH(rotY, rotZ) }, \
#define CS_ACTOR_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
{ CMD_HH(id, startFrame) }, { CMD_HH(endFrame, rotX) }, { CMD_HH(rotY, rotZ) }, \
{ CMD_W(startX) }, { CMD_W(startY) }, { CMD_W(startZ) }, \
{ CMD_W(endX) }, { CMD_W(endY) }, { CMD_W(endZ) }, \
{ CMD_F(normX) }, { CMD_F(normY) }, { CMD_F(normZ) }
/**
* Declares a list of `CS_PLAYER_CUE` entries.
*
* ARGS
* s32 cmdType (c), s32 entries (e)
* FORMAT
* 000000C8 eeeeeeee
* size = 0x8
*/
#define CS_PLAYER_ACTION_LIST(entries) { CS_CMD_SET_PLAYER_ACTION }, { CMD_W(entries) }
#define CS_PLAYER_CUE_LIST(entries) { CS_CMD_PLAYER_CUE }, { CMD_W(entries) }
/**
* A player cue is the same as `CS_ACTOR_CUE` but is specifically for player.
*
* ARGS
* s16 playerAction (a), s16 startFrame (s), s16 endFrame (e),
* s16 id (a), s16 startFrame (s), s16 endFrame (e),
* s16 rotX (u), s16 rotY (v), s16 rotZ (w),
* s32 startX (i), s32 startY (j), s32 startZ (k),
* s32 endX (l), s32 endY (m), s32 endZ (n),
@ -338,113 +384,87 @@
* aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
* size = 0x30
*/
#define CS_PLAYER_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
CS_ACTOR_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ)
#define CS_PLAYER_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
CS_ACTOR_CUE(id, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ)
/**
* Declares a list of `CS_START_SEQ` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
* 0000012C eeeeeeee
* size = 0x8
*/
#define CS_PLAYSEQ_LIST(entries) { CS_CMD_PLAYSEQ }, { CMD_W(entries) }
#define CS_START_SEQ_LIST(entries) \
{ CS_CMD_START_SEQ }, { CMD_W(entries) }
/**
* Starts a sequence at the specified time.
* @note `endFrame` is not used in the implementation of the command, so its value does not matter
*
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 seqId (i), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
*/
#define CS_PLAYSEQ(sequence, startFrame, endFrame) \
{ CMD_HH(sequence, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000130 eeeeeeee
* iiiissss eeeeUUUU
* size = 0x8
*/
#define CS_SCENE_UNK_130_LIST(entries) { CS_CMD_130 }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x30
*/
#define CS_SCENE_UNK_130(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000131 eeeeeeee
* size = 0x8
*/
#define CS_SCENE_UNK_131_LIST(entries) { CS_CMD_131 }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
*/
#define CS_SCENE_UNK_131(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000132 eeeeeeee
* size = 0x8
*/
#define CS_SCENE_UNK_132_LIST(entries) { CS_CMD_132 }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
*/
#define CS_SCENE_UNK_132(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_START_SEQ(seqId, startFrame, endFrame) \
{ CMD_HH((seqId + 1), startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
* Declares a list of `CS_STOP_SEQ` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
* 00000133 eeeeeeee
* size = 0x8
*/
#define CS_STOPSEQ_LIST(entries) { CS_CMD_STOPSEQ }, { CMD_W(entries) }
#define CS_STOP_SEQ_LIST(entries) { CS_CMD_STOP_SEQ }, { CMD_W(entries) }
/**
* Stops a sequence at the specified time.
*
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 seqId (i), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* iiiissss eeeeUUUU
* size = 0x8
*/
#define CS_STOPSEQ(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
#define CS_STOP_SEQ(seqId, startFrame, endFrame, unk_06) \
{ CMD_HH((seqId + 1), startFrame) }, { CMD_HH(endFrame, unk_06) }
/**
* Stops a sequence at the specified time.
* @note `endFrame` is not used in the implementation of the command, so its value does not matter
*
* ARGS
* s32 entries (e)
* FORMAT
* 0000009C eeeeeeee
* size = 0x8
*/
#define CS_FADE_OUT_SEQ_LIST(entries) { CS_CMD_FADE_OUT_SEQ }, { CMD_W(entries) }
/**
* Fade out the sequence that is playing on the specified sequence player, over the specified frame range.
* @see `CutsceneFadeOutSeqPlayer`
*
* ARGS
* s16 seqPlayer (p), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* ppppssss eeeeUUUU UUUUUUUU
* size = 0x0C
*/
#define CS_FADE_OUT_SEQ(seqPlayer, startFrame, endFrame) \
{ CMD_HH(seqPlayer, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) }
/**
@ -454,18 +474,18 @@
* 00000134 eeeeeeee
* size = 0x8
*/
#define CS_PLAYAMBIENCE_LIST(entries) { CS_CMD_PLAYAMBIENCE }, { CMD_W(entries) }
#define CS_START_AMBIENCE_LIST(entries) { CS_CMD_START_AMBIENCE }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* UUUUssss eeeeUUUU
* size = 0x8
*/
#define CS_PLAYAMBIENCE(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
#define CS_START_AMBIENCE(unused0, startFrame, endFrame) \
{ CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) }
/**
@ -475,39 +495,106 @@
* 00000135 eeeeeeee
* size = 0x8
*/
#define CS_FADEAMBIENCE_LIST(entries) { CS_CMD_FADEAMBIENCE }, { CMD_W(entries) }
#define CS_FADE_OUT_AMBIENCE_LIST(entries) { CS_CMD_FADE_OUT_AMBIENCE }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* UUUUssss eeeeUUUU
* size = 0x8
*/
#define CS_FADEAMBIENCE(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
#define CS_FADE_OUT_AMBIENCE(unused0, startFrame, endFrame) \
{ CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 0000015E eeeeeeee
* 00000132 eeeeeeee
* size = 0x8
*/
#define CS_TERMINATOR_LIST(entries) { CS_CMD_TERMINATOR }, { CMD_W(entries) }
#define CS_MODIFY_SEQ_LIST(entries) { CS_CMD_MODIFY_SEQ }, { CMD_W(entries) }
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_TERMINATOR(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_MODIFY_SEQ(type, startFrame, endFrame) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000130 eeeeeeee
* size = 0x8
*/
#define CS_SFX_REVERB_INDEX_2_LIST(entries) { CS_CMD_SFX_REVERB_INDEX_2 }, { CMD_W(entries) }
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* UUUUssss eeeeUUUU
* size = 0x30
*/
#define CS_SFX_REVERB_INDEX_2(unused0, startFrame, endFrame) \
{ CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) }
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000131 eeeeeeee
* size = 0x8
*/
#define CS_SFX_REVERB_INDEX_1_LIST(entries) { CS_CMD_SFX_REVERB_INDEX_1 }, { CMD_W(entries) }
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* UUUUssss eeeeUUUU
* size = 0x8
*/
#define CS_SFX_REVERB_INDEX_1(unused0, startFrame, endFrame) \
{ CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, 0) }
/**
* Declares a list of `CS_DESTINATION` entries.
*
* ARGS
* s32 entries (e)
* FORMAT
* 0000015E eeeeeeee
* size = 0x8
*/
#define CS_DESTINATION_LIST(entries) { CS_CMD_DESTINATION }, { CMD_W(entries) }
/**
* Sends the player to a new destination using the entry defined in `CutsceneScriptEntry`.
*
* ARGS
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_DESTINATION(type, startFrame, endFrame) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -521,14 +608,14 @@
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_CHOOSE_CREDITS_SCENES(base, startFrame, endFrame) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
#define CS_CHOOSE_CREDITS_SCENES(type, startFrame, endFrame) \
{ CMD_HH(type, startFrame) }, { CMD_HH(endFrame, endFrame) }
/**
@ -542,14 +629,14 @@
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 type (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* ttttssss eeeeUUUU
* size = 0x8
*/
#define CS_RUMBLE(base, startFrame, endFrame, intensity, decayTimer, decayStep) \
{ CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, intensity, decayTimer) }, { CMD_BBBB(decayStep, 0, 0, 0) }
#define CS_RUMBLE(type, startFrame, endFrame, intensity, decayTimer, decayStep) \
{ CMD_HH(type, startFrame) }, { CMD_HBB(endFrame, intensity, decayTimer) }, { CMD_BBBB(decayStep, 0, 0, 0) }
/**
@ -563,14 +650,14 @@
/**
* ARGS
* s16 base (m), s16 startFrame (s), s16 endFrame (e)
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU
* size = 0x08
* UUUUssss eeeeUUUU
* size = 0x8
*/
#define CS_UNK_DATA(base, startFrame, endFrame, unk_06) \
{ CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
#define CS_UNK_DATA(unused0, startFrame, endFrame, unk_06) \
{ CMD_HH(unused0, startFrame) }, { CMD_HH(endFrame, unk_06) }
/**
@ -578,4 +665,47 @@
*/
#define CS_END() { CMD_W(0xFFFFFFFF) }
// TODO: Fix ZAPD and delete these
#define CS_ACTOR_ACTION_LIST CS_ACTOR_CUE_LIST
#define CS_ACTOR_ACTION CS_ACTOR_CUE
#define CS_PLAYER_ACTION_LIST CS_PLAYER_CUE_LIST
#define CS_PLAYER_ACTION CS_PLAYER_CUE
#define CS_LIGHTING_LIST CS_LIGHT_SETTING_LIST
#define CS_CAMERA_LIST CS_CAM_SPLINE_LIST
#define CS_TEXT_DISPLAY_TEXTBOX CS_TEXT
#define CS_TEXT_LEARN_SONG CS_TEXT_OCARINA_ACTION
#define CS_SCENE_TRANS_FX_LIST CS_TRANSITION_LIST
#define CS_SCENE_TRANS_FX CS_TRANSITION
#define CS_GIVETATL_LIST CS_GIVE_TATL_LIST
#define CS_GIVETATL CS_GIVE_TATL
#define CS_PLAYSEQ_LIST CS_START_SEQ_LIST
#define CS_STOPSEQ_LIST CS_STOP_SEQ_LIST
#define CS_FADESEQ_LIST CS_FADE_OUT_SEQ_LIST
#define CS_FADESEQ CS_FADE_OUT_SEQ
#define CS_PLAYAMBIENCE_LIST CS_START_AMBIENCE_LIST
#define CS_PLAYAMBIENCE CS_START_AMBIENCE
#define CS_FADEAMBIENCE_LIST CS_FADE_OUT_AMBIENCE_LIST
#define CS_FADEAMBIENCE CS_FADE_OUT_AMBIENCE
#define CS_SCENE_UNK_130_LIST CS_SFX_REVERB_INDEX_2_LIST
#define CS_SCENE_UNK_130 CS_SFX_REVERB_INDEX_2
#define CS_SCENE_UNK_131_LIST CS_SFX_REVERB_INDEX_1_LIST
#define CS_SCENE_UNK_131 CS_SFX_REVERB_INDEX_1
#define CS_SCENE_UNK_132_LIST CS_MODIFY_SEQ_LIST
#define CS_SCENE_UNK_132 CS_MODIFY_SEQ
#define CS_MOTIONBLUR_LIST CS_MOTION_BLUR_LIST
#define CS_MOTIONBLUR CS_MOTION_BLUR
#define CS_FADESCREEN_LIST CS_TRANSITION_GENERAL_LIST
#define CS_FADESCREEN CS_TRANSITION_GENERAL
#define CS_TERMINATOR_LIST CS_DESTINATION_LIST
#define CS_TERMINATOR CS_DESTINATION
#define CS_PLAYSEQ(seqId, startFrame, endFrame) \
CS_START_SEQ((seqId)-1, startFrame, endFrame)
#define CS_STOPSEQ(seqId, startFrame, endFrame, unk_06) \
CS_STOP_SEQ((seqId)-1, startFrame, endFrame, unk_06)
#define CS_LIGHTING(lightSetting, startFrame, endFrame) \
CS_LIGHT_SETTING((lightSetting)-1, startFrame, endFrame)
#endif

View File

@ -535,8 +535,8 @@ typedef enum PlayerCsMode {
/* 0x03 */ PLAYER_CSMODE_3,
/* 0x04 */ PLAYER_CSMODE_4,
/* 0x05 */ PLAYER_CSMODE_5,
/* 0x06 */ PLAYER_CSMODE_6,
/* 0x07 */ PLAYER_CSMODE_7,
/* 0x06 */ PLAYER_CSMODE_END,
/* 0x07 */ PLAYER_CSMODE_WAIT,
/* 0x08 */ PLAYER_CSMODE_8,
/* 0x09 */ PLAYER_CSMODE_9,
/* 0x0A */ PLAYER_CSMODE_10,
@ -1018,7 +1018,7 @@ typedef struct Player {
/* 0xA7C */ Actor* boomerangActor;
/* 0xA80 */ Actor* tatlActor;
/* 0xA84 */ s16 tatlTextId;
/* 0xA86 */ s8 unk_A86; // actorCutsceneIndex?
/* 0xA86 */ s8 csId;
/* 0xA87 */ s8 exchangeItemId; // PlayerItemAction enum
/* 0xA88 */ Actor* talkActor;
/* 0xA8C */ f32 talkActorDistance;

View File

@ -299,7 +299,7 @@ typedef struct Save {
/* 0x05 */ u8 isFirstCycle; // "opening_flag"
/* 0x06 */ u8 unk_06;
/* 0x07 */ u8 linkAge; // "link_age"
/* 0x08 */ s32 cutscene; // "day_time"
/* 0x08 */ s32 cutsceneIndex; // "day_time"
/* 0x0C */ u16 time; // "zelda_time"
/* 0x0E */ u16 owlSaveLocation;
/* 0x10 */ s32 isNight; // "asahiru_fg"
@ -707,7 +707,7 @@ typedef enum {
#define WEEKEVENTREG_20_01 PACK_WEEKEVENTREG_FLAG(20, 0x01)
// woodfall temple purification cutscene watched
#define WEEKEVENTREG_20_02 PACK_WEEKEVENTREG_FLAG(20, 0x02)
#define WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE PACK_WEEKEVENTREG_FLAG(20, 0x02)
#define WEEKEVENTREG_20_04 PACK_WEEKEVENTREG_FLAG(20, 0x04)
#define WEEKEVENTREG_20_08 PACK_WEEKEVENTREG_FLAG(20, 0x08)
@ -851,7 +851,7 @@ typedef enum {
#define WEEKEVENTREG_33_40 PACK_WEEKEVENTREG_FLAG(33, 0x40)
// Mountain village is unfrozen
#define WEEKEVENTREG_33_80 PACK_WEEKEVENTREG_FLAG(33, 0x80)
#define WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE PACK_WEEKEVENTREG_FLAG(33, 0x80)
// Spoken to MINIFROG_YELLOW
#define WEEKEVENTREG_34_01 PACK_WEEKEVENTREG_FLAG(34, 0x01)
@ -1015,7 +1015,7 @@ typedef enum {
#define WEEKEVENTREG_52_10 PACK_WEEKEVENTREG_FLAG(52, 0x10)
// cleared Stone Tower Temple
#define WEEKEVENTREG_52_20 PACK_WEEKEVENTREG_FLAG(52, 0x20)
#define WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE PACK_WEEKEVENTREG_FLAG(52, 0x20)
#define WEEKEVENTREG_52_40 PACK_WEEKEVENTREG_FLAG(52, 0x40)
#define WEEKEVENTREG_52_80 PACK_WEEKEVENTREG_FLAG(52, 0x80)
@ -1047,7 +1047,7 @@ typedef enum {
#define WEEKEVENTREG_55_40 PACK_WEEKEVENTREG_FLAG(55, 0x40)
// Gyorg has been defeated
#define WEEKEVENTREG_55_80 PACK_WEEKEVENTREG_FLAG(55, 0x80)
#define WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE PACK_WEEKEVENTREG_FLAG(55, 0x80)
#define WEEKEVENTREG_56_01 PACK_WEEKEVENTREG_FLAG(56, 0x01)
#define WEEKEVENTREG_56_02 PACK_WEEKEVENTREG_FLAG(56, 0x02)
@ -1576,7 +1576,7 @@ void Sram_IncrementDay(void);
u16 Sram_CalcChecksum(void* data, size_t count);
void Sram_InitNewSave(void);
void Sram_InitDebugSave(void);
void func_80144A94(SramContext* sramCtx);
void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx);
void Sram_OpenSave(struct FileSelectState* fileSelect, SramContext* sramCtx);
void func_8014546C(SramContext* sramCtx);
void func_801457CC(struct FileSelectState* fileSelect, SramContext* sramCtx);

View File

@ -177,9 +177,9 @@ typedef struct {
typedef struct {
/* 0x0 */ u8 code;
/* 0x1 */ u8 sceneCsCount;
/* 0x1 */ u8 scriptListCount;
/* 0x4 */ void* segment;
} SCmdCutsceneList; // size = 0x8
} SCmdCsScriptList; // size = 0x8
typedef struct {
/* 0x0 */ u8 code;
@ -202,7 +202,7 @@ typedef struct {
/* 0x0 */ u8 code;
/* 0x1 */ u8 num;
/* 0x4 */ void* segment;
} SCmdCutsceneActorList; // size = 0x8
} SCmdCutsceneList; // size = 0x8
typedef struct {
/* 0x0 */ u8 code;
@ -531,11 +531,11 @@ typedef union {
/* Command: 0x14 */ SCmdEndMarker endMarker;
/* Command: 0x15 */ SCmdSoundSettings soundSettings;
/* Command: 0x16 */ SCmdEchoSettings echoSettings;
/* Command: 0x17 */ SCmdCutsceneList cutsceneList;
/* Command: 0x17 */ SCmdCsScriptList scriptList;
/* Command: 0x18 */ SCmdAltHeaders altHeaders;
/* Command: 0x19 */ SCmdRegionVisited regionVisited;
/* Command: 0x1A */ SCmdTextureAnimations textureAnimations;
/* Command: 0x1B */ SCmdCutsceneActorList cutsceneActorList;
/* Command: 0x1B */ SCmdCutsceneList cutsceneList;
/* Command: 0x1C */ SCmdMinimapSettings minimapSettings;
/* Command: 0x1D */ // Unused
/* Command: 0x1E */ SCmdMinimapChests minimapChests;
@ -822,6 +822,15 @@ typedef enum {
*/
#define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4))
/*
* Entrances used in cutscene destination. Includes scene layer that's immediately applied to `nextCutsceneIndex` and removed.
* See `CutsceneScriptEntry.nextEntrance`
* 0xFE00: Index into sSceneEntranceTable (Scene)
* 0x01F0: Index into the scenes specific entrance table (Spawn)
* 0x000F: Index into the specific entrance table (Layer)
*/
#define CS_ENTRANCE(scene, spawn, layer) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4) | ((layer) & 0xF))
// SceneTableEntry draw configs
typedef enum {
/* 0 */ SCENE_DRAW_CFG_DEFAULT,
@ -867,7 +876,7 @@ typedef enum {
/* 0x14 */ SCENE_CMD_ID_END,
/* 0x15 */ SCENE_CMD_ID_SOUND_SETTINGS,
/* 0x16 */ SCENE_CMD_ID_ECHO_SETTINGS,
/* 0x17 */ SCENE_CMD_ID_CUTSCENE_LIST,
/* 0x17 */ SCENE_CMD_ID_CUTSCENE_SCRIPT_LIST,
/* 0x18 */ SCENE_CMD_ID_ALTERNATE_HEADER_LIST,
/* 0x19 */ SCENE_CMD_ID_SET_REGION_VISITED,
/* 0x1A */ SCENE_CMD_ID_ANIMATED_MATERIAL_LIST,
@ -952,21 +961,20 @@ typedef enum {
#define SCENE_CMD_ECHO_SETTINGS(echo) \
{ SCENE_CMD_ID_ECHO_SETTINGS, 0, CMD_BBBB(0, 0, 0, echo) }
#define SCENE_CMD_CUTSCENE_LIST(numCutscene, cutsceneList) \
{ SCENE_CMD_ID_CUTSCENE_LIST, numCutscene, CMD_PTR(cutsceneList) }
#define SCENE_CMD_CUTSCENE_SCRIPT_LIST(numEntries, scriptList) \
{ SCENE_CMD_ID_CUTSCENE_SCRIPT_LIST, numEntries, CMD_PTR(scriptList) }
#define SCENE_CMD_ALTERNATE_HEADER_LIST(alternateHeaderList) \
{ SCENE_CMD_ID_ALTERNATE_HEADER_LIST, 0, CMD_PTR(alternateHeaderList) }
#define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED // TODO: ZAPD Capatability
#define SCENE_CMD_SET_REGION_VISITED() \
{ SCENE_CMD_ID_SET_REGION_VISITED, 0, CMD_W(0) }
#define SCENE_CMD_ANIMATED_MATERIAL_LIST(matAnimList) \
{ SCENE_CMD_ID_ANIMATED_MATERIAL_LIST, 0, CMD_PTR(matAnimList) }
#define SCENE_CMD_ACTOR_CUTSCENE_LIST(actorCutsceneCount, actorCutsceneList) \
{ SCENE_CMD_ID_ACTOR_CUTSCENE_LIST, actorCutsceneCount, CMD_PTR(actorCutsceneList) }
#define SCENE_CMD_ACTOR_CUTSCENE_LIST(numEntries, actorCutsceneList) \
{ SCENE_CMD_ID_ACTOR_CUTSCENE_LIST, numEntries, CMD_PTR(actorCutsceneList) }
#define SCENE_CMD_MINIMAP_INFO(minimapInfo) \
{ SCENE_CMD_ID_MINIMAP_INFO, 0, CMD_PTR(minimapInfo) }
@ -974,4 +982,8 @@ typedef enum {
#define SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(compassIconCount, compassIconInfo) \
{ SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO, compassIconCount, CMD_PTR(compassIconInfo) }
// TODO: ZAPD Capatability
#define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED
#define SCENE_CMD_CUTSCENE_LIST SCENE_CMD_CUTSCENE_SCRIPT_LIST
#endif

View File

@ -11,9 +11,9 @@ extern Vec3f gOneVec3f;
#define SUBS_TIME_PATHING_ORDER 3
typedef enum {
/* 0 */ SUBS_CUTSCENE_SET_UNK_LINK_FIELDS,
/* 0 */ SUBS_CUTSCENE_WITH_PLAYER,
/* 1 */ SUBS_CUTSCENE_NORMAL,
/* 2 */ SUBS_CUTSCENE_SET_FLAG
/* 2 */ SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG
} SubSCutsceneType;
//! TODO: rename based on func_8013E748 and func_800B8500
@ -153,8 +153,8 @@ s32 SubS_ActorPathing_SetNextPoint(struct PlayState* play, ActorPathing* actorPa
void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animationInfo, s32 nextAnimIndex, s32* curAnimIndex);
s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type);
s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes);
s32 SubS_StartCutscene(Actor* actor, s16 nextCsId, s16 curCsId, s32 type);
s32 SubS_FillCutscenesList(Actor* actor, s16 csIdList[], s16 numCutscenes);
void SubS_ConstructPlane(Vec3f* point, Vec3f* unitVec, Vec3s* rot, Plane* plane);
s32 SubS_LineSegVsPlane(Vec3f* point, Vec3s* rot, Vec3f* unitVec, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect);

5
spec
View File

@ -470,7 +470,6 @@ beginseg
include "build/data/code/z_eventmgr.bss.o"
include "build/src/code/z_fcurve_data.o"
include "build/src/code/z_fcurve_data_skelanime.o"
include "build/data/code/code_801BD830.data.o"
include "build/src/code/z_fireobj.o"
include "build/src/code/z_game_dlftbls.o"
include "build/src/code/z_horse.o"
@ -539,8 +538,8 @@ beginseg
include "build/src/code/z_message_staff.o"
include "build/src/code/z_player_call.o"
include "build/src/code/z_shrink_window.o"
include "build/src/code/db_camera.o"
include "build/data/code/db_camera.bss.o"
include "build/src/code/cutscene_camera.o"
include "build/data/code/cutscene_camera.bss.o"
include "build/src/code/z_kaleido_manager.o"
include "build/src/code/z_kaleido_scope_call.o"
include "build/src/code/z_fbdemo_dlftbls.o"

View File

@ -3357,7 +3357,7 @@ void AudioOcarina_Update(void) {
#define OCARINA_INSTRUMENT_OOT_MAX 7
void AudioOcarina_PlayLongScarecrowAfterCredits(void) {
void AudioOcarina_PlayLongScarecrowSong(void) {
static u8 sScarecrowAfterCreditsState = 0;
static u8 sScarecrowAfterCreditsIntrumentId = OCARINA_INSTRUMENT_DEFAULT;
static u16 sScarecrowAfterCreditsTimer = 1200;

View File

@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "global.h"
#include "stack.h"
#include "buffers.h"

View File

@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
u8 sYaz0DataBuffer[0x400];

380
src/code/cutscene_camera.c Normal file
View File

@ -0,0 +1,380 @@
#include "global.h"
extern CutsceneCamera* sCurCsCamera;
typedef s16 (*CsCamInterpolateCallback)(Vec3f*, f32*, s16*, CsCmdCamPoint*, CsCmdCamMisc*, CutsceneCameraInterp*);
// function declarations
s16 func_80161180(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_8016237C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_8016253C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_80162A50(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_801623E4(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_80161C20(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_80161E4C(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_801620CC(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
s16 func_80163334(Vec3f* pos, f32* fov, s16* roll, CsCmdCamPoint* point, CsCmdCamMisc* misc,
CutsceneCameraInterp* interp);
f32 func_80163660(Actor* actor);
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161180.s")
/**
* Initializes Cutscene Camera Info
*/
s32 CutsceneCamera_Init(Camera* camera, CutsceneCamera* csCamera) {
csCamera->camera = camera;
csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0;
csCamera->cmdIndex = 0;
csCamera->splineIndex = 0xFFFF;
csCamera->splineNeedsInit = true;
csCamera->state = CS_CAM_STATE_UPDATE_ALL;
sCurCsCamera = csCamera;
__osMemset(&csCamera->eyeInterp, 0, sizeof(CutsceneCameraInterp));
__osMemset(&csCamera->atInterp, 0, sizeof(CutsceneCameraInterp));
csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7;
return 1;
}
CsCamInterpolateCallback CutsceneCamera_Interpolate(u8 interpType) {
switch (interpType) {
case CS_CAM_INTERP_7:
default:
return func_80161180;
case CS_CAM_INTERP_0:
return func_8016237C;
case CS_CAM_INTERP_5:
return func_8016253C;
case CS_CAM_INTERP_4:
return func_80162A50;
case CS_CAM_INTERP_1:
return func_801623E4;
case CS_CAM_INTERP_2:
return func_80161C20;
case CS_CAM_INTERP_3:
return func_80161E4C;
case CS_CAM_INTERP_6:
return func_801620CC;
}
}
u8 CutsceneCamera_ProcessSpline(CutsceneCamera* csCamera) {
s32 sp5C;
f32* fov;
s16* roll;
CsCamInterpolateCallback interpHandler;
Player* player;
Actor* target;
s16 numPoints;
sp5C = true;
if (csCamera->state == CS_CAM_STATE_DONE_SPLINE) {
return false;
}
player = GET_PLAYER(csCamera->camera->play);
target = csCamera->camera->target;
if (csCamera->eyeCmd[csCamera->atInterp.curPoint].interpType <
csCamera->atCmd[csCamera->eyeInterp.curPoint].interpType) {
sp5C = false;
}
csCamera->eyeInterp.unk_00 = csCamera->camera->eye;
csCamera->atInterp.unk_00 = csCamera->camera->at;
if (sp5C) {
fov = NULL;
} else {
fov = &csCamera->camera->fov;
}
if (sp5C) {
roll = NULL;
} else {
roll = &csCamera->camera->roll;
}
interpHandler = CutsceneCamera_Interpolate(csCamera->atCmd[csCamera->eyeInterp.curPoint].interpType);
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2);
break;
default: // CS_CAM_REL_0
break;
}
numPoints = interpHandler(&csCamera->camera->at, fov, roll, &csCamera->atCmd[csCamera->eyeInterp.curPoint],
&csCamera->miscCmd[csCamera->eyeInterp.curPoint], &csCamera->eyeInterp);
switch (csCamera->atCmd[csCamera->eyeInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 2);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
csCamera->camera->at.y += func_80163660(&player->actor);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->at, &csCamera->camera->at, 1);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 1);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->at, &csCamera->camera->at, 2);
break;
default: // CS_CAM_REL_0
break;
}
csCamera->eyeInterp.curPoint += numPoints;
if (sp5C) {
fov = &csCamera->camera->fov;
} else {
fov = NULL;
}
if (sp5C) {
roll = &csCamera->camera->roll;
} else {
roll = NULL;
}
interpHandler = CutsceneCamera_Interpolate(csCamera->eyeCmd[csCamera->atInterp.curPoint].interpType);
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fDiff(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fDiff(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
break;
default: // CS_CAM_REL_0
break;
}
numPoints = interpHandler(&csCamera->camera->eye, fov, roll, &csCamera->eyeCmd[csCamera->atInterp.curPoint],
&csCamera->miscCmd[csCamera->atInterp.curPoint], &csCamera->atInterp);
switch (csCamera->eyeCmd[csCamera->atInterp.curPoint].relativeTo) {
case CS_CAM_REL_2:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
break;
case CS_CAM_REL_3:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
csCamera->camera->eye.y += func_80163660(&player->actor);
break;
case CS_CAM_REL_1:
OLib_DbCameraVec3fSum(&player->actor.world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
break;
case CS_CAM_REL_4:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 1);
break;
case CS_CAM_REL_5:
OLib_DbCameraVec3fSum(&target->world, &csCamera->camera->eye, &csCamera->camera->eye, 2);
break;
default: // CS_CAM_REL_0
break;
}
csCamera->atInterp.curPoint += numPoints;
if ((csCamera->eyeInterp.curPoint >= csCamera->eyeInterp.numEntries) ||
(csCamera->atInterp.curPoint >= csCamera->atInterp.numEntries)) {
return false;
}
return true;
}
/**
* Processes camera cutscene commands
*/
s32 CutsceneCamera_UpdateSplines(u8* script, CutsceneCamera* csCamera) {
CsCmdCamSpline* spline;
switch (csCamera->state) {
case CS_CAM_STATE_DONE:
return 0;
case CS_CAM_STATE_PAUSE:
return csCamera->nextSplineTimer;
case CS_CAM_STATE_UPDATE_SPLINE:
if (csCamera->updateSplineTimer <= csCamera->duration) {
csCamera->updateSplineTimer++;
if (csCamera->updateSplineTimer <= csCamera->duration) {
// Process Spline
if (!CutsceneCamera_ProcessSpline(csCamera)) {
csCamera->state = CS_CAM_STATE_DONE_SPLINE;
}
}
}
break;
case CS_CAM_STATE_DONE_SPLINE:
break;
default: // CS_CAM_STATE_UPDATE_ALL
if (csCamera->splineNeedsInit == true) {
// Spline Header
spline = (CsCmdCamSpline*)&script[csCamera->cmdIndex];
csCamera->atInterp.numEntries = csCamera->eyeInterp.numEntries = spline->numEntries;
csCamera->duration = spline->duration;
csCamera->cmdIndex += sizeof(CsCmdCamSpline);
// At Point
csCamera->atCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex];
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint));
// Misc Point
csCamera->eyeCmd = (CsCmdCamPoint*)&script[csCamera->cmdIndex];
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamPoint));
// Misc
csCamera->miscCmd = (CsCmdCamMisc*)&script[csCamera->cmdIndex];
csCamera->cmdIndex += (s16)(csCamera->eyeInterp.numEntries * sizeof(CsCmdCamMisc));
// Other Params
csCamera->eyeInterp.curPoint = 0;
csCamera->atInterp.curPoint = 0;
csCamera->splineNeedsInit = false;
//! FAKE: csCamera->splineIndex++;
csCamera->splineIndex = (csCamera->splineIndex & 0xFFFF) + 1;
csCamera->state = CS_CAM_STATE_UPDATE_ALL;
csCamera->nextSplineTimer = csCamera->updateSplineTimer = 0;
csCamera->eyeInterp.unk_2D = csCamera->atInterp.unk_2D = 7;
}
csCamera->nextSplineTimer++;
if (csCamera->updateSplineTimer <= csCamera->duration) {
csCamera->updateSplineTimer++;
if (csCamera->updateSplineTimer <= csCamera->duration) {
// Process SubCommands
if (!CutsceneCamera_ProcessSpline(csCamera)) {
csCamera->state = CS_CAM_STATE_DONE_SPLINE;
}
}
}
break;
}
if (csCamera->nextSplineTimer > csCamera->duration) {
// Next Spline
csCamera->splineNeedsInit = true;
spline = (CsCmdCamSpline*)&script[csCamera->cmdIndex];
if (spline->numEntries == -1) {
csCamera->state = CS_CAM_STATE_DONE;
return 0;
}
}
return csCamera->nextSplineTimer;
}
// Unused
s16 func_80161BAC(void) {
return (sCurCsCamera->state == CS_CAM_STATE_PAUSE) || (sCurCsCamera->state == CS_CAM_STATE_UPDATE_SPLINE);
}
void CutsceneCamera_SetState(s16 state) {
if (sCurCsCamera->state == CS_CAM_STATE_UPDATE_ALL) {
sCurCsCamera->state = state;
}
}
void CutsceneCamera_Reset(void) {
sCurCsCamera->state = CS_CAM_STATE_UPDATE_ALL;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161C20.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80161E4C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801620CC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016237C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801623E4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801624EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_8016253C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801629BC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162A50.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80162FF8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_801631DC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163334.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/cutscene_camera/func_80163660.s")

View File

@ -1,43 +0,0 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161180.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016119C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016122C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801612B8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161998.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161BAC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161BE0.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161C0C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161C20.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80161E4C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801620CC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016237C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801623E4.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801624EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_8016253C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801629BC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80162A50.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80162FF8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_801631DC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80163334.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/db_camera/func_80163660.s")

View File

@ -1371,7 +1371,7 @@ void func_800B722C(GameState* gameState, Player* player) {
s32 func_800B724C(PlayState* play, Actor* actor, u8 csMode) {
Player* player = GET_PLAYER(play);
if ((player->csMode == PLAYER_CSMODE_5) || ((csMode == PLAYER_CSMODE_6) && (player->csMode == PLAYER_CSMODE_0))) {
if ((player->csMode == PLAYER_CSMODE_5) || ((csMode == PLAYER_CSMODE_END) && (player->csMode == PLAYER_CSMODE_0))) {
return false;
}
@ -1880,7 +1880,7 @@ s32 func_800B8500(Actor* actor, PlayState* play, f32 xzRange, f32 yRange, Player
player->talkActorDistance = actor->xzDistToPlayer;
player->exchangeItemId = exchangeItemId;
ActorCutscene_SetIntentToPlay(0x7C);
CutsceneManager_Queue(CS_ID_GLOBAL_TALK);
return true;
}
@ -2048,7 +2048,7 @@ s32 Actor_OfferGetItem(Actor* actor, PlayState* play, GetItemId getItemId, f32 x
player->getItemDirection = absYawDiff;
if ((getItemId > GI_NONE) && (getItemId < GI_MAX)) {
ActorCutscene_SetIntentToPlay(play->playerActorCsIds[1]);
CutsceneManager_Queue(play->playerCsIds[PLAYER_CS_ID_ITEM_GET]);
}
return true;
@ -2123,7 +2123,7 @@ s32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide) {
PLAYER_STATE1_40000 | PLAYER_STATE1_80000 | PLAYER_STATE1_100000 | PLAYER_STATE1_200000))) {
player->rideActor = horse;
player->mountSide = mountSide;
ActorCutscene_SetIntentToPlay(0x7C);
CutsceneManager_Queue(CS_ID_GLOBAL_TALK);
return true;
}
@ -3126,8 +3126,8 @@ void Actor_FreeOverlay(ActorOverlay* entry) {
Actor* Actor_Spawn(ActorContext* actorCtx, PlayState* play, s16 actorId, f32 posX, f32 posY, f32 posZ, s16 rotX,
s16 rotY, s16 rotZ, s32 params) {
return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1,
HALFDAYBIT_ALL, NULL);
return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params,
CS_ID_NONE, HALFDAYBIT_ALL, NULL);
}
ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
@ -3171,7 +3171,7 @@ ActorInit* Actor_LoadOverlay(ActorContext* actorCtx, s16 index) {
}
Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s16 index, f32 x, f32 y, f32 z, s16 rotX,
s16 rotY, s16 rotZ, s32 params, u32 cutscene, u32 halfDaysBits, Actor* parent) {
s16 rotY, s16 rotZ, s32 params, u32 csId, u32 halfDaysBits, Actor* parent) {
s32 pad;
Actor* actor;
ActorInit* actorInit;
@ -3237,10 +3237,10 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
actor->home.rot.y = rotY;
actor->home.rot.z = rotZ;
actor->params = params & 0xFFFF;
actor->cutscene = (cutscene & 0x7F);
actor->csId = csId & 0x7F;
if (actor->cutscene == 0x7F) {
actor->cutscene = -1;
if (actor->csId == 0x7F) {
actor->csId = CS_ID_NONE;
}
if (halfDaysBits != 0) {
@ -3263,8 +3263,8 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
Actor* Actor_SpawnAsChild(ActorContext* actorCtx, Actor* parent, PlayState* play, s16 actorId, f32 posX, f32 posY,
f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s32 params) {
return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params, -1,
parent->halfDaysBits, parent);
return Actor_SpawnAsChildAndCutscene(actorCtx, play, actorId, posX, posY, posZ, rotX, rotY, rotZ, params,
CS_ID_NONE, parent->halfDaysBits, parent);
}
void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
@ -4404,7 +4404,7 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
Player* player = GET_PLAYER(play);
f32 phi_f2;
if ((play->csCtx.state != CS_STATE_0) || gDbgCamEnabled) {
if ((play->csCtx.state != CS_STATE_IDLE) || gDbgCamEnabled) {
phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f;
} else {
phi_f2 = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos);

View File

@ -3613,31 +3613,31 @@ CameraSetting sCameraSettings[] = {
};
s16 sGlobalCamDataSettings[] = {
/* -25 */ CAM_SET_ELEGY_SHELL,
/* -24 */ CAM_SET_SIDED,
/* -23 */ CAM_SET_BOAT_CRUISE,
/* -22 */ CAM_SET_NONE,
/* -21 */ CAM_SET_SUBJECTD,
/* -20 */ CAM_SET_NORMALD,
/* -19 */ CAM_SET_NONE,
/* -18 */ CAM_SET_NONE,
/* -17 */ CAM_SET_NONE,
/* -16 */ CAM_SET_WARP_PAD_ENTRANCE,
/* -15 */ CAM_SET_ATTENTION,
/* -14 */ CAM_SET_CONNECT0,
/* -13 */ CAM_SET_REMOTEBOMB,
/* -12 */ CAM_SET_NONE,
/* -11 */ CAM_SET_MASK_TRANSFORMATION,
/* -10 */ CAM_SET_LONG_CHEST_OPENING,
/* -9 */ CAM_SET_REBIRTH,
/* -8 */ CAM_SET_DEATH,
/* -7 */ CAM_SET_WARP_PAD_MOON,
/* -6 */ CAM_SET_NAVI,
/* -5 */ CAM_SET_ITEM3,
/* -4 */ CAM_SET_ITEM2,
/* -3 */ CAM_SET_ITEM1,
/* -2 */ CAM_SET_ITEM0,
/* -1 */ CAM_SET_STOP0,
/* -25 */ CAM_SET_ELEGY_SHELL, // CS_CAM_ID_GLOBAL_ELEGY
/* -24 */ CAM_SET_SIDED, // CS_CAM_ID_GLOBAL_SIDED
/* -23 */ CAM_SET_BOAT_CRUISE, // CS_CAM_ID_GLOBAL_BOAT_CRUISE
/* -22 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N16
/* -21 */ CAM_SET_SUBJECTD, // CS_CAM_ID_GLOBAL_SUBJECTD
/* -20 */ CAM_SET_NORMALD, // CS_CAM_ID_GLOBAL_NORMALD
/* -19 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N13
/* -18 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N12
/* -17 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N11
/* -16 */ CAM_SET_WARP_PAD_ENTRANCE, // CS_CAM_ID_GLOBAL_WARP_PAD_ENTRANCE
/* -15 */ CAM_SET_ATTENTION, // CS_CAM_ID_GLOBAL_ATTENTION
/* -14 */ CAM_SET_CONNECT0, // CS_CAM_ID_GLOBAL_CONNECT
/* -13 */ CAM_SET_REMOTEBOMB, // CS_CAM_ID_GLOBAL_REMOTE_BOMB
/* -12 */ CAM_SET_NONE, // CS_CAM_ID_GLOBAL_N0C
/* -11 */ CAM_SET_MASK_TRANSFORMATION, // CS_CAM_ID_GLOBAL_MASK_TRANSFORMATION
/* -10 */ CAM_SET_LONG_CHEST_OPENING, // CS_CAM_ID_GLOBAL_LONG_CHEST_OPENING
/* -9 */ CAM_SET_REBIRTH, // CS_CAM_ID_GLOBAL_REVIVE
/* -8 */ CAM_SET_DEATH, // CS_CAM_ID_GLOBAL_DEATH
/* -7 */ CAM_SET_WARP_PAD_MOON, // CS_CAM_ID_GLOBAL_WARP_PAD_MOON
/* -6 */ CAM_SET_NAVI, // CS_CAM_ID_GLOBAL_SONG_WARP
/* -5 */ CAM_SET_ITEM3, // CS_CAM_ID_GLOBAL_ITEM_SHOW
/* -4 */ CAM_SET_ITEM2, // CS_CAM_ID_GLOBAL_ITEM_BOTTLE
/* -3 */ CAM_SET_ITEM1, // CS_CAM_ID_GLOBAL_ITEM_OCARINA
/* -2 */ CAM_SET_ITEM0, // CS_CAM_ID_GLOBAL_ITEM_GET
/* -1 */ CAM_SET_STOP0, // CS_CAM_ID_NONE
/* 0 */ CAM_SET_NONE,
};

View File

@ -1,4 +1,3 @@
#include "prevent_bss_reordering.h"
#include "global.h"
Vec3f D_801EDE00;

File diff suppressed because it is too large Load Diff

View File

@ -1,33 +1,33 @@
#include "global.h"
void EnvFlags_UnsetAll(PlayState* play) {
void CutsceneFlags_UnsetAll(PlayState* play) {
u8 i;
for (i = 0; i < ARRAY_COUNT(play->envFlags); i++) {
play->envFlags[i] = 0;
for (i = 0; i < ARRAY_COUNT(play->cutsceneFlags); i++) {
play->cutsceneFlags[i] = 0;
}
}
void EnvFlags_Set(PlayState* play, s16 flag) {
void CutsceneFlags_Set(PlayState* play, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
play->envFlags[index] |= mask;
play->cutsceneFlags[index] |= mask;
}
void EnvFlags_Unset(PlayState* play, s16 flag) {
void CutsceneFlags_Unset(PlayState* play, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = (1 << bit) ^ 0xFFFF;
play->envFlags[index] &= mask;
play->cutsceneFlags[index] &= mask;
}
s32 EnvFlags_Get(PlayState* play, s16 flag) {
s32 CutsceneFlags_Get(PlayState* play, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
return play->envFlags[index] & mask;
return play->cutsceneFlags[index] & mask;
}

View File

@ -1,52 +1,554 @@
/**
* @file z_eventmgr.c
*
* Manages all cutscenes except for manual
*/
#include "global.h"
#include "z64shrink_window.h"
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F1460.s")
ActorCutscene sGlobalCutsceneList[] = {
// CS_ID_GLOBAL_78
{ -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255,
255 },
// CS_ID_GLOBAL_79
{ -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255,
255 },
// CS_ID_GLOBAL_7A
{ -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255,
255 },
// CS_ID_GLOBAL_ELEGY
{ 2, -1, CS_CAM_ID_GLOBAL_ELEGY, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_NONE,
CS_END_CAM_0, 32 },
// CS_ID_GLOBAL_TALK
{ 32765, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT,
CS_END_CAM_0, 255 },
// CS_ID_GLOBAL_DOOR
{ 32764, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT,
CS_END_CAM_0, 255 },
// CS_ID_GLOBAL_RETURN_TO_CAM
{ 32766, -2, CS_CAM_ID_GLOBAL_CONNECT, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE, 255,
CS_HUD_VISIBILITY_ALL_ALT, CS_END_CAM_0, 32 },
// CS_ID_GLOBAL_END
{ 0, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE, 255, CS_HUD_VISIBILITY_ALL_ALT,
CS_END_CAM_0, 32 },
};
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutsceneImpl.s")
typedef enum {
/* 0 */ CS_START_0,
/* 1 */ CS_START_1,
/* 2 */ CS_START_2,
} ActorCutsceneStartMethod;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Init.s")
typedef struct {
/* 0x00 */ s16 csId;
/* 0x02 */ s16 length;
/* 0x04 */ s16 endCsId;
/* 0x06 */ s16 subCamId;
/* 0x08 */ Actor* targetActor;
/* 0x0C */ s32 startMethod;
/* 0x10 */ PlayState* play;
/* 0x14 */ s16 retCamId;
/* 0x16 */ s16 isCameraStored;
} CutsceneManager; // size = 0x18
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F15D8.s")
CutsceneManager sCutsceneMgr = {
CS_ID_NONE, 0, CS_ID_NONE, SUB_CAM_ID_DONE, NULL, CS_START_0, NULL, CAM_ID_MAIN, false,
};
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearWaiting.s")
s16 CutsceneManager_SetHudVisibility(s16 csHudVisibility) {
u16 hudVisibility;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_ClearNextCutscenes.s")
switch (csHudVisibility) {
case CS_HUD_VISIBILITY_NONE:
hudVisibility = HUD_VISIBILITY_NONE_ALT;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_MarkNextCutscenes.s")
case CS_HUD_VISIBILITY_ALL:
hudVisibility = HUD_VISIBILITY_ALL;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_End.s")
case CS_HUD_VISIBILITY_A_HEARTS_MAGIC:
hudVisibility = HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Update.s")
case CS_HUD_VISIBILITY_C_HEARTS_MAGIC:
hudVisibility = HUD_VISIBILITY_HEARTS_MAGIC_C;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_SetIntentToPlay.s")
case CS_HUD_VISIBILITY_ALL_NO_MINIMAP:
hudVisibility = HUD_VISIBILITY_ALL_NO_MINIMAP;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCanPlayNext.s")
case CS_HUD_VISIBILITY_A_B_C:
hudVisibility = HUD_VISIBILITY_A_B_C;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetUnkLinkFields.s")
case CS_HUD_VISIBILITY_B_MINIMAP:
hudVisibility = HUD_VISIBILITY_B_MINIMAP;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_StartAndSetFlag.s")
case CS_HUD_VISIBILITY_A:
hudVisibility = HUD_VISIBILITY_A;
break;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Start.s")
default:
hudVisibility = HUD_VISIBILITY_ALL;
break;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_Stop.s")
Interface_SetHudVisibility(hudVisibility);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentIndex.s")
return hudVisibility;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCutscene.s")
ActorCutscene* CutsceneManager_GetCutsceneEntryImpl(s16 csId) {
if (csId < CS_ID_GLOBAL_78) {
return &sSceneCutsceneList[csId];
} else {
csId -= CS_ID_GLOBAL_78;
return &sGlobalCutsceneList[csId];
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetAdditionalCutscene.s")
void CutsceneManager_Init(PlayState* play, ActorCutscene* cutsceneList, s16 numEntries) {
s32 i;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetLength.s")
sSceneCutsceneList = cutsceneList;
sSceneCutsceneCount = numEntries;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F2138.s")
for (i = 0; i < ARRAY_COUNT(sWaitingCutsceneList); i++) {
sWaitingCutsceneList[i] = 0;
sNextCutsceneList[i] = 0;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F2178.s")
sCutsceneMgr.endCsId = CS_ID_NONE;
sCutsceneMgr.play = play;
sCutsceneMgr.length = -1;
sCutsceneMgr.targetActor = NULL;
sCutsceneMgr.subCamId = SUB_CAM_ID_DONE;
sCutsceneMgr.isCameraStored = false;
sCutsceneMgr.csId = sCutsceneMgr.endCsId;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_GetCurrentSubCamId.s")
/**
* Store camera into subCam 2, and keep subCam 2 INACTIVE to preserve the struct.
*/
void CutsceneManager_StoreCamera(Camera* camera) {
if (camera != NULL) {
memcpy(&sCutsceneMgr.play->subCameras[2], camera, sizeof(Camera));
sCutsceneMgr.play->subCameras[2].camId = camera->camId;
Camera_ChangeStatus(&sCutsceneMgr.play->subCameras[2], CAM_STATUS_INACTIVE);
sCutsceneMgr.isCameraStored = true;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F21CC.s")
void CutsceneManager_ClearWaiting(void) {
s32 i;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/func_800F22C4.s")
for (i = 0; i < ARRAY_COUNT(sWaitingCutsceneList); i++) {
sWaitingCutsceneList[i] = 0;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_eventmgr/ActorCutscene_SetReturnCamera.s")
void CutsceneManager_ClearNextCutscenes(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(sNextCutsceneList); i++) {
sNextCutsceneList[i] = 0;
}
}
s16 CutsceneManager_MarkNextCutscenes(void) {
s16 bit;
s32 i;
s32 j;
s32 count = 0;
s16 csIdMax = CS_ID_NONE;
s16 priorityMax = SHT_MAX; // lower number means higher priority
s16 csId;
s16 priority;
for (i = 0; i < ARRAY_COUNT(sNextCutsceneList); i++) {
for (bit = 1, j = 0; j < 8; j++) {
if (sWaitingCutsceneList[i] & bit) {
csId = (i << 3) | j;
priority = CutsceneManager_GetCutsceneEntryImpl(csId)->priority;
if ((priority ^ 0) == -1) {
sNextCutsceneList[i] |= bit;
} else if ((priority < priorityMax) && (priority > 0)) {
csIdMax = csId;
priorityMax = priority;
}
count++;
}
bit <<= 1;
}
}
if (csIdMax != CS_ID_NONE) {
sNextCutsceneList[csIdMax >> 3] |= 1 << (csIdMax & 7);
}
return count;
}
#define RET_CAM sCutsceneMgr.play->cameraPtrs[sCutsceneMgr.retCamId]
#define CUR_CAM sCutsceneMgr.play->cameraPtrs[sCutsceneMgr.subCamId]
void CutsceneManager_End(void) {
ActorCutscene* csEntry;
s16 oldCamId;
s16 oldStateFlags;
switch (sCutsceneMgr.startMethod) {
case CS_START_2:
sCutsceneMgr.targetActor->flags &= ~ACTOR_FLAG_100000;
// fallthrough
case CS_START_1:
func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_END);
sCutsceneMgr.startMethod = CS_START_0;
break;
default:
break;
}
csEntry = CutsceneManager_GetCutsceneEntryImpl(sCutsceneMgr.csId);
switch (csEntry->endSfx) {
case CS_END_SFX_TRE_BOX_APPEAR:
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
break;
case CS_END_SFX_CORRECT_CHIME:
play_sound(NA_SE_SY_CORRECT_CHIME);
break;
default: // CS_END_SFX_NONE
break;
}
switch (csEntry->endCam) {
case CS_END_CAM_SMOOTH:
Play_CopyCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId, sCutsceneMgr.subCamId);
RET_CAM->stateFlags =
(RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER);
CutsceneManager_Queue(CS_ID_GLOBAL_RETURN_TO_CAM);
break;
case CS_END_CAM_0:
default:
Play_CopyCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId, sCutsceneMgr.subCamId);
RET_CAM->stateFlags =
(RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER);
break;
case CS_END_CAM_1:
oldCamId = RET_CAM->camId;
oldStateFlags = RET_CAM->stateFlags;
if (sCutsceneMgr.isCameraStored) {
// Restore the camera that was stored in subCam 2
memcpy(RET_CAM, &sCutsceneMgr.play->subCameras[2], sizeof(Camera));
RET_CAM->stateFlags =
(RET_CAM->stateFlags & ~CAM_STATE_UNDERWATER) | (CUR_CAM->stateFlags & CAM_STATE_UNDERWATER);
RET_CAM->stateFlags = (RET_CAM->stateFlags & ~CAM_STATE_2) | (oldStateFlags & CAM_STATE_2);
sCutsceneMgr.isCameraStored = false;
}
RET_CAM->camId = oldCamId;
break;
}
if (sCutsceneMgr.subCamId != SUB_CAM_ID_DONE) {
Play_ClearCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId);
Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.retCamId, CAM_STATUS_ACTIVE);
}
sCutsceneMgr.csId = CS_ID_NONE;
sCutsceneMgr.endCsId = CS_ID_NONE;
sCutsceneMgr.length = -1;
sCutsceneMgr.targetActor = NULL;
sCutsceneMgr.subCamId = SUB_CAM_ID_DONE;
}
s16 CutsceneManager_Update(void) {
s16 sp1E = 0;
if (CutsceneManager_IsNext(CS_ID_GLOBAL_RETURN_TO_CAM)) {
CutsceneManager_StartWithPlayerCs(CS_ID_GLOBAL_RETURN_TO_CAM, &GET_PLAYER(sCutsceneMgr.play)->actor);
}
if (sCutsceneMgr.endCsId == CS_ID_NONE) {
if (sCutsceneMgr.csId != CS_ID_NONE) {
if (sCutsceneMgr.length > 0) {
sCutsceneMgr.length--;
}
sp1E = 1;
if (sCutsceneMgr.length == 0) {
CutsceneManager_Stop(sCutsceneMgr.csId);
}
}
}
if (sCutsceneMgr.endCsId != CS_ID_NONE) {
CutsceneManager_End();
sp1E = 2;
}
CutsceneManager_ClearNextCutscenes();
if (sCutsceneMgr.csId == CS_ID_NONE) {
if ((CutsceneManager_MarkNextCutscenes() == 0) && (sp1E != 0)) {
ShrinkWindow_Letterbox_SetSizeTarget(0);
} else if (sp1E == 0) {
CutsceneManager_StoreCamera(Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId));
}
}
return sp1E;
}
void CutsceneManager_Queue(s16 csId) {
if (csId >= 0) {
sWaitingCutsceneList[csId >> 3] |= 1 << (csId & 7);
}
}
s16 CutsceneManager_IsNext(s16 csId) {
if (csId == CS_ID_GLOBAL_END) {
if (sCutsceneMgr.csId == CS_ID_NONE) {
return 0x7F;
} else {
return 0;
}
}
if (csId <= CS_ID_NONE) {
return -1;
}
return (sNextCutsceneList[csId >> 3] & (1 << (csId & 7))) ? 1 : 0;
}
/**
* Start an actor cutscene, activate Player Cutscene Mode "Wait"
*/
s16 CutsceneManager_StartWithPlayerCs(s16 csId, Actor* actor) {
s16 startCsId = CutsceneManager_Start(csId, actor);
if (startCsId >= 0) {
func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_WAIT);
if (sCutsceneMgr.length == 0) {
CutsceneManager_Stop(sCutsceneMgr.csId);
}
sCutsceneMgr.startMethod = CS_START_1;
}
return startCsId;
}
/**
* Start an actor cutscene, activate Player Cutscene Mode "Wait", turn on ACTOR_FLAG_100000
*/
s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor) {
s16 startCsId = CutsceneManager_Start(csId, actor);
if (startCsId >= 0) {
func_800B7298(sCutsceneMgr.play, 0, PLAYER_CSMODE_WAIT);
if (sCutsceneMgr.length == 0) {
CutsceneManager_Stop(sCutsceneMgr.csId);
}
if (actor != NULL) {
actor->flags |= ACTOR_FLAG_100000;
sCutsceneMgr.startMethod = CS_START_2;
} else {
sCutsceneMgr.startMethod = CS_START_1;
}
}
return startCsId;
}
s16 CutsceneManager_Start(s16 csId, Actor* actor) {
ActorCutscene* csEntry;
Camera* subCam;
Camera* retCam;
s32 csType = 0;
if ((csId < 0) || (sCutsceneMgr.csId != CS_ID_NONE)) {
return csId;
}
sCutsceneMgr.startMethod = CS_START_0;
csEntry = CutsceneManager_GetCutsceneEntryImpl(csId);
ShrinkWindow_Letterbox_SetSizeTarget(csEntry->letterboxSize);
CutsceneManager_SetHudVisibility(csEntry->hudVisibility);
if (csId == CS_ID_GLOBAL_END) {
csType = 1;
} else if (csEntry->scriptIndex != CS_SCRIPT_ID_NONE) {
// scripted cutscene
csType = 1;
} else if ((csId != CS_ID_GLOBAL_DOOR) && (csId != CS_ID_GLOBAL_TALK)) {
csType = 2;
}
if (csType != 0) {
sCutsceneMgr.retCamId = Play_GetActiveCamId(sCutsceneMgr.play);
sCutsceneMgr.subCamId = Play_CreateSubCamera(sCutsceneMgr.play);
subCam = Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId);
retCam = Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.retCamId);
if ((retCam->setting == CAM_SET_START0) || (retCam->setting == CAM_SET_START2) ||
(retCam->setting == CAM_SET_START1)) {
if (CutsceneManager_FindEntranceCsId() != csId) {
func_800E0348(retCam);
} else {
Camera_ClearFlags(retCam, CAM_STATE_2);
}
}
memcpy(subCam, retCam, sizeof(Camera));
subCam->camId = sCutsceneMgr.subCamId;
Camera_ClearFlags(subCam, CAM_STATE_6 | CAM_STATE_0);
Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.retCamId, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(sCutsceneMgr.play, sCutsceneMgr.subCamId, CAM_STATUS_ACTIVE);
subCam->target = sCutsceneMgr.targetActor = actor;
subCam->behaviorFlags = 0;
if (csType == 1) {
Camera_ChangeSetting(subCam, CAM_SET_FREE0);
Cutscene_StartScripted(sCutsceneMgr.play, csEntry->scriptIndex);
sCutsceneMgr.length = csEntry->length;
} else {
if (csEntry->csCamId != CS_CAM_ID_NONE) {
Camera_ChangeDataIdx(subCam, csEntry->csCamId);
} else {
Camera_ChangeSetting(subCam, CAM_SET_FREE0);
}
sCutsceneMgr.length = csEntry->length;
}
}
sCutsceneMgr.csId = csId;
return csId;
}
s16 CutsceneManager_Stop(s16 csId) {
ActorCutscene* csEntry;
if (csId < 0) {
return csId;
}
csEntry = CutsceneManager_GetCutsceneEntryImpl(sCutsceneMgr.csId);
if ((sCutsceneMgr.length > 0) && (csEntry->scriptIndex == CS_SCRIPT_ID_NONE)) {
return -2;
}
if ((csId != CS_ID_GLOBAL_END) && (csEntry->scriptIndex != CS_SCRIPT_ID_NONE)) {
return -3;
}
if (csId == CS_ID_GLOBAL_END) {
csId = sCutsceneMgr.csId;
}
if (csId == sCutsceneMgr.csId) {
sCutsceneMgr.endCsId = sCutsceneMgr.csId;
return sCutsceneMgr.endCsId;
}
return -1;
}
s16 CutsceneManager_GetCurrentCsId(void) {
return sCutsceneMgr.csId;
}
ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) {
return CutsceneManager_GetCutsceneEntryImpl(csId);
}
s16 CutsceneManager_GetAdditionalCsId(s16 csId) {
if (csId < 0) {
return CS_ID_NONE;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->additionalCsId;
}
s16 CutsceneManager_GetLength(s16 csId) {
if (csId < 0) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->length;
}
s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId) {
if (csId < 0) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->scriptIndex;
}
s16 CutsceneManager_GetCutsceneCustomValue(s16 csId) {
if (csId < 0) {
return -1;
}
return CutsceneManager_GetCutsceneEntryImpl(csId)->customValue;
}
s16 CutsceneManager_GetCurrentSubCamId(s16 csId) {
return sCutsceneMgr.subCamId;
}
s16 CutsceneManager_FindEntranceCsId(void) {
PlayState* play;
s32 csId;
for (csId = 0; csId < sSceneCutsceneCount; csId++) {
//! FAKE:
if ((sSceneCutsceneList[csId].scriptIndex != CS_SCRIPT_ID_NONE) &&
(sSceneCutsceneList[csId].scriptIndex < (play = sCutsceneMgr.play)->csCtx.scriptListCount) &&
(sCutsceneMgr.play->curSpawn ==
sCutsceneMgr.play->csCtx.scriptList[sSceneCutsceneList[csId].scriptIndex].spawn)) {
return csId;
}
}
for (csId = 0; csId < sSceneCutsceneCount; csId++) {
if ((sSceneCutsceneList[csId].customValue >= 100) &&
(sSceneCutsceneList[csId].customValue == (sCutsceneMgr.play->curSpawn + 100))) {
return csId;
}
}
return -1;
}
s32 func_800F22C4(s16 csId, Actor* actor) {
f32 dist;
s16 screenPosX;
s16 screenPosY;
if ((sCutsceneMgr.csId == CS_ID_NONE) || (csId == CS_ID_NONE)) {
return 4;
}
Actor_GetScreenPos(sCutsceneMgr.play, actor, &screenPosX, &screenPosY);
dist = OLib_Vec3fDist(&actor->focus.pos, &Play_GetCamera(sCutsceneMgr.play, sCutsceneMgr.subCamId)->eye);
if ((screenPosX > 40) && (screenPosX < SCREEN_WIDTH - 40) && (screenPosY > 40) &&
(screenPosY < SCREEN_HEIGHT - 40) && (dist < 700.0f)) {
return 1;
}
if (sCutsceneMgr.length < 6) {
return 2;
}
if (csId == sCutsceneMgr.csId) {
return 0;
}
return 3;
}
void CutsceneManager_SetReturnCamera(s16 camId) {
sCutsceneMgr.retCamId = camId;
}

View File

@ -92,7 +92,7 @@ void KaleidoSetup_Update(PlayState* play) {
if ((pauseCtx->state == PAUSE_STATE_OFF) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if ((gSaveContext.save.cutscene < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
(gSaveContext.magicState != MAGIC_STATE_FILL)) {

View File

@ -1990,7 +1990,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) {
}
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if (ActorCutscene_GetCurrentIndex() == -1) {
if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) {
Interface_SetHudVisibility(HUD_VISIBILITY_ALL);
}
}
@ -2267,7 +2267,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
s32 pad;
s32 restoreHudVisibility = false;
if (gSaveContext.save.cutscene < 0xFFF0) {
if (gSaveContext.save.cutsceneIndex < 0xFFF0) {
gSaveContext.hudVisibilityForceButtonAlphasByStatus = false;
if ((player->stateFlags1 & PLAYER_STATE1_800000) || CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01) ||
(!(CHECK_EVENTINF(EVENTINF_41)) && (play->unk_1887C >= 2))) {
@ -2434,7 +2434,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
sPictoState = PICTO_BOX_STATE_OFF;
} else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) || (func_801A5100() == 1)) {
if (!(CHECK_EVENTINF(EVENTINF_41)) ||
((CHECK_EVENTINF(EVENTINF_41)) && (ActorCutscene_GetCurrentIndex() == -1))) {
((CHECK_EVENTINF(EVENTINF_41)) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE))) {
play_sound(NA_SE_SY_CAMERA_SHUTTER);
SREG(89) = 1;
play->haltAllActors = true;

View File

@ -567,11 +567,13 @@ void Play_UpdateTransition(PlayState* this) {
if ((!(Entrance_GetTransitionFlags(this->nextEntrance + sceneLayer) & 0x8000) ||
((this->nextEntrance == ENTRANCE(PATH_TO_MOUNTAIN_VILLAGE, 1)) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) ||
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) ||
((this->nextEntrance == ENTRANCE(ROAD_TO_SOUTHERN_SWAMP, 1)) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) ||
((this->nextEntrance == ENTRANCE(TERMINA_FIELD, 2)) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) ||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20))) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) ||
((this->nextEntrance == ENTRANCE(TERMINA_FIELD, 2)) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) ||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) &&
!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE))) &&
(!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS))) {
func_801A4058(20);
@ -983,8 +985,8 @@ void Play_UpdateMain(PlayState* this) {
if (!this->haltAllActors) {
Actor_UpdateAll(this, &this->actorCtx);
}
Cutscene_Update1(this, &this->csCtx);
Cutscene_Update2(this, &this->csCtx);
Cutscene_UpdateManual(this, &this->csCtx);
Cutscene_UpdateScripted(this, &this->csCtx);
Effect_UpdateAll(this);
EffectSS_UpdateAllParticles(this);
EffFootmark_Update(this);
@ -1502,8 +1504,8 @@ void Play_Main(GameState* thisx) {
*CONTROLLER1(&this->state) = input;
}
ActorCutscene_Update();
ActorCutscene_ClearWaiting();
CutsceneManager_Update();
CutsceneManager_ClearWaiting();
}
s32 Play_InCsMode(PlayState* this) {
@ -2016,37 +2018,47 @@ s32 Play_IsDebugCamEnabled(void) {
return gDbgCamEnabled;
}
// A mapping from playerActorCsIds to sGlobalCamDataSettings indices.
s16 D_801D0D64[] = { -3, -2, -4, -5, -7, -11, -8, -9, -6, -16 };
// A mapping from playerCsIds to sGlobalCamDataSettings indices.
s16 sPlayerCsIdToCsCamId[] = {
CS_CAM_ID_GLOBAL_ITEM_OCARINA, // PLAYER_CS_ID_ITEM_OCARINA
CS_CAM_ID_GLOBAL_ITEM_GET, // PLAYER_CS_ID_ITEM_GET
CS_CAM_ID_GLOBAL_ITEM_BOTTLE, // PLAYER_CS_ID_ITEM_BOTTLE
CS_CAM_ID_GLOBAL_ITEM_SHOW, // PLAYER_CS_ID_ITEM_SHOW
CS_CAM_ID_GLOBAL_WARP_PAD_MOON, // PLAYER_CS_ID_WARP_PAD_MOON
CS_CAM_ID_GLOBAL_MASK_TRANSFORMATION, // PLAYER_CS_ID_MASK_TRANSFORMATION
CS_CAM_ID_GLOBAL_DEATH, // PLAYER_CS_ID_DEATH
CS_CAM_ID_GLOBAL_REVIVE, // PLAYER_CS_ID_REVIVE
CS_CAM_ID_GLOBAL_SONG_WARP, // PLAYER_CS_ID_SONG_WARP
CS_CAM_ID_GLOBAL_WARP_PAD_ENTRANCE, // PLAYER_CS_ID_WARP_PAD_ENTRANCE
};
// Used by Player
/**
* Extract the common actor cutscene ids used by Player from the scene and set the actor cutscene ids in
* this->playerActorCsIds. If a playerActorCsId is not present in the scene, then that particular id is set
* to -1. Otherwise, if there is an ActorCutscene where csCamSceneDataId matches the appropriate element of D_801D0D64,
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one)
* Extract the common cutscene ids used by Player from the scene and set the cutscene ids in this->playerCsIds.
* If a playerCsId is not present in the scene, then that particular id is set to CS_ID_NONE.
* Otherwise, if there is an ActorCutscene where csCamId matches the appropriate element of sPlayerCsIdToCsCamId,
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one).
*/
void Play_AssignPlayerActorCsIdsFromScene(GameState* thisx, s32 startActorCsId) {
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
PlayState* this = (PlayState*)thisx;
s32 i;
s16* curPlayerActorCsId = this->playerActorCsIds;
s16* phi_s1 = D_801D0D64;
s16* curPlayerCsId = this->playerCsIds;
s16* csCamId = sPlayerCsIdToCsCamId;
for (i = 0; i < ARRAY_COUNT(this->playerActorCsIds); i++, curPlayerActorCsId++, phi_s1++) {
ActorCutscene* actorCutscene;
s32 curActorCsId;
for (i = 0; i < ARRAY_COUNT(this->playerCsIds); i++, curPlayerCsId++, csCamId++) {
ActorCutscene* csEntry;
s32 curCsId;
*curPlayerActorCsId = -1;
*curPlayerCsId = CS_ID_NONE;
for (curActorCsId = startActorCsId; curActorCsId != -1; curActorCsId = actorCutscene->additionalCutscene) {
actorCutscene = ActorCutscene_GetCutscene(curActorCsId);
for (curCsId = spawnCsId; curCsId != CS_ID_NONE; curCsId = csEntry->additionalCsId) {
csEntry = CutsceneManager_GetCutsceneEntry(curCsId);
if (actorCutscene->csCamSceneDataId == *phi_s1) {
if ((actorCutscene->csCamSceneDataId == -3) &&
(actorCutscene->priority == 700)) { // override ocarina cs priority
actorCutscene->priority = 550;
if (csEntry->csCamId == *csCamId) {
if ((csEntry->csCamId == CS_CAM_ID_GLOBAL_ITEM_OCARINA) && (csEntry->priority == 700)) {
csEntry->priority = 550;
}
*curPlayerActorCsId = curActorCsId;
*curPlayerCsId = curCsId;
break;
}
}
@ -2101,7 +2113,7 @@ void Play_Init(GameState* thisx) {
scene = ((void)0, gSaveContext.save.entrance) >> 9;
spawn = (((void)0, gSaveContext.save.entrance) >> 4) & 0x1F;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) {
if (scene == ENTR_SCENE_MOUNTAIN_VILLAGE_WINTER) {
scene = ENTR_SCENE_MOUNTAIN_VILLAGE_SPRING;
} else if (scene == ENTR_SCENE_GORON_VILLAGE_WINTER) {
@ -2115,7 +2127,7 @@ void Play_Init(GameState* thisx) {
}
}
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
if (scene == ENTR_SCENE_SOUTHERN_SWAMP_POISONED) {
scene = ENTR_SCENE_SOUTHERN_SWAMP_CLEARED;
} else if (scene == ENTR_SCENE_WOODFALL) {
@ -2123,11 +2135,11 @@ void Play_Init(GameState* thisx) {
}
}
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && (scene == ENTR_SCENE_IKANA_CANYON)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && (scene == ENTR_SCENE_IKANA_CANYON)) {
gSaveContext.nextCutsceneIndex = 0xFFF2;
}
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80) &&
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE) &&
((scene == ENTR_SCENE_GREAT_BAY_COAST) || (scene == ENTR_SCENE_ZORA_CAPE))) {
gSaveContext.nextCutsceneIndex = 0xFFF0;
}
@ -2179,15 +2191,15 @@ void Play_Init(GameState* thisx) {
EffectSS_Init(this, 100);
CollisionCheck_InitContext(this, &this->colChkCtx);
AnimationContext_Reset(&this->animationCtx);
Cutscene_Init(this, &this->csCtx);
Cutscene_InitContext(this, &this->csCtx);
if (gSaveContext.nextCutsceneIndex != 0xFFEF) {
gSaveContext.save.cutscene = gSaveContext.nextCutsceneIndex;
gSaveContext.save.cutsceneIndex = gSaveContext.nextCutsceneIndex;
gSaveContext.nextCutsceneIndex = 0xFFEF;
}
if (gSaveContext.save.cutscene == 0xFFFD) {
gSaveContext.save.cutscene = 0;
if (gSaveContext.save.cutsceneIndex == 0xFFFD) {
gSaveContext.save.cutsceneIndex = 0;
}
if (gSaveContext.nextDayTime != 0xFFFF) {
@ -2204,13 +2216,13 @@ void Play_Init(GameState* thisx) {
func_800EDDB0(this);
if (((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_TITLE_SCREEN)) ||
(gSaveContext.save.cutscene >= 0xFFF0)) {
(gSaveContext.save.cutsceneIndex >= 0xFFF0)) {
gSaveContext.unk_3DC0 = 0;
Magic_Reset(this);
gSaveContext.sceneLayer = (gSaveContext.save.cutscene & 0xF) + 1;
gSaveContext.sceneLayer = (gSaveContext.save.cutsceneIndex & 0xF) + 1;
// Set saved cutscene to 0 so it doesn't immediately play, but instead let the `CutsceneManager` handle it.
gSaveContext.save.cutscene = 0;
gSaveContext.save.cutsceneIndex = 0;
} else {
gSaveContext.sceneLayer = 0;
}
@ -2296,7 +2308,7 @@ void Play_Init(GameState* thisx) {
D_801F6D4C->envColor.g = 0;
D_801F6D4C->envColor.b = 0;
D_801F6D4C->envColor.a = 0;
EnvFlags_UnsetAll(this);
CutsceneFlags_UnsetAll(this);
THA_GetRemaining(&this->state.heap);
zAllocSize = THA_GetRemaining(&this->state.heap);
zAlloc = (uintptr_t)THA_AllocTailAlign16(&this->state.heap, zAllocSize);
@ -2319,13 +2331,13 @@ void Play_Init(GameState* thisx) {
Camera_ChangeDataIdx(&this->mainCamera, player->actor.params & 0xFF);
}
func_800F15D8(&this->mainCamera);
CutsceneManager_StoreCamera(&this->mainCamera);
Interface_SetSceneRestrictions(this);
func_800FB758(this);
gSaveContext.seqId = this->sequenceCtx.seqId;
gSaveContext.ambienceId = this->sequenceCtx.ambienceId;
AnimationContext_Update(this, &this->animationCtx);
func_800EDBE0(this);
Cutscene_HandleEntranceTriggers(this);
gSaveContext.respawnFlag = 0;
sBombersNotebookOpen = false;
BombersNotebook_Init(&sBombersNotebook);

View File

@ -359,9 +359,9 @@ void func_80122F28(Player* player) {
PLAYER_STATE1_20000000))) &&
(!(player->stateFlags2 & PLAYER_STATE2_1))) {
if (player->doorType <= PLAYER_DOORTYPE_TALKING) {
ActorCutscene_SetIntentToPlay(0x7C);
CutsceneManager_Queue(CS_ID_GLOBAL_TALK);
} else {
ActorCutscene_SetIntentToPlay(0x7D);
CutsceneManager_Queue(CS_ID_GLOBAL_DOOR);
}
}
}

View File

@ -402,7 +402,7 @@ void Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd) {
play->envCtx.sunPos.y = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 120.0f) * 25.0f;
play->envCtx.sunPos.z = (Math_CosS(((void)0, gSaveContext.save.time) - CLOCK_TIME(12, 0)) * 20.0f) * 25.0f;
if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutscene < 0xFFF0)) {
if ((play->envCtx.sceneTimeSpeed == 0) && (gSaveContext.save.cutsceneIndex < 0xFFF0)) {
gSaveContext.skyboxTime = gSaveContext.save.time;
if ((gSaveContext.skyboxTime >= CLOCK_TIME(4, 0)) && (gSaveContext.skyboxTime < CLOCK_TIME(6, 30))) {
@ -470,15 +470,15 @@ void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd) {
}
}
// SceneTableEntry Header Command 0x17: Cutscene List
void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) {
play->csCtx.sceneCsCount = cmd->cutsceneList.sceneCsCount;
play->csCtx.sceneCsList = Lib_SegmentedToVirtual(cmd->cutsceneList.segment);
// SceneTableEntry Header Command 0x17: Cutscene Script List
void Scene_CommandCutsceneScriptList(PlayState* play, SceneCmd* cmd) {
play->csCtx.scriptListCount = cmd->scriptList.scriptListCount;
play->csCtx.scriptList = Lib_SegmentedToVirtual(cmd->scriptList.segment);
}
// SceneTableEntry Header Command 0x1B: Actor Cutscene List
void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd) {
ActorCutscene_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment), cmd->cutsceneActorList.num);
// SceneTableEntry Header Command 0x1B: Cutscene List
void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) {
CutsceneManager_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneList.segment), cmd->cutsceneList.num);
}
// SceneTableEntry Header Command 0x1C: Mini Maps
@ -560,11 +560,11 @@ void (*sSceneCmdHandlers[])(PlayState*, SceneCmd*) = {
NULL,
Scene_CommandSoundSettings,
Scene_CommandEchoSetting,
Scene_CommandCutsceneList,
Scene_CommandCutsceneScriptList,
Scene_CommandAltHeaderList,
Scene_CommandSetRegionVisitedFlag,
Scene_CommandAnimatedMaterials,
Scene_CommandActorCutsceneList,
Scene_CommandCutsceneList,
Scene_CommandMiniMap,
Scene_Command1D,
Scene_CommandMiniMapCompassInfo,
@ -601,7 +601,7 @@ u16 Entrance_Create(s32 scene, s32 spawn, s32 layer) {
}
/**
* Creates an layer 0 entranace from the current entrance and the given spawn.
* Creates an layer 0 entrance from the current entrance and the given spawn.
*/
u16 Entrance_CreateFromSpawn(s32 spawn) {
return Entrance_Create((u32)gSaveContext.save.entrance >> 9, spawn, 0);

View File

@ -939,10 +939,9 @@ void Sram_InitDebugSave(void) {
Sram_GenerateRandomSaveFields();
}
// Unused
void func_80144A94(SramContext* sramCtx) {
void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
s32 i;
s32 cutscene = gSaveContext.save.cutscene;
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
@ -957,7 +956,7 @@ void func_80144A94(SramContext* sramCtx) {
D_801C67F0[gSaveContext.fileNum * 2 + 1]);
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
}
gSaveContext.save.cutscene = cutscene;
gSaveContext.save.cutsceneIndex = cutsceneIndex;
for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) {
gSaveContext.eventInf[i] = 0;
@ -1067,10 +1066,10 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
} else {
gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlSaveLocation];
if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) {
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
} else if ((gSaveContext.save.entrance == ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8)) &&
CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80)) {
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) {
gSaveContext.save.entrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 8);
}
@ -1532,7 +1531,7 @@ void Sram_InitSave(FileSelectState* fileSelect2, SramContext* sramCtx) {
if (gSaveContext.unk_3F3F) {
Sram_InitNewSave();
if (fileSelect->unk_24480 == 0) {
gSaveContext.save.cutscene = 0xFFF0;
gSaveContext.save.cutsceneIndex = 0xFFF0;
}
for (phi_v0 = 0; phi_v0 < ARRAY_COUNT(gSaveContext.save.saveInfo.playerData.playerName); phi_v0++) {
@ -1634,7 +1633,7 @@ void Sram_SaveSpecialEnterClockTown(PlayState* play) {
* Saves when beating the game, after showing the "Dawn of the New Day" message
*/
void Sram_SaveSpecialNewDay(PlayState* play) {
s32 cutscene = gSaveContext.save.cutscene;
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;
s32 day;
u16 time = gSaveContext.save.time;
@ -1647,7 +1646,7 @@ void Sram_SaveSpecialNewDay(PlayState* play) {
gSaveContext.save.day = day;
gSaveContext.save.time = time;
gSaveContext.save.cutscene = cutscene;
gSaveContext.save.cutsceneIndex = cutsceneIndex;
func_80185F64(play->sramCtx.saveBuf, D_801C67C8[gSaveContext.fileNum * 2], D_801C67F0[gSaveContext.fileNum * 2]);
}

View File

@ -1386,48 +1386,53 @@ void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* a
*curAnimIndex = nextAnimIndex;
}
s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) {
s32 SubS_StartCutscene(Actor* actor, s16 nextCsId, s16 curCsId, s32 type) {
s32 isStarted = false;
if ((curCutscene != -1) && (ActorCutscene_GetCurrentIndex() == curCutscene)) {
ActorCutscene_Stop(curCutscene);
ActorCutscene_SetIntentToPlay(nextCutscene);
} else if (ActorCutscene_GetCanPlayNext(nextCutscene)) {
if ((curCsId != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == curCsId)) {
CutsceneManager_Stop(curCsId);
CutsceneManager_Queue(nextCsId);
} else if (CutsceneManager_IsNext(nextCsId)) {
switch (type) {
case SUBS_CUTSCENE_SET_UNK_LINK_FIELDS:
ActorCutscene_StartAndSetUnkLinkFields(nextCutscene, actor);
case SUBS_CUTSCENE_WITH_PLAYER:
CutsceneManager_StartWithPlayerCs(nextCsId, actor);
break;
case SUBS_CUTSCENE_NORMAL:
ActorCutscene_Start(nextCutscene, actor);
CutsceneManager_Start(nextCsId, actor);
break;
case SUBS_CUTSCENE_SET_FLAG:
ActorCutscene_StartAndSetFlag(nextCutscene, actor);
case SUBS_CUTSCENE_WITH_PLAYER_SET_FLAG:
CutsceneManager_StartWithPlayerCsAndSetFlag(nextCsId, actor);
break;
default:
break;
}
isStarted = true;
} else {
ActorCutscene_SetIntentToPlay(nextCutscene);
CutsceneManager_Queue(nextCsId);
}
return isStarted;
}
s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes) {
s16 cs;
s32 SubS_FillCutscenesList(Actor* actor, s16 csIdList[], s16 numCutscenes) {
s16 csId;
s32 i;
for (i = 0; i < numCutscenes; i++) {
cutscenes[i] = -1;
csIdList[i] = CS_ID_NONE;
}
cs = actor->cutscene;
csId = actor->csId;
i = 0;
while (cs != -1) {
// Note: Infinite loop if numCutscenes is less than possible additional cutscenes
while (csId != CS_ID_NONE) {
// Note: Infinite loop if numCutscenes is less than possible additional csIdList
if (i < numCutscenes) {
cutscenes[i] = cs;
cs = ActorCutscene_GetAdditionalCutscene(cs);
csIdList[i] = csId;
csId = CutsceneManager_GetAdditionalCsId(csId);
i++;
}
}

View File

@ -113,7 +113,7 @@ void BgAstrBombwall_Init(Actor* thisx, PlayState* play) {
return;
}
BgAstrBombwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->collider);
SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList));
func_80C0A378(this);
}
@ -175,7 +175,7 @@ void func_80C0A400(BgAstrBombwall* this, PlayState* play) {
}
void func_80C0A418(BgAstrBombwall* this, PlayState* play) {
if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) {
func_80C0A458(this, play);
}
}

View File

@ -13,6 +13,6 @@ typedef struct BgAstrBombwall {
/* 0x15C */ BgAstrBombwallActionFunc actionFunc;
/* 0x160 */ ColliderTris collider;
/* 0x180 */ ColliderTrisElement colliderElements[2];
/* 0x238 */ s16 cutscenes[1];
/* 0x238 */ s16 csIdList[1];
} BgAstrBombwall;
#endif // Z_BG_ASTR_BOMBWALL_H

View File

@ -153,7 +153,7 @@ s32 func_808B7380(BgBreakwall* this, PlayState* play) {
}
s32 func_808B73C4(BgBreakwall* this, PlayState* play) {
return CHECK_WEEKEVENTREG(WEEKEVENTREG_33_80) || CHECK_WEEKEVENTREG(WEEKEVENTREG_21_01);
return CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE) || CHECK_WEEKEVENTREG(WEEKEVENTREG_21_01);
}
s32 func_808B73FC(BgBreakwall* this, PlayState* play) {
@ -176,7 +176,7 @@ s32 func_808B7460(BgBreakwall* this, PlayState* play) {
}
s32 func_808B74A8(BgBreakwall* this, PlayState* play) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) {
return false;
}
return true;
@ -285,7 +285,7 @@ void func_808B782C(BgBreakwall* this, PlayState* play) {
}
void func_808B78A4(BgBreakwall* this, PlayState* play) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) {
Actor_Kill(&this->dyna.actor);
}
}

View File

@ -163,8 +163,8 @@ void BgCtowerGear_Update(Actor* thisx, PlayState* play) {
void BgCtowerGear_UpdateOrgan(Actor* thisx, PlayState* play) {
BgCtowerGear* this = THIS;
if (Cutscene_CheckActorAction(play, 104)) {
switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 104)]->action) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_104)) {
switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_104)]->id) {
case 1:
this->dyna.actor.draw = NULL;
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);

View File

@ -88,7 +88,7 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, PlayState* play) {
Camera_ChangeSetting(play->cameraPtrs[CAM_ID_MAIN], CAM_SET_DUNGEON0);
this->dyna.actor.shape.rot.z = rotZ * 16.384f;
if (play->csCtx.frames == 132) {
if (play->csCtx.curFrame == 132) {
play_sound(NA_SE_SY_SPIRAL_DASH);
}
}
@ -100,7 +100,7 @@ void BgCtowerRot_DoorClose(BgCtowerRot* this, PlayState* play) {
if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) {
if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
}
this->actionFunc = BgCtowerRot_DoorDoNothing;
} else if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
@ -119,19 +119,19 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, PlayState* play) {
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
if (offset.z > 30.0f) {
this->unk160 = 0.0f;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = BgCtowerRot_SetupDoorClose;
}
}
void BgCtowerRot_SetupDoorClose(BgCtowerRot* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
}
this->actionFunc = BgCtowerRot_DoorClose;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -627,16 +627,16 @@ void func_80B83518(Actor* thisx, PlayState* play) {
if (this->unk_17F == 2) {
this->unk_17E--;
if (this->unk_17E <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->unk_17F = 0;
}
} else if ((this->unk_17F != 0) && (this->unk_17F == 1)) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->unk_17F = 2;
this->unk_17E = 0x50;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
this->unk_16C = this->unk_170;

View File

@ -97,7 +97,7 @@ static AnimatedMaterial* sTexAnims[] = {
s16 D_80A2B96C[] = { 0, 0x16C, -0x16C, 0 };
s16 D_80A2B974[] = { -1, -1 };
static s16 sCsIdList[] = { CS_ID_NONE, CS_ID_NONE };
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE),
@ -197,7 +197,7 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) {
this->xluDList = sXluDLists[this->unk_160];
this->texAnim = sTexAnims[this->unk_160];
SubS_FillCutscenesList(&this->dyna.actor, this->unk_1B6, ARRAY_COUNT(this->unk_1B6));
SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList));
switch (this->unk_160) {
case 1:
@ -254,8 +254,8 @@ void BgDblueMovebg_Init(Actor* thisx, PlayState* play) {
this->unk_2F8[1] = NULL;
this->unk_2F8[0] = NULL;
label:
for (i = 0; i < ARRAY_COUNT(D_80A2B974); i++) {
D_80A2B974[i] = this->unk_1B6[i];
for (i = 0; i < ARRAY_COUNT(sCsIdList); i++) {
sCsIdList[i] = this->csIdList[i];
}
this->unk_178 = func_80A29A80(play, this->unk_1C0, this->unk_1BC);
this->unk_1CC = D_80A2B96C[this->unk_178];
@ -385,8 +385,8 @@ void func_80A2A32C(BgDblueMovebg* this, PlayState* play) {
}
if (phi_v1) {
this->unk_180 = func_800F2178(this->unk_1B6[0]);
this->unk_1D2 = this->unk_1B6[0];
this->unk_180 = CutsceneManager_GetCutsceneCustomValue(this->csIdList[0]);
this->csId = this->csIdList[0];
this->unk_172 |= 8;
this->actionFunc = func_80A2A444;
} else {
@ -447,7 +447,7 @@ void func_80A2A670(BgDblueMovebg* this, PlayState* play) {
void func_80A2A688(BgDblueMovebg* this, PlayState* play) {
this->unk_180--;
if (this->unk_180 <= 0) {
ActorCutscene_Stop(this->unk_1B6[0]);
CutsceneManager_Stop(this->csIdList[0]);
}
if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 60.0f, 2.0f) &&
@ -477,8 +477,8 @@ void func_80A2A714(BgDblueMovebg* this, PlayState* play) {
}
this->unk_17E = phi_v0 * phi_f0;
this->unk_180 = func_800F2178(this->unk_1B6[0]);
this->unk_1D2 = this->unk_1B6[0];
this->unk_180 = CutsceneManager_GetCutsceneCustomValue(this->csIdList[0]);
this->csId = this->csIdList[0];
this->unk_172 |= 8;
this->actionFunc = func_80A2A7F8;
}
@ -549,12 +549,12 @@ void func_80A2AAB8(BgDblueMovebg* this, PlayState* play) {
s32 sp18;
if (this->unk_180-- <= 0) {
ActorCutscene_Stop(this->unk_1B6[0]);
CutsceneManager_Stop(this->csIdList[0]);
}
sp18 = false;
if ((this->unk_1D0 > 0) && ((D_80A2B974[0] >= 0) || (D_80A2B974[1] >= 0))) {
if (ActorCutscene_GetCurrentIndex() != -1) {
if ((this->unk_1D0 > 0) && ((sCsIdList[0] >= 0) || (sCsIdList[1] >= 0))) {
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
sp18 = true;
}
}
@ -642,13 +642,13 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) {
switch (temp_v0_3) {
case 1:
case 2:
this->unk_1D2 = this->unk_1B6[0];
this->csId = this->csIdList[0];
this->unk_17E = 40;
break;
case 0:
case 3:
this->unk_1D2 = this->unk_1B6[1];
this->csId = this->csIdList[1];
this->unk_17E = 15;
break;
}
@ -721,7 +721,7 @@ void BgDblueMovebg_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->unk_172 & 8) {
if (SubS_StartActorCutscene(&this->dyna.actor, this->unk_1D2, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
if (SubS_StartCutscene(&this->dyna.actor, this->csId, CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) {
this->unk_172 &= ~8;
}
}

View File

@ -37,7 +37,7 @@ typedef struct BgDblueMovebg {
/* 0x19C */ Vec3f unk_19C;
/* 0x1A8 */ Vec3f unk_1A8;
/* 0x1B4 */ UNK_TYPE1 unk1B4[2];
/* 0x1B6 */ s16 unk_1B6[2];
/* 0x1B6 */ s16 csIdList[2];
/* 0x1BC */ s32 unk_1BC;
/* 0x1C0 */ s32 unk_1C0;
/* 0x1C4 */ s32 unk_1C4;
@ -45,7 +45,7 @@ typedef struct BgDblueMovebg {
/* 0x1CC */ s16 unk_1CC;
/* 0x1CE */ s16 unk_1CE;
/* 0x1D0 */ s16 unk_1D0;
/* 0x1D2 */ s16 unk_1D2;
/* 0x1D2 */ s16 csId;
/* 0x1D4 */ f32 unk_1D4;
/* 0x1D8 */ s16 unk_1D8[2][8];
/* 0x1F8 */ f32 unk_1F8[2][8];

View File

@ -423,13 +423,13 @@ void func_80B84928(BgDblueWaterfall* this, PlayState* play) {
if (sp30 != 0) {
func_80B83EA4(this, play);
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x800) {
this->unk_1A4 = this->actor.cutscene;
this->csId = this->actor.csId;
func_80B84AD4(this, play);
}
} else {
func_80B841A0(this, play);
if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x1000) {
this->unk_1A4 = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
this->csId = CutsceneManager_GetAdditionalCsId(this->actor.csId);
func_80B84AD4(this, play);
}
}
@ -448,9 +448,9 @@ void func_80B84AEC(BgDblueWaterfall* this, PlayState* play) {
s32 pad;
s32 sp20;
if (ActorCutscene_GetCanPlayNext(this->unk_1A4)) {
if (CutsceneManager_IsNext(this->csId)) {
sp20 = func_80B83D04(this, play);
ActorCutscene_StartAndSetUnkLinkFields(this->unk_1A4, &this->actor);
CutsceneManager_StartWithPlayerCs(this->csId, &this->actor);
this->unk_1A3 = true;
if (sp20) {
func_80B83D94(this, play);
@ -460,7 +460,7 @@ void func_80B84AEC(BgDblueWaterfall* this, PlayState* play) {
func_80B84B9C(this, play);
}
} else {
ActorCutscene_SetIntentToPlay(this->unk_1A4);
CutsceneManager_Queue(this->csId);
}
}
@ -533,7 +533,7 @@ void func_80B84BCC(BgDblueWaterfall* this, PlayState* play) {
func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
} else {
if (this->unk_1A3) {
ActorCutscene_Stop(this->unk_1A4);
CutsceneManager_Stop(this->csId);
}
func_80B8484C(this, play);
}
@ -572,7 +572,7 @@ void func_80B84F20(BgDblueWaterfall* this, PlayState* play) {
func_800B9010(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG);
} else {
if (this->unk_1A3) {
ActorCutscene_Stop(this->unk_1A4);
CutsceneManager_Stop(this->csId);
}
func_80B8484C(this, play);
}

View File

@ -22,7 +22,7 @@ typedef struct BgDblueWaterfall {
/* 0x1A0 */ u8 unk_1A0;
/* 0x1A1 */ UNK_TYPE1 unk1A1[2];
/* 0x1A3 */ s8 unk_1A3;
/* 0x1A4 */ s16 unk_1A4;
/* 0x1A4 */ s16 csId;
/* 0x1A6 */ UNK_TYPE1 unk1A6[1];
/* 0x1A7 */ s8 unk_1A7;
/* 0x1A8 */ f32 unk_1A8;

View File

@ -146,7 +146,7 @@ void BgDkjailIvy_WaitForCut(BgDkjailIvy* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
this->dyna.actor.flags |= ACTOR_FLAG_10;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
BgDkjailIvy_SetupCutscene(this);
} else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
@ -158,8 +158,8 @@ void BgDkjailIvy_SetupCutscene(BgDkjailIvy* this) {
}
void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->fadeOutTimer = 50;
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
Flags_SetSwitch(play, BG_DKJAIL_GET_SWITCH(&this->dyna.actor));
@ -167,7 +167,7 @@ void BgDkjailIvy_BeginCutscene(BgDkjailIvy* this, PlayState* play) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_GRASS_WALL_BROKEN);
BgDkjailIvy_SetupFadeOut(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -157,16 +157,16 @@ s32 func_80BC3B00(BgF40Block* this) {
}
s32 func_80BC3CA4(BgF40Block* this) {
if (this->dyna.actor.cutscene == -1) {
if (this->dyna.actor.csId == CS_ID_NONE) {
return true;
}
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
return true;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
return false;
}
@ -277,13 +277,13 @@ void func_80BC4228(BgF40Block* this, PlayState* play) {
this->unk_164 = this->unk_160 + 1;
} else {
this->actionFunc = func_80BC4530;
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
}
}
if (func_80BC3D08(this, play, 0)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->actionFunc = func_80BC41AC;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
return;
@ -337,13 +337,13 @@ void func_80BC4448(BgF40Block* this, PlayState* play) {
this->unk_164 = this->unk_160 - 1;
} else {
this->actionFunc = func_80BC4380;
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_C);
}
}
if (func_80BC3D08(this, play, 0)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->actionFunc = func_80BC43CC;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_STOP_F);
}

View File

@ -147,7 +147,7 @@ void BgF40Switch_Press(BgF40Switch* this, PlayState* play) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_IKANA_BLOCK_SWITCH);
Rumble_Request(this->dyna.actor.xyzDistToPlayerSq, 120, 20, 10);
if (this->isInitiator) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->isInitiator = false;
}
this->actionFunc = BgF40Switch_IdlePressed;
@ -157,19 +157,19 @@ void BgF40Switch_Press(BgF40Switch* this, PlayState* play) {
}
void BgF40Switch_WaitToPress(BgF40Switch* this, PlayState* play) {
if (!this->isInitiator || this->dyna.actor.cutscene == -1) {
if (!this->isInitiator || (this->dyna.actor.csId == CS_ID_NONE)) {
this->actionFunc = BgF40Switch_Press;
if (this->isInitiator) {
Flags_SetSwitch(play, BGF40SWITCH_GET_SWITCHFLAG(&this->dyna.actor));
}
} else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
} else if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->actionFunc = BgF40Switch_Press;
if (this->isInitiator) {
Flags_SetSwitch(play, BGF40SWITCH_GET_SWITCHFLAG(&this->dyna.actor));
}
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -42,7 +42,7 @@ void func_80B40080(BgGoronOyu* this) {
void func_80B4009C(BgGoronOyu* this) {
this->unk_17E = 0;
this->initialActorCutscene = this->dyna.actor.cutscene;
this->initCsId = this->dyna.actor.csId;
this->actionFunc = func_80B40100;
this->unk_164 = 20.0f;
}
@ -53,11 +53,11 @@ void func_80B400C8(BgGoronOyu* this, PlayState* play) {
}
void func_80B40100(BgGoronOyu* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->initialActorCutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->initialActorCutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->initCsId)) {
CutsceneManager_StartWithPlayerCs(this->initCsId, &this->dyna.actor);
this->actionFunc = func_80B40160;
} else {
ActorCutscene_SetIntentToPlay(this->initialActorCutscene);
CutsceneManager_Queue(this->initCsId);
}
}
@ -69,7 +69,7 @@ void func_80B40160(BgGoronOyu* this, PlayState* play) {
BgGoronOyu_UpdateWaterBoxInfo(this, play);
if (this->unk_164 <= 0.0f) {
ActorCutscene_Stop(this->initialActorCutscene);
CutsceneManager_Stop(this->initCsId);
this->unk_164 = 0.0f;
func_80B40080(this);
}

View File

@ -15,7 +15,7 @@ typedef struct BgGoronOyu {
/* 0x168 */ Vec3f waterBoxPos;
/* 0x174 */ f32 waterBoxXLength;
/* 0x178 */ f32 waterBoxZLength;
/* 0x17C */ s16 initialActorCutscene;
/* 0x17C */ s16 initCsId;
/* 0x17E */ u16 unk_17E;
} BgGoronOyu; // size = 0x180

View File

@ -191,13 +191,13 @@ void func_80BD6274(BgHakaBombwall* this, PlayState* play) {
void BgHakaBombwall_SetupPlayCutscene(BgHakaBombwall* this) {
this->dyna.actor.flags |= ACTOR_FLAG_10;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = BgHakaBombwall_PlayCutscene;
}
void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
func_80BD5E6C(this, play);
this->dyna.actor.draw = NULL;
Flags_SetSwitch(play, BGHAKABOMBWALL_GET_7F(&this->dyna.actor));
@ -205,7 +205,7 @@ void BgHakaBombwall_PlayCutscene(BgHakaBombwall* this, PlayState* play) {
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
BgHakaBombwall_SetupEndCutscene(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -217,7 +217,7 @@ void BgHakaBombwall_SetupEndCutscene(BgHakaBombwall* this) {
void BgHakaBombwall_EndCutscene(BgHakaBombwall* this, PlayState* play) {
this->csTimer--;
if (this->csTimer <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_Kill(&this->dyna.actor);
}
}

View File

@ -79,12 +79,12 @@ void func_80B6DCEC(BgHakaCurtain* this) {
}
void func_80B6DD00(BgHakaCurtain* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
func_80B6DD5C(this);
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
void func_80B6DD5C(BgHakaCurtain* this) {
@ -123,11 +123,11 @@ void func_80B6DEA8(BgHakaCurtain* this, PlayState* play) {
void BgHakaCurtain_Update(Actor* thisx, PlayState* play) {
BgHakaCurtain* this = THIS;
CsCmdActorAction* actorAction;
CsCmdActorCue* cue;
if (Cutscene_CheckActorAction(play, 469)) {
actorAction = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 469)];
if (actorAction->startFrame == play->csCtx.frames && actorAction->action == 2) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_469)) {
cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_469)];
if ((cue->startFrame == play->csCtx.curFrame) && (cue->id == 2)) {
func_80B6DD80(this);
}
}

View File

@ -47,7 +47,7 @@ void BgHakaTomb_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
DynaPolyActor_LoadMesh(play, &this->dyna, &object_haka_obj_Colheader_000EE8);
SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList));
func_80BD6624(this);
}
@ -61,15 +61,15 @@ void func_80BD6624(BgHakaTomb* this) {
this->actionFunc = func_80BD66AC;
}
s32 func_80BD6638(s16* arg0, s16* arg1, s32 arg2) {
s32 func_80BD6638(s16* csId, s16* csIdList, s32 numCutscenes) {
s32 pad;
s32 retVal = false;
s32 i;
*arg0 = ActorCutscene_GetCurrentIndex();
if (*arg0 >= 0) {
for (i = 0; i < arg2; i++) {
if (*arg0 == arg1[i]) {
*csId = CutsceneManager_GetCurrentCsId();
if (*csId >= 0) {
for (i = 0; i < numCutscenes; i++) {
if (*csId == csIdList[i]) {
retVal = true;
break;
}
@ -80,12 +80,13 @@ s32 func_80BD6638(s16* arg0, s16* arg1, s32 arg2) {
}
void func_80BD66AC(BgHakaTomb* this, PlayState* play) {
s16 temp;
s16 csId;
if (Flags_GetClear(play, this->dyna.actor.room)) {
this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) && Flags_GetClear(play, this->dyna.actor.room)) {
if (!func_80BD6638(&csId, this->csIdList, ARRAY_COUNT(this->csIdList)) && (csId < 0) &&
Flags_GetClear(play, this->dyna.actor.room)) {
this->dyna.actor.flags |= ACTOR_FLAG_1;
if (this->dyna.actor.isTargeted) {
func_80BD6754(this);
@ -100,7 +101,7 @@ void func_80BD6754(BgHakaTomb* this) {
}
void func_80BD6768(BgHakaTomb* this, PlayState* play) {
if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) {
BgHakaTomb_SetupDoNothing(this);
}
}

View File

@ -10,7 +10,7 @@ typedef void (*BgHakaTombActionFunc)(struct BgHakaTomb*, PlayState*);
typedef struct BgHakaTomb {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgHakaTombActionFunc actionFunc;
/* 0x160 */ s16 cutscenes[1];
/* 0x160 */ s16 csIdList[1];
} BgHakaTomb; // size = 0x164
#endif // Z_BG_HAKA_TOMB_H

View File

@ -382,7 +382,7 @@ void func_80ABCCE4(BgHakuginBombwall* this, PlayState* play) {
if (ptr->unk_20(this, play)) {
this->dyna.actor.flags |= ACTOR_FLAG_10;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = func_80ABCD98;
} else {
this->collider.base.acFlags &= ~AC_HIT;
@ -393,10 +393,10 @@ void func_80ABCCE4(BgHakuginBombwall* this, PlayState* play) {
void func_80ABCD98(BgHakuginBombwall* this, PlayState* play) {
s32 pad;
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
BgHakuginBombwallStruct* ptr = &D_80ABCFC0[BGHAKUGIN_BOMBWALL_100(&this->dyna.actor)];
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
ptr->unk_24(this, play);
this->dyna.actor.draw = NULL;
this->unk_1AC = 20;
@ -404,7 +404,7 @@ void func_80ABCD98(BgHakuginBombwall* this, PlayState* play) {
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
this->actionFunc = func_80ABCE60;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -413,7 +413,7 @@ void func_80ABCE60(BgHakuginBombwall* this, PlayState* play) {
this->unk_1AC--;
if (this->unk_1AC <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_Kill(&this->dyna.actor);
} else if (this->unk_1AC == ptr->unk_2C) {
ptr->unk_28(this, play);

View File

@ -104,15 +104,15 @@ void func_80ABD92C(BgHakuginElvpole* this, PlayState* play) {
this->unk_15C = 0;
}
if (this->unk_160) {
if (this->dyna.actor.cutscene == -1) {
if (this->dyna.actor.csId == CS_ID_NONE) {
this->unk_160 = false;
return;
} else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
} else if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->unk_160 = false;
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -28,9 +28,9 @@ void func_80A9CE00(BgHakuginPost* this);
void func_80A9CE1C(BgHakuginPost* this, PlayState* play);
void func_80A9D0A0(BgHakuginPost* this);
void func_80A9D0B4(BgHakuginPost* this, PlayState* play);
void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4);
void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csLength, s16 csId);
void func_80A9D260(BgHakuginPost* this, PlayState* play);
void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4);
void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csId, s16 additionalCsId);
void func_80A9D360(BgHakuginPost* this, PlayState* play);
void func_80A9D3E4(BgHakuginPost* this);
void func_80A9D434(BgHakuginPost* this, PlayState* play);
@ -162,12 +162,12 @@ void func_80A9AFB4(BgHakuginPost* this, PlayState* play, BgHakuginPostUnkStruct*
} else {
unkStruct->unk_0000[i].unk_34 = 1;
}
unkStruct->unk_0000[i].unk_2A = this->dyna.actor.cutscene;
unkStruct->unk_0000[i].unk_2C = ActorCutscene_GetAdditionalCutscene(unkStruct->unk_0000[i].unk_2A);
unkStruct->unk_0000[i].csId = this->dyna.actor.csId;
unkStruct->unk_0000[i].additionalCsId = CutsceneManager_GetAdditionalCsId(unkStruct->unk_0000[i].csId);
} else {
unkStruct->unk_0000[i].unk_34 = 1;
unkStruct->unk_0000[i].unk_2A = -1;
unkStruct->unk_0000[i].unk_2C = -1;
unkStruct->unk_0000[i].csId = CS_ID_NONE;
unkStruct->unk_0000[i].additionalCsId = CS_ID_NONE;
}
unkStruct->unk_0000[i].unk_2F = 1;
@ -783,7 +783,7 @@ void func_80A9CC84(BgHakuginPost* this) {
void func_80A9CCA0(BgHakuginPost* this, PlayState* play) {
if (this->unk_174 != 0) {
func_80A9D1E0(this, func_80A9CD00, (this->unk_164 - this->dyna.actor.home.pos.y) + 100.0f, 60,
this->dyna.actor.cutscene);
this->dyna.actor.csId);
}
}
@ -823,7 +823,7 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) {
if (this->unk_170 != 0) {
func_80A9D1E0(this, func_80A9D0A0, (this->unk_164 - this->dyna.actor.home.pos.y) + 100.0f, 0x3C,
ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene));
CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId));
return;
}
@ -843,8 +843,8 @@ void func_80A9CE1C(BgHakuginPost* this, PlayState* play) {
func_8019F128(NA_SE_EV_SLIDE_DOOR_OPEN);
Flags_SetSwitch(play, D_80A9E028.unk_0000[i].unk_2E);
this->unk_178 = 20;
func_80A9D2C4(this, func_80A9CE00, D_80A9E028.unk_0000[i].unk_14.y + 50.0f,
D_80A9E028.unk_0000[i].unk_2A, D_80A9E028.unk_0000[i].unk_2C);
func_80A9D2C4(this, func_80A9CE00, D_80A9E028.unk_0000[i].unk_14.y + 50.0f, D_80A9E028.unk_0000[i].csId,
D_80A9E028.unk_0000[i].additionalCsId);
break;
}
}
@ -884,12 +884,12 @@ void func_80A9D0B4(BgHakuginPost* this, PlayState* play) {
}
}
void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4) {
void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csLength, s16 csId) {
this->unkFunc = unkFunc;
this->unk_184 = arg4;
this->unk_180 = ActorCutscene_GetLength(arg4);
if (this->unk_180 < 0) {
this->unk_180 = arg3;
this->csId = csId;
this->csLength = CutsceneManager_GetLength(csId);
if (this->csLength < 0) {
this->csLength = csLength;
}
this->dyna.actor.focus.pos.x = this->dyna.actor.home.pos.x;
this->dyna.actor.focus.pos.y = this->unk_16C + arg2;
@ -898,22 +898,22 @@ void func_80A9D1E0(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16
}
void func_80A9D260(BgHakuginPost* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->unk_184)) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_184, &this->dyna.actor);
if (CutsceneManager_IsNext(this->csId)) {
CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor);
this->unkFunc(this);
} else {
ActorCutscene_SetIntentToPlay(this->unk_184);
CutsceneManager_Queue(this->csId);
}
}
void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 arg3, s16 arg4) {
void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16 csId, s16 additionalCsId) {
this->unkFunc = unkFunc;
this->unk_184 = arg3;
this->unk_186 = arg4;
this->unk_180 = -1;
this->unk_180 = ActorCutscene_GetLength(arg3);
if (this->unk_180 < 0) {
this->unk_180 = 15;
this->csId = csId;
this->additionalCsId = additionalCsId;
this->csLength = -1;
this->csLength = CutsceneManager_GetLength(csId);
if (this->csLength < 0) {
this->csLength = 15;
}
this->dyna.actor.focus.pos.x = this->dyna.actor.home.pos.x;
this->dyna.actor.focus.pos.y = this->unk_16C + arg2;
@ -922,32 +922,32 @@ void func_80A9D2C4(BgHakuginPost* this, BgHakuginPostFunc unkFunc, f32 arg2, s16
}
void func_80A9D360(BgHakuginPost* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->unk_184)) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_184, &this->dyna.actor);
if (this->unk_186 >= 0) {
if (CutsceneManager_IsNext(this->csId)) {
CutsceneManager_StartWithPlayerCs(this->csId, &this->dyna.actor);
if (this->additionalCsId >= 0) {
func_80A9D3E4(this);
} else {
this->unkFunc(this);
}
} else {
ActorCutscene_SetIntentToPlay(this->unk_184);
CutsceneManager_Queue(this->csId);
}
}
void func_80A9D3E4(BgHakuginPost* this) {
this->unk_182 = ActorCutscene_GetLength(this->unk_186);
if (this->unk_182 < 0) {
this->unk_182 = 30;
this->additionalCsLength = CutsceneManager_GetLength(this->additionalCsId);
if (this->additionalCsLength < 0) {
this->additionalCsLength = 30;
}
this->actionFunc = func_80A9D434;
}
void func_80A9D434(BgHakuginPost* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->unk_186) != 0) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_186, &this->dyna.actor);
if (CutsceneManager_IsNext(this->additionalCsId)) {
CutsceneManager_StartWithPlayerCs(this->additionalCsId, &this->dyna.actor);
this->unkFunc(this);
} else {
ActorCutscene_SetIntentToPlay(this->unk_186);
CutsceneManager_Queue(this->additionalCsId);
}
}
@ -956,17 +956,17 @@ void BgHakuginPost_Update(Actor* thisx, PlayState* play) {
f32 temp;
func_80A9B46C(this, play);
if ((this->unk_180 >= 0) && ((this->actionFunc != func_80A9D260) || (this->actionFunc != func_80A9D360))) {
this->unk_180--;
if (this->unk_180 < 0) {
ActorCutscene_Stop(this->unk_184);
if ((this->csLength >= 0) && ((this->actionFunc != func_80A9D260) || (this->actionFunc != func_80A9D360))) {
this->csLength--;
if (this->csLength < 0) {
CutsceneManager_Stop(this->csId);
}
}
if ((this->unk_182 >= 0) && (this->actionFunc != func_80A9D434)) {
this->unk_182--;
if (this->unk_182 < 0) {
ActorCutscene_Stop(this->unk_186);
if ((this->additionalCsLength >= 0) && (this->actionFunc != func_80A9D434)) {
this->additionalCsLength--;
if (this->additionalCsLength < 0) {
CutsceneManager_Stop(this->additionalCsId);
}
}

View File

@ -19,8 +19,8 @@ typedef struct {
/* 0x20 */ f32 unk_20;
/* 0x24 */ f32 unk_24;
/* 0x28 */ s16 unk_28;
/* 0x2A */ s16 unk_2A;
/* 0x2C */ s16 unk_2C;
/* 0x2A */ s16 csId;
/* 0x2C */ s16 additionalCsId;
/* 0x2E */ u8 unk_2E;
/* 0x2F */ u8 unk_2F;
/* 0x30 */ s8 unk_30;
@ -64,10 +64,10 @@ typedef struct BgHakuginPost {
/* 0x178 */ s8 unk_178;
/* 0x179 */ s8 unk_179;
/* 0x17C */ BgHakuginPostFunc unkFunc;
/* 0x180 */ s16 unk_180;
/* 0x182 */ s16 unk_182;
/* 0x184 */ s16 unk_184;
/* 0x186 */ s16 unk_186;
/* 0x180 */ s16 csLength;
/* 0x182 */ s16 additionalCsLength;
/* 0x184 */ s16 csId;
/* 0x186 */ s16 additionalCsId;
} BgHakuginPost; // size = 0x188
#endif // Z_BG_HAKUGIN_POST_H

View File

@ -143,12 +143,12 @@ void BgHakuginSwitch_Init(Actor* thisx, PlayState* play) {
this->collider.dim.yShift = 0x1D;
this->unk_1A8 = object_goronswitch_DL_000268;
this->unk_1B8 = this->dyna.actor.cutscene;
this->csId = this->dyna.actor.csId;
if (sp34 == 0) {
this->unk_1BA = -1;
this->additionalCsId = CS_ID_NONE;
} else {
this->unk_1BA = ActorCutscene_GetAdditionalCutscene(this->unk_1B8);
this->additionalCsId = CutsceneManager_GetAdditionalCsId(this->csId);
}
if (sp30) {
@ -166,8 +166,8 @@ void BgHakuginSwitch_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain2);
this->unk_1A8 = D_80B1688C[sp34].unk_10;
this->unk_1B8 = this->dyna.actor.cutscene;
this->unk_1BA = ActorCutscene_GetAdditionalCutscene(this->unk_1B8);
this->csId = this->dyna.actor.csId;
this->additionalCsId = CutsceneManager_GetAdditionalCsId(this->csId);
if (sp30 == sp28) {
func_80B15F3C(this, play);
@ -186,9 +186,9 @@ void BgHakuginSwitch_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyCylinder(play, &this->collider);
}
void func_80B15A4C(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2) {
void func_80B15A4C(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 csId) {
this->unk_1B4 = func;
this->unk_1BC = arg2;
this->curCsId = csId;
this->actionFunc = func_80B15A68;
}
@ -197,14 +197,14 @@ void func_80B15A68(BgHakuginSwitch* this, PlayState* play) {
BgHakuginSwitchStruct* s = &D_80B1688C[BGHAKUGINSWITCH_GET_7(&this->dyna.actor)];
s32 sp18 = !(s->unk_14 & 0x40);
if (ActorCutscene_GetCanPlayNext(this->unk_1BC)) {
if (CutsceneManager_IsNext(this->curCsId)) {
if (sp18) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_1BC, &this->dyna.actor);
CutsceneManager_StartWithPlayerCs(this->curCsId, &this->dyna.actor);
this->unk_1BF = 40;
}
this->unk_1B4(this, play);
} else if (sp18) {
ActorCutscene_SetIntentToPlay(this->unk_1BC);
CutsceneManager_Queue(this->curCsId);
}
}
@ -281,7 +281,7 @@ void func_80B15B74(BgHakuginSwitch* this, PlayState* play) {
D_80B16AF0 = play->gameplayFrames;
if (sp38->unk_14 & 0x10) {
func_80B15A4C(this, func_80B15E0C, this->unk_1B8);
func_80B15A4C(this, func_80B15E0C, this->csId);
} else {
func_80B15E0C(this, play);
}
@ -343,7 +343,7 @@ void func_80B15F88(BgHakuginSwitch* this, PlayState* play) {
if (phi_a0 != phi_v1) {
if ((sp18->unk_14 & 0xFF) & 0x20) {
if (D_80B16AF0 < play->gameplayFrames) {
func_80B15A4C(this, func_80B1606C, this->unk_1BA);
func_80B15A4C(this, func_80B1606C, this->additionalCsId);
}
} else {
func_80B1606C(this, play);
@ -372,16 +372,16 @@ void func_80B160DC(BgHakuginSwitch* this, PlayState* play) {
}
}
void func_80B16180(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2, s32 arg3) {
void func_80B16180(BgHakuginSwitch* this, BgHakuginSwitchUnkFunc func, s32 arg2, s32 csId) {
this->unk_1B4 = func;
this->unk_1BE = arg2;
this->unk_1BC = arg3;
this->curCsId = csId;
this->actionFunc = func_80B161A0;
}
void func_80B161A0(BgHakuginSwitch* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->unk_1BC)) {
ActorCutscene_StartAndSetUnkLinkFields(this->unk_1BC, &this->dyna.actor);
if (CutsceneManager_IsNext(this->curCsId)) {
CutsceneManager_StartWithPlayerCs(this->curCsId, &this->dyna.actor);
if (this->unk_1BE != 0) {
Flags_SetSwitch(play, BGHAKUGINSWITCH_GET_SWITCHFLAG(&this->dyna.actor));
} else {
@ -390,7 +390,7 @@ void func_80B161A0(BgHakuginSwitch* this, PlayState* play) {
this->unk_1BF = 50;
this->unk_1B4(this, play);
} else {
ActorCutscene_SetIntentToPlay(this->unk_1BC);
CutsceneManager_Queue(this->curCsId);
}
}
@ -427,7 +427,7 @@ void func_80B162AC(BgHakuginSwitch* this, PlayState* play) {
if (sp24) {
if (sp28) {
func_80B16180(this, func_80B163C4, 1, this->unk_1B8);
func_80B16180(this, func_80B163C4, 1, this->csId);
} else {
func_80B163C4(this, play);
}
@ -466,7 +466,7 @@ void func_80B16494(BgHakuginSwitch* this, PlayState* play) {
void func_80B16520(BgHakuginSwitch* this, PlayState* play) {
if (!Flags_GetSwitch(play, BGHAKUGINSWITCH_GET_SWITCHFLAG(&this->dyna.actor))) {
if (BGHAKUGINSWITCH_GET_7(&this->dyna.actor) == BGHAKUGINSWITCH_GET_7_1) {
func_80B16180(this, func_80B165A0, 0, this->unk_1BA);
func_80B16180(this, func_80B165A0, 0, this->additionalCsId);
} else {
func_80B165A0(this, play);
}
@ -498,7 +498,7 @@ void BgHakuginSwitch_Update(Actor* thisx, PlayState* play) {
if ((this->actionFunc != func_80B15A68) && (this->actionFunc != func_80B161A0)) {
this->unk_1BF--;
if (this->unk_1BF == 0) {
ActorCutscene_Stop(this->unk_1BC);
CutsceneManager_Stop(this->curCsId);
}
}
}

View File

@ -22,9 +22,9 @@ typedef struct BgHakuginSwitch {
/* 0x1B0 */ s16 unk_1B0;
/* 0x1B2 */ s8 unk_1B2;
/* 0x1B4 */ BgHakuginSwitchUnkFunc unk_1B4;
/* 0x1B8 */ s16 unk_1B8;
/* 0x1BA */ s16 unk_1BA;
/* 0x1BC */ s16 unk_1BC;
/* 0x1B8 */ s16 csId;
/* 0x1BA */ s16 additionalCsId;
/* 0x1BC */ s16 curCsId;
/* 0x1BE */ s8 unk_1BE;
/* 0x1BF */ s8 unk_1BF;
/* 0x1C0 */ s8 unk_1C0;

View File

@ -358,13 +358,13 @@ void BgIkanaBlock_Update(Actor* thisx, PlayState* play) {
if (this->unk_17E != 0) {
if (this->unk_17F > 0) {
this->unk_17F--;
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->unk_17E = 0;
} else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
} else if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->unk_17F = 30;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
}

View File

@ -319,13 +319,13 @@ void func_80BD4F9C(BgIkanaBombwall* this, PlayState* play) {
void func_80BD4FF8(BgIkanaBombwall* this) {
this->dyna.actor.flags |= ACTOR_FLAG_10;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = func_80BD503C;
}
void func_80BD503C(BgIkanaBombwall* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
if (!BGIKANABOMBWALL_GET_100(&this->dyna.actor)) {
func_80BD4720(this, play);
} else {
@ -339,7 +339,7 @@ void func_80BD503C(BgIkanaBombwall* this, PlayState* play) {
}
func_80BD5118(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -352,11 +352,11 @@ void func_80BD5134(BgIkanaBombwall* this, PlayState* play) {
if (!BGIKANABOMBWALL_GET_100(&this->dyna.actor)) {
this->unk_1AC--;
if (this->unk_1AC <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_Kill(&this->dyna.actor);
}
} else if (this->dyna.actor.cutscene >= 0) {
if (ActorCutscene_GetCurrentIndex() != this->dyna.actor.cutscene) {
} else if (this->dyna.actor.csId >= 0) {
if (CutsceneManager_GetCurrentCsId() != this->dyna.actor.csId) {
Actor_Kill(&this->dyna.actor);
}
} else {

View File

@ -115,7 +115,7 @@ void BgIkanaDharma_Init(Actor* thisx, PlayState* play2) {
Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_BG_IKANA_DHARMA, this->dyna.actor.world.pos.x,
segmentY, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x,
this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z,
BGIKANADHARMA_PARAMS(0, true, 0), this->dyna.actor.cutscene,
BGIKANADHARMA_PARAMS(0, true, 0), this->dyna.actor.csId,
this->dyna.actor.halfDaysBits, NULL);
}
@ -173,16 +173,16 @@ void BgIkanaDharma_WaitForHit(BgIkanaDharma* this, PlayState* play) {
}
void BgIkanaDharma_SetupStartCutscene(BgIkanaDharma* this) {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = BgIkanaDharma_StartCutscene;
}
void BgIkanaDharma_StartCutscene(BgIkanaDharma* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
BgIkanaDharma_SetupWaitForCutsceneToEnd(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -200,7 +200,7 @@ void BgIkanaDharma_WaitForCutsceneToEnd(BgIkanaDharma* this, PlayState* play) {
sFirstHitBgIkanaDharma = NULL;
}
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
}
}

View File

@ -179,7 +179,7 @@ void func_80B80440(BgIkanaRotaryroom* this, PlayState* play) {
this->unk_204.unk_00 = Actor_SpawnAsChildAndCutscene(
&play->actorCtx, play, ACTOR_BG_IKANA_BLOCK, sp50.x, sp50.y, sp50.z, this->dyna.actor.shape.rot.x,
this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, -1,
ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene), this->dyna.actor.halfDaysBits, NULL);
CutsceneManager_GetAdditionalCsId(this->dyna.actor.csId), this->dyna.actor.halfDaysBits, NULL);
Matrix_Pop();
}
@ -515,7 +515,7 @@ void func_80B81010(BgIkanaRotaryroom* this, PlayState* play) {
CollisionPoly* sp7C;
s32 sp78;
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
phi_s7 = true;
for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
@ -582,7 +582,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) {
CollisionPoly* sp40;
s32 sp3C;
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
if (player == NULL) {
return;
}
@ -646,7 +646,7 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) {
void func_80B814B8(BgIkanaRotaryroom* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
if (player->actor.bgCheckFlags & BGCHECKFLAG_CRUSHED) {
Player_PlaySfx(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->voiceSfxIdOffset);
func_80169EFC(&play->state);
@ -791,14 +791,14 @@ void func_80B819DC(BgIkanaRotaryroom* this) {
void func_80B819F0(Actor* thisx, PlayState* play) {
BgIkanaRotaryroom* this = THIS;
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (this->dyna.actor.cutscene >= 0) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
if (this->dyna.actor.csId >= 0) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT);
}
func_80B81A64(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -926,7 +926,7 @@ void func_80B81DC8(Actor* thisx, PlayState* play) {
this->unk_584--;
if (this->unk_584 <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
func_80B818B4(this);
} else if (this->unk_584 == 19) {
s16 quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);

View File

@ -106,12 +106,12 @@ void func_80BD5878(BgIkanaShutter* this) {
}
void func_80BD5894(BgIkanaShutter* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
func_80BD58F0(this);
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
void func_80BD58F0(BgIkanaShutter* this) {
@ -177,13 +177,13 @@ void func_80BD5B44(BgIkanaShutter* this) {
}
void func_80BD5B60(BgIkanaShutter* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
Flags_SetClear(play, this->dyna.actor.room);
func_80BD5BC4(this);
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
void func_80BD5BC4(BgIkanaShutter* this) {

View File

@ -179,11 +179,11 @@ void func_80C0ACD4(BgIkninSusceil* this) {
}
void func_80C0ACE8(BgIkninSusceil* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
func_80C0AD44(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -198,7 +198,7 @@ void func_80C0AD64(BgIkninSusceil* this, PlayState* play) {
if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 365.0f, 0.5f,
this->dyna.actor.velocity.y, 1.0f) < 0.1f) {
func_80C0A86C(this, play, 1, 14, 3);
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
func_80C0AB14(this);
} else {
func_800B9010(&this->dyna.actor, NA_SE_EV_ICE_PILLAR_RISING - SFX_FLAG);

View File

@ -80,16 +80,16 @@ void func_80C07220(BgIkninside* this, PlayState* play) {
}
void func_80C07230(BgIkninside* this, PlayState* play) {
if (this->dyna.actor.cutscene == -1) {
if (this->dyna.actor.csId == CS_ID_NONE) {
this->actionFunc = func_80C07220;
} else if (ActorCutscene_GetCurrentIndex() == 0x7C) {
ActorCutscene_Stop(0x7C);
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
} else if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
} else if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) {
CutsceneManager_Stop(CS_ID_GLOBAL_TALK);
CutsceneManager_Queue(this->dyna.actor.csId);
} else if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->actionFunc = func_80C07220;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -51,9 +51,9 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
switch (BGIKNVDOUKUTU_GET_F(&this->dyna.actor)) {
case BGIKNVDOUKUTU_F_0:
this->actionFunc = func_80BD71BC;
this->csAction = 0x204;
this->cueType = CS_CMD_ACTOR_CUE_516;
this->unk_160 = 1.0f;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_14_04) || CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE)) {
this->dyna.actor.draw = func_80BD7768;
this->actionFunc = func_80BD73D0;
play->envCtx.lightSettingOverride = 25;
@ -65,7 +65,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
case BGIKNVDOUKUTU_F_1:
Actor_SetScale(&this->dyna.actor, 1.0f);
this->dyna.actor.draw = func_80BD7820;
this->csAction = 0x204;
this->cueType = CS_CMD_ACTOR_CUE_516;
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012788, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
@ -75,7 +75,7 @@ void BgIknvDoukutu_Init(Actor* thisx, PlayState* play) {
break;
case BGIKNVDOUKUTU_F_2:
this->csAction = 0x204;
this->cueType = CS_CMD_ACTOR_CUE_516;
this->dyna.actor.draw = func_80BD78C4;
DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_0117C8, &colHeader);
@ -116,8 +116,8 @@ void func_80BD716C(BgIknvDoukutu* this, PlayState* play) {
void func_80BD71BC(BgIknvDoukutu* this, PlayState* play) {
play->envCtx.lightSettingOverride = 24;
if (Cutscene_CheckActorAction(play, this->csAction) &&
(play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 2)) {
if (Cutscene_IsCueInChannel(play, this->cueType) &&
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 2)) {
this->actionFunc = func_80BD716C;
this->dyna.actor.draw = func_80BD7538;
}
@ -135,8 +135,8 @@ void func_80BD7250(BgIknvDoukutu* this, PlayState* play) {
}
void func_80BD72BC(BgIknvDoukutu* this, PlayState* play) {
if (Cutscene_CheckActorAction(play, this->csAction) &&
(play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 3)) {
if (Cutscene_IsCueInChannel(play, this->cueType) &&
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 3)) {
this->actionFunc = func_80BD7250;
}
@ -146,8 +146,8 @@ void func_80BD72BC(BgIknvDoukutu* this, PlayState* play) {
}
void func_80BD7360(BgIknvDoukutu* this, PlayState* play) {
if (Cutscene_CheckActorAction(play, this->csAction) &&
(play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action == 2)) {
if (Cutscene_IsCueInChannel(play, this->cueType) &&
(play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id == 2)) {
this->actionFunc = func_80BD72BC;
}
}

View File

@ -18,7 +18,7 @@ enum {
typedef struct BgIknvDoukutu {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ s16 unk_15C; // set and not used
/* 0x15E */ u16 csAction;
/* 0x15E */ u16 cueType;
/* 0x160 */ f32 unk_160;
/* 0x164 */ BgIknvDoukutuActionFunc actionFunc;
} BgIknvDoukutu;// size = 0x168

View File

@ -107,20 +107,20 @@ void BgIknvObj_Destroy(Actor* thisx, PlayState* play) {
}
s32 func_80BD7CEC(BgIknvObj* this) {
if (this->dyna.actor.cutscene == -1) {
if (this->dyna.actor.csId == CS_ID_NONE) {
return true;
}
if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
if (CutsceneManager_GetCurrentCsId() == this->dyna.actor.csId) {
return true;
}
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
return true;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
return false;
}
@ -131,8 +131,8 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, PlayState* play) {
func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
}
if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.currentCsIndex == 4) &&
(play->csCtx.frames == 1495)) {
if ((play->csCtx.state != 0) && (gSaveContext.sceneLayer == 1) && (play->csCtx.scriptIndex == 4) &&
(play->csCtx.curFrame == 1495)) {
func_8019F128(NA_SE_EV_DOOR_UNLOCK);
}
}
@ -166,7 +166,7 @@ void func_80BD7F4C(BgIknvObj* this, PlayState* play) {
this->actionFunc = func_80BD7ED8;
}
if ((this->dyna.actor.home.rot.x == 1) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_58_80)) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
this->dyna.actor.home.rot.x = 0;
}
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);

View File

@ -126,7 +126,7 @@ s32 func_80953DA8(BgIngate* this, PlayState* play) {
Camera* mainCam = Play_GetCamera(play, CAM_ID_MAIN);
if (CHECK_EVENTINF(EVENTINF_35)) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT);
} else {
SET_EVENTINF(EVENTINF_41);
}
@ -169,7 +169,7 @@ void func_80953F14(BgIngate* this, PlayState* play) {
if (this->timePath != NULL) {
func_80953B40(this);
}
this->unk16E = -1;
this->csId = CS_ID_NONE;
this->actionFunc = func_80953F9C;
}
@ -192,7 +192,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) {
if (this->timePath->unk1 != 0xFF) {
func_80953E38(play);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT);
this->dyna.actor.textId = 0x9E4;
Message_StartTextbox(play, this->dyna.actor.textId, NULL);
this->unk16C += 1;
@ -206,13 +206,13 @@ void func_80953F9C(BgIngate* this, PlayState* play) {
}
this->actionFunc = func_809542A0;
}
} else if ((ActorCutscene_GetCurrentIndex() == -1) && (this->timePath != NULL)) {
} else if ((CutsceneManager_GetCurrentCsId() == CS_ID_NONE) && (this->timePath != NULL)) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CRUISER - SFX_FLAG);
func_80953BEC(this);
}
}
if (ActorCutscene_GetCurrentIndex() != this->unk16E) {
if (ActorCutscene_GetCurrentIndex() != -1) {
if (CutsceneManager_GetCurrentCsId() != this->csId) {
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
Camera_ChangeSetting(mainCam, CAM_SET_NORMAL0);
player->stateFlags1 |= PLAYER_STATE1_20;
play->actorCtx.flags &= ~ACTORCTX_FLAG_PICTO_BOX_ON;
@ -221,7 +221,7 @@ void func_80953F9C(BgIngate* this, PlayState* play) {
player->stateFlags1 &= ~PLAYER_STATE1_20;
}
}
this->unk16E = ActorCutscene_GetCurrentIndex();
this->csId = CutsceneManager_GetCurrentCsId();
}
void func_809541B8(BgIngate* this, PlayState* play) {
@ -231,7 +231,7 @@ void func_809541B8(BgIngate* this, PlayState* play) {
if ((player->transformation == PLAYER_FORM_HUMAN) && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(this->dyna.actor.xzDistToPlayer < 40.0f)) {
if (this->dyna.actor.playerHeightRel > 15.0f) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_7);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_WAIT);
this->dyna.actor.textId = 0x9E6;
Message_StartTextbox(play, this->dyna.actor.textId, NULL);
this->actionFunc = func_809543D4;
@ -261,7 +261,7 @@ void func_809542A0(BgIngate* this, PlayState* play) {
void func_80954340(BgIngate* this, PlayState* play) {
if (!DECR(this->unk16A)) {
if (this->timePath != NULL) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END);
this->timePath = &play->setupPathList[this->timePath->unk1];
func_80953F14(this, play);
Environment_StopTime();
@ -280,7 +280,7 @@ void func_809543D4(BgIngate* this, PlayState* play) {
break;
case 0x9E5:
if (play->msgCtx.choiceIndex == 0) {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END);
this->unk160 &= ~0x4;
this->actionFunc = func_809541B8;
Environment_StartTime();
@ -301,7 +301,7 @@ void func_809543D4(BgIngate* this, PlayState* play) {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40);
func_8019F208();
} else {
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_6);
func_800B7298(play, &this->dyna.actor, PLAYER_CSMODE_END);
this->unk160 &= ~0x4;
this->actionFunc = func_809541B8;
Environment_StartTime();
@ -330,7 +330,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) {
Actor_SetScale(&this->dyna.actor, 1.0f);
this->timePath = SubS_GetAdditionalPath(play, BGINGATE_GET_FF(&this->dyna.actor), 0);
this->dyna.actor.room = -1;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_40);
}
if (!CHECK_EVENTINF(EVENTINF_35) && CHECK_WEEKEVENTREG(WEEKEVENTREG_90_40)) {

View File

@ -17,7 +17,7 @@ typedef struct BgIngate {
/* 0x168 */ s16 timePathTimeSpeed;
/* 0x16A */ s16 unk16A;
/* 0x16C */ s16 unk16C;
/* 0x16E */ s16 unk16E;
/* 0x16E */ s16 csId;
/* 0x170 */ Vec3f timePathTargetPos;
/* 0x17C */ f32 timePathProgress;
/* 0x180 */ s32 timePathTotalTime;

View File

@ -171,7 +171,7 @@ void BgKin2Bombwall_SetupWait(BgKin2Bombwall* this) {
void BgKin2Bombwall_Wait(BgKin2Bombwall* this, PlayState* play) {
if (BgKin2Bombwall_IsHitFromNearby(this, play)) {
this->collider.base.acFlags &= ~AC_HIT;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
BgKin2Bombwall_SetupPlayCutscene(this);
} else {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
@ -183,8 +183,8 @@ void BgKin2Bombwall_SetupPlayCutscene(BgKin2Bombwall* this) {
}
void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
Flags_SetSwitch(play, BG_KIN2_BOMBWALL_SWITCH_FLAG(&this->dyna.actor));
SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 60, NA_SE_EV_WALL_BROKEN);
DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
@ -193,7 +193,7 @@ void BgKin2Bombwall_PlayCutscene(BgKin2Bombwall* this, PlayState* play) {
BgKin2Bombwall_SetupEndCutscene(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -205,7 +205,7 @@ void BgKin2Bombwall_SetupEndCutscene(BgKin2Bombwall* this) {
void BgKin2Bombwall_EndCutscene(BgKin2Bombwall* this, PlayState* play) {
this->timer--;
if (this->timer <= 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_Kill(&this->dyna.actor);
}
}

View File

@ -217,13 +217,13 @@ void BgKin2Fence_SetupPlayOpenCutscene(BgKin2Fence* this) {
}
void BgKin2Fence_PlayOpenCutscene(BgKin2Fence* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
Flags_SetSwitch(play, this->dyna.actor.params & 0x7F);
BgKin2Fence_SetupWaitBeforeOpen(this);
return;
}
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
void BgKin2Fence_SetupWaitBeforeOpen(BgKin2Fence* this) {

View File

@ -202,7 +202,7 @@ void BgKin2Picture_Wait(BgKin2Picture* this, PlayState* play) {
// hit by projectile
if (this->colliderTris.base.acFlags & AC_HIT) {
this->colliderTris.base.acFlags &= ~AC_HIT;
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
BgKin2Picture_SetupPlayCutscene(this);
} else { // Gold Skulltula can be heard behind Skullkid's painting.
if (this->skulltulaNoiseTimer >= 0) {
@ -227,12 +227,12 @@ void BgKin2Picture_SetupPlayCutscene(BgKin2Picture* this) {
}
void BgKin2Picture_PlayCutscene(BgKin2Picture* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->cutsceneStarted = true;
BgKin2Picture_SetupShiver(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -314,7 +314,7 @@ void BgKin2Picture_Fall(BgKin2Picture* this, PlayState* play) {
this->dyna.actor.shape.yOffset = 40.0f;
if (this->cutsceneStarted) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
}
DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId);

View File

@ -90,20 +90,20 @@ void BgLadder_Destroy(Actor* thisx, PlayState* play) {
void BgLadder_Wait(BgLadder* this, PlayState* play) {
// Wait for the flag to be set, then trigger the cutscene
if (Flags_GetSwitch(play, this->switchFlag)) {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->action = BgLadder_StartCutscene;
}
}
void BgLadder_StartCutscene(BgLadder* this, PlayState* play) {
// Trigger the cutscene, then make the ladder fade in
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
this->dyna.actor.draw = BgLadder_Draw;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SECRET_LADDER_APPEAR);
this->action = BgLadder_FadeIn;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -112,7 +112,7 @@ void BgLadder_FadeIn(BgLadder* this, PlayState* play) {
this->alpha += 5;
if (this->alpha >= 255) {
this->alpha = 255;
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
DynaPoly_EnableCollision(play, &play->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off
this->action = BgLadder_DoNothing;

View File

@ -164,7 +164,7 @@ void BgLastBwall_Init(Actor* thisx, PlayState* play) {
BgLastBwall_InitCollider(&sTrisInit, &this->dyna.actor.world.pos, &this->dyna.actor.shape.rot, &this->colliderTris,
D_80C18AC0[this->type]);
SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
SubS_FillCutscenesList(&this->dyna.actor, this->csIdList, ARRAY_COUNT(this->csIdList));
func_80C187E4(this);
}
@ -239,7 +239,7 @@ void func_80C1886C(BgLastBwall* this, PlayState* play) {
}
void func_80C18884(BgLastBwall* this, PlayState* play) {
if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
if (SubS_StartCutscene(&this->dyna.actor, this->csIdList[0], CS_ID_NONE, SUBS_CUTSCENE_WITH_PLAYER)) {
func_80C188C4(this, play);
}
}

View File

@ -22,7 +22,7 @@ typedef struct BgLastBwall {
/* 0x160 */ ColliderTris colliderTris;
/* 0x180 */ ColliderTrisElement colliderTrisElement[2];
/* 0x238 */ u8 type;
/* 0x23A */ s16 cutscenes[1];
/* 0x23A */ s16 csIdList[1];
} BgLastBwall; // size = 0x23C
#endif // Z_BG_LAST_BWALL_H

View File

@ -217,13 +217,13 @@ void BgNumaHana_SetupClosedIdle(BgNumaHana* this) {
void BgNumaHana_ClosedIdle(BgNumaHana* this, PlayState* play) {
if (this->fire.state != FIRE_STATE_NOT_LIT) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION);
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
SET_WEEKEVENTREG(WEEKEVENTREG_12_01);
Flags_SetSwitch(play, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor));
BgNumaHana_SetupUnfoldInnerPetals(this);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
}
@ -327,7 +327,7 @@ void BgNumaHana_RaiseFlower(BgNumaHana* this, PlayState* play) {
this->flowerRotationalVelocity = 0x147;
this->settleScale = 0.0f;
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
BgNumaHana_SetupOpenedIdle(this);
}

View File

@ -166,18 +166,18 @@ void func_80ACAEF0(BgOpenShutter* this, PlayState* play) {
void BgOpenShutter_Update(Actor* thisx, PlayState* play2) {
BgOpenShutter* this = THIS;
PlayState* play = play2;
s32 index;
s32 cueChannel;
if (Cutscene_CheckActorAction(play, 0x7C)) {
index = Cutscene_GetActorActionIndex(play, 0x7C);
if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_OPEN) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_124)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_124);
if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_OPEN) {
if (this->actionFunc == func_80ACAD88) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_OPEN);
this->actionFunc = func_80ACAE5C;
this->dyna.actor.velocity.y = 0.0f;
}
this->unk_164 = 0;
} else if (play->csCtx.actorActions[index]->action == BGOPENSHUTTER_DOOR_CLOSED) {
} else if (play->csCtx.actorCues[cueChannel]->id == BGOPENSHUTTER_DOOR_CLOSED) {
if (this->actionFunc == func_80ACAE5C) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
this->actionFunc = func_80ACAEF0;

View File

@ -47,13 +47,13 @@ void BgOpenSpot_Destroy(Actor* thisx, PlayState* play) {
void BgOpenSpot_Update(Actor* thisx, PlayState* play) {
BgOpenSpot* this = THIS;
u32 action;
u32 cueId;
if (Cutscene_CheckActorAction(play, 0x7D)) {
action = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x7D)]->action;
if (action == 1) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_125)) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_125)]->id;
if (cueId == 1) {
this->actor.draw = NULL;
} else if (action == 2) {
} else if (cueId == 2) {
this->actor.draw = BgOpenSpot_Draw;
}
}

View File

@ -45,7 +45,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) {
Vec3f pos;
s32 pad2;
s32 shouldSpawnSeahorse;
s32 cs;
s32 csId;
s32 i;
DynaPolyActor_Init(&this->dyna, 0);
@ -54,11 +54,11 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) {
Math_Vec3f_Copy(&pos, &this->dyna.actor.world.pos);
pos.x += Math_SinS(this->dyna.actor.world.rot.y + 0x8000) * 3000.0f;
pos.z += Math_CosS(this->dyna.actor.world.rot.y + 0x8000) * 3000.0f;
cs = this->dyna.actor.cutscene;
csId = this->dyna.actor.csId;
i = 0;
// clang-format off
while (cs != -1) { this->cutscenes[i] = cs; cs = ActorCutscene_GetAdditionalCutscene(cs); i++; }
while (csId != CS_ID_NONE) { this->csIdList[i] = csId; csId = CutsceneManager_GetAdditionalCsId(csId); i++; }
// clang-format on
this->dyna.actor.scale.x = 0.1f;
@ -74,9 +74,9 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) {
if (this->deepPython != NULL) {
EnDragon* dragon = (EnDragon*)this->deepPython;
dragon->grabCutsceneIndex = this->cutscenes[0];
dragon->deathCutsceneIndex = this->cutscenes[1];
dragon->actor.cutscene = this->dyna.actor.cutscene;
dragon->grabCsId = this->csIdList[0];
dragon->deathCsId = this->csIdList[1];
dragon->actor.csId = this->dyna.actor.csId;
Math_Vec3f_Copy(&dragon->burrowEntrancePos, &this->dyna.actor.world.pos);
dragon->pythonIndex = this->pythonIndex;
}
@ -99,7 +99,7 @@ void BgSinkaiKabe_Init(Actor* thisx, PlayState* play) {
pos.z += (Math_CosS(this->dyna.actor.world.rot.y + 0x8000) * 500.0f);
if (shouldSpawnSeahorse) {
Actor_SpawnAsChildAndCutscene(&play->actorCtx, play, ACTOR_EN_OT, pos.x, pos.y, pos.z, 0,
this->dyna.actor.shape.rot.y, 0, 0x4000, this->dyna.actor.cutscene,
this->dyna.actor.shape.rot.y, 0, 0x4000, this->dyna.actor.csId,
this->dyna.actor.halfDaysBits, NULL);
}

View File

@ -12,7 +12,7 @@ typedef struct BgSinkaiKabe {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ BgSinkaiKabeActionFunc actionFunc;
/* 0x160 */ Actor* deepPython;
/* 0x164 */ s16 cutscenes[2];
/* 0x164 */ s16 csIdList[2];
/* 0x168 */ UNK_TYPE1 unk_168[0x4];
/* 0x16C */ s32 pythonIndex;
} BgSinkaiKabe; // size = 0x170

View File

@ -229,7 +229,7 @@ void func_809CE234(BgSpdweb* this, PlayState* play) {
}
if (this->unk_162 == 0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
CutsceneManager_Stop(this->dyna.actor.csId);
Actor_Kill(&this->dyna.actor);
return;
}
@ -369,8 +369,8 @@ void func_809CE830(BgSpdweb* this, PlayState* play) {
}
if (this->unk_162 == 0) {
if (ActorCutscene_GetLength(this->dyna.actor.cutscene) == -1) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
if (CutsceneManager_GetLength(this->dyna.actor.csId) == -1) {
CutsceneManager_Stop(this->dyna.actor.csId);
}
Actor_Kill(&this->dyna.actor);
return;
@ -470,16 +470,16 @@ void func_809CEBC0(BgSpdweb* this, PlayState* play) {
}
void func_809CEE74(BgSpdweb* this) {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
this->actionFunc = func_809CEEAC;
}
void func_809CEEAC(BgSpdweb* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
func_809CE1D0(this, play);
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}

View File

@ -47,24 +47,24 @@ void func_80919F30(BgUmajump* this, PlayState* play) {
}
void BgUmajump_StopCutscene(BgUmajump* this, PlayState* play) {
if ((play->csCtx.frames >= 6) && !this->hasSoundPlayed) {
if ((play->csCtx.curFrame >= 6) && !this->hasSoundPlayed) {
this->hasSoundPlayed = true;
play_sound(NA_SE_EV_KID_HORSE_NEIGH);
}
if (play->csCtx.state == CS_STATE_0) {
ActorCutscene_Stop(this->dyna.actor.cutscene);
if (play->csCtx.state == CS_STATE_IDLE) {
CutsceneManager_Stop(this->dyna.actor.csId);
this->dyna.actor.update = Actor_Noop;
}
}
void BgUmajump_PlayCutscene(BgUmajump* this, PlayState* play) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
if (CutsceneManager_IsNext(this->dyna.actor.csId)) {
CutsceneManager_StartWithPlayerCs(this->dyna.actor.csId, &this->dyna.actor);
SET_WEEKEVENTREG(WEEKEVENTREG_89_20);
this->actionFunc = BgUmajump_StopCutscene;
} else {
ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
CutsceneManager_Queue(this->dyna.actor.csId);
}
}
@ -95,7 +95,7 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) {
if ((thisx->params == BG_UMAJUMP_TYPE_2)) {
if ((((play->sceneId == SCENE_F01) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_89_20)) &&
!CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) &&
(thisx->cutscene != -1)) {
(thisx->csId != CS_ID_NONE)) {
this->actionFunc = BgUmajump_CheckDistance;
thisx->update = func_8091A5A0;
thisx->flags |= ACTOR_FLAG_10;

View File

@ -550,7 +550,7 @@ void Boss02_Init(Actor* thisx, PlayState* play) {
s32 i;
s32 pad[2];
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) && (this->actor.params == TWINMOLD_RED)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) && (this->actor.params == TWINMOLD_RED)) {
sBlueWarp = (DoorWarp1*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, 60.0f,
0.0f, 0, 0, 0, 1);
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, 30.0f, -150.0f, 0, 1, 0, 0);
@ -1631,7 +1631,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
switch (this->unk_1D18) {
case 0:
if (player->stateFlags1 & PLAYER_STATE1_100) {
Cutscene_Start(play, &play->csCtx);
Cutscene_StartManual(play, &play->csCtx);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
@ -1751,7 +1751,7 @@ void func_809DD934(Boss02* this, PlayState* play) {
this->unk_1D18 = 0;
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
Cutscene_StopManual(play, &play->csCtx);
this->actor.flags |= ACTOR_FLAG_1;
player->stateFlags1 &= ~PLAYER_STATE1_100;
this->unk_1D70 = 0.01f;
@ -2050,10 +2050,11 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
break;
case 1:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_52_20) || ((u32)(KREG(13) + 15) >= this->unk_1D1C)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_STONE_TOWER_TEMPLE) ||
((u32)(KREG(13) + 15) >= this->unk_1D1C)) {
break;
}
Cutscene_Start(play, &play->csCtx);
Cutscene_StartManual(play, &play->csCtx);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
@ -2138,8 +2139,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
if (this->unk_1D1C == (u32)(BREG(27) + 335)) {
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
this->actor.flags |= ACTOR_FLAG_1;
this->unk_1D20 = 0;
sRedTwinmold->unk_0144 = sBlueTwinmold->unk_0144 = 3;
@ -2149,8 +2150,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
break;
case 100:
if (ActorCutscene_GetCurrentIndex() == -1) {
Cutscene_Start(play, &play->csCtx);
if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) {
Cutscene_StartManual(play, &play->csCtx);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
@ -2199,8 +2200,8 @@ void func_809DEAC4(Boss02* this, PlayState* play) {
if (this->unk_1D1C == 30) {
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
this->unk_1D20 = 0;
this->actor.flags |= ACTOR_FLAG_1;
sp68->unk_0144 = 10;

View File

@ -48,8 +48,6 @@
* - Effect Update/Draw
* - Seaweed
*/
#include "prevent_bss_reordering.h"
#include "z_boss_03.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "overlays/actors/ovl_En_Water_Effect/z_en_water_effect.h"
@ -450,7 +448,7 @@ void Boss03_Init(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
Vec3f sp70;
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_55_80)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_GREAT_BAY_TEMPLE)) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, PLATFORM_HEIGHT, 200.0f, 0, 0,
0, ENDOORWARP1_FF_1);
Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, 0.0f, PLATFORM_HEIGHT, 0.0f, 0, 0, 0, 0);
@ -1147,8 +1145,8 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
switch (this->csState) {
case 0:
if (player->actor.world.pos.y < 1350.0f) {
Cutscene_Start(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_7);
Cutscene_StartManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
@ -1369,8 +1367,8 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) {
mainCam->at = this->subCamAt;
func_80169AFC(play, this->subCamId, 0);
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
this->subCamId = SUB_CAM_ID_DONE;
func_809E344C(this, play);
@ -1446,8 +1444,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
switch (this->csState) {
case 0:
if (ActorCutscene_GetCurrentIndex() == -1) {
Cutscene_Start(play, &play->csCtx);
if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) {
Cutscene_StartManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_1);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
@ -1628,8 +1626,8 @@ void Boss03_DeathCutscene(Boss03* this, PlayState* play) {
mainCam->at = this->subCamAt;
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
this->csState = 3;
Play_DisableMotionBlur();
Boss03_PlayUnderwaterSfx(&this->actor.projectedPos, NA_SE_EN_KONB_INIT_OLD);
@ -1661,8 +1659,8 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, PlayState* play) {
this->csTimer++;
switch (this->csState) {
case 0:
if (ActorCutscene_GetCurrentIndex() == -1) {
Cutscene_Start(play, &play->csCtx);
if (CutsceneManager_GetCurrentCsId() == CS_ID_NONE) {
Cutscene_StartManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_1);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
@ -1723,8 +1721,8 @@ void Boss03_SpawnSmallFishesCutscene(Boss03* this, PlayState* play) {
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
func_809E344C(this, play);
this->workTimer[WORK_TIMER_UNK1_A] = 50;

View File

@ -254,16 +254,16 @@ void func_809EC568(Boss04* this, PlayState* play) {
this->unk_2D0 = 2000.0f;
if ((player->stateFlags1 & PLAYER_STATE1_100000) && (this->actor.projectedPos.z > 0.0f) &&
(fabsf(this->actor.projectedPos.x) < 300.0f) && (fabsf(this->actor.projectedPos.y) < 300.0f)) {
if ((this->unk_704 >= 15) && (ActorCutscene_GetCurrentIndex() == -1)) {
if ((this->unk_704 >= 15) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) {
Actor* boss;
this->unk_708 = 10;
this->unk_704 = 0;
Cutscene_Start(play, &play->csCtx);
Cutscene_StartManual(play, &play->csCtx);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
func_800B7298(play, &this->actor, PLAYER_CSMODE_7);
func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT);
player->actor.world.pos.x = this->unk_6E8;
player->actor.world.pos.z = this->unk_6F0 + 410.0f;
player->actor.shape.rot.y = 0x7FFF;
@ -389,8 +389,8 @@ void func_809EC568(Boss04* this, PlayState* play) {
mainCam->at = this->subCamAt;
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
Play_DisableMotionBlur();
SET_EVENTINF(EVENTINF_60);
}

View File

@ -195,12 +195,12 @@ void func_809F24C8(Boss06* this, PlayState* play) {
switch (this->unk_1C9) {
case 0:
if (ActorCutscene_GetCurrentIndex() != -1) {
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
break;
}
Cutscene_Start(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_7);
Cutscene_StartManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_WAIT);
this->subCamId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STATUS_WAIT);
Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE);
@ -332,8 +332,8 @@ void func_809F24C8(Boss06* this, PlayState* play) {
func_809F2ED0(this, play);
func_80169AFC(play, this->subCamId, 0);
this->subCamId = SUB_CAM_ID_DONE;
Cutscene_End(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_6);
Cutscene_StopManual(play, &play->csCtx);
func_800B7298(play, &this->actor, PLAYER_CSMODE_END);
D_809F4970->unk_151 = 0;
}
break;

View File

@ -34,7 +34,7 @@ static s16 sObjectBankIndices[] = { OBJECT_GI_MASK14, OBJECT_GI_SWORD_4 };
static s16 sGetItemDraws[] = { GID_MASK_GREAT_FAIRY, GID_SWORD_GREAT_FAIRY };
static u16 sCsActionIndices[] = { 0x6E, 0x236 };
static u16 sCueTypes[] = { CS_CMD_ACTOR_CUE_110, CS_CMD_ACTOR_CUE_566 };
void DemoGetitem_Init(Actor* thisx, PlayState* play) {
s32 pad;
@ -49,7 +49,7 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.25f);
this->actionFunc = func_80A4FB10;
this->item = sGetItemDraws[itemIndex];
this->csAction = sCsActionIndices[itemIndex];
this->cueType = sCueTypes[itemIndex];
objectIndex = Object_GetIndex(&play->objectCtx, sObjectBankIndices[itemIndex]);
if (objectIndex < 0) {
Actor_Kill(&this->actor);
@ -74,14 +74,14 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) {
PlayState* play = play2;
u16 sp22 = (play->gameplayFrames * 1000) & 0xFFFF;
if (Cutscene_CheckActorAction(play, this->csAction)) {
if (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action != 4) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
if (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id != 4) {
this->actor.shape.yOffset = 0.0f;
}
switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->csAction)]->action) {
switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) {
case 2:
this->actor.draw = DemoGetitem_Draw;
Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction));
Cutscene_ActorTranslate(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType));
this->actor.shape.rot.y += 0x3E8;
break;
@ -91,7 +91,7 @@ void func_80A4FB68(DemoGetitem* this, PlayState* play2) {
case 4:
this->actor.draw = DemoGetitem_Draw;
Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetActorActionIndex(play, this->csAction));
Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType));
this->actor.shape.yOffset = Math_SinS(sp22) * 15.0f;
break;

View File

@ -12,7 +12,7 @@ typedef void (*DemoGetitemActionFunc)(struct DemoGetitem*, PlayState*);
typedef struct DemoGetitem {
/* 0x000 */ Actor actor;
/* 0x144 */ s16 item;
/* 0x146 */ u16 csAction;
/* 0x146 */ u16 cueType;
/* 0x148 */ s8 objectIndex;
/* 0x14C */ DemoGetitemActionFunc actionFunc;
} DemoGetitem; // size = 0x150

View File

@ -68,7 +68,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
this->unk_3E6 = 0;
this->unk_3DC = NULL;
this->unk_3E0 = NULL;
this->unk_3F2 = 0;
this->cueId = 0;
this->unk_3D8 = 1.0f;
switch (DEMOSYOTEN_GET_F(&this->actor)) {
@ -81,7 +81,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
this->actor.child =
Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EFF_DUST, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0, 0);
this->unk_3F0 = 0x215;
this->cueType = CS_CMD_ACTOR_CUE_533;
Actor_SetScale(&this->actor, 0.05f);
break;
@ -91,14 +91,14 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_001448);
this->unk_3E4 |= 1;
this->actionFunc = func_80C16BD4;
this->unk_3F0 = 0x215;
this->cueType = CS_CMD_ACTOR_CUE_533;
Actor_SetScale(&this->actor, 0.05f);
break;
case DEMOSYOTEN_F_2:
this->unk_3DC = object_syoten_DL_001730;
this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_0018B8);
this->unk_3F0 = 0x216;
this->cueType = CS_CMD_ACTOR_CUE_534;
this->actionFunc = func_80C16DD4;
this->unk_3E4 |= 2;
Actor_SetScale(&this->actor, 4.0f);
@ -107,7 +107,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
case DEMOSYOTEN_F_3:
this->unk_3DC = object_syoten_DL_001DD0;
this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_002B98);
this->unk_3F0 = 0x218;
this->cueType = CS_CMD_ACTOR_CUE_536;
this->unk_3E4 |= 8;
this->actionFunc = func_80C16EAC;
Actor_SetScale(&this->actor, 0.5f);
@ -118,7 +118,7 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
this->unk_3E0 = Lib_SegmentedToVirtual(&object_syoten_Matanimheader_002B88);
this->unk_3E4 |= 2;
this->actionFunc = func_80C17008;
this->unk_3F0 = 0x217;
this->cueType = CS_CMD_ACTOR_CUE_535;
this->unk_3E4 |= 1;
this->unk_3E4 |= 8;
this->actor.draw = func_80C17690;
@ -219,20 +219,20 @@ void func_80C16A64(DemoSyoten* this, PlayState* play) {
}
void func_80C16A74(DemoSyoten* this, PlayState* play) {
u16 temp_a0;
u16 cueId;
func_80183DE0(&this->unk_144);
if (Cutscene_CheckActorAction(play, this->unk_3F0)) {
if ((play->csCtx.frames >= 160) && (play->csCtx.frames < 322)) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
if ((play->csCtx.curFrame >= 160) && (play->csCtx.curFrame < 322)) {
func_800B9010(&this->actor, NA_SE_EV_IKANA_SOUL_LV - SFX_FLAG);
} else if (play->csCtx.frames == 322) {
} else if (play->csCtx.curFrame == 322) {
Actor_PlaySfx(&this->actor, NA_SE_EV_IKANA_SOUL_TRANSFORM);
}
temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action;
if (this->unk_3F2 != temp_a0) {
this->unk_3F2 = temp_a0;
switch (temp_a0) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id;
if (this->cueId != cueId) {
this->cueId = cueId;
switch (cueId) {
case 1:
this->actor.draw = NULL;
break;
@ -251,7 +251,7 @@ void func_80C16A74(DemoSyoten* this, PlayState* play) {
}
}
if (temp_a0 == 3) {
if (cueId == 3) {
if (this->unk_3D8 > 0.0125f) {
this->unk_3D8 -= 0.0125f;
if (this->actor.child != NULL) {
@ -271,13 +271,13 @@ void func_80C16A74(DemoSyoten* this, PlayState* play) {
void func_80C16BD4(DemoSyoten* this, PlayState* play) {
s32 pad;
u16 temp_a0;
u16 cueId;
if (Cutscene_CheckActorAction(play, this->unk_3F0)) {
temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action;
if (this->unk_3F2 != temp_a0) {
this->unk_3F2 = temp_a0;
switch (temp_a0) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id;
if (this->cueId != cueId) {
this->cueId = cueId;
switch (cueId) {
default:
this->actor.draw = NULL;
break;
@ -304,7 +304,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) {
}
}
switch (temp_a0) {
switch (cueId) {
case 3:
if (this->actor.scale.x < 0.05f) {
this->actor.scale.x += 0.000625f;
@ -314,7 +314,7 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) {
case 4:
this->actor.speed =
play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->urot.z * 0.005493164f;
play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->rot.z * 0.005493164f;
if (this->unk_3EC < this->unk_3E8->count) {
if (func_80C16818(this)) {
this->unk_3EC++;
@ -330,13 +330,13 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) {
void func_80C16DD4(DemoSyoten* this, PlayState* play) {
s32 pad;
u16 temp_a0;
u16 cueId;
if (Cutscene_CheckActorAction(play, this->unk_3F0)) {
temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action;
if (this->unk_3F2 != temp_a0) {
this->unk_3F2 = temp_a0;
switch (temp_a0) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id;
if (this->cueId != cueId) {
this->cueId = cueId;
switch (cueId) {
case 1:
this->actor.draw = NULL;
break;
@ -349,7 +349,7 @@ void func_80C16DD4(DemoSyoten* this, PlayState* play) {
}
}
if ((temp_a0 == 2) && (this->unk_3E6 < 40)) {
if ((cueId == 2) && (this->unk_3E6 < 40)) {
this->unk_3E6++;
}
} else {
@ -359,13 +359,13 @@ void func_80C16DD4(DemoSyoten* this, PlayState* play) {
void func_80C16EAC(DemoSyoten* this, PlayState* play) {
s32 pad;
u16 temp_a0;
u16 cueId;
if (Cutscene_CheckActorAction(play, this->unk_3F0)) {
temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action;
if (this->unk_3F2 != temp_a0) {
this->unk_3F2 = temp_a0;
switch (temp_a0) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id;
if (this->cueId != cueId) {
this->cueId = cueId;
switch (cueId) {
case 1:
this->actor.draw = NULL;
this->unk_3D8 = 0.0f;
@ -378,7 +378,7 @@ void func_80C16EAC(DemoSyoten* this, PlayState* play) {
}
}
if (temp_a0 == 2) {
if (cueId == 2) {
if (this->actor.scale.x < 8.0f) {
this->actor.scale.x += 0.1875f;
}
@ -401,13 +401,13 @@ void func_80C16EAC(DemoSyoten* this, PlayState* play) {
}
void func_80C17008(DemoSyoten* this, PlayState* play) {
u16 temp_a0;
u16 cueId;
if (Cutscene_CheckActorAction(play, this->unk_3F0)) {
temp_a0 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, this->unk_3F0)]->action;
if (this->unk_3F2 != temp_a0) {
this->unk_3F2 = temp_a0;
switch (temp_a0) {
if (Cutscene_IsCueInChannel(play, this->cueType)) {
cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id;
if (this->cueId != cueId) {
this->cueId = cueId;
switch (cueId) {
case 1:
this->actor.draw = NULL;
break;
@ -419,7 +419,7 @@ void func_80C17008(DemoSyoten* this, PlayState* play) {
}
}
if ((temp_a0 == 2) && (this->unk_3E6 < 15)) {
if ((cueId == 2) && (this->unk_3E6 < 15)) {
this->unk_3E6++;
}
} else {

View File

@ -32,8 +32,8 @@ typedef struct DemoSyoten {
/* 0x3E6 */ s16 unk_3E6;
/* 0x3E8 */ Path* unk_3E8;
/* 0x3EC */ s32 unk_3EC;
/* 0x3F0 */ u16 unk_3F0;
/* 0x3F2 */ u16 unk_3F2;
/* 0x3F0 */ u16 cueType;
/* 0x3F2 */ u16 cueId;
/* 0x3F4 */ DemoSyotenActionFunc actionFunc;
} DemoSyoten; // size = 0x3F8

View File

@ -124,23 +124,23 @@ Actor* func_80C1D78C(PlayState* play) {
void func_80C1D7FC(DmAh* this, PlayState* play) {
s32 D_80C1DE00[] = { 0, 0, 0, 0, 0 };
u16 csAction;
s32 actionIndex;
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != 0) {
if (!this->unk_29C) {
this->action = 0xFF;
this->cueId = 255;
this->unk_29C = true;
this->animationIndex2 = this->animationIndex;
}
if (Cutscene_CheckActorAction(play, 0x232)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x232);
csAction = play->csCtx.actorActions[actionIndex]->action;
if (this->action != (u8)csAction) {
this->action = csAction;
func_80C1D410(this, D_80C1DE00[csAction]);
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
func_80C1D410(this, D_80C1DE00[cueId]);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_29C) {
this->unk_29C = false;

View File

@ -19,7 +19,7 @@ typedef struct DmAh {
/* 0x1B0 */ Vec3s morphTable[OBJECT_AH_LIMB_MAX];
/* 0x216 */ Vec3s jointTable[OBJECT_AH_LIMB_MAX];
/* 0x27C */ u16 unk_27C;
/* 0x27E */ u8 action;
/* 0x27E */ u8 cueId;
/* 0x280 */ Actor* unk_280;
/* 0x284 */ s16 unk_284;
/* 0x286 */ s16 unk_286;

View File

@ -48,23 +48,23 @@ s32 DmAl_ChangeAnim(DmAl* this, s32 animIndex) {
void func_80C1BDD8(DmAl* this, PlayState* play) {
s32 D_80C1C280[] = { 0, 0, 0, 0, 0 };
u16 csAction;
s32 actionIndex;
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != 0) {
if (!this->unk_45C) {
this->action = 0xFF;
this->cueId = 255;
this->unk_45C = true;
this->animIndex2 = this->animIndex;
}
if (Cutscene_CheckActorAction(play, 0x232)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x232);
csAction = play->csCtx.actorActions[actionIndex]->action;
if (this->action != (u8)csAction) {
this->action = csAction;
DmAl_ChangeAnim(this, D_80C1C280[csAction]);
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
DmAl_ChangeAnim(this, D_80C1C280[cueId]);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_45C) {
this->unk_45C = false;

View File

@ -15,7 +15,7 @@ typedef struct DmAl {
/* 0x18C */ MtxF shawlMatrices[6];
/* 0x30C */ Vec3s jointTable[MADAME_AROMA_LIMB_MAX];
/* 0x3AE */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX];
/* 0x450 */ u8 action;
/* 0x450 */ u8 cueId;
/* 0x454 */ s32 animIndex;
/* 0x458 */ s32 animIndex2;
/* 0x45C */ s32 unk_45C;

View File

@ -195,28 +195,28 @@ void func_80C1C958(DmAn* this, PlayState* play) {
void func_80C1CAB0(DmAn* this, PlayState* play) {
s32 sp28[] = { 0, 0, 12, 2, 4, 6, 8, 10, 11, 3 };
u16 action;
s32 sp20;
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != 0) {
if (this->unk_2D0 == 0) {
this->unk_2B0 = 255;
this->cueId = 255;
this->unk_2D0 = 1;
this->unk_2D4 = 0;
this->unk_2CC = this->unk_2C8;
}
if (Cutscene_CheckActorAction(play, 0x22D)) {
sp20 = Cutscene_GetActorActionIndex(play, 0x22D);
action = play->csCtx.actorActions[sp20]->action;
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_557)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_557);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->unk_2B0 != (action & 0xFF)) {
this->unk_2B0 = action;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
this->unk_2D4 = 1;
func_80C1C4D8(this, play, sp28[action]);
func_80C1C4D8(this, play, sp28[cueId]);
}
switch (this->unk_2B0) {
switch (this->cueId) {
case 2:
case 4:
case 5:
@ -230,7 +230,7 @@ void func_80C1CAB0(DmAn* this, PlayState* play) {
}
break;
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, sp20);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_2D0 != 0) {
this->unk_2D0 = 0;

View File

@ -21,7 +21,7 @@ typedef struct DmAn {
/* 0x2AC */ s8 unk_2AC;
/* 0x2AD */ s8 unk_2AD;
/* 0x2AE */ u16 unk_2AE;
/* 0x2B0 */ u8 unk_2B0;
/* 0x2B0 */ u8 cueId;
/* 0x2B4 */ Actor* unk_2B4;
/* 0x2B8 */ s16 unk_2B8;
/* 0x2BA */ s16 unk_2BA;

View File

@ -74,15 +74,15 @@ void DmBal_DoNothing(DmBal* this, PlayState* play) {
}
void func_80C1EAE8(DmBal* this, PlayState* play) {
static u16 D_80C1F2C0 = 0x63;
s32 actionIndex;
static u16 sCueId = 99;
s32 cueChannel;
if (Cutscene_CheckActorAction(play, 0x238)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x238);
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_568)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_568);
if (D_80C1F2C0 != play->csCtx.actorActions[actionIndex]->action) {
D_80C1F2C0 = play->csCtx.actorActions[actionIndex]->action;
switch (play->csCtx.actorActions[actionIndex]->action) {
if (sCueId != play->csCtx.actorCues[cueChannel]->id) {
sCueId = play->csCtx.actorCues[cueChannel]->id;
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
this->keepEyesShut = false;
this->eyeIndex = 0;
@ -96,7 +96,7 @@ void func_80C1EAE8(DmBal* this, PlayState* play) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 13);
break;
}
} else if (D_80C1F2C0 == 3) {
} else if (sCueId == 3) {
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
this->keepEyesShut = true;
} else if (Animation_OnFrame(&this->skelAnime, 29.0f)) {
@ -104,12 +104,12 @@ void func_80C1EAE8(DmBal* this, PlayState* play) {
this->eyeIndex = 0;
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
this->actor.home.pos = this->actor.world.pos;
} else {
this->keepEyesShut = false;
this->eyeIndex = 0;
D_80C1F2C0 = 0x63;
sCueId = 99;
}
}

View File

@ -150,7 +150,7 @@ void func_80AA5580(SkelAnime* skelAnime, AnimationInfo* animation, u16 idx) {
void func_80AA561C(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames + 20) {
switch (play->csCtx.curFrame + 20) {
case 503:
case 926:
case 979:
@ -169,7 +169,7 @@ void func_80AA561C(DmChar00* this, PlayState* play) {
break;
}
} else {
switch (play->csCtx.frames + 20) {
switch (play->csCtx.curFrame + 20) {
case 503:
case 926:
case 979:
@ -188,14 +188,14 @@ void func_80AA561C(DmChar00* this, PlayState* play) {
}
void func_80AA5720(DmChar00* this, PlayState* play) {
if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 505)) {
if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.curFrame == 505)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_SPOT_LIGHT_OPEN);
}
}
void func_80AA575C(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 474:
case 489:
case 495:
@ -227,24 +227,24 @@ void func_80AA575C(DmChar00* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EV_BELL_BRAKE);
break;
}
} else if (play->csCtx.frames == 660) {
} else if (play->csCtx.curFrame == 660) {
Actor_PlaySfx(&this->actor, NA_SE_EV_MONDO_SURPRISE);
}
}
void func_80AA5890(DmChar00* this, PlayState* play) {
if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.frames == 20)) {
if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (play->csCtx.curFrame == 20)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
}
}
void func_80AA58CC(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
if (play->csCtx.frames == 568) {
if (play->csCtx.curFrame == 568) {
Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
}
} else {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 375:
case 479:
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
@ -262,11 +262,11 @@ void func_80AA5950(DmChar00* this, PlayState* play) {
void func_80AA5960(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
if (play->csCtx.frames == 280) {
if (play->csCtx.curFrame == 280) {
Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
}
} else {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 87:
case 190:
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
@ -281,7 +281,7 @@ void func_80AA5960(DmChar00* this, PlayState* play) {
void func_80AA59E4(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 125:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
break;
@ -291,14 +291,14 @@ void func_80AA59E4(DmChar00* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON);
break;
}
} else if (play->csCtx.frames == 125) {
} else if (play->csCtx.curFrame == 125) {
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
}
}
void func_80AA5A6C(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 44:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
break;
@ -308,14 +308,14 @@ void func_80AA5A6C(DmChar00* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON);
break;
}
} else if (play->csCtx.frames == 44) {
} else if (play->csCtx.curFrame == 44) {
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
}
}
void func_80AA5AF4(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 352:
case 401:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
@ -330,7 +330,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) {
break;
}
} else {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 362:
case 401:
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
@ -341,7 +341,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) {
break;
}
if ((play->csCtx.frames >= 500) && (play->csCtx.frames < 602)) {
if ((play->csCtx.curFrame >= 500) && (play->csCtx.curFrame < 602)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SHIVER - SFX_FLAG);
}
}
@ -349,7 +349,7 @@ void func_80AA5AF4(DmChar00* this, PlayState* play) {
void func_80AA5BF8(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 762:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_SHOT_DASH);
break;
@ -358,7 +358,7 @@ void func_80AA5BF8(DmChar00* this, PlayState* play) {
break;
}
} else {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 762:
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_SHOT_DASH);
break;
@ -375,14 +375,14 @@ void func_80AA5BF8(DmChar00* this, PlayState* play) {
}
void func_80AA5CD4(DmChar00* this, PlayState* play) {
if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (play->csCtx.frames == 467)) {
if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (play->csCtx.curFrame == 467)) {
Actor_PlaySfx(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
}
}
void func_80AA5D10(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 8:
Actor_PlaySfx(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
break;
@ -396,7 +396,7 @@ void func_80AA5D10(DmChar00* this, PlayState* play) {
void func_80AA5D6C(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 2:
case 166:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
@ -411,7 +411,7 @@ void func_80AA5D6C(DmChar00* this, PlayState* play) {
void func_80AA5DC8(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 233:
case 415:
case 593:
@ -427,7 +427,7 @@ void func_80AA5DC8(DmChar00* this, PlayState* play) {
void func_80AA5E2C(DmChar00* this, PlayState* play) {
if (DMCHAR00_GET(&this->actor) == DMCHAR00_1) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 32:
Actor_PlaySfx(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
break;
@ -458,11 +458,11 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) {
case SCENE_OPENINGDAN:
if (gSaveContext.sceneLayer == 0) {
if (play->csCtx.currentCsIndex == 0) {
if (play->csCtx.scriptIndex == 0) {
func_80AA5720(this, play);
} else if (play->csCtx.currentCsIndex == 1) {
} else if (play->csCtx.scriptIndex == 1) {
func_80AA575C(this, play);
} else if (play->csCtx.currentCsIndex == 2) {
} else if (play->csCtx.scriptIndex == 2) {
func_80AA5890(this, play);
}
}
@ -470,17 +470,17 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) {
case SCENE_OKUJOU:
if (gSaveContext.sceneLayer == 0) {
if (play->csCtx.currentCsIndex == 0) {
if (play->csCtx.scriptIndex == 0) {
func_80AA58CC(this, play);
} else if (play->csCtx.currentCsIndex == 1) {
} else if (play->csCtx.scriptIndex == 1) {
func_80AA5950(this, play);
} else if (play->csCtx.currentCsIndex == 2) {
} else if (play->csCtx.scriptIndex == 2) {
func_80AA5960(this, play);
}
} else if (gSaveContext.sceneLayer == 2) {
if (play->csCtx.currentCsIndex == 0) {
if (play->csCtx.scriptIndex == 0) {
func_80AA59E4(this, play);
} else if (play->csCtx.currentCsIndex == 1) {
} else if (play->csCtx.scriptIndex == 1) {
func_80AA5A6C(this, play);
}
}
@ -488,34 +488,34 @@ void func_80AA5EBC(DmChar00* this, PlayState* play) {
case SCENE_00KEIKOKU:
if (gSaveContext.sceneLayer == 3) {
if (play->csCtx.currentCsIndex == 0) {
if (play->csCtx.scriptIndex == 0) {
func_80AA5AF4(this, play);
} else if (play->csCtx.currentCsIndex == 2) {
} else if (play->csCtx.scriptIndex == 2) {
func_80AA5E2C(this, play);
}
} else if (gSaveContext.sceneLayer == 7) {
if (play->csCtx.currentCsIndex == 0) {
if (play->csCtx.scriptIndex == 0) {
func_80AA5BF8(this, play);
} else if (play->csCtx.currentCsIndex == 1) {
} else if (play->csCtx.scriptIndex == 1) {
func_80AA5CD4(this, play);
}
}
break;
case SCENE_MITURIN:
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) {
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 1)) {
func_80AA5DC8(this, play);
}
break;
case SCENE_INSIDETOWER:
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) {
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0)) {
func_80AA5D10(this, play);
}
break;
case SCENE_PIRATE:
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 0)) {
if ((gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 0)) {
func_80AA5D6C(this, play);
}
break;
@ -535,7 +535,7 @@ void DmChar00_Init(Actor* thisx, PlayState* play) {
this->unk_250 = D_80AA77D8[DMCHAR00_GET(thisx)];
thisx->targetArrowOffset = 3000.0f;
this->unk_260 = 99;
this->cueId = 99;
this->unk_262 = DMCHAR00_GET_F800(thisx);
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
@ -551,18 +551,18 @@ void DmChar00_Destroy(Actor* thisx, PlayState* play) {
}
void func_80AA62FC(DmChar00* this, PlayState* play) {
u16 sp26 = DMCHAR00_GET(&this->actor) + 113;
s32 temp_v0;
u16 cueType = CS_CMD_ACTOR_CUE_113 + DMCHAR00_GET(&this->actor);
s32 cueChannel;
s32 pad;
if (Cutscene_CheckActorAction(play, sp26)) {
temp_v0 = Cutscene_GetActorActionIndex(play, sp26);
if (Cutscene_IsCueInChannel(play, cueType)) {
cueChannel = Cutscene_GetCueChannel(play, cueType);
if (play->csCtx.frames == play->csCtx.actorActions[temp_v0]->startFrame) {
if (this->unk_260 != play->csCtx.actorActions[temp_v0]->action) {
this->unk_260 = play->csCtx.actorActions[temp_v0]->action;
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
if (this->cueId != play->csCtx.actorCues[cueChannel]->id) {
this->cueId = play->csCtx.actorCues[cueChannel]->id;
switch (play->csCtx.actorActions[temp_v0]->action) {
switch (play->csCtx.actorCues[cueChannel]->id) {
case 0x1:
this->unk_261 = 0;
break;
@ -786,9 +786,9 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, temp_v0);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
} else {
this->unk_260 = 99;
this->cueId = 99;
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
@ -853,7 +853,7 @@ void func_80AA62FC(DmChar00* this, PlayState* play) {
void func_80AA67F8(DmChar00* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((play->csCtx.state == 0) && (gSaveContext.sceneLayer == 0) && (play->csCtx.currentCsIndex == 1)) {
if ((play->csCtx.state == 0) && (gSaveContext.sceneLayer == 0) && (play->csCtx.scriptIndex == 1)) {
if (this->unk_261 != 42) {
this->unk_261 = 42;
func_80AA5580(&this->skelAnime, &sAnimationInfo[this->unk_261], 0);
@ -916,7 +916,7 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) {
if ((play->csCtx.state == 0) &&
((play->sceneId != SCENE_OPENINGDAN) || (gSaveContext.sceneLayer != 0) || (play->roomCtx.curRoom.num != 0) ||
(play->csCtx.currentCsIndex != 1) || (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) {
(play->csCtx.scriptIndex != 1) || (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) {
return;
}

View File

@ -23,7 +23,7 @@ typedef struct DmChar00 {
/* 0x23C */ DmChar00ActionFunc actionFunc;
/* 0x240 */ Color_RGBAf unk_240;
/* 0x250 */ Color_RGBAf unk_250;
/* 0x260 */ u8 unk_260;
/* 0x260 */ u8 cueId;
/* 0x261 */ u8 unk_261;
/* 0x262 */ u16 unk_262;
} DmChar00; // size = 0x264

View File

@ -67,7 +67,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) {
switch (DMCHAR01_GET(&this->dyna.actor)) {
case DMCHAR01_0:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
this->unk_34C = 2;
this->actionFunc = func_80AA8F1C;
break;
@ -97,7 +97,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) {
break;
case DMCHAR01_1:
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02) || (gSaveContext.sceneLayer == 1)) {
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE) || (gSaveContext.sceneLayer == 1)) {
this->unk_34C = 1;
this->actionFunc = func_80AA8F1C;
} else {
@ -134,7 +134,7 @@ void DmChar01_Init(Actor* thisx, PlayState* play) {
DynaPolyActor_LoadMesh(play, &this->dyna, &gWoodfallSceneryTempleRampAndPlatformCol);
this->unk_34D = true;
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_20_02)) {
if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
this->actionFunc = func_80AA9020;
this->dyna.actor.world.pos.y -= 120.0f;
} else {
@ -187,19 +187,20 @@ void func_80AA8698(DmChar01* this, PlayState* play) {
}
void func_80AA884C(DmChar01* this, PlayState* play) {
s16 sp1E = this->dyna.actor.cutscene;
s16 csId = this->dyna.actor.csId;
if (ActorCutscene_GetCanPlayNext(sp1E)) {
ActorCutscene_Start(sp1E, &this->dyna.actor);
if (CutsceneManager_IsNext(csId)) {
CutsceneManager_Start(csId, &this->dyna.actor);
this->actionFunc = func_80AA88A8;
} else {
ActorCutscene_SetIntentToPlay(sp1E);
CutsceneManager_Queue(csId);
}
}
void func_80AA88A8(DmChar01* this, PlayState* play) {
if (Cutscene_CheckActorAction(play, 135)) {
if (play->csCtx.frames == play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 135)]->startFrame) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_135)) {
if (play->csCtx.curFrame ==
play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_135)]->startFrame) {
D_80AAAE24 = 1;
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_FORT_RISING);
}
@ -344,11 +345,11 @@ void func_80AA8F2C(DmChar01* this, PlayState* play) {
}
void func_80AA9020(DmChar01* this, PlayState* play) {
if (Cutscene_CheckActorAction(play, 135)) {
CsCmdActorAction* temp_v1 = play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 135)];
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_135)) {
CsCmdActorCue* cue = play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_135)];
if ((temp_v1->startFrame == play->csCtx.frames) && (temp_v1->action == 2)) {
SET_WEEKEVENTREG(WEEKEVENTREG_20_02);
if ((cue->startFrame == play->csCtx.curFrame) && (cue->id == 2)) {
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE);
this->actionFunc = func_80AA90AC;
}
}

View File

@ -61,7 +61,7 @@ void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16
}
void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) {
switch (play->csCtx.frames) {
switch (play->csCtx.curFrame) {
case 95:
Actor_PlaySfx(&this->actor, NA_SE_EV_OCARINA_BOUND_0);
break;
@ -75,7 +75,7 @@ void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play)
}
void DmChar02_PlaySfxForCutscenes(DmChar02* this, PlayState* play) {
if ((play->csCtx.state != 0) && (play->sceneId == SCENE_OKUJOU) && (play->csCtx.currentCsIndex == 1)) {
if ((play->csCtx.state != 0) && (play->sceneId == SCENE_OKUJOU) && (play->csCtx.scriptIndex == 1)) {
DmChar02_PlaySfxForDroppingOcarinaCutscene(this, play);
}
}
@ -101,12 +101,12 @@ void DmChar02_Destroy(Actor* thisx, PlayState* play) {
void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
u8 shouldChangeAnimation = true;
s32 actionIndex;
s32 cueChannel;
if (Cutscene_CheckActorAction(play, 0x83)) {
actionIndex = Cutscene_GetActorActionIndex(play, 0x83);
if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) {
switch (play->csCtx.actorActions[actionIndex]->action) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_131)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_131);
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
default:
this->animIndex = DMCHAR02_ANIM_HIT_GROUND;
shouldChangeAnimation = false;
@ -130,7 +130,7 @@ void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
}
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
@ -174,8 +174,8 @@ void DmChar02_Draw(Actor* thisx, PlayState* play) {
if ((play->csCtx.state == 0) && (this->actor.world.pos.y < 100.0f)) {
shouldDraw = true;
} else if (Cutscene_CheckActorAction(play, 0x6B)) {
switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x6B)]->action) {
} else if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_107)) {
switch (play->csCtx.actorCues[Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_107)]->id) {
case 0x17:
case 0x1C:
case 0x26:

Some files were not shown because too many files have changed in this diff Show More