summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorRevoSucks <projectrevotpp@hotmail.com>2023-10-31 21:26:08 -0400
committerRevoSucks <projectrevotpp@hotmail.com>2023-10-31 21:26:08 -0400
commitb1a5cf8ede90f6ced7feaed7723d7e8b448e3597 (patch)
treef8ed3e87059c9c5bf06037eccfab79f780bd4041 /src/code
parent28ebd27e5f6c154ee8af6a97c34efd08fde48ace (diff)
parentdbedc294294ab569a3dcbb0a03dac7d2a51066b3 (diff)
z_parameter
Diffstat (limited to 'src/code')
-rw-r--r--src/code/PreRender.c4
-rw-r--r--src/code/code_8012EC80.c4
-rw-r--r--src/code/title_setup.c6
-rw-r--r--src/code/z_kaleido_setup.c4
-rw-r--r--src/code/z_message.c22
-rw-r--r--src/code/z_message_nes.c6
-rw-r--r--src/code/z_parameter.c192
-rw-r--r--src/code/z_player_lib.c4
8 files changed, 170 insertions, 72 deletions
diff --git a/src/code/PreRender.c b/src/code/PreRender.c
index d058fded3..e33fbd30e 100644
--- a/src/code/PreRender.c
+++ b/src/code/PreRender.c
@@ -104,8 +104,8 @@ void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 en
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, this->width, this->height);
- Prerender_DrawBackground2D(&gfx, buf, 0, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0, 0.0f,
- 0.0f, 1.0f, 1.0f, BG2D_FLAGS_1 | BG2D_FLAGS_2 | BG2D_FLAGS_LOAD_S2DEX2);
+ Prerender_DrawBackground2D(&gfx, buf, NULL, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0,
+ 0.0f, 0.0f, 1.0f, 1.0f, 0xB);
gDPPipeSync(gfx++);
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
diff --git a/src/code/code_8012EC80.c b/src/code/code_8012EC80.c
index 768c0b8dc..8d3d2dcf9 100644
--- a/src/code/code_8012EC80.c
+++ b/src/code/code_8012EC80.c
@@ -478,8 +478,8 @@ s32 Inventory_GetBtnBItem(PlayState* play) {
} else if (gSaveContext.bButtonStatus == BTN_DISABLED) {
return ITEM_NONE;
} else if (CUR_FORM_EQUIP(EQUIP_SLOT_B) == ITEM_NONE) {
- if (play->interfaceCtx.unk_21C != 0) {
- if (play->interfaceCtx.bButtonDoAction != 0) {
+ if (play->interfaceCtx.bButtonDoActionActive) {
+ if (play->interfaceCtx.bButtonDoAction != DO_ACTION_ATTACK) {
return play->interfaceCtx.bButtonDoAction;
}
}
diff --git a/src/code/title_setup.c b/src/code/title_setup.c
index e8aa68c44..8330df574 100644
--- a/src/code/title_setup.c
+++ b/src/code/title_setup.c
@@ -3,9 +3,9 @@
void Setup_SetRegs(void) {
XREG(2) = 0;
- XREG(10) = 0x1A;
- XREG(11) = 0x14;
- XREG(12) = 0xE;
+ XREG(10) = 26;
+ XREG(11) = 20;
+ XREG(12) = 14;
XREG(13) = 0;
R_A_BTN_Y_OFFSET = 0;
R_MAGIC_CONSUME_TIMER_GIANTS_MASK = 80;
diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c
index 61f8d2989..dcaaa9551 100644
--- a/src/code/z_kaleido_setup.c
+++ b/src/code/z_kaleido_setup.c
@@ -93,8 +93,8 @@ void KaleidoSetup_Update(PlayState* play) {
(play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
- if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) {
- if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
+ if (!Play_InCsMode(play) || ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF))) {
+ if ((play->bButtonAmmoPlusOne < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
if (!CHECK_EVENTINF(EVENTINF_17) && !(player->stateFlags1 & PLAYER_STATE1_20)) {
if (!(play->actorCtx.flags & ACTORCTX_FLAG_1) &&
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 06ac6c23d..ff16d258a 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -1245,7 +1245,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
msgCtx->stateTimer = msgCtx->decodedBuffer.wchar[++i];
Font_LoadMessageBoxEndIcon(&play->msgCtx.font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -1258,7 +1258,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
msgCtx->stateTimer = msgCtx->decodedBuffer.wchar[++i];
Font_LoadMessageBoxEndIcon(&play->msgCtx.font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -1416,7 +1416,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) {
Font_LoadMessageBoxEndIcon(font, 0);
}
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
} else {
Audio_PlaySfx(NA_SE_NONE);
@@ -3106,7 +3106,7 @@ void Message_OpenText(PlayState* play, u16 textId) {
}
if (textId == 0xFF) {
- func_80115844(play, DO_ACTION_STOP);
+ Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP);
play->msgCtx.hudVisibility = gSaveContext.hudVisibility;
Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C);
gSaveContext.save.unk_06 = 20;
@@ -3337,9 +3337,9 @@ void Message_ContinueTextbox(PlayState* play, u16 textId) {
if (interfaceCtx->unk_222 == 0) {
if (textId != 0x1B93) {
- func_8011552C(play, DO_ACTION_NEXT);
+ Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
} else if (textId != 0xF8) {
- func_8011552C(play, DO_ACTION_DECIDE);
+ Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE);
}
}
msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget;
@@ -3566,7 +3566,7 @@ void Message_DisplayOcarinaStaffImpl(PlayState* play, u16 ocarinaAction) {
msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget;
if (!noStop) {
- func_80115844(play, DO_ACTION_STOP);
+ Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP);
noStop = gSaveContext.hudVisibility;
Interface_SetHudVisibility(HUD_VISIBILITY_B_ALT);
gSaveContext.hudVisibility = noStop;
@@ -5405,9 +5405,9 @@ void Message_Update(PlayState* play) {
msgCtx->msgMode = MSGMODE_TEXT_NEXT_MSG;
if (!pauseCtx->itemDescriptionOn) {
if (msgCtx->currentTextId == 0xFF) {
- func_8011552C(play, DO_ACTION_STOP);
+ Interface_SetAButtonDoAction(play, DO_ACTION_STOP);
} else if (msgCtx->currentTextId != 0xF8) {
- func_8011552C(play, DO_ACTION_NEXT);
+ Interface_SetAButtonDoAction(play, DO_ACTION_NEXT);
}
}
break;
@@ -5698,7 +5698,7 @@ void Message_Update(PlayState* play) {
Message_CloseTextbox(play);
play->msgCtx.ocarinaMode = OCARINA_MODE_END;
gSaveContext.prevHudVisibility = HUD_VISIBILITY_A_B;
- func_80115844(play, DO_ACTION_STOP);
+ Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP);
GameState_SetFramerateDivisor(&play->state, 2);
if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) {
ShrinkWindow_Letterbox_SetSizeTarget(0);
@@ -5759,7 +5759,7 @@ void Message_Update(PlayState* play) {
XREG(31) = 0;
if (pauseCtx->itemDescriptionOn) {
- func_8011552C(play, DO_ACTION_INFO);
+ Interface_SetAButtonDoAction(play, DO_ACTION_INFO);
pauseCtx->itemDescriptionOn = false;
}
diff --git a/src/code/z_message_nes.c b/src/code/z_message_nes.c
index 2b6afbb68..069a97d45 100644
--- a/src/code/z_message_nes.c
+++ b/src/code/z_message_nes.c
@@ -590,7 +590,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
msgCtx->stateTimer = stateTimerHi;
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -605,7 +605,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
msgCtx->stateTimer = stateTimerHi;
Font_LoadMessageBoxEndIcon(font, 1);
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
}
*gfxP = gfx;
@@ -785,7 +785,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) {
Font_LoadMessageBoxEndIcon(font, 0);
}
if (play->csCtx.state == CS_STATE_IDLE) {
- func_8011552C(play, DO_ACTION_RETURN);
+ Interface_SetAButtonDoAction(play, DO_ACTION_RETURN);
}
} else {
Audio_PlaySfx(NA_SE_NONE);
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index 1ad8135a5..4da2e4d7a 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -171,6 +171,7 @@ s16 D_801BF9BC[] = {
s16 D_801BF9C4[] = { 0x9E, 0x9B };
s16 D_801BF9C8[] = { 0x17, 0x16 };
f32 D_801BF9CC[] = { -380.0f, -350.0f };
+
s16 D_801BF9D4[] = {
0xA7, // EQUIP_SLOT_B
0xE3, // EQUIP_SLOT_C_LEFT
@@ -1317,7 +1318,7 @@ void Interface_UpdateHudAlphas(PlayState* play, s16 dimmingAlpha) {
}
if ((gSaveContext.buttonStatus[EQUIP_SLOT_B] == BTN_DISABLED) ||
- (gSaveContext.bButtonStatus == ITEM_NONE)) {
+ (gSaveContext.bButtonStatus == BTN_DISABLED)) {
if (interfaceCtx->bAlpha != 70) {
interfaceCtx->bAlpha = 70;
}
@@ -2185,7 +2186,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
if (gSaveContext.save.cutsceneIndex < 0xFFF0) {
gSaveContext.hudVisibilityForceButtonAlphasByStatus = false;
if ((player->stateFlags1 & PLAYER_STATE1_800000) || CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01) ||
- (!CHECK_EVENTINF(EVENTINF_41) && (play->unk_1887C >= 2))) {
+ (!(CHECK_EVENTINF(EVENTINF_41)) && (play->bButtonAmmoPlusOne >= 2))) {
// Riding Epona OR Honey & Darling minigame OR Horseback balloon minigame OR related to swamp boat
// (non-minigame?)
if ((player->stateFlags1 & PLAYER_STATE1_800000) && (player->currentMask == PLAYER_MASK_BLAST) &&
@@ -2237,7 +2238,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
} else {
BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_BOW;
- if (play->unk_1887C >= 2) {
+ if (play->bButtonAmmoPlusOne >= 2) {
Interface_LoadItemIconImpl(play, EQUIP_SLOT_B);
} else if (gSaveContext.save.saveInfo.inventory.items[SLOT_BOW] == ITEM_NONE) {
BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_NONE;
@@ -2263,7 +2264,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
} else if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_82_08) &&
(gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE)) {
Interface_SetHudVisibility(HUD_VISIBILITY_B);
- } else if (play->unk_1887C >= 2) {
+ } else if (play->bButtonAmmoPlusOne >= 2) {
Interface_SetHudVisibility(HUD_VISIBILITY_B);
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01)) {
gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = BTN_DISABLED;
@@ -2294,7 +2295,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_BOW;
}
- if (play->unk_1887C >= 2) {
+ if (play->bButtonAmmoPlusOne >= 2) {
Interface_LoadItemIconImpl(play, EQUIP_SLOT_B);
} else if (gSaveContext.save.saveInfo.inventory.items[SLOT_BOW] == ITEM_NONE) {
BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) = ITEM_NONE;
@@ -2320,7 +2321,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP);
} else if (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) {
Interface_SetHudVisibility(HUD_VISIBILITY_B);
- } else if (play->unk_1887C >= 2) {
+ } else if (play->bButtonAmmoPlusOne >= 2) {
Interface_SetHudVisibility(HUD_VISIBILITY_B);
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01)) {
gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = BTN_DISABLED;
@@ -2364,7 +2365,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
Message_CloseTextbox(play);
if (play->msgCtx.choiceIndex != 0) {
Audio_PlaySfx_MessageCancel();
- func_80115844(play, DO_ACTION_STOP);
+ Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP);
Interface_SetHudVisibility(HUD_VISIBILITY_A_B);
sPictoState = PICTO_BOX_STATE_LENS;
REMOVE_QUEST_ITEM(QUEST_PICTOGRAPH);
@@ -2403,7 +2404,7 @@ void Interface_UpdateButtonsPart1(PlayState* play) {
} else if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) {
// Related to pictograph
if (!CHECK_QUEST_ITEM(QUEST_PICTOGRAPH)) {
- func_80115844(play, DO_ACTION_STOP);
+ Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP);
Interface_SetHudVisibility(HUD_VISIBILITY_A_B);
sPictoState = PICTO_BOX_STATE_LENS;
} else {
@@ -2469,9 +2470,16 @@ void Interface_InitMinigame(PlayState* play) {
interfaceCtx->minigameAmmo = 20;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_LoadItemIconImpl.s")
+void Interface_LoadItemIconImpl(PlayState* play, u8 btn) {
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
+
+ CmpDma_LoadFile(SEGMENT_ROM_START(icon_item_static_yar), GET_CUR_FORM_BTN_ITEM(btn),
+ &interfaceCtx->iconItemSegment[(u32)btn * 0x1000], 0x1000);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_LoadItemIcon.s")
+void Interface_LoadItemIcon(PlayState* play, u8 btn) {
+ Interface_LoadItemIconImpl(play, btn);
+}
/**
* @param play PlayState
@@ -3145,7 +3153,7 @@ void Inventory_UpdateDeitySwordEquip(PlayState* play) {
u8 btn;
if (CUR_FORM == PLAYER_FORM_FIERCE_DEITY) {
- interfaceCtx->unk_21C = 0;
+ interfaceCtx->bButtonDoActionActive = false;
interfaceCtx->bButtonDoAction = 0;
// Is simply checking if (GET_PLAYER_FORM == PLAYER_FORM_FIERCE_DEITY)
@@ -3244,23 +3252,113 @@ void Inventory_UpdateItem(PlayState* play, s16 slot, s16 item) {
}
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801153C8.s")
+void Interface_MemSetZeroed(u32* buf, s32 count) {
+ s32 i;
-TexturePtr sDoActionTextures[] = {
- gDoActionAttackENGTex,
- gDoActionCheckENGTex,
-};
+ for (i = 0; i != count; i++) {
+ buf[i] = 0;
+ }
+}
+
+void Interface_LoadAButtonDoActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 loadOffset) {
+ static TexturePtr sDoActionTextures[] = {
+ gDoActionAttackENGTex,
+ gDoActionCheckENGTex,
+ };
+
+ if (action >= DO_ACTION_MAX) {
+ action = DO_ACTION_NONE;
+ }
+
+ if (action != DO_ACTION_NONE) {
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
+ DmaMgr_SendRequestImpl(&interfaceCtx->dmaRequest,
+ (u32)interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
+ (u32)SEGMENT_ROM_START(do_action_static) + (action * DO_ACTION_TEX_SIZE),
+ DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, 0);
+ osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
+ } else {
+ gSegments[0x09] = PHYSICAL_TO_VIRTUAL(interfaceCtx->doActionSegment);
+ Interface_MemSetZeroed(Lib_SegmentedToVirtual(sDoActionTextures[loadOffset]), 0x60);
+ }
+}
+
+void Interface_SetAButtonDoAction(PlayState* play, u16 aButtonDoAction) {
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
+ PauseContext* pauseCtx = &play->pauseCtx;
+
+ if (interfaceCtx->aButtonDoAction != aButtonDoAction) {
+ interfaceCtx->aButtonDoAction = aButtonDoAction;
+ interfaceCtx->aButtonState = A_BTN_STATE_1;
+ interfaceCtx->aButtonRoll = 0.0f;
+ Interface_LoadAButtonDoActionLabel(interfaceCtx, aButtonDoAction, 1);
+ if (pauseCtx->state != PAUSE_STATE_OFF) {
+ interfaceCtx->aButtonState = A_BTN_STATE_3;
+ }
+ }
+}
+
+void Interface_SetBButtonDoAction(PlayState* play, s16 bButtonDoAction) {
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
+
+ if (((BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) >= ITEM_SWORD_KOKIRI) &&
+ (BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) <= ITEM_SWORD_GILDED)) ||
+ (BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) == ITEM_NONE) ||
+ (BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) == ITEM_DEKU_NUT)) {
+ if ((CUR_FORM == PLAYER_FORM_DEKU) && !gSaveContext.save.saveInfo.playerData.isMagicAcquired) {
+ interfaceCtx->bButtonDoAction = 0xFD;
+ } else {
+ interfaceCtx->bButtonDoAction = bButtonDoAction;
+ if (interfaceCtx->bButtonDoAction != DO_ACTION_NONE) {
+ osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1);
+ DmaMgr_SendRequestImpl(&interfaceCtx->dmaRequest, interfaceCtx->doActionSegment + 0x600,
+ (bButtonDoAction * 0x180) + SEGMENT_ROM_START(do_action_static), 0x180, 0,
+ &interfaceCtx->loadQueue, NULL);
+ osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
+ }
+
+ interfaceCtx->bButtonDoActionActive = true;
+ }
+ } else {
+ interfaceCtx->bButtonDoActionActive = false;
+ interfaceCtx->bButtonDoAction = 0;
+ }
+}
+
+void Interface_SetTatlCall(PlayState* play, u16 tatlCallState) {
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
-void func_80115428(InterfaceContext* interfaceCtx, u16 doAction, s16 loadOffset);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115428.s")
+ if (((tatlCallState == TATL_STATE_2A) || (tatlCallState == TATL_STATE_2B)) && !interfaceCtx->tatlCalling &&
+ (play->csCtx.state == CS_STATE_IDLE)) {
+ if (tatlCallState == TATL_STATE_2B) {
+ Audio_PlaySfx(NA_SE_VO_NAVY_CALL);
+ }
+ if (tatlCallState == TATL_STATE_2A) {
+ Audio_PlaySfx_AtPosWithReverb(&gSfxDefaultPos, NA_SE_VO_NA_HELLO_2, 0x20);
+ }
+ interfaceCtx->tatlCalling = true;
+ sCUpInvisible = 0;
+ sCUpTimer = 10;
+ } else if (tatlCallState == TATL_STATE_2C) {
+ if (interfaceCtx->tatlCalling) {
+ interfaceCtx->tatlCalling = false;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8011552C.s")
+void Interface_LoadBButtonDoActionLabel(PlayState* play, s16 bButtonDoAction) {
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801155B4.s")
+ interfaceCtx->unk_224 = bButtonDoAction;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115764.s")
+ osCreateMesgQueue(&play->interfaceCtx.loadQueue, &play->interfaceCtx.loadMsg, 1);
+ DmaMgr_SendRequestImpl(&interfaceCtx->dmaRequest, interfaceCtx->doActionSegment + 0x480,
+ (bButtonDoAction * 0x180) + SEGMENT_ROM_START(do_action_static), 0x180, 0,
+ &interfaceCtx->loadQueue, NULL);
+ osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115844.s")
+ interfaceCtx->unk_222 = 1;
+}
/**
* @return false if player is out of health
@@ -3701,8 +3799,8 @@ void Magic_Update(PlayState* play) {
gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA;
// fallthrough
case MAGIC_STATE_CONSUME_GORON_ZORA:
- if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == 0) &&
- (msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
+ if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE) &&
+ (msgCtx->msgMode == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) &&
(play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
if (!Play_InCsMode(play)) {
interfaceCtx->magicConsumptionTimer--;
@@ -4033,8 +4131,8 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) {
if ((button == EQUIP_SLOT_B) && (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE)) {
ammo = play->interfaceCtx.minigameAmmo;
- } else if ((button == EQUIP_SLOT_B) && (play->unk_1887C > 1)) {
- ammo = play->unk_1887C - 1;
+ } else if ((button == EQUIP_SLOT_B) && (play->bButtonAmmoPlusOne > 1)) {
+ ammo = play->bButtonAmmoPlusOne - 1;
} else if (((i == ITEM_BOW) && (AMMO(i) == CUR_CAPACITY(UPG_QUIVER))) ||
((i == ITEM_BOMB) && (AMMO(i) == CUR_CAPACITY(UPG_BOMB_BAG))) ||
((i == ITEM_DEKU_STICK) && (AMMO(i) == CUR_CAPACITY(UPG_DEKU_STICKS))) ||
@@ -4086,8 +4184,8 @@ void Interface_DrawBButtonIcons(PlayState* play) {
Interface_DrawAmmoCount(play, EQUIP_SLOT_B, interfaceCtx->bAlpha);
}
- } else if ((!interfaceCtx->unk_21C && (interfaceCtx->unk_222 == 0)) ||
- ((interfaceCtx->unk_21C &&
+ } else if ((!interfaceCtx->bButtonDoActionActive && (interfaceCtx->unk_222 == 0)) ||
+ ((interfaceCtx->bButtonDoActionActive &&
((BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) < ITEM_SWORD_KOKIRI) ||
(BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) > ITEM_SWORD_GILDED)) &&
BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) != ITEM_NONE) &&
@@ -4096,7 +4194,7 @@ void Interface_DrawBButtonIcons(PlayState* play) {
if (BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) != ITEM_NONE) {
Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, EQUIP_SLOT_B);
if ((player->stateFlags1 & PLAYER_STATE1_800000) || CHECK_WEEKEVENTREG(WEEKEVENTREG_08_01) ||
- (play->unk_1887C >= 2)) {
+ (play->bButtonAmmoPlusOne >= 2)) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE,
0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
@@ -4105,8 +4203,8 @@ void Interface_DrawBButtonIcons(PlayState* play) {
(play->sceneId != SCENE_BOWLING) &&
((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) ||
(gSaveContext.save.entrance != ENTRANCE(ROMANI_RANCH, 0))) &&
- ((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) || !CHECK_EVENTINF(EVENTINF_35)) &&
- (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || (play->unk_1887C != 100))) {
+ ((gSaveContext.minigameStatus != MINIGAME_STATUS_ACTIVE) || !(CHECK_EVENTINF(EVENTINF_35))) &&
+ (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || (play->bButtonAmmoPlusOne != 100))) {
Interface_DrawAmmoCount(play, EQUIP_SLOT_B, interfaceCtx->bAlpha);
}
}
@@ -4263,9 +4361,9 @@ void Interface_DrawAButton(PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
}
-static s16 sMagicArrowEffectsR[] = { 255, 100, 255 };
-static s16 sMagicArrowEffectsG[] = { 0, 100, 255 };
-static s16 sMagicArrowEffectsB[] = { 0, 255, 100 };
+static s16 sMagicArrowEffectsR[] = { 255, 100, 255 }; // magicArrowEffectsR
+static s16 sMagicArrowEffectsG[] = { 0, 100, 255 }; // magicArrowEffectsG
+static s16 sMagicArrowEffectsB[] = { 0, 255, 100 }; // magicArrowEffectsB
void Interface_DrawPauseMenuEquippingIcons(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
@@ -5571,9 +5669,9 @@ void Interface_DrawTimers(PlayState* play) {
if (interfaceCtx->magicAlpha != 255) {
gSaveContext.timerY[sTimerId] = 22;
} else if (gSaveContext.save.saveInfo.playerData.healthCapacity > 0xA0) {
- gSaveContext.timerY[sTimerId] = 54;
+ gSaveContext.timerY[sTimerId] = 54; // two rows of hearts
} else {
- gSaveContext.timerY[sTimerId] = 46;
+ gSaveContext.timerY[sTimerId] = 46; // one row of hearts
}
if ((interfaceCtx->minigameState == MINIGAME_STATE_COUNTDOWN_GO) ||
@@ -5629,9 +5727,9 @@ void Interface_DrawTimers(PlayState* play) {
} else {
gSaveContext.timerX[sTimerId] = 26;
if (gSaveContext.save.saveInfo.playerData.healthCapacity > 0xA0) {
- gSaveContext.timerY[sTimerId] = 54;
+ gSaveContext.timerY[sTimerId] = 54; // two rows of hearts
} else {
- gSaveContext.timerY[sTimerId] = 46;
+ gSaveContext.timerY[sTimerId] = 46; // one row of hearts
}
}
@@ -6025,7 +6123,7 @@ void Interface_DrawMinigameIcons(PlayState* play) {
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) {
// Carrots rendering if the action corresponds to riding a horse
- if (interfaceCtx->unk_212 == DO_ACTION_FASTER) {
+ if (interfaceCtx->aButtonHorseDoAction == DO_ACTION_FASTER) {
// Load Carrot Icon
gDPLoadTextureBlock(OVERLAY_DISP++, gCarrotIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 16, 16, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
@@ -6229,7 +6327,7 @@ void Interface_Draw(PlayState* play) {
sRupeeCounterIconPrimColors[CUR_UPG_VALUE(UPG_WALLET)].b, interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, sRupeeCounterIconEnvColors[CUR_UPG_VALUE(UPG_WALLET)].r,
sRupeeCounterIconEnvColors[CUR_UPG_VALUE(UPG_WALLET)].g,
- sRupeeCounterIconEnvColors[CUR_UPG_VALUE(UPG_WALLET)].b, 255);
+ sRupeeCounterIconEnvColors[CUR_UPG_VALUE(4)].b, 255);
OVERLAY_DISP =
Gfx_DrawTexRectIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, 26, 206, 16, 16, 1 << 10, 1 << 10);
@@ -6815,7 +6913,7 @@ void Interface_Update(PlayState* play) {
// Update minigame State
if ((play->pauseCtx.state == PAUSE_STATE_OFF) && (play->pauseCtx.debugEditor == DEBUG_EDITOR_NONE)) {
- if ((u32)interfaceCtx->minigameState != MINIGAME_STATE_NONE) {
+ if (interfaceCtx->minigameState) { // != MINIGAME_STATE_NONE
switch (interfaceCtx->minigameState) {
case MINIGAME_STATE_COUNTDOWN_SETUP_3:
case MINIGAME_STATE_COUNTDOWN_SETUP_2:
@@ -6885,12 +6983,12 @@ void Interface_Update(PlayState* play) {
if (interfaceCtx->aButtonRoll >= 0.0f) {
interfaceCtx->aButtonRoll = 0.0f;
interfaceCtx->aButtonState = A_BTN_STATE_0;
- interfaceCtx->unk_212 = interfaceCtx->aButtonDoAction;
- aButtonDoAction = interfaceCtx->unk_212;
+ interfaceCtx->aButtonHorseDoAction = interfaceCtx->aButtonDoAction;
+ aButtonDoAction = interfaceCtx->aButtonHorseDoAction;
if ((aButtonDoAction == DO_ACTION_MAX) || (aButtonDoAction == DO_ACTION_MAX + 1)) {
aButtonDoAction = DO_ACTION_NONE;
}
- func_80115428(&play->interfaceCtx, aButtonDoAction, 0);
+ Interface_LoadAButtonDoActionLabel(&play->interfaceCtx, aButtonDoAction, 0);
}
break;
@@ -6907,13 +7005,13 @@ void Interface_Update(PlayState* play) {
if (interfaceCtx->aButtonRoll >= 0.0f) {
interfaceCtx->aButtonRoll = 0.0f;
interfaceCtx->aButtonState = A_BTN_STATE_0;
- interfaceCtx->unk_212 = interfaceCtx->aButtonDoAction;
- aButtonDoAction = interfaceCtx->unk_212;
+ interfaceCtx->aButtonHorseDoAction = interfaceCtx->aButtonDoAction;
+ aButtonDoAction = interfaceCtx->aButtonHorseDoAction;
if ((aButtonDoAction == DO_ACTION_MAX) || (aButtonDoAction == DO_ACTION_MAX + 1)) {
aButtonDoAction = DO_ACTION_NONE;
}
- func_80115428(&play->interfaceCtx, aButtonDoAction, 0);
+ Interface_LoadAButtonDoActionLabel(&play->interfaceCtx, aButtonDoAction, 0);
}
break;
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index b09b0ed6c..f5b034f2b 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -1362,8 +1362,8 @@ s32 func_80123F14(PlayState* play) {
return player->stateFlags1 & PLAYER_STATE1_800000;
}
-s32 func_80123F2C(PlayState* play, s32 ammo) {
- play->unk_1887C = ammo + 1;
+s32 Player_SetBButtonAmmo(PlayState* play, s32 ammo) {
+ play->bButtonAmmoPlusOne = ammo + 1;
return 1;
}