Document hud mode

This commit is contained in:
engineer124
2022-07-14 05:29:39 +10:00
parent 91dd5910c2
commit 3a27f65cdd
24 changed files with 501 additions and 445 deletions
+1 -4
View File
@@ -1873,10 +1873,7 @@ void func_8010EA9C(s16 timeLimit, s16 arg1);
// void func_8010EBA0(void);
// void func_8010EC54(void);
void Interface_NewDay(PlayState* play, s32 day);
void Interface_ChangeAlpha(u16 param_1);
// void func_8010EF9C(void);
// void func_8010F0D4(void);
// void func_8010F1A8(void);
void Interface_ChangeHudMode(u16 hudMode);
// void func_80110038(void);
// void func_80111CB4(void);
// void Interface_SetSceneRestrictions(void);
+28
View File
@@ -582,6 +582,34 @@ typedef enum {
/* 0x2A */ DO_ACTION_MAX
} DoAction;
typedef enum {
/* 0 */ HUD_MODE_IDLE,
/* 1 */ HUD_MODE_OFF,
/* 2 */ HUD_MODE_OFF_ALT, // Identical to HUD_MODE_OFF
/* 3 */ HUD_MODE_HEARTS_W_OVERWRITE, // Uses Interface_DimButtonAlphas so gives the opportunity to overwrite
/* 4 */ HUD_MODE_A,
/* 5 */ HUD_MODE_A_HEARTS_MAGIC_W_OVERWRITE, // Uses Interface_DimButtonAlphas so gives the opportunity to overwrite
/* 6 */ HUD_MODE_A_HEARTS_MAGIC_MINIMAP_W_OVERWRITE, // Uses Interface_DimButtonAlphas so gives the opportunity to overwrite
/* 7 */ HUD_MODE_ALL_NO_MINIMAP_W_DISABLED, // Only raises button alphas if not disabled
/* 8 */ HUD_MODE_B_FAST, // reaches target twice as fast
/* 9 */ HUD_MODE_HEARTS_MAGIC,
/* 10 */ HUD_MODE_B,
/* 11 */ HUD_MODE_HEARTS,
/* 12 */ HUD_MODE_A_B_MINIMAP,
/* 13 */ HUD_MODE_HEARTS_MAGIC_W_OVERWRITE, // Uses Interface_DimButtonAlphas so gives the opportunity to overwrite
/* 14 */ HUD_MODE_HEARTS_MAGIC_C,
/* 15 */ HUD_MODE_ALL_NO_MINIMAP,
/* 16 */ HUD_MODE_A_B_C,
/* 17 */ HUD_MODE_B_MINIMAP,
/* 18 */ HUD_MODE_HEARTS_MAGIC_MINIMAP,
/* 19 */ HUD_MODE_A_HEARTS_MAGIC_MINIMAP,
/* 20 */ HUD_MODE_B_MAGIC,
/* 21 */ HUD_MODE_A_B,
/* 22 */ HUD_MODE_A_B_HEARTS_MAGIC_MINIMAP,
/* 50 */ HUD_MODE_ALL = 50,
/* 52 */ HUD_MODE_OFF_NOW = 52
} HudMode;
typedef struct {
/* 0x000 */ View view;
/* 0x168 */ Vtx* actionVtx;
+5 -5
View File
@@ -251,11 +251,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 hudModeDimOnlyDisabledButtons; // if the buttons are requested to dim, only dim disabled buttons "ck_fg"
/* 0x3F20 */ u16 requestHudMode; // triggers the hud to change modes to the requested value. Reset to 0 when target is reached "alpha_type"
/* 0x3F22 */ u16 curHudMode; // current hud mode "prev_alpha_type"
/* 0x3F24 */ u16 hudModeCounter; // number of frames in the transition to a new hud display. Used to step alpha "alpha_count"
/* 0x3F26 */ u16 prevHudMode; // used to store and recover hud display 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 magicUnusedFlag; // Set to 0 in func_80812D94, otherwise unused "keep_magic_flag"
+1
View File
@@ -1,3 +1,4 @@
#include "prevent_bss_reordering.h"
#include "global.h"
u32 sDmaMgrDmaBuffSize = 0x2000;
+1 -1
View File
@@ -16,7 +16,7 @@ void SaveContext_Init(void) {
gSaveContext.environmentTime = 0;
gSaveContext.dogIsLost = true;
gSaveContext.nextTransition = 0xFF;
gSaveContext.unk_3F26 = 50;
gSaveContext.prevHudMode = HUD_MODE_ALL;
gSaveContext.options.language = 1;
gSaveContext.options.audioSetting = 0;
gSaveContext.options.zTargetSetting = 0;
+5 -5
View File
@@ -105,7 +105,7 @@ s32 func_800EA220(PlayState* play, CutsceneContext* csCtx, f32 target) {
}
void func_800EA258(PlayState* play, CutsceneContext* csCtx) {
Interface_ChangeAlpha(1);
Interface_ChangeHudMode(HUD_MODE_OFF);
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_ChangeHudMode(HUD_MODE_OFF);
ShrinkWindow_SetLetterboxTarget(32);
if (func_800EA220(play, csCtx, 1.0f)) {
Audio_SetCutsceneFlag(true);
@@ -565,7 +565,7 @@ void Cutscene_TerminatorImpl(PlayState* play, CutsceneContext* csCtx, CsCmdBase*
gSaveContext.unk_3F48 = 1;
if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) {
gSaveContext.unk_3F1E = 1;
gSaveContext.hudModeDimOnlyDisabledButtons = true;
}
gSaveContext.save.cutscene = 0;
@@ -1100,7 +1100,7 @@ void Cutscene_Command_Textbox(PlayState* play, CutsceneContext* csCtx, CsCmdText
}
if (originalCsFrames == csCtx->frames) {
Interface_ChangeAlpha(1);
Interface_ChangeHudMode(HUD_MODE_OFF);
D_801BB124 = 0;
D_801BB128 = 0;
func_80161C0C();
@@ -1479,7 +1479,7 @@ void func_800EDA84(PlayState* play, CutsceneContext* csCtx) {
csCtx->unk_18 = 0xFFFF;
if (gSaveContext.cutsceneTrigger == 0) {
Interface_ChangeAlpha(1);
Interface_ChangeHudMode(HUD_MODE_OFF);
ShrinkWindow_SetLetterboxTarget(32);
ShrinkWindow_SetLetterboxMagnitude(0x20);
csCtx->state++;
+4 -4
View File
@@ -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.hudModeDimOnlyDisabledButtons = false;
gSaveContext.requestHudMode = HUD_MODE_IDLE;
gSaveContext.curHudMode = HUD_MODE_IDLE;
gSaveContext.hudModeCounter = 0;
Kankyo_InitGameOverLights(play);
sGameOverTimer = 20;
Rumble_Request(0.0f, 126, 124, 63);
+1 -1
View File
@@ -79,7 +79,7 @@ void KaleidoSetup_Update(PlayState* play) {
if (!(gSaveContext.eventInf[1] & 0x80) && !(player->stateFlags1 & 0x20)) {
if (!(play->actorCtx.unk5 & 2) && !(play->actorCtx.unk5 & 4)) {
if ((play->actorCtx.unk268 == 0) && CHECK_BTN_ALL(input->press.button, BTN_START)) {
gSaveContext.unk_3F26 = gSaveContext.unk_3F22;
gSaveContext.prevHudMode = gSaveContext.curHudMode;
pauseCtx->unk_2B9 = 0;
pauseCtx->state = 1;
func_800F4A10(play);
+1 -1
View File
@@ -382,7 +382,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_ChangeHudMode(HUD_MODE_OFF);
}
}
+419 -392
View File
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -508,19 +508,21 @@ 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.curHudMode == HUD_MODE_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.curHudMode == HUD_MODE_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]
: (gSaveContext.curHudMode == HUD_MODE_A_B_C) ? gSaveContext.save.equips.buttonItems[0][EQUIP_SLOT_C_RIGHT]
: ITEM_NONE;
}
@@ -4,6 +4,7 @@
* Description: Great Bay Temple - Waterwheels and push switches
*/
#include "prevent_bss_reordering.h"
#include "z_bg_dblue_movebg.h"
#include "objects/object_dblue_object/object_dblue_object.h"
#include "overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h"
@@ -597,7 +597,7 @@ void func_808B9F10(DoorWarp1* this, PlayState* play) {
if ((this->unk_203 == 0) && func_808B866C(this, play) && !Play_InCsMode(play) && (this->unk_203 == 0)) {
Player* player = GET_PLAYER(play);
Interface_ChangeAlpha(1);
Interface_ChangeHudMode(HUD_MODE_OFF);
func_800B7298(play, &this->dyna.actor, 9);
player->unk_3A0.x = this->dyna.actor.world.pos.x;
player->unk_3A0.z = this->dyna.actor.world.pos.z;
@@ -5163,7 +5163,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) {
sCameraAt.y = camera->at.y;
sCameraAt.z = camera->at.z;
D_8090CD4C = 2;
Interface_ChangeAlpha(12);
Interface_ChangeHudMode(HUD_MODE_A_B_MINIMAP);
D_80911F4C = 0.0f;
// fallthrough
+2 -2
View File
@@ -393,7 +393,7 @@ void EnFsn_EndInteraction(EnFsn* this, PlayState* play) {
Actor_ProcessTalkRequest(&this->actor, &play->state);
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
@@ -1161,7 +1161,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) {
Actor_PickUp(&this->actor, play, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f);
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
this->shopItemSelectedTween = 0.0f;
item = this->items[this->cursorIdx];
+1 -1
View File
@@ -821,7 +821,7 @@ void func_8096326C(EnFu* this, PlayState* play) {
void func_809632D0(EnFu* this) {
if (gSaveContext.save.playerForm == PLAYER_FORM_DEKU) {
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
}
gSaveContext.save.weekEventReg[8] &= (u8)~1;
+2 -2
View File
@@ -135,7 +135,7 @@ void EnMag_Init(Actor* thisx, PlayState* play) {
this->unk11F02 = 30;
this->unk11F00 = this->state = MAG_STATE_INITIAL;
if (gSaveContext.unk_3F1E != 0) {
if (gSaveContext.hudModeDimOnlyDisabledButtons) {
this->mainTitleAlpha = 210;
this->unk11F32 = 255;
this->copyrightAlpha = 255;
@@ -158,7 +158,7 @@ void EnMag_Init(Actor* thisx, PlayState* play) {
this->displayEffectEnvColor[1] = 255;
this->displayEffectEnvColor[2] = 155;
gSaveContext.unk_3F1E = 0;
gSaveContext.hudModeDimOnlyDisabledButtons = false;
this->state = MAG_STATE_FADE_IN_MASK;
sInputDelayTimer = 20;
gSaveContext.fadeDuration = 1;
@@ -302,7 +302,7 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) {
Actor_ProcessTalkRequest(&this->actor, &play->state);
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
@@ -985,7 +985,7 @@ void EnOssan_SetupBuyItemWithFanfare(PlayState* play, EnOssan* this) {
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
player->stateFlags2 &= ~0x20000000;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
EnOssan_SetupAction(this, EnOssan_BuyItemWithFanfare);
}
+2 -2
View File
@@ -442,7 +442,7 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) {
Actor_ProcessTalkRequest(&this->actor, &play->state);
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
@@ -932,7 +932,7 @@ void EnSob1_SetupBuyItemWithFanfare(PlayState* play, EnSob1* this) {
play->msgCtx.msgMode = 0x43;
play->msgCtx.unk12023 = 4;
player->stateFlags2 &= ~0x20000000;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
this->drawCursor = 0;
EnSob1_SetupAction(this, EnSob1_BuyItemWithFanfare);
}
@@ -509,9 +509,9 @@ void func_80A42F20(EnTest4* this, PlayState* play) {
if (sCurrentCs >= 0) {
ActorCutscene_Stop(sCurrentCs);
}
gSaveContext.unk_3F22 = 0;
gSaveContext.curHudMode = HUD_MODE_IDLE;
gSaveContext.eventInf[1] &= (u8)~0x80;
Interface_ChangeAlpha(50);
Interface_ChangeHudMode(HUD_MODE_ALL);
}
}

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