2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
decompile z_camera (#398)
* cleanup
* name camera action functions
* decompile a few small functions, name a few Camera struct members
* decompile camera data, decompile a few camera functions
* Split ASM for code_800BB0A0
* removing code_800BB0A0.s
* PR Requests, Camera WIP
* remove #define NON_MATCHING from db_camera
* rename code_8007BF90.c to z_olib.c, rename functions in z_olib.c
* camera wip
* rename some struct memebers, some decomp wip
* pr updates
* camera wip
* name some fields in Camera Struct, being making sense of Camera_Update
* Camera WIP
* wip
* wip
* add z64camera.h header, begin creating CameraSetting macros
* wip
* wip
* wip
* wip
* migrate camera bss to c
* match a couple functions in db_camera
* match some small db_camera functions
* wip
* migrate db_camera rodata, match a few functions
* remote db_camera.rodata.s
* match some of db_camera
* identify types of some unknown data pieces
* some small wip
* Match Camera_Init, some function changes, some struct name changes. Change unk_C0 and unk_CC to floats from Vec3fs
* add naming for a few more Camera struct members
* wip
* match func_80043F94
* Match Camera_Jump1
* document some of Camera_Jump1
* wip
* match Camera_Jump3
* Match Camera_Update, FeelsAmazing
* wip
* wip
* match Camera_SetParam
* minor cleanup
* wip
* wip
* match Camera_KeepOn0
* some documentation, modify some matching functions to match style of others.
* match Camera_Demo1
* match camera_demo9
* document Camera_Demo1 and Camera_Demo9
* wip
* Match camera_battle4
* match camera_unique2
* Match Camera_Unique3
* match camera_special6
* match Camera_Special5
* wip
* document camera_special6
* naming updates
* match camera_Unique1
* match Camera_Unique0
* wip
* Match Camera_CalcUpFromPitchYawRoll
* match func_80045508
* document Camera_Battle4
* document several camera functions, move camera data to separate file
* rename phi/theta to pitch/yaw
* wip
* uniq9 wip
* Camera_Unqiue9 OK
* document Camera_Unique9
* name unk_160 in camera struct
* wip
* wip
* minor updates
* fix conflicts
* wip
* wip
* Olib updates
* wip
* wip
* rename most Math3D functions, few matches, documentation
* wip
* document most of math3d
* wip
* wip
* wip
* pr updates
* Match Camera_Fixed4
* match func_80058E8C
* pr updates
* add missing comment block finalizer
* Merge math3dupdates
* match Camera_ChangeSetting
* Match Camera_ChangeMode
* match func_80058148
* Match Camera_Special9
* decompile the rest of camera data
* match Camera_Demo5
* name a few camera functions in z_play
* match func_80046CB4, some work on other fucntions
* wip
* impove some non matchings
* fix function rename
* match func_800588B4
* match Camera_Subj4
* wip
* Camera_Demo3 matching, Camera_Battle1 big progress
* Camera_Normal2 OK
* wip
* match Camera_Parallel1
* normalize some things across functions
* match Camera_Normal1
* Match Camera_Normal3
* some cleanup
* more cleanup
* more cleanup , match Camera_CalcDefaultPitch
* data formatting
* Match Camera_Jump2
* document Camera_Jump2
* Match Camera_KeepOn3
* document some of Camera_KeepOn3
* improve some non_matchings
* match func_80045C74 and func_800460A8
* code cleanup, documentation
* match Camera_KeepOn1
* Match Camera_Subj3
* Match Camera_Battle1
* remove non_matching from func_80044adc and func_80046e20
* name several members of Battle1
* more documentation on Battle1
* cleanup
* renaming Camera_Vec3fScaleXYZFactor to Camera_Vec3fTranslateByUnitVector
* reorganize update structs, remove final references to params, remove CameraParams union
* implement camera enums into player
* Renaming Camera_GetDir to Camera_GetInputDir, Camera_GetRealDir to Camera_GetCamDir, etc, implement camera enum's into player
* remove non-global camera variables from variables.h
* clean up some variable declarations
* finish pr comment updates
* fix some warnings
* data formatting
* finish commenting on data
* delete unused asm
* remove asm
Co-authored-by: fig <fig02srl@gmail.com>
2020-12-06 22:39:47 +00:00
|
|
|
#include "z64camera.h"
|
2021-11-09 02:15:37 +00:00
|
|
|
|
2022-06-06 19:37:25 +00:00
|
|
|
#include "assets/scenes/indoors/tokinoma/tokinoma_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot00/spot00_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot01/spot01_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot02/spot02_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot04/spot04_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot05/spot05_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot06/spot06_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot07/spot07_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot08/spot08_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot09/spot09_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot11/spot11_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot12/spot12_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot15/spot15_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot16/spot16_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot17/spot17_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot18/spot18_scene.h"
|
|
|
|
#include "assets/scenes/overworld/spot20/spot20_scene.h"
|
2021-11-09 02:15:37 +00:00
|
|
|
|
2022-06-06 19:37:25 +00:00
|
|
|
#include "assets/scenes/dungeons/bdan/bdan_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/ddan/ddan_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/ydan/ydan_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/ganontika/ganontika_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/ganon_tou/ganon_tou_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/jyasinboss/jyasinboss_scene.h"
|
|
|
|
#include "assets/scenes/dungeons/ice_doukutu/ice_doukutu_scene.h"
|
2021-11-09 02:15:37 +00:00
|
|
|
|
2022-06-06 19:37:25 +00:00
|
|
|
#include "assets/scenes/misc/hakaana_ouke/hakaana_ouke_scene.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
u16 D_8011E1C0 = 0;
|
|
|
|
u16 D_8011E1C4 = 0;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
typedef void (*CutsceneStateHandler)(PlayState*, CutsceneContext*);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064720(PlayState* play, CutsceneContext* csCtx);
|
|
|
|
void func_80064760(PlayState* play, CutsceneContext* csCtx);
|
|
|
|
void func_800647C0(PlayState* play, CutsceneContext* csCtx);
|
|
|
|
void func_80068C3C(PlayState* play, CutsceneContext* csCtx);
|
|
|
|
void func_80068D84(PlayState* play, CutsceneContext* csCtx);
|
|
|
|
void func_80068DC0(PlayState* play, CutsceneContext* csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
CutsceneStateHandler sCsStateHandlers1[] = {
|
|
|
|
func_80064720, func_80064760, func_80064720, func_80068D84, func_80064720,
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
CutsceneStateHandler sCsStateHandlers2[] = {
|
|
|
|
func_80064720, func_800647C0, func_80068C3C, func_80068DC0, func_80068C3C,
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
u8 sTitleCsState = 0;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
EntranceCutscene sEntranceCutsceneTable[] = {
|
2022-05-09 17:45:53 +00:00
|
|
|
{ ENTR_SPOT00_3, 2, EVENTCHKINF_A0, gHyruleFieldIntroCs },
|
|
|
|
{ ENTR_SPOT16_0, 2, EVENTCHKINF_A1, gDMTIntroCs },
|
|
|
|
{ ENTR_SPOT01_0, 2, EVENTCHKINF_A3, gKakarikoVillageIntroCs },
|
|
|
|
{ ENTR_SPOT07_0, 2, EVENTCHKINF_A4, gZorasDomainIntroCs },
|
|
|
|
{ ENTR_SPOT15_0, 1, EVENTCHKINF_A5, gHyruleCastleIntroCs },
|
|
|
|
{ ENTR_SPOT18_0, 2, EVENTCHKINF_A6, gGoronCityIntroCs },
|
|
|
|
{ ENTR_TOKINOMA_0, 2, EVENTCHKINF_A7, gTempleOfTimeIntroCs },
|
|
|
|
{ ENTR_YDAN_0, 2, EVENTCHKINF_A8, gDekuTreeIntroCs },
|
|
|
|
{ ENTR_SPOT00_11, 0, EVENTCHKINF_18, gHyruleFieldSouthEponaJumpCs },
|
|
|
|
{ ENTR_SPOT00_13, 0, EVENTCHKINF_18, gHyruleFieldEastEponaJumpCs },
|
|
|
|
{ ENTR_SPOT00_12, 0, EVENTCHKINF_18, gHyruleFieldWestEponaJumpCs },
|
|
|
|
{ ENTR_SPOT00_15, 0, EVENTCHKINF_18, gHyruleFieldGateEponaJumpCs },
|
|
|
|
{ ENTR_SPOT00_16, 1, EVENTCHKINF_A9, gHyruleFieldGetOoTCs },
|
|
|
|
{ ENTR_SPOT06_0, 2, EVENTCHKINF_B1, gLakeHyliaIntroCs },
|
|
|
|
{ ENTR_SPOT09_0, 2, EVENTCHKINF_B2, gGerudoValleyIntroCs },
|
|
|
|
{ ENTR_SPOT12_0, 2, EVENTCHKINF_B3, gGerudoFortressIntroCs },
|
|
|
|
{ ENTR_SPOT20_0, 2, EVENTCHKINF_B4, gLonLonRanchIntroCs },
|
|
|
|
{ ENTR_BDAN_0, 2, EVENTCHKINF_B5, gJabuJabuIntroCs },
|
|
|
|
{ ENTR_SPOT02_0, 2, EVENTCHKINF_B6, gGraveyardIntroCs },
|
|
|
|
{ ENTR_SPOT08_2, 2, EVENTCHKINF_B7, gZorasFountainIntroCs },
|
|
|
|
{ ENTR_SPOT11_0, 2, EVENTCHKINF_B8, gDesertColossusIntroCs },
|
|
|
|
{ ENTR_SPOT17_0, 2, EVENTCHKINF_B9, gDeathMountainCraterIntroCs },
|
|
|
|
{ ENTR_SPOT15_0, 0, EVENTCHKINF_BA, gGanonsCastleIntroCs },
|
|
|
|
{ ENTR_HAKAANA_OUKE_1, 2, EVENTCHKINF_5A, gSunSongGraveSunSongTeachPart2Cs },
|
|
|
|
{ ENTR_GANONTIKA_2, 2, EVENTCHKINF_BB, gForestBarrierCs },
|
|
|
|
{ ENTR_GANONTIKA_3, 2, EVENTCHKINF_BC, gWaterBarrierCs },
|
|
|
|
{ ENTR_GANONTIKA_4, 2, EVENTCHKINF_BD, gShadowBarrierCs },
|
|
|
|
{ ENTR_GANONTIKA_5, 2, EVENTCHKINF_BE, gFireBarrierCs },
|
|
|
|
{ ENTR_GANONTIKA_6, 2, EVENTCHKINF_BF, gLightBarrierCs },
|
|
|
|
{ ENTR_GANONTIKA_7, 2, EVENTCHKINF_AD, gSpiritBarrierCs },
|
|
|
|
{ ENTR_JYASINBOSS_0, 0, EVENTCHKINF_C0, gSpiritBossNabooruKnuckleIntroCs },
|
|
|
|
{ ENTR_SPOT12_17, 0, EVENTCHKINF_C7, gGerudoFortressFirstCaptureCs },
|
|
|
|
{ ENTR_SPOT17_1, 2, EVENTCHKINF_B9, gDeathMountainCraterIntroCs },
|
|
|
|
{ ENTR_SPOT04_12, 2, EVENTCHKINF_C6, gKokiriForestDekuSproutCs },
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Unused, seems to be an early list of dungeon entrance cutscene locations
|
2021-11-09 02:15:37 +00:00
|
|
|
void* D_8011E304[] = {
|
|
|
|
gDekuTreeIntroCs, gJabuJabuIntroCs, gDcOpeningCs, gMinuetCs, gIceCavernSerenadeCs, gTowerBarrierCs,
|
|
|
|
};
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
u16 D_8015FCC0;
|
|
|
|
u16 D_8015FCC2;
|
|
|
|
u16 D_8015FCC4;
|
2022-05-12 18:35:31 +00:00
|
|
|
s16 sReturnToCamId;
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 D_8015FCC8;
|
2021-11-09 02:15:37 +00:00
|
|
|
s16 sQuakeIndex;
|
2020-04-16 21:36:12 +00:00
|
|
|
u16 D_8015FCCC; // only written to, never read
|
|
|
|
char D_8015FCD0[20]; // unreferenced
|
|
|
|
u8 D_8015FCE4; // only written to, never read
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80068ECC(PlayState* play, CutsceneContext* csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_DrawDebugInfo(PlayState* play, Gfx** dlist, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
GfxPrint printer;
|
2021-05-02 23:15:16 +00:00
|
|
|
s32 pad[2];
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-06-14 02:59:58 +00:00
|
|
|
GfxPrint_Init(&printer);
|
2020-03-17 04:31:30 +00:00
|
|
|
GfxPrint_Open(&printer, *dlist);
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
GfxPrint_SetPos(&printer, 22, 25);
|
|
|
|
GfxPrint_SetColor(&printer, 255, 255, 55, 32);
|
|
|
|
GfxPrint_Printf(&printer, "%s", "FLAME ");
|
|
|
|
GfxPrint_SetColor(&printer, 255, 255, 255, 32);
|
|
|
|
GfxPrint_Printf(&printer, "%06d", csCtx->frames);
|
|
|
|
GfxPrint_SetColor(&printer, 50, 255, 255, 60);
|
|
|
|
GfxPrint_SetPos(&printer, 4, 26);
|
|
|
|
GfxPrint_Printf(&printer, "%s", "SKIP=(START) or (Cursole Right)");
|
2021-05-02 23:15:16 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
*dlist = GfxPrint_Close(&printer);
|
2020-06-14 02:59:58 +00:00
|
|
|
GfxPrint_Destroy(&printer);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_8006450C(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
csCtx->unk_0C = 0.0f;
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064520(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_SKIPPABLE_INIT;
|
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064534(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064558(PlayState* play, CutsceneContext* csCtx) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex < 0xFFF0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
sCsStateHandlers1[csCtx->state](play, csCtx);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_800645A0(PlayState* play, CutsceneContext* csCtx) {
|
|
|
|
Input* input = &play->state.input[0];
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-11-15 21:33:44 +00:00
|
|
|
if (CHECK_BTN_ALL(input->press.button, BTN_DLEFT) && (csCtx->state == CS_STATE_IDLE) &&
|
2020-10-03 15:22:44 +00:00
|
|
|
(gSaveContext.sceneSetupIndex >= 4)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC8 = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2021-11-15 21:33:44 +00:00
|
|
|
if (CHECK_BTN_ALL(input->press.button, BTN_DUP) && (csCtx->state == CS_STATE_IDLE) &&
|
2021-03-31 16:18:31 +00:00
|
|
|
(gSaveContext.sceneSetupIndex >= 4) && !gDbgCamEnabled) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC8 = 1;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (play->transitionTrigger == TRANS_TRIGGER_START)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 0;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE)) {
|
2021-09-04 13:33:19 +00:00
|
|
|
osSyncPrintf("\nデモ開始要求 発令!"); // "Cutscene start request announcement!"
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
func_80068ECC(play, csCtx);
|
|
|
|
sCsStateHandlers2[csCtx->state](play, csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064720(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
u32 func_8006472C(PlayState* play, CutsceneContext* csCtx, f32 target) {
|
2020-12-26 10:44:53 +00:00
|
|
|
return Math_StepToF(&csCtx->unk_0C, target, 0.1f);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064760(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if (func_8006472C(play, csCtx, 1.0f)) {
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(1);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_800647C0(PlayState* play, CutsceneContext* csCtx) {
|
|
|
|
func_80068C3C(play, csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if (func_8006472C(play, csCtx, 1.0f)) {
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(1);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 3: Misc. Actions
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
|
|
|
Player* player = GET_PLAYER(play);
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 temp;
|
2021-11-09 02:15:37 +00:00
|
|
|
u8 sp3F = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-02-01 19:52:23 +00:00
|
|
|
if ((csCtx->frames < cmd->startFrame) || ((csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-09-20 16:51:35 +00:00
|
|
|
temp = Environment_LerpWeight(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-23 23:11:21 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
sp3F = 1;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2021-12-27 17:35:05 +00:00
|
|
|
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_4, 0x3F);
|
|
|
|
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 1);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 20;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2021-12-27 17:35:05 +00:00
|
|
|
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
|
2022-05-21 18:23:43 +00:00
|
|
|
Environment_AddLightningBolts(play, 3);
|
2021-09-20 16:51:35 +00:00
|
|
|
gLightningStrike.state = LIGHTNING_STRIKE_START;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_SetEnv(play, 0);
|
2022-05-09 17:45:53 +00:00
|
|
|
if (gSaveContext.entranceIndex == ENTR_TOKINOMA_0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_SetEnv(play, 2);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 6:
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->envCtx.adjFogFar < 12800) {
|
|
|
|
play->envCtx.adjFogFar += 35;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.changeSkyboxState = CHANGE_SKYBOX_REQUESTED;
|
|
|
|
play->envCtx.skyboxConfig = 1;
|
|
|
|
play->envCtx.changeSkyboxNextConfig = 0;
|
|
|
|
play->envCtx.changeSkyboxTimer = 60;
|
|
|
|
play->envCtx.changeLightEnabled = true;
|
|
|
|
play->envCtx.lightConfig = 0;
|
|
|
|
play->envCtx.changeLightNextConfig = 1;
|
|
|
|
play->envCtx.changeLightTimer = play->envCtx.changeDuration = 60;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 8:
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->roomCtx.unk_74[0] < 0x80) {
|
|
|
|
play->roomCtx.unk_74[0] += 4;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 9:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.precipitation[PRECIP_SNOW_MAX] = 16;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_SetEnv(play, 1);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 11:
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->roomCtx.unk_74[0] < 0x672) {
|
|
|
|
play->roomCtx.unk_74[0] += 0x14;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
|
|
|
if (csCtx->frames == 0x30F) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80078884(NA_SE_EV_DEKU_DEATH);
|
2020-03-23 23:11:21 +00:00
|
|
|
} else if (csCtx->frames == 0x2CD) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->roomCtx.unk_74[0] = 0;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2020-03-23 23:11:21 +00:00
|
|
|
if (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 13:
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->roomCtx.unk_74[1] == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_80078884(NA_SE_EV_TRIFORCE_FLASH);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->roomCtx.unk_74[1] < 0xFF) {
|
|
|
|
play->roomCtx.unk_74[1] += 5;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 14:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2022-06-21 00:31:53 +00:00
|
|
|
Play_SetViewpoint(play, VIEWPOINT_LOCKED);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 15:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, player->giObjectSegment, 160, 120, 144, 24, 20);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 16:
|
2020-03-22 21:19:43 +00:00
|
|
|
if (sp3F != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
sQuakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 6);
|
2021-11-09 02:15:37 +00:00
|
|
|
Quake_SetSpeed(sQuakeIndex, 0x7FFF);
|
|
|
|
Quake_SetQuakeValues(sQuakeIndex, 4, 0, 1000, 0);
|
|
|
|
Quake_SetCountdown(sQuakeIndex, 800);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 17:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2021-11-09 02:15:37 +00:00
|
|
|
Quake_RemoveFromIdx(sQuakeIndex);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 18:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.precipitation[PRECIP_RAIN_MAX] = 0;
|
|
|
|
play->envCtx.stormRequest = STORM_REQUEST_STOP;
|
2022-05-20 18:40:13 +00:00
|
|
|
if (gSaveContext.dayTime < CLOCK_TIME(7, 0)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime += 30;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->envCtx.precipitation[PRECIP_RAIN_CUR] == 0) {
|
2022-05-20 18:40:13 +00:00
|
|
|
gWeatherMode = WEATHER_MODE_CLEAR;
|
2021-12-27 17:35:05 +00:00
|
|
|
Audio_SetNatureAmbienceChannelIO(NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_1, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 19:
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_65);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 20:
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_67);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 21:
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_69);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 22:
|
2020-07-17 01:37:53 +00:00
|
|
|
D_801614B0.r = 255;
|
|
|
|
D_801614B0.g = 255;
|
|
|
|
D_801614B0.b = 255;
|
|
|
|
D_801614B0.a = 255;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 23:
|
2020-07-17 01:37:53 +00:00
|
|
|
D_801614B0.r = 255;
|
|
|
|
D_801614B0.g = 180;
|
|
|
|
D_801614B0.b = 100;
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801614B0.a = 255.0f * temp;
|
|
|
|
break;
|
|
|
|
case 24:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->roomCtx.curRoom.segment = NULL;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 25:
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime += 30;
|
2022-05-20 18:40:13 +00:00
|
|
|
if ((gSaveContext.dayTime) >= CLOCK_TIME(19, 0)) {
|
|
|
|
gSaveContext.dayTime = CLOCK_TIME(19, 0) - 1;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 26:
|
2022-05-20 18:40:13 +00:00
|
|
|
if ((gSaveContext.dayTime < CLOCK_TIME(4, 30)) || (gSaveContext.dayTime >= CLOCK_TIME(6, 30))) {
|
|
|
|
if ((gSaveContext.dayTime >= CLOCK_TIME(6, 30)) && (gSaveContext.dayTime < CLOCK_TIME(16, 0))) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.lightSettingOverride = 1;
|
2022-05-20 18:40:13 +00:00
|
|
|
} else if ((gSaveContext.dayTime >= CLOCK_TIME(16, 0)) &&
|
|
|
|
(gSaveContext.dayTime <= CLOCK_TIME(18, 30))) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.lightSettingOverride = 2;
|
2020-03-23 23:11:21 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.lightSettingOverride = 3;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 27:
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->state.frames & 8) {
|
|
|
|
if (play->envCtx.adjAmbientColor[0] < 40) {
|
|
|
|
play->envCtx.adjAmbientColor[0] += 2;
|
|
|
|
play->envCtx.adjLight1Color[1] -= 3;
|
|
|
|
play->envCtx.adjLight1Color[2] -= 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
if (play->envCtx.adjAmbientColor[0] > 2) {
|
|
|
|
play->envCtx.adjAmbientColor[0] -= 2;
|
|
|
|
play->envCtx.adjLight1Color[1] += 3;
|
|
|
|
play->envCtx.adjLight1Color[2] += 3;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 28:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->unk_11DE9 = true;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 29:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->unk_11DE9 = false;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 30:
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_SetEnv(play, 3);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 31:
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_SetEnv(play, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
2020-03-23 23:11:21 +00:00
|
|
|
if (sp3F != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.sandstormState = SANDSTORM_FILL;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-07-05 03:30:21 +00:00
|
|
|
func_800788CC(NA_SE_EV_SAND_STORM - SFX_FLAG);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 33:
|
2021-09-20 16:51:35 +00:00
|
|
|
gSaveContext.sunsSongState = SUNSSONG_START;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 34:
|
2021-08-21 23:12:57 +00:00
|
|
|
if (IS_DAY) {
|
2022-05-20 18:40:13 +00:00
|
|
|
gSaveContext.dayTime -= gTimeSpeed;
|
2020-03-23 23:11:21 +00:00
|
|
|
} else {
|
2022-05-20 18:40:13 +00:00
|
|
|
gSaveContext.dayTime -= gTimeSpeed * 2;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 35:
|
2022-05-09 16:59:23 +00:00
|
|
|
AudioOcarina_PlayLongScarecrowAfterCredits();
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames = cmd->startFrame - 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 4: Set Environment Lighting
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_SetLighting(PlayState* play, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.lightSettingOverride = cmd->setting - 1;
|
|
|
|
play->envCtx.lightBlend = 1.0f;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x56: Play Background Music
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_PlayBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F595C(cmd->sequence - 1);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x57: Stop Background Music
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_StopBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusicChange* cmd) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800F59E8(cmd->sequence - 1);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x7C: Fade Background Music over duration
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_FadeBGM(PlayState* play, CutsceneContext* csCtx, CsCmdMusicFade* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 var1;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
var1 = cmd->endFrame - cmd->startFrame;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->type == 3) {
|
2021-11-30 18:47:09 +00:00
|
|
|
Audio_QueueSeqCmd(var1 << 0x10 | (0x1 << 28 | SEQ_PLAYER_FANFARE << 24 | 0xFF));
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2021-11-30 18:47:09 +00:00
|
|
|
Audio_QueueSeqCmd(var1 << 0x10 | (0x1 << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xFF));
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 9: ?
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_09(PlayState* play, CutsceneContext* csCtx, CsCmdUnknown9* cmd) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800AA000(0.0f, cmd->unk_06, cmd->unk_07, cmd->unk_08);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x8C: Set Time of Day & Environment Time
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80065134(PlayState* play, CutsceneContext* csCtx, CsCmdDayTime* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 temp1;
|
|
|
|
s16 temp2;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == cmd->startFrame) {
|
2021-03-31 16:18:31 +00:00
|
|
|
temp1 = (cmd->hour * 60.0f) / (360.0f / 0x4000);
|
|
|
|
temp2 = (cmd->minute + 1) / (360.0f / 0x4000);
|
2020-04-08 16:45:50 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.dayTime = temp1 + temp2;
|
2021-09-20 16:51:35 +00:00
|
|
|
gSaveContext.skyboxTime = temp1 + temp2;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x3E8: Code Execution (& Terminates Cutscene?)
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
|
|
|
Player* player = GET_PLAYER(play);
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 temp = 0;
|
|
|
|
|
2022-06-24 01:32:48 +00:00
|
|
|
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (gSaveContext.gameMode != GAMEMODE_END_CREDITS) &&
|
|
|
|
(play->sceneNum != SCENE_SPOT00) && (csCtx->frames > 20) &&
|
2022-05-21 18:23:43 +00:00
|
|
|
(CHECK_BTN_ALL(play->state.input[0].press.button, BTN_A) ||
|
|
|
|
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_B) ||
|
|
|
|
CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START)) &&
|
|
|
|
(gSaveContext.fileNum != 0xFEDC) && (play->transitionTrigger == TRANS_TRIGGER_OFF)) {
|
2022-07-30 13:05:27 +00:00
|
|
|
Audio_PlaySfxGeneral(NA_SE_SY_PIECE_OF_HEART, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
|
|
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
2020-03-17 04:31:30 +00:00
|
|
|
temp = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
|
2022-05-21 18:23:43 +00:00
|
|
|
((csCtx->frames > 20) && CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(gSaveContext.fileNum != 0xFEDC))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(0);
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.cutsceneTransitionControl = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-09-04 13:33:19 +00:00
|
|
|
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); // "Future fork designation=No. [%d]"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-24 01:32:48 +00:00
|
|
|
if ((gSaveContext.gameMode != GAMEMODE_NORMAL) && (csCtx->frames != cmd->startFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
gSaveContext.unk_13E7 = 1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT09_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT16_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 5:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 6:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 7:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_INSTANT;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
gSaveContext.fw.set = 0;
|
|
|
|
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
|
2022-04-29 18:19:48 +00:00
|
|
|
if (!GET_EVENTCHKINF(EVENTCHKINF_45)) {
|
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_45);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_INSTANT;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.sceneSetupIndex < 4) {
|
2021-08-21 23:12:57 +00:00
|
|
|
if (!LINK_IS_ADULT) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_2;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 9:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT09_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FILL_BROWN;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_LINK_HOME_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 11:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 12:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT16_5;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 13:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT08_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 14:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_11;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 15:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 16:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 17:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 18:
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_4F);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_4;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 19:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT16_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0x8000;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 21:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT06_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 22:
|
2022-05-21 18:23:43 +00:00
|
|
|
Item_Give(play, ITEM_SONG_REQUIEM);
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT11_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 23:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 24:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_BDAN_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 25:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 26:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 27:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 28:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 29:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.chamberCutsceneNum = 0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 30:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
|
|
|
Item_Give(play, ITEM_MEDALLION_FIRE);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.chamberCutsceneNum = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 31:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.chamberCutsceneNum = 2;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 32:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_INSTANT;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 33:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 34:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 35:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 38:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 39:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF9;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 40:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFA;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 41:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT06_5;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 42:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT01_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 43:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HAKASITARELAY_2;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 44:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_3;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 46:
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_4F);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_4;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 47:
|
2022-05-21 18:23:43 +00:00
|
|
|
Item_Give(play, ITEM_SONG_NOCTURNE);
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_54);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT01_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 48:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT11_4;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_SANDSTORM_END;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_SANDSTORM_END;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 49:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_5;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK_FAST;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 50:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT01_13;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE_INSTANT;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 51:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_WHITE, TCS_SLOW);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 52:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_INSTANT;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 53:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_16;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 54:
|
2022-06-24 01:32:48 +00:00
|
|
|
gSaveContext.gameMode = GAMEMODE_END_CREDITS;
|
2022-07-30 13:05:27 +00:00
|
|
|
Audio_SetSfxBanksMute(0x6F);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT09_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 55:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT12_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 56:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT01_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 57:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT16_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 58:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT18_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 59:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT06_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 60:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT08_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 61:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT07_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 62:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 63:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 64:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 65:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 66:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT01_14;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 67:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_9;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 68:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 69:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_12;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 70:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT16_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 71:
|
2022-04-30 16:18:56 +00:00
|
|
|
gSaveContext.equips.equipment |= EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4);
|
2022-05-21 18:23:43 +00:00
|
|
|
Player_SetEquipmentData(play, player);
|
2022-04-30 16:18:56 +00:00
|
|
|
gSaveContext.equips.equipment |= EQUIP_VALUE_BOOTS_KOKIRI << (EQUIP_TYPE_BOOTS * 4);
|
2022-05-21 18:23:43 +00:00
|
|
|
Player_SetEquipmentData(play, player);
|
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 72:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_NAKANIWA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 73:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 74:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 75:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF4;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 76:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF5;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 77:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_CHILD;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 78:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 79:
|
|
|
|
case 80:
|
|
|
|
case 81:
|
|
|
|
case 82:
|
|
|
|
case 83:
|
|
|
|
case 84:
|
|
|
|
case 85:
|
|
|
|
case 86:
|
|
|
|
case 87:
|
|
|
|
case 88:
|
|
|
|
case 89:
|
|
|
|
case 90:
|
|
|
|
case 91:
|
|
|
|
case 92:
|
|
|
|
case 93:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 94:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT20_1;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 95:
|
2022-04-29 18:19:48 +00:00
|
|
|
if (GET_EVENTCHKINF(EVENTCHKINF_48) && GET_EVENTCHKINF(EVENTCHKINF_49) &&
|
|
|
|
GET_EVENTCHKINF(EVENTCHKINF_4A)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
switch (gSaveContext.sceneSetupIndex) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 8:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT05_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 9:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT17_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 10:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT06_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 96:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-04-29 18:19:48 +00:00
|
|
|
SET_EVENTCHKINF(EVENTCHKINF_C8);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT11_8;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 97:
|
2020-04-16 21:36:12 +00:00
|
|
|
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_KENJYANOMA_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE_FAST;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT02_8;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 98:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT17_5;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 99:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT05_3;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 100:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT04_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 101:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT11_6;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_SANDSTORM_END;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 102:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_TOKINOMA_6;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 103:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF3;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 104:
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (sTitleCsState) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 0:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_JYASINBOSS_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF2;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState++;
|
|
|
|
break;
|
|
|
|
case 1:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT17_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState++;
|
|
|
|
break;
|
|
|
|
case 2:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HIRAL_DEMO_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF6;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
sTitleCsState = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 105:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT02_0;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF1;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 106:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_HAKAANA_OUKE_1;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 107:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_2;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 108:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_3;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 109:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_4;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 110:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_5;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 111:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_6;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 112:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_GANONTIKA_7;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 113:
|
2022-04-29 18:19:48 +00:00
|
|
|
if (Flags_GetEventChkInf(EVENTCHKINF_BB) && Flags_GetEventChkInf(EVENTCHKINF_BC) &&
|
|
|
|
Flags_GetEventChkInf(EVENTCHKINF_BD) && Flags_GetEventChkInf(EVENTCHKINF_BE) &&
|
|
|
|
Flags_GetEventChkInf(EVENTCHKINF_BF) && Flags_GetEventChkInf(EVENTCHKINF_AD)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTowerBarrierCs);
|
|
|
|
play->csCtx.frames = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 1;
|
|
|
|
gSaveContext.cutsceneIndex = 0xFFFF;
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFF;
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 114:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_3;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 115:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_17;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_BLACK;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 116:
|
2022-04-29 18:19:48 +00:00
|
|
|
if (GET_EVENTCHKINF(EVENTCHKINF_C8)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT02_8;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_SPOT11_8;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 117:
|
2022-06-24 01:32:48 +00:00
|
|
|
gSaveContext.gameMode = GAMEMODE_END_CREDITS;
|
2022-07-30 13:05:27 +00:00
|
|
|
Audio_SetSfxBanksMute(0x6F);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->linkAgeOnLoad = LINK_AGE_ADULT;
|
|
|
|
play->nextEntranceIndex = ENTR_SPOT00_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF7;
|
2022-05-21 18:23:43 +00:00
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 118:
|
2022-05-09 17:45:53 +00:00
|
|
|
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = ENTR_GANON_DEMO_0;
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_TriggerVoidOut(play);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.respawnFlag = -2;
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case 119:
|
2022-05-20 18:40:13 +00:00
|
|
|
gSaveContext.dayTime = CLOCK_TIME(12, 0);
|
|
|
|
gSaveContext.skyboxTime = CLOCK_TIME(12, 0);
|
2022-05-21 18:23:43 +00:00
|
|
|
play->nextEntranceIndex = ENTR_NAKANIWA_1;
|
|
|
|
play->transitionTrigger = TRANS_TRIGGER_START;
|
|
|
|
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x2D: Transition Effects
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 temp;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames <= cmd->endFrame)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.fillScreen = true;
|
2021-09-20 16:51:35 +00:00
|
|
|
temp = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 1:
|
|
|
|
case 5:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 160;
|
|
|
|
play->envCtx.screenFillColor[1] = 160;
|
|
|
|
play->envCtx.screenFillColor[2] = 160;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 1) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = 255.0f * temp;
|
2022-05-09 17:45:53 +00:00
|
|
|
if ((temp == 0.0f) && (gSaveContext.entranceIndex == ENTR_KENJYANOMA_0)) {
|
2022-07-30 13:05:27 +00:00
|
|
|
Audio_PlaySfxGeneral(NA_SE_SY_WHITE_OUT_S, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
|
|
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
2022-05-09 17:45:53 +00:00
|
|
|
} else if ((temp == 0.0f) && ((gSaveContext.entranceIndex == ENTR_TOKINOMA_0) ||
|
|
|
|
(gSaveContext.entranceIndex == ENTR_SPOT15_0) ||
|
|
|
|
(gSaveContext.entranceIndex == ENTR_YOUSEI_IZUMI_YOKO_0))) {
|
2022-07-30 13:05:27 +00:00
|
|
|
Audio_PlaySfxGeneral(NA_SE_EV_WHITE_OUT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
|
|
|
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
2022-05-21 18:23:43 +00:00
|
|
|
} else if ((temp == 0.0f) && (play->sceneNum == SCENE_GANONTIKA)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800788CC(NA_SE_EV_WHITE_OUT);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 2:
|
|
|
|
case 6:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 0;
|
|
|
|
play->envCtx.screenFillColor[1] = 0;
|
|
|
|
play->envCtx.screenFillColor[2] = 255;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 2) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 3:
|
|
|
|
case 7:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 255;
|
|
|
|
play->envCtx.screenFillColor[1] = 0;
|
|
|
|
play->envCtx.screenFillColor[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 3) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 4:
|
|
|
|
case 8:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 0;
|
|
|
|
play->envCtx.screenFillColor[1] = 255;
|
|
|
|
play->envCtx.screenFillColor[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 4) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 9:
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.cutsceneTransitionControl = 1;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 10:
|
|
|
|
case 11:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 0;
|
|
|
|
play->envCtx.screenFillColor[1] = 0;
|
|
|
|
play->envCtx.screenFillColor[2] = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base == 10) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = (1.0f - temp) * 255.0f;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[3] = 255.0f * temp;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 12:
|
2022-04-27 20:00:25 +00:00
|
|
|
gSaveContext.cutsceneTransitionControl = 255.0f - (155.0f * temp);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2022-04-27 20:00:25 +00:00
|
|
|
|
2020-03-17 04:31:30 +00:00
|
|
|
case 13:
|
2022-05-21 18:23:43 +00:00
|
|
|
play->envCtx.screenFillColor[0] = 0;
|
|
|
|
play->envCtx.screenFillColor[1] = 0;
|
|
|
|
play->envCtx.screenFillColor[2] = 0;
|
|
|
|
play->envCtx.screenFillColor[3] = 255.0f - ((1.0f - temp) * 155.0f);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-12 18:35:31 +00:00
|
|
|
// Command 0x1 & 0x5: Camera Eye Points
|
2022-05-21 18:23:43 +00:00
|
|
|
s32 Cutscene_Command_CameraEyePoints(PlayState* play, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 shouldContinue = 1;
|
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((csCtx->unk_18 < cmdBase->startFrame) || (csCtx->unk_18 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1B = 1;
|
2022-05-12 18:35:31 +00:00
|
|
|
csCtx->subCamEyePoints = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1A != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_18 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_CameraChangeSetting(play, csCtx->subCamId, CAM_SET_CS_0);
|
|
|
|
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
|
|
|
|
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
|
|
|
|
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
|
|
|
|
Camera_SetCSParams(Play_GetCamera(play, csCtx->subCamId), csCtx->subCamLookAtPoints,
|
|
|
|
csCtx->subCamEyePoints, GET_PLAYER(play), relativeToLink);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
while (shouldContinue) {
|
2021-03-31 16:18:31 +00:00
|
|
|
if (((CutsceneCameraPoint*)cmd)->continueFlag == CS_CMD_STOP) {
|
2020-03-22 21:19:43 +00:00
|
|
|
shouldContinue = 0;
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd += 0x10;
|
|
|
|
size += 0x10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
2022-05-12 18:35:31 +00:00
|
|
|
// Command 0x2 & 0x6: Camera At Points
|
2022-05-21 18:23:43 +00:00
|
|
|
s32 Cutscene_Command_CameraLookAtPoints(PlayState* play, CutsceneContext* csCtx, u8* cmd, u8 relativeToLink) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 shouldContinue = 1;
|
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC0 < cmdBase->startFrame) || (D_8015FCC0 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1A = 1;
|
2022-05-12 18:35:31 +00:00
|
|
|
csCtx->subCamLookAtPoints = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1B != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC0 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_CameraChangeSetting(play, csCtx->subCamId, CAM_SET_CS_0);
|
|
|
|
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_WAIT);
|
|
|
|
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
|
|
|
|
Camera_ResetAnim(Play_GetCamera(play, csCtx->subCamId));
|
|
|
|
Camera_SetCSParams(Play_GetCamera(play, csCtx->subCamId), csCtx->subCamLookAtPoints,
|
|
|
|
csCtx->subCamEyePoints, GET_PLAYER(play), relativeToLink);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
while (shouldContinue) {
|
2021-03-31 16:18:31 +00:00
|
|
|
if (((CutsceneCameraPoint*)cmd)->continueFlag == CS_CMD_STOP) {
|
2020-03-22 21:19:43 +00:00
|
|
|
shouldContinue = 0;
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd += 0x10;
|
|
|
|
size += 0x10;
|
|
|
|
}
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x7: ? (Related to camera positons)
|
2022-05-21 18:23:43 +00:00
|
|
|
s32 Cutscene_Command_07(PlayState* play, CutsceneContext* csCtx, u8* cmd, u8 unused) {
|
2020-03-17 04:31:30 +00:00
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
Vec3f sp3C;
|
|
|
|
Vec3f sp30;
|
2022-05-12 18:35:31 +00:00
|
|
|
Camera* subCam;
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 sp28;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC2 < cmdBase->startFrame) || (D_8015FCC2 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1B = 1;
|
2022-05-12 18:35:31 +00:00
|
|
|
csCtx->subCamEyePoints = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1A != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC2 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
subCam = Play_GetCamera(play, csCtx->subCamId);
|
2022-05-12 18:35:31 +00:00
|
|
|
subCam->player = NULL;
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
|
|
|
|
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
|
|
|
|
Play_CameraChangeSetting(play, csCtx->subCamId, CAM_SET_FREE0);
|
2022-05-12 18:35:31 +00:00
|
|
|
sp28 = csCtx->subCamLookAtPoints->cameraRoll * 1.40625f;
|
|
|
|
Camera_SetParam(subCam, 64, &sp28);
|
|
|
|
sp3C.x = csCtx->subCamLookAtPoints->pos.x;
|
|
|
|
sp3C.y = csCtx->subCamLookAtPoints->pos.y;
|
|
|
|
sp3C.z = csCtx->subCamLookAtPoints->pos.z;
|
|
|
|
sp30.x = csCtx->subCamEyePoints->pos.x;
|
|
|
|
sp30.y = csCtx->subCamEyePoints->pos.y;
|
|
|
|
sp30.z = csCtx->subCamEyePoints->pos.z;
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_CameraSetAtEye(play, csCtx->subCamId, &sp3C, &sp30);
|
|
|
|
Play_CameraSetFov(play, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
size += 0x10;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x8: ? (Related to camera focus points)
|
2022-05-21 18:23:43 +00:00
|
|
|
s32 Cutscene_Command_08(PlayState* play, CutsceneContext* csCtx, u8* cmd, u8 unused) {
|
2020-03-17 04:31:30 +00:00
|
|
|
CsCmdBase* cmdBase = (CsCmdBase*)cmd;
|
|
|
|
s32 size;
|
|
|
|
Vec3f sp3C;
|
|
|
|
Vec3f sp30;
|
2022-05-12 18:35:31 +00:00
|
|
|
Camera* subCam;
|
2020-03-17 04:31:30 +00:00
|
|
|
f32 sp28;
|
|
|
|
|
|
|
|
cmd += 8;
|
|
|
|
size = 8;
|
|
|
|
|
|
|
|
if ((cmdBase->startFrame < csCtx->frames) && (csCtx->frames < cmdBase->endFrame) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
((D_8015FCC4 < cmdBase->startFrame) || (D_8015FCC4 >= 0xF000))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->unk_1A = 1;
|
2022-05-12 18:35:31 +00:00
|
|
|
csCtx->subCamLookAtPoints = (CutsceneCameraPoint*)cmd;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->unk_1B != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCC4 = cmdBase->startFrame;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
subCam = Play_GetCamera(play, csCtx->subCamId);
|
2022-05-12 18:35:31 +00:00
|
|
|
subCam->player = NULL;
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_ChangeCameraStatus(play, CAM_ID_MAIN, CAM_STAT_WAIT);
|
|
|
|
Play_ChangeCameraStatus(play, csCtx->subCamId, CAM_STAT_ACTIVE);
|
|
|
|
Play_CameraChangeSetting(play, csCtx->subCamId, CAM_SET_FREE0);
|
2022-05-12 18:35:31 +00:00
|
|
|
sp3C.x = csCtx->subCamLookAtPoints->pos.x;
|
|
|
|
sp3C.y = csCtx->subCamLookAtPoints->pos.y;
|
|
|
|
sp3C.z = csCtx->subCamLookAtPoints->pos.z;
|
|
|
|
sp30.x = csCtx->subCamEyePoints->pos.x;
|
|
|
|
sp30.y = csCtx->subCamEyePoints->pos.y;
|
|
|
|
sp30.z = csCtx->subCamEyePoints->pos.z;
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_CameraSetAtEye(play, csCtx->subCamId, &sp3C, &sp30);
|
|
|
|
Play_CameraSetFov(play, csCtx->subCamId, csCtx->subCamEyePoints->viewAngle);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
size += 0x10;
|
|
|
|
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Command 0x13: Textbox
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdTextbox* cmd) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 dialogState;
|
|
|
|
s16 originalCsFrames;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
|
|
|
if (cmd->type != 2) {
|
|
|
|
if (D_8011E1C0 != cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011E1C0 = cmd->base;
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((cmd->type == 3) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_StartTextbox(play, cmd->textId1, NULL);
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if ((cmd->type == 4) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_StartTextbox(play, cmd->textId1, NULL);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_StartTextbox(play, cmd->base, NULL);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
|
|
|
if (D_8011E1C4 != cmd->base) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011E1C4 = cmd->base;
|
2022-05-21 18:23:43 +00:00
|
|
|
func_8010BD58(play, cmd->base);
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames >= cmd->endFrame) {
|
2020-03-17 04:31:30 +00:00
|
|
|
originalCsFrames = csCtx->frames;
|
2022-05-21 18:23:43 +00:00
|
|
|
dialogState = Message_GetState(&play->msgCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
|
|
|
if ((dialogState != TEXT_STATE_CLOSING) && (dialogState != TEXT_STATE_NONE) &&
|
|
|
|
(dialogState != TEXT_STATE_SONG_DEMO_DONE) && (dialogState != TEXT_STATE_8)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames--;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if ((dialogState == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
|
|
|
|
if (play->msgCtx.choiceIndex == 0) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->textId1 != 0xFFFF) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_ContinueTextbox(play, cmd->textId1);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (cmd->textId2 != 0xFFFF) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_ContinueTextbox(play, cmd->textId2);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
|
|
|
if (dialogState == TEXT_STATE_9) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->textId1 != 0xFFFF) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Message_ContinueTextbox(play, cmd->textId1);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy
* Fix merge
* Some more progress
* Fix merge
* More z_message_PAL
* Small progress
* More small progress
* message_data_static files OK
* Prepare z_message_tables
* Matched another function, small updates
* Attempt to use asm-processor static-symbols branch
* Refactor text id declarations
* Begin large text codes parser function
* Fix merge
* Refactor done
* Build OK, add color and highscore names
* Remove encoded text headers and automatically encode during build
* Fix kanfont
* Various cleanups
* DISP macros
* Another match aside data
* Further progress
* Small improvements
* Deduplicate magic values for text control codes, small improvements
* Tiny progress
* Minor cleanups
* Clean up z_message_PAL comment
* Progress on large functions
* Further progress on large functions
* Changes to mkldscript to link .data in the .rodata section
* data OK
* Few improvements
* Use gDPLoadTextureBlock macros where appropriate
* rm z_message_tables, progress on large functions
* 2 more matches
* Improvements
* Small progress
* More progress on big function
* progress
* match func_80107980
* match Message_Update
* match func_8010BED8
* done
* Progress on remaining large functions
* Small progress on largest function
* Another match, extract text and move to assets, improve text build system
* Small nonmatchings improvements
* docs wip
* Largest function maybe equivalent
* Fix merge
* Document do_action values, largest function is almost instruction-matching
* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice
* Fix merge
* one match
* Last function is instruction-matching
* Fix
* Improvements thanks to engineer124
* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup
* More variables labeled, use text state enum everywhere
* More labels and names
* Fix
* Actor_IsTalking -> Actor_TalkRequested
* Match func_8010C39C and remove unused asm
* More docs
* Mostly ocarina related docs
* All msgModes named
* Fix assetclean
* Cleanup
* Extraction fixes and headers
* Suggestions
* Review suggestions
* Change text extraction again, only extract if the headers do not already exist
* Fix
* Use ast for charmap, fix assetclean for real this time
* Review suggestions
* BGM ids and ran formatter
* Review comments
* rename include_readonly to include_data_with_rodata
* Remove leading 0s in number directives
* Review suggestions for message_data_static
* textbox pos enum comments, rename several enum names from Message to TextBox
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-23 01:20:30 +00:00
|
|
|
if (dialogState == TEXT_STATE_EVENT) {
|
2022-05-21 18:23:43 +00:00
|
|
|
if (Message_ShouldAdvance(play)) {
|
|
|
|
func_8010BD58(play, cmd->base);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->frames == originalCsFrames) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
|
|
|
D_8011E1C0 = 0;
|
|
|
|
D_8011E1C4 = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_ProcessCommands(PlayState* play, CutsceneContext* csCtx, u8* cutscenePtr) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
s32 totalEntries;
|
|
|
|
s32 cmdType;
|
|
|
|
s32 cmdEntries;
|
|
|
|
CsCmdBase* cmd;
|
|
|
|
s32 cutsceneEndFrame;
|
|
|
|
s16 j;
|
|
|
|
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&totalEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cutsceneEndFrame, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cutsceneEndFrame < csCtx->frames) && (csCtx->state != CS_STATE_UNSKIPPABLE_EXEC)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_DRIGHT)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < totalEntries; i++) {
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdType, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmdType == -1) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
switch (cmdType) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case CS_CMD_MISC:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
func_80064824(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_LIGHTING:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_SetLighting(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_PLAYBGM:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_PlayBGM(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_STOPBGM:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_StopBGM(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_FADEBGM:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_FadeBGM(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_09:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_09(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SETTIME:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2022-05-21 18:23:43 +00:00
|
|
|
func_80065134(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_PLAYER_ACTION:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->linkAction = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_ACTOR_ACTION_1:
|
|
|
|
case 17:
|
|
|
|
case 18:
|
|
|
|
case 23:
|
|
|
|
case 34:
|
|
|
|
case 39:
|
|
|
|
case 46:
|
|
|
|
case 76:
|
|
|
|
case 85:
|
|
|
|
case 93:
|
|
|
|
case 105:
|
|
|
|
case 107:
|
|
|
|
case 110:
|
|
|
|
case 119:
|
|
|
|
case 123:
|
|
|
|
case 138:
|
|
|
|
case 139:
|
|
|
|
case 144:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[0] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_2:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 16:
|
|
|
|
case 24:
|
|
|
|
case 35:
|
|
|
|
case 40:
|
|
|
|
case 48:
|
|
|
|
case 64:
|
|
|
|
case 68:
|
|
|
|
case 70:
|
|
|
|
case 78:
|
|
|
|
case 80:
|
|
|
|
case 94:
|
|
|
|
case 116:
|
|
|
|
case 118:
|
|
|
|
case 120:
|
|
|
|
case 125:
|
|
|
|
case 131:
|
|
|
|
case 141:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[1] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_3:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 36:
|
|
|
|
case 41:
|
|
|
|
case 50:
|
|
|
|
case 67:
|
|
|
|
case 69:
|
|
|
|
case 72:
|
|
|
|
case 74:
|
|
|
|
case 81:
|
|
|
|
case 106:
|
|
|
|
case 117:
|
|
|
|
case 121:
|
|
|
|
case 126:
|
|
|
|
case 132:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[2] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_4:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 37:
|
|
|
|
case 42:
|
|
|
|
case 51:
|
|
|
|
case 53:
|
|
|
|
case 63:
|
|
|
|
case 65:
|
|
|
|
case 66:
|
|
|
|
case 75:
|
|
|
|
case 82:
|
|
|
|
case 108:
|
|
|
|
case 127:
|
|
|
|
case 133:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[3] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_5:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 38:
|
|
|
|
case 43:
|
|
|
|
case 47:
|
|
|
|
case 54:
|
|
|
|
case 79:
|
|
|
|
case 83:
|
|
|
|
case 128:
|
|
|
|
case 135:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[4] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_6:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 55:
|
|
|
|
case 77:
|
|
|
|
case 84:
|
|
|
|
case 90:
|
|
|
|
case 129:
|
|
|
|
case 136:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[5] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_7:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 52:
|
|
|
|
case 57:
|
|
|
|
case 58:
|
|
|
|
case 88:
|
|
|
|
case 115:
|
|
|
|
case 130:
|
|
|
|
case 137:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[6] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_8:
|
2020-03-17 04:31:30 +00:00
|
|
|
case 60:
|
|
|
|
case 89:
|
|
|
|
case 111:
|
|
|
|
case 114:
|
|
|
|
case 134:
|
|
|
|
case 142:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[7] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
case CS_CMD_SET_ACTOR_ACTION_9:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[8] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SET_ACTOR_ACTION_10:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((cmd->startFrame < csCtx->frames) && (csCtx->frames <= cmd->endFrame)) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[9] = (void*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
|
|
|
}
|
|
|
|
break;
|
2021-12-02 21:04:55 +00:00
|
|
|
case CS_CMD_CAM_EYE:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraEyePoints(play, csCtx, (void*)cutscenePtr, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2021-12-02 21:04:55 +00:00
|
|
|
case CS_CMD_CAM_EYE_REL_TO_PLAYER:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraEyePoints(play, csCtx, (void*)cutscenePtr, 1);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2021-12-02 21:04:55 +00:00
|
|
|
case CS_CMD_CAM_AT:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraLookAtPoints(play, csCtx, (void*)cutscenePtr, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
2021-12-02 21:04:55 +00:00
|
|
|
case CS_CMD_CAM_AT_REL_TO_PLAYER:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_CameraLookAtPoints(play, csCtx, (void*)cutscenePtr, 1);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case CS_CMD_07:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_07(play, csCtx, (void*)cutscenePtr, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case CS_CMD_08:
|
2022-05-21 18:23:43 +00:00
|
|
|
cutscenePtr += Cutscene_Command_08(play, csCtx, (void*)cutscenePtr, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
case CS_CMD_TERMINATOR:
|
|
|
|
cutscenePtr += 4;
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_Terminator(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 8;
|
|
|
|
break;
|
|
|
|
case CS_CMD_TEXTBOX:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cmd = (CsCmdBase*)cutscenePtr;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (cmd->base != 0xFFFF) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_Textbox(play, csCtx, (void*)cutscenePtr);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0xC;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CS_CMD_SCENE_TRANS_FX:
|
|
|
|
cutscenePtr += 4;
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_Command_TransitionFX(play, csCtx, (void*)cutscenePtr);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 8;
|
|
|
|
break;
|
|
|
|
default:
|
2022-05-01 22:06:35 +00:00
|
|
|
MemCpy(&cmdEntries, cutscenePtr, 4);
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 4;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (j = 0; j < cmdEntries; j++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
cutscenePtr += 0x30;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80068C3C(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Gfx* displayList;
|
|
|
|
Gfx* prevDisplayList;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (0) {} // Necessary to match
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneIndex >= 0xFFF0) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (0) {} // Also necessary to match
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (BREG(0) != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
OPEN_DISPS(play->state.gfxCtx, "../z_demo.c", 4101);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-10-29 21:31:09 +00:00
|
|
|
prevDisplayList = POLY_OPA_DISP;
|
|
|
|
displayList = Graph_GfxPlusOne(POLY_OPA_DISP);
|
|
|
|
gSPDisplayList(OVERLAY_DISP++, displayList);
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_DrawDebugInfo(play, &displayList, csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
gSPEndDisplayList(displayList++);
|
2020-04-04 16:12:59 +00:00
|
|
|
Graph_BranchDlist(prevDisplayList, displayList);
|
2020-10-29 21:31:09 +00:00
|
|
|
POLY_OPA_DISP = displayList;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
CLOSE_DISPS(play->state.gfxCtx, "../z_demo.c", 4108);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
csCtx->frames++;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (dREG(95) != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_ProcessCommands(play, csCtx, D_8012D1F0);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_ProcessCommands(play, csCtx, play->csCtx.segment);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80068D84(PlayState* play, CutsceneContext* csCtx) {
|
|
|
|
if (func_8006472C(play, csCtx, 0.0f)) {
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(0);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80068DC0(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if (func_8006472C(play, csCtx, 0.0f)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 10; i++) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[i] = NULL;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2021-09-04 13:33:19 +00:00
|
|
|
osSyncPrintf("\n\n\n\n\nやっぱりここかいな"); // "Right here, huh"
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0;
|
2022-06-24 01:32:48 +00:00
|
|
|
gSaveContext.gameMode = GAMEMODE_NORMAL;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2020-04-16 21:36:12 +00:00
|
|
|
switch (gSaveContext.entranceIndex) {
|
2020-03-17 04:31:30 +00:00
|
|
|
case 0x028A:
|
|
|
|
case 0x028E:
|
|
|
|
case 0x0292:
|
|
|
|
case 0x0476:
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_CopyCamera(play, sReturnToCamId, csCtx->subCamId);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
Play_ChangeCameraStatus(play, sReturnToCamId, CAM_STAT_ACTIVE);
|
|
|
|
Play_ClearCamera(play, csCtx->subCamId);
|
|
|
|
func_8005B1A4(play->cameraPtrs[sReturnToCamId]);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(0);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state = CS_STATE_IDLE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80068ECC(PlayState* play, CutsceneContext* csCtx) {
|
2020-03-17 04:31:30 +00:00
|
|
|
u8 i;
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_IDLE) && !Player_InCsMode(play)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFFD;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) {
|
2022-05-21 18:23:43 +00:00
|
|
|
Flags_UnsetEnv(play, 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
D_8011E1C0 = 0;
|
|
|
|
D_8011E1C4 = 0;
|
|
|
|
csCtx->unk_12 = 0;
|
|
|
|
csCtx->linkAction = NULL;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 10; i++) {
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
csCtx->npcActions[i] = NULL;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
csCtx->state++;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (csCtx->state == CS_STATE_SKIPPABLE_INIT) {
|
2021-08-30 00:08:41 +00:00
|
|
|
Audio_SetCutsceneFlag(1);
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
csCtx->frames = 0xFFFF;
|
|
|
|
csCtx->unk_18 = 0xFFFF;
|
|
|
|
D_8015FCC0 = 0xFFFF;
|
|
|
|
D_8015FCC2 = 0xFFFF;
|
|
|
|
D_8015FCC4 = 0xFFFF;
|
|
|
|
csCtx->unk_1A = 0;
|
|
|
|
csCtx->unk_1B = 0;
|
2022-05-21 18:23:43 +00:00
|
|
|
sReturnToCamId = play->activeCamId;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCC8 != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
csCtx->subCamId = Play_CreateSubCamera(play);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.cutsceneTrigger == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Interface_ChangeAlpha(1);
|
2020-07-09 01:54:39 +00:00
|
|
|
ShrinkWindow_SetVal(0x20);
|
|
|
|
ShrinkWindow_SetCurrentVal(0x20);
|
2020-03-17 04:31:30 +00:00
|
|
|
csCtx->state++;
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
func_80068C3C(play, csCtx);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_80069048(PlayState* play) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 i;
|
|
|
|
|
|
|
|
D_8015FCCC = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < 20; i++) {
|
|
|
|
; // Empty Loop
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCE4 = 0;
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void func_8006907C(PlayState* play) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8015FCCC != 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8015FCCC = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_HandleEntranceTriggers(PlayState* play) {
|
2020-03-17 04:31:30 +00:00
|
|
|
EntranceCutscene* entranceCutscene;
|
|
|
|
u8 requiredAge;
|
|
|
|
s16 i;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
entranceCutscene = &sEntranceCutsceneTable[i];
|
|
|
|
|
|
|
|
requiredAge = entranceCutscene->ageRestriction;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (requiredAge == 2) {
|
2020-04-16 21:36:12 +00:00
|
|
|
requiredAge = gSaveContext.linkAge;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.entranceIndex == entranceCutscene->entrance) &&
|
2022-04-29 18:19:48 +00:00
|
|
|
(!Flags_GetEventChkInf(entranceCutscene->flag) || (entranceCutscene->flag == EVENTCHKINF_18)) &&
|
2020-04-16 21:36:12 +00:00
|
|
|
(gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) &&
|
|
|
|
(gSaveContext.respawnFlag <= 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Flags_SetEventChkInf(entranceCutscene->flag);
|
2022-05-21 18:23:43 +00:00
|
|
|
Cutscene_SetSegment(play, entranceCutscene->segAddr);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneTrigger = 2;
|
2020-10-11 17:45:08 +00:00
|
|
|
gSaveContext.showTitleCard = false;
|
2020-03-17 04:31:30 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_HandleConditionalTriggers(PlayState* play) {
|
2020-10-13 03:15:42 +00:00
|
|
|
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", ((void)0, gSaveContext.respawnFlag));
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2022-06-24 01:32:48 +00:00
|
|
|
if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.respawnFlag <= 0) &&
|
|
|
|
(gSaveContext.cutsceneIndex < 0xFFF0)) {
|
2022-05-09 17:45:53 +00:00
|
|
|
if ((gSaveContext.entranceIndex == ENTR_SPOT11_1) && !Flags_GetEventChkInf(EVENTCHKINF_AC)) {
|
2022-04-29 18:19:48 +00:00
|
|
|
Flags_SetEventChkInf(EVENTCHKINF_AC);
|
2022-05-09 17:45:53 +00:00
|
|
|
gSaveContext.entranceIndex = ENTR_SPOT11_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-09 17:45:53 +00:00
|
|
|
} else if ((gSaveContext.entranceIndex == ENTR_SPOT01_0) && LINK_IS_ADULT && GET_EVENTCHKINF(EVENTCHKINF_48) &&
|
2022-04-29 18:19:48 +00:00
|
|
|
GET_EVENTCHKINF(EVENTCHKINF_49) && GET_EVENTCHKINF(EVENTCHKINF_4A) &&
|
|
|
|
!Flags_GetEventChkInf(EVENTCHKINF_AA)) {
|
|
|
|
Flags_SetEventChkInf(EVENTCHKINF_AA);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2022-05-09 17:45:53 +00:00
|
|
|
} else if ((gSaveContext.entranceIndex == ENTR_SPOT10_9) && !Flags_GetEventChkInf(EVENTCHKINF_C1)) {
|
2022-04-29 18:19:48 +00:00
|
|
|
Flags_SetEventChkInf(EVENTCHKINF_C1);
|
2022-05-21 18:23:43 +00:00
|
|
|
Item_Give(play, ITEM_OCARINA_FAIRY);
|
2022-05-09 17:45:53 +00:00
|
|
|
gSaveContext.entranceIndex = ENTR_SPOT10_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
|
|
|
} else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
2022-04-29 18:19:48 +00:00
|
|
|
LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_C4) &&
|
2020-10-13 03:15:42 +00:00
|
|
|
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA)) {
|
2022-04-29 18:19:48 +00:00
|
|
|
Flags_SetEventChkInf(EVENTCHKINF_C4);
|
2022-05-09 17:45:53 +00:00
|
|
|
gSaveContext.entranceIndex = ENTR_TOKINOMA_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF8;
|
2022-04-29 18:19:48 +00:00
|
|
|
} else if (!Flags_GetEventChkInf(EVENTCHKINF_C7) &&
|
2020-10-13 03:15:42 +00:00
|
|
|
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO)) {
|
2022-04-29 18:19:48 +00:00
|
|
|
Flags_SetEventChkInf(EVENTCHKINF_C7);
|
2022-05-09 17:45:53 +00:00
|
|
|
gSaveContext.entranceIndex = ENTR_GANON_DEMO_0;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.cutsceneIndex = 0xFFF0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-05-21 18:23:43 +00:00
|
|
|
void Cutscene_SetSegment(PlayState* play, void* segment) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (SEGMENT_NUMBER(segment) != 0) {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->csCtx.segment = SEGMENTED_TO_VIRTUAL(segment);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2022-05-21 18:23:43 +00:00
|
|
|
play->csCtx.segment = segment;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-05-27 07:48:07 +00:00
|
|
|
}
|