diff --git a/include/functions.h b/include/functions.h index 324f723d9..4e2669da1 100644 --- a/include/functions.h +++ b/include/functions.h @@ -817,7 +817,7 @@ void Player_UpdateBottleHeld(PlayState* play, Player* player, ItemId itemId, Pla void Player_Untarget(Player* player); void func_80123DC0(Player* player); void func_80123E90(PlayState* play, Actor* actor); -s32 func_80123F2C(PlayState* play, s32 ammo); +s32 Player_SetBButtonAmmo(PlayState* play, s32 ammo); s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); u8 Player_GetStrength(void); s32 Player_GetMask(PlayState* play); diff --git a/include/macros.h b/include/macros.h index da931fb27..f6fa1bb6e 100644 --- a/include/macros.h +++ b/include/macros.h @@ -21,6 +21,11 @@ #define ARRAY_COUNT_2D(arr) (ARRAY_COUNT(arr) * ARRAY_COUNT(arr[0])) +#define KSEG0 0x80000000 // 0x80000000 - 0x9FFFFFFF Physical memory, cached, unmapped + +#define RDRAM_CACHED KSEG0 + +#define PHYSICAL_TO_VIRTUAL(addr) ((uintptr_t)(addr) + RDRAM_CACHED) #define SEGMENTED_TO_K0(addr) (void*)((gSegments[SEGMENT_NUMBER(addr)] + K0BASE) + SEGMENT_OFFSET(addr)) #define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamId]) diff --git a/include/regs.h b/include/regs.h index 7dfd8fd2e..f696b2e91 100644 --- a/include/regs.h +++ b/include/regs.h @@ -136,7 +136,7 @@ extern RegEditor* gRegEditor; #define R_A_BTN_COLOR(i) XREG(22 + i) #define R_A_BTN_Y_OFFSET XREG(31) #define R_MAGIC_CONSUME_TIMER_GIANTS_MASK XREG(41) -#define R_THREE_DAY_CLOCK_Y_POS XREG(43) +#define R_THREE_DAY_CLOCK_Y_POS XREG(43) // TODO: Test #define R_THREE_DAY_CLOCK_SUN_MOON_CUTOFF XREG(44) #define R_THREE_DAY_CLOCK_HOUR_DIGIT_CUTOFF XREG(45) #define R_PAUSE_DBG_MAP_CLOUD_ON XREG(50) diff --git a/include/z64.h b/include/z64.h index fe15012e8..0ae81bfa5 100644 --- a/include/z64.h +++ b/include/z64.h @@ -167,6 +167,24 @@ typedef enum { /* 0x02 */ KALEID_OVL_MAX } KaleidoMgrOverlayType; +typedef struct { + /* 0x00 */ TexturePtr timg; + /* 0x04 */ TexturePtr tlut; + /* 0x08 */ u16 width; + /* 0x0A */ u16 height; + /* 0x0C */ u8 fmt; + /* 0x0D */ u8 siz; + /* 0x0E */ u16 tt; + /* 0x10 */ u16 unk_10; + /* 0x14 */ f32 x; + /* 0x18 */ f32 y; + /* 0x1C */ f32 xScale; + /* 0x20 */ f32 yScale; + /* 0x24 */ u32 flags; +} PreRenderParams; // size = 0x28 + +struct PlayState; + typedef struct { /* 0x0 */ u8 seqId; /* 0x1 */ u8 ambienceId; @@ -242,7 +260,7 @@ typedef struct PlayState { /* 0x18876 */ s16 worldCoverAlpha; /* 0x18878 */ s16 bgCoverAlpha; /* 0x1887A */ u16 nextEntrance; - /* 0x1887C */ s8 unk_1887C; // shootingGalleryStatus? + /* 0x1887C */ s8 bButtonAmmoPlusOne; /* 0x1887D */ s8 unk_1887D; /* 0x1887E */ s8 unk_1887E; /* 0x1887F */ u8 transitionType; // fadeTransition diff --git a/include/z64interface.h b/include/z64interface.h index c83630cbf..d768254e2 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -64,7 +64,10 @@ typedef enum { /* 0x27 */ DO_ACTION_POUND, /* 0x28 */ DO_ACTION_HOOK, /* 0x29 */ DO_ACTION_SHOOT, - /* 0x2A */ DO_ACTION_MAX + /* 0x2A */ DO_ACTION_MAX, + /* 0x2A */ TATL_STATE_2A = DO_ACTION_MAX, + /* 0x2B */ TATL_STATE_2B, + /* 0x2C */ TATL_STATE_2C } DoAction; typedef enum { @@ -138,10 +141,10 @@ typedef struct { /* 0x1FC */ OSMesg loadMsg; /* 0x200 */ Viewport viewport; /* 0x210 */ s16 aButtonState; - /* 0x212 */ u16 unk_212; + /* 0x212 */ u16 aButtonHorseDoAction; // TODO: Confirm. Only seems to be used for Epona and "DO_ACTION_FASTER". Also Kaleido? /* 0x214 */ u16 aButtonDoAction; /* 0x218 */ f32 aButtonRoll; - /* 0x21C */ s16 unk_21C; + /* 0x21C */ s16 bButtonDoActionActive; /* 0x21E */ s16 bButtonDoAction; /* 0x220 */ s16 tatlCalling; /* 0x222 */ s16 unk_222; @@ -243,16 +246,16 @@ u8 Item_CheckObtainability(u8 item); void Inventory_DeleteItem(s16 item, s16 slot); void Inventory_UnequipItem(s16 item); s32 Inventory_ReplaceItem(struct PlayState* play, u8 oldItem, u8 newItem); -void Inventory_UpdateDeitySwordEquip(struct PlayState* play); +void Inventory_UpdateDeitySwordEquip(struct PlayState* play) ; s32 Inventory_HasEmptyBottle(void); s32 Inventory_HasItemInBottle(u8 item); void Inventory_UpdateBottleItem(struct PlayState* play, u8 item, u8 btn); s32 Inventory_ConsumeFairy(struct PlayState* play); void Inventory_UpdateItem(struct PlayState* play, s16 slot, s16 item); -void func_8011552C(struct PlayState* play, u16 arg1); -void func_801155B4(struct PlayState* play, s16 arg1); -void func_80115764(struct PlayState* play, UNK_TYPE arg1); -void func_80115844(struct PlayState* play, s16 doAction); +void Interface_SetAButtonDoAction(struct PlayState* play, u16 aButtonDoAction); +void Interface_SetBButtonDoAction(struct PlayState* play, s16 bButtonDoAction); +void Interface_SetTatlCall(struct PlayState* play, u16 tatlCallState); +void Interface_LoadBButtonDoActionLabel(struct PlayState* play, s16 bButtonDoAction); s32 Health_ChangeBy(struct PlayState* play, s16 healthChange); void Health_GiveHearts(s16 hearts); void Rupees_ChangeBy(s16 rupeeChange); diff --git a/include/z64save.h b/include/z64save.h index e1c752906..b0766b415 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -6,6 +6,7 @@ #include "z64item.h" #include "z64math.h" #include "unk.h" +#include "z64item.h" struct GameState; struct PlayState; 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; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_LoadItemIcon.s") + CmpDma_LoadFile(SEGMENT_ROM_START(icon_item_static_yar), GET_CUR_FORM_BTN_ITEM(btn), + &interfaceCtx->iconItemSegment[(u32)btn * 0x1000], 0x1000); +} + +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 func_80115428(InterfaceContext* interfaceCtx, u16 doAction, s16 loadOffset); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115428.s") +void Interface_LoadAButtonDoActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 loadOffset) { + static TexturePtr sDoActionTextures[] = { + gDoActionAttackENGTex, + gDoActionCheckENGTex, + }; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8011552C.s") + if (action >= DO_ACTION_MAX) { + action = DO_ACTION_NONE; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801155B4.s") + 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); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115764.s") +void Interface_SetAButtonDoAction(PlayState* play, u16 aButtonDoAction) { + InterfaceContext* interfaceCtx = &play->interfaceCtx; + PauseContext* pauseCtx = &play->pauseCtx; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115844.s") + 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; + + 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; + } + } +} + +void Interface_LoadBButtonDoActionLabel(PlayState* play, s16 bButtonDoAction) { + InterfaceContext* interfaceCtx = &play->interfaceCtx; + + interfaceCtx->unk_224 = bButtonDoAction; + + 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); + + 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; } diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 736e11e36..ea0596ba3 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -131,7 +131,7 @@ s32 func_80953DA8(BgIngate* this, PlayState* play) { SET_EVENTINF(EVENTINF_41); } Camera_ChangeSetting(mainCam, CAM_SET_BOAT_CRUISE); - play->unk_1887C = 0x63; + play->bButtonAmmoPlusOne = 99; return false; } @@ -143,7 +143,7 @@ void func_80953E38(PlayState* play) { CLEAR_EVENTINF(EVENTINF_41); } - play->unk_1887C = -1; + play->bButtonAmmoPlusOne = -1; } void func_80953EA4(BgIngate* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c index b3042e119..124ec7988 100644 --- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c +++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c @@ -721,10 +721,10 @@ void func_80C02704(EnBomjimb* this, PlayState* play) { } } +u16 D_80C03230[] = { + 0x0721, 0x0722, 0x0723, 0x0724, 0x072C, +}; void func_80C02740(EnBomjimb* this, PlayState* play) { - static u16 D_80C03230[] = { - 0x0721, 0x0722, 0x0723, 0x0724, 0x072C, - }; Player* player = GET_PLAYER(play); func_80C012E0(this); diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index 99d48772b..d76e0cd98 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -825,7 +825,7 @@ void EnFsn_BeginInteraction(EnFsn* this, PlayState* play) { CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->cutsceneState = ENFSN_CUTSCENESTATE_PLAYING; if (Player_GetMask(play) == PLAYER_MASK_NONE) { - func_8011552C(play, DO_ACTION_NEXT); + Interface_SetAButtonDoAction(play, DO_ACTION_NEXT); if (EnFsn_HasItemsToSell()) { this->actionFunc = EnFsn_AskBuyOrSell; } else { @@ -916,7 +916,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, PlayState* play) { } } } else if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnFsn_TestEndInteraction(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: @@ -1100,7 +1100,7 @@ void EnFsn_ResumeShoppingInteraction(EnFsn* this, PlayState* play) { } else if (this->actor.textId != 0x29D6) { this->actionFunc = EnFsn_AskCanBuyAterRunningOutOfItems; } else { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnFsn_FaceShopkeeperSelling; @@ -1151,7 +1151,7 @@ void EnFsn_BrowseShelf(EnFsn* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnFsn_UpdateCursorPos(this, play); if (talkstate == TEXT_STATE_5) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnFsn_HasPlayerSelectedItem(this, play, CONTROLLER1(&play->state))) { EnFsn_CursorLeftRight(this); if (this->cursorIndex != prevCursorIdx) { @@ -1259,7 +1259,7 @@ void EnFsn_SelectItem(EnFsn* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (EnFsn_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnFsn_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: @@ -1392,7 +1392,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) { u8 cursorIndex; if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnFsn_TestEndInteraction(this, play, CONTROLLER1(&play->state)) && (!Message_ShouldAdvance(play) || !EnFsn_FacingShopkeeperDialogResult(this, play)) && this->stickAccumX > 0) { @@ -1400,7 +1400,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, PlayState* play) { if (cursorIndex != CURSOR_INVALID) { this->cursorIndex = cursorIndex; this->actionFunc = EnFsn_LookToShelf; - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Audio_PlaySfx(NA_SE_SY_CURSOR); } diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index a54ac46fd..a0066f376 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -4017,8 +4017,8 @@ void func_80886C00(EnHorse* this, PlayState* play) { if (((this->action == ENHORSE_ACTION_MOUNTED_WALK) || (this->action == ENHORSE_ACTION_MOUNTED_TROT) || (this->action == ENHORSE_ACTION_MOUNTED_GALLOP)) && - (CHECK_BTN_ALL(input->press.button, BTN_A) || (AudioVoice_GetWord() == VOICE_WORD_ID_HIYA)) && - (play->interfaceCtx.unk_212 == 8) && !(this->stateFlags & ENHORSE_BOOST) && + (CHECK_BTN_ALL(input->press.button, BTN_A) || (AudioVoice_GetWord() == 5)) && + (play->interfaceCtx.aButtonHorseDoAction == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) { if (this->numBoosts > 0) { Rumble_Request(0.0f, 180, 20, 100); diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index ded860c33..bd4bb8406 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -343,7 +343,7 @@ s32 EnOssan_TestCancelOption(EnOssan* this, PlayState* play, Input* input) { } void EnOssan_SetupStartShopping(PlayState* play, EnOssan* this, u8 skipHello) { - func_8011552C(play, DO_ACTION_NEXT); + Interface_SetAButtonDoAction(play, DO_ACTION_NEXT); if (!skipHello) { EnOssan_SetupAction(this, EnOssan_Hello); } else { @@ -354,7 +354,7 @@ void EnOssan_SetupStartShopping(PlayState* play, EnOssan* this, u8 skipHello) { void EnOssan_StartShopping(PlayState* play, EnOssan* this) { EnOssan_SetupAction(this, EnOssan_FaceShopkeeper); Message_ContinueTextbox(play, 0x640); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = true; this->stickLeftPrompt.isEnabled = true; } @@ -612,7 +612,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, PlayState* play) { } EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper); Message_ContinueTextbox(play, sTalkOptionTextIds[this->actor.params]); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; return true; @@ -642,7 +642,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { this->cutsceneState = ENOSSAN_CUTSCENESTATE_WAITING; } else { if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnOssan_TestEndInteraction(this, play, CONTROLLER1(&play->state)) && (!Message_ShouldAdvance(play) || !EnOssan_FacingShopkeeperDialogResult(this, play))) { if (this->stickAccumX < 0) { @@ -650,7 +650,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { if (cursorIndex != CURSOR_INVALID) { this->cursorIndex = cursorIndex; EnOssan_SetupAction(this, EnOssan_LookToLeftShelf); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; Audio_PlaySfx(NA_SE_SY_CURSOR); } @@ -659,7 +659,7 @@ void EnOssan_FaceShopkeeper(EnOssan* this, PlayState* play) { if (cursorIndex != CURSOR_INVALID) { this->cursorIndex = cursorIndex; EnOssan_SetupAction(this, EnOssan_LookToRightShelf); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Audio_PlaySfx(NA_SE_SY_CURSOR); } @@ -865,7 +865,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) { this->stickRightPrompt.isEnabled = true; EnOssan_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_5) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnOssan_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) { if (this->moveHorizontal) { if (this->stickAccumX > 0) { @@ -923,7 +923,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnOssan_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_5) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnOssan_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) { if (this->moveHorizontal != 0) { if (this->stickAccumX < 0) { @@ -1073,7 +1073,7 @@ void EnOssan_SelectItem(EnOssan* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (EnOssan_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnOssan_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: @@ -1144,7 +1144,7 @@ void EnOssan_ContinueShopping(EnOssan* this, PlayState* play) { EnGirlA* item; if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (Message_ShouldAdvance(play)) { EnOssan_ResetItemPosition(this); item = this->items[this->cursorIndex]; diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index 42a2b3663..761d2f468 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -500,7 +500,7 @@ s32 EnSob1_TestCancelOption(EnSob1* this, PlayState* play, Input* input) { } void EnSob1_SetupStartShopping(PlayState* play, EnSob1* this, u8 skipHello) { - func_8011552C(play, DO_ACTION_NEXT); + Interface_SetAButtonDoAction(play, DO_ACTION_NEXT); if (!skipHello) { EnSob1_SetupAction(this, EnSob1_Hello); } else { @@ -511,7 +511,7 @@ void EnSob1_SetupStartShopping(PlayState* play, EnSob1* this, u8 skipHello) { void EnSob1_StartShopping(PlayState* play, EnSob1* this) { EnSob1_SetupAction(this, EnSob1_FaceShopkeeper); Message_ContinueTextbox(play, sFacingShopkeeperTextIds[this->shopType]); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; } @@ -520,7 +520,7 @@ void EnSob1_TalkToShopkeeper(PlayState* play, EnSob1* this) { EnSob1_SetupAction(this, EnSob1_TalkingToShopkeeper); this->talkOptionTextId = EnSob1_GetTalkOption(this, play); Message_ContinueTextbox(play, this->talkOptionTextId); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; } @@ -687,7 +687,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) { this->cutsceneState = ENSOB1_CUTSCENESTATE_WAITING; } else { if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnSob1_TestEndInteraction(this, play, CONTROLLER1(&play->state))) { if (!Message_ShouldAdvance(play) || !EnSob1_FacingShopkeeperDialogResult(this, play)) { if (this->stickAccumX > 0) { @@ -695,7 +695,7 @@ void EnSob1_FaceShopkeeper(EnSob1* this, PlayState* play) { if (cursorIndex != CURSOR_INVALID) { this->cursorIndex = cursorIndex; EnSob1_SetupAction(this, EnSob1_LookToShelf); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Audio_PlaySfx(NA_SE_SY_CURSOR); } @@ -940,7 +940,7 @@ void EnSob1_BrowseShelf(EnSob1* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnSob1_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_5) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnSob1_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) { EnSob1_CursorLeftRight(play, this); cursorIndex = this->cursorIndex; @@ -1060,7 +1060,7 @@ void EnSob1_SelectItem(EnSob1* this, PlayState* play) { u8 talkState = Message_GetState(&play->msgCtx); if (EnSob1_TakeItemOffShelf(this) && (talkState == TEXT_STATE_CHOICE)) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnSob1_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index c501e30b3..0a0e723f2 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -420,7 +420,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) player->actor.freezeTimer = 0; Interface_InitMinigame(play); play->interfaceCtx.minigameAmmo = 80; - func_80123F2C(play, 80); + Player_SetBButtonAmmo(play, 80); this->shootingGameState = SG_GAME_STATE_RUNNING; this->actionFunc = EnSyatekiMan_Swamp_StartGame; Audio_PlaySubBgm(NA_BGM_TIMED_MINI_GAME); @@ -782,7 +782,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play) player->actor.freezeTimer = 0; this->flagsIndex = 0; Interface_InitMinigame(play); - func_80123F2C(play, 0x63); + Player_SetBButtonAmmo(play, 99); this->shootingGameState = SG_GAME_STATE_RUNNING; Audio_PlaySubBgm(NA_BGM_TIMED_MINI_GAME); this->actionFunc = EnSyatekiMan_Town_StartGame; @@ -1180,7 +1180,7 @@ void EnSyatekiMan_Swamp_EndGame(EnSyatekiMan* this, PlayState* play) { } if (this->talkWaitTimer < 5) { - play->unk_1887C = -10; + play->bButtonAmmoPlusOne = -10; } } @@ -1453,7 +1453,7 @@ void EnSyatekiMan_Town_EndGame(EnSyatekiMan* this, PlayState* play) { } if (this->talkWaitTimer < 5) { - play->unk_1887C = -10; + play->bButtonAmmoPlusOne = -10; } } diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c index 0e2e81bbd..e23507ded 100644 --- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c +++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c @@ -21,17 +21,22 @@ void func_80A42AB8(EnTest4* this, PlayState* play); void func_80A42F20(EnTest4* this, PlayState* play); ActorInit En_Test4_InitVars = { - /**/ ACTOR_EN_TEST4, - /**/ ACTORCAT_SWITCH, - /**/ FLAGS, - /**/ GAMEPLAY_KEEP, - /**/ sizeof(EnTest4), - /**/ EnTest4_Init, - /**/ EnTest4_Destroy, - /**/ EnTest4_Update, - /**/ NULL, + ACTOR_EN_TEST4, + ACTORCAT_SWITCH, + FLAGS, + GAMEPLAY_KEEP, + sizeof(EnTest4), + (ActorFunc)EnTest4_Init, + (ActorFunc)EnTest4_Destroy, + (ActorFunc)EnTest4_Update, + (ActorFunc)NULL, // Interface_DrawClock }; +typedef enum { + /* 0 */ TIME_DAY, + /* 1 */ TIME_NIGHT, +} NightFlag; + static s32 sIsLoaded = false; // "Night of ..." static s16 sNightMessages1[] = { 0x1BB4, 0x1BB5, 0x1BB6 }; @@ -41,7 +46,7 @@ static s16 sDayMessages1[] = { 0x1BB2, 0x1BB2, 0x1BB3 }; static s16 sNightMessages2[] = { 0x1BB4, 0x1BB5, 0x1BB6 }; // "Dawn of ..." (Note: first two message are the same) static s16 sDayMessages2[] = { 0x1BB2, 0x1BB2, 0x1BB3 }; -static u16 D_80A43364[] = { CLOCK_TIME(6, 0), CLOCK_TIME(18, 0) }; +static u16 sDayNightTransitionTimes[] = { CLOCK_TIME(6, 0), CLOCK_TIME(18, 0) }; static s16 sCsIdList[2]; static s16 sCurCsId; @@ -369,7 +374,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) { if ((play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (play->numSetupActors <= 0) && (play->roomCtx.status == 0) && !Play_IsDebugCamEnabled()) { s16 temp_a2; - u16 temp_a0 = D_80A43364[this->csIdIndex]; + u16 temp_a0 = sDayNightTransitionTimes[this->csIdIndex]; s16 temp_a3; s16 bellDiff; s16 new_var; diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 13041c81f..3aa34a537 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -253,7 +253,7 @@ s32 EnTrt_TestCancelOption(EnTrt* this, PlayState* play, Input* input) { } void EnTrt_SetupStartShopping(PlayState* play, EnTrt* this, u8 skipHello) { - func_8011552C(play, DO_ACTION_NEXT); + Interface_SetAButtonDoAction(play, DO_ACTION_NEXT); if (!skipHello) { this->actionFunc = EnTrt_Hello; } else { @@ -263,7 +263,7 @@ void EnTrt_SetupStartShopping(PlayState* play, EnTrt* this, u8 skipHello) { void EnTrt_StartShopping(PlayState* play, EnTrt* this) { Message_ContinueTextbox(play, 0x83E); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_FaceShopkeeper; @@ -542,7 +542,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) { CutsceneManager_Queue(this->csId); this->cutsceneState = ENTRT_CUTSCENESTATE_WAITING; } else if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnTrt_TestEndInteraction(this, play, CONTROLLER1(&play->state))) { if ((!Message_ShouldAdvance(play) || !EnTrt_FacingShopkeeperDialogResult(this, play)) && (this->stickAccumX > 0)) { @@ -550,7 +550,7 @@ void EnTrt_FaceShopkeeper(EnTrt* this, PlayState* play) { if (cursorIndex != CURSOR_INVALID) { this->cursorIndex = cursorIndex; this->actionFunc = EnTrt_LookToShelf; - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickRightPrompt.isEnabled = false; Audio_PlaySfx(NA_SE_SY_CURSOR); } @@ -644,7 +644,7 @@ void EnTrt_BrowseShelf(EnTrt* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnTrt_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_5) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnTrt_HasPlayerSelectedItem(play, this, CONTROLLER1(&play->state))) { EnTrt_CursorLeftRight(play, this); if (this->cursorIndex != prevCursorIdx) { @@ -737,7 +737,7 @@ void EnTrt_SelectItem(EnTrt* this, PlayState* play) { if (EnTrt_TakeItemOffShelf(this)) { if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (!EnTrt_TestCancelOption(this, play, CONTROLLER1(&play->state)) && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: @@ -909,11 +909,9 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { this->animIndex = TRT_ANIM_HANDS_ON_COUNTER; switch (this->textId) { case 0x834: - if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_SAVED_KOUME) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_RED_POTION_FOR_KOUME) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_INJURED) && - !CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY)) { - func_8011552C(play, DO_ACTION_DECIDE); + if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_SAVED_KOUME) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_RED_POTION_FOR_KOUME) && + !CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_INJURED) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_KOUME_KIOSK_EMPTY)) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_Hello; @@ -923,7 +921,7 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { break; case 0x83E: - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_FaceShopkeeper; @@ -1141,7 +1139,7 @@ void EnTrt_ContinueShopping(EnTrt* this, PlayState* play) { EnGirlA* item; if (talkState == TEXT_STATE_CHOICE) { - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); if (Message_ShouldAdvance(play)) { EnTrt_ResetItemPosition(this); item = this->items[this->cursorIndex]; @@ -1455,7 +1453,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, PlayState* play) { void EnTrt_SetupTalkToShopkeeper(PlayState* play, EnTrt* this) { this->actionFunc = EnTrt_TalkToShopkeeper; Message_ContinueTextbox(play, this->talkOptionTextId); - func_8011552C(play, DO_ACTION_DECIDE); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; } diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c index 7763baa50..185f5dee4 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -1726,10 +1726,10 @@ void ObjUm_Update(Actor* thisx, PlayState* play) { } if (this->flags & OBJ_UM_FLAG_0010) { - func_80123F2C(play, 0x63); + Player_SetBButtonAmmo(play, 99); this->flags &= ~OBJ_UM_FLAG_0010; } else if (this->flags & OBJ_UM_FLAG_0004) { - func_80123F2C(play, -3); + Player_SetBButtonAmmo(play, -3); this->flags &= ~OBJ_UM_FLAG_0004; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index a8cd45917..cce1a9b12 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -3797,7 +3797,7 @@ void Player_UpdateItems(Player* this, PlayState* play) { if ((this->actor.id == ACTOR_PLAYER) && !(this->stateFlags3 & PLAYER_STATE3_START_CHANGING_HELD_ITEM)) { if ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_400000)) { if ((gSaveContext.save.saveInfo.playerData.health != 0) && (play->csCtx.state == CS_STATE_IDLE)) { - if ((this->csAction == PLAYER_CSACTION_NONE) && (play->unk_1887C == 0) && + if ((this->csAction == PLAYER_CSACTION_NONE) && (play->bButtonAmmoPlusOne == 0) && (play->activeCamId == CAM_ID_MAIN)) { if (!func_8082DA90(play) && (gSaveContext.timerStates[TIMER_ID_MINIGAME_2] != TIMER_STATE_STOP)) { Player_ProcessItemButtons(this, play); @@ -3836,8 +3836,8 @@ s32 func_808305BC(PlayState* play, Player* this, ItemId* item, ArrowType* typePa if (gSaveContext.minigameStatus == MINIGAME_STATUS_ACTIVE) { return play->interfaceCtx.minigameAmmo; } - if (play->unk_1887C != 0) { - return play->unk_1887C; + if (play->bButtonAmmoPlusOne != 0) { + return play->bButtonAmmoPlusOne; } return AMMO(*item); @@ -3998,7 +3998,7 @@ s32 func_80830B88(PlayState* play, Player* this) { if (!(this->stateFlags1 & (PLAYER_STATE1_400000 | PLAYER_STATE1_800000 | PLAYER_STATE1_20000000))) { if (!(this->stateFlags1 & PLAYER_STATE1_8000000) || ((this->currentBoots >= PLAYER_BOOTS_ZORA_UNDERWATER) && (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND))) { - if ((play->unk_1887C == 0) && (this->heldItemAction == this->itemAction)) { + if ((play->bButtonAmmoPlusOne == 0) && (this->heldItemAction == this->itemAction)) { if ((this->transformation == PLAYER_FORM_FIERCE_DEITY) || (!Player_IsGoronOrDeku(this) && ((((this->transformation == PLAYER_FORM_ZORA)) && @@ -4090,13 +4090,14 @@ s32 func_80830E30(Player* this, PlayState* play) { } s32 func_80830F9C(PlayState* play) { - return (play->unk_1887C > 0) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B); + return (play->bButtonAmmoPlusOne > 0) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B); } s32 func_80830FD4(PlayState* play) { - return (play->unk_1887C != 0) && - ((play->unk_1887C < 0) || CHECK_BTN_ANY(sPlayerControlInput->cur.button, - BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A)); + return (play->bButtonAmmoPlusOne != 0) && + ((play->bButtonAmmoPlusOne < 0) || + CHECK_BTN_ANY(sPlayerControlInput->cur.button, + BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_B | BTN_A)); } s32 func_80831010(Player* this, PlayState* play) { @@ -4146,15 +4147,15 @@ s32 func_80831194(PlayState* play, Player* this) { (play->sceneId != SCENE_SYATEKI_MORI)) { play->interfaceCtx.minigameAmmo--; } - } else if (play->unk_1887C != 0) { - play->unk_1887C--; + } else if (play->bButtonAmmoPlusOne != 0) { + play->bButtonAmmoPlusOne--; } else { Inventory_ChangeAmmo(item, -1); } } - if (play->unk_1887C == 1) { - play->unk_1887C = -10; + if (play->bButtonAmmoPlusOne == 1) { + play->bButtonAmmoPlusOne = -10; } Player_RequestRumble(play, this, 150, 10, 150, SQ(0)); @@ -8007,7 +8008,7 @@ s32 Player_ActionChange_6(Player* this, PlayState* play) { s32 Player_ActionChange_11(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sPlayerControlInput->cur.button, BTN_R) && (this->unk_AA5 == PLAYER_UNKAA5_0) && - (play->unk_1887C == 0)) { + (play->bButtonAmmoPlusOne == 0)) { if (Player_IsGoronOrDeku(this) || ((((this->transformation == PLAYER_FORM_ZORA) && !(this->stateFlags1 & PLAYER_STATE1_2000000)) || ((this->transformation == PLAYER_FORM_HUMAN) && (this->currentShield != PLAYER_SHIELD_NONE))) && @@ -10784,7 +10785,7 @@ void Player_Init(Actor* thisx, PlayState* play) { return; } - play->unk_1887C = 0; + play->bButtonAmmoPlusOne = 0; play->unk_1887D = 0; play->unk_1887E = 0; this->giObjectSegment = ZeldaArena_Malloc(0x2000); @@ -10974,9 +10975,9 @@ void Player_SetDoAction(PlayState* play, Player* this) { } if (doActionB > -1) { - func_801155B4(play, doActionB); - } else if (play->interfaceCtx.unk_21C != 0) { - play->interfaceCtx.unk_21C = 0; + Interface_SetBButtonDoAction(play, doActionB); + } else if (play->interfaceCtx.bButtonDoActionActive) { + play->interfaceCtx.bButtonDoActionActive = false; play->interfaceCtx.bButtonDoAction = 0; } @@ -11118,19 +11119,19 @@ void Player_SetDoAction(PlayState* play, Player* this) { this->putAwayCountdown--; } - func_8011552C(play, doActionA); + Interface_SetAButtonDoAction(play, doActionA); // Set Tatl state if (!Play_InCsMode(play) && (this->stateFlags2 & PLAYER_STATE2_200000) && !(this->stateFlags3 & PLAYER_STATE3_100)) { if (this->lockOnActor != NULL) { - func_80115764(play, 0x2B); + Interface_SetTatlCall(play, TATL_STATE_2B); } else { - func_80115764(play, 0x2A); + Interface_SetTatlCall(play, TATL_STATE_2A); } CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } else { - func_80115764(play, 0x2C); + Interface_SetTatlCall(play, TATL_STATE_2C); } } } @@ -12806,7 +12807,7 @@ s32 func_80847190(PlayState* play, Player* this, s32 arg2) { this->unk_AA6 |= 2; - return func_80832754(this, (play->unk_1887C != 0) || func_800B7128(this) || func_8082EF20(this)); + return func_80832754(this, (play->bButtonAmmoPlusOne != 0) || func_800B7128(this) || func_8082EF20(this)); } void func_8084748C(Player* this, f32* speed, f32 speedTarget, s16 yawTarget) { @@ -12886,10 +12887,10 @@ void func_808477D0(PlayState* play, Player* this, Input* input, f32 arg3) { } s32 func_80847880(PlayState* play, Player* this) { - if (play->unk_1887C != 0) { + if (play->bButtonAmmoPlusOne != 0) { if (play->sceneId == SCENE_20SICHITAI) { Player_SetAction(play, this, Player_Action_80, 0); - play->unk_1887C = 0; + play->bButtonAmmoPlusOne = 0; this->csAction = PLAYER_CSACTION_NONE; return true; } @@ -13286,9 +13287,8 @@ s32 Player_UpperAction_1(Player* this, PlayState* play) { s32 Player_UpperAction_ChangeHeldItem(Player* this, PlayState* play) { if (PlayerAnimation_Update(play, &this->skelAnimeUpper) || ((Player_ItemToItemAction(this, this->heldItemId) == this->heldItemAction) && - (sPlayerUseHeldItem = - (sPlayerUseHeldItem || ((this->modelAnimType != PLAYER_ANIMTYPE_3) && - (this->heldItemAction != PLAYER_IA_DEKU_STICK) && (play->unk_1887C == 0)))))) { + (sPlayerUseHeldItem = sPlayerUseHeldItem || ((this->modelAnimType != PLAYER_ANIMTYPE_3) && + (this->heldItemAction != PLAYER_IA_DEKU_STICK) && (play->bButtonAmmoPlusOne == 0))))) { Player_SetUpperAction(play, this, sPlayerUpperActionUpdateFuncs[this->heldItemAction]); this->unk_ACC = 0; this->unk_AA4 = 0; @@ -15258,11 +15258,11 @@ void Player_Action_35(Player* this, PlayState* play) { func_801226E0(play, ((void)0, gSaveContext.respawn[RESPAWN_MODE_DOWN].data)); } - if (play->unk_1887C != 0) { + if (play->bButtonAmmoPlusOne != 0) { play->func_18780(this, play); Player_SetAction(play, this, Player_Action_80, 0); - if (play->sceneId == SCENE_20SICHITAI) { - play->unk_1887C = 0; + if (play->sceneId == 0x45) { + play->bButtonAmmoPlusOne = 0; } } else if (!Player_ActionChange_4(this, play)) { func_8083B2E4(this, play); @@ -17610,17 +17610,17 @@ void Player_Action_79(Player* this, PlayState* play) { } void Player_Action_80(Player* this, PlayState* play) { - if (play->unk_1887C < 0) { - play->unk_1887C = 0; + if (play->bButtonAmmoPlusOne < 0) { + play->bButtonAmmoPlusOne = 0; func_80839ED0(this, play); } else if (this->av1.actionVar1 == 0) { if ((play->sceneId != SCENE_20SICHITAI) && CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_B)) { - play->unk_1887C = 10; + play->bButtonAmmoPlusOne = 10; func_80847880(play, this); Player_SetAction(play, this, Player_Action_80, 1); this->av1.actionVar1 = 1; } else { - play->unk_1887C = 0; + play->bButtonAmmoPlusOne = 0; func_80847190(play, this, 0); if (play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON) { @@ -17638,12 +17638,12 @@ void Player_Action_80(Player* this, PlayState* play) { } } else if (CHECK_BTN_ANY(sPlayerControlInput->press.button, BTN_CRIGHT | BTN_CLEFT | BTN_CDOWN | BTN_CUP | BTN_R | BTN_A)) { - play->unk_1887C = -1; + play->bButtonAmmoPlusOne = -1; Player_Action_81(this, play); Player_SetAction(play, this, Player_Action_80, 0); this->av1.actionVar1 = 0; } else { - play->unk_1887C = 10; + play->bButtonAmmoPlusOne = 10; Player_Action_81(this, play); } } @@ -17656,9 +17656,9 @@ void Player_Action_81(Player* this, PlayState* play) { this->upperLimbRot.y = func_80847190(play, this, 1) - this->actor.shape.rot.y; this->unk_AA6 |= 0x80; - if (play->unk_1887C < 0) { - play->unk_1887C++; - if (play->unk_1887C == 0) { + if (play->bButtonAmmoPlusOne < 0) { + play->bButtonAmmoPlusOne++; + if (play->bButtonAmmoPlusOne == 0) { func_80839ED0(this, play); } } diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c index 6c3af4569..6032f374a 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_collect.c @@ -623,8 +623,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { if (nextCursorPoint == CURSOR_TO_LEFT) { KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; - if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, DO_ACTION_INFO); + if (interfaceCtx->aButtonHorseDoAction == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } return; } else { @@ -807,8 +807,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG; - if (interfaceCtx->unk_212 != 6) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonHorseDoAction != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } // Stop receiving input to play a song as mentioned above @@ -820,8 +820,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_ALL); } } else { - if (interfaceCtx->unk_212 != 6) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonHorseDoAction != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED; @@ -831,12 +831,12 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { } } else { if ((cursor == QUEST_BOMBERS_NOTEBOOK) && (pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE)) { - if (interfaceCtx->unk_212 != 6) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonHorseDoAction != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; - } else if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, DO_ACTION_INFO); + } else if (interfaceCtx->aButtonHorseDoAction == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } if ((pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE) && (msgCtx->msgLength == 0)) { diff --git a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c index 8268949c7..70c239996 100644 --- a/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c +++ b/src/overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope_NES.c @@ -352,8 +352,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) { if (CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT) || CHECK_BTN_ALL(input->press.button, BTN_R)) { // Switch the page to the right regardless of where the cursor is - if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, 0x15); + if (interfaceCtx->aButtonHorseDoAction == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_RIGHT); return; @@ -361,8 +361,8 @@ void KaleidoScope_HandlePageToggles(PlayState* play, Input* input) { if (CHECK_BTN_ALL(input->cur.button, BTN_DLEFT) || CHECK_BTN_ALL(input->press.button, BTN_Z)) { // Switch the page to the left regardless of where the cursor is - if (interfaceCtx->unk_212 == 6) { - func_8011552C(play, 0x15); + if (interfaceCtx->aButtonHorseDoAction == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_LEFT); return; @@ -2792,7 +2792,7 @@ void KaleidoScope_UpdateOpening(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->state++; // PAUSE_STATE_MAIN pauseCtx->alpha = 255; - func_80115844(play, DO_ACTION_RETURN); + Interface_LoadBButtonDoActionLabel(play, DO_ACTION_RETURN); } else if (pauseCtx->switchPageTimer == 64) { pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; pauseCtx->nextPageMode = (pauseCtx->pageIndex * 2) + 1; @@ -2897,10 +2897,8 @@ void KaleidoScope_Update(PlayState* play) { DmaMgr_SendRequest0(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2); pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2); - func_8011552C(play, DO_ACTION_INFO); - - //! note: `worldMapArea` never set to a value other than 0 - if (((void)0, gSaveContext.worldMapArea) < 22) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); + if (((void)0, gSaveContext.worldMapArea) < 0x16) { Kaleido_LoadMapNameStaticLarge(pauseCtx->nameSegment + 0x400, ((void)0, gSaveContext.worldMapArea)); } @@ -2945,7 +2943,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_MAIN_STATE_IDLE: if (!pauseCtx->itemDescriptionOn && (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B))) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -2979,7 +2977,7 @@ void KaleidoScope_Update(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { // Abort having the player play the song and close the pause menu AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3015,7 +3013,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG: if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF); - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_UNPAUSE_SETUP; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3057,7 +3055,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_SAVEPROMPT_STATE_1: if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { if (pauseCtx->promptChoice != PAUSE_PROMPT_YES) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU; } else { Audio_PlaySfx(NA_SE_SY_PIECE_OF_HEART); @@ -3075,13 +3073,13 @@ void KaleidoScope_Update(PlayState* play) { sDelayTimer = 90; } } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3; sPauseMenuVerticalOffset = -6240.0f; D_8082B90C = pauseCtx->roll; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_RETURN_TO_MENU; D_8082B90C = pauseCtx->roll; } @@ -3096,7 +3094,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_SAVEPROMPT_STATE_5: if (CHECK_BTN_ALL(input->press.button, BTN_B) || CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START) || (--sDelayTimer == 0)) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->savePromptState = PAUSE_SAVEPROMPT_STATE_3; sPauseMenuVerticalOffset = -6240.0f; D_8082B90C = pauseCtx->roll; @@ -3139,7 +3137,7 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->roll = -314.0f; pauseCtx->itemPageRoll = pauseCtx->mapPageRoll = pauseCtx->questPageRoll = pauseCtx->maskPageRoll = 0.0f; - func_8011552C(play, DO_ACTION_INFO); + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); gSaveContext.buttonStatus[EQUIP_SLOT_B] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + 1][0]; gSaveContext.buttonStatus[EQUIP_SLOT_C_LEFT] = @@ -3450,7 +3448,7 @@ void KaleidoScope_Update(PlayState* play) { DmaMgr_SendRequest0(pauseCtx->iconItemLangSegment, SEGMENT_ROM_START(icon_item_jpn_static), size2); pauseCtx->nameSegment = (void*)ALIGN16((uintptr_t)pauseCtx->iconItemLangSegment + size2); - func_8011552C(play, DO_ACTION_WARP); + Interface_SetAButtonDoAction(play, DO_ACTION_WARP); worldMapCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; Kaleido_LoadMapNameStatic(pauseCtx->nameSegment, worldMapCursorPoint); @@ -3486,7 +3484,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_STATE_OWLWARP_SELECT: if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_B)) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_OWLWARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3506,7 +3504,7 @@ void KaleidoScope_Update(PlayState* play) { msgCtx->msgLength = 0; msgCtx->msgMode = MSGMODE_NONE; if (msgCtx->choiceIndex == 0) { - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_OWLWARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3514,7 +3512,7 @@ void KaleidoScope_Update(PlayState* play) { Audio_PlaySfx(NA_SE_SY_DECIDE); } else { pauseCtx->state = PAUSE_STATE_OWLWARP_SELECT; - func_8011552C(play, DO_ACTION_WARP); + Interface_SetAButtonDoAction(play, DO_ACTION_WARP); Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS); } } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -3524,8 +3522,8 @@ void KaleidoScope_Update(PlayState* play) { Audio_PlaySfx(NA_SE_SY_MESSAGE_PASS); } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { msgCtx->msgLength = 0; - msgCtx->msgMode = MSGMODE_NONE; - func_8011552C(play, DO_ACTION_NONE); + msgCtx->msgMode = 0; + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_OWLWARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3604,9 +3602,9 @@ void KaleidoScope_Update(PlayState* play) { MsgEvent_SendNullTask(); func_80143324(play, &play->skyboxCtx, play->skyboxId); - if ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF)) { - func_80115844(play, DO_ACTION_STOP); - func_8011552C(play, DO_ACTION_STOP); + if ((msgCtx->msgMode != 0) && (msgCtx->currentTextId == 0xFF)) { + Interface_LoadBButtonDoActionLabel(play, DO_ACTION_STOP); + Interface_SetAButtonDoAction(play, DO_ACTION_STOP); Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C); } else { interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 62a0a8699..a9bda38aa 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2124,12 +2124,12 @@ 0x80114FD0:("Inventory_UpdateBottleItem",), 0x80115130:("Inventory_ConsumeFairy",), 0x801152B8:("Inventory_UpdateItem",), - 0x801153C8:("func_801153C8",), - 0x80115428:("func_80115428",), - 0x8011552C:("func_8011552C",), - 0x801155B4:("func_801155B4",), - 0x80115764:("func_80115764",), - 0x80115844:("func_80115844",), + 0x801153C8:("Interface_MemSetZeroed",), + 0x80115428:("Interface_LoadAButtonDoActionLabel",), + 0x8011552C:("Interface_SetAButtonDoAction",), + 0x801155B4:("Interface_SetBButtonDoAction",), + 0x80115764:("Interface_SetTatlCall",), + 0x80115844:("Interface_LoadBButtonDoActionLabel",), 0x80115908:("Health_ChangeBy",), 0x801159C0:("Health_GiveHearts",), 0x801159EC:("Rupees_ChangeBy",), @@ -2212,7 +2212,7 @@ 0x80123DC0:("func_80123DC0",), 0x80123E90:("func_80123E90",), 0x80123F14:("func_80123F14",), - 0x80123F2C:("func_80123F2C",), + 0x80123F2C:("Player_SetBButtonAmmo",), 0x80123F48:("Player_IsBurningStickInRange",), 0x80124020:("Player_GetStrength",), 0x8012403C:("Player_GetMask",), diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt index 2c93781db..d6cfd8e41 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1122,8 +1122,8 @@ 0x801BFCE4:("sTimerStateTimer","UNK_TYPE4","",0x4), 0x801BFCE8:("sTimerDigits","u16","[8]",0x10), 0x801BFCF8:("sTimerBeepSfxSeconds","UNK_TYPE4","",0x4), - 0x801BFCFC:("D_801BFCFC","UNK_TYPE4","",0x4), - 0x801BFD0C:("D_801BFD0C","UNK_TYPE4","",0x4), + 0x801BFCFC:("sTimerDigitsOffsetX","UNK_TYPE4","",0x4), + 0x801BFD0C:("sTimerDigitsWidth","UNK_TYPE4","",0x4), 0x801BFD1C:("sRupeeDigitsFirst","UNK_TYPE1","",0x1), 0x801BFD24:("sRupeeDigitsCount","UNK_TYPE1","",0x1), 0x801BFD2C:("sRupeeCounterIconPrimColors","UNK_TYPE1","",0x1), @@ -11240,7 +11240,7 @@ 0x80A4334A:("sDayMessages1","s16","[3]",0x6), 0x80A43352:("sNightMessages2","s16","[3]",0x6), 0x80A4335A:("sDayMessages2","s16","[3]",0x6), - 0x80A43364:("D_80A43364","u16","[2]",0x4), + 0x80A43364:("sDayNightTransitionTimes","u16","[2]",0x4), 0x80A434D0:("sCsIdList","s16","[2]",0x4), 0x80A434D4:("sCurCsId","s16","",0x2), 0x80A449E0:("En_Bat_InitVars","ActorInit","",0x1), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 1bc8891b9..a7e863f8c 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1638,12 +1638,12 @@ asm/non_matchings/code/z_parameter/Inventory_HasItemInBottle.s,Inventory_HasItem asm/non_matchings/code/z_parameter/Inventory_UpdateBottleItem.s,Inventory_UpdateBottleItem,0x80114FD0,0x58 asm/non_matchings/code/z_parameter/Inventory_ConsumeFairy.s,Inventory_ConsumeFairy,0x80115130,0x62 asm/non_matchings/code/z_parameter/Inventory_UpdateItem.s,Inventory_UpdateItem,0x801152B8,0x44 -asm/non_matchings/code/z_parameter/func_801153C8.s,func_801153C8,0x801153C8,0x18 -asm/non_matchings/code/z_parameter/func_80115428.s,func_80115428,0x80115428,0x41 -asm/non_matchings/code/z_parameter/func_8011552C.s,func_8011552C,0x8011552C,0x22 -asm/non_matchings/code/z_parameter/func_801155B4.s,func_801155B4,0x801155B4,0x6C -asm/non_matchings/code/z_parameter/func_80115764.s,func_80115764,0x80115764,0x38 -asm/non_matchings/code/z_parameter/func_80115844.s,func_80115844,0x80115844,0x31 +asm/non_matchings/code/z_parameter/Interface_MemSetZeroed.s,Interface_MemSetZeroed,0x801153C8,0x18 +asm/non_matchings/code/z_parameter/Interface_LoadAButtonDoActionLabel.s,Interface_LoadAButtonDoActionLabel,0x80115428,0x41 +asm/non_matchings/code/z_parameter/Interface_SetAButtonDoAction.s,Interface_SetAButtonDoAction,0x8011552C,0x22 +asm/non_matchings/code/z_parameter/Interface_SetBButtonDoAction.s,Interface_SetBButtonDoAction,0x801155B4,0x6C +asm/non_matchings/code/z_parameter/Interface_SetTatlCall.s,Interface_SetTatlCall,0x80115764,0x38 +asm/non_matchings/code/z_parameter/Interface_LoadBButtonDoActionLabel.s,Interface_LoadBButtonDoActionLabel,0x80115844,0x31 asm/non_matchings/code/z_parameter/Health_ChangeBy.s,Health_ChangeBy,0x80115908,0x2E asm/non_matchings/code/z_parameter/Health_GiveHearts.s,Health_GiveHearts,0x801159C0,0xB asm/non_matchings/code/z_parameter/Rupees_ChangeBy.s,Rupees_ChangeBy,0x801159EC,0xA @@ -1726,7 +1726,7 @@ asm/non_matchings/code/z_player_lib/Player_Untarget.s,Player_Untarget,0x80123DA4 asm/non_matchings/code/z_player_lib/func_80123DC0.s,func_80123DC0,0x80123DC0,0x34 asm/non_matchings/code/z_player_lib/func_80123E90.s,func_80123E90,0x80123E90,0x21 asm/non_matchings/code/z_player_lib/func_80123F14.s,func_80123F14,0x80123F14,0x6 -asm/non_matchings/code/z_player_lib/func_80123F2C.s,func_80123F2C,0x80123F2C,0x7 +asm/non_matchings/code/z_player_lib/Player_SetBButtonAmmo.s,Player_SetBButtonAmmo,0x80123F2C,0x7 asm/non_matchings/code/z_player_lib/Player_IsBurningStickInRange.s,Player_IsBurningStickInRange,0x80123F48,0x36 asm/non_matchings/code/z_player_lib/Player_GetStrength.s,Player_GetStrength,0x80124020,0x7 asm/non_matchings/code/z_player_lib/Player_GetMask.s,Player_GetMask,0x8012403C,0x4