Entrance Macro (#987)

* POC

* fix

* Fix typo

* token POC

* The rest

* small cleanup

* More small cleanup

* ENTRANCE

* arg renames

* EntranceIndex -> Entrance

* format

* PR

* PR2

* Remove layer from entrance macro

* namefixer plus comments

* format
This commit is contained in:
Derek Hensley
2022-08-15 14:45:28 -04:00
committed by GitHub
parent 82fe521721
commit 132dd6a373
69 changed files with 687 additions and 419 deletions
+6 -6
View File
@@ -2154,8 +2154,8 @@ void Scene_HeaderCmdSetAreaVisitedFlag(PlayState* play, SceneCmd* cmd);
void Scene_HeaderCmdAnimatedMaterials(PlayState* play, SceneCmd* cmd);
void Scene_SetExitFade(PlayState* play);
s32 Scene_ProcessHeader(PlayState* play, SceneCmd* header);
u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup);
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex);
u16 Entrance_Create(s32 scene, s32 spawn, s32 layer);
u16 Entrance_CreateFromSpawn(s32 spawn);
void Scene_ExecuteDrawConfig(PlayState* play);
void Scene_DrawConfigDefault(PlayState* play);
Gfx* AnimatedMat_TexScroll(PlayState* play, AnimatedMatTexScrollParams* params);
@@ -2193,10 +2193,10 @@ void Scene_DrawConfig5(PlayState* play);
void Scene_DrawConfigMatAnimManualStep(PlayState* play);
void Scene_DrawConfigGreatBayTemple(PlayState* play);
EntranceTableEntry* Entrance_GetTableEntry(u16 entrance);
s32 Entrance_GetSceneNum(u16 entranceIndex);
s32 Entrance_GetSceneNumAbsolute(u16 entranceIndex);
s32 Entrance_GetSpawnNum(u16 entranceIndex);
s32 Entrance_GetTransitionFlags(u16 entranceIndex);
s32 Entrance_GetSceneNum(u16 entrance);
s32 Entrance_GetSceneNumAbsolute(u16 entrance);
s32 Entrance_GetSpawnNum(u16 entrance);
s32 Entrance_GetTransitionFlags(u16 entrance);
s32 Schedule_RunScript(PlayState* play, u8* script, ScheduleOutput* output);
void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
+1 -1
View File
@@ -1157,7 +1157,7 @@ struct PlayState {
/* 0x18875 */ s8 transitionTrigger; // "fade_direction"
/* 0x18876 */ s16 unk_18876;
/* 0x18878 */ s16 bgCoverAlpha;
/* 0x1887A */ u16 nextEntranceIndex;
/* 0x1887A */ u16 nextEntrance;
/* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus?
/* 0x1887D */ s8 unk_1887D;
/* 0x1887E */ s8 unk_1887E;
+1 -1
View File
@@ -166,7 +166,7 @@ typedef union CutsceneData {
typedef struct {
/* 0x0 */ CutsceneData* segmentedData;
/* 0x4 */ s16 nextEntranceIndex;
/* 0x4 */ s16 nextEntrance;
/* 0x6 */ u8 unk6;
/* 0x7 */ u8 unk7; // a weekEventReg bitpack?
} CutsceneEntry; // size = 0x8
+2 -2
View File
@@ -65,7 +65,7 @@ typedef struct RespawnData {
/* 0x00 */ Vec3f pos;
/* 0x0C */ s16 yaw;
/* 0x0E */ s16 playerParams;
/* 0x10 */ u16 entranceIndex;
/* 0x10 */ u16 entrance;
/* 0x12 */ u8 roomIndex;
/* 0x13 */ s8 data;
/* 0x14 */ u32 tempSwitchFlags;
@@ -121,7 +121,7 @@ typedef struct SavePlayerData {
} SavePlayerData; // size = 0x28
typedef struct Save {
/* 0x0000 */ u32 entranceIndex; // "scene_no"
/* 0x0000 */ u32 entrance; // "scene_no"
/* 0x0004 */ u8 equippedMask; // "player_mask"
/* 0x0005 */ u8 isFirstCycle; // "opening_flag"
/* 0x0006 */ u8 unk_06;
+122 -1
View File
@@ -648,7 +648,128 @@ typedef enum {
/* 0x6F */ SCENE_CLOCKTOWER,
/* 0x70 */ SCENE_ALLEY,
/* 0x71 */ SCENE_MAX
} SceneID;
} SceneId;
typedef enum {
/* 0x00 */ ENTR_SCENE_MAYORS_RESIDENCE,
/* 0x01 */ ENTR_SCENE_MAJORAS_LAIR,
/* 0x02 */ ENTR_SCENE_MAGIC_HAGS_POTION_SHOP,
/* 0x03 */ ENTR_SCENE_RANCH_HOUSE,
/* 0x04 */ ENTR_SCENE_HONEY_AND_DARLINGS_SHOP,
/* 0x05 */ ENTR_SCENE_BENEATH_THE_GRAVERYARD,
/* 0x06 */ ENTR_SCENE_SOUTHERN_SWAMP_CLEARED,
/* 0x07 */ ENTR_SCENE_CURIOSITY_SHOP,
/* 0x08 */ ENTR_SCENE_UNSET_08,
/* 0x09 */ ENTR_SCENE_UNSET_09,
/* 0x0A */ ENTR_SCENE_GROTTOS,
/* 0x0B */ ENTR_SCENE_UNSET_0B,
/* 0x0C */ ENTR_SCENE_UNSET_0C,
/* 0x0D */ ENTR_SCENE_UNSET_0D,
/* 0x0E */ ENTR_SCENE_CUTSCENE,
/* 0x0F */ ENTR_SCENE_UNSET_0F,
/* 0x10 */ ENTR_SCENE_IKANA_CANYON,
/* 0x11 */ ENTR_SCENE_PIRATES_FORTRESS,
/* 0x12 */ ENTR_SCENE_MILK_BAR,
/* 0x13 */ ENTR_SCENE_STONE_TOWER_TEMPLE,
/* 0x14 */ ENTR_SCENE_TREASURE_CHEST_SHOP,
/* 0x15 */ ENTR_SCENE_STONE_TOWER_TEMPLE_INVERTED,
/* 0x16 */ ENTR_SCENE_CLOCK_TOWER_ROOFTOP,
/* 0x17 */ ENTR_SCENE_OPENING_DUNGEON,
/* 0x18 */ ENTR_SCENE_WOODFALL_TEMPLE,
/* 0x19 */ ENTR_SCENE_PATH_TO_MOUNTAIN_VILLAGE,
/* 0x1A */ ENTR_SCENE_IKANA_CASTLE,
/* 0x1B */ ENTR_SCENE_DEKU_SCRUB_PLAYGROUND,
/* 0x1C */ ENTR_SCENE_ODOLWAS_LAIR,
/* 0x1D */ ENTR_SCENE_TOWN_SHOOTING_GALLERY,
/* 0x1E */ ENTR_SCENE_SNOWHEAD_TEMPLE,
/* 0x1F */ ENTR_SCENE_MILK_ROAD,
/* 0x20 */ ENTR_SCENE_PIRATES_FORTRESS_INTERIOR,
/* 0x21 */ ENTR_SCENE_SWAMP_SHOOTING_GALLERY,
/* 0x22 */ ENTR_SCENE_PINNACLE_ROCK,
/* 0x23 */ ENTR_SCENE_FAIRY_FOUNTAIN,
/* 0x24 */ ENTR_SCENE_SWAMP_SPIDER_HOUSE,
/* 0x25 */ ENTR_SCENE_OCEANSIDE_SPIDER_HOUSE,
/* 0x26 */ ENTR_SCENE_ASTRAL_OBSERVATORY,
/* 0x27 */ ENTR_SCENE_MOON_DEKU_TRIAL,
/* 0x28 */ ENTR_SCENE_DEKU_PALACE,
/* 0x29 */ ENTR_SCENE_MOUNTAIN_SMITHY,
/* 0x2A */ ENTR_SCENE_TERMINA_FIELD,
/* 0x2B */ ENTR_SCENE_POST_OFFICE,
/* 0x2C */ ENTR_SCENE_MARINE_RESEARCH_LAB,
/* 0x2D */ ENTR_SCENE_DAMPES_HOUSE,
/* 0x2E */ ENTR_SCENE_UNSET_2E,
/* 0x2F */ ENTR_SCENE_GORON_SHRINE,
/* 0x30 */ ENTR_SCENE_ZORA_HALL,
/* 0x31 */ ENTR_SCENE_TRADING_POST,
/* 0x32 */ ENTR_SCENE_ROMANI_RANCH,
/* 0x33 */ ENTR_SCENE_TWINMOLDS_LAIR,
/* 0x34 */ ENTR_SCENE_GREAT_BAY_COAST,
/* 0x35 */ ENTR_SCENE_ZORA_CAPE,
/* 0x36 */ ENTR_SCENE_LOTTERY_SHOP,
/* 0x37 */ ENTR_SCENE_UNSET_37,
/* 0x38 */ ENTR_SCENE_PIRATES_FORTRESS_EXTERIOR,
/* 0x39 */ ENTR_SCENE_FISHERMANS_HUT,
/* 0x3A */ ENTR_SCENE_GORON_SHOP,
/* 0x3B */ ENTR_SCENE_DEKU_KINGS_CHAMBER,
/* 0x3C */ ENTR_SCENE_MOON_GORON_TRIAL,
/* 0x3D */ ENTR_SCENE_ROAD_TO_SOUTHERN_SWAMP,
/* 0x3E */ ENTR_SCENE_DOGGY_RACETRACK,
/* 0x3F */ ENTR_SCENE_CUCCO_SHACK,
/* 0x40 */ ENTR_SCENE_IKANA_GRAVEYARD,
/* 0x41 */ ENTR_SCENE_GOHTS_LAIR,
/* 0x42 */ ENTR_SCENE_SOUTHERN_SWAMP_POISONED,
/* 0x43 */ ENTR_SCENE_WOODFALL,
/* 0x44 */ ENTR_SCENE_MOON_ZORA_TRIAL,
/* 0x45 */ ENTR_SCENE_GORON_VILLAGE_SPRING,
/* 0x46 */ ENTR_SCENE_GREAT_BAY_TEMPLE,
/* 0x47 */ ENTR_SCENE_WATERFALL_RAPIDS,
/* 0x48 */ ENTR_SCENE_BENEATH_THE_WELL,
/* 0x49 */ ENTR_SCENE_ZORA_HALL_ROOMS,
/* 0x4A */ ENTR_SCENE_GORON_VILLAGE_WINTER,
/* 0x4B */ ENTR_SCENE_GORON_GRAVERYARD,
/* 0x4C */ ENTR_SCENE_SAKONS_HIDEOUT,
/* 0x4D */ ENTR_SCENE_MOUNTAIN_VILLAGE_WINTER,
/* 0x4E */ ENTR_SCENE_GHOST_HUT,
/* 0x4F */ ENTR_SCENE_DEKU_SHRINE,
/* 0x50 */ ENTR_SCENE_ROAD_TO_IKANA,
/* 0x51 */ ENTR_SCENE_SWORDMANS_SCHOOL,
/* 0x52 */ ENTR_SCENE_MUSIC_BOX_HOUSE,
/* 0x53 */ ENTR_SCENE_IGOS_DU_IKANAS_LAIR,
/* 0x54 */ ENTR_SCENE_TOURIST_INFORMATION,
/* 0x55 */ ENTR_SCENE_STONE_TOWER,
/* 0x56 */ ENTR_SCENE_STONE_TOWER_INVERTED,
/* 0x57 */ ENTR_SCENE_MOUNTAIN_VILLAGE_SPRING,
/* 0x58 */ ENTR_SCENE_PATH_TO_SNOWHEAD,
/* 0x59 */ ENTR_SCENE_SNOWHEAD,
/* 0x5A */ ENTR_SCENE_PATH_TO_GORON_VILLAGE_WINTER,
/* 0x5B */ ENTR_SCENE_PATH_TO_GORON_VILLAGE_SPRING,
/* 0x5C */ ENTR_SCENE_GYORGS_LAIR,
/* 0x5D */ ENTR_SCENE_SECRET_SHRINE,
/* 0x5E */ ENTR_SCENE_STOCK_POT_INN,
/* 0x5F */ ENTR_SCENE_GREAT_BAY_CUTSCENE,
/* 0x60 */ ENTR_SCENE_CLOCK_TOWER_INTERIOR,
/* 0x61 */ ENTR_SCENE_WOODS_OF_MYSTERY,
/* 0x62 */ ENTR_SCENE_LOST_WOODS,
/* 0x63 */ ENTR_SCENE_MOON_LINK_TRIAL,
/* 0x64 */ ENTR_SCENE_THE_MOON,
/* 0x65 */ ENTR_SCENE_BOMB_SHOP,
/* 0x66 */ ENTR_SCENE_GIANTS_CHAMBER,
/* 0x67 */ ENTR_SCENE_GORMAN_TRACK,
/* 0x68 */ ENTR_SCENE_GORON_RACETRACK,
/* 0x69 */ ENTR_SCENE_EAST_CLOCK_TOWN,
/* 0x6A */ ENTR_SCENE_WEST_CLOCK_TOWN,
/* 0x6B */ ENTR_SCENE_NORTH_CLOCK_TOWN,
/* 0x6C */ ENTR_SCENE_SOUTH_CLOCK_TOWN,
/* 0x6D */ ENTR_SCENE_LAUNDRY_POOL,
/* 0x6E */ ENTR_SCENE_MAX
} EntranceSceneId;
/*
* 0xFE00: Index into sSceneEntranceTable (Scene)
* 0x01F0: Index into the scenes specific entrance table (Spawn)
* 0x000F: Index into the specific entrance table (Layer), stored seperately in sceneSetupIndex
*/
#define ENTRANCE(scene, spawn) ((((ENTR_SCENE_##scene) & 0x7F) << 9) | (((spawn) & 0x1F) << 4))
// SceneTableEntry draw configs
typedef enum {
+31 -50
View File
@@ -290,7 +290,7 @@ void Cutscene_Command_Misc(PlayState* play2, CutsceneContext* csCtx, CsCmdBase*
break;
case 0x1B:
if (isStartFrame) {
play->nextEntranceIndex = 0x1C00;
play->nextEntrance = ENTRANCE(CUTSCENE, 0);
gSaveContext.nextCutsceneIndex = 0xFFF8;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -569,7 +569,7 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase*
gSaveContext.save.cutscene = 0;
if (cmd->base == 1) {
play->nextEntranceIndex = play->csCtx.sceneCsList[play->csCtx.currentCsIndex].nextEntranceIndex;
play->nextEntrance = play->csCtx.sceneCsList[play->csCtx.currentCsIndex].nextEntrance;
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
if (gSaveContext.gameMode != 1) {
@@ -582,11 +582,11 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase*
play->transitionType = TRANS_TYPE_04;
}
if ((play->nextEntranceIndex & 0xF) > 0) {
gSaveContext.nextCutsceneIndex = (play->nextEntranceIndex & 0xF) + 0xFFEF;
if ((play->nextEntrance & 0xF) > 0) {
gSaveContext.nextCutsceneIndex = (play->nextEntrance & 0xF) + 0xFFEF;
}
play->nextEntranceIndex &= ~0xF;
play->nextEntrance &= ~0xF;
}
}
@@ -603,11 +603,11 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
switch (D_801F4DE2) {
case 0x1F:
if (gSaveContext.save.weekEventReg[20] & 2) {
play->nextEntranceIndex = 0x3010;
play->nextEntrance = ENTRANCE(WOODFALL_TEMPLE, 1);
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
} else {
play->nextEntranceIndex = 0x8600;
play->nextEntrance = ENTRANCE(WOODFALL, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -616,11 +616,11 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 0x44:
if (gSaveContext.save.weekEventReg[33] & 0x80) {
play->nextEntranceIndex = 0xAE70;
play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 7);
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
} else {
play->nextEntranceIndex = 0xAE00;
play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -629,7 +629,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 0x5F:
gSaveContext.save.weekEventReg[55] |= 0x80;
play->nextEntranceIndex = 0x6A80;
play->nextEntrance = ENTRANCE(ZORA_CAPE, 8);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -637,7 +637,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
case 0x36:
gSaveContext.save.weekEventReg[52] |= 0x20;
play->nextEntranceIndex = 0x2000;
play->nextEntrance = ENTRANCE(IKANA_CANYON, 0);
gSaveContext.nextCutsceneIndex = 0xFFF1;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -658,12 +658,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 2:
if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) {
// Milk bar
play->nextEntranceIndex = 0x2400;
play->nextEntrance = ENTRANCE(MILK_BAR, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C00;
play->nextEntrance = ENTRANCE(CUTSCENE, 0);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -671,12 +669,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 3:
if (INV_CONTENT(ITEM_MASK_GREAT_FAIRY) == ITEM_MASK_GREAT_FAIRY) {
// Fairy's fountain
play->nextEntranceIndex = 0x4600;
play->nextEntrance = ENTRANCE(FAIRY_FOUNTAIN, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C10;
play->nextEntrance = ENTRANCE(CUTSCENE, 1);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -684,12 +680,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 4:
if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) {
// Romani ranch
play->nextEntranceIndex = 0x6400;
play->nextEntrance = ENTRANCE(ROMANI_RANCH, 0);
gSaveContext.nextCutsceneIndex = 0xFFF1;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C20;
play->nextEntrance = ENTRANCE(CUTSCENE, 2);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -697,12 +691,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 5:
if (INV_CONTENT(ITEM_MASK_BLAST) == ITEM_MASK_BLAST) {
// West clock town
play->nextEntranceIndex = 0xD400;
play->nextEntrance = ENTRANCE(WEST_CLOCK_TOWN, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C30;
play->nextEntrance = ENTRANCE(CUTSCENE, 3);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -710,12 +702,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 6:
if (INV_CONTENT(ITEM_MASK_CIRCUS_LEADER) == ITEM_MASK_CIRCUS_LEADER) {
// Milk bar
play->nextEntranceIndex = 0x2400;
play->nextEntrance = ENTRANCE(MILK_BAR, 0);
gSaveContext.nextCutsceneIndex = 0xFFF1;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C50;
play->nextEntrance = ENTRANCE(CUTSCENE, 5);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -723,32 +713,27 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 7:
if (INV_CONTENT(ITEM_MASK_BREMEN) == ITEM_MASK_BREMEN) {
// Milk bar
play->nextEntranceIndex = 0x2400;
play->nextEntrance = ENTRANCE(MILK_BAR, 0);
gSaveContext.nextCutsceneIndex = 0xFFF3;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C60;
play->nextEntrance = ENTRANCE(CUTSCENE, 6);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
break;
case 8:
// Ikana canyon
play->nextEntranceIndex = 0x2000;
play->nextEntrance = ENTRANCE(IKANA_CANYON, 0);
gSaveContext.nextCutsceneIndex = 0xFFF3;
play->transitionTrigger = TRANS_TRIGGER_START;
break;
case 9:
if (INV_CONTENT(ITEM_MASK_COUPLE) == ITEM_MASK_COUPLE) {
// Termina field
play->nextEntranceIndex = 0x5400;
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 0);
gSaveContext.nextCutsceneIndex = 0xFFF8;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C70;
play->nextEntrance = ENTRANCE(CUTSCENE, 7);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -756,12 +741,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 10:
if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) {
// Cucco shack
play->nextEntranceIndex = 0x7E00;
play->nextEntrance = ENTRANCE(CUCCO_SHACK, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C40;
play->nextEntrance = ENTRANCE(CUTSCENE, 4);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -769,12 +752,10 @@ void Cutscene_Command_ChooseCreditsScenes(PlayState* play, CutsceneContext* csCt
case 11:
if (INV_CONTENT(ITEM_MASK_POSTMAN) == ITEM_MASK_POSTMAN) {
// Termina field
play->nextEntranceIndex = 0x5410;
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 1);
gSaveContext.nextCutsceneIndex = 0xFFF8;
} else {
// SPOT00
play->nextEntranceIndex = 0x1C80;
play->nextEntrance = ENTRANCE(CUTSCENE, 8);
gSaveContext.nextCutsceneIndex = 0xFFF9;
}
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -1528,7 +1509,7 @@ void func_800EDBE0(PlayState* play) {
if ((gSaveContext.respawnFlag == 0) || (gSaveContext.respawnFlag == -2)) {
sp24 = play->loadedScene;
if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) {
if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entranceIndex) +
if ((Entrance_GetTransitionFlags(((void)0, gSaveContext.save.entrance) +
((void)0, gSaveContext.sceneSetupIndex)) &
0x4000) != 0) {
func_80151A68(play, sp24->titleTextId);
+7 -7
View File
@@ -357,11 +357,11 @@ void Play_SaveCycleSceneFlags(GameState* thisx) {
cycleSceneFlags->clearedRoom = this->actorCtx.flags.clearedRoom;
}
void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entranceIndex, s32 roomIndex, s32 playerParams,
Vec3f* pos, s16 yaw) {
void Play_SetRespawnData(GameState* thisx, s32 respawnMode, u16 entrance, s32 roomIndex, s32 playerParams, Vec3f* pos,
s16 yaw) {
PlayState* this = (PlayState*)thisx;
gSaveContext.respawn[respawnMode].entranceIndex = Entrance_CreateIndex(entranceIndex >> 9, 0, entranceIndex & 0xF);
gSaveContext.respawn[respawnMode].entrance = Entrance_Create(entrance >> 9, 0, entrance & 0xF);
gSaveContext.respawn[respawnMode].roomIndex = roomIndex;
gSaveContext.respawn[respawnMode].pos = *pos;
gSaveContext.respawn[respawnMode].yaw = yaw;
@@ -376,7 +376,7 @@ void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams)
Player* player = GET_PLAYER(this);
if (this->sceneNum != SCENE_KAKUSIANA) { // Grottos
Play_SetRespawnData(&this->state, respawnMode, (u16)((void)0, gSaveContext.save.entranceIndex),
Play_SetRespawnData(&this->state, respawnMode, (u16)((void)0, gSaveContext.save.entrance),
this->roomCtx.currRoom.num, playerParams, &player->actor.world.pos,
player->actor.shape.rot.y);
}
@@ -385,7 +385,7 @@ void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams)
// Override respawn data in Sakon's Hideout
void func_80169ECC(PlayState* this) {
if (this->sceneNum == SCENE_SECOM) {
this->nextEntranceIndex = 0x2060;
this->nextEntrance = ENTRANCE(IKANA_CANYON, 6);
gSaveContext.respawnFlag = -7;
}
}
@@ -398,7 +398,7 @@ void func_80169EFC(GameState* thisx) {
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempSwitchFlags = this->actorCtx.flags.switches[2];
gSaveContext.respawn[RESPAWN_MODE_DOWN].unk_18 = this->actorCtx.flags.collectible[1];
gSaveContext.respawn[RESPAWN_MODE_DOWN].tempCollectFlags = this->actorCtx.flags.collectible[2];
this->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex;
this->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance;
gSaveContext.respawnFlag = 1;
func_80169ECC(this);
this->transitionTrigger = TRANS_TRIGGER_START;
@@ -410,7 +410,7 @@ void func_80169EFC(GameState* thisx) {
void func_80169F78(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
this->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex;
this->nextEntrance = gSaveContext.respawn[RESPAWN_MODE_TOP].entrance;
gSaveContext.respawnFlag = -1;
func_80169ECC(this);
this->transitionTrigger = TRANS_TRIGGER_START;
+8 -8
View File
@@ -454,7 +454,7 @@ void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd) {
SceneCmd** altHeaderList;
SceneCmd* altHeader;
if (gSaveContext.sceneSetupIndex) {
if (gSaveContext.sceneSetupIndex != 0) {
altHeaderList = Lib_SegmentedToVirtual(cmd->altHeaders.segment);
altHeader = altHeaderList[gSaveContext.sceneSetupIndex - 1];
@@ -527,7 +527,7 @@ void Scene_HeaderCmdAnimatedMaterials(PlayState* play, SceneCmd* cmd) {
* Sets the exit fade from the next entrance index.
*/
void Scene_SetExitFade(PlayState* play) {
play->transitionType = Entrance_GetTransitionFlags(play->nextEntranceIndex) & 0x7F;
play->transitionType = Entrance_GetTransitionFlags(play->nextEntrance) & 0x7F;
}
/**
@@ -587,15 +587,15 @@ s32 Scene_ProcessHeader(PlayState* play, SceneCmd* header) {
}
/**
* Creates an entrance index from the scene index, spawn index, and scene setup.
* Creates an entrance from the scene, spawn, and lyaer.
*/
u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup) {
return (((sceneIndex << 9) | (spawnIndex << 4)) | sceneSetup) & 0xFFFF;
u16 Entrance_Create(s32 scene, s32 spawn, s32 layer) {
return (scene << 9) | (spawn << 4) | layer;
}
/**
* Creates an entrance index from the current entrance index with the given spawn index.
* Creates an layer 0 entranace from the current entrance and the given spawn.
*/
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex) {
return Entrance_CreateIndex(gSaveContext.save.entranceIndex >> 9, spawnIndex, 0);
u16 Entrance_CreateFromSpawn(s32 spawn) {
return Entrance_Create(gSaveContext.save.entrance >> 9, spawn, 0);
}
+21 -21
View File
@@ -486,22 +486,22 @@ static EntranceTableEntry* sTreasureChestShopEntranceTable[] = {
sTreasureChestShopEntrance1,
};
static EntranceTableEntry sStoneTowerTempleReversedEntrance0[] = {
static EntranceTableEntry sStoneTowerTempleInvertedEntrance0[] = {
{ 0xE8, 0x00, 0xC102 },
};
static EntranceTableEntry sStoneTowerTempleReversedEntrance1[] = {
static EntranceTableEntry sStoneTowerTempleInvertedEntrance1[] = {
{ 0xE8, 0x01, 0x8102 },
};
static EntranceTableEntry sStoneTowerTempleReversedEntrance2[] = {
static EntranceTableEntry sStoneTowerTempleInvertedEntrance2[] = {
{ 0xE8, 0x02, 0x8102 },
};
static EntranceTableEntry* sStoneTowerTempleReversedEntranceTable[] = {
sStoneTowerTempleReversedEntrance0,
sStoneTowerTempleReversedEntrance1,
sStoneTowerTempleReversedEntrance2,
static EntranceTableEntry* sStoneTowerTempleInvertedEntranceTable[] = {
sStoneTowerTempleInvertedEntrance0,
sStoneTowerTempleInvertedEntrance1,
sStoneTowerTempleInvertedEntrance2,
};
static EntranceTableEntry sClockTowerRooftopEntrance0[] = {
@@ -2678,7 +2678,7 @@ static SceneEntranceTableEntry sSceneEntranceTable[] = {
/* 0x12 */ SCENE_ENTRANCE(sMilkBarEntranceTable, "Z2_MILK_BAR"),
/* 0x13 */ SCENE_ENTRANCE(sStoneTowerTempleEntranceTable, "Z2_INISIE_N"),
/* 0x14 */ SCENE_ENTRANCE(sTreasureChestShopEntranceTable, "Z2_TAKARAYA"),
/* 0x15 */ SCENE_ENTRANCE(sStoneTowerTempleReversedEntranceTable, "Z2_INISIE_R"),
/* 0x15 */ SCENE_ENTRANCE(sStoneTowerTempleInvertedEntranceTable, "Z2_INISIE_R"),
/* 0x16 */ SCENE_ENTRANCE(sClockTowerRooftopEntranceTable, "Z2_OKUJOU"),
/* 0x17 */ SCENE_ENTRANCE(sOpeningDungeonEntranceTable, "Z2_OPENINGDAN"),
/* 0x18 */ SCENE_ENTRANCE(sWoodfallTempleEntranceTable, "Z2_MITURIN"),
@@ -2772,19 +2772,19 @@ static SceneEntranceTableEntry sSceneEntranceTable[] = {
/**
* Returns a pointer to an entrance table from a given entrance index.
*/
EntranceTableEntry* Entrance_GetTableEntry(u16 entranceIndex) {
u32 entranceIndex2 = entranceIndex;
EntranceTableEntry** tableEntryP = sSceneEntranceTable[entranceIndex2 >> 9].table;
EntranceTableEntry* tableEntry = tableEntryP[(entranceIndex2 >> 4) & 0x1F];
EntranceTableEntry* Entrance_GetTableEntry(u16 entrance) {
u32 entranceIndex = entrance;
EntranceTableEntry** tableEntryP = sSceneEntranceTable[entranceIndex >> 9].table;
EntranceTableEntry* tableEntry = tableEntryP[(entranceIndex >> 4) & 0x1F];
return &tableEntry[entranceIndex2 & 0xF];
return &tableEntry[entranceIndex & 0xF];
}
/**
* Returns the scene index from a given entrance index.
*/
s32 Entrance_GetSceneNum(u16 entranceIndex) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entranceIndex);
s32 Entrance_GetSceneNum(u16 entrance) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entrance);
return tableEntry->sceneNum;
}
@@ -2792,8 +2792,8 @@ s32 Entrance_GetSceneNum(u16 entranceIndex) {
/**
* Returns the absolute value scene index (since for some reason some of them are negative) from a given entrance index.
*/
s32 Entrance_GetSceneNumAbsolute(u16 entranceIndex) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entranceIndex);
s32 Entrance_GetSceneNumAbsolute(u16 entrance) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entrance);
return ABS_ALT(tableEntry->sceneNum);
}
@@ -2801,8 +2801,8 @@ s32 Entrance_GetSceneNumAbsolute(u16 entranceIndex) {
/**
* Returns the spawn index from a given entrance index.
*/
s32 Entrance_GetSpawnNum(u16 entranceIndex) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entranceIndex);
s32 Entrance_GetSpawnNum(u16 entrance) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entrance);
return tableEntry->spawnNum;
}
@@ -2810,8 +2810,8 @@ s32 Entrance_GetSpawnNum(u16 entranceIndex) {
/**
* Returns the transition effect flags from a given entrance index.
*/
s32 Entrance_GetTransitionFlags(u16 entranceIndex) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entranceIndex);
s32 Entrance_GetTransitionFlags(u16 entrance) {
EntranceTableEntry* tableEntry = Entrance_GetTableEntry(entrance);
return tableEntry->flags;
}
+19 -11
View File
@@ -501,7 +501,7 @@ u16 Sram_CalcChecksum(void* data, size_t count) {
// Resets `Save` substruct
void Sram_ResetSave(void) {
gSaveContext.save.entranceIndex = 0x1C00;
gSaveContext.save.entrance = ENTRANCE(CUTSCENE, 0);
gSaveContext.save.equippedMask = 0;
gSaveContext.save.isFirstCycle = false;
gSaveContext.save.unk_06 = 0;
@@ -845,7 +845,7 @@ void Sram_InitDebugSave(void) {
gSaveContext.save.horseData.pos.z = -1285;
gSaveContext.save.horseData.yaw = -0x7554;
gSaveContext.save.entranceIndex = 0x1C00;
gSaveContext.save.entrance = ENTRANCE(CUTSCENE, 0);
gSaveContext.save.isFirstCycle = true;
//
@@ -910,7 +910,13 @@ void func_80144A94(SramContext* sramCtx) {
gSaveContext.jinxTimer = 0;
}
u16 D_801C6A58[] = { 0x68B0, 0x6A60, 0xB230, 0x9A80, 0xD890, 0x3E40, 0x8640, 0x84A0, 0x2040, 0xAA30 };
u16 D_801C6A58[] = {
ENTRANCE(GREAT_BAY_COAST, 11), ENTRANCE(ZORA_CAPE, 6),
ENTRANCE(SNOWHEAD, 3), ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8),
ENTRANCE(SOUTH_CLOCK_TOWN, 9), ENTRANCE(MILK_ROAD, 4),
ENTRANCE(WOODFALL, 4), ENTRANCE(SOUTHERN_SWAMP_POISONED, 10),
ENTRANCE(IKANA_CANYON, 4), ENTRANCE(STONE_TOWER, 3),
};
void Sram_OpenSave(FileChooseContext* fileChooseCtx, SramContext* sramCtx) {
s32 i;
@@ -973,22 +979,24 @@ void Sram_OpenSave(FileChooseContext* fileChooseCtx, SramContext* sramCtx) {
}
if (gSaveContext.save.isFirstCycle) {
gSaveContext.save.entranceIndex = 0xD800;
gSaveContext.save.entrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0);
gSaveContext.save.day = 0;
gSaveContext.save.time = 0x3FFF;
} else {
gSaveContext.save.entranceIndex = 0x1C00;
gSaveContext.save.entrance = ENTRANCE(CUTSCENE, 0);
gSaveContext.nextCutsceneIndex = 0;
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
}
} else {
gSaveContext.save.entranceIndex = D_801C6A58[(void)0, gSaveContext.save.owlSaveLocation];
if ((gSaveContext.save.entranceIndex == 0x84A0) && (gSaveContext.save.weekEventReg[20] & 2)) {
gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlSaveLocation];
if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
(gSaveContext.save.weekEventReg[20] & 2)) {
// Unconfirmed weekEventReg: "Woodfall Temple Prison Entrance raised / Water cleansed"
gSaveContext.save.entranceIndex = 0xCA0;
} else if ((gSaveContext.save.entranceIndex == 0x9A80) && (gSaveContext.save.weekEventReg[33] & 0x80)) {
gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
} else if ((gSaveContext.save.entrance == ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8)) &&
(gSaveContext.save.weekEventReg[33] & 0x80)) {
// Unconfirmed weekEventReg: "Mountain Village Unfrozen"
gSaveContext.save.entranceIndex = 0xAE80;
gSaveContext.save.entrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 8);
}
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
@@ -1513,7 +1521,7 @@ void func_80146DF8(SramContext* sramCtx) {
}
void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
if (gSaveContext.save.entranceIndex) {} // Required to match
if (gSaveContext.save.entrance) {} // Required to match
func_801A3D98(gSaveContext.options.audioSetting);
}
@@ -245,10 +245,10 @@ void func_809541B8(BgIngate* this, PlayState* play) {
void func_809542A0(BgIngate* this, PlayState* play) {
if (gSaveContext.eventInf[5] & 1) {
play->nextEntranceIndex = 0xA820;
play->nextEntrance = ENTRANCE(TOURIST_INFORMATION, 2);
gSaveContext.eventInf[5] &= (u8)~1;
} else {
play->nextEntranceIndex = 0xA810;
play->nextEntrance = ENTRANCE(TOURIST_INFORMATION, 1);
}
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
+1 -1
View File
@@ -1045,7 +1045,7 @@ void DmStk_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->collider);
if (gSaveContext.save.entranceIndex == 0x2C00) {
if (gSaveContext.save.entrance == ENTRANCE(CLOCK_TOWER_ROOFTOP, 0)) {
if (gSaveContext.sceneSetupIndex == 0) {
if (gSaveContext.unk_3DD0[3] == 0) {
// Starts a 5 minute (300 second) timer until the moon falls.
@@ -52,9 +52,10 @@ static ColliderCylinderInit sCylinderInit = {
{ 50, 10, 0, { 0, 0, 0 } },
};
static u16 sEntranceIndexes[] = {
0x1A00, 0x1400, 0x1410, 0x1420, 0x1430, 0x1440, 0x1450, 0x1460,
0x1470, 0x1480, 0x1490, 0x14A0, 0x14B0, 0x14C0, 0x14D0,
static u16 sEntrances[] = {
ENTRANCE(UNSET_0D, 0), ENTRANCE(GROTTOS, 0), ENTRANCE(GROTTOS, 1), ENTRANCE(GROTTOS, 2), ENTRANCE(GROTTOS, 3),
ENTRANCE(GROTTOS, 4), ENTRANCE(GROTTOS, 5), ENTRANCE(GROTTOS, 6), ENTRANCE(GROTTOS, 7), ENTRANCE(GROTTOS, 8),
ENTRANCE(GROTTOS, 9), ENTRANCE(GROTTOS, 10), ENTRANCE(GROTTOS, 11), ENTRANCE(GROTTOS, 12), ENTRANCE(GROTTOS, 13),
};
void DoorAna_SetupAction(DoorAna* this, DoorAnaActionFunc actionFunction) {
@@ -135,7 +136,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
if (grottoType == DOORANA_TYPE_VISIBLE_SCENE_EXIT) {
s32 exitIndex = DOORANA_GET_EXIT_INDEX(&this->actor);
play->nextEntranceIndex = play->setupExitList[exitIndex];
play->nextEntrance = play->setupExitList[exitIndex];
} else {
s32 destinationIdx = DOORANA_GET_ENTRANCE(&this->actor);
@@ -151,7 +152,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) {
destinationIdx = DOORANA_GET_EX_ENTRANCE(&this->actor);
}
play->nextEntranceIndex = sEntranceIndexes[destinationIdx];
play->nextEntrance = sEntrances[destinationIdx];
}
DoorAna_SetupAction(this, DoorAna_GrabLink);
@@ -485,7 +485,7 @@ void func_808B98A8(DoorWarp1* this, PlayState* play) {
if ((gSaveContext.nextCutsceneIndex == 0xFFEF) && (D_808BC000 < this->unk_1D0) &&
(gSaveContext.nextCutsceneIndex == 0xFFEF)) {
if (DOORWARP1_GET_FF00_1(&this->dyna.actor) != 0xFF) {
play->nextEntranceIndex = play->setupExitList[DOORWARP1_GET_FF00_3(&this->dyna.actor)];
play->nextEntrance = play->setupExitList[DOORWARP1_GET_FF00_3(&this->dyna.actor)];
Scene_SetExitFade(play);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
@@ -700,7 +700,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
break;
}
play->nextEntranceIndex = 0xCC00;
play->nextEntrance = ENTRANCE(GIANTS_CHAMBER, 0);
if (phi_v0_3 < 10) {
gSaveContext.nextCutsceneIndex = phi_v0_3 + 0xFFF0;
}
@@ -713,12 +713,12 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
case 0:
if (gSaveContext.save.weekEventReg[20] & 2) {
gSaveContext.save.weekEventReg[7] |= 0x80;
play->nextEntranceIndex = 0x3010;
play->nextEntrance = ENTRANCE(WOODFALL_TEMPLE, 1);
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
gSaveContext.nextTransitionType = TRANS_TYPE_03;
} else {
play->nextEntranceIndex = 0x8600;
play->nextEntrance = ENTRANCE(WOODFALL, 0);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -728,7 +728,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
case 1:
gSaveContext.save.weekEventReg[33] |= 0x80;
play->nextEntranceIndex = 0xAE70;
play->nextEntrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 7);
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
gSaveContext.nextTransitionType = TRANS_TYPE_03;
@@ -736,14 +736,14 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
case 3:
if (gSaveContext.save.weekEventReg[55] & 0x80) {
play->nextEntranceIndex = 0x6A90;
play->nextEntrance = ENTRANCE(ZORA_CAPE, 9);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
gSaveContext.nextTransitionType = TRANS_TYPE_03;
} else {
gSaveContext.save.weekEventReg[55] |= 0x80;
play->nextEntranceIndex = 0x6A80;
play->nextEntrance = ENTRANCE(ZORA_CAPE, 8);
gSaveContext.nextCutsceneIndex = 0xFFF0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -753,7 +753,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
case 2:
gSaveContext.save.weekEventReg[52] |= 0x20;
play->nextEntranceIndex = 0x20F0;
play->nextEntrance = ENTRANCE(IKANA_CANYON, 15);
gSaveContext.nextCutsceneIndex = 0xFFF2;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_03;
@@ -765,7 +765,7 @@ void func_808BA10C(DoorWarp1* this, PlayState* play) {
if (DOORWARP1_GET_FF(&this->dyna.actor) == ENDOORWARP1_FF_6) {
gSaveContext.respawnFlag = ~1;
}
play->nextEntranceIndex = play->setupExitList[DOORWARP1_GET_FF00_3(&this->dyna.actor)];
play->nextEntrance = play->setupExitList[DOORWARP1_GET_FF00_3(&this->dyna.actor)];
Scene_SetExitFade(play);
play->transitionTrigger = TRANS_TRIGGER_START;
} else {
@@ -416,7 +416,7 @@ void func_809C1C9C(EnAob01* this, PlayState* play) {
gSaveContext.save.weekEventReg[63] &= (u8)~2;
this->unk_2D2 |= 0x20;
func_800FD750(0x40);
play->nextEntranceIndex = 0x7C10;
play->nextEntrance = ENTRANCE(DOGGY_RACETRACK, 1);
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_64;
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & (u8)~7) | 2;
@@ -672,7 +672,7 @@ void func_809C2788(EnAob01* this, PlayState* play) {
this->unk_2D2 |= 0x20;
if (func_809C25E4(this, play)) {
if (func_801A8A50(0) != 0x41) {
play->nextEntranceIndex = 0x7C10;
play->nextEntrance = ENTRANCE(DOGGY_RACETRACK, 1);
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & (u8)~7) | 3;
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_03;
+8 -7
View File
@@ -300,7 +300,7 @@ void EnBaba_HandleConversation(EnBaba* this, PlayState* play) {
}
void EnBaba_TriggerTransition(PlayState* play, u16 nextEntrance) {
play->nextEntranceIndex = nextEntrance;
play->nextEntrance = nextEntrance;
play->transitionType = TRANS_TYPE_64;
gSaveContext.nextTransitionType = TRANS_TYPE_64;
play->transitionTrigger = TRANS_TRIGGER_START;
@@ -510,7 +510,8 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
this->actionFunc = EnBaba_Idle;
} else if (play->sceneNum == SCENE_BACKTOWN) {
if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_FOLLOW_SCHEDULE) &&
(gSaveContext.save.entranceIndex != 0xD670) && (BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F)) {
(gSaveContext.save.entrance != ENTRANCE(NORTH_CLOCK_TOWN, 7)) &&
(BOMB_SHOP_LADY_GET_PATH_INDEX(&this->actor) != 0x3F)) {
if ((gSaveContext.save.weekEventReg[58] & 0x40) ||
(gSaveContext.save.time >= CLOCK_TIME(0, 20) && (gSaveContext.save.time < CLOCK_TIME(6, 0)))) {
Actor_MarkForDeath(&this->actor);
@@ -522,7 +523,7 @@ void EnBaba_FinishInit(EnBaba* this, PlayState* play) {
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animIndex);
this->actionFunc = EnBaba_FollowSchedule;
} else if ((BOMB_SHOP_LADY_GET_TYPE(&this->actor) == BOMB_SHOP_LADY_TYPE_IDLE) &&
(gSaveContext.save.entranceIndex == 0xD670)) {
(gSaveContext.save.entrance == ENTRANCE(NORTH_CLOCK_TOWN, 7))) {
if (gSaveContext.save.weekEventReg[81] & 2) {
Actor_MarkForDeath(&this->actor);
return;
@@ -603,12 +604,12 @@ void EnBaba_Talk(EnBaba* this, PlayState* play) {
if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
if (play->msgCtx.unk120B1 == 0) {
gSaveContext.save.weekEventReg[81] |= 2;
EnBaba_TriggerTransition(play, 0xD670);
EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7));
return;
}
} else {
gSaveContext.save.weekEventReg[81] |= 2;
EnBaba_TriggerTransition(play, 0xD670);
EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7));
}
} else {
this->textId = 0;
@@ -626,7 +627,7 @@ void EnBaba_Talk(EnBaba* this, PlayState* play) {
} else if (talkState == TEXT_STATE_DONE) {
if (Message_ShouldAdvance(play) && (play->msgCtx.unk120B1 == 0)) {
gSaveContext.save.weekEventReg[81] |= 2;
EnBaba_TriggerTransition(play, 0xD670);
EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7));
}
}
}
@@ -699,7 +700,7 @@ void EnBaba_KnockedOver(EnBaba* this, PlayState* play) {
} else {
if ((gSaveContext.save.weekEventReg[79] & 0x40) && (DECR(this->sakonDeadTimer) == 0)) {
Audio_QueueSeqCmd(0x101400FF);
EnBaba_TriggerTransition(play, 0xD670);
EnBaba_TriggerTransition(play, ENTRANCE(NORTH_CLOCK_TOWN, 7));
} else {
Actor_MoveWithGravity(&this->actor);
}
@@ -296,8 +296,8 @@ void func_809CD634(EnBji01* this, PlayState* play) {
AudioSfx_MuteBanks((1 << BANK_PLAYER) | (1 << BANK_ITEM) | (1 << BANK_ENV) | (1 << BANK_ENEMY) |
(1 << BANK_OCARINA) | (1 << BANK_VOICE));
Audio_QueueSeqCmd(0xE0000101);
play->nextEntranceIndex = 0x54A0; /* Termina Field from telescope */
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = play->nextEntranceIndex;
play->nextEntrance = ENTRANCE(TERMINA_FIELD, 10); /* Telescope entrance */
gSaveContext.respawn[RESPAWN_MODE_DOWN].entrance = play->nextEntrance;
func_80169EFC(&play->state); /* Load new entrance? */
gSaveContext.respawnFlag = -2;
this->actionFunc = EnBji01_DoNothing;
@@ -343,13 +343,13 @@ void EnBji01_Init(Actor* thisx, PlayState* play) {
SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
this->moonsTear = (ObjMoonStone*)SubS_FindActor(play, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
switch (gSaveContext.save.entranceIndex) {
case 0x4C00: /* Observatory from ECT */
case 0x4C10: /* Observatory from Termina Field door */
switch (gSaveContext.save.entrance) {
case ENTRANCE(ASTRAL_OBSERVATORY, 0): /* ECT entrance*/
case ENTRANCE(ASTRAL_OBSERVATORY, 1): /* TF door entrance */
this->actor.params = SHIKASHI_TYPE_DEFAULT;
func_809CCE98(this, play);
break;
case 0x4C20: /* Observatory from Termina Field telescope */
case ENTRANCE(ASTRAL_OBSERVATORY, 2): /* Telescope entrance */
this->actor.flags |= ACTOR_FLAG_10000;
AudioSfx_MuteBanks(0);
Audio_QueueSeqCmd(0xE0000100);
@@ -97,7 +97,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play) {
this->path = SubS_GetPathByIndex(play, this->unk_29A, 0x3F);
this->unk_2C8 = 80.0f;
if ((gSaveContext.save.entranceIndex == 0xD220) && (gSaveContext.save.weekEventReg[73] & 0x80) &&
if ((gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2)) && (gSaveContext.save.weekEventReg[73] & 0x80) &&
!CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
this->unk_2D6 = this->actor.cutscene;
if (this->unk_2D6 == 0) {
@@ -332,7 +332,7 @@ void func_809C51B4(EnBomBowlMan* this, PlayState* play) {
if ((play->msgCtx.unk120B1 == 0) &&
((play->msgCtx.msgMode == 0) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE))) {
play->nextEntranceIndex = Entrance_CreateIndexFromSpawn(6);
play->nextEntrance = Entrance_CreateFromSpawn(6);
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_86;
@@ -94,7 +94,7 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) {
this->jointTable, OBJECT_CS_LIMB_MAX);
this->actor.targetMode = 6;
Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
if ((gSaveContext.save.weekEventReg[73] & 0x80) || (gSaveContext.save.entranceIndex == 0xD220)) {
if ((gSaveContext.save.weekEventReg[73] & 0x80) || (gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2))) {
this->actor.world.pos.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f;
cos = Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f;
this->unk_2AC = 1;
@@ -757,7 +757,7 @@ void func_80BFFBC4(EnBomjima* this, PlayState* play) {
if (D_80C009F0 >= 104) {
D_80C009F0 = 0;
func_801477B4(play);
play->nextEntranceIndex = Entrance_CreateIndexFromSpawn(6);
play->nextEntrance = Entrance_CreateFromSpawn(6);
gSaveContext.nextCutsceneIndex = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_86;

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