mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
z_parameter: Hud Visibility (#942)
* Begin interface alpha docs * More Interface Alpha * cleanup docs * Minor fixes * Apply Discord Discussions * More discussions * More suggestions from OoT * fix merge
This commit is contained in:
+1
-4
@@ -1823,10 +1823,7 @@ void func_8010EA9C(s32 arg0, s32 arg1);
|
||||
// void func_8010EBA0(void);
|
||||
// void func_8010EC54(void);
|
||||
void func_8010EE74(PlayState* play, s32 day);
|
||||
void Interface_ChangeAlpha(u16 param_1);
|
||||
// void func_8010EF9C(void);
|
||||
// void func_8010F0D4(void);
|
||||
// void func_8010F1A8(void);
|
||||
void Interface_SetHudVisibility(u16 hudVisibility);
|
||||
// void func_80110038(void);
|
||||
// void func_80111CB4(void);
|
||||
// void func_801129E4(void);
|
||||
|
||||
+33
-5
@@ -54,6 +54,34 @@ typedef enum {
|
||||
#define MAGIC_NORMAL_METER 0x30
|
||||
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ HUD_VISIBILITY_IDLE,
|
||||
/* 1 */ HUD_VISIBILITY_NONE,
|
||||
/* 2 */ HUD_VISIBILITY_NONE_ALT, // Identical to HUD_VISIBILITY_NONE
|
||||
/* 3 */ HUD_VISIBILITY_HEARTS_WITH_OVERWRITE, // Uses Interface_UpdateButtonAlphas so gives the opportunity to dim only disabled buttons
|
||||
/* 4 */ HUD_VISIBILITY_A,
|
||||
/* 5 */ HUD_VISIBILITY_A_HEARTS_MAGIC_WITH_OVERWRITE, // Uses Interface_UpdateButtonAlphas so gives the opportunity to dim only disabled buttons
|
||||
/* 6 */ HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_WITH_OVERWRITE, // Uses Interface_UpdateButtonAlphas so gives the opportunity to dim only disabled buttons
|
||||
/* 7 */ HUD_VISIBILITY_ALL_NO_MINIMAP_W_DISABLED, // Only raises button alphas if not disabled
|
||||
/* 8 */ HUD_VISIBILITY_B,
|
||||
/* 9 */ HUD_VISIBILITY_HEARTS_MAGIC,
|
||||
/* 10 */ HUD_VISIBILITY_B_ALT,
|
||||
/* 11 */ HUD_VISIBILITY_HEARTS,
|
||||
/* 12 */ HUD_VISIBILITY_A_B_MINIMAP,
|
||||
/* 13 */ HUD_VISIBILITY_HEARTS_MAGIC_WITH_OVERWRITE, // Uses Interface_UpdateButtonAlphas so gives the opportunity to dim only disabled buttons
|
||||
/* 14 */ HUD_VISIBILITY_HEARTS_MAGIC_C,
|
||||
/* 15 */ HUD_VISIBILITY_ALL_NO_MINIMAP,
|
||||
/* 16 */ HUD_VISIBILITY_A_B_C,
|
||||
/* 17 */ HUD_VISIBILITY_B_MINIMAP,
|
||||
/* 18 */ HUD_VISIBILITY_HEARTS_MAGIC_MINIMAP,
|
||||
/* 19 */ HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP,
|
||||
/* 20 */ HUD_VISIBILITY_B_MAGIC,
|
||||
/* 21 */ HUD_VISIBILITY_A_B,
|
||||
/* 22 */ HUD_VISIBILITY_A_B_HEARTS_MAGIC_MINIMAP,
|
||||
/* 50 */ HUD_VISIBILITY_ALL = 50,
|
||||
/* 52 */ HUD_VISIBILITY_NONE_INSTANT = 52
|
||||
} HudVisibility;
|
||||
|
||||
typedef struct SramContext {
|
||||
/* 0x00 */ u8* readBuff;
|
||||
/* 0x04 */ u8 *saveBuf;
|
||||
@@ -251,11 +279,11 @@ typedef struct SaveContext {
|
||||
/* 0x3F16 */ u8 seqIndex; // "old_bgm"
|
||||
/* 0x3F17 */ u8 nightSeqIndex; // "old_env"
|
||||
/* 0x3F18 */ u8 buttonStatus[6]; // "button_item"
|
||||
/* 0x3F1E */ u8 unk_3F1E; // "ck_fg"
|
||||
/* 0x3F20 */ u16 unk_3F20; // "alpha_type"
|
||||
/* 0x3F22 */ u16 unk_3F22; // "prev_alpha_type"
|
||||
/* 0x3F24 */ u16 unk_3F24; // "alpha_count"
|
||||
/* 0x3F26 */ u16 unk_3F26; // "last_time_type"
|
||||
/* 0x3F1E */ u8 hudVisibilityForceButtonAlphasByStatus; // if btn alphas are updated through Interface_UpdateButtonAlphas, instead update them through Interface_UpdateButtonAlphasByStatus "ck_fg"
|
||||
/* 0x3F20 */ u16 nextHudVisibility; // triggers the hud to change visibility to the requested value. Reset to HUD_VISIBILITY_IDLE when target is reached "alpha_type"
|
||||
/* 0x3F22 */ u16 hudVisibility; // current hud visibility "prev_alpha_type"
|
||||
/* 0x3F24 */ u16 hudVisibilityTimer; // number of frames in the transition to a new hud visibility. Used to step alpha "alpha_count"
|
||||
/* 0x3F26 */ u16 prevHudVisibility; // used to store and recover hud visibility for pause menu and text boxes "last_time_type"
|
||||
/* 0x3F28 */ s16 magicState; // determines magic meter behavior on each frame "magic_flag"
|
||||
/* 0x3F2A */ s16 isMagicRequested; // a request to add magic has been given "recovery_magic_flag"
|
||||
/* 0x3F2C */ s16 magicFlag; // Set to 0 in func_80812D94(), otherwise unused "keep_magic_flag"
|
||||
|
||||
+4
-4
@@ -271,7 +271,7 @@ typedef struct {
|
||||
} Room; // size = 0x14
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ Room currRoom;
|
||||
/* 0x00 */ Room curRoom;
|
||||
/* 0x14 */ Room prevRoom;
|
||||
/* 0x28 */ void* roomMemPages[2]; // In a scene with transitions, roomMemory is split between two pages that toggle each transition. This is one continuous range, as the second page allocates from the end
|
||||
/* 0x30 */ u8 activeMemPage; // 0 - First page in memory, 1 - Second page
|
||||
@@ -843,11 +843,11 @@ typedef enum {
|
||||
#define SCENE_CMD_SPECIAL_FILES(elfMessageFile, keepObjectId) \
|
||||
{ SCENE_CMD_ID_SPECIAL_FILES, elfMessageFile, CMD_W(keepObjectId) }
|
||||
|
||||
#define SCENE_CMD_ROOM_BEHAVIOR(currRoomUnk3, currRoomUnk2, currRoomUnk5, msgCtxunk12044, enablePosLights, \
|
||||
#define SCENE_CMD_ROOM_BEHAVIOR(curRoomUnk3, curRoomUnk2, curRoomUnk5, msgCtxunk12044, enablePosLights, \
|
||||
kankyoContextUnkE2) \
|
||||
{ \
|
||||
SCENE_CMD_ID_ROOM_BEHAVIOR, currRoomUnk3, \
|
||||
currRoomUnk2 | _SHIFTL(currRoomUnk5, 8, 1) | _SHIFTL(msgCtxunk12044, 10, 1) | \
|
||||
SCENE_CMD_ID_ROOM_BEHAVIOR, curRoomUnk3, \
|
||||
curRoomUnk2 | _SHIFTL(curRoomUnk5, 8, 1) | _SHIFTL(msgCtxunk12044, 10, 1) | \
|
||||
_SHIFTL(enablePosLights, 11, 1) | _SHIFTL(kankyoContextUnkE2, 12, 1) \
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -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)) {
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -4404,7 +4404,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 +4489,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 +4631,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
|
||||
D_801F6D30.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++;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -81,7 +81,7 @@ 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;
|
||||
gSaveContext.prevHudVisibility = gSaveContext.hudVisibility;
|
||||
pauseCtx->itemDescriptionOn = false;
|
||||
pauseCtx->state = 1;
|
||||
func_800F4A10(play);
|
||||
|
||||
@@ -177,7 +177,7 @@ 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);
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+761
-4
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -377,7 +377,7 @@ void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams)
|
||||
|
||||
if (this->sceneNum != 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);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,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) {
|
||||
|
||||
+11
-8
@@ -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")
|
||||
@@ -865,7 +868,7 @@ s32 func_801242DC(PlayState* play) {
|
||||
TextTriggerEntry* triggerEntry;
|
||||
s32 envIndex;
|
||||
|
||||
if (play->roomCtx.currRoom.unk2 == 3) { // Room is hot
|
||||
if (play->roomCtx.curRoom.unk2 == 3) { // Room is hot
|
||||
envIndex = 0;
|
||||
} else if ((player->transformation != PLAYER_FORM_ZORA) && (player->unk_AD8 > 80)) {
|
||||
envIndex = 3;
|
||||
|
||||
+11
-11
@@ -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,15 +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)) &&
|
||||
if (((play->sceneNum != SCENE_IKANA) || (roomCtx->curRoom.num != 1)) &&
|
||||
(play->sceneNum != SCENE_IKNINSIDE)) {
|
||||
play->envCtx.lightSettingOverride = 0xFF;
|
||||
play->envCtx.unk_E0 = 0;
|
||||
@@ -142,9 +142,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);
|
||||
}
|
||||
|
||||
+6
-6
@@ -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=
|
||||
|
||||
@@ -340,14 +340,14 @@ void func_80A2A1E0(BgDblueMovebg* this, PlayState* play) {
|
||||
Math_StepToS(&this->unk_1CC, this->unk_1CE, 12);
|
||||
this->dyna.actor.shape.rot.y += this->unk_1CC;
|
||||
|
||||
if (play->roomCtx.currRoom.num == 0) {
|
||||
if (play->roomCtx.curRoom.num == 0) {
|
||||
this->opaDList = gGreatBayTempleObjectGearShaftWithPlatformsDL;
|
||||
} else if (play->roomCtx.currRoom.num == 8) {
|
||||
} else if (play->roomCtx.curRoom.num == 8) {
|
||||
this->opaDList = NULL;
|
||||
}
|
||||
|
||||
if (play->roomCtx.currRoom.num != this->unk_170) {
|
||||
if (play->roomCtx.currRoom.num != this->unk_171) {
|
||||
if (play->roomCtx.curRoom.num != this->unk_170) {
|
||||
if (play->roomCtx.curRoom.num != this->unk_171) {
|
||||
if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) {
|
||||
D_80A2BBF4.unk_01 = 0;
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
@@ -628,8 +628,8 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) {
|
||||
s32 pad;
|
||||
s32 temp_v0_3;
|
||||
|
||||
if (play->roomCtx.currRoom.num != this->unk_170) {
|
||||
if (play->roomCtx.currRoom.num != this->unk_171) {
|
||||
if (play->roomCtx.curRoom.num != this->unk_170) {
|
||||
if (play->roomCtx.curRoom.num != this->unk_171) {
|
||||
if ((play->roomCtx.prevRoom.num != this->unk_170) && (play->roomCtx.prevRoom.num != this->unk_171)) {
|
||||
D_80A2BBF4.unk_00 = 0;
|
||||
Actor_MarkForDeath(&this->dyna.actor);
|
||||
@@ -669,7 +669,7 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) {
|
||||
this->dyna.actor.shape.rot.x += this->unk_1CC;
|
||||
|
||||
if (this->unk_160 == 8) {
|
||||
if (play->roomCtx.currRoom.num == 8) {
|
||||
if (play->roomCtx.curRoom.num == 8) {
|
||||
func_80A2ABD0(this, play);
|
||||
this->unk_172 |= 0x20;
|
||||
} else {
|
||||
@@ -677,9 +677,9 @@ void func_80A2AED0(BgDblueMovebg* this, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
if (play->roomCtx.currRoom.num == 0) {
|
||||
if (play->roomCtx.curRoom.num == 0) {
|
||||
this->opaDList = gGreatBayTempleObjectWaterwheelDL;
|
||||
} else if (play->roomCtx.currRoom.num == 8) {
|
||||
} else if (play->roomCtx.curRoom.num == 8) {
|
||||
this->opaDList = gGreatBayTempleObjectWaterwheelWithFakeGearDL;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ void Boss04_Init(Actor* thisx, PlayState* play2) {
|
||||
s16 phi_s0_2;
|
||||
s32 pad;
|
||||
|
||||
if (Flags_GetClear(play, play->roomCtx.currRoom.num)) {
|
||||
if (Flags_GetClear(play, play->roomCtx.curRoom.num)) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -915,7 +915,7 @@ void DmChar00_Draw(Actor* thisx, PlayState* play2) {
|
||||
Gfx* gfx = GRAPH_ALLOC(play->state.gfxCtx, sizeof(Gfx) * 4);
|
||||
|
||||
if ((play->csCtx.state == 0) && ((play->sceneNum != SCENE_OPENINGDAN) || (gSaveContext.sceneSetupIndex != 0) ||
|
||||
(play->roomCtx.currRoom.num != 0) || (play->csCtx.currentCsIndex != 1) ||
|
||||
(play->roomCtx.curRoom.num != 0) || (play->csCtx.currentCsIndex != 1) ||
|
||||
(DMCHAR00_GET(&this->actor) != DMCHAR00_0))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -553,9 +553,9 @@ void func_808A1884(DoorShutter* this, PlayState* play) {
|
||||
play->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)].sides[(sp44.z < 0.0f) ? 0 : 1].room;
|
||||
|
||||
if (room != this->actor.room) {
|
||||
Room temp = play->roomCtx.currRoom;
|
||||
Room temp = play->roomCtx.curRoom;
|
||||
|
||||
play->roomCtx.currRoom = play->roomCtx.prevRoom;
|
||||
play->roomCtx.curRoom = play->roomCtx.prevRoom;
|
||||
play->roomCtx.prevRoom = temp;
|
||||
play->roomCtx.activeMemPage ^= 1;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user