mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-26 15:44:42 -04:00
merge master
This commit is contained in:
+28
-28
@@ -365,7 +365,7 @@ s16 gItemPrices[] = {
|
||||
};
|
||||
|
||||
// Used to map scene indexes to their region in Termina
|
||||
u16 gScenesPerRegion[11][27] = {
|
||||
u16 gSceneIdsPerRegion[11][27] = {
|
||||
// Great Bay
|
||||
{
|
||||
SCENE_30GYOSON,
|
||||
@@ -522,7 +522,7 @@ void Inventory_ChangeUpgrade(s16 upgrade, u32 value) {
|
||||
gSaveContext.save.inventory.upgrades = upgrades;
|
||||
}
|
||||
|
||||
s32 Inventory_IsMapVisible(s16 sceneNum) {
|
||||
s32 Inventory_IsMapVisible(s16 sceneId) {
|
||||
s16 index = 0;
|
||||
|
||||
/**
|
||||
@@ -530,30 +530,30 @@ s32 Inventory_IsMapVisible(s16 sceneNum) {
|
||||
* increment to the next index of scenesVisible so that every scene gets a unique flag in scenesVisible,
|
||||
* 224 bits were allocated to this although there are only 112 scenes
|
||||
*/
|
||||
if (sceneNum >= 0x20) {
|
||||
if (sceneNum < 0x40) {
|
||||
if (sceneId >= 0x20) {
|
||||
if (sceneId < 0x40) {
|
||||
index = 1;
|
||||
} else if (sceneNum < 0x60) {
|
||||
} else if (sceneId < 0x60) {
|
||||
index = 2;
|
||||
} else if (sceneNum < 0x80) {
|
||||
} else if (sceneId < 0x80) {
|
||||
index = 3;
|
||||
} else if (sceneNum < 0xA0) {
|
||||
} else if (sceneId < 0xA0) {
|
||||
index = 4;
|
||||
} else if (sceneNum < 0xC0) {
|
||||
} else if (sceneId < 0xC0) {
|
||||
index = 5;
|
||||
} else if (sceneNum < 0xE0) {
|
||||
} else if (sceneId < 0xE0) {
|
||||
index = 6;
|
||||
}
|
||||
}
|
||||
|
||||
if (gSaveContext.save.scenesVisible[index] & gBitFlags[sceneNum - (index << 5)]) {
|
||||
if (gSaveContext.save.scenesVisible[index] & gBitFlags[sceneId - (index << 5)]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static u16 sScenesPerTingleMap[6][12] = {
|
||||
static u16 sSceneIdsPerTingleMap[6][12] = {
|
||||
{
|
||||
// Clock Town Tingle Map
|
||||
SCENE_00KEIKOKU,
|
||||
@@ -630,11 +630,11 @@ static u16 sScenesPerTingleMap[6][12] = {
|
||||
void Inventory_SetMapVisibility(s16 tingleIndex) {
|
||||
s16 i = 0;
|
||||
s16 index = 0;
|
||||
u16(*tingleMapSceneIndices)[] = &sScenesPerTingleMap[tingleIndex];
|
||||
u16(*tingleMapSceneIds)[] = &sSceneIdsPerTingleMap[tingleIndex];
|
||||
|
||||
if ((tingleIndex >= 0) && (tingleIndex < 6)) {
|
||||
while (true) {
|
||||
if ((*tingleMapSceneIndices)[i] == 0xFFFF) {
|
||||
if ((*tingleMapSceneIds)[i] == 0xFFFF) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -643,38 +643,38 @@ void Inventory_SetMapVisibility(s16 tingleIndex) {
|
||||
* increment to the next index of scenesVisible so that every scene gets a unique flag in scenesVisible,
|
||||
* 224 bits were allocated to this although there are only 112 scenes
|
||||
*/
|
||||
if (((s16)(*tingleMapSceneIndices)[i]) < 0x20) {
|
||||
if (((s16)(*tingleMapSceneIds)[i]) < 0x20) {
|
||||
index = 0;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0x40) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0x40) {
|
||||
index = 1;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0x60) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0x60) {
|
||||
index = 2;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0x80) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0x80) {
|
||||
index = 3;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0xA0) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0xA0) {
|
||||
index = 4;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0xC0) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0xC0) {
|
||||
index = 5;
|
||||
} else if (((s16)(*tingleMapSceneIndices)[i]) < 0xE0) {
|
||||
} else if (((s16)(*tingleMapSceneIds)[i]) < 0xE0) {
|
||||
index = 6;
|
||||
}
|
||||
|
||||
gSaveContext.save.scenesVisible[index] =
|
||||
gSaveContext.save.scenesVisible[index] | gBitFlags[(s16)(*tingleMapSceneIndices)[i] - (index << 5)];
|
||||
gSaveContext.save.scenesVisible[index] | gBitFlags[(s16)(*tingleMapSceneIds)[i] - (index << 5)];
|
||||
i++;
|
||||
}
|
||||
|
||||
if ((*tingleMapSceneIndices) == sScenesPerTingleMap[0]) {
|
||||
if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[0]) {
|
||||
gSaveContext.save.mapsVisible |= 3;
|
||||
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[1]) {
|
||||
} else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[1]) {
|
||||
gSaveContext.save.mapsVisible |= 0x1C;
|
||||
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[2]) {
|
||||
} else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[2]) {
|
||||
gSaveContext.save.mapsVisible |= 0xE0;
|
||||
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[3]) {
|
||||
} else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[3]) {
|
||||
gSaveContext.save.mapsVisible |= 0x100;
|
||||
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[4]) {
|
||||
} else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[4]) {
|
||||
gSaveContext.save.mapsVisible |= 0x1E00;
|
||||
} else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[5]) {
|
||||
} else if ((*tingleMapSceneIds) == sSceneIdsPerTingleMap[5]) {
|
||||
gSaveContext.save.mapsVisible |= 0x6000;
|
||||
}
|
||||
}
|
||||
@@ -688,7 +688,7 @@ void Inventory_SetMapVisibility(s16 tingleIndex) {
|
||||
void Inventory_SaveDekuPlaygroundHighScore(s16 timerId) {
|
||||
s16 i;
|
||||
|
||||
gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.unk_3DE0[timerId];
|
||||
gSaveContext.save.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.timerCurTimes[timerId];
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
gSaveContext.save.inventory.dekuPlaygroundPlayerName[CURRENT_DAY - 1][i] =
|
||||
|
||||
+17
-17
@@ -1336,7 +1336,7 @@ s32 func_800B715C(PlayState* play) {
|
||||
}
|
||||
|
||||
void Actor_SetCameraHorseSetting(PlayState* play, Player* player) {
|
||||
if ((play->roomCtx.currRoom.unk3 != 4) && (player->actor.id == ACTOR_PLAYER)) {
|
||||
if ((play->roomCtx.curRoom.unk3 != 4) && (player->actor.id == ACTOR_PLAYER)) {
|
||||
EnHorse* rideActor = (EnHorse*)player->rideActor;
|
||||
|
||||
if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) {
|
||||
@@ -2235,7 +2235,7 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* acto
|
||||
s32 i;
|
||||
|
||||
gSaveContext.save.weekEventReg[92] |= 0x80;
|
||||
cycleFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(play->sceneNum)];
|
||||
cycleFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(play->sceneId)];
|
||||
|
||||
bzero(actorCtx, sizeof(ActorContext));
|
||||
ActorOverlayTable_Init();
|
||||
@@ -2252,8 +2252,8 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* acto
|
||||
actorCtx->sceneFlags.chest = cycleFlags->chest;
|
||||
actorCtx->sceneFlags.switches[0] = cycleFlags->switch0;
|
||||
actorCtx->sceneFlags.switches[1] = cycleFlags->switch1;
|
||||
if (play->sceneNum == SCENE_INISIE_R) {
|
||||
cycleFlags = &gSaveContext.cycleSceneFlags[play->sceneNum];
|
||||
if (play->sceneId == SCENE_INISIE_R) {
|
||||
cycleFlags = &gSaveContext.cycleSceneFlags[play->sceneId];
|
||||
}
|
||||
actorCtx->sceneFlags.collectible[0] = cycleFlags->collectible;
|
||||
actorCtx->sceneFlags.clearedRoom = cycleFlags->clearedRoom;
|
||||
@@ -2499,7 +2499,7 @@ void Actor_Draw(PlayState* play, Actor* actor) {
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
light = LightContext_NewLights(&play->lightCtx, play->state.gfxCtx);
|
||||
if ((actor->flags & ACTOR_FLAG_10000000) && (play->roomCtx.currRoom.enablePosLights || (MREG(93) != 0))) {
|
||||
if ((actor->flags & ACTOR_FLAG_10000000) && (play->roomCtx.curRoom.enablePosLights || (MREG(93) != 0))) {
|
||||
light->enablePosLights = true;
|
||||
}
|
||||
|
||||
@@ -2669,7 +2669,7 @@ void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) {
|
||||
gDPSetPrimColor(spAC++, 0, 0, 0, 0, 0, 255);
|
||||
// temp_s1_5 = spAC;
|
||||
|
||||
if (play->roomCtx.currRoom.unk5 == 0) {
|
||||
if (play->roomCtx.curRoom.unk5 == 0) {
|
||||
// temp_s1_5->words.w0 = 0xFC61E6C3;
|
||||
// temp_s1_5->words.w1 = 0x11CF9FCF;
|
||||
// phi_s1 = temp_s1_5 + 8;
|
||||
@@ -2719,7 +2719,7 @@ void Actor_DrawLensActors(PlayState* play, s32 numActors, Actor** actors) {
|
||||
|
||||
// temp_a0_2 = &spAC;
|
||||
// if (sp34->unk_6E5 == 0) {
|
||||
if (play->roomCtx.currRoom.unk5 == 0) {
|
||||
if (play->roomCtx.curRoom.unk5 == 0) {
|
||||
// temp_s1_10->unk_0 = 0xFC119623;
|
||||
// temp_s1_10->unk_4 = 0xFF2FFFFF;
|
||||
// phi_s1_4 = temp_s1_10 + 8;
|
||||
@@ -2882,8 +2882,8 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
|
||||
actor->isDrawn = false;
|
||||
if ((actor->init == NULL) && (actor->draw != NULL) && (actor->flags & actorFlags)) {
|
||||
if ((actor->flags & ACTOR_FLAG_80) &&
|
||||
((play->roomCtx.currRoom.unk5 == 0) || (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) ||
|
||||
(actor->room != play->roomCtx.currRoom.num))) {
|
||||
((play->roomCtx.curRoom.unk5 == 0) || (play->actorCtx.lensMaskSize == LENS_MASK_ACTIVE_SIZE) ||
|
||||
(actor->room != play->roomCtx.curRoom.num))) {
|
||||
if (Actor_RecordUndrawnActor(play, actor)) {}
|
||||
} else {
|
||||
Actor_Draw(play, actor);
|
||||
@@ -2960,7 +2960,7 @@ void func_800BA798(PlayState* play, ActorContext* actorCtx) {
|
||||
actor = actorCtx->actorLists[i].first;
|
||||
|
||||
while (actor != NULL) {
|
||||
if ((actor->room >= 0) && (actor->room != play->roomCtx.currRoom.num) &&
|
||||
if ((actor->room >= 0) && (actor->room != play->roomCtx.curRoom.num) &&
|
||||
(actor->room != play->roomCtx.prevRoom.num)) {
|
||||
if (!actor->isDrawn) {
|
||||
actor = Actor_Delete(actorCtx, actor, play);
|
||||
@@ -3091,9 +3091,9 @@ Actor* Actor_RemoveFromCategory(PlayState* play, ActorContext* actorCtx, Actor*
|
||||
actorToRemove->next = NULL;
|
||||
actorToRemove->prev = NULL;
|
||||
|
||||
if ((actorToRemove->room == play->roomCtx.currRoom.num) && (actorToRemove->category == ACTORCAT_ENEMY) &&
|
||||
if ((actorToRemove->room == play->roomCtx.curRoom.num) && (actorToRemove->category == ACTORCAT_ENEMY) &&
|
||||
(actorCtx->actorLists[ACTORCAT_ENEMY].length == 0)) {
|
||||
Flags_SetClearTemp(play, play->roomCtx.currRoom.num);
|
||||
Flags_SetClearTemp(play, play->roomCtx.curRoom.num);
|
||||
}
|
||||
|
||||
return newHead;
|
||||
@@ -3180,8 +3180,8 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
|
||||
}
|
||||
|
||||
objBankIndex = Object_GetIndex(&play->objectCtx, actorInit->objectId);
|
||||
if ((objBankIndex < 0) || ((actorInit->type == ACTORCAT_ENEMY) &&
|
||||
Flags_GetClear(play, play->roomCtx.currRoom.num) && (actorInit->id != ACTOR_BOSS_05))) {
|
||||
if ((objBankIndex < 0) || ((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) &&
|
||||
(actorInit->id != ACTOR_BOSS_05))) {
|
||||
Actor_FreeOverlay(&gActorOverlayTable[index]);
|
||||
return NULL;
|
||||
}
|
||||
@@ -3219,7 +3219,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
|
||||
actor->parent = parent;
|
||||
parent->child = actor;
|
||||
} else {
|
||||
actor->room = play->roomCtx.currRoom.num;
|
||||
actor->room = play->roomCtx.curRoom.num;
|
||||
}
|
||||
|
||||
actor->home.pos.x = x;
|
||||
@@ -3267,10 +3267,10 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
|
||||
for (i = 0; i < numTransitionActors; transitionActorList++, i++) {
|
||||
if (transitionActorList->id >= 0) {
|
||||
if ((transitionActorList->sides[0].room >= 0 &&
|
||||
(play->roomCtx.currRoom.num == transitionActorList->sides[0].room ||
|
||||
(play->roomCtx.curRoom.num == transitionActorList->sides[0].room ||
|
||||
play->roomCtx.prevRoom.num == transitionActorList->sides[0].room)) ||
|
||||
(transitionActorList->sides[1].room >= 0 &&
|
||||
(play->roomCtx.currRoom.num == transitionActorList->sides[1].room ||
|
||||
(play->roomCtx.curRoom.num == transitionActorList->sides[1].room ||
|
||||
play->roomCtx.prevRoom.num == transitionActorList->sides[1].room))) {
|
||||
s16 rotY = ((transitionActorList->rotY >> 7) & 0x1FF) * (0x10000 / 360.0f);
|
||||
|
||||
|
||||
+11
-10
@@ -1,3 +1,4 @@
|
||||
#include "prevent_bss_reordering.h"
|
||||
#include "global.h"
|
||||
#include "vt.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
@@ -46,7 +47,7 @@ u8 D_801B46C0[] = {
|
||||
/* 0x0E */ 1
|
||||
};
|
||||
|
||||
s16 sSmallMemScenes[] = {
|
||||
s16 sSmallMemSceneIds[] = {
|
||||
SCENE_F01,
|
||||
};
|
||||
|
||||
@@ -1462,10 +1463,10 @@ u32 BgCheck_InitStaticLookup(CollisionContext* colCtx, PlayState* play, StaticLo
|
||||
* Returns whether the current scene should reserve less memory for it's collision lookup
|
||||
*/
|
||||
s32 BgCheck_IsSmallMemScene(PlayState* play) {
|
||||
s16* i;
|
||||
s16* sceneId;
|
||||
|
||||
for (i = sSmallMemScenes; i < sSmallMemScenes + ARRAY_COUNT(sSmallMemScenes); i++) {
|
||||
if (play->sceneNum == *i) {
|
||||
for (sceneId = sSmallMemSceneIds; sceneId < sSmallMemSceneIds + ARRAY_COUNT(sSmallMemSceneIds); sceneId++) {
|
||||
if (play->sceneId == *sceneId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1504,7 +1505,7 @@ s32 BgCheck_GetSpecialSceneMaxObjects(PlayState* play, s32* maxNodes, s32* maxPo
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sCustomDynapolyMem); i++) {
|
||||
if (play->sceneNum == sCustomDynapolyMem[i].sceneId) {
|
||||
if (play->sceneId == sCustomDynapolyMem[i].sceneId) {
|
||||
*maxNodes = sCustomDynapolyMem[i].maxNodes;
|
||||
*maxPolygons = sCustomDynapolyMem[i].maxPolygons;
|
||||
*maxVertices = sCustomDynapolyMem[i].maxVertices;
|
||||
@@ -1541,7 +1542,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
|
||||
s32 useCustomSubdivisions;
|
||||
s32 i;
|
||||
|
||||
if (BgCheck_TryGetCustomMemsize(play->sceneNum, &customMemSize)) {
|
||||
if (BgCheck_TryGetCustomMemsize(play->sceneId, &customMemSize)) {
|
||||
colCtx->memSize = customMemSize;
|
||||
} else {
|
||||
colCtx->memSize = 0x23000;
|
||||
@@ -1554,7 +1555,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader
|
||||
useCustomSubdivisions = false;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sSceneSubdivisionList); i++) {
|
||||
if (play->sceneNum == sSceneSubdivisionList[i].sceneId) {
|
||||
if (play->sceneId == sSceneSubdivisionList[i].sceneId) {
|
||||
colCtx->subdivAmount.x = sSceneSubdivisionList[i].subdivAmount.x;
|
||||
colCtx->subdivAmount.y = sSceneSubdivisionList[i].subdivAmount.y;
|
||||
colCtx->subdivAmount.z = sSceneSubdivisionList[i].subdivAmount.z;
|
||||
@@ -4404,7 +4405,7 @@ s32 WaterBox_GetSurfaceImpl(PlayState* play, CollisionContext* colCtx, f32 x, f3
|
||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||
curWaterBox++) {
|
||||
room = 0x3F & (curWaterBox->properties >> 13);
|
||||
if (room == (u32)play->roomCtx.currRoom.num || room == 0x3F) {
|
||||
if (room == (u32)play->roomCtx.curRoom.num || room == 0x3F) {
|
||||
if (curWaterBox->properties & 0x80000) {
|
||||
continue;
|
||||
}
|
||||
@@ -4489,7 +4490,7 @@ s32 WaterBox_GetSurface2(PlayState* play, CollisionContext* colCtx, Vec3f* pos,
|
||||
waterBox = &colHeader->waterBoxes[i];
|
||||
|
||||
room = WATERBOX_ROOM(waterBox->properties);
|
||||
if (!(room == play->roomCtx.currRoom.num || room == 0x3F)) {
|
||||
if (!(room == play->roomCtx.curRoom.num || room == 0x3F)) {
|
||||
continue;
|
||||
}
|
||||
if ((waterBox->properties & 0x80000)) {
|
||||
@@ -4631,7 +4632,7 @@ s32 func_800CA6F0(PlayState* play, CollisionContext* colCtx, f32 x, f32 z, f32*
|
||||
for (curWaterBox = colHeader->waterBoxes; curWaterBox < colHeader->waterBoxes + colHeader->numWaterBoxes;
|
||||
curWaterBox++) {
|
||||
room = WATERBOX_ROOM(curWaterBox->properties);
|
||||
if (room == (u32)play->roomCtx.currRoom.num || room == 0x3F) {
|
||||
if (room == (u32)play->roomCtx.curRoom.num || room == 0x3F) {
|
||||
if ((curWaterBox->properties & 0x80000) != 0) {
|
||||
if (curWaterBox->minPos.x < x && x < curWaterBox->minPos.x + curWaterBox->xLength) {
|
||||
if (curWaterBox->minPos.z < z && z < curWaterBox->minPos.z + curWaterBox->zLength) {
|
||||
|
||||
@@ -16,7 +16,7 @@ void SaveContext_Init(void) {
|
||||
gSaveContext.skyboxTime = 0;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
gSaveContext.unk_3F26 = 50;
|
||||
gSaveContext.prevHudVisibility = HUD_VISIBILITY_ALL;
|
||||
|
||||
gSaveContext.options.language = 1;
|
||||
gSaveContext.options.audioSetting = 0;
|
||||
|
||||
+6
-6
@@ -105,7 +105,7 @@ s32 func_800EA220(PlayState* play, CutsceneContext* csCtx, f32 target) {
|
||||
}
|
||||
|
||||
void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
@@ -115,7 +115,7 @@ void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
|
||||
|
||||
void func_800EA2B8(PlayState* play, CutsceneContext* csCtx) {
|
||||
func_800ED980(play, csCtx);
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
if (func_800EA220(play, csCtx, 1.0f)) {
|
||||
Audio_SetCutsceneFlag(true);
|
||||
@@ -215,7 +215,7 @@ void Cutscene_Command_Misc(PlayState* play, CutsceneContext* csCtx, CsCmdBase* c
|
||||
gVisMonoColor.a = 255 * progress;
|
||||
break;
|
||||
case 0xC:
|
||||
play->roomCtx.currRoom.segment = NULL;
|
||||
play->roomCtx.curRoom.segment = NULL;
|
||||
break;
|
||||
case 0xD:
|
||||
if (play->state.frames & 8) {
|
||||
@@ -561,7 +561,7 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase*
|
||||
gSaveContext.cutsceneTransitionControl = 1;
|
||||
|
||||
if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) {
|
||||
gSaveContext.unk_3F1E = 1;
|
||||
gSaveContext.hudVisibilityForceButtonAlphasByStatus = true;
|
||||
}
|
||||
|
||||
gSaveContext.save.cutscene = 0;
|
||||
@@ -1078,7 +1078,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText
|
||||
}
|
||||
|
||||
if (originalCsFrames == csCtx->frames) {
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
D_801BB124 = 0;
|
||||
D_801BB128 = 0;
|
||||
func_80161C0C();
|
||||
@@ -1451,7 +1451,7 @@ void func_800EDA84(PlayState* play, CutsceneContext* csCtx) {
|
||||
csCtx->unk_18 = 0xFFFF;
|
||||
|
||||
if (gSaveContext.cutsceneTrigger == 0) {
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
ShrinkWindow_SetLetterboxTarget(32);
|
||||
ShrinkWindow_SetLetterboxMagnitude(0x20);
|
||||
csCtx->state++;
|
||||
|
||||
@@ -20,7 +20,7 @@ u16 ElfMessage_GetFirstCycleHint(PlayState* play) {
|
||||
if (gSaveContext.save.weekEventReg[9] & 1) {
|
||||
return 0x21E;
|
||||
}
|
||||
if (play->sceneNum == SCENE_YOUSEI_IZUMI) {
|
||||
if (play->sceneId == SCENE_YOUSEI_IZUMI) {
|
||||
return 0;
|
||||
}
|
||||
return 0x21D;
|
||||
@@ -29,7 +29,7 @@ u16 ElfMessage_GetFirstCycleHint(PlayState* play) {
|
||||
return 0x21F;
|
||||
}
|
||||
if (INV_CONTENT(ITEM_DEED_LAND) == ITEM_DEED_LAND) {
|
||||
if (play->sceneNum != SCENE_OKUJOU) {
|
||||
if (play->sceneId != SCENE_OKUJOU) {
|
||||
return 0x244;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -18,14 +18,14 @@ static s16 sGameOverTimer = 0;
|
||||
|
||||
void GameOver_Update(PlayState* play) {
|
||||
GameOverContext* gameOverCtx = &play->gameOverCtx;
|
||||
s16 i;
|
||||
s16 timerId;
|
||||
|
||||
switch (gameOverCtx->state) {
|
||||
case GAMEOVER_DEATH_START:
|
||||
func_801477B4(play);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
|
||||
gSaveContext.unk_3DD0[i] = 0;
|
||||
for (timerId = 0; timerId < TIMER_ID_MAX; timerId++) {
|
||||
gSaveContext.timerStates[timerId] = TIMER_STATE_OFF;
|
||||
}
|
||||
|
||||
gSaveContext.eventInf[1] &= ~1;
|
||||
@@ -57,10 +57,10 @@ void GameOver_Update(PlayState* play) {
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_DOWN] = BTN_ENABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_C_RIGHT] = BTN_ENABLED;
|
||||
gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_ENABLED;
|
||||
gSaveContext.unk_3F1E = 0;
|
||||
gSaveContext.unk_3F20 = 0;
|
||||
gSaveContext.unk_3F22 = 0;
|
||||
gSaveContext.unk_3F24 = 0;
|
||||
gSaveContext.hudVisibilityForceButtonAlphasByStatus = false;
|
||||
gSaveContext.nextHudVisibility = HUD_VISIBILITY_IDLE;
|
||||
gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE;
|
||||
gSaveContext.hudVisibilityTimer = 0;
|
||||
Kankyo_InitGameOverLights(play);
|
||||
sGameOverTimer = 20;
|
||||
Rumble_Request(0.0f, 126, 124, 63);
|
||||
|
||||
+15
-15
@@ -33,12 +33,12 @@ void func_800F4A10(PlayState* play) {
|
||||
for (i = 9; i >= 0; i--) {
|
||||
if ((gSaveContext.save.playerData.owlActivationFlags >> i) & 1) {
|
||||
pauseCtx->worldMapPoints[i] = 1;
|
||||
pauseCtx->unk_238[4] = i;
|
||||
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.save.playerData.owlActivationFlags >> 4) & 1) {
|
||||
pauseCtx->unk_238[4] = 4;
|
||||
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,8 @@ void KaleidoSetup_Update(PlayState* play) {
|
||||
if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) &&
|
||||
!(play->actorCtx.flags & ACTORCTX_FLAG_2)) {
|
||||
if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||
gSaveContext.unk_3F26 = gSaveContext.unk_3F22;
|
||||
pauseCtx->unk_2B9 = 0;
|
||||
gSaveContext.prevHudVisibility = gSaveContext.hudVisibility;
|
||||
pauseCtx->itemDescriptionOn = false;
|
||||
pauseCtx->state = 1;
|
||||
func_800F4A10(play);
|
||||
pauseCtx->mode = pauseCtx->pageIndex * 2 + 1;
|
||||
@@ -122,23 +122,23 @@ void KaleidoSetup_Init(PlayState* play) {
|
||||
pauseCtx->unk_20C = 936.0f;
|
||||
pauseCtx->unk_220 = -314.0f;
|
||||
|
||||
pauseCtx->unk_238[PAUSE_MAP] = XREG(94) + 3;
|
||||
pauseCtx->cursorPoint[PAUSE_MAP] = XREG(94) + 3;
|
||||
|
||||
pauseCtx->unk_258 = 11;
|
||||
pauseCtx->unk_25A = 0;
|
||||
pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_RIGHT;
|
||||
pauseCtx->pageSwitchTimer = 0;
|
||||
|
||||
pauseCtx->cursorItem[PAUSE_ITEM] = 999;
|
||||
pauseCtx->cursorItem[PAUSE_ITEM] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_MAP] = XREG(94) + 3;
|
||||
pauseCtx->cursorItem[PAUSE_QUEST] = 999;
|
||||
pauseCtx->cursorItem[PAUSE_MASK] = 999;
|
||||
pauseCtx->cursorItem[PAUSE_QUEST] = PAUSE_ITEM_NONE;
|
||||
pauseCtx->cursorItem[PAUSE_MASK] = PAUSE_ITEM_NONE;
|
||||
|
||||
pauseCtx->unk_268[PAUSE_ITEM] = 0;
|
||||
pauseCtx->unk_268[PAUSE_MAP] = XREG(94) + 3;
|
||||
pauseCtx->cursorSlot[PAUSE_ITEM] = 0;
|
||||
pauseCtx->cursorSlot[PAUSE_MAP] = XREG(94) + 3;
|
||||
|
||||
pauseCtx->unk_284 = 2;
|
||||
pauseCtx->cursorColorSet = 2;
|
||||
pauseCtx->unk_2A0 = -1;
|
||||
pauseCtx->unk_2BA = 320;
|
||||
pauseCtx->unk_2BC = 40;
|
||||
pauseCtx->equipAnimScale = 320;
|
||||
pauseCtx->equipAnimShrinkRate = 40;
|
||||
pauseCtx->promptAlpha = 100;
|
||||
|
||||
View_Init(&pauseCtx->view, play->state.gfxCtx);
|
||||
|
||||
+17
-17
@@ -5,7 +5,7 @@ s16 sMinimapInitPosX = 0;
|
||||
s16 sMinimapInitPosZ = 0;
|
||||
s16 sMinimapInitDir = 0;
|
||||
|
||||
s32 sDungeonAndBossScenes[] = {
|
||||
s32 sDungeonAndBossSceneIds[] = {
|
||||
SCENE_MITURIN, SCENE_HAKUGIN, SCENE_SEA, SCENE_INISIE_N, SCENE_INISIE_R,
|
||||
SCENE_MITURIN_BS, SCENE_HAKUGIN_BS, SCENE_SEA_BS, SCENE_INISIE_BS,
|
||||
};
|
||||
@@ -17,8 +17,8 @@ s32 sDungeonAndBossScenes[] = {
|
||||
s32 Map_GetDungeonOrBossAreaIndex(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonAndBossScenes); i++) {
|
||||
if (Play_GetOriginalSceneNumber(play->sceneNum) == sDungeonAndBossScenes[i]) {
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonAndBossSceneIds); i++) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == sDungeonAndBossSceneIds[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ s32 func_8010A0A4(PlayState* play) {
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 sDungeonScenes[] = {
|
||||
s32 sDungeonSceneIds[] = {
|
||||
SCENE_MITURIN, SCENE_HAKUGIN, SCENE_SEA, SCENE_INISIE_N, SCENE_INISIE_R,
|
||||
};
|
||||
|
||||
@@ -56,8 +56,8 @@ s32 sDungeonScenes[] = {
|
||||
s32 Map_GetDungeonAreaIndex(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonScenes); i++) {
|
||||
if (Play_GetOriginalSceneNumber(play->sceneNum) == sDungeonScenes[i]) {
|
||||
for (i = 0; i < ARRAY_COUNT(sDungeonSceneIds); i++) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == sDungeonSceneIds[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ s32 Map_IsInDungeonArea(PlayState* play) {
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 sBossScenes[] = {
|
||||
s32 sBossSceneIds[] = {
|
||||
SCENE_MITURIN_BS, // DUNGEON_INDEX_WOODFALL_TEMPLE
|
||||
SCENE_HAKUGIN_BS, // DUNGEON_INDEX_SNOWHEAD_TEMPLE
|
||||
SCENE_SEA_BS, // DUNGEON_INDEX_GREAT_BAY_TEMPLE
|
||||
@@ -90,8 +90,8 @@ s32 sBossScenes[] = {
|
||||
s32 Map_GetBossAreaIndex(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sBossScenes); i++) {
|
||||
if (Play_GetOriginalSceneNumber(play->sceneNum) == sBossScenes[i]) {
|
||||
for (i = 0; i < ARRAY_COUNT(sBossSceneIds); i++) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == sBossSceneIds[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ s32 func_8010A238(PlayState* play) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_801BF5A4); i++) {
|
||||
if (Play_GetOriginalSceneNumber(play->sceneNum) == D_801BF5A4[i]) {
|
||||
if (Play_GetOriginalSceneId(play->sceneId) == D_801BF5A4[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
|
||||
if (room >= 0) {
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
gSaveContext.save.permanentSceneFlags[Play_GetOriginalSceneNumber(play->sceneNum)].rooms |= gBitFlags[room];
|
||||
gSaveContext.save.permanentSceneFlags[Play_GetOriginalSceneId(play->sceneId)].rooms |= gBitFlags[room];
|
||||
interfaceCtx->mapRoomNum = room;
|
||||
interfaceCtx->dungeonOrBossAreaMapIndex = mapIndex;
|
||||
}
|
||||
@@ -169,15 +169,15 @@ void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
}
|
||||
}
|
||||
|
||||
void Map_Destroy(void) {
|
||||
func_80105A40();
|
||||
void Map_Destroy(PlayState* play) {
|
||||
func_80105A40(play);
|
||||
}
|
||||
|
||||
void Map_Init(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s32 dungeonIndex;
|
||||
|
||||
func_80105C40(play->roomCtx.currRoom.num);
|
||||
func_80105C40(play->roomCtx.curRoom.num);
|
||||
interfaceCtx->unk_278 = -1;
|
||||
interfaceCtx->dungeonOrBossAreaMapIndex = -1;
|
||||
interfaceCtx->mapSegment = THA_AllocEndAlign16(&play->state.heap, 0x1000);
|
||||
@@ -189,7 +189,7 @@ void Map_Init(PlayState* play) {
|
||||
if (Map_IsInDungeonOrBossArea(play)) {
|
||||
dungeonIndex = Map_GetDungeonOrBossAreaIndex(play);
|
||||
gSaveContext.mapIndex = dungeonIndex;
|
||||
switch (play->sceneNum) {
|
||||
switch (play->sceneId) {
|
||||
case SCENE_MITURIN_BS:
|
||||
dungeonIndex = DUNGEON_INDEX_WOODFALL_TEMPLE;
|
||||
break;
|
||||
@@ -208,7 +208,7 @@ void Map_Init(PlayState* play) {
|
||||
}
|
||||
|
||||
gSaveContext.dungeonIndex = dungeonIndex;
|
||||
Map_InitRoomData(play, play->roomCtx.currRoom.num);
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ void Map_Update(PlayState* play) {
|
||||
if (Map_IsInDungeonArea(play)) {
|
||||
floor = func_80109124(player->actor.world.pos.y);
|
||||
if (floor != -1) {
|
||||
gSaveContext.save.permanentSceneFlags[Play_GetOriginalSceneNumber(play->sceneNum)].unk_14 |=
|
||||
gSaveContext.save.permanentSceneFlags[Play_GetOriginalSceneId(play->sceneId)].unk_14 |=
|
||||
gBitFlags[FLOOR_INDEX_MAX - floor];
|
||||
XREG(94) = FLOOR_INDEX_MAX - floor;
|
||||
if (interfaceCtx->mapRoomNum != sLastRoomNum) {
|
||||
|
||||
@@ -267,10 +267,10 @@ void func_8014D62C(PlayState* play, s32* arg1, f32* arg2, s16* arg3) {
|
||||
s16 phi_v0;
|
||||
s16 phi_s0;
|
||||
|
||||
if ((func_8010A0A4(play) != 0) || (play->sceneNum == 0x4F)) {
|
||||
if ((func_8010A0A4(play) != 0) || (play->sceneId == SCENE_SECOM)) {
|
||||
phi_v0 = 0xA;
|
||||
} else {
|
||||
phi_v0 = pauseCtx->unk_238[PAUSE_WORLD_MAP];
|
||||
phi_v0 = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
|
||||
}
|
||||
|
||||
temp_s6 = D_801D0250[phi_v0];
|
||||
@@ -360,7 +360,7 @@ void func_80151A68(PlayState* play, u16 textId) {
|
||||
XREG(77) = 0x3C;
|
||||
XREG(76) = 0x1C;
|
||||
msgCtx->unk11F1A[0] = msgCtx->unk11F1A[1] = msgCtx->unk11F1A[2] = 0;
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -254,10 +254,10 @@ void Message_LoadAreaTextNES(PlayState* play, s32* offset, f32* arg2, s16* decod
|
||||
s16 currentArea;
|
||||
s16 stringLimit;
|
||||
|
||||
if ((func_8010A0A4(play) != 0) || (play->sceneNum == SCENE_SECOM)) {
|
||||
if ((func_8010A0A4(play) != 0) || (play->sceneId == SCENE_SECOM)) {
|
||||
currentArea = 10;
|
||||
} else {
|
||||
currentArea = play->pauseCtx.unk_238[PAUSE_WORLD_MAP];
|
||||
currentArea = play->pauseCtx.cursorPoint[PAUSE_WORLD_MAP];
|
||||
}
|
||||
stringLimit = D_801D07C4[currentArea];
|
||||
|
||||
|
||||
+1454
-43
File diff suppressed because it is too large
Load Diff
+28
-28
@@ -450,7 +450,7 @@ void Play_Destroy(GameState* thisx) {
|
||||
}
|
||||
gSaveContext.save.weekEventReg[0x5C] &= (u8)~0x80;
|
||||
|
||||
func_80121F94(this);
|
||||
Interface_Destroy(this);
|
||||
KaleidoScopeCall_Destroy(this);
|
||||
KaleidoManager_Destroy();
|
||||
ZeldaArena_Cleanup();
|
||||
@@ -593,7 +593,7 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
if (this->transitionTrigger != TRANS_TRIGGER_END) {
|
||||
s16 sceneLayer = 0;
|
||||
|
||||
Interface_ChangeAlpha(1);
|
||||
Interface_SetHudVisibility(HUD_VISIBILITY_NONE);
|
||||
|
||||
if (gSaveContext.nextCutsceneIndex >= 0xFFF0) {
|
||||
sceneLayer = (gSaveContext.nextCutsceneIndex & 0xF) + 1;
|
||||
@@ -608,7 +608,7 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
!(gSaveContext.save.weekEventReg[0x37] & 0x80)) ||
|
||||
((this->nextEntrance == ENTRANCE(ROAD_TO_IKANA, 1)) &&
|
||||
!(gSaveContext.save.weekEventReg[0x34] & 0x20))) &&
|
||||
(!func_800FE590(this) || (Entrance_GetSceneNum(this->nextEntrance + sceneLayer) < 0) ||
|
||||
(!func_800FE590(this) || (Entrance_GetSceneId(this->nextEntrance + sceneLayer) < 0) ||
|
||||
(func_801A8A50(0) != NA_BGM_FINAL_HOURS))) {
|
||||
func_801A4058(20);
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
@@ -621,7 +621,7 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
}
|
||||
|
||||
if (func_800FE590(this) && (Entrance_GetSceneNum(this->nextEntrance + sceneLayer) >= 0) &&
|
||||
if (func_800FE590(this) && (Entrance_GetSceneId(this->nextEntrance + sceneLayer) >= 0) &&
|
||||
(func_801A8A50(0) == NA_BGM_FINAL_HOURS)) {
|
||||
func_801A41C8(20);
|
||||
}
|
||||
@@ -1012,7 +1012,7 @@ void Play_Update(PlayState* this) {
|
||||
Rumble_SetUpdateEnabled(false);
|
||||
}
|
||||
|
||||
Room_nop8012D510(this, &this->roomCtx.currRoom, &pad58[1], 0);
|
||||
Room_nop8012D510(this, &this->roomCtx.curRoom, &pad58[1], 0);
|
||||
Room_nop8012D510(this, &this->roomCtx.prevRoom, &pad58[1], 1);
|
||||
SkyboxDraw_Update(&this->skyboxCtx);
|
||||
|
||||
@@ -1149,7 +1149,7 @@ void Play_Draw(PlayState* this) {
|
||||
}
|
||||
|
||||
if ((SREG(94) < 2) && (gTrnsnUnkState < 2)) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.currRoom.mesh->type0.type == 1)) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.mesh->type0.type == 1)) {
|
||||
func_8012CF0C(gfxCtx, 0, 1, 0, 0, 0);
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, 1, 1, this->lightCtx.unk7, this->lightCtx.unk8, this->lightCtx.unk9);
|
||||
@@ -1299,7 +1299,7 @@ void Play_Draw(PlayState* this) {
|
||||
func_800FE390(this);
|
||||
sp268 = LightContext_NewLights(&this->lightCtx, gfxCtx);
|
||||
|
||||
if (this->roomCtx.currRoom.enablePosLights || (MREG(93) != 0)) {
|
||||
if (this->roomCtx.curRoom.enablePosLights || (MREG(93) != 0)) {
|
||||
sp268->enablePosLights = true;
|
||||
}
|
||||
|
||||
@@ -1314,7 +1314,7 @@ void Play_Draw(PlayState* this) {
|
||||
// `if (stuff that evaluates to 0 but not trivially)`
|
||||
s64 roomDrawFlags = 3;
|
||||
|
||||
Room_Draw(this, &this->roomCtx.currRoom, roomDrawFlags);
|
||||
Room_Draw(this, &this->roomCtx.curRoom, roomDrawFlags);
|
||||
Room_Draw(this, &this->roomCtx.prevRoom, roomDrawFlags);
|
||||
}
|
||||
|
||||
@@ -1575,13 +1575,13 @@ void func_801692C4(PlayState* this, s32 spawn) {
|
||||
func_8016927C(this, this->skyboxId);
|
||||
}
|
||||
|
||||
void Play_SceneInit(PlayState* this, s32 scene, s32 spawn) {
|
||||
void Play_SceneInit(PlayState* this, s32 sceneId, s32 spawn) {
|
||||
s32 pad;
|
||||
SceneTableEntry* sp1C = &gSceneTable[scene];
|
||||
SceneTableEntry* sp1C = &gSceneTable[sceneId];
|
||||
|
||||
sp1C->unk_D = 0;
|
||||
this->loadedScene = sp1C;
|
||||
this->sceneNum = scene;
|
||||
this->sceneId = sceneId;
|
||||
this->sceneConfig = sp1C->drawConfig;
|
||||
this->sceneSegment = Play_LoadScene(this, &sp1C->segment);
|
||||
sp1C->unk_D = 0;
|
||||
@@ -1818,38 +1818,38 @@ Vec3s* Play_GetActorCsCamFuncData(PlayState* this, s32 csCamDataIndex) {
|
||||
* Converts the number of a scene to its "original" equivalent, the default version of the area which the player first
|
||||
* enters.
|
||||
*/
|
||||
s16 Play_GetOriginalSceneNumber(s16 sceneNum) {
|
||||
s16 Play_GetOriginalSceneId(s16 sceneId) {
|
||||
// Inverted Stone Tower Temple -> Stone Tower Temple
|
||||
if (sceneNum == SCENE_INISIE_R) {
|
||||
if (sceneId == SCENE_INISIE_R) {
|
||||
return SCENE_INISIE_N;
|
||||
}
|
||||
|
||||
// Purified Southern Swamp -> Poisoned Sothern Swamp
|
||||
if (sceneNum == SCENE_20SICHITAI2) {
|
||||
if (sceneId == SCENE_20SICHITAI2) {
|
||||
return SCENE_20SICHITAI;
|
||||
}
|
||||
|
||||
// Spring Mountain Village -> Winter Mountain Village
|
||||
if (sceneNum == SCENE_10YUKIYAMANOMURA2) {
|
||||
if (sceneId == SCENE_10YUKIYAMANOMURA2) {
|
||||
return SCENE_10YUKIYAMANOMURA;
|
||||
}
|
||||
|
||||
// Spring Goron Village -> Winter Goron Village
|
||||
if (sceneNum == SCENE_11GORONNOSATO2) {
|
||||
if (sceneId == SCENE_11GORONNOSATO2) {
|
||||
return SCENE_11GORONNOSATO;
|
||||
}
|
||||
|
||||
// Spring Path to Goron Village -> Winter Path to Goron Village
|
||||
if (sceneNum == SCENE_17SETUGEN2) {
|
||||
if (sceneId == SCENE_17SETUGEN2) {
|
||||
return SCENE_17SETUGEN;
|
||||
}
|
||||
|
||||
// Inverted Stone Tower -> Stone Tower
|
||||
if (sceneNum == SCENE_F41) {
|
||||
if (sceneId == SCENE_F41) {
|
||||
return SCENE_F40;
|
||||
}
|
||||
|
||||
return sceneNum;
|
||||
return sceneId;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1860,13 +1860,13 @@ void Play_SaveCycleSceneFlags(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
CycleSceneFlags* cycleSceneFlags;
|
||||
|
||||
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneNumber(this->sceneNum)];
|
||||
cycleSceneFlags = &gSaveContext.cycleSceneFlags[Play_GetOriginalSceneId(this->sceneId)];
|
||||
cycleSceneFlags->chest = this->actorCtx.sceneFlags.chest;
|
||||
cycleSceneFlags->switch0 = this->actorCtx.sceneFlags.switches[0];
|
||||
cycleSceneFlags->switch1 = this->actorCtx.sceneFlags.switches[1];
|
||||
|
||||
if (this->sceneNum == SCENE_INISIE_R) { // Inverted Stone Tower Temple
|
||||
cycleSceneFlags = &gSaveContext.cycleSceneFlags[this->sceneNum];
|
||||
if (this->sceneId == SCENE_INISIE_R) { // Inverted Stone Tower Temple
|
||||
cycleSceneFlags = &gSaveContext.cycleSceneFlags[this->sceneId];
|
||||
}
|
||||
|
||||
cycleSceneFlags->collectible = this->actorCtx.sceneFlags.collectible[0];
|
||||
@@ -1891,16 +1891,16 @@ void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams)
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
Player* player = GET_PLAYER(this);
|
||||
|
||||
if (this->sceneNum != SCENE_KAKUSIANA) { // Grottos
|
||||
if (this->sceneId != SCENE_KAKUSIANA) { // Grottos
|
||||
Play_SetRespawnData(&this->state, respawnMode, (u16)((void)0, gSaveContext.save.entrance),
|
||||
this->roomCtx.currRoom.num, playerParams, &player->actor.world.pos,
|
||||
this->roomCtx.curRoom.num, playerParams, &player->actor.world.pos,
|
||||
player->actor.shape.rot.y);
|
||||
}
|
||||
}
|
||||
|
||||
// Override respawn data in Sakon's Hideout
|
||||
void func_80169ECC(PlayState* this) {
|
||||
if (this->sceneNum == SCENE_SECOM) {
|
||||
if (this->sceneId == SCENE_SECOM) {
|
||||
this->nextEntrance = ENTRANCE(IKANA_CANYON, 6);
|
||||
gSaveContext.respawnFlag = -7;
|
||||
}
|
||||
@@ -1943,7 +1943,7 @@ void func_80169FDC(GameState* thisx) {
|
||||
s32 func_80169FFC(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
return this->roomCtx.currRoom.mesh->type0.type != 1;
|
||||
return this->roomCtx.curRoom.mesh->type0.type != 1;
|
||||
}
|
||||
|
||||
s32 FrameAdvance_IsEnabled(GameState* thisx) {
|
||||
@@ -2214,7 +2214,7 @@ void Play_Init(GameState* thisx) {
|
||||
|
||||
Play_SceneInit(
|
||||
this,
|
||||
Entrance_GetSceneNumAbsolute(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneSetupIndex)),
|
||||
Entrance_GetSceneIdAbsolute(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneSetupIndex)),
|
||||
Entrance_GetSpawnNum(((void)0, gSaveContext.save.entrance) + ((void)0, gSaveContext.sceneSetupIndex)));
|
||||
KaleidoScopeCall_Init(this);
|
||||
func_80121FC4(this);
|
||||
@@ -2301,7 +2301,7 @@ void Play_Init(GameState* thisx) {
|
||||
|
||||
while (Room_HandleLoadCallbacks(this, &this->roomCtx) == 0) {}
|
||||
|
||||
if ((CURRENT_DAY != 0) && ((this->roomCtx.currRoom.unk3 == 1) || (this->roomCtx.currRoom.unk3 == 5))) {
|
||||
if ((CURRENT_DAY != 0) && ((this->roomCtx.curRoom.unk3 == 1) || (this->roomCtx.curRoom.unk3 == 5))) {
|
||||
Actor_Spawn(&this->actorCtx, this, 0x15A, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
+26
-22
@@ -30,7 +30,7 @@ void func_80127B64(struct_801F58B0 arg0[], UNK_TYPE arg1, Vec3f* arg2);
|
||||
s32 func_801226E0(PlayState* play, s32 arg1) {
|
||||
if (arg1 == 0) {
|
||||
Play_SetupRespawnPoint(&play->state, RESPAWN_MODE_DOWN, 0xBFF);
|
||||
if (play->sceneNum == SCENE_KAKUSIANA) {
|
||||
if (play->sceneId == SCENE_KAKUSIANA) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -274,7 +274,7 @@ u8 Player_MaskIdToItemId(s32 maskIdMinusOne) {
|
||||
return sMaskItemIds[maskIdMinusOne];
|
||||
}
|
||||
|
||||
u8 Player_GetCurMaskItemId(PlayState* play) {
|
||||
s32 Player_GetCurMaskItemId(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (player->currentMask != PLAYER_MASK_NONE) {
|
||||
@@ -389,7 +389,7 @@ void func_80123140(PlayState* play, Player* player) {
|
||||
IREG(69) = bootRegs[16];
|
||||
MREG(95) = bootRegs[17];
|
||||
|
||||
if (play->roomCtx.currRoom.unk3 == 2) {
|
||||
if (play->roomCtx.curRoom.unk3 == 2) {
|
||||
R_RUN_SPEED_LIMIT = 500;
|
||||
}
|
||||
|
||||
@@ -508,20 +508,23 @@ s32 func_8012364C(PlayState* play, Player* player, s32 arg2) {
|
||||
if (arg2 == 1) {
|
||||
return (gSaveContext.buttonStatus[1] != BTN_DISABLED)
|
||||
? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT]
|
||||
: (gSaveContext.unk_3F22 == 0x10) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT]
|
||||
: ITEM_NONE;
|
||||
: (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
|
||||
? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_LEFT]
|
||||
: ITEM_NONE;
|
||||
}
|
||||
|
||||
if (arg2 == 2) {
|
||||
return (gSaveContext.buttonStatus[2] != BTN_DISABLED)
|
||||
? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN]
|
||||
: (gSaveContext.unk_3F22 == 0x10) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN]
|
||||
: ITEM_NONE;
|
||||
: (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
|
||||
? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_DOWN]
|
||||
: ITEM_NONE;
|
||||
}
|
||||
|
||||
return (gSaveContext.buttonStatus[3] != BTN_DISABLED) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
|
||||
: (gSaveContext.unk_3F22 == 0x10) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
|
||||
: ITEM_NONE;
|
||||
: (gSaveContext.hudVisibility == HUD_VISIBILITY_A_B_C)
|
||||
? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
|
||||
: ITEM_NONE;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123810.s")
|
||||
@@ -857,39 +860,40 @@ s32 func_80124278(Actor* actor, s32 actionParam) {
|
||||
}
|
||||
|
||||
s32 func_801242B4(Player* player) {
|
||||
return (player->stateFlags1 & PLAYER_STATE1_8000000) && player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER;
|
||||
return (player->stateFlags1 & PLAYER_STATE1_8000000) && (player->currentBoots < PLAYER_BOOTS_ZORA_UNDERWATER);
|
||||
}
|
||||
|
||||
s32 func_801242DC(PlayState* play) {
|
||||
s32 Player_GetEnvTimerType(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
TextTriggerEntry* triggerEntry;
|
||||
s32 envIndex;
|
||||
s32 envTimerType;
|
||||
|
||||
if (play->roomCtx.currRoom.unk2 == 3) { // Room is hot
|
||||
envIndex = 0;
|
||||
} else if ((player->transformation != PLAYER_FORM_ZORA) && (player->unk_AD8 > 80)) {
|
||||
envIndex = 3;
|
||||
if (play->roomCtx.curRoom.unk2 == 3) { // Room is hot
|
||||
envTimerType = PLAYER_ENV_TIMER_HOTROOM - 1;
|
||||
} else if ((player->transformation != PLAYER_FORM_ZORA) && (player->underwaterTimer > 80)) {
|
||||
envTimerType = PLAYER_ENV_TIMER_UNDERWATER_FREE - 1;
|
||||
} else if (player->stateFlags1 & PLAYER_STATE1_8000000) {
|
||||
if ((player->transformation == PLAYER_FORM_ZORA) && (player->currentBoots >= PLAYER_BOOTS_ZORA_UNDERWATER) &&
|
||||
(player->actor.bgCheckFlags & 1)) {
|
||||
envIndex = 1;
|
||||
envTimerType = PLAYER_ENV_TIMER_UNDERWATER_FLOOR - 1;
|
||||
} else {
|
||||
envIndex = 2;
|
||||
envTimerType = PLAYER_ENV_TIMER_SWIMMING - 1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
return PLAYER_ENV_TIMER_NONE;
|
||||
}
|
||||
|
||||
// Trigger general textboxes under certain conditions, like "It's so hot in here!". Unused in MM
|
||||
triggerEntry = &sEnvironmentTextTriggers[envIndex];
|
||||
triggerEntry = &sEnvironmentTextTriggers[envTimerType];
|
||||
if (!Player_InCsMode(play)) {
|
||||
if ((triggerEntry->flag) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) && (envIndex == 0)) {
|
||||
if ((triggerEntry->flag) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) &&
|
||||
(envTimerType == (PLAYER_ENV_TIMER_HOTROOM - 1))) {
|
||||
Message_StartTextbox(play, triggerEntry->textId, NULL);
|
||||
gSaveContext.textTriggerFlags |= triggerEntry->flag;
|
||||
}
|
||||
}
|
||||
|
||||
return envIndex + 1;
|
||||
return envTimerType + 1;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80124420.s")
|
||||
|
||||
+11
-12
@@ -64,8 +64,8 @@ void Room_DrawType1Mesh(PlayState* play, Room* room, u32 flags) {
|
||||
|
||||
void Room_Init(PlayState* play, RoomContext* roomCtx) {
|
||||
s32 i;
|
||||
roomCtx->currRoom.num = -1;
|
||||
roomCtx->currRoom.segment = NULL;
|
||||
roomCtx->curRoom.num = -1;
|
||||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->unk78 = 1;
|
||||
roomCtx->unk79 = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -79,9 +79,9 @@ s32 Room_StartRoomTransition(PlayState* play, RoomContext* roomCtx, s32 index) {
|
||||
if (roomCtx->unk31 == 0) {
|
||||
s32 size;
|
||||
|
||||
roomCtx->prevRoom = roomCtx->currRoom;
|
||||
roomCtx->currRoom.num = index;
|
||||
roomCtx->currRoom.segment = NULL;
|
||||
roomCtx->prevRoom = roomCtx->curRoom;
|
||||
roomCtx->curRoom.num = index;
|
||||
roomCtx->curRoom.segment = NULL;
|
||||
roomCtx->unk31 = 1;
|
||||
|
||||
size = play->roomList[index].vromEnd - play->roomList[index].vromStart;
|
||||
@@ -103,16 +103,15 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) {
|
||||
if (roomCtx->unk31 == 1) {
|
||||
if (!osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK)) {
|
||||
roomCtx->unk31 = 0;
|
||||
roomCtx->currRoom.segment = roomCtx->activeRoomVram;
|
||||
roomCtx->curRoom.segment = roomCtx->activeRoomVram;
|
||||
// TODO: Segment number enum
|
||||
gSegments[0x03] = PHYSICAL_TO_VIRTUAL(roomCtx->activeRoomVram);
|
||||
|
||||
Scene_ProcessHeader(play, (SceneCmd*)roomCtx->currRoom.segment);
|
||||
Scene_ProcessHeader(play, (SceneCmd*)roomCtx->curRoom.segment);
|
||||
func_80123140(play, GET_PLAYER(play));
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
|
||||
if (((play->sceneNum != SCENE_IKANA) || (roomCtx->currRoom.num != 1)) &&
|
||||
(play->sceneNum != SCENE_IKNINSIDE)) {
|
||||
if (((play->sceneId != SCENE_IKANA) || (roomCtx->curRoom.num != 1)) && (play->sceneId != SCENE_IKNINSIDE)) {
|
||||
play->envCtx.lightSettingOverride = 0xFF;
|
||||
play->envCtx.unk_E0 = 0;
|
||||
}
|
||||
@@ -142,9 +141,9 @@ void func_8012EBF8(PlayState* play, RoomContext* roomCtx) {
|
||||
roomCtx->prevRoom.segment = NULL;
|
||||
func_800BA798(play, &play->actorCtx);
|
||||
Actor_SpawnTransitionActors(play, &play->actorCtx);
|
||||
if (roomCtx->currRoom.num > -1) {
|
||||
Map_InitRoomData(play, roomCtx->currRoom.num);
|
||||
if (roomCtx->curRoom.num > -1) {
|
||||
Map_InitRoomData(play, roomCtx->curRoom.num);
|
||||
Minimap_SavePlayerRoomInitInfo(play);
|
||||
}
|
||||
func_801A3CD8(play->roomCtx.currRoom.echo);
|
||||
func_801A3CD8(play->roomCtx.curRoom.echo);
|
||||
}
|
||||
|
||||
+14
-14
@@ -28,12 +28,12 @@ void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) {
|
||||
u32 spaceSize;
|
||||
s32 i;
|
||||
|
||||
if (play->sceneNum == SCENE_CLOCKTOWER || play->sceneNum == SCENE_TOWN || play->sceneNum == SCENE_BACKTOWN ||
|
||||
play->sceneNum == SCENE_ICHIBA) {
|
||||
if (play->sceneId == SCENE_CLOCKTOWER || play->sceneId == SCENE_TOWN || play->sceneId == SCENE_BACKTOWN ||
|
||||
play->sceneId == SCENE_ICHIBA) {
|
||||
spaceSize = OBJECT_SPACE_SIZE_CLOCK_TOWN;
|
||||
} else if (play->sceneNum == SCENE_MILK_BAR) {
|
||||
} else if (play->sceneId == SCENE_MILK_BAR) {
|
||||
spaceSize = OBJECT_SPACE_SIZE_MILK_BAR;
|
||||
} else if (play->sceneNum == SCENE_00KEIKOKU) {
|
||||
} else if (play->sceneId == SCENE_00KEIKOKU) {
|
||||
spaceSize = OBJECT_SPACE_SIZE_TERMINA_FIELD;
|
||||
} else {
|
||||
spaceSize = OBJECT_SPACE_SIZE_DEFAULT;
|
||||
@@ -234,17 +234,17 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x08: Room Behavior
|
||||
void Scene_HeaderCmdRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.currRoom.unk3 = cmd->roomBehavior.gpFlag1;
|
||||
play->roomCtx.currRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
play->roomCtx.currRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
play->roomCtx.curRoom.unk3 = cmd->roomBehavior.gpFlag1;
|
||||
play->roomCtx.curRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
play->roomCtx.curRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
play->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
||||
play->roomCtx.currRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xB) & 1;
|
||||
play->roomCtx.curRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xB) & 1;
|
||||
play->envCtx.unk_E2 = (cmd->roomBehavior.gpFlag2 >> 0xC) & 1;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0A: Mesh Header
|
||||
void Scene_HeaderCmdMesh(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.currRoom.mesh = Lib_SegmentedToVirtual(cmd->mesh.segment);
|
||||
play->roomCtx.curRoom.mesh = Lib_SegmentedToVirtual(cmd->mesh.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0B: Object List
|
||||
@@ -446,7 +446,7 @@ void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
|
||||
// SceneTableEntry Header Command 0x16: Echo Setting
|
||||
void Scene_HeaderCmdEchoSetting(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.currRoom.echo = cmd->echoSettings.echo;
|
||||
play->roomCtx.curRoom.echo = cmd->echoSettings.echo;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x18: Alternate Header List=
|
||||
@@ -497,23 +497,23 @@ void Scene_HeaderCmdSetAreaVisitedFlag(PlayState* play, SceneCmd* cmd) {
|
||||
s16 i = 0;
|
||||
|
||||
while (true) {
|
||||
if (gScenesPerRegion[i][j] == 0xFFFF) {
|
||||
if (gSceneIdsPerRegion[i][j] == 0xFFFF) {
|
||||
i++;
|
||||
j = 0;
|
||||
|
||||
if (i == ARRAY_COUNT(gScenesPerRegion)) {
|
||||
if (i == ARRAY_COUNT(gSceneIdsPerRegion)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (play->sceneNum == gScenesPerRegion[i][j]) {
|
||||
if (play->sceneId == gSceneIdsPerRegion[i][j]) {
|
||||
break;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
if (i < ARRAY_COUNT(gScenesPerRegion)) {
|
||||
if (i < ARRAY_COUNT(gSceneIdsPerRegion)) {
|
||||
gSaveContext.save.mapsVisited = (gBitFlags[i] | gSaveContext.save.mapsVisited) | gSaveContext.save.mapsVisited;
|
||||
}
|
||||
}
|
||||
|
||||
+644
-631
File diff suppressed because it is too large
Load Diff
@@ -130,9 +130,9 @@ s32 Schedule_ReturnValueS(PlayState* play, u8** script, ScheduleOutput* output)
|
||||
|
||||
s32 Schedule_CheckNotInSceneS(PlayState* play, u8** script, ScheduleOutput* output) {
|
||||
ScheduleCmdCheckNotInSceneS* cmd = (ScheduleCmdCheckNotInSceneS*)*script;
|
||||
s16 scene = (cmd->sceneH << 8) | cmd->sceneL;
|
||||
s16 sceneId = (cmd->sceneIdH << 8) | cmd->sceneIdL;
|
||||
|
||||
if (scene != play->sceneNum) {
|
||||
if (sceneId != play->sceneId) {
|
||||
*script += cmd->offset;
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ s32 Schedule_CheckNotInSceneS(PlayState* play, u8** script, ScheduleOutput* outp
|
||||
|
||||
s32 Schedule_CheckNotInSceneL(PlayState* play, u8** script, ScheduleOutput* output) {
|
||||
ScheduleCmdCheckNotInSceneL* cmd = (ScheduleCmdCheckNotInSceneL*)*script;
|
||||
s16 scene = (cmd->sceneH << 8) | cmd->sceneL;
|
||||
s16 sceneId = (cmd->sceneIdH << 8) | cmd->sceneIdL;
|
||||
|
||||
if (scene != play->sceneNum) {
|
||||
if (sceneId != play->sceneId) {
|
||||
*script = *script + (s16)((cmd->offsetH << 8) | cmd->offsetL);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
|
||||
gSaveContext.save.pictoFlags0 = 0;
|
||||
gSaveContext.save.pictoFlags1 = 0;
|
||||
|
||||
if (play->sceneNum == SCENE_20SICHITAI) {
|
||||
if (play->sceneId == SCENE_20SICHITAI) {
|
||||
Snap_SetFlag(PICTOGRAPH_IN_SWAMP);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ s32 Snap_RecordPictographedActors(PlayState* play) {
|
||||
seen = 0;
|
||||
|
||||
// Actors which must be pictographed in a specific scene
|
||||
switch (play->sceneNum) {
|
||||
switch (play->sceneId) {
|
||||
case SCENE_20SICHITAI:
|
||||
if ((actor->id == ACTOR_EN_MNK) || (actor->id == ACTOR_EN_BIGOKUTA)) {
|
||||
seen = PICTO_SEEN_IN_SCENE;
|
||||
|
||||
+32
-32
@@ -219,13 +219,13 @@ void Sram_ActivateOwl(u8 owlId) {
|
||||
void Sram_ClearHighscores(void) {
|
||||
gSaveContext.save.unk_EE8 = (gSaveContext.save.unk_EE8 & 0xFFFF) | 0x130000;
|
||||
gSaveContext.save.unk_EE8 = (gSaveContext.save.unk_EE8 & 0xFFFF0000) | 0xA;
|
||||
gSaveContext.save.horseBackBalloonHighScore = 6000; // 60 seconds
|
||||
gSaveContext.save.horseBackBalloonHighScore = SECONDS_TO_TIMER(60);
|
||||
SET_TOWN_SHOOTING_GALLERY_HIGH_SCORE(39);
|
||||
SET_SWAMP_SHOOTING_GALLERY_HIGH_SCORE(10);
|
||||
|
||||
gSaveContext.save.dekuPlaygroundHighScores[0] = 7500; // 75 seconds
|
||||
gSaveContext.save.dekuPlaygroundHighScores[1] = 7500; // 75 seconds
|
||||
gSaveContext.save.dekuPlaygroundHighScores[2] = 7600; // 76 seconds
|
||||
gSaveContext.save.dekuPlaygroundHighScores[0] = SECONDS_TO_TIMER(75);
|
||||
gSaveContext.save.dekuPlaygroundHighScores[1] = SECONDS_TO_TIMER(75);
|
||||
gSaveContext.save.dekuPlaygroundHighScores[2] = SECONDS_TO_TIMER(76);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,7 +248,7 @@ void Sram_ClearFlagsAtDawnOfTheFirstDay(void) {
|
||||
* Used by Song of Time (when clicking "Yes") and (indirectly) by the "Dawn of the New Day" cutscene
|
||||
*/
|
||||
void Sram_SaveEndOfCycle(PlayState* play) {
|
||||
s16 sceneNum;
|
||||
s16 sceneId;
|
||||
s32 j;
|
||||
s32 i;
|
||||
u8 slot;
|
||||
@@ -264,13 +264,13 @@ void Sram_SaveEndOfCycle(PlayState* play) {
|
||||
gSaveContext.save.playerData.deaths = 999;
|
||||
}
|
||||
|
||||
sceneNum = Play_GetOriginalSceneNumber(play->sceneNum);
|
||||
sceneId = Play_GetOriginalSceneId(play->sceneId);
|
||||
Play_SaveCycleSceneFlags(&play->state);
|
||||
|
||||
play->actorCtx.sceneFlags.chest &= D_801C5FC0[sceneNum][2];
|
||||
play->actorCtx.sceneFlags.switches[0] &= D_801C5FC0[sceneNum][0];
|
||||
play->actorCtx.sceneFlags.switches[1] &= D_801C5FC0[sceneNum][1];
|
||||
play->actorCtx.sceneFlags.collectible[0] &= D_801C5FC0[sceneNum][3];
|
||||
play->actorCtx.sceneFlags.chest &= D_801C5FC0[sceneId][2];
|
||||
play->actorCtx.sceneFlags.switches[0] &= D_801C5FC0[sceneId][0];
|
||||
play->actorCtx.sceneFlags.switches[1] &= D_801C5FC0[sceneId][1];
|
||||
play->actorCtx.sceneFlags.collectible[0] &= D_801C5FC0[sceneId][3];
|
||||
play->actorCtx.sceneFlags.clearedRoom = 0;
|
||||
|
||||
for (i = 0; i < SCENE_MAX; i++) {
|
||||
@@ -608,7 +608,7 @@ SavePlayerData sSaveDefaultPlayerData = {
|
||||
0xFF, // unk_20
|
||||
0x0000, // owlActivationFlags
|
||||
0xFF, // unk_24
|
||||
SCENE_SPOT00, // savedSceneNum
|
||||
SCENE_SPOT00, // savedSceneId
|
||||
};
|
||||
|
||||
ItemEquips sSaveDefaultItemEquips = {
|
||||
@@ -646,7 +646,7 @@ Inventory sSaveDefaultInventory = {
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
// dungeonKeys
|
||||
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF },
|
||||
// defenceHearts
|
||||
// defenseHearts
|
||||
0,
|
||||
// strayFairies
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
@@ -679,7 +679,7 @@ void Sram_InitNewSave(void) {
|
||||
Lib_MemCpy(&gSaveContext.save.inventory, &sSaveDefaultInventory, sizeof(Inventory));
|
||||
Lib_MemCpy(&gSaveContext.save.checksum, &sSaveDefaultChecksum, sizeof(gSaveContext.save.checksum));
|
||||
|
||||
gSaveContext.save.horseData.scene = SCENE_F01;
|
||||
gSaveContext.save.horseData.sceneId = SCENE_F01;
|
||||
gSaveContext.save.horseData.pos.x = -1420;
|
||||
gSaveContext.save.horseData.pos.y = 257;
|
||||
gSaveContext.save.horseData.pos.z = -1285;
|
||||
@@ -708,7 +708,7 @@ SavePlayerData sSaveDebugPlayerData = {
|
||||
0xFF, // unk_20
|
||||
0, // owlActivationFlags
|
||||
0xFF, // unk_24
|
||||
SCENE_SPOT00, // savedSceneNum
|
||||
SCENE_SPOT00, // savedSceneId
|
||||
};
|
||||
|
||||
ItemEquips sSaveDebugItemEquips = {
|
||||
@@ -792,7 +792,7 @@ Inventory sSaveDebugInventory = {
|
||||
{ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 },
|
||||
// dungeonKeys
|
||||
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 },
|
||||
// defenceHearts
|
||||
// defenseHearts
|
||||
0,
|
||||
// strayFairies
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
@@ -839,7 +839,7 @@ void Sram_InitDebugSave(void) {
|
||||
|
||||
gSaveContext.save.hasTatl = true;
|
||||
|
||||
gSaveContext.save.horseData.scene = SCENE_F01;
|
||||
gSaveContext.save.horseData.sceneId = SCENE_F01;
|
||||
gSaveContext.save.horseData.pos.x = -1420;
|
||||
gSaveContext.save.horseData.pos.y = 257;
|
||||
gSaveContext.save.horseData.pos.z = -1285;
|
||||
@@ -894,13 +894,13 @@ void func_80144A94(SramContext* sramCtx) {
|
||||
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.permanentSceneFlags[i].collectible;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
|
||||
gSaveContext.unk_3DD0[i] = 0;
|
||||
gSaveContext.unk_3DE0[i] = 0;
|
||||
gSaveContext.unk_3E18[i] = 0;
|
||||
gSaveContext.unk_3E50[i] = 0;
|
||||
gSaveContext.unk_3E88[i] = 0;
|
||||
gSaveContext.unk_3EC0[i] = 0;
|
||||
for (i = 0; i < TIMER_ID_MAX; i++) {
|
||||
gSaveContext.timerStates[i] = TIMER_STATE_OFF;
|
||||
gSaveContext.timerCurTimes[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerTimeLimits[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerStartOsTimes[i] = 0;
|
||||
gSaveContext.timerStopTimes[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerPausedOsTimes[i] = 0;
|
||||
}
|
||||
|
||||
D_801BDAA0 = 1;
|
||||
@@ -969,13 +969,13 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
|
||||
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.permanentSceneFlags[i].collectible;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveContext.unk_3DD0); i++) {
|
||||
gSaveContext.unk_3DD0[i] = 0;
|
||||
gSaveContext.unk_3DE0[i] = 0;
|
||||
gSaveContext.unk_3E18[i] = 0;
|
||||
gSaveContext.unk_3E50[i] = 0;
|
||||
gSaveContext.unk_3E88[i] = 0;
|
||||
gSaveContext.unk_3EC0[i] = 0;
|
||||
for (i = 0; i < TIMER_ID_MAX; i++) {
|
||||
gSaveContext.timerStates[i] = TIMER_STATE_OFF;
|
||||
gSaveContext.timerCurTimes[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerTimeLimits[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerStartOsTimes[i] = 0;
|
||||
gSaveContext.timerStopTimes[i] = SECONDS_TO_TIMER(0);
|
||||
gSaveContext.timerPausedOsTimes[i] = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.save.isFirstCycle) {
|
||||
@@ -1598,7 +1598,7 @@ void func_80147068(SramContext* sramCtx) {
|
||||
sramCtx->status = 4;
|
||||
}
|
||||
}
|
||||
} else if (((osGetTime() - sramCtx->unk_18) * 0x40) / 3000 / 10000 >= 200) {
|
||||
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->unk_18) >= SECONDS_TO_TIMER(2)) {
|
||||
sramCtx->status = 0;
|
||||
}
|
||||
}
|
||||
@@ -1635,7 +1635,7 @@ void func_80147198(SramContext* sramCtx) {
|
||||
sramCtx->status = 4;
|
||||
}
|
||||
}
|
||||
} else if (((osGetTime() - sramCtx->unk_18) * 0x40) / 3000 / 10000 >= 200) {
|
||||
} else if (OSTIME_TO_TIMER(osGetTime() - sramCtx->unk_18) >= SECONDS_TO_TIMER(2)) {
|
||||
sramCtx->status = 0;
|
||||
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||
gSaveContext.save.isOwlSave = false;
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ void func_801431E8(GameState* gameState, SkyboxContext* skyboxCtx, s16 skyType)
|
||||
skyboxCtx->envB = 40;
|
||||
|
||||
// Inverted Stone Tower Temple and Inverted Stone Tower
|
||||
if ((play->sceneNum == SCENE_F41) || (play->sceneNum == SCENE_INISIE_R)) {
|
||||
if ((play->sceneId == SCENE_F41) || (play->sceneId == SCENE_INISIE_R)) {
|
||||
skyboxCtx->rotZ = 3.15000009537f;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user