1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Document Transition System (#1131)

* transition type enum

* mode enum, start documenting some types

* some more

* use enums for entrance table

* entrance table filled out

* sceneLoadFlag -> transitionTrigger

* sandstorm state/mode/type

* done i think

* fixes

* clean up circle weirdness

* circle use enum + fix texture names

* fix

* how did that even happen lol

* jesus

* review2

* some more review

* most review, still some more to do

* new transition trigger names

* some of review

* next type default
This commit is contained in:
fig02 2022-04-27 16:00:25 -04:00 committed by GitHub
parent fed9ac3e20
commit 16790bc253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 2477 additions and 1382 deletions

View file

@ -1,9 +1,9 @@
<Root>
<File Name="code" OutName="z_fbdemo_circle" RangeStart="0x10ED48" RangeEnd="0x10FF68">
<Texture Name="sCircleWipeDefaultTex" Format="i8" Width="16" Height="64" Offset="0x10ED48"/>
<Texture Name="sCircleWipeWaveTex" Format="i8" Width="16" Height="64" Offset="0x10F148"/>
<Texture Name="sCircleWipeRippleTex" Format="i8" Width="16" Height="64" Offset="0x10F548"/>
<Texture Name="sCircleWipeStarburstTex" Format="i8" Width="16" Height="64" Offset="0x10F948"/>
<Texture Name="sTransCircleNormalTex" Format="i8" Width="16" Height="64" Offset="0x10ED48"/>
<Texture Name="sTransCircleWaveTex" Format="i8" Width="16" Height="64" Offset="0x10F148"/>
<Texture Name="sTransCircleRippleTex" Format="i8" Width="16" Height="64" Offset="0x10F548"/>
<Texture Name="sTransCircleStarburstTex" Format="i8" Width="16" Height="64" Offset="0x10F948"/>
<Array Name="sCircleWipeVtx" Count="34" Offset="0x10FD48">
<Vtx/>
</Array>

View file

@ -1496,7 +1496,7 @@ void KaleidoScopeCall_Draw(GlobalContext* globalCtx);
void func_800BC490(GlobalContext* globalCtx, s16 point);
s32 func_800BC56C(GlobalContext* globalCtx, s16 arg1);
void func_800BC590(GlobalContext* globalCtx);
void func_800BC5E0(GlobalContext* globalCtx, s32 transitionType);
void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType);
Gfx* Gameplay_SetFog(GlobalContext* globalCtx, Gfx* gfx);
void Gameplay_Destroy(GameState* thisx);
void Gameplay_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

@ -1019,6 +1019,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;
@ -1229,14 +1305,14 @@ typedef struct GlobalContext {
/* 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

@ -158,17 +158,17 @@ typedef struct {
/* 0x140B */ char unk_140B[0x0001];
/* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold
/* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set
/* 0x1410 */ u8 unk_1410; // transition related
/* 0x1410 */ u8 cutsceneTransitionControl; // context dependent usage: can either trigger a delayed fade or control fill alpha
/* 0x1411 */ char unk_1411[0x0001];
/* 0x1412 */ u16 nextCutsceneIndex;
/* 0x1414 */ u8 cutsceneTrigger;
/* 0x1415 */ u8 chamberCutsceneNum;
/* 0x1416 */ u16 nextDayTime; // "next_zelda_time"
/* 0x1418 */ u8 fadeDuration;
/* 0x1419 */ u8 unk_1419; // transition related
/* 0x1418 */ u8 transFadeDuration;
/* 0x1419 */ u8 transWipeSpeed;
/* 0x141A */ u16 skyboxTime;
/* 0x141C */ u8 dogIsLost;
/* 0x141D */ u8 nextTransition;
/* 0x141D */ u8 nextTransitionType;
/* 0x141E */ char unk_141E[0x0002];
/* 0x1420 */ s16 worldMapArea;
/* 0x1422 */ s16 sunsSongState; // controls the effects of suns song

View file

@ -309,6 +309,10 @@ typedef enum {
/* 0x6E */ SCENE_ID_MAX
} SceneID;
// this define exists to preserve shiftability for an unused scene that is
// listed in the entrance table
#define SCENE_UNUSED_6E SCENE_ID_MAX
#undef DEFINE_SCENE
// Scene commands

View file

@ -50,11 +50,11 @@ 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 speed;
/* 0x014 */ u8 direction;
/* 0x015 */ u8 colorType;
/* 0x016 */ u8 speedType;
/* 0x017 */ u8 appearanceType;
/* 0x018 */ u8 isDone;
/* 0x019 */ u8 frame;
/* 0x01A */ u16 normal;

View file

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

View file

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

View file

@ -164,7 +164,7 @@ void func_800645A0(GlobalContext* globalCtx, CutsceneContext* csCtx) {
gSaveContext.cutsceneTrigger = 1;
}
if ((gSaveContext.cutsceneTrigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) {
if ((gSaveContext.cutsceneTrigger != 0) && (globalCtx->transitionTrigger == TRANS_TRIGGER_START)) {
gSaveContext.cutsceneTrigger = 0;
}
@ -405,7 +405,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
break;
case 32:
if (sp3F != 0) {
globalCtx->envCtx.sandstormState = 1;
globalCtx->envCtx.sandstormState = SANDSTORM_FILL;
}
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
break;
@ -494,7 +494,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
(CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) ||
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B) ||
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START)) &&
(gSaveContext.fileNum != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) {
(gSaveContext.fileNum != 0xFEDC) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
temp = 1;
@ -505,7 +505,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
(gSaveContext.fileNum != 0xFEDC))) {
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
Audio_SetCutsceneFlag(0);
gSaveContext.unk_1410 = 1;
gSaveContext.cutsceneTransitionControl = 1;
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); // "Future fork designation=No. [%d]"
@ -519,44 +519,44 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
case 1:
globalCtx->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 2:
globalCtx->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 10;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 3:
globalCtx->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 10;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 4:
globalCtx->nextEntranceIndex = 0x013D;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 10;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 5:
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 10;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 6:
globalCtx->nextEntranceIndex = 0x00A0;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 10;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_WHITE;
break;
case 7:
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 11;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_INSTANT;
break;
case 8:
gSaveContext.fw.set = 0;
@ -564,9 +564,9 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
if (!(gSaveContext.eventChkInf[4] & 0x20)) {
gSaveContext.eventChkInf[4] |= 0x20;
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->fadeTransition = 11;
globalCtx->transitionType = TRANS_TYPE_INSTANT;
} else {
if (gSaveContext.sceneSetupIndex < 4) {
if (!LINK_IS_ADULT) {
@ -576,254 +576,254 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
}
}
globalCtx->nextEntranceIndex = 0x02CA;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 9:
globalCtx->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 12;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FILL_BROWN;
break;
case 10:
globalCtx->nextEntranceIndex = 0x00BB;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 11:
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 12:
globalCtx->nextEntranceIndex = 0x047A;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 13:
globalCtx->nextEntranceIndex = 0x010E;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 14:
globalCtx->nextEntranceIndex = 0x0457;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 15:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 16:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 17:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 18:
gSaveContext.eventChkInf[4] |= 0x8000;
globalCtx->nextEntranceIndex = 0x0324;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 19:
globalCtx->nextEntranceIndex = 0x013D;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 4;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
gSaveContext.cutsceneIndex = 0x8000;
break;
case 21:
globalCtx->nextEntranceIndex = 0x0102;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 22:
Item_Give(globalCtx, ITEM_SONG_REQUIEM);
globalCtx->nextEntranceIndex = 0x0123;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 23:
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF8;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 24:
globalCtx->nextEntranceIndex = 0x0028;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 25:
globalCtx->linkAgeOnLoad = LINK_AGE_ADULT;
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 26:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 27:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 28:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 29:
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.chamberCutsceneNum = 0;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 30:
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
Item_Give(globalCtx, ITEM_MEDALLION_FIRE);
gSaveContext.chamberCutsceneNum = 1;
break;
case 31:
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.chamberCutsceneNum = 2;
break;
case 32:
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x00CD;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->fadeTransition = 11;
globalCtx->transitionType = TRANS_TYPE_INSTANT;
break;
case 33:
globalCtx->nextEntranceIndex = 0x00CD;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 34:
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 35:
globalCtx->nextEntranceIndex = 0x00CD;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 38:
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 39:
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF9;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 40:
globalCtx->linkAgeOnLoad = LINK_AGE_ADULT;
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFFA;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 41:
globalCtx->nextEntranceIndex = 0x04E6;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 42:
globalCtx->nextEntranceIndex = 0x00DB;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 43:
globalCtx->nextEntranceIndex = 0x0503;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 4;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 44:
globalCtx->nextEntranceIndex = 0x0320;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 17;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
break;
case 46:
gSaveContext.eventChkInf[4] |= 0x8000;
globalCtx->nextEntranceIndex = 0x0324;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 4;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 47:
Item_Give(globalCtx, ITEM_SONG_NOCTURNE);
gSaveContext.eventChkInf[5] |= 0x10;
globalCtx->nextEntranceIndex = 0x00DB;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 48:
globalCtx->nextEntranceIndex = 0x01ED;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 15;
gSaveContext.nextTransition = 15;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_SANDSTORM_END;
gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_END;
break;
case 49:
globalCtx->nextEntranceIndex = 0x058C;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 4;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
break;
case 50:
globalCtx->nextEntranceIndex = 0x0513;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 17;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
break;
case 51:
globalCtx->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF8;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 41;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_WHITE, TCS_SLOW);
break;
case 52:
globalCtx->nextEntranceIndex = 0x0053;
gSaveContext.cutsceneIndex = 0xFFF7;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 11;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_INSTANT;
break;
case 53:
globalCtx->nextEntranceIndex = 0x050F;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 54:
gSaveContext.gameMode = 3;
@ -831,104 +831,104 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0117;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 55:
globalCtx->nextEntranceIndex = 0x0129;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 56:
globalCtx->nextEntranceIndex = 0x00DB;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 57:
globalCtx->nextEntranceIndex = 0x013D;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 58:
globalCtx->nextEntranceIndex = 0x014D;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 59:
globalCtx->nextEntranceIndex = 0x0102;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 60:
globalCtx->nextEntranceIndex = 0x010E;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 61:
globalCtx->nextEntranceIndex = 0x0108;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 62:
globalCtx->linkAgeOnLoad = LINK_AGE_ADULT;
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF6;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 63:
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF7;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 64:
globalCtx->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF5;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 65:
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0157;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 66:
globalCtx->nextEntranceIndex = 0x0554;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 67:
globalCtx->nextEntranceIndex = 0x027E;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 68:
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 69:
globalCtx->nextEntranceIndex = 0x05E8;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 70:
globalCtx->nextEntranceIndex = 0x013D;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 71:
gSaveContext.equips.equipment |= 0x0100;
@ -937,57 +937,57 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
Player_SetEquipmentData(globalCtx, player);
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 72:
globalCtx->nextEntranceIndex = 0x0400;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 73:
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 74:
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 75:
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF4;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 76:
globalCtx->linkAgeOnLoad = LINK_AGE_ADULT;
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF5;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 77:
globalCtx->linkAgeOnLoad = LINK_AGE_CHILD;
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 78:
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF7;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 79:
case 80:
@ -1005,38 +1005,38 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
case 92:
case 93:
globalCtx->nextEntranceIndex = 0x0157;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 94:
globalCtx->nextEntranceIndex = 0x02AE;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 95:
if ((gSaveContext.eventChkInf[4] & 0x100) && (gSaveContext.eventChkInf[4] & 0x200) &&
(gSaveContext.eventChkInf[4] & 0x400)) {
globalCtx->nextEntranceIndex = 0x0053;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
} else {
switch (gSaveContext.sceneSetupIndex) {
case 8:
globalCtx->nextEntranceIndex = 0x00FC;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 9:
globalCtx->nextEntranceIndex = 0x0147;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 10:
globalCtx->nextEntranceIndex = 0x0102;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
}
}
@ -1044,130 +1044,130 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
case 96:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 5;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
} else {
gSaveContext.eventChkInf[12] |= 0x100;
globalCtx->nextEntranceIndex = 0x0610;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 97:
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
globalCtx->nextEntranceIndex = 0x006B;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 5;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
} else {
globalCtx->nextEntranceIndex = 0x0580;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
break;
case 98:
globalCtx->nextEntranceIndex = 0x0564;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 99:
globalCtx->nextEntranceIndex = 0x0608;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 100:
globalCtx->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF8;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 101:
globalCtx->nextEntranceIndex = 0x01F5;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 15;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_SANDSTORM_END;
break;
case 102:
globalCtx->nextEntranceIndex = 0x0590;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 103:
globalCtx->nextEntranceIndex = 0x00CD;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF3;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 104:
switch (sTitleCsState) {
case 0:
globalCtx->nextEntranceIndex = 0x008D;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF2;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState++;
break;
case 1:
globalCtx->nextEntranceIndex = 0x0147;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState++;
break;
case 2:
globalCtx->nextEntranceIndex = 0x00A0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF6;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
sTitleCsState = 0;
break;
}
break;
case 105:
globalCtx->nextEntranceIndex = 0x00E4;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.cutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 106:
globalCtx->nextEntranceIndex = 0x0574;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 107:
globalCtx->nextEntranceIndex = 0x0538;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 108:
globalCtx->nextEntranceIndex = 0x053C;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 109:
globalCtx->nextEntranceIndex = 0x0540;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 110:
globalCtx->nextEntranceIndex = 0x0544;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 111:
globalCtx->nextEntranceIndex = 0x0548;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 112:
globalCtx->nextEntranceIndex = 0x054C;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 113:
if (Flags_GetEventChkInf(0xBB) && Flags_GetEventChkInf(0xBC) && Flags_GetEventChkInf(0xBD) &&
@ -1184,26 +1184,26 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
break;
case 114:
globalCtx->nextEntranceIndex = 0x0185;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
break;
case 115:
globalCtx->nextEntranceIndex = 0x0594;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 116:
if (gSaveContext.eventChkInf[12] & 0x100) {
globalCtx->nextEntranceIndex = 0x0580;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
} else {
globalCtx->nextEntranceIndex = 0x0610;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
}
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
break;
case 117:
gSaveContext.gameMode = 3;
@ -1211,21 +1211,21 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
globalCtx->linkAgeOnLoad = LINK_AGE_ADULT;
globalCtx->nextEntranceIndex = 0x00CD;
gSaveContext.cutsceneIndex = 0xFFF7;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
case 118:
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517;
Gameplay_TriggerVoidOut(globalCtx);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
break;
case 119:
gSaveContext.dayTime = 0x8000;
gSaveContext.skyboxTime = 0x8000;
globalCtx->nextEntranceIndex = 0x05F0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
break;
}
}
@ -1262,6 +1262,7 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
}
break;
case 2:
case 6:
globalCtx->envCtx.screenFillColor[0] = 0;
@ -1273,6 +1274,7 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
}
break;
case 3:
case 7:
globalCtx->envCtx.screenFillColor[0] = 255;
@ -1284,6 +1286,7 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
}
break;
case 4:
case 8:
globalCtx->envCtx.screenFillColor[0] = 0;
@ -1295,9 +1298,11 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
}
break;
case 9:
gSaveContext.unk_1410 = 1;
gSaveContext.cutsceneTransitionControl = 1;
break;
case 10:
case 11:
globalCtx->envCtx.screenFillColor[0] = 0;
@ -1309,9 +1314,11 @@ void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* cs
globalCtx->envCtx.screenFillColor[3] = 255.0f * temp;
}
break;
case 12:
gSaveContext.unk_1410 = 255.0f - (155.0f * temp);
gSaveContext.cutsceneTransitionControl = 255.0f - (155.0f * temp);
break;
case 13:
globalCtx->envCtx.screenFillColor[0] = 0;
globalCtx->envCtx.screenFillColor[1] = 0;

View file

@ -37,51 +37,50 @@ Gfx sCircleDList[] = {
void TransitionCircle_Start(void* thisx) {
TransitionCircle* this = (TransitionCircle*)thisx;
this->isDone = 0;
this->isDone = false;
switch (this->effect) {
case 1:
this->texture = sCircleWipeWaveTex;
switch (this->appearanceType) {
case TCA_WAVE:
this->texture = sTransCircleWaveTex;
break;
case 2:
this->texture = sCircleWipeRippleTex;
case TCA_RIPPLE:
this->texture = sTransCircleRippleTex;
break;
case 3:
this->texture = sCircleWipeStarburstTex;
case TCA_STARBURST:
this->texture = sTransCircleStarburstTex;
break;
default:
this->texture = sCircleWipeDefaultTex;
this->texture = sTransCircleNormalTex;
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) {
// yes, really.
} else if (this->colorType == TCC_GRAY) {
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, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
@ -105,29 +104,29 @@ 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, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
}
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;
}
}
}
@ -184,15 +183,18 @@ 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

@ -49,16 +49,16 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
break;
case 1:
this->fadeTimer += updateRate;
if (this->fadeTimer >= gSaveContext.fadeDuration) {
this->fadeTimer = gSaveContext.fadeDuration;
if (this->fadeTimer >= gSaveContext.transFadeDuration) {
this->fadeTimer = gSaveContext.transFadeDuration;
this->isDone = 1;
}
if (!gSaveContext.fadeDuration) {
if (!gSaveContext.transFadeDuration) {
// "Divide by 0! Zero is included in ZCommonGet fade_speed"
osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST);
}
alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.fadeDuration);
alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.transFadeDuration);
this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha;
break;
case 2:

View file

@ -63,18 +63,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.unk_1419;
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.unk_1419;
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,10 +13,10 @@ void KaleidoSetup_Update(GlobalContext* globalCtx) {
Input* input = &globalCtx->state.input[0];
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE &&
globalCtx->sceneLoadFlag == 0 && globalCtx->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 &&
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Gameplay_InCsMode(globalCtx) &&
globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
(globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) {
globalCtx->transitionTrigger == TRANS_TRIGGER_OFF && globalCtx->transitionMode == TRANS_MODE_OFF &&
gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 &&
!Gameplay_InCsMode(globalCtx) && globalCtx->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 &&
gSaveContext.unk_13F0 != 9 && (globalCtx->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(globalCtx, 0x38))) {
if (CHECK_BTN_ALL(input->cur.button, BTN_L) && CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
if (BREG(0)) {

View file

@ -281,7 +281,7 @@ void Environment_Init(GlobalContext* globalCtx2, EnvironmentContext* envCtx, s32
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;
@ -292,7 +292,7 @@ void Environment_Init(GlobalContext* globalCtx2, EnvironmentContext* envCtx, s32
sLightningFlashAlpha = 0;
gSaveContext.unk_1410 = 0;
gSaveContext.cutsceneTransitionControl = 0;
envCtx->adjAmbientColor[0] = envCtx->adjAmbientColor[1] = envCtx->adjAmbientColor[2] = envCtx->adjLight1Color[0] =
envCtx->adjLight1Color[1] = envCtx->adjLight1Color[2] = envCtx->adjFogColor[0] = envCtx->adjFogColor[1] =
@ -879,7 +879,7 @@ void Environment_Update(GlobalContext* globalCtx, EnvironmentContext* envCtx, Li
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(globalCtx) &&
(globalCtx->transitionMode == 0 || ((void)0, gSaveContext.gameMode) != 0)) {
(globalCtx->transitionMode == TRANS_MODE_OFF || ((void)0, gSaveContext.gameMode) != 0)) {
if (IS_DAY || gTimeIncrement >= 0x190) {
gSaveContext.dayTime += gTimeIncrement;
@ -2229,7 +2229,7 @@ void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) {
u16 sp92;
switch (sandstormState) {
case 3:
case SANDSTORM_ACTIVE:
if ((globalCtx->sceneNum == SCENE_SPOT13) && (globalCtx->roomCtx.curRoom.num == 0)) {
envA1 = 0;
primA1 = (globalCtx->envCtx.sandstormEnvA > 128) ? 255 : globalCtx->envCtx.sandstormEnvA >> 1;
@ -2242,11 +2242,13 @@ void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) {
envA1 = 128;
}
break;
case 1:
case SANDSTORM_FILL:
primA1 = 255;
envA1 = (globalCtx->envCtx.sandstormPrimA >= 255) ? 255 : 128;
break;
case 2:
case SANDSTORM_UNFILL:
envA1 = 128;
if (globalCtx->envCtx.sandstormEnvA > 128) {
primA1 = 0xFF;
@ -2258,15 +2260,16 @@ void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) {
primA1 += 73;
}
if ((primA1 >= primA) && (primA1 != 255)) {
globalCtx->envCtx.sandstormState = 3;
globalCtx->envCtx.sandstormState = SANDSTORM_ACTIVE;
}
break;
case 4:
case SANDSTORM_DISSIPATE:
envA1 = 0;
primA1 = (globalCtx->envCtx.sandstormEnvA > 128) ? 255 : globalCtx->envCtx.sandstormEnvA >> 1;
if (primA == 0) {
globalCtx->envCtx.sandstormState = 0;
globalCtx->envCtx.sandstormState = SANDSTORM_OFF;
}
break;
}
@ -2434,9 +2437,9 @@ void Environment_WarpSongLeave(GlobalContext* globalCtx) {
gSaveContext.cutsceneIndex = 0;
gSaveContext.respawnFlag = -3;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
switch (globalCtx->nextEntranceIndex) {
case 0x147:

View file

@ -669,7 +669,7 @@ void func_80083108(GlobalContext* globalCtx) {
Interface_ChangeAlpha(6);
}
if (globalCtx->transitionMode != 0) {
if (globalCtx->transitionMode != TRANS_MODE_OFF) {
Interface_ChangeAlpha(1);
} else if (gSaveContext.minigameState == 1) {
Interface_ChangeAlpha(8);
@ -1062,7 +1062,7 @@ void func_80083108(GlobalContext* globalCtx) {
if (sp28) {
gSaveContext.unk_13EA = 0;
if ((globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0)) {
if ((globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (globalCtx->transitionMode == TRANS_MODE_OFF)) {
Interface_ChangeAlpha(50);
osSyncPrintf("???????? alpha_change( 50 ); ?????\n");
} else {
@ -2475,7 +2475,8 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
case 7:
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {
(globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (globalCtx->transitionMode == TRANS_MODE_OFF) &&
!Gameplay_InCsMode(globalCtx)) {
if ((gSaveContext.magic == 0) || ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) ||
((gSaveContext.equips.buttonItems[1] != ITEM_LENS) &&
(gSaveContext.equips.buttonItems[2] != ITEM_LENS) &&
@ -3389,8 +3390,8 @@ void Interface_Draw(GlobalContext* globalCtx) {
// Trade quest timer reached 0
D_8015FFE6 = 40;
gSaveContext.cutsceneIndex = 0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.timer2State = 0;
if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) &&
@ -3424,9 +3425,9 @@ void Interface_Draw(GlobalContext* globalCtx) {
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (msgCtx->msgMode == MSGMODE_NONE) &&
!(player->stateFlags2 & PLAYER_STATE2_24) && (globalCtx->sceneLoadFlag == 0) &&
(globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx) && (gSaveContext.minigameState != 1) &&
(globalCtx->shootingGalleryStatus <= 1) &&
!(player->stateFlags2 & PLAYER_STATE2_24) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) &&
(globalCtx->transitionMode == TRANS_MODE_OFF) && !Gameplay_InCsMode(globalCtx) &&
(gSaveContext.minigameState != 1) && (globalCtx->shootingGalleryStatus <= 1) &&
!((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) {
svar6 = 0;
switch (gSaveContext.timer1State) {
@ -3990,7 +3991,8 @@ void Interface_Update(GlobalContext* globalCtx) {
if ((gSaveContext.timer1State >= 3) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && !(player->stateFlags2 & PLAYER_STATE2_24) &&
(globalCtx->sceneLoadFlag == 0) && (globalCtx->transitionMode == 0) && !Gameplay_InCsMode(globalCtx)) {}
(globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (globalCtx->transitionMode == TRANS_MODE_OFF) &&
!Gameplay_InCsMode(globalCtx)) {}
if (gSaveContext.rupeeAccumulator != 0) {
if (gSaveContext.rupeeAccumulator > 0) {
@ -4073,8 +4075,8 @@ void Interface_Update(GlobalContext* globalCtx) {
WREG(7) = interfaceCtx->unk_1F4;
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->sceneLoadFlag == 0) &&
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->transitionMode == 0) &&
(msgCtx->msgMode == MSGMODE_NONE) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) &&
(globalCtx->gameOverCtx.state == GAMEOVER_INACTIVE) && (globalCtx->transitionMode == TRANS_MODE_OFF) &&
((globalCtx->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(globalCtx))) {
if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
gSaveContext.magicLevel = gSaveContext.doubleMagic + 1;
@ -4170,24 +4172,24 @@ void Interface_Update(GlobalContext* globalCtx) {
} else if ((globalCtx->roomCtx.curRoom.unk_03 != 1) && (interfaceCtx->restrictions.sunsSong != 3)) {
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) {
gSaveContext.nextDayTime = 0;
globalCtx->fadeTransition = 4;
gSaveContext.nextTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
globalCtx->unk_11DE9 = true;
} else {
gSaveContext.nextDayTime = 0x8001;
globalCtx->fadeTransition = 5;
gSaveContext.nextTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
globalCtx->unk_11DE9 = true;
}
if (globalCtx->sceneNum == SCENE_SPOT13) {
globalCtx->fadeTransition = 14;
gSaveContext.nextTransition = 14;
globalCtx->transitionType = TRANS_TYPE_SANDSTORM_PERSIST;
gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_PERSIST;
}
gSaveContext.respawnFlag = -2;
globalCtx->nextEntranceIndex = gSaveContext.entranceIndex;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
func_800F6964(30);
gSaveContext.seqId = (u8)NA_BGM_DISABLED;

View file

@ -10,7 +10,7 @@ s32 gTrnsnUnkState;
VisMono D_80161498;
Color_RGBA8_u32 D_801614B0;
FaultClient D_801614B8;
s16 D_801614C8;
s16 sTransitionFillTimer;
u64 D_801614D0[0xA00];
void func_800BC450(GlobalContext* globalCtx) {
@ -43,13 +43,14 @@ void func_800BC590(GlobalContext* globalCtx) {
}
}
void func_800BC5E0(GlobalContext* globalCtx, s32 transitionType) {
void Gameplay_SetupTransition(GlobalContext* globalCtx, s32 transitionType) {
TransitionContext* transitionCtx = &globalCtx->transitionCtx;
bzero(transitionCtx, sizeof(TransitionContext));
transitionCtx->transitionType = transitionType;
// circle types
if ((transitionCtx->transitionType >> 5) == 1) {
transitionCtx->init = TransitionCircle_Init;
transitionCtx->destroy = TransitionCircle_Destroy;
@ -62,7 +63,7 @@ void func_800BC5E0(GlobalContext* globalCtx, 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;
@ -73,8 +74,9 @@ void func_800BC5E0(GlobalContext* globalCtx, 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;
@ -85,16 +87,17 @@ void func_800BC5E0(GlobalContext* globalCtx, 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;
@ -105,25 +108,32 @@ void func_800BC5E0(GlobalContext* globalCtx, s32 transitionType) {
transitionCtx->setColor = TransitionFade_SetColor;
transitionCtx->setEnvColor = NULL;
break;
case 9:
case 10:
globalCtx->transitionMode = 4;
case TRANS_TYPE_FILL_WHITE2:
case TRANS_TYPE_FILL_WHITE:
globalCtx->transitionMode = TRANS_MODE_FILL_WHITE_INIT;
break;
case 11:
globalCtx->transitionMode = 10;
case TRANS_TYPE_INSTANT:
globalCtx->transitionMode = TRANS_MODE_INSTANT;
break;
case 12:
globalCtx->transitionMode = 7;
case TRANS_TYPE_FILL_BROWN:
globalCtx->transitionMode = TRANS_MODE_FILL_BROWN_INIT;
break;
case 14:
globalCtx->transitionMode = 12;
case TRANS_TYPE_SANDSTORM_PERSIST:
globalCtx->transitionMode = TRANS_MODE_SANDSTORM_INIT;
break;
case 15:
globalCtx->transitionMode = 14;
case TRANS_TYPE_SANDSTORM_END:
globalCtx->transitionMode = TRANS_MODE_SANDSTORM_END_INIT;
break;
case 16:
globalCtx->transitionMode = 16;
case TRANS_TYPE_CS_BLACK_FILL:
globalCtx->transitionMode = TRANS_MODE_CS_BLACK_FILL_INIT;
break;
default:
Fault_AddHungupAndCrash("../z_play.c", 2290);
break;
@ -159,10 +169,10 @@ void Gameplay_Destroy(GameState* thisx) {
gTrnsnUnkState = 0;
}
if (globalCtx->transitionMode == 3) {
if (globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) {
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.data);
func_800BC88C(globalCtx);
globalCtx->transitionMode = 0;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
ShrinkWindow_Destroy();
@ -325,27 +335,28 @@ void Gameplay_Init(GameState* thisx) {
PreRender_SetValuesSave(&globalCtx->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0);
PreRender_SetValues(&globalCtx->pauseBgPreRender, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
gTrnsnUnkState = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionMode = TRANS_MODE_OFF;
FrameAdvance_Init(&globalCtx->frameAdvCtx);
Rand_Seed((u32)osGetTime());
Matrix_Init(&globalCtx->state);
globalCtx->state.main = Gameplay_Main;
globalCtx->state.destroy = Gameplay_Destroy;
globalCtx->sceneLoadFlag = -0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_END;
globalCtx->unk_11E16 = 0xFF;
globalCtx->unk_11E18 = 0;
globalCtx->unk_11DE9 = false;
if (gSaveContext.gameMode != 1) {
if (gSaveContext.nextTransition == 0xFF) {
globalCtx->fadeTransition =
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In
if (gSaveContext.nextTransitionType == TRANS_NEXT_TYPE_DEFAULT) {
// fade in
globalCtx->transitionType =
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F;
} else {
globalCtx->fadeTransition = gSaveContext.nextTransition;
gSaveContext.nextTransition = 0xFF;
globalCtx->transitionType = gSaveContext.nextTransitionType;
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
}
} else {
globalCtx->fadeTransition = 6;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_SLOW;
}
ShrinkWindow_Init();
@ -443,8 +454,8 @@ void Gameplay_Update(GlobalContext* globalCtx) {
gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment);
if (FrameAdvance_Update(&globalCtx->frameAdvCtx, &input[1])) {
if ((globalCtx->transitionMode == 0) && (globalCtx->sceneLoadFlag != 0)) {
globalCtx->transitionMode = 1;
if ((globalCtx->transitionMode == TRANS_MODE_OFF) && (globalCtx->transitionTrigger != TRANS_TRIGGER_OFF)) {
globalCtx->transitionMode = TRANS_MODE_SETUP;
}
if (gTrnsnUnkState != 0) {
@ -467,19 +478,22 @@ void Gameplay_Update(GlobalContext* globalCtx) {
if (globalCtx->transitionMode) {
switch (globalCtx->transitionMode) {
case 1:
if (globalCtx->sceneLoadFlag != -0x14) {
s16 sp6E = 0;
case TRANS_MODE_SETUP:
if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
s16 sceneSetupIndex = 0;
Interface_ChangeAlpha(1);
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
sp6E = (gSaveContext.cutsceneIndex & 0xF) + 4;
sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4;
}
if (!(gEntranceTable[globalCtx->nextEntranceIndex + sp6E].field & 0x8000)) { // Continue BGM Off
// fade out bgm if "continue bgm" flag is not set
if (!(gEntranceTable[globalCtx->nextEntranceIndex + sceneSetupIndex].field & 0x8000)) {
// "Sound initalized. 111"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。111");
if ((globalCtx->fadeTransition < 56) && !Environment_IsForcedSequenceDisabled()) {
if ((globalCtx->transitionType < TRANS_TYPE_MAX) &&
!Environment_IsForcedSequenceDisabled()) {
// "Sound initalized. 222"
osSyncPrintf("\n\n\nサウンドイニシャル来ました。222");
func_800F6964(0x14);
@ -489,71 +503,80 @@ void Gameplay_Update(GlobalContext* globalCtx) {
}
}
if (CREG(11) == 0) {
func_800BC5E0(globalCtx, globalCtx->fadeTransition);
if (!R_TRANS_DBG_ENABLED) {
Gameplay_SetupTransition(globalCtx, globalCtx->transitionType);
} else {
func_800BC5E0(globalCtx, CREG(12));
Gameplay_SetupTransition(globalCtx, R_TRANS_DBG_TYPE);
}
if (globalCtx->transitionMode >= 4) {
if (globalCtx->transitionMode >= TRANS_MODE_FILL_WHITE_INIT) {
// non-instance modes break out of this switch
break;
}
case 2:
// fallthrough
case TRANS_MODE_INSTANCE_INIT:
globalCtx->transitionCtx.init(&globalCtx->transitionCtx.data);
// circle types
if ((globalCtx->transitionCtx.transitionType >> 5) == 1) {
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data,
globalCtx->transitionCtx.transitionType | 0x80);
globalCtx->transitionCtx.transitionType | TC_SET_PARAMS);
}
gSaveContext.unk_1419 = 14;
if ((globalCtx->transitionCtx.transitionType == 8) ||
(globalCtx->transitionCtx.transitionType == 9)) {
gSaveContext.unk_1419 = 28;
gSaveContext.transWipeSpeed = 14;
if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_WIPE_FAST) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FILL_WHITE2)) {
//! @bug TRANS_TYPE_FILL_WHITE2 will never reach this code.
//! It is a non-instance type transition which doesn't run this case.
gSaveContext.transWipeSpeed = 28;
}
gSaveContext.fadeDuration = 60;
if ((globalCtx->transitionCtx.transitionType == 4) ||
(globalCtx->transitionCtx.transitionType == 5)) {
gSaveContext.fadeDuration = 20;
} else if ((globalCtx->transitionCtx.transitionType == 6) ||
(globalCtx->transitionCtx.transitionType == 7)) {
gSaveContext.fadeDuration = 150;
} else if (globalCtx->transitionCtx.transitionType == 17) {
gSaveContext.fadeDuration = 2;
gSaveContext.transFadeDuration = 60;
if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_FAST) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST)) {
gSaveContext.transFadeDuration = 20;
} else if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLACK_SLOW) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW)) {
gSaveContext.transFadeDuration = 150;
} else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT) {
gSaveContext.transFadeDuration = 2;
}
if ((globalCtx->transitionCtx.transitionType == 3) ||
(globalCtx->transitionCtx.transitionType == 5) ||
(globalCtx->transitionCtx.transitionType == 7) ||
(globalCtx->transitionCtx.transitionType == 13) ||
(globalCtx->transitionCtx.transitionType == 17)) {
if ((globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_FAST) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_SLOW) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) ||
(globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_INSTANT)) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(160, 160, 160, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(160, 160, 160, 255));
}
} else if (globalCtx->transitionCtx.transitionType == 18) {
} else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_GREEN) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(140, 140, 100, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(140, 140, 100, 255));
}
} else if (globalCtx->transitionCtx.transitionType == 19) {
} else if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_BLUE) {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(70, 100, 110, 255));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
RGBA8(70, 100, 110, 255));
}
} else {
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
if (globalCtx->transitionCtx.setEnvColor != NULL) {
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data, RGBA8(0, 0, 0, 0));
}
}
if (globalCtx->sceneLoadFlag == -0x14) {
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 1);
} else {
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 2);
@ -561,26 +584,28 @@ void Gameplay_Update(GlobalContext* globalCtx) {
globalCtx->transitionCtx.start(&globalCtx->transitionCtx);
if (globalCtx->transitionCtx.transitionType == 13) {
globalCtx->transitionMode = 11;
if (globalCtx->transitionCtx.transitionType == TRANS_TYPE_FADE_WHITE_CS_DELAYED) {
globalCtx->transitionMode = TRANS_MODE_INSTANCE_WAIT;
} else {
globalCtx->transitionMode = 3;
globalCtx->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
}
break;
case 3:
if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx) != 0) {
if (globalCtx->transitionCtx.transitionType >= 56) {
if (globalCtx->sceneLoadFlag == -0x14) {
case TRANS_MODE_INSTANCE_RUNNING:
if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx)) {
if (globalCtx->transitionCtx.transitionType >= TRANS_TYPE_MAX) {
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
func_800BC88C(globalCtx);
globalCtx->transitionMode = 0;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
} else if (globalCtx->sceneLoadFlag != -0x14) {
globalCtx->state.running = 0;
} else if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
globalCtx->state.running = false;
if (gSaveContext.gameMode != 2) {
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
if (gSaveContext.minigameState == 1) {
gSaveContext.minigameState = 3;
}
@ -590,177 +615,186 @@ void Gameplay_Update(GlobalContext* globalCtx) {
} else {
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
func_800BC88C(globalCtx);
globalCtx->transitionMode = 0;
globalCtx->transitionMode = TRANS_MODE_OFF;
if (gTrnsnUnkState == 3) {
TransitionUnk_Destroy(&sTrnsnUnk);
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
}
}
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
} else {
globalCtx->transitionCtx.update(&globalCtx->transitionCtx.data, R_UPDATE_RATE);
}
break;
}
// update non-instance transitions
switch (globalCtx->transitionMode) {
case 4:
D_801614C8 = 0;
case TRANS_MODE_FILL_WHITE_INIT:
sTransitionFillTimer = 0;
globalCtx->envCtx.fillScreen = true;
globalCtx->envCtx.screenFillColor[0] = 160;
globalCtx->envCtx.screenFillColor[1] = 160;
globalCtx->envCtx.screenFillColor[2] = 160;
if (globalCtx->sceneLoadFlag != -0x14) {
if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
globalCtx->envCtx.screenFillColor[3] = 0;
globalCtx->transitionMode = 5;
globalCtx->transitionMode = TRANS_MODE_FILL_IN;
} else {
globalCtx->envCtx.screenFillColor[3] = 255;
globalCtx->transitionMode = 6;
globalCtx->transitionMode = TRANS_MODE_FILL_OUT;
}
break;
case 5:
globalCtx->envCtx.screenFillColor[3] = (D_801614C8 / 20.0f) * 255.0f;
if (D_801614C8 >= 20 && 1) {
globalCtx->state.running = 0;
case TRANS_MODE_FILL_IN:
globalCtx->envCtx.screenFillColor[3] = (sTransitionFillTimer / 20.0f) * 255.0f;
if (sTransitionFillTimer >= 20) {
globalCtx->state.running = false;
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
} else {
D_801614C8++;
sTransitionFillTimer++;
}
break;
case 6:
globalCtx->envCtx.screenFillColor[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
if (D_801614C8 >= 20 && 1) {
case TRANS_MODE_FILL_OUT:
globalCtx->envCtx.screenFillColor[3] = (1 - sTransitionFillTimer / 20.0f) * 255.0f;
if (sTransitionFillTimer >= 20) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
globalCtx->envCtx.fillScreen = false;
} else {
D_801614C8++;
sTransitionFillTimer++;
}
break;
case 7:
D_801614C8 = 0;
case TRANS_MODE_FILL_BROWN_INIT:
sTransitionFillTimer = 0;
globalCtx->envCtx.fillScreen = true;
globalCtx->envCtx.screenFillColor[0] = 170;
globalCtx->envCtx.screenFillColor[1] = 160;
globalCtx->envCtx.screenFillColor[2] = 150;
if (globalCtx->sceneLoadFlag != -0x14) {
if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
globalCtx->envCtx.screenFillColor[3] = 0;
globalCtx->transitionMode = 5;
globalCtx->transitionMode = TRANS_MODE_FILL_IN;
} else {
globalCtx->envCtx.screenFillColor[3] = 255;
globalCtx->transitionMode = 6;
globalCtx->transitionMode = TRANS_MODE_FILL_OUT;
}
break;
case 10:
if (globalCtx->sceneLoadFlag != -0x14) {
globalCtx->state.running = 0;
case TRANS_MODE_INSTANT:
if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
globalCtx->state.running = false;
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
} else {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
break;
case 11:
if (gSaveContext.unk_1410 != 0) {
globalCtx->transitionMode = 3;
case TRANS_MODE_INSTANCE_WAIT:
if (gSaveContext.cutsceneTransitionControl != 0) {
globalCtx->transitionMode = TRANS_MODE_INSTANCE_RUNNING;
}
break;
case 12:
if (globalCtx->sceneLoadFlag != -0x14) {
globalCtx->envCtx.sandstormState = 1;
globalCtx->transitionMode = 13;
case TRANS_MODE_SANDSTORM_INIT:
if (globalCtx->transitionTrigger != TRANS_TRIGGER_END) {
// trigger in, leaving area
globalCtx->envCtx.sandstormState = SANDSTORM_FILL;
globalCtx->transitionMode = TRANS_MODE_SANDSTORM;
} else {
globalCtx->envCtx.sandstormState = 2;
globalCtx->envCtx.sandstormState = SANDSTORM_UNFILL;
globalCtx->envCtx.sandstormPrimA = 255;
globalCtx->envCtx.sandstormEnvA = 255;
globalCtx->transitionMode = 13;
globalCtx->transitionMode = TRANS_MODE_SANDSTORM;
}
break;
case 13:
case TRANS_MODE_SANDSTORM:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
if (globalCtx->sceneLoadFlag == -0x14) {
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
if (globalCtx->envCtx.sandstormPrimA < 110) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
} else {
if (globalCtx->envCtx.sandstormEnvA == 255) {
globalCtx->state.running = 0;
globalCtx->state.running = false;
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
}
break;
case 14:
if (globalCtx->sceneLoadFlag == -0x14) {
globalCtx->envCtx.sandstormState = 4;
case TRANS_MODE_SANDSTORM_END_INIT:
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
globalCtx->envCtx.sandstormState = SANDSTORM_DISSIPATE;
globalCtx->envCtx.sandstormPrimA = 255;
globalCtx->envCtx.sandstormEnvA = 255;
// "It's here!!!!!!!!!"
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471);
globalCtx->transitionMode = 15;
globalCtx->transitionMode = TRANS_MODE_SANDSTORM_END;
} else {
globalCtx->transitionMode = 12;
globalCtx->transitionMode = TRANS_MODE_SANDSTORM_INIT;
}
break;
case 15:
case TRANS_MODE_SANDSTORM_END:
Audio_PlaySoundGeneral(NA_SE_EV_SAND_STORM - SFX_FLAG, &gSfxDefaultPos, 4,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
if (globalCtx->sceneLoadFlag == -0x14) {
if (globalCtx->transitionTrigger == TRANS_TRIGGER_END) {
if (globalCtx->envCtx.sandstormPrimA <= 0) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
}
break;
case 16:
D_801614C8 = 0;
case TRANS_MODE_CS_BLACK_FILL_INIT:
sTransitionFillTimer = 0;
globalCtx->envCtx.fillScreen = true;
globalCtx->envCtx.screenFillColor[0] = 0;
globalCtx->envCtx.screenFillColor[1] = 0;
globalCtx->envCtx.screenFillColor[2] = 0;
globalCtx->envCtx.screenFillColor[3] = 255;
globalCtx->transitionMode = 17;
globalCtx->transitionMode = TRANS_MODE_CS_BLACK_FILL;
break;
case 17:
if (gSaveContext.unk_1410 != 0) {
globalCtx->envCtx.screenFillColor[3] = gSaveContext.unk_1410;
if (gSaveContext.unk_1410 < 0x65) {
case TRANS_MODE_CS_BLACK_FILL:
if (gSaveContext.cutsceneTransitionControl != 0) {
globalCtx->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl;
if (gSaveContext.cutsceneTransitionControl <= 100) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
globalCtx->sceneLoadFlag = 0;
globalCtx->transitionMode = 0;
globalCtx->transitionTrigger = TRANS_TRIGGER_OFF;
globalCtx->transitionMode = TRANS_MODE_OFF;
}
}
break;
@ -1116,7 +1150,8 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
gfxP = Graph_GfxPlusOne(sp1CC);
gSPDisplayList(OVERLAY_DISP++, gfxP);
if ((globalCtx->transitionMode == 3) || (globalCtx->transitionMode == 11) ||
if ((globalCtx->transitionMode == TRANS_MODE_INSTANCE_RUNNING) ||
(globalCtx->transitionMode == TRANS_MODE_INSTANCE_WAIT) ||
(globalCtx->transitionCtx.transitionType >= 56)) {
View view;
@ -1271,7 +1306,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
}
if ((HREG(80) != 10) || (HREG(88) != 0)) {
if (globalCtx->envCtx.sandstormState != 0) {
if (globalCtx->envCtx.sandstormState != SANDSTORM_OFF) {
Environment_DrawSandstorm(globalCtx, globalCtx->envCtx.sandstormState);
}
}
@ -1756,14 +1791,14 @@ void Gameplay_TriggerVoidOut(GlobalContext* globalCtx) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwchFlags = globalCtx->actorCtx.flags.tempSwch;
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = globalCtx->actorCtx.flags.tempCollect;
gSaveContext.respawnFlag = 1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
}
void Gameplay_LoadToLastEntrance(GlobalContext* globalCtx) {
gSaveContext.respawnFlag = -1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
if ((globalCtx->sceneNum == SCENE_GANON_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_FINAL) ||
(globalCtx->sceneNum == SCENE_GANONTIKA_SONOGO) || (globalCtx->sceneNum == SCENE_GANON_DEMO)) {
@ -1776,7 +1811,7 @@ void Gameplay_LoadToLastEntrance(GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = gSaveContext.entranceIndex;
}
globalCtx->fadeTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
}
void Gameplay_TriggerRespawn(GlobalContext* globalCtx) {

View file

@ -481,7 +481,7 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) {
s32 Player_InBlockingCsMode(GlobalContext* globalCtx, Player* this) {
return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csMode != 0) ||
(globalCtx->sceneLoadFlag == 0x14) || (this->stateFlags1 & PLAYER_STATE1_0) ||
(globalCtx->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) ||
(this->stateFlags3 & PLAYER_STATE3_7) ||
((gSaveContext.unk_13F0 != 0) && (Player_ActionToMagicSpell(this, this->itemActionParam) >= 0));
}

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1497,9 +1497,9 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx)
}
if (this->csTimer == 180) {
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->nextEntranceIndex = 0x43F;
globalCtx->fadeTransition = 5;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
}
break;

View file

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

View file

@ -868,8 +868,8 @@ void func_80986B2C(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
globalCtx->nextEntranceIndex = 0xCD;
globalCtx->fadeTransition = 38;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
func_8002DF54(globalCtx, &player->actor, 8);
}
}

View file

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

View file

@ -494,7 +494,8 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
this->warpTimer++;
if (sWarpTimerTarget < this->warpTimer && gSaveContext.nextCutsceneIndex == 0xFFEF) {
osSyncPrintf("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", globalCtx->sceneLoadFlag, 0x14);
osSyncPrintf("\n\n\nじかんがきたからおーしまい fade_direction=[%d]", globalCtx->transitionTrigger,
TRANS_TRIGGER_START);
if (globalCtx->sceneNum == SCENE_DDAN_BOSS) {
if (!Flags_GetEventChkInf(0x25)) {
@ -522,9 +523,9 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
gSaveContext.nextCutsceneIndex = 0;
}
osSyncPrintf("\n\n\nおわりおわり");
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 7;
gSaveContext.nextTransition = 3;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_SLOW;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
}
Math_StepToF(&this->unk_194, 2.0f, 0.01f);
@ -608,8 +609,8 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
Item_Give(globalCtx, ITEM_ZORA_SAPPHIRE);
globalCtx->nextEntranceIndex = 0x10E;
gSaveContext.nextCutsceneIndex = 0xFFF0;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 7;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_SLOW;
}
Math_StepToF(&this->unk_194, 2.0f, 0.01f);
@ -777,9 +778,9 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
gSaveContext.nextCutsceneIndex = 0;
}
}
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 7;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE_SLOW;
}
if (this->warpTimer >= 141) {
f32 screenFillAlpha;

View file

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

View file

@ -236,8 +236,8 @@ void EnGe1_KickPlayer(EnGe1* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = 0x3B4;
}
globalCtx->fadeTransition = 0x26;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -582,8 +582,8 @@ void EnGe1_BeginGame_Archery(EnGe1* this, GlobalContext* globalCtx) {
Rupees_ChangeBy(-20);
globalCtx->nextEntranceIndex = 0x129;
gSaveContext.nextCutsceneIndex = 0xFFF0;
globalCtx->fadeTransition = 0x26;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.eventInf[0] |= 0x100;
gSaveContext.eventChkInf[6] |= 0x100;

View file

@ -245,8 +245,8 @@ void EnGe2_CaptureClose(EnGe2* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = 0x3B4;
}
globalCtx->fadeTransition = 0x26;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -271,8 +271,8 @@ void EnGe2_CaptureCharge(EnGe2* this, GlobalContext* globalCtx) {
globalCtx->nextEntranceIndex = 0x3B4;
}
globalCtx->fadeTransition = 0x26;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
}

View file

@ -1582,8 +1582,8 @@ void EnGeldB_Draw(Actor* thisx, GlobalContext* globalCtx) {
} else {
globalCtx->nextEntranceIndex = 0x3B4;
}
globalCtx->fadeTransition = 0x26;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
}
}

View file

@ -349,11 +349,11 @@ void EnHeishi1_Kick(EnHeishi1* this, GlobalContext* globalCtx) {
if (!this->loadStarted) {
gSaveContext.eventChkInf[4] |= 0x4000;
globalCtx->nextEntranceIndex = 0x4FA;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
this->loadStarted = true;
sPlayerIsCaught = false;
globalCtx->fadeTransition = 0x2E;
gSaveContext.nextTransition = 0x2E;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
}
}
}

View file

@ -204,10 +204,10 @@ void func_80A55D00(EnHeishi3* this, GlobalContext* globalCtx) {
(this->respawnFlag == 0)) {
gSaveContext.eventChkInf[4] |= 0x4000;
globalCtx->nextEntranceIndex = 0x47E; // Hyrule Castle from Guard Capture (outside)
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
this->respawnFlag = 1;
globalCtx->fadeTransition = 0x2E;
gSaveContext.nextTransition = 0x2E;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
gSaveContext.nextTransitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
}
}

View file

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

View file

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

View file

@ -316,16 +316,16 @@ s16 func_80A79500(GlobalContext* globalCtx, Actor* thisx) {
void func_80A795C8(EnIn* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 phi_a3;
s16 arg3;
if (this->skelAnime.animation == &object_in_Anim_0003B4 || this->skelAnime.animation == &object_in_Anim_001BE0 ||
this->skelAnime.animation == &object_in_Anim_013D60) {
phi_a3 = 1;
arg3 = 1;
} else {
phi_a3 = 0;
arg3 = 0;
}
if (this->actionFunc == func_80A7A568) {
phi_a3 = 4;
arg3 = 4;
}
if (this->actionFunc == func_80A7B024) {
this->unk_308.unk_18 = globalCtx->view.eye;
@ -334,7 +334,7 @@ void func_80A795C8(EnIn* this, GlobalContext* globalCtx) {
this->unk_308.unk_18 = player->actor.world.pos;
this->unk_308.unk_14 = 16.0f;
}
func_80034A14(&this->actor, &this->unk_308, 1, phi_a3);
func_80034A14(&this->actor, &this->unk_308, 1, arg3);
}
void func_80A79690(SkelAnime* skelAnime, EnIn* this, GlobalContext* globalCtx) {
@ -423,15 +423,15 @@ void func_80A79AB4(EnIn* this, GlobalContext* globalCtx) {
}
}
void func_80A79BAC(EnIn* this, GlobalContext* globalCtx, s32 index, u32 arg3) {
void func_80A79BAC(EnIn* this, GlobalContext* globalCtx, s32 index, u32 transitionType) {
s16 entrances[] = { 0x0558, 0x04CA, 0x0157 };
globalCtx->nextEntranceIndex = entrances[index];
if (index == 2) {
gSaveContext.nextCutsceneIndex = 0xFFF0;
}
globalCtx->fadeTransition = arg3;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = transitionType;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
func_8002DF54(globalCtx, &this->actor, 8);
Interface_ChangeAlpha(1);
if (index == 0) {
@ -638,7 +638,7 @@ void func_80A7A4BC(EnIn* this, GlobalContext* globalCtx) {
void func_80A7A4C8(EnIn* this, GlobalContext* globalCtx) {
if (this->unk_308.unk_00 == 2) {
func_80A79BAC(this, globalCtx, 1, 0x20);
func_80A79BAC(this, globalCtx, 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;
gSaveContext.infTable[10] &= ~4;
@ -652,7 +652,7 @@ void func_80A7A4C8(EnIn* this, GlobalContext* globalCtx) {
void func_80A7A568(EnIn* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 phi_a2;
s32 phi_a3;
s32 transitionType;
if (!(gSaveContext.eventChkInf[1] & 0x800) && (player->stateFlags1 & PLAYER_STATE1_23)) {
gSaveContext.infTable[10] |= 0x800;
@ -675,7 +675,7 @@ void func_80A7A568(EnIn* this, GlobalContext* globalCtx) {
(gSaveContext.eventInf[0] & ~0x10) | (((EnHorse*)GET_PLAYER(globalCtx)->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, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@ -687,9 +687,9 @@ void func_80A7A568(EnIn* this, GlobalContext* globalCtx) {
}
gSaveContext.eventInf[0] &= ~0xF;
phi_a2 = 0;
phi_a3 = 0x20;
transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
}
func_80A79BAC(this, globalCtx, phi_a2, phi_a3);
func_80A79BAC(this, globalCtx, phi_a2, transitionType);
globalCtx->msgCtx.stateTimer = 0;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
globalCtx->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
@ -721,7 +721,7 @@ void func_80A7A848(EnIn* this, GlobalContext* globalCtx) {
gSaveContext.eventInf[0] &= ~0xF;
this->actionFunc = func_80A7A4C8;
} else {
func_80A79BAC(this, globalCtx, 2, 0x26);
func_80A79BAC(this, globalCtx, 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;
globalCtx->msgCtx.stateTimer = 0;
@ -746,7 +746,7 @@ void func_80A7A940(EnIn* this, GlobalContext* globalCtx) {
}
if (this->unk_308.unk_00 == 2) {
this->actor.flags &= ~ACTOR_FLAG_16;
func_80A79BAC(this, globalCtx, 2, 0x26);
func_80A79BAC(this, globalCtx, 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;
globalCtx->msgCtx.stateTimer = 0;
@ -870,8 +870,8 @@ void func_80A7AEF0(EnIn* this, GlobalContext* globalCtx) {
yaw = Math_Vec3f_Yaw(&pos, &player->actor.world.pos);
if (ABS(yaw) > 0x4000) {
globalCtx->nextEntranceIndex = 0x0476;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 5;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
this->actionFunc = func_80A7B018;
} else if (this->unk_308.unk_00 == 2) {
globalCtx->msgCtx.stateTimer = 4;
@ -896,7 +896,7 @@ void func_80A7B024(EnIn* this, GlobalContext* globalCtx) {
gSaveContext.eventChkInf[1] |= 0x800;
gSaveContext.infTable[10] |= 0x800;
}
func_80A79BAC(this, globalCtx, 0, 0x26);
func_80A79BAC(this, globalCtx, 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;
globalCtx->msgCtx.stateTimer = 4;

View file

@ -387,8 +387,8 @@ void func_80AA1150(EnMa1* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) {
globalCtx->nextEntranceIndex = 0x157;
gSaveContext.nextCutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 42;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_WAVE, TCC_WHITE, TCS_FAST);
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
this->actionFunc = EnMa1_DoNothing;
}
}

View file

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

View file

@ -86,8 +86,8 @@ void EnMag_Init(Actor* thisx, GlobalContext* globalCtx) {
gSaveContext.unk_13E7 = 0;
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
Font_LoadOrderedFont(&this->font);
@ -130,8 +130,8 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) {
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
} else if (this->globalState >= MAG_STATE_DISPLAY) {
if (sDelayTimer == 0) {
@ -139,15 +139,15 @@ void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) {
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) ||
CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B)) {
if (globalCtx->sceneLoadFlag != 20) {
if (globalCtx->transitionTrigger != TRANS_TRIGGER_START) {
Audio_SetCutsceneFlag(0);
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
gSaveContext.gameMode = 2;
globalCtx->sceneLoadFlag = 20;
globalCtx->fadeTransition = 2;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
}
this->copyrightAlphaStep = 15;

View file

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

View file

@ -918,8 +918,8 @@ void EnOssan_State_StartConversation(EnOssan* this, GlobalContext* globalCtx, Pl
return;
case OSSAN_HAPPY_STATE_ANGRY:
globalCtx->nextEntranceIndex = 0x1D1;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->fadeTransition = 0x2E;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
return;
}

View file

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

View file

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

View file

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

View file

@ -2137,7 +2137,7 @@ void func_80834298(Player* this, GlobalContext* globalCtx) {
((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & PLAYER_STATE1_22)) &&
(gSaveContext.health != 0) && (globalCtx->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) &&
(globalCtx->shootingGalleryStatus == 0) && (globalCtx->activeCamera == MAIN_CAM) &&
(globalCtx->sceneLoadFlag != 0x14) && (gSaveContext.timer1State != 10)) {
(globalCtx->transitionTrigger != TRANS_TRIGGER_START) && (gSaveContext.timer1State != 10)) {
func_80833DF8(this, globalCtx);
}
@ -3233,7 +3233,8 @@ s32 func_80836FAC(GlobalContext* globalCtx, Player* this, f32* arg2, s16* arg3,
f32 temp_f14;
f32 temp_f12;
if ((this->unk_6AD != 0) || (globalCtx->sceneLoadFlag == 0x14) || (this->stateFlags1 & PLAYER_STATE1_0)) {
if ((this->unk_6AD != 0) || (globalCtx->transitionTrigger == TRANS_TRIGGER_START) ||
(this->stateFlags1 & PLAYER_STATE1_0)) {
*arg2 = 0.0f;
*arg3 = this->actor.shape.rot.y;
} else {
@ -4084,7 +4085,7 @@ void func_80838F5C(GlobalContext* globalCtx, Player* this) {
}
s32 func_80838FB8(GlobalContext* globalCtx, Player* this) {
if ((globalCtx->sceneLoadFlag == 0) && (this->stateFlags1 & PLAYER_STATE1_31)) {
if ((globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) && (this->stateFlags1 & PLAYER_STATE1_31)) {
func_80838F5C(globalCtx, this);
func_80832284(globalCtx, this, &gPlayerAnim_003040);
func_80832698(this, NA_SE_VO_LI_FALL_S);
@ -4124,8 +4125,8 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
if (this->actor.category == ACTORCAT_PLAYER) {
sp3C = 0;
if (!(this->stateFlags1 & PLAYER_STATE1_7) && (globalCtx->sceneLoadFlag == 0) && (this->csMode == 0) &&
!(this->stateFlags1 & PLAYER_STATE1_0) &&
if (!(this->stateFlags1 & PLAYER_STATE1_7) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) &&
(this->csMode == 0) && !(this->stateFlags1 & PLAYER_STATE1_0) &&
(((poly != NULL) && (sp3C = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, poly, bgId), sp3C != 0)) ||
(func_8083816C(D_808535E4) && (this->unk_A7A == 12)))) {
@ -4144,8 +4145,8 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
if (globalCtx->nextEntranceIndex == 0x7FFF) {
gSaveContext.respawnFlag = 2;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
globalCtx->fadeTransition = 3;
gSaveContext.nextTransition = 3;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
} else if (globalCtx->nextEntranceIndex >= 0x7FF9) {
globalCtx->nextEntranceIndex =
D_808544F8[D_80854514[globalCtx->nextEntranceIndex - 0x7FF9] + globalCtx->curSpawn];
@ -4159,7 +4160,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
gSaveContext.unk_13C3 = 1;
func_800994A0(globalCtx);
}
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
if (!(this->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_29)) &&
@ -4205,7 +4206,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
return 1;
} else {
if (globalCtx->sceneLoadFlag == 0) {
if (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF) {
if ((this->actor.world.pos.y < -4000.0f) ||
(((this->unk_A7A == 5) || (this->unk_A7A == 12)) &&
@ -4219,7 +4220,7 @@ s32 func_80839034(GlobalContext* globalCtx, Player* this, CollisionPoly* poly, u
} else {
Gameplay_TriggerVoidOut(globalCtx);
}
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
func_80078884(NA_SE_OC_ABYSS);
} else {
func_80838F5C(globalCtx, this);
@ -10338,8 +10339,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
: &gPlayerAnim_002878);
}
} else {
if ((this->actor.parent == NULL) &&
((globalCtx->sceneLoadFlag == 0x14) || (this->unk_A87 != 0) || !func_808382DC(this, globalCtx))) {
if ((this->actor.parent == NULL) && ((globalCtx->transitionTrigger == TRANS_TRIGGER_START) ||
(this->unk_A87 != 0) || !func_808382DC(this, globalCtx))) {
func_8083AA10(this, globalCtx);
} else {
this->fallStartHeight = this->actor.world.pos.y;
@ -11495,7 +11496,7 @@ s32 func_8084C9BC(Player* this, GlobalContext* globalCtx) {
}
}
if ((globalCtx->csCtx.state == CS_STATE_IDLE) && (globalCtx->transitionMode == 0) &&
if ((globalCtx->csCtx.state == CS_STATE_IDLE) && (globalCtx->transitionMode == TRANS_MODE_OFF) &&
(EN_HORSE_CHECK_1(rideActor) || EN_HORSE_CHECK_4(rideActor))) {
this->stateFlags2 |= PLAYER_STATE2_22;
@ -12068,9 +12069,9 @@ s32 func_8084DFF4(GlobalContext* globalCtx, Player* this) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CLOSING) {
if (this->getItemId == GI_GAUNTLETS_SILVER) {
globalCtx->nextEntranceIndex = 0x0123;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
gSaveContext.nextCutsceneIndex = 0xFFF1;
globalCtx->fadeTransition = 0xF;
globalCtx->transitionType = TRANS_TYPE_SANDSTORM_END;
this->stateFlags1 &= ~PLAYER_STATE1_29;
func_80852FFC(globalCtx, NULL, 8);
}
@ -12678,7 +12679,7 @@ void func_8084F710(Player* this, GlobalContext* globalCtx) {
void func_8084F88C(Player* this, GlobalContext* globalCtx) {
LinkAnimation_Update(globalCtx, &this->skelAnime);
if ((this->unk_850++ > 8) && (globalCtx->sceneLoadFlag == 0)) {
if ((this->unk_850++ > 8) && (globalCtx->transitionTrigger == TRANS_TRIGGER_OFF)) {
if (this->unk_84F != 0) {
if (globalCtx->sceneNum == 9) {
@ -12690,16 +12691,16 @@ void func_8084F88C(Player* this, GlobalContext* globalCtx) {
Gameplay_TriggerVoidOut(globalCtx);
}
globalCtx->fadeTransition = 4;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
func_80078884(NA_SE_OC_ABYSS);
} else {
globalCtx->fadeTransition = 2;
gSaveContext.nextTransition = 2;
globalCtx->transitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.natureAmbienceId = 0xFF;
}
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
}
}
@ -13018,9 +13019,9 @@ void func_8085063C(Player* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.choiceIndex == 0) {
gSaveContext.respawnFlag = 3;
globalCtx->sceneLoadFlag = 0x14;
globalCtx->transitionTrigger = TRANS_TRIGGER_START;
globalCtx->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
globalCtx->fadeTransition = 5;
globalCtx->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
func_80088AF0(globalCtx);
return;
}

View file

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

View file

@ -3390,7 +3390,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
if (pauseCtx->promptChoice == 0) {
Gameplay_TriggerRespawn(globalCtx);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.health = 0x30;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;
@ -3406,7 +3406,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6);
osSyncPrintf(VT_RST);
} else {
globalCtx->state.running = 0;
globalCtx->state.running = false;
SET_NEXT_GAMESTATE(&globalCtx->state, Opening_Init, OpeningContext);
}
}