Transition docs (#3322)

* transition variables renamed

* transition circle

* transition wipe

* sand storm

* remaining sceneloadflag rename

* transition trigger macros

* transition mode enum

* transition type enum

* tc set params

* creg debug transitions
This commit is contained in:
inspectredc 2023-11-19 07:38:07 +00:00 committed by GitHub
parent a8e387b949
commit 2b1327c41a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 685 additions and 590 deletions

View File

@ -1537,7 +1537,7 @@ void KaleidoScopeCall_Draw(PlayState* play);
void func_800BC490(PlayState* play, s16 point);
s32 func_800BC56C(PlayState* play, s16 arg1);
void func_800BC590(PlayState* play);
void func_800BC5E0(PlayState* play, s32 arg1);
void Gameplay_SetupTransition(PlayState* play, s32 arg1);
Gfx* Play_SetFog(PlayState* play, Gfx* gfx);
void Play_Destroy(GameState* thisx);
void Play_Init(GameState* thisx);

View File

@ -86,6 +86,8 @@
#define R_ITEM_ICON_X(i) ZREG(82 + i)
#define R_ITEM_ICON_Y(i) ZREG(86 + i)
#define R_ITEM_ICON_DD(i) ZREG(90 + i)
#define R_TRANS_DBG_ENABLED CREG(11)
#define R_TRANS_DBG_TYPE CREG(12)
#define R_ENV_WIND_DIR(i) CREG(16 + i)
#define R_ENV_WIND_SPEED CREG(19)
#define R_A_BTN_Y XREG(16)

View File

@ -1119,6 +1119,82 @@ typedef struct {
/* 0x4C */ u32 unk_4C;
} PreRender; // size = 0x50
#define TRANS_TRIGGER_OFF 0 // transition is not active
#define TRANS_TRIGGER_START 20 // start transition (exiting an area)
#define TRANS_TRIGGER_END -20 // transition is ending (arriving in a new area)
typedef enum {
/* 0 */ TRANS_MODE_OFF,
/* 1 */ TRANS_MODE_SETUP,
/* 2 */ TRANS_MODE_INSTANCE_INIT,
/* 3 */ TRANS_MODE_INSTANCE_RUNNING,
/* 4 */ TRANS_MODE_FILL_WHITE_INIT,
/* 5 */ TRANS_MODE_FILL_IN,
/* 6 */ TRANS_MODE_FILL_OUT,
/* 7 */ TRANS_MODE_FILL_BROWN_INIT,
/* 8 */ TRANS_MODE_08, // unused
/* 9 */ TRANS_MODE_09, // unused
/* 10 */ TRANS_MODE_INSTANT,
/* 11 */ TRANS_MODE_INSTANCE_WAIT,
/* 12 */ TRANS_MODE_SANDSTORM_INIT,
/* 13 */ TRANS_MODE_SANDSTORM,
/* 14 */ TRANS_MODE_SANDSTORM_END_INIT,
/* 15 */ TRANS_MODE_SANDSTORM_END,
/* 16 */ TRANS_MODE_CS_BLACK_FILL_INIT,
/* 17 */ TRANS_MODE_CS_BLACK_FILL
} TransitionMode;
typedef enum {
/* 0 */ TRANS_TYPE_WIPE,
/* 1 */ TRANS_TYPE_TRIFORCE,
/* 2 */ TRANS_TYPE_FADE_BLACK,
/* 3 */ TRANS_TYPE_FADE_WHITE,
/* 4 */ TRANS_TYPE_FADE_BLACK_FAST,
/* 5 */ TRANS_TYPE_FADE_WHITE_FAST,
/* 6 */ TRANS_TYPE_FADE_BLACK_SLOW,
/* 7 */ TRANS_TYPE_FADE_WHITE_SLOW,
/* 8 */ TRANS_TYPE_WIPE_FAST,
/* 9 */ TRANS_TYPE_FILL_WHITE2,
/* 10 */ TRANS_TYPE_FILL_WHITE,
/* 11 */ TRANS_TYPE_INSTANT,
/* 12 */ TRANS_TYPE_FILL_BROWN,
/* 13 */ TRANS_TYPE_FADE_WHITE_CS_DELAYED,
/* 14 */ TRANS_TYPE_SANDSTORM_PERSIST,
/* 15 */ TRANS_TYPE_SANDSTORM_END,
/* 16 */ TRANS_TYPE_CS_BLACK_FILL,
/* 17 */ TRANS_TYPE_FADE_WHITE_INSTANT,
/* 18 */ TRANS_TYPE_FADE_GREEN,
/* 19 */ TRANS_TYPE_FADE_BLUE,
// transition types 20 - 31 are unused
// transition types 32 - 55 are constructed using the TRANS_TYPE_CIRCLE macro
/* 56 */ TRANS_TYPE_MAX = 56
} TransitionType;
#define TRANS_NEXT_TYPE_DEFAULT 0xFF // when `nextTransitionType` is set to default, the type will be taken from the entrance table for the ending transition
typedef enum {
/* 0 */ TCA_NORMAL,
/* 1 */ TCA_WAVE,
/* 2 */ TCA_RIPPLE,
/* 3 */ TCA_STARBURST
} TransitionCircleAppearance;
typedef enum {
/* 0 */ TCC_BLACK,
/* 1 */ TCC_WHITE,
/* 2 */ TCC_GRAY,
/* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken
} TransitionCircleColor;
typedef enum {
/* 0 */ TCS_FAST,
/* 1 */ TCS_SLOW
} TransitionCircleSpeed;
#define TC_SET_PARAMS (1 << 7)
#define TRANS_TYPE_CIRCLE(appearance, color, speed) ((1 << 5) | ((color & 3) << 3) | ((appearance & 3) << 1) | (speed & 1))
typedef struct {
union {
TransitionFade fade;
@ -1381,14 +1457,14 @@ typedef struct PlayState {
/* 0x11E0C */ ElfMessage* cUpElfMsgs;
/* 0x11E10 */ void* specialEffects;
/* 0x11E14 */ u8 skyboxId;
/* 0x11E15 */ s8 sceneLoadFlag; // "fade_direction"
/* 0x11E15 */ s8 transitionTrigger; // "fade_direction"
/* 0x11E16 */ s16 unk_11E16;
/* 0x11E18 */ s16 unk_11E18;
/* 0x11E1A */ s16 nextEntranceIndex;
/* 0x11E1C */ char unk_11E1C[0x40];
/* 0x11E5C */ s8 shootingGalleryStatus;
/* 0x11E5D */ s8 bombchuBowlingStatus; // "bombchu_game_flag"
/* 0x11E5E */ u8 fadeTransition;
/* 0x11E5E */ u8 transitionType;
/* 0x11E60 */ CollisionCheckContext colChkCtx;
/* 0x120FC */ u16 envFlags[20];
/* 0x12124 */ PreRender pauseBgPreRender;

View File

@ -30,6 +30,14 @@ typedef enum {
/* 13 */ SKYBOX_DMA_PAL2_START
} SkyboxDmaState;
typedef enum {
/* 0 */ SANDSTORM_OFF,
/* 1 */ SANDSTORM_FILL,
/* 2 */ SANDSTORM_UNFILL,
/* 3 */ SANDSTORM_ACTIVE,
/* 4 */ SANDSTORM_DISSIPATE
} SandstormState;
typedef struct {
/* 0x00 */ u8 state;
/* 0x01 */ u8 flashRed;

View File

@ -50,11 +50,16 @@ typedef struct {
/* 0x004 */ Color_RGBA8_u32 envColor;
/* 0x008 */ s32 texX;
/* 0x00C */ s32 texY;
/* 0x010 */ s32 step;
/* 0x014 */ u8 unk_14;
/* 0x015 */ u8 typeColor;
/* 0x016 */ u8 speed;
/* 0x017 */ u8 effect;
// /* 0x010 */ s32 step;
// /* 0x014 */ u8 unk_14;
// /* 0x015 */ u8 typeColor;
// /* 0x016 */ u8 speed;
// /* 0x017 */ u8 effect;
/* 0x010 */ s32 speed;
/* 0x014 */ u8 direction;
/* 0x015 */ u8 colorType;
/* 0x016 */ u8 speedType;
/* 0x017 */ u8 appearanceType;
/* 0x018 */ u8 isDone;
/* 0x019 */ u8 frame;
/* 0x01A */ u16 normal;

View File

@ -218,8 +218,8 @@ void BossRush_HandleBlueWarp(PlayState* play, f32 warpPosX, f32 warpPosZ) {
} else if (gSaveContext.bossRushOptions[BR_OPTIONS_BOSSES] == BR_CHOICE_BOSSES_CHILD) {
play->nextEntranceIndex = 0x6B;
gSaveContext.nextCutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
}
}
}

View File

@ -397,9 +397,9 @@ static bool EntranceHandler(std::shared_ptr<LUS::Console> Console, const std::ve
}
gPlayState->nextEntranceIndex = entrance;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 11;
gSaveContext.nextTransitionType = 11;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_INSTANT;
gSaveContext.nextTransitionType = TRANS_TYPE_INSTANT;
}
static bool VoidHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) {
@ -407,10 +407,10 @@ static bool VoidHandler(std::shared_ptr<LUS::Console> Console, const std::vector
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = gPlayState->actorCtx.flags.tempSwch;
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = gPlayState->actorCtx.flags.tempCollect;
gSaveContext.respawnFlag = 1;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
gPlayState->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
gPlayState->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
} else {
ERROR_MESSAGE("gPlayState == nullptr");
return 1;
@ -421,9 +421,9 @@ static bool VoidHandler(std::shared_ptr<LUS::Console> Console, const std::vector
static bool ReloadHandler(std::shared_ptr<LUS::Console> Console, const std::vector<std::string>& args, std::string* output) {
if (gPlayState != nullptr) {
gPlayState->nextEntranceIndex = gSaveContext.entranceIndex;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 11;
gSaveContext.nextTransitionType = 11;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_INSTANT;
gSaveContext.nextTransitionType = TRANS_TYPE_INSTANT;
} else {
ERROR_MESSAGE("gPlayState == nullptr");
return 1;
@ -457,9 +457,9 @@ static bool FWHandler(std::shared_ptr<LUS::Console> Console, const std::vector<s
break;
case 1: //warp
if (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0) {
gPlayState->sceneLoadFlag = 0x14;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
gPlayState->fadeTransition = 5;
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
} else {
ERROR_MESSAGE("Farore's wind not set!");
return 1;

View File

@ -326,9 +326,9 @@ void GameInteractor::RawAction::UpdateActor(void* refActor) {
void GameInteractor::RawAction::TeleportPlayer(int32_t nextEntrance) {
Audio_PlaySoundGeneral(NA_SE_EN_GANON_LAUGH, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
gPlayState->nextEntranceIndex = nextEntrance;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
}
void GameInteractor::RawAction::ClearAssignedButtons(uint8_t buttonSet) {

View File

@ -39,9 +39,9 @@ uint32_t ResourceMgr_IsSceneMasterQuest(s16 sceneNum);
// TODO: When there's more uses of something like this, create a new GI::RawAction?
void ReloadSceneTogglingLinkAge() {
gPlayState->nextEntranceIndex = gSaveContext.entranceIndex;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 42; // Fade Out
gSaveContext.nextTransitionType = 42;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST); // Fade Out
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST);
gPlayState->linkAgeOnLoad ^= 1; // toggle linkAgeOnLoad
}
@ -205,8 +205,8 @@ void RegisterSwitchAge() {
warped = true;
}
if (warped && gPlayState->sceneLoadFlag != 0x0014 &&
gSaveContext.nextTransitionType == 255) {
if (warped && gPlayState->transitionTrigger != TRANS_TRIGGER_START &&
gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) {
GET_PLAYER(gPlayState)->actor.shape.rot.y = playerYaw;
GET_PLAYER(gPlayState)->actor.world.pos = playerPos;
if (roomNum != roomCtx->curRoom.num) {
@ -630,8 +630,8 @@ void RegisterTriforceHunt() {
if (GameInteractor::State::TriforceHuntCreditsWarpActive) {
gPlayState->nextEntranceIndex = 0x6B;
gSaveContext.nextCutsceneIndex = 0xFFF2;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 3;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE;
GameInteractor::State::TriforceHuntCreditsWarpActive = 0;
}
@ -649,7 +649,7 @@ void RegisterTriforceHunt() {
uint8_t requiredPieces = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED);
// Give Boss Key when player loads back into the savefile.
if (currentPieces >= requiredPieces && gPlayState->sceneLoadFlag != 0x14 &&
if (currentPieces >= requiredPieces && gPlayState->transitionTrigger != TRANS_TRIGGER_START &&
(1 << 0 & gSaveContext.inventory.dungeonItems[SCENE_GANONS_TOWER]) == 0) {
GetItemEntry getItemEntry = ItemTableManager::Instance->RetrieveItemEntry(MOD_RANDOMIZER, RG_GANONS_CASTLE_BOSS_KEY);
GiveItemEntryWithoutActor(gPlayState, getItemEntry);

View File

@ -406,8 +406,8 @@ void Entrance_SetSavewarpEntrance(void) {
}
void Entrance_SetWarpSongEntrance(void) {
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 5;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
switch (gPlayState->msgCtx.lastPlayedSong) {
case 0:
gPlayState->nextEntranceIndex = Entrance_OverrideNextIndex(0x0600); // Minuet
@ -428,7 +428,7 @@ void Entrance_SetWarpSongEntrance(void) {
gPlayState->nextEntranceIndex = Entrance_OverrideNextIndex(0x05F4); // Prelude
break;
default:
gPlayState->sceneLoadFlag = 0; // if something goes wrong, the animation plays normally
gPlayState->transitionTrigger = TRANS_TRIGGER_OFF; // if something goes wrong, the animation plays normally
}
// If one of the warp songs happens to lead to a grotto return, then we
@ -481,8 +481,8 @@ void Entrance_OverrideCutsceneEntrance(u16 cutsceneCmd) {
switch (cutsceneCmd) {
case 24: // Dropping a fish for Jabu Jabu
gPlayState->nextEntranceIndex = Entrance_OverrideNextIndex(newJabuJabusBellyEntrance);
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 2;
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
gPlayState->transitionType = TRANS_TYPE_FADE_BLACK;
// In case Jabu's mouth leads to a grotto return
Grotto_ForceGrottoReturnOnSpecialEntrance();
break;

View File

@ -161,12 +161,12 @@ s16 Grotto_OverrideSpecialEntrance(s16 nextEntranceIndex) {
if (gPlayState != NULL && gPlayState->nextEntranceIndex != -1) {
gSaveContext.respawnFlag = 2;
nextEntranceIndex = grotto.entranceIndex;
gPlayState->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
} else if (gPlayState == NULL) { // Handle spawn position when loading from a save file
gSaveContext.respawnFlag = 2;
nextEntranceIndex = grotto.entranceIndex;
gSaveContext.nextTransitionType = 3;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
// Otherwise return 0x7FFF and let the game handle it
} else {
nextEntranceIndex = 0x7FFF;

View File

@ -7594,7 +7594,7 @@ Vec3s Camera_Update(Camera* camera) {
D_8011D3F0--;
sCameraInterfaceFlags = 0x3200;
Camera_UpdateInterface(sCameraInterfaceFlags);
} else if (camera->play->transitionMode != 0) {
} else if (camera->play->transitionMode != TRANS_MODE_OFF) {
sCameraInterfaceFlags = 0xF200;
Camera_UpdateInterface(sCameraInterfaceFlags);
} else if (camera->play->csCtx.state != CS_STATE_IDLE) {

View File

@ -14,6 +14,6 @@ void SaveContext_Init(void) {
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.skyboxTime = 0;
gSaveContext.dogIsLost = true;
gSaveContext.nextTransitionType = 0xFF;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
gSaveContext.unk_13EE = 50;
}

View File

@ -168,7 +168,7 @@ void func_800645A0(PlayState* play, CutsceneContext* csCtx) {
gSaveContext.cutsceneTrigger = 1;
}
if ((gSaveContext.cutsceneTrigger != 0) && (play->sceneLoadFlag == 0x14)) {
if ((gSaveContext.cutsceneTrigger != 0) && (play->transitionTrigger == TRANS_TRIGGER_START)) {
gSaveContext.cutsceneTrigger = 0;
}
@ -409,7 +409,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
break;
case 32:
if (sp3F != 0) {
play->envCtx.sandstormState = 1;
play->envCtx.sandstormState = SANDSTORM_FILL;
}
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
break;
@ -506,7 +506,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
(CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) &&
(gSaveContext.fileNum != 0xFEDC) && (play->sceneLoadFlag == 0)) {
(gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
temp = 1;
}
@ -576,44 +576,44 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 1:
play->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 2:
play->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 10;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 3:
play->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 10;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 4:
play->nextEntranceIndex = 0x013D;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 10;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 5:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 10;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 6:
play->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 10;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 7:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 11;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_INSTANT;
break;
case 8:
if (CVarGetInteger("gBetterFW", 0)) {
@ -627,9 +627,9 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
if (!Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL)) {
Flags_SetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL);
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 11;
play->transitionType = TRANS_TYPE_INSTANT;
} else {
if (gSaveContext.sceneSetupIndex < 4) {
if (!LINK_IS_ADULT) {
@ -639,254 +639,254 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
}
}
play->nextEntranceIndex = 0x02CA;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 9:
play->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 12;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FILL_BROWN;
break;
case 10:
play->nextEntranceIndex = 0x00BB;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 11:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF3;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 12:
play->nextEntranceIndex = 0x047A;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 13:
play->nextEntranceIndex = 0x010E;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 14:
play->nextEntranceIndex = 0x0457;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 15:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 16:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 17:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 18:
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
play->nextEntranceIndex = 0x0324;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 19:
play->nextEntranceIndex = 0x013D;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
gSaveContext.cutsceneIndex = 0x8000;
break;
case 21:
play->nextEntranceIndex = 0x0102;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 22:
Item_Give(play, ITEM_SONG_REQUIEM);
play->nextEntranceIndex = 0x0123;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 23:
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF8;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 24:
play->nextEntranceIndex = 0x0028;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 25:
play->linkAgeOnLoad = 0;
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 26:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 27:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 28:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 29:
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.chamberCutsceneNum = 0;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 30:
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
Item_Give(play, ITEM_MEDALLION_FIRE);
gSaveContext.chamberCutsceneNum = 1;
break;
case 31:
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.chamberCutsceneNum = 2;
break;
case 32:
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x00CD;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
play->fadeTransition = 11;
play->transitionType = TRANS_TYPE_INSTANT;
break;
case 33:
play->nextEntranceIndex = 0x00CD;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 34:
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 35:
play->nextEntranceIndex = 0x00CD;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 38:
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 39:
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF9;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 40:
play->linkAgeOnLoad = 0;
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFFA;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 41:
play->nextEntranceIndex = 0x04E6;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 42:
play->nextEntranceIndex = 0x00DB;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 43:
play->nextEntranceIndex = 0x0503;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 44:
play->nextEntranceIndex = 0x0320;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 17;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
break;
case 46:
Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER);
play->nextEntranceIndex = 0x0324;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 47:
Item_Give(play, ITEM_SONG_NOCTURNE);
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_NOCTURNE_OF_SHADOW);
play->nextEntranceIndex = 0x00DB;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 48:
play->nextEntranceIndex = 0x01ED;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 15;
gSaveContext.nextTransitionType = 15;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_SANDSTORM_END;
gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_END;
break;
case 49:
play->nextEntranceIndex = 0x058C;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 50:
play->nextEntranceIndex = 0x0513;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 17;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
break;
case 51:
play->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF8;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 41;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_WHITE, TCS_SLOW);
break;
case 52:
play->nextEntranceIndex = 0x0053;
gSaveContext.cutsceneIndex = 0xFFF7;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 11;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_INSTANT;
break;
case 53:
play->nextEntranceIndex = 0x050F;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 54:
gSaveContext.gameMode = 3;
@ -894,104 +894,104 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 55:
play->nextEntranceIndex = 0x0129;
gSaveContext.cutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 56:
play->nextEntranceIndex = 0x00DB;
gSaveContext.cutsceneIndex = 0xFFF4;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 57:
play->nextEntranceIndex = 0x013D;
gSaveContext.cutsceneIndex = 0xFFF3;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 58:
play->nextEntranceIndex = 0x014D;
gSaveContext.cutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 59:
play->nextEntranceIndex = 0x0102;
gSaveContext.cutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 60:
play->nextEntranceIndex = 0x010E;
gSaveContext.cutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 61:
play->nextEntranceIndex = 0x0108;
gSaveContext.cutsceneIndex = 0xFFF0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 62:
play->linkAgeOnLoad = 0;
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF6;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 63:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF7;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 64:
play->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF5;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 65:
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0157;
gSaveContext.cutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 66:
play->nextEntranceIndex = 0x0554;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 67:
play->nextEntranceIndex = 0x027E;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 68:
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 69:
play->nextEntranceIndex = 0x05E8;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 70:
play->nextEntranceIndex = 0x013D;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 71:
gSaveContext.equips.equipment |= EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4);
@ -1000,57 +1000,57 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
Player_SetEquipmentData(play, player);
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 72:
play->nextEntranceIndex = 0x0400;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 73:
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 74:
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 75:
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 76:
play->linkAgeOnLoad = 0;
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 77:
play->linkAgeOnLoad = 1;
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 78:
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF7;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 79:
case 80:
@ -1068,38 +1068,38 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 92:
case 93:
play->nextEntranceIndex = 0x0157;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 94:
play->nextEntranceIndex = 0x02AE;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 95:
if ((Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) &&
(Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP))) {
play->nextEntranceIndex = 0x0053;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
} else {
switch (gSaveContext.sceneSetupIndex) {
case 8:
play->nextEntranceIndex = 0x00FC;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 9:
play->nextEntranceIndex = 0x0147;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 10:
play->nextEntranceIndex = 0x0102;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
}
}
@ -1107,130 +1107,130 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 96:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 5;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
} else {
Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION);
play->nextEntranceIndex = 0x0610;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 97:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
play->nextEntranceIndex = 0x006B;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 5;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
} else {
play->nextEntranceIndex = 0x0580;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 98:
play->nextEntranceIndex = 0x0564;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 99:
play->nextEntranceIndex = 0x0608;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 100:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF8;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 101:
play->nextEntranceIndex = 0x01F5;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 15;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_SANDSTORM_END;
break;
case 102:
play->nextEntranceIndex = 0x0590;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 103:
play->nextEntranceIndex = 0x00CD;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 104:
switch (sTitleCsState) {
case 0:
play->nextEntranceIndex = 0x008D;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState++;
break;
case 1:
play->nextEntranceIndex = 0x0147;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState++;
break;
case 2:
play->nextEntranceIndex = 0x00A0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState = 0;
break;
}
break;
case 105:
play->nextEntranceIndex = 0x00E4;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 106:
play->nextEntranceIndex = 0x0574;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 107:
play->nextEntranceIndex = 0x0538;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 108:
play->nextEntranceIndex = 0x053C;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 109:
play->nextEntranceIndex = 0x0540;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 110:
play->nextEntranceIndex = 0x0544;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 111:
play->nextEntranceIndex = 0x0548;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 112:
play->nextEntranceIndex = 0x054C;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 113:
if (Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_FOREST_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_WATER_TRIAL) && Flags_GetEventChkInf(EVENTCHKINF_COMPLETED_SHADOW_TRIAL) &&
@ -1247,26 +1247,26 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
break;
case 114:
play->nextEntranceIndex = 0x0185;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 115:
play->nextEntranceIndex = 0x0594;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 116:
if (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_SPIRIT_MEDALLION)) {
play->nextEntranceIndex = 0x0580;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
} else {
play->nextEntranceIndex = 0x0610;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
}
gSaveContext.nextTransitionType = 3;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 117:
gSaveContext.gameMode = 3;
@ -1274,21 +1274,21 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->linkAgeOnLoad = 0;
play->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF7;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 118:
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517;
Play_TriggerVoidOut(play);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransitionType = 2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 119:
gSaveContext.dayTime = 0x8000;
gSaveContext.skyboxTime = 0x8000;
play->nextEntranceIndex = 0x05F0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
break;
}

View File

@ -39,16 +39,16 @@ Gfx __sCircleDList[] = {
void TransitionCircle_Start(void* thisx) {
TransitionCircle* this = (TransitionCircle*)thisx;
this->isDone = 0;
this->isDone = false;
switch (this->effect) {
case 1:
switch (this->appearanceType) {
case TCA_WAVE:
this->texture = sTransCircleWaveTex;
break;
case 2:
case TCA_RIPPLE:
this->texture = sTransCircleRippleTex;
break;
case 3:
case TCA_STARBURST:
this->texture = sTransCircleStarburstTex;
break;
default:
@ -56,34 +56,34 @@ void TransitionCircle_Start(void* thisx) {
break;
}
if (this->speed == 0) {
this->step = 0x14;
if (this->speedType == TCS_FAST) {
this->speed = 20;
} else {
this->step = 0xA;
this->speed = 10;
}
if (this->typeColor == 0) {
if (this->colorType == TCC_BLACK) {
this->color.rgba = RGBA8(0, 0, 0, 255);
} else if (this->typeColor == 1) {
} else if (this->colorType == TCC_WHITE) {
this->color.rgba = RGBA8(160, 160, 160, 255);
} else if (this->typeColor == 2) {
} else if (this->colorType == TCC_GRAY) {
// yes, really.
this->color.r = 100;
this->color.g = 100;
this->color.b = 100;
this->color.a = 255;
} else {
this->step = 0x28;
this->color.rgba = this->effect == 1 ? RGBA8(0, 0, 0, 255) : RGBA8(160, 160, 160, 255);
this->speed = 40;
this->color.rgba = this->appearanceType == TCA_WAVE ? RGBA8(0, 0, 0, 255) : RGBA8(160, 160, 160, 255);
}
if (this->unk_14 != 0) {
if (this->direction != 0) {
this->texY = 0;
if (this->typeColor == 3) {
if (this->colorType == TCC_SPECIAL) {
this->texY = 0xFA;
}
} else {
this->texY = 0x1F4;
if (this->effect == 2) {
if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_OUT, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
}
@ -106,28 +106,28 @@ void TransitionCircle_Update(void* thisx, s32 updateRate) {
s32 temp_t2;
s32 temp_t3;
if (this->unk_14 != 0) {
if (this->direction != 0) {
if (this->texY == 0) {
if (this->effect == 2) {
if (this->appearanceType == TCA_RIPPLE) {
Audio_PlaySoundGeneral(NA_SE_OC_SECRET_WARP_IN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
}
this->texY += this->step * 3 / updateRate;
this->texY += this->speed * 3 / updateRate;
if (this->texY >= 0x1F4) {
this->texY = 0x1F4;
this->isDone = 1;
this->isDone = true;
}
} else {
this->texY -= this->step * 3 / updateRate;
if (this->typeColor != 3) {
this->texY -= this->speed * 3 / updateRate;
if (this->colorType != TCC_SPECIAL) {
if (this->texY <= 0) {
this->texY = 0;
this->isDone = 1;
this->isDone = true;
}
} else {
if (this->texY < 0xFB) {
this->texY = 0xFA;
this->isDone = 1;
this->isDone = true;
}
}
}
@ -194,15 +194,17 @@ s32 TransitionCircle_IsDone(void* thisx) {
void TransitionCircle_SetType(void* thisx, s32 type) {
TransitionCircle* this = (TransitionCircle*)thisx;
if (type & 0x80) {
this->unk_14 = (type >> 5) & 0x1;
this->typeColor = (type >> 3) & 0x3;
this->speed = type & 0x1;
this->effect = (type >> 1) & 0x3;
if (type & TC_SET_PARAMS) {
// SetType is called twice for circles, the actual direction value will be set on the second call.
// The direction set here will be overwritten on that second call.
this->direction = (type >> 5) & 0x1;
this->colorType = (type >> 3) & 0x3;
this->speedType = type & 0x1;
this->appearanceType = (type >> 1) & 0x3;
} else if (type == 1) {
this->unk_14 = 1;
this->direction = 1;
} else {
this->unk_14 = 0;
this->direction = 0;
}
}

View File

@ -64,18 +64,18 @@ void TransitionWipe_Destroy(void* thisx) {
void TransitionWipe_Update(void* thisx, s32 updateRate) {
TransitionWipe* this = (TransitionWipe*)thisx;
u8 unk1419;
u8 speed;
if (this->direction != 0) {
unk1419 = gSaveContext.transWipeSpeed;
this->texY += (unk1419 * 3) / updateRate;
speed = gSaveContext.transWipeSpeed;
this->texY += (speed * 3) / updateRate;
if (this->texY >= 0x264) {
this->texY = 0x264;
this->isDone = 1;
}
} else {
unk1419 = gSaveContext.transWipeSpeed;
this->texY -= (unk1419 * 3) / updateRate;
speed = gSaveContext.transWipeSpeed;
this->texY -= (speed * 3) / updateRate;
if (this->texY < 0x14E) {
this->texY = 0x14D;
this->isDone = 1;

View File

@ -13,7 +13,7 @@ void KaleidoSetup_Update(PlayState* play) {
Input* input = &play->state.input[0];
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
play->sceneLoadFlag == 0 && play->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 &&
play->transitionTrigger == TRANS_TRIGGER_OFF && play->transitionMode == TRANS_MODE_OFF && gSaveContext.cutsceneIndex < 0xFFF0 &&
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) &&
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY && gSaveContext.magicState != MAGIC_STATE_FILL &&
(play->sceneNum != SCENE_BOMBCHU_BOWLING_ALLEY || !Flags_GetSwitch(play, 0x38))) {

View File

@ -289,7 +289,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
envCtx->skyboxFilterColor[1] = 0;
envCtx->skyboxFilterColor[2] = 0;
envCtx->skyboxFilterColor[3] = 0;
envCtx->sandstormState = 0;
envCtx->sandstormState = SANDSTORM_OFF;
envCtx->sandstormPrimA = 0;
envCtx->sandstormEnvA = 0;
@ -925,7 +925,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
if ((pauseCtx->state == 0) && (gameOverCtx->state == GAMEOVER_INACTIVE)) {
if (((msgCtx->msgLength == 0) && (msgCtx->msgMode == 0)) || (((void)0, gSaveContext.gameMode) == 3)) {
if ((envCtx->unk_1A == 0) && !FrameAdvance_IsEnabled(play) &&
(play->transitionMode == 0 || ((void)0, gSaveContext.gameMode) != 0)) {
(play->transitionMode == TRANS_MODE_OFF || ((void)0, gSaveContext.gameMode) != 0)) {
if (IS_DAY || gTimeIncrement >= 0x190) {
gSaveContext.dayTime += gTimeIncrement;
@ -2336,7 +2336,7 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
Environment_PatchSandstorm(play);
switch (sandstormState) {
case 3:
case SANDSTORM_ACTIVE:
if ((play->sceneNum == SCENE_HAUNTED_WASTELAND) && (play->roomCtx.curRoom.num == 0)) {
envA1 = 0;
primA1 = (play->envCtx.sandstormEnvA > 128) ? 255 : play->envCtx.sandstormEnvA >> 1;
@ -2349,11 +2349,11 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
envA1 = 128;
}
break;
case 1:
case SANDSTORM_FILL:
primA1 = 255;
envA1 = (play->envCtx.sandstormPrimA >= 255) ? 255 : 128;
break;
case 2:
case SANDSTORM_UNFILL:
envA1 = 128;
if (play->envCtx.sandstormEnvA > 128) {
primA1 = 0xFF;
@ -2365,15 +2365,15 @@ void Environment_DrawSandstorm(PlayState* play, u8 sandstormState) {
primA1 += 73;
}
if ((primA1 >= primA) && (primA1 != 255)) {
play->envCtx.sandstormState = 3;
play->envCtx.sandstormState = SANDSTORM_ACTIVE;
}
break;
case 4:
case SANDSTORM_DISSIPATE:
envA1 = 0;
primA1 = (play->envCtx.sandstormEnvA > 128) ? 255 : play->envCtx.sandstormEnvA >> 1;
if (primA == 0) {
play->envCtx.sandstormState = 0;
play->envCtx.sandstormState = SANDSTORM_OFF;
}
break;
}
@ -2541,9 +2541,9 @@ void Environment_WarpSongLeave(PlayState* play) {
gSaveContext.cutsceneIndex = 0;
gSaveContext.respawnFlag = -3;
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
switch (play->nextEntranceIndex) {
case 0x147:

View File

@ -893,7 +893,7 @@ void func_80083108(PlayState* play) {
Interface_ChangeAlpha(6);
}
if (play->transitionMode != 0) {
if (play->transitionMode != TRANS_MODE_OFF) {
Interface_ChangeAlpha(1);
} else if (gSaveContext.minigameState == 1) {
Interface_ChangeAlpha(8);
@ -1344,7 +1344,7 @@ void func_80083108(PlayState* play) {
if (sp28) {
gSaveContext.unk_13EA = 0;
if ((play->sceneLoadFlag == 0) && (play->transitionMode == 0)) {
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
Interface_ChangeAlpha(50);
osSyncPrintf("???????? alpha_change( 50 ); ?????\n");
} else {
@ -3463,7 +3463,7 @@ void Interface_UpdateMagicBar(PlayState* play) {
case MAGIC_STATE_CONSUME_LENS:
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->sceneLoadFlag == 0) && (play->transitionMode == 0) && !Play_InCsMode(play)) {
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {
bool hasLens = false;
for (int buttonIndex = 1; buttonIndex < (CVarGetInteger("gDpadEquips", 0) != 0) ? ARRAY_COUNT(gSaveContext.equips.buttonItems) : 4; buttonIndex++) {
if (gSaveContext.equips.buttonItems[buttonIndex] == ITEM_LENS) {
@ -5788,8 +5788,8 @@ void Interface_Draw(PlayState* play) {
// Trade quest timer reached 0
D_8015FFE6 = 40;
gSaveContext.cutsceneIndex = 0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.timer2State = 0;
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
@ -5824,8 +5824,8 @@ void Interface_Draw(PlayState* play) {
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
!(player->stateFlags2 & 0x01000000) && (play->sceneLoadFlag == 0) &&
(play->transitionMode == 0) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
!(player->stateFlags2 & 0x01000000) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (gSaveContext.minigameState != 1) &&
(play->shootingGalleryStatus <= 1) &&
!((play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38))) {
svar6 = 0;
@ -6516,8 +6516,8 @@ void Interface_Update(PlayState* play) {
HealthMeter_Update(play);
if ((gSaveContext.timer1State >= 3) && (play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & 0x01000000) && (play->sceneLoadFlag == 0) &&
(play->transitionMode == 0) && !Play_InCsMode(play)) {}
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & 0x01000000) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) {}
if (gSaveContext.rupeeAccumulator != 0) {
if (gSaveContext.rupeeAccumulator > 0) {
@ -6612,8 +6612,8 @@ void Interface_Update(PlayState* play) {
WREG(7) = interfaceCtx->unk_1F4;
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->sceneLoadFlag == 0) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionMode == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionMode == TRANS_MODE_OFF) &&
((play->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(play))) {
if ((gSaveContext.isMagicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
gSaveContext.magicLevel = gSaveContext.isDoubleMagicAcquired + 1;
@ -6710,19 +6710,19 @@ void Interface_Update(PlayState* play) {
(interfaceCtx->restrictions.sunsSong != 3)) {
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) {
gSaveContext.nextDayTime = 0;
play->fadeTransition = 4;
gSaveContext.nextTransitionType = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
play->unk_11DE9 = 1;
} else {
gSaveContext.nextDayTime = 0x8001;
play->fadeTransition = 5;
gSaveContext.nextTransitionType = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
play->unk_11DE9 = 1;
}
if (play->sceneNum == SCENE_HAUNTED_WASTELAND) {
play->fadeTransition = 14;
gSaveContext.nextTransitionType = 14;
play->transitionType = TRANS_TYPE_SANDSTORM_PERSIST;
gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_PERSIST;
}
gSaveContext.respawnFlag = -2;
@ -6733,7 +6733,7 @@ void Interface_Update(PlayState* play) {
Grotto_ForceGrottoReturn();
}
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
func_800F6964(30);
gSaveContext.seqId = (u8)NA_BGM_DISABLED;

View File

@ -72,13 +72,14 @@ void func_800BC590(PlayState* play) {
}
}
void func_800BC5E0(PlayState* play, s32 transitionType) {
void Gameplay_SetupTransition(PlayState* play, s32 transitionType) {
TransitionContext* transitionCtx = &play->transitionCtx;
memset(transitionCtx,0, sizeof(TransitionContext));
transitionCtx->transitionType = transitionType;
// Circle Transition Types
if ((transitionCtx->transitionType >> 5) == 1) {
transitionCtx->init = TransitionCircle_Init;
transitionCtx->destroy = TransitionCircle_Destroy;
@ -91,7 +92,7 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
} else {
switch (transitionCtx->transitionType) {
case 1:
case TRANS_TYPE_TRIFORCE:
transitionCtx->init = TransitionTriforce_Init;
transitionCtx->destroy = TransitionTriforce_Destroy;
transitionCtx->start = TransitionTriforce_Start;
@ -102,8 +103,8 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
transitionCtx->setColor = TransitionTriforce_SetColor;
transitionCtx->setEnvColor = NULL;
break;
case 0:
case 8:
case TRANS_TYPE_WIPE:
case TRANS_TYPE_WIPE_FAST:
transitionCtx->init = TransitionWipe_Init;
transitionCtx->destroy = TransitionWipe_Destroy;
transitionCtx->start = TransitionWipe_Start;
@ -114,16 +115,16 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
transitionCtx->setColor = TransitionWipe_SetColor;
transitionCtx->setEnvColor = NULL;
break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 13:
case 17:
case 18:
case 19:
case TRANS_TYPE_FADE_BLACK:
case TRANS_TYPE_FADE_WHITE:
case TRANS_TYPE_FADE_BLACK_FAST:
case TRANS_TYPE_FADE_WHITE_FAST:
case TRANS_TYPE_FADE_BLACK_SLOW:
case TRANS_TYPE_FADE_WHITE_SLOW:
case TRANS_TYPE_FADE_WHITE_CS_DELAYED:
case TRANS_TYPE_FADE_WHITE_INSTANT:
case TRANS_TYPE_FADE_GREEN:
case TRANS_TYPE_FADE_BLUE:
transitionCtx->init = TransitionFade_Init;
transitionCtx->destroy = TransitionFade_Destroy;
transitionCtx->start = TransitionFade_Start;
@ -134,24 +135,24 @@ void func_800BC5E0(PlayState* play, s32 transitionType) {
transitionCtx->setColor = TransitionFade_SetColor;
transitionCtx->setEnvColor = NULL;
break;
case 9:
case 10:
play->transitionMode = 4;
case TRANS_TYPE_FILL_WHITE2:
case TRANS_TYPE_FILL_WHITE:
play->transitionMode = TRANS_MODE_FILL_WHITE_INIT;
break;
case 11:
play->transitionMode = 10;
case TRANS_TYPE_INSTANT:
play->transitionMode = TRANS_MODE_INSTANT;
break;
case 12:
play->transitionMode = 7;
case TRANS_TYPE_FILL_BROWN:
play->transitionMode = TRANS_MODE_FILL_BROWN_INIT;
break;
case 14:
play->transitionMode = 12;
case TRANS_TYPE_SANDSTORM_PERSIST:
play->transitionMode = TRANS_MODE_SANDSTORM_INIT;
break;
case 15:
play->transitionMode = 14;
case TRANS_TYPE_SANDSTORM_END:
play->transitionMode = TRANS_MODE_SANDSTORM_END_INIT;
break;
case 16:
play->transitionMode = 16;
case TRANS_TYPE_CS_BLACK_FILL:
play->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT;
break;
default:
Fault_AddHungupAndCrash(__FILE__, __LINE__);
@ -200,10 +201,10 @@ void Play_Destroy(GameState* thisx) {
gTrnsnUnkState = 0;
}
if (play->transitionMode == 3) {
if (play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) {
play->transitionCtx.destroy(&play->transitionCtx.data);
func_800BC88C(play);
play->transitionMode = 0;
play->transitionMode = TRANS_MODE_OFF;
}
ShrinkWindow_Destroy();
@ -229,7 +230,7 @@ void GivePlayerRandoRewardSongOfTime(PlayState* play, RandomizerCheck check) {
Player* player = GET_PLAYER(play);
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(play, player) &&
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == 0xFF && !gSaveContext.pendingIceTrapCount) {
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT && !gSaveContext.pendingIceTrapCount) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemEntryWithoutActor(play, getItemEntry);
player->pendingFlag.flagID = 0x1F;
@ -442,7 +443,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(PlayState* play, RandomizerCheck
if (meetsRequirements && LINK_IS_ADULT &&
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TEMPLE_OF_TIME) &&
!Flags_GetTreasure(play, 0x1E) && player != NULL && !Player_InBlockingCsMode(play, player) &&
play->sceneLoadFlag == 0) {
play->transitionTrigger == TRANS_TRIGGER_OFF) {
GetItemEntry getItem = Randomizer_GetItemFromKnownCheck(check, GI_ARROW_LIGHT);
if (GiveItemEntryWithoutActor(play, getItem)) {
player->pendingFlag.flagID = 0x1E;
@ -624,12 +625,12 @@ void Play_Init(GameState* thisx) {
PreRender_SetValuesSave(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0);
PreRender_SetValues(&play->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
gTrnsnUnkState = 0;
play->transitionMode = 0;
play->transitionMode = TRANS_MODE_OFF;
if (CVarGetInteger("gSceneTransitions", 255)!= 255){
play->transitionMode = CVarGetInteger("gSceneTransitions", 0);
gSaveContext.nextTransitionType = CVarGetInteger("gSceneTransitions", 0);
play->fadeTransition = CVarGetInteger("gSceneTransitions", 0);
play->transitionType = CVarGetInteger("gSceneTransitions", 0);
}
FrameAdvance_Init(&play->frameAdvCtx);
@ -637,21 +638,21 @@ void Play_Init(GameState* thisx) {
Matrix_Init(&play->state);
play->state.main = Play_Main;
play->state.destroy = Play_Destroy;
play->sceneLoadFlag = -0x14;
play->transitionTrigger = TRANS_TRIGGER_END;
play->unk_11E16 = 0xFF;
play->unk_11E18 = 0;
play->unk_11DE9 = 0;
if (gSaveContext.gameMode != 1) {
if (gSaveContext.nextTransitionType == 0xFF) {
play->fadeTransition =
if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) {
play->transitionType =
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In
} else {
play->fadeTransition = gSaveContext.nextTransitionType;
gSaveContext.nextTransitionType = 0xFF;
play->transitionType = gSaveContext.nextTransitionType;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
}
} else {
play->fadeTransition = 6;
play->transitionType = TRANS_TYPE_FADE_BLACK_SLOW;
}
ShrinkWindow_Init();
@ -808,8 +809,8 @@ void Play_Update(PlayState* play) {
gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
if (FrameAdvance_Update(&play->frameAdvCtx, &input[1])) {
if ((play->transitionMode == 0) && (play->sceneLoadFlag != 0)) {
play->transitionMode = 1;
if ((play->transitionMode == TRANS_MODE_OFF) && (play->transitionTrigger != TRANS_TRIGGER_OFF)) {
play->transitionMode = TRANS_MODE_SETUP;
}
// Gameplay stats: Count button presses
@ -858,8 +859,8 @@ void Play_Update(PlayState* play) {
if (play->transitionMode) {
switch (play->transitionMode) {
case 1:
if (play->sceneLoadFlag != -0x14) {
case TRANS_MODE_SETUP:
if (play->transitionTrigger != TRANS_TRIGGER_END) {
s16 sp6E = 0;
Interface_ChangeAlpha(1);
@ -870,7 +871,7 @@ void Play_Update(PlayState* play) {
if (!(gEntranceTable[play->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off
// "Sound initalized. 111"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");
if ((play->fadeTransition < 56) && !Environment_IsForcedSequenceDisabled()) {
if ((play->transitionType < TRANS_TYPE_MAX) && !Environment_IsForcedSequenceDisabled()) {
// "Sound initalized. 222"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。222");
func_800F6964(0x14);
@ -880,58 +881,59 @@ void Play_Update(PlayState* play) {
}
}
if (CREG(11) == 0) {
func_800BC5E0(play, play->fadeTransition);
if (!R_TRANS_DBG_ENABLED) {
Gameplay_SetupTransition(play, play->transitionType);
} else {
func_800BC5E0(play, CREG(12));
Gameplay_SetupTransition(play, R_TRANS_DBG_TYPE);
}
if (play->transitionMode >= 4) {
if (play->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) {
break;
}
case 2:
case TRANS_MODE_INSTANCE_INIT:
play->transitionCtx.init(&play->transitionCtx.data);
// Circle Transition Types
if ((play->transitionCtx.transitionType >> 5) == 1) {
play->transitionCtx.setType(&play->transitionCtx.data,
play->transitionCtx.transitionType | 0x80);
play->transitionCtx.transitionType | TC_SET_PARAMS);
}
gSaveContext.transWipeSpeed = 14;
if ((play->transitionCtx.transitionType == 8) ||
(play->transitionCtx.transitionType == 9)) {
if ((play->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) {
gSaveContext.transWipeSpeed = 28;
}
gSaveContext.transFadeDuration = 60;
if ((play->transitionCtx.transitionType == 4) ||
(play->transitionCtx.transitionType == 5)) {
if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) {
gSaveContext.transFadeDuration = 20;
} else if ((play->transitionCtx.transitionType == 6) ||
(play->transitionCtx.transitionType == 7)) {
} else if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_SLOW) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW)) {
gSaveContext.transFadeDuration = 150;
} else if (play->transitionCtx.transitionType == 17) {
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT) {
gSaveContext.transFadeDuration = 2;
}
if ((play->transitionCtx.transitionType == 3) ||
(play->transitionCtx.transitionType == 5) ||
(play->transitionCtx.transitionType == 7) ||
(play->transitionCtx.transitionType == 13) ||
(play->transitionCtx.transitionType == 17)) {
if ((play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) ||
(play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) {
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(160, 160, 160, 255));
if (play->transitionCtx.setEnvColor != NULL) {
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
RGBA8(160, 160, 160, 255));
}
} else if (play->transitionCtx.transitionType == 18) {
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) {
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(140, 140, 100, 255));
if (play->transitionCtx.setEnvColor != NULL) {
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
RGBA8(140, 140, 100, 255));
}
} else if (play->transitionCtx.transitionType == 19) {
} else if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) {
play->transitionCtx.setColor(&play->transitionCtx.data, RGBA8(70, 100, 110, 255));
if (play->transitionCtx.setEnvColor != NULL) {
play->transitionCtx.setEnvColor(&play->transitionCtx.data,
@ -944,7 +946,7 @@ void Play_Update(PlayState* play) {
}
}
if (play->sceneLoadFlag == -0x14) {
if (play->transitionTrigger == TRANS_TRIGGER_END) {
play->transitionCtx.setType(&play->transitionCtx.data, 1);
} else {
play->transitionCtx.setType(&play->transitionCtx.data, 2);
@ -952,22 +954,22 @@ void Play_Update(PlayState* play) {
play->transitionCtx.start(&play->transitionCtx);
if (play->transitionCtx.transitionType == 13) {
play->transitionMode = 11;
if (play->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) {
play->transitionMode = TRANS_MODE_INSTANCE_WAIT;
} else {
play->transitionMode = 3;
play->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
}
break;
case 3:
case TRANS_MODE_INSTANCE_RUNNING:
if (play->transitionCtx.isDone(&play->transitionCtx) != 0) {
if (play->transitionCtx.transitionType >= 56) {
if (play->sceneLoadFlag == -0x14) {
if (play->transitionCtx.transitionType >= TRANS_TYPE_MAX) {
if (play->transitionTrigger == TRANS_TRIGGER_END) {
play->transitionCtx.destroy(&play->transitionCtx);
func_800BC88C(play);
play->transitionMode = 0;
play->transitionMode = TRANS_MODE_OFF;
}
} else if (play->sceneLoadFlag != -0x14) {
} else if (play->transitionTrigger != TRANS_TRIGGER_END) {
play->state.running = 0;
if (gSaveContext.gameMode != 2) {
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
@ -981,7 +983,7 @@ void Play_Update(PlayState* play) {
} else {
play->transitionCtx.destroy(&play->transitionCtx);
func_800BC88C(play);
play->transitionMode = 0;
play->transitionMode = TRANS_MODE_OFF;
if (gTrnsnUnkState == 3) {
TransitionUnk_Destroy(&sTrnsnUnk);
gTrnsnUnkState = 0;
@ -991,7 +993,7 @@ void Play_Update(PlayState* play) {
// Transition end for standard transitions
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
}
play->sceneLoadFlag = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
} else {
play->transitionCtx.update(&play->transitionCtx.data, R_UPDATE_RATE);
}
@ -999,104 +1001,104 @@ void Play_Update(PlayState* play) {
}
switch (play->transitionMode) {
case 4:
case TRANS_MODE_FILL_WHITE_INIT:
D_801614C8 = 0;
play->envCtx.fillScreen = true;
play->envCtx.screenFillColor[0] = 160;
play->envCtx.screenFillColor[1] = 160;
play->envCtx.screenFillColor[2] = 160;
if (play->sceneLoadFlag != -0x14) {
if (play->transitionTrigger != TRANS_TRIGGER_END) {
play->envCtx.screenFillColor[3] = 0;
play->transitionMode = 5;
play->transitionMode = TRANS_MODE_FILL_IN;
} else {
play->envCtx.screenFillColor[3] = 255;
play->transitionMode = 6;
play->transitionMode = TRANS_MODE_FILL_OUT;
}
break;
case 5:
case TRANS_MODE_FILL_IN:
play->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f;
if (D_801614C8 >= 20 && 1) {
play->state.running = 0;
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
gSaveContext.entranceIndex = play->nextEntranceIndex;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
} else {
D_801614C8++;
}
break;
case 6:
case TRANS_MODE_FILL_OUT:
play->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
if (D_801614C8 >= 20 && 1) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
play->envCtx.fillScreen = false;
} else {
D_801614C8++;
}
break;
case 7:
case TRANS_MODE_FILL_BROWN_INIT:
D_801614C8 = 0;
play->envCtx.fillScreen = true;
play->envCtx.screenFillColor[0] = 170;
play->envCtx.screenFillColor[1] = 160;
play->envCtx.screenFillColor[2] = 150;
if (play->sceneLoadFlag != -0x14) {
if (play->transitionTrigger != TRANS_TRIGGER_END) {
play->envCtx.screenFillColor[3] = 0;
play->transitionMode = 5;
play->transitionMode = TRANS_MODE_FILL_IN;
} else {
play->envCtx.screenFillColor[3] = 255;
play->transitionMode = 6;
play->transitionMode = TRANS_MODE_FILL_OUT;
}
break;
case 10:
if (play->sceneLoadFlag != -0x14) {
case TRANS_MODE_INSTANT:
if (play->transitionTrigger != TRANS_TRIGGER_END) {
play->state.running = 0;
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
gSaveContext.entranceIndex = play->nextEntranceIndex;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
} else {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
}
break;
case 11:
case TRANS_MODE_INSTANCE_WAIT:
if (gSaveContext.cutsceneTransitionControl != 0) {
play->transitionMode = 3;
play->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
}
break;
case 12:
if (play->sceneLoadFlag != -0x14) {
play->envCtx.sandstormState = 1;
play->transitionMode = 13;
case TRANS_MODE_SANDSTORM_INIT:
if (play->transitionTrigger != TRANS_TRIGGER_END) {
play->envCtx.sandstormState = SANDSTORM_FILL;
play->transitionMode = TRANS_MODE_SANDSTORM;
} else {
play->envCtx.sandstormState = 2;
play->envCtx.sandstormState = SANDSTORM_UNFILL;
play->envCtx.sandstormPrimA = 255;
play->envCtx.sandstormEnvA = 255;
play->transitionMode = 13;
play->transitionMode = TRANS_MODE_SANDSTORM;
}
break;
case 13:
case TRANS_MODE_SANDSTORM:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
if (play->sceneLoadFlag == -0x14) {
if (play->transitionTrigger == TRANS_TRIGGER_END) {
if (play->envCtx.sandstormPrimA < 110) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
// Transition end for sandstorm effect (delayed until effect is finished)
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
@ -1106,34 +1108,34 @@ void Play_Update(PlayState* play) {
play->state.running = 0;
SET_NEXT_GAMESTATE(&play->state, Play_Init, PlayState);
gSaveContext.entranceIndex = play->nextEntranceIndex;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
}
}
break;
case 14:
if (play->sceneLoadFlag == -0x14) {
play->envCtx.sandstormState = 4;
case TRANS_MODE_SANDSTORM_END_INIT:
if (play->transitionTrigger == TRANS_TRIGGER_END) {
play->envCtx.sandstormState = SANDSTORM_DISSIPATE;
play->envCtx.sandstormPrimA = 255;
play->envCtx.sandstormEnvA = 255;
// "It's here!!!!!!!!!"
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!");
play->transitionMode = 15;
play->transitionMode = TRANS_MODE_SANDSTORM_END;
} else {
play->transitionMode = 12;
play->transitionMode = TRANS_MODE_SANDSTORM_INIT;
}
break;
case 15:
case TRANS_MODE_SANDSTORM_END:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
if (play->sceneLoadFlag == -0x14) {
if (play->transitionTrigger == TRANS_TRIGGER_END) {
if (play->envCtx.sandstormPrimA <= 0) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
// Transition end for sandstorm effect (delayed until effect is finished)
GameInteractor_ExecuteOnTransitionEndHooks(play->sceneNum);
@ -1141,24 +1143,24 @@ void Play_Update(PlayState* play) {
}
break;
case 16:
case TRANS_MODE_CS_BLACK_FILL_INIT:
D_801614C8 = 0;
play->envCtx.fillScreen = true;
play->envCtx.screenFillColor[0] = 0;
play->envCtx.screenFillColor[1] = 0;
play->envCtx.screenFillColor[2] = 0;
play->envCtx.screenFillColor[3] = 255;
play->transitionMode = 17;
play->transitionMode = TRANS_MODE_CS_BLACK_FILL;
break;
case 17:
case TRANS_MODE_CS_BLACK_FILL:
if (gSaveContext.cutsceneTransitionControl != 0) {
play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl;
if (gSaveContext.cutsceneTransitionControl < 0x65) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
play->transitionMode = 0;
play->transitionTrigger = TRANS_TRIGGER_OFF;
play->transitionMode = TRANS_MODE_OFF;
}
}
break;
@ -1546,8 +1548,8 @@ void Play_Draw(PlayState* play) {
gSPDisplayList(OVERLAY_DISP++, gfxP);
gSPGrayscale(gfxP++, false);
if ((play->transitionMode == 3) || (play->transitionMode == 11) ||
(play->transitionCtx.transitionType >= 56)) {
if ((play->transitionMode == TRANS_MODE_INSTANCE_RUNNING) || (play->transitionMode == TRANS_MODE_INSTANCE_WAIT) ||
(play->transitionCtx.transitionType >= TRANS_TYPE_MAX)) {
View view;
View_Init(&view, gfxCtx);
@ -1709,7 +1711,7 @@ void Play_Draw(PlayState* play) {
}
if ((HREG(80) != 10) || (HREG(88) != 0)) {
if (play->envCtx.sandstormState != 0) {
if (play->envCtx.sandstormState != SANDSTORM_OFF) {
Environment_DrawSandstorm(play, play->envCtx.sandstormState);
}
}
@ -2253,14 +2255,14 @@ void Play_TriggerVoidOut(PlayState* play) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = play->actorCtx.flags.tempSwch;
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = play->actorCtx.flags.tempCollect;
gSaveContext.respawnFlag = 1;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
}
void Play_LoadToLastEntrance(PlayState* play) {
gSaveContext.respawnFlag = -1;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
if ((play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_INTERIOR) || (play->sceneNum == SCENE_GANONS_TOWER_COLLAPSE_EXTERIOR) ||
(play->sceneNum == SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) || (play->sceneNum == SCENE_GANON_BOSS)) {
@ -2273,7 +2275,7 @@ void Play_LoadToLastEntrance(PlayState* play) {
play->nextEntranceIndex = gSaveContext.entranceIndex;
}
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
}
void Play_TriggerRespawn(PlayState* play) {

View File

@ -573,7 +573,7 @@ uint8_t Player_IsCustomLinkModel() {
}
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->sceneLoadFlag == 0x14) ||
return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) ||
(this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) ||
((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0));
}

View File

@ -875,7 +875,7 @@ void func_800994A0(PlayState* play) {
}
}
play->fadeTransition = gEntranceTable[computedEntranceIndex].field & 0x7F; // Fade out
play->transitionType = gEntranceTable[computedEntranceIndex].field & 0x7F; // Fade out
}
// Scene Draw Config 0

View File

@ -226,8 +226,8 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) {
func_8002DF54(play, &player->actor, 8);
play->nextEntranceIndex = 0x00CD;
gSaveContext.nextCutsceneIndex = 0xFFF1;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 4;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
} else if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 3000.0f, 0x7530)) {
play->envCtx.gloomySkyMode = 1;
}

View File

@ -1538,7 +1538,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) {
}
if (this->csTimer == 180) {
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
if ((IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE) || IS_BOSS_RUSH)) {
Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO);
play->nextEntranceIndex = 0x517;
@ -1546,7 +1546,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) {
else {
play->nextEntranceIndex = 0x43F;
}
play->fadeTransition = 5;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
}
break;

View File

@ -1858,8 +1858,8 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
case 20:
play->nextEntranceIndex = 0x6B;
gSaveContext.nextCutsceneIndex = 0xFFF2;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
play->linkAgeOnLoad = 1;
break;
}

View File

@ -873,8 +873,8 @@ void func_80986B2C(PlayState* play) {
} else {
play->nextEntranceIndex = 0xCD;
}
play->fadeTransition = 38;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
func_8002DF54(play, &player->actor, 8);
}
}
@ -913,9 +913,9 @@ void GivePlayerRandoRewardImpa(Actor* impa, PlayState* play, RandomizerCheck che
GiveItemEntryFromActor(impa, play, getItemEntry, 75.0f, 50.0f);
} else if (!Player_InBlockingCsMode(play, GET_PLAYER(play))) {
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY);
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
// In entrance rando have impa bring link back to the front of castle grounds
if (Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) {
play->nextEntranceIndex = 0x0138;

View File

@ -133,7 +133,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
player = GET_PLAYER(play);
if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) {
if ((this->actor.targetMode != 0) && (play->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) &&
if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & 0x80000000) &&
(player->unk_84F == 0)) {
destinationIdx = ((this->actor.params >> 0xC) & 7) - 1;
Play_SetupRespawnPoint(play, RESPAWN_MODE_RETURN, 0x4FF);

View File

@ -567,7 +567,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) {
this->warpTimer++;
if (sWarpTimerTarget < this->warpTimer && gSaveContext.nextCutsceneIndex == 0xFFEF) {
osSyncPrintf("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", play->sceneLoadFlag, 0x14);
osSyncPrintf("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", play->transitionTrigger, TRANS_TRIGGER_START);
if (play->sceneNum == SCENE_DODONGOS_CAVERN_BOSS) {
if (!Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) {
@ -615,9 +615,9 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) {
}
osSyncPrintf("\n\n\nおわりおわり");
play->sceneLoadFlag = 0x14;
play->fadeTransition = 7;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE_SLOW;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
Math_StepToF(&this->unk_194, 2.0f, 0.01f);
@ -721,8 +721,8 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, PlayState* play) {
Entrance_OverrideBlueWarp();
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 7;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE_SLOW;
}
Math_StepToF(&this->unk_194, 2.0f, 0.01f);
@ -946,9 +946,9 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
Entrance_OverrideBlueWarp();
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 7;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE_SLOW;
}
if (this->warpTimer >= 141) {
f32 screenFillAlpha;

View File

@ -55,7 +55,7 @@ void func_809FFDC8(EnEg* this, PlayState* play) {
Play_TriggerRespawn(play);
gSaveContext.respawnFlag = -2;
Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP);
play->fadeTransition = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
EnEg_PlayVoidOutSFX();
voided = true;
}

View File

@ -273,8 +273,8 @@ void EnGe1_KickPlayer(EnGe1* this, PlayState* play) {
Entrance_OverrideGeurdoGuardCapture();
}
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -656,8 +656,8 @@ void EnGe1_BeginGame_Archery(EnGe1* this, PlayState* play) {
Rupees_ChangeBy(-20);
play->nextEntranceIndex = 0x129;
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.eventInf[0] |= 0x100;
Flags_SetEventChkInf(EVENTCHKINF_PLAYED_HORSEBACK_ARCHERY);

View File

@ -263,8 +263,8 @@ void EnGe2_CaptureClose(EnGe2* this, PlayState* play) {
Entrance_OverrideGeurdoGuardCapture();
}
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -293,8 +293,8 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) {
Entrance_OverrideGeurdoGuardCapture();
}
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
}
}

View File

@ -1579,8 +1579,8 @@ void EnGeldB_Draw(Actor* thisx, PlayState* play) {
Entrance_OverrideGeurdoGuardCapture();
}
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
}
}
}

View File

@ -367,11 +367,11 @@ void EnHeishi1_Kick(EnHeishi1* this, PlayState* play) {
if (!this->loadStarted) {
Flags_SetEventChkInf(EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS);
play->nextEntranceIndex = 0x4FA;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
this->loadStarted = true;
sHeishi1PlayerIsCaught = false;
play->fadeTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
}
}
}

View File

@ -207,10 +207,10 @@ void func_80A55D00(EnHeishi3* this, PlayState* play) {
(this->respawnFlag == 0)) {
Flags_SetEventChkInf(EVENTCHKINF_CAUGHT_BY_CASTLE_GUARDS);
play->nextEntranceIndex = 0x47E; // Hyrule Castle from Guard Capture (outside)
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
this->respawnFlag = 1;
play->fadeTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
}
}

View File

@ -362,9 +362,9 @@ void EnHeishi4_MarketSneak(EnHeishi4* this, PlayState* play) {
} else {
play->nextEntranceIndex = 0x00CD; // HF Near bridge (OoT cutscene entrance) to not fall in the water
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
this->actionFunc = func_80A56614;
break;
case 1: //no

View File

@ -2510,8 +2510,8 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) {
if (sp20 != 1 && gSaveContext.minigameState != 3) {
gSaveContext.cutsceneIndex = 0;
play->nextEntranceIndex = 0x3B0;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 0x20;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
}
}

View File

@ -114,22 +114,22 @@ void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState*
if (gSaveContext.eventInf[0] & 0x40) {
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 6;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
play->fadeTransition = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
Environment_ForcePlaySequence(NA_BGM_INGO);
} else {
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 4;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
Environment_ForcePlaySequence(NA_BGM_INGO);
play->fadeTransition = 0x2E;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
}
} else {
play->nextEntranceIndex = 0x558;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 3;
play->fadeTransition = 0x20;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
}
DREG(25) = 0;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.timer1State = 0;
}
@ -294,22 +294,22 @@ void EnHorseGameCheck_FinishMalonRace(EnHorseGameCheckMalonRace* this, PlayState
if ((this->result == MALONRACE_SUCCESS) || (this->result == MALONRACE_TIME_UP)) {
gSaveContext.cutsceneIndex = 0;
play->nextEntranceIndex = 0x4CE;
play->fadeTransition = 0x2E;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
} else if (this->result == MALONRACE_FAILURE) {
gSaveContext.timer1Value = 240;
gSaveContext.timer1State = 0xF;
gSaveContext.cutsceneIndex = 0;
play->nextEntranceIndex = 0x4CE;
play->fadeTransition = 0x2E;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
// "not supported"
osSyncPrintf("En_HGC_Spot20_Ta_end():対応せず\n");
gSaveContext.cutsceneIndex = 0;
play->nextEntranceIndex = 0x157;
play->fadeTransition = 0x2E;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
}
}

View File

@ -425,15 +425,15 @@ void func_80A79AB4(EnIn* this, PlayState* play) {
}
}
void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 arg3) {
void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) {
s16 entrances[] = { 0x0558, 0x04CA, 0x0157 };
play->nextEntranceIndex = entrances[index];
if (index == 2) {
gSaveContext.nextCutsceneIndex = 0xFFF0;
}
play->fadeTransition = arg3;
play->sceneLoadFlag = 0x14;
play->transitionType = transitionType;
play->transitionTrigger = TRANS_TRIGGER_START;
func_8002DF54(play, &this->actor, 8);
Interface_ChangeAlpha(1);
if (index == 0) {
@ -641,7 +641,7 @@ void func_80A7A4BC(EnIn* this, PlayState* play) {
void func_80A7A4C8(EnIn* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
func_80A79BAC(this, play, 1, 0x20);
func_80A79BAC(this, play, 1, TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST));
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x000F) | 0x0001;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
Flags_UnsetInfTable(INFTABLE_A2);
@ -655,7 +655,7 @@ void func_80A7A4C8(EnIn* this, PlayState* play) {
void func_80A7A568(EnIn* this, PlayState* play) {
Player* player = GET_PLAYER(play);
s32 phi_a2;
s32 phi_a3;
s32 transitionType;
if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO) && (player->stateFlags1 & 0x800000)) {
Flags_SetInfTable(INFTABLE_AB);
@ -677,7 +677,7 @@ void func_80A7A568(EnIn* this, PlayState* play) {
(gSaveContext.eventInf[0] & ~0x10) | (((EnHorse*)GET_PLAYER(play)->rideActor)->type << 4);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 2;
phi_a2 = 2;
phi_a3 = 2;
transitionType = TRANS_TYPE_FADE_BLACK;
} else {
Audio_PlaySoundGeneral(NA_SE_SY_FOUND, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (!Flags_GetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO)) {
@ -688,9 +688,9 @@ void func_80A7A568(EnIn* this, PlayState* play) {
}
gSaveContext.eventInf[0] &= ~0xF;
phi_a2 = 0;
phi_a3 = 0x20;
transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
}
func_80A79BAC(this, play, phi_a2, phi_a3);
func_80A79BAC(this, play, phi_a2, transitionType);
play->msgCtx.stateTimer = 0;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
@ -722,7 +722,7 @@ void func_80A7A848(EnIn* this, PlayState* play) {
gSaveContext.eventInf[0] &= ~0xF;
this->actionFunc = func_80A7A4C8;
} else {
func_80A79BAC(this, play, 2, 0x26);
func_80A79BAC(this, play, 2, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 2;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
play->msgCtx.stateTimer = 0;
@ -747,7 +747,7 @@ void func_80A7A940(EnIn* this, PlayState* play) {
}
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actor.flags &= ~ACTOR_FLAG_WILL_TALK;
func_80A79BAC(this, play, 2, 0x26);
func_80A79BAC(this, play, 2, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x000F) | 0x0002;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
play->msgCtx.stateTimer = 0;
@ -871,8 +871,8 @@ void func_80A7AEF0(EnIn* this, PlayState* play) {
yaw = Math_Vec3f_Yaw(&pos, &player->actor.world.pos);
if (ABS(yaw) > 0x4000) {
play->nextEntranceIndex = 0x0476;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 5;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
this->actionFunc = func_80A7B018;
} else if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
play->msgCtx.stateTimer = 4;
@ -896,7 +896,7 @@ void func_80A7B024(EnIn* this, PlayState* play) {
Flags_SetEventChkInf(EVENTCHKINF_RENTED_HORSE_FROM_INGO);
Flags_SetInfTable(INFTABLE_AB);
}
func_80A79BAC(this, play, 0, 0x26);
func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
gSaveContext.eventInf[0] = gSaveContext.eventInf[0] & ~0xF;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
play->msgCtx.stateTimer = 4;

View File

@ -492,8 +492,8 @@ void func_80AA1150(EnMa1* this, PlayState* play) {
if (!IS_RANDO) {
play->nextEntranceIndex = 0x157;
gSaveContext.nextCutsceneIndex = 0xFFF1;
play->fadeTransition = 42;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
this->actionFunc = EnMa1_DoNothing;
} else {
// When rando'ed, skip the cutscene, play the chime, reset some flags,

View File

@ -117,8 +117,8 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
if (Message_ShouldAdvance(play)) {
play->nextEntranceIndex = 0x157;
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->fadeTransition = 0x26;
play->sceneLoadFlag = 0x14;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.eventInf[0] |= 0x400;
gSaveContext.timer1State = 0xF;
}

View File

@ -244,15 +244,15 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) {
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) {
if (play->sceneLoadFlag != 20) {
if (play->transitionTrigger != TRANS_TRIGGER_START) {
Audio_SetCutsceneFlag(0);
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
gSaveContext.gameMode = 2;
play->sceneLoadFlag = 20;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
}
this->copyrightAlphaStep = 15;
@ -404,15 +404,15 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) {
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B)) {
if (play->sceneLoadFlag != 20) {
if (play->transitionTrigger != TRANS_TRIGGER_START) {
Audio_SetCutsceneFlag(0);
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
gSaveContext.gameMode = 2;
play->sceneLoadFlag = 20;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
}
this->copyrightAlphaStep = 15;

View File

@ -73,7 +73,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, PlayState* play) {
Flags_UnsetEnv(play, 5); // clear storms env flag
if (((play->pauseCtx.state == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->msgCtx.msgLength == 0) && (!FrameAdvance_IsEnabled(play)) &&
((play->transitionMode == 0) || (gSaveContext.gameMode != 0))) ||
((play->transitionMode == TRANS_MODE_OFF) || (gSaveContext.gameMode != 0))) ||
(this->timer >= 250)) {
if (play->envCtx.indoors || play->envCtx.unk_1F != 1) {
this->timer--;

View File

@ -952,8 +952,8 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla
} else {
play->nextEntranceIndex = 0x1D1;
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 0x2E;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
return;
}

View File

@ -967,8 +967,8 @@ void func_80ACC00C(EnOwl* this, PlayState* play) {
} else {
play->nextEntranceIndex = 0x027E;
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
}
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaOwlCs);
@ -982,8 +982,8 @@ void func_80ACC00C(EnOwl* this, PlayState* play) {
} else {
play->nextEntranceIndex = 0x0554;
}
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_BLACK;
break;
}
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gDMTOwlCs);

View File

@ -468,7 +468,7 @@ void func_80B12460(EnSyatekiNiw* this, PlayState* play) {
case 6:
if (this->unk_25E == 1) {
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.entranceIndex;
play->shootingGalleryStatus = 0;
player->actor.freezeTimer = 20;

View File

@ -672,14 +672,14 @@ void func_80B15424(EnTa* this, PlayState* play) {
play->nextEntranceIndex = 0x5E4;
if (gSaveContext.eventInf[0] & 0x100) {
play->fadeTransition = 46;
gSaveContext.nextTransitionType = 3;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
} else {
play->fadeTransition = 38;
gSaveContext.nextTransitionType = 2;
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
}
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.eventInf[0] |= 0x400;
this->actionFunc = func_80B153D4;
this->unk_2CC = 22;

View File

@ -800,8 +800,8 @@ s32 EnZl4_CsAskName(EnZl4* this, PlayState* play) {
play->msgCtx.msgMode = MSGMODE_PAUSED;
play->nextEntranceIndex = 0xA0;
gSaveContext.nextCutsceneIndex = 0xFFF7;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
}
break;
}

View File

@ -173,9 +173,9 @@ void ItemOcarina_StartSoTCutscene(ItemOcarina* this, PlayState* play) {
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gHyruleFieldZeldaSongOfTimeCs);
gSaveContext.cutsceneTrigger = 1;
} else {
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
play->nextEntranceIndex = 0x050F;
gSaveContext.nextCutsceneIndex = 0;
}

View File

@ -2182,7 +2182,7 @@ void func_80834298(Player* this, PlayState* play) {
((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_SHIELDING)) &&
(gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) &&
(play->shootingGalleryStatus == 0) && (play->activeCamera == MAIN_CAM) &&
(play->sceneLoadFlag != 0x14) && (gSaveContext.timer1State != 10)) {
(play->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timer1State != 10)) {
func_80833DF8(this, play);
}
@ -3332,7 +3332,7 @@ s32 func_80836FAC(PlayState* play, Player* this, f32* arg2, s16* arg3, f32 arg4)
f32 temp_f14;
f32 temp_f12;
if ((this->unk_6AD != 0) || (play->sceneLoadFlag == 0x14) || (this->stateFlags1 & PLAYER_STATE1_LOADING)) {
if ((this->unk_6AD != 0) || (play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_LOADING)) {
*arg2 = 0.0f;
*arg3 = this->actor.shape.rot.y;
} else {
@ -4193,7 +4193,7 @@ void func_80838F5C(PlayState* play, Player* this) {
}
s32 func_80838FB8(PlayState* play, Player* this) {
if ((play->sceneLoadFlag == 0) && (this->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED)) {
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (this->stateFlags1 & PLAYER_STATE1_FLOOR_DISABLED)) {
func_80838F5C(play, this);
func_80832284(play, this, &gPlayerAnim_link_normal_landing_wait);
func_80832698(this, NA_SE_VO_LI_FALL_S);
@ -4233,7 +4233,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
if (this->actor.category == ACTORCAT_PLAYER) {
sp3C = 0;
if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (play->sceneLoadFlag == 0) && (this->csMode == 0) &&
if (!(this->stateFlags1 & PLAYER_STATE1_DEAD) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (this->csMode == 0) &&
!(this->stateFlags1 & PLAYER_STATE1_LOADING) &&
(((poly != NULL) && (sp3C = SurfaceType_GetSceneExitIndex(&play->colCtx, poly, bgId), sp3C != 0)) ||
(func_8083816C(D_808535E4) && (this->unk_A7A == 12)))) {
@ -4259,8 +4259,8 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
if (play->nextEntranceIndex == 0x7FFF) {
gSaveContext.respawnFlag = 2;
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
play->fadeTransition = 3;
gSaveContext.nextTransitionType = 3;
play->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
} else if (play->nextEntranceIndex >= 0x7FF9) {
// handle dynamic exits
if (IS_RANDO) {
@ -4280,7 +4280,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
gSaveContext.retainWeatherMode = 1;
func_800994A0(play);
}
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
}
if (!(this->stateFlags1 & (PLAYER_STATE1_ON_HORSE | PLAYER_STATE1_IN_CUTSCENE)) &&
@ -4326,7 +4326,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
return 1;
} else {
if (play->sceneLoadFlag == 0) {
if (play->transitionTrigger == TRANS_TRIGGER_OFF) {
if ((this->actor.world.pos.y < -4000.0f) ||
(((this->unk_A7A == 5) || (this->unk_A7A == 12)) &&
@ -4340,7 +4340,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId)
} else {
Play_TriggerVoidOut(play);
}
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
func_80078884(NA_SE_OC_ABYSS);
} else {
func_80838F5C(play, this);
@ -10897,7 +10897,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
}
} else {
if ((this->actor.parent == NULL) &&
((play->sceneLoadFlag == 0x14) || (this->unk_A87 != 0) || !func_808382DC(this, play))) {
((play->transitionTrigger == TRANS_TRIGGER_START) || (this->unk_A87 != 0) || !func_808382DC(this, play))) {
func_8083AA10(this, play);
} else {
this->fallStartHeight = this->actor.world.pos.y;
@ -12205,7 +12205,7 @@ s32 func_8084C9BC(Player* this, PlayState* play) {
}
}
if ((play->csCtx.state == CS_STATE_IDLE) && (play->transitionMode == 0) &&
if ((play->csCtx.state == CS_STATE_IDLE) && (play->transitionMode == TRANS_MODE_OFF) &&
(EN_HORSE_CHECK_1(rideActor) || EN_HORSE_CHECK_4(rideActor))) {
this->stateFlags2 |= PLAYER_STATE2_DO_ACTION_DOWN;
@ -12844,9 +12844,9 @@ s32 func_8084DFF4(PlayState* play, Player* this) {
if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) {
if (this->getItemId == GI_GAUNTLETS_SILVER && !IS_RANDO) {
play->nextEntranceIndex = 0x0123;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.nextCutsceneIndex = 0xFFF1;
play->fadeTransition = 0xF;
play->transitionType = TRANS_TYPE_SANDSTORM_END;
this->stateFlags1 &= ~PLAYER_STATE1_IN_CUTSCENE;
func_80852FFC(play, NULL, 8);
}
@ -13560,7 +13560,7 @@ void func_8084F710(Player* this, PlayState* play) {
void func_8084F88C(Player* this, PlayState* play) {
LinkAnimation_Update(play, &this->skelAnime);
if ((this->unk_850++ > 8) && (play->sceneLoadFlag == 0)) {
if ((this->unk_850++ > 8) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
if (this->unk_84F != 0) {
if (play->sceneNum == SCENE_ICE_CAVERN) {
@ -13576,16 +13576,16 @@ void func_8084F88C(Player* this, PlayState* play) {
Play_TriggerVoidOut(play);
}
play->fadeTransition = 4;
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
func_80078884(NA_SE_OC_ABYSS);
} else {
play->fadeTransition = 2;
gSaveContext.nextTransitionType = 2;
play->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.natureAmbienceId = 0xFF;
}
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -13903,9 +13903,9 @@ void func_8085063C(Player* this, PlayState* play) {
if (play->msgCtx.choiceIndex == 0) { //Returns to FW
gSaveContext.respawnFlag = 3;
play->sceneLoadFlag = 0x14;
play->transitionTrigger = TRANS_TRIGGER_START;
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
play->fadeTransition = 5;
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
func_80088AF0(play);
return;
}

View File

@ -2987,7 +2987,7 @@ void FileChoose_LoadGame(GameState* thisx) {
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.skyboxTime = 0;
gSaveContext.nextTransitionType = 0xFF;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;

View File

@ -4292,7 +4292,7 @@ void KaleidoScope_Update(PlayState* play)
}
// Reset frame counter to prevent autosave on respawn
play->gameplayFrames = 0;
gSaveContext.nextTransitionType = 2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;