diff --git a/include/z64interface.h b/include/z64interface.h index 518927dd29..1865a24427 100644 --- a/include/z64interface.h +++ b/include/z64interface.h @@ -4,6 +4,48 @@ #include "ultra64.h" #include "z64view.h" +// TODO extract this information from the texture definitions themselves +// 8x8 IA8 +#define AMMO_DIGIT_TEX_WIDTH 8 +#define AMMO_DIGIT_TEX_HEIGHT 8 +#define AMMO_DIGIT_TEX_SIZE (AMMO_DIGIT_TEX_WIDTH * AMMO_DIGIT_TEX_HEIGHT) + +// TODO extract this information from the texture definitions themselves +// 32x32 RGBA32 +#define ICON_ITEM_TEX_WIDTH 32 +#define ICON_ITEM_TEX_HEIGHT 32 +#define ICON_ITEM_TEX_SIZE ((ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT) * 4) + +// TODO extract this information from the texture definitions themselves +// 48x16 I4 +#define DO_ACTION_TEX_WIDTH 48 +#define DO_ACTION_TEX_HEIGHT 16 +#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) + +// This do action label slot contains the current do action text +#define DO_ACTION_A_SLOT_ACTIVE 0 +// This do action label slot contains the next do action text for the duration of the A button switching animation +#define DO_ACTION_A_SLOT_NEXT 1 + +// Do action texture offset for the A button's active do action text +#define DO_ACTION_OFFSET_A_ACTIVE (0 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the A button's next do action text +#define DO_ACTION_OFFSET_A_NEXT (1 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the start button in the pause menu +#define DO_ACTION_OFFSET_START (2 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the B button for player actions (masks, transformations) +#define DO_ACTION_OFFSET_B_PLAYER (3 * DO_ACTION_TEX_SIZE) +// Do action texture offset for the B button for the interface (pause menu, pictograph box, ocarina) +#define DO_ACTION_OFFSET_B_INTERFACE (4 * DO_ACTION_TEX_SIZE) +// Following the do action textures is extra space for the day number used by the 3 day clock +#define DO_ACTION_OFFSET_DAY_NUMBER (5 * DO_ACTION_TEX_SIZE) + +// TODO extract this information from the texture definitions themselves +// 48x26 IA8 +#define WEEK_STATIC_TEX_WIDTH 48 +#define WEEK_STATIC_TEX_HEIGHT 27 +#define WEEK_STATIC_TEX_SIZE ((WEEK_STATIC_TEX_WIDTH * WEEK_STATIC_TEX_HEIGHT)) + typedef enum { /* -1 */ EQUIP_SLOT_NONE = -1, /* 0 */ EQUIP_SLOT_B, @@ -14,11 +56,11 @@ typedef enum { } EquipSlot; typedef enum { - /* 0 */ A_BTN_STATE_0, - /* 1 */ A_BTN_STATE_1, - /* 2 */ A_BTN_STATE_2, - /* 3 */ A_BTN_STATE_3, - /* 4 */ A_BTN_STATE_4 + /* 0 */ A_BTN_STATE_IDLE, // Uses ACTIVE slot + /* 1 */ A_BTN_STATE_CHANGE_1_UNPAUSED, // Uses ACTIVE slot + /* 2 */ A_BTN_STATE_CHANGE_2_UNPAUSED, // Uses NEXT slot + /* 3 */ A_BTN_STATE_CHANGE_1_PAUSED, // Uses ACTIVE slot + /* 4 */ A_BTN_STATE_CHANGE_2_PAUSED // Uses NEXT slot } AButtonState; typedef enum { @@ -64,7 +106,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 { @@ -131,21 +176,21 @@ typedef struct { /* 0x174 */ u8* doActionSegment; /* 0x178 */ u8* iconItemSegment; /* 0x17C */ u8* mapSegment; - /* 0x180 */ u8* unk_180; // unused segment? + /* 0x180 */ UNK_TYPE4 unk_180; // unused segment? /* 0x184 */ DmaRequest dmaRequest; /* 0x1A4 */ UNK_TYPE1 unk_1A4[0x40]; // likely 2 DmaRequest /* 0x1E4 */ OSMesgQueue loadQueue; /* 0x1FC */ OSMesg loadMsg; /* 0x200 */ Viewport viewport; /* 0x210 */ s16 aButtonState; - /* 0x212 */ u16 unk_212; + /* 0x212 */ u16 aButtonDoActionDelayed; // Like aButtonDoAction, but does not update until the A button animation is complete /* 0x214 */ u16 aButtonDoAction; /* 0x218 */ f32 aButtonRoll; - /* 0x21C */ s16 unk_21C; - /* 0x21E */ s16 bButtonDoAction; + /* 0x21C */ s16 bButtonPlayerDoActionActive; + /* 0x21E */ s16 bButtonPlayerDoAction; /* 0x220 */ s16 tatlCalling; - /* 0x222 */ s16 unk_222; - /* 0x224 */ s16 unk_224; + /* 0x222 */ s16 bButtonInterfaceDoActionActive; + /* 0x224 */ s16 bButtonInterfaceDoAction; /* 0x226 */ s16 lifeColorChange; /* 0x228 */ s16 lifeColorChangeDirection; /* 0x22A */ s16 beatingHeartPrim[3]; @@ -160,7 +205,7 @@ typedef struct { /* 0x250 */ s16 healthTimer; /* 0x252 */ s16 lifeSizeChange; /* 0x254 */ s16 lifeSizeChangeDirection; // 1 means shrinking, 0 growing - /* 0x256 */ s16 unk_256; + /* 0x256 */ UNK_TYPE2 unk_256; /* 0x258 */ s16 magicConsumptionTimer; // For certain magic states, 1 unit of magic is consumed every time the timer reaches 0 /* 0x25A */ u8 numHorseBoosts; /* 0x25C */ u16 minigamePoints; // Points to add to the minigame score. Reset to 0 every frame. @@ -177,11 +222,11 @@ typedef struct { /* 0x272 */ s16 magicAlpha; /* 0x274 */ s16 minimapAlpha; /* 0x276 */ s16 startAlpha; - /* 0x278 */ s16 unk_278; + /* 0x278 */ s16 unk_278; // Set in Map_Init, never read /* 0x27A */ s16 dungeonSceneIndex; /* 0x27C */ s16 mapRoomNum; - /* 0x27E */ u8 unk_27E; - /* 0x27F */ u8 unk_27F; + /* 0x27E */ u8 fishingHUDControl; // Left over from OoT + /* 0x27F */ UNK_TYPE1 unk_27F; /* 0x280 */ u8 minigameState; /* 0x282 */ s16 minigameCountdownAlpha; /* 0x284 */ s16 minigameCountdownScale; @@ -249,10 +294,10 @@ 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_SetBButtonPlayerDoAction(struct PlayState* play, s16 bButtonDoAction); +void Interface_SetTatlCall(struct PlayState* play, u16 tatlCallState); +void Interface_SetBButtonInterfaceDoAction(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/z64play.h b/include/z64play.h index b5f78f702f..f1d51034cd 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -103,7 +103,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/z64player.h b/include/z64player.h index c3d4e90958..67eda81f29 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1388,7 +1388,7 @@ void Player_UpdateBottleHeld(struct PlayState* play, Player* player, ItemId item void Player_Untarget(Player* player); void func_80123DC0(Player* player); void func_80123E90(struct PlayState* play, Actor* actor); -s32 func_80123F2C(struct PlayState* play, s32 ammo); +s32 Player_SetBButtonAmmo(struct PlayState* play, s32 ammo); bool Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange); u8 Player_GetStrength(void); PlayerMask Player_GetMask(struct PlayState* play); diff --git a/src/code/z_inventory.c b/src/code/z_inventory.c index cb73b9da1c..69fcdcc0d6 100644 --- a/src/code/z_inventory.c +++ b/src/code/z_inventory.c @@ -478,10 +478,10 @@ 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) { - return play->interfaceCtx.bButtonDoAction; - } + //! @bug "Weird B": If the B button is empty and there's a B do action text displaying, pressing B will use the + //! item with the same id as the current do action. It's unclear what this code was originally intended for. + if (play->interfaceCtx.bButtonPlayerDoActionActive && play->interfaceCtx.bButtonPlayerDoAction != 0) { + return play->interfaceCtx.bButtonPlayerDoAction; } return ITEM_NONE; } else { diff --git a/src/code/z_kaleido_setup.c b/src/code/z_kaleido_setup.c index 9d74d6d46e..44bed418d9 100644 --- a/src/code/z_kaleido_setup.c +++ b/src/code/z_kaleido_setup.c @@ -106,7 +106,7 @@ void KaleidoSetup_Update(PlayState* play) { } if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) { - if (play->unk_1887C >= 2) { + if (play->bButtonAmmoPlusOne >= 2) { return; } diff --git a/src/code/z_message.c b/src/code/z_message.c index 175fd529c0..7fed4ade48 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -1266,7 +1266,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; @@ -1279,7 +1279,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; @@ -1437,7 +1437,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); @@ -3112,7 +3112,7 @@ void Message_OpenText(PlayState* play, u16 textId) { } if (textId == 0xFF) { - func_80115844(play, DO_ACTION_STOP); + Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP); play->msgCtx.hudVisibility = gSaveContext.hudVisibility; Interface_SetHudVisibility(HUD_VISIBILITY_A_B_C); gSaveContext.save.unk_06 = 20; @@ -3341,11 +3341,11 @@ void Message_ContinueTextbox(PlayState* play, u16 textId) { msgCtx->stateTimer = 8; msgCtx->textDelayTimer = 0; - if (interfaceCtx->unk_222 == 0) { + if (!interfaceCtx->bButtonInterfaceDoActionActive) { 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; @@ -3572,7 +3572,7 @@ void Message_DisplayOcarinaStaffImpl(PlayState* play, u16 ocarinaAction) { msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget; if (!noStop) { - func_80115844(play, DO_ACTION_STOP); + Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP); noStop = gSaveContext.hudVisibility; Interface_SetHudVisibility(HUD_VISIBILITY_B_ALT); gSaveContext.hudVisibility = noStop; @@ -5410,9 +5410,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; @@ -5706,7 +5706,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_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP); GameState_SetFramerateDivisor(&play->state, 2); if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) { ShrinkWindow_Letterbox_SetSizeTarget(0); @@ -5767,7 +5767,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 4a3e495753..9c9409e7a1 100644 --- a/src/code/z_message_nes.c +++ b/src/code/z_message_nes.c @@ -632,7 +632,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; @@ -647,7 +647,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; @@ -827,7 +827,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_message_staff.c b/src/code/z_message_staff.c index cc3af99996..a871ca9d8e 100644 --- a/src/code/z_message_staff.c +++ b/src/code/z_message_staff.c @@ -259,7 +259,7 @@ void Message_DrawTextCredits(PlayState* play, Gfx** gfxP) { Audio_PlaySfx(NA_SE_SY_MESSAGE_END); Font_LoadMessageBoxEndIcon(font, 1); if (play->csCtx.state == CS_STATE_IDLE) { - func_8011552C(play, DO_ACTION_RETURN); + Interface_SetAButtonDoAction(play, DO_ACTION_RETURN); } } } @@ -281,7 +281,7 @@ void Message_DrawTextCredits(PlayState* play, Gfx** gfxP) { msgCtx->stateTimer = msgCtx->decodedBuffer.schar[++i]; 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; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index f1928b8dfe..6002bc5c4a 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -1,6 +1,7 @@ #include "global.h" #include "PR/gs2dex.h" #include "sys_cfb.h" +#include "sys_cmpdma.h" #include "sys_ucode.h" #include "z64lifemeter.h" #include "z64malloc.h" @@ -13,6 +14,7 @@ #include "interface/do_action_static/do_action_static.h" #include "misc/story_static/story_static.h" +#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h" #include "overlays/actors/ovl_En_Mm3/z_en_mm3.h" typedef enum { @@ -22,11 +24,6 @@ typedef enum { /* 3 */ PICTO_BOX_STATE_PHOTO } PictoBoxState; -// TODO extract this information from the texture definitions themselves -#define DO_ACTION_TEX_WIDTH 48 -#define DO_ACTION_TEX_HEIGHT 16 -#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex)) - typedef struct { /* 0x0 */ u8 scene; /* 0x1 */ u8 flags1; @@ -146,11 +143,10 @@ u8 sIsTimerPaused = false; u8 sIsBottleTimerPaused = false; s16 sTimerId = TIMER_ID_NONE; -s16 D_801BF974 = 0; -s16 D_801BF978 = 10; -s16 D_801BF97C = 255; -f32 D_801BF980 = 1.0f; -s32 D_801BF984 = 0; +s16 sThreeDayClockStarMinuteGlowDirection = 0; +s16 sThreeDayClockStarMinuteGlowTimer = 10; +s16 sThreeDayClockStarMinuteGlowAlpha = 255; +f32 sThreeDayClockStarMinuteScale = 1.0f; static Gfx sScreenFillSetupDL[] = { gsDPPipeSync(), @@ -163,50 +159,52 @@ static Gfx sScreenFillSetupDL[] = { gsSPEndDisplayList(), }; -s16 D_801BF9B0 = 0; -f32 D_801BF9B4[] = { +s16 sBButtonDoActionTextureScale = 0; +f32 sBButtonDoActionTextureScales[] = { + // 100 is 1:1 scale, > 100 magnifies 100.0f, // LANGUAGE_JPN 109.0f, // LANGUAGE_ENG // Data missing for other languages? }; -s16 D_801BF9BC[] = { - 0x226, // EQUIP_SLOT_B - 0x2A8, // EQUIP_SLOT_C_LEFT - 0x2A8, // EQUIP_SLOT_C_DOWN - 0x2A8, // EQUIP_SLOT_C_RIGHT +s16 sItemIconTextureScales[] = { + (s16)(1.074219f * (1 << 10)) >> 1, // EQUIP_SLOT_B + (s16)(1.328125f * (1 << 10)) >> 1, // EQUIP_SLOT_C_LEFT + (s16)(1.328125f * (1 << 10)) >> 1, // EQUIP_SLOT_C_DOWN + (s16)(1.328125f * (1 << 10)) >> 1, // EQUIP_SLOT_C_RIGHT }; -s16 D_801BF9C4[] = { - 0x9E, // LANGUAGE_JPN - 0x9B, // LANGUAGE_ENG +s16 sBButtonDoActionXPositions[] = { + 158, // LANGUAGE_JPN + 155, // LANGUAGE_ENG // Data missing for other languages? }; -s16 D_801BF9C8[] = { - 0x17, // LANGUAGE_JPN - 0x16, // LANGUAGE_ENG +s16 sBButtonDoActionYPositions[] = { + 23, // LANGUAGE_JPN + 22, // LANGUAGE_ENG // Data missing for other languages? }; -f32 D_801BF9CC[] = { +f32 sAButtonDoActionTexScales[] = { -380.0f, // LANGUAGE_JPN -350.0f, // LANGUAGE_ENG // Data missing for other languages? }; -s16 D_801BF9D4[] = { - 0xA7, // EQUIP_SLOT_B - 0xE3, // EQUIP_SLOT_C_LEFT - 0xF9, // EQUIP_SLOT_C_DOWN - 0x10F, // EQUIP_SLOT_C_RIGHT +s16 sBCButtonXPositions[] = { + 167, // EQUIP_SLOT_B + 227, // EQUIP_SLOT_C_LEFT + 249, // EQUIP_SLOT_C_DOWN + 271, // EQUIP_SLOT_C_RIGHT }; -s16 D_801BF9DC[] = { - 0x11, // EQUIP_SLOT_B - 0x12, // EQUIP_SLOT_C_LEFT - 0x22, // EQUIP_SLOT_C_DOWN - 0x12, // EQUIP_SLOT_C_RIGHT +s16 sBCButtonYPositions[] = { + 17, // EQUIP_SLOT_B + 18, // EQUIP_SLOT_C_LEFT + 34, // EQUIP_SLOT_C_DOWN + 18, // EQUIP_SLOT_C_RIGHT }; -s16 D_801BF9E4[] = { - 0x23F, // EQUIP_SLOT_B - 0x26C, // EQUIP_SLOT_C_LEFT - 0x26C, // EQUIP_SLOT_C_DOWN - 0x26C, // EQUIP_SLOT_C_RIGHT + +s16 sBCButtonScales[] = { + (s32)(1.1230469f * (1 << 10)) >> 1, // EQUIP_SLOT_B + (s32)(1.2109375f * (1 << 10)) >> 1, // EQUIP_SLOT_C_LEFT + (s32)(1.2109375f * (1 << 10)) >> 1, // EQUIP_SLOT_C_DOWN + (s32)(1.2109375f * (1 << 10)) >> 1, // EQUIP_SLOT_C_RIGHT }; s16 sFinalHoursClockDigitsRed = 0; @@ -936,8 +934,8 @@ void Interface_NewDay(PlayState* play, s32 day) { } // Loads day number from week_static for the three-day clock - DmaMgr_RequestSync((void*)(play->interfaceCtx.doActionSegment + 0x780), - SEGMENT_ROM_START_OFFSET(week_static, i * 0x510), 0x510); + DmaMgr_RequestSync(play->interfaceCtx.doActionSegment + DO_ACTION_OFFSET_DAY_NUMBER, + SEGMENT_ROM_START(week_static) + i * WEEK_STATIC_TEX_SIZE, WEEK_STATIC_TEX_SIZE); // i is used to store sceneId for (i = 0; i < ARRAY_COUNT(gSaveContext.save.saveInfo.permanentSceneFlags); i++) { @@ -1336,7 +1334,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; } @@ -1873,7 +1871,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { restoreHudVisibility = true; } gSaveContext.bButtonStatus = BTN_ENABLED; - } else if ((interfaceCtx->bButtonDoAction == DO_ACTION_EXPLODE) && + } else if ((interfaceCtx->bButtonPlayerDoAction == DO_ACTION_EXPLODE) && (player->currentMask == PLAYER_MASK_BLAST)) { if (gSaveContext.bButtonStatus != BTN_DISABLED) { gSaveContext.bButtonStatus = BTN_DISABLED; @@ -1962,7 +1960,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { // End of special event cases // B button - if ((interfaceCtx->bButtonDoAction == DO_ACTION_EXPLODE) && (player->currentMask == PLAYER_MASK_BLAST) && + if ((interfaceCtx->bButtonPlayerDoAction == DO_ACTION_EXPLODE) && (player->currentMask == PLAYER_MASK_BLAST) && (player->blastMaskTimer != 0)) { // Cooldown period for blast mask if (gSaveContext.bButtonStatus != BTN_DISABLED) { @@ -1997,7 +1995,7 @@ void Interface_UpdateButtonsPart2(PlayState* play) { } restoreHudVisibility = true; } else if (BUTTON_ITEM_EQUIP(CUR_FORM, EQUIP_SLOT_B) == ITEM_NONE) { - if (interfaceCtx->bButtonDoAction != 0) { + if (interfaceCtx->bButtonPlayerDoAction != 0) { if (gSaveContext.buttonStatus[EQUIP_SLOT_B] == BTN_DISABLED) { restoreHudVisibility = true; gSaveContext.buttonStatus[EQUIP_SLOT_B] = BTN_ENABLED; @@ -2204,7 +2202,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) && @@ -2256,7 +2254,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; @@ -2282,7 +2280,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; @@ -2313,7 +2311,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; @@ -2339,7 +2337,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; @@ -2357,12 +2355,12 @@ void Interface_UpdateButtonsPart1(PlayState* play) { Play_CompressI8ToI5((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : gWorkBuffer, (u8*)((void)0, gSaveContext.pictoPhotoI5), PICTO_PHOTO_WIDTH * PICTO_PHOTO_HEIGHT); - interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; + interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0; restoreHudVisibility = true; sPictoState = PICTO_BOX_STATE_OFF; } else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_B)) { play->actorCtx.flags &= ~ACTORCTX_FLAG_PICTO_BOX_ON; - interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; + interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0; restoreHudVisibility = true; sPictoState = PICTO_BOX_STATE_OFF; } else if (CHECK_BTN_ALL(CONTROLLER1(&play->state)->press.button, BTN_A) || @@ -2383,13 +2381,13 @@ void Interface_UpdateButtonsPart1(PlayState* play) { Message_CloseTextbox(play); if (play->msgCtx.choiceIndex != 0) { Audio_PlaySfx_MessageCancel(); - func_80115844(play, DO_ACTION_STOP); + Interface_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP); Interface_SetHudVisibility(HUD_VISIBILITY_A_B); sPictoState = PICTO_BOX_STATE_LENS; REMOVE_QUEST_ITEM(QUEST_PICTOGRAPH); } else { Audio_PlaySfx_MessageDecide(); - interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; + interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0; restoreHudVisibility = true; Interface_SetHudVisibility(HUD_VISIBILITY_ALL); sPictoState = PICTO_BOX_STATE_OFF; @@ -2422,7 +2420,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_SetBButtonInterfaceDoAction(play, DO_ACTION_STOP); Interface_SetHudVisibility(HUD_VISIBILITY_A_B); sPictoState = PICTO_BOX_STATE_LENS; } else { @@ -2488,9 +2486,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 * ICON_ITEM_TEX_SIZE], ICON_ITEM_TEX_SIZE); +} + +void Interface_LoadItemIcon(PlayState* play, u8 btn) { + Interface_LoadItemIconImpl(play, btn); +} /** * @param play PlayState @@ -3164,8 +3169,8 @@ void Inventory_UpdateDeitySwordEquip(PlayState* play) { u8 btn; if (CUR_FORM == PLAYER_FORM_FIERCE_DEITY) { - interfaceCtx->unk_21C = 0; - interfaceCtx->bButtonDoAction = 0; + interfaceCtx->bButtonPlayerDoActionActive = false; + interfaceCtx->bButtonPlayerDoAction = 0; // Is simply checking if (GET_PLAYER_FORM == PLAYER_FORM_FIERCE_DEITY) if ((((GET_PLAYER_FORM > 0) && (GET_PLAYER_FORM < 4)) ? 1 : GET_PLAYER_FORM >> 1) == 0) { @@ -3263,23 +3268,131 @@ void Inventory_UpdateItem(PlayState* play, s16 slot, s16 item) { } } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801153C8.s") +void Interface_ClearBuffer(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") +/** + * Internal function to load the A button do action texture. To change it externally use Interface_SetAButtonDoAction. + * + * @see Interface_SetAButtonDoAction + */ +void Interface_LoadAButtonDoActionLabel(InterfaceContext* interfaceCtx, u16 doAction, s16 slot) { + static TexturePtr sDoActionTextures[] = { + gDoActionAttackENGTex, + gDoActionCheckENGTex, + }; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_8011552C.s") + if (doAction >= DO_ACTION_MAX) { + doAction = DO_ACTION_NONE; + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801155B4.s") + if (doAction != DO_ACTION_NONE) { + osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); + DmaMgr_RequestAsync(&interfaceCtx->dmaRequest, + interfaceCtx->doActionSegment + DO_ACTION_OFFSET_A_ACTIVE + slot * DO_ACTION_TEX_SIZE, + SEGMENT_ROM_START(do_action_static) + doAction * DO_ACTION_TEX_SIZE, DO_ACTION_TEX_SIZE, 0, + &interfaceCtx->loadQueue, NULL); + osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); + } else { + gSegments[0x09] = OS_K0_TO_PHYSICAL(interfaceCtx->doActionSegment); + Interface_ClearBuffer(Lib_SegmentedToVirtual(sDoActionTextures[slot]), DO_ACTION_TEX_SIZE / sizeof(u32)); + } +} -#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115764.s") +/** + * Updates the current A button do action. + * + * Triggers the A button animation to play before the label itself changes within a few frames. + * The logical do action updates immediately without waiting for the label to appear. + */ +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_CHANGE_1_UNPAUSED; + interfaceCtx->aButtonRoll = 0.0f; + Interface_LoadAButtonDoActionLabel(interfaceCtx, aButtonDoAction, DO_ACTION_A_SLOT_NEXT); + if (pauseCtx->state != PAUSE_STATE_OFF) { + interfaceCtx->aButtonState = A_BTN_STATE_CHANGE_1_PAUSED; + } + } +} + +/** + * Updates the current B button player do action. + */ +void Interface_SetBButtonPlayerDoAction(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->bButtonPlayerDoAction = 0xFD; + } else { + interfaceCtx->bButtonPlayerDoAction = bButtonDoAction; + if (interfaceCtx->bButtonPlayerDoAction != DO_ACTION_NONE) { + osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, 1); + DmaMgr_RequestAsync(&interfaceCtx->dmaRequest, + interfaceCtx->doActionSegment + DO_ACTION_OFFSET_B_INTERFACE, + SEGMENT_ROM_START(do_action_static) + bButtonDoAction * DO_ACTION_TEX_SIZE, + DO_ACTION_TEX_SIZE, 0, &interfaceCtx->loadQueue, NULL); + osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); + } + + interfaceCtx->bButtonPlayerDoActionActive = true; + } + } else { + interfaceCtx->bButtonPlayerDoActionActive = false; + interfaceCtx->bButtonPlayerDoAction = 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; + } + } +} + +/** + * Updates the current B button interface do action. + */ +void Interface_SetBButtonInterfaceDoAction(PlayState* play, s16 bButtonDoAction) { + InterfaceContext* interfaceCtx = &play->interfaceCtx; + + interfaceCtx->bButtonInterfaceDoAction = bButtonDoAction; + + osCreateMesgQueue(&play->interfaceCtx.loadQueue, &play->interfaceCtx.loadMsg, 1); + DmaMgr_RequestAsync(&interfaceCtx->dmaRequest, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_B_PLAYER, + SEGMENT_ROM_START(do_action_static) + bButtonDoAction * DO_ACTION_TEX_SIZE, DO_ACTION_TEX_SIZE, + 0, &interfaceCtx->loadQueue, NULL); + osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); + + interfaceCtx->bButtonInterfaceDoActionActive = true; +} /** * @return false if player is out of health @@ -3807,7 +3920,7 @@ void Magic_DrawMeter(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 250, 0, interfaceCtx->magicAlpha); gDPLoadTextureBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, 104, (magicBarY + 3) << 2, + gSPTextureRectangle(OVERLAY_DISP++, 26 << 2, (magicBarY + 3) << 2, (((void)0, gSaveContext.save.saveInfo.playerData.magic) + 26) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); @@ -3822,7 +3935,7 @@ void Magic_DrawMeter(PlayState* play) { } gSPTextureRectangle( - OVERLAY_DISP++, 104, (magicBarY + 3) << 2, + OVERLAY_DISP++, 26 << 2, (magicBarY + 3) << 2, ((((void)0, gSaveContext.save.saveInfo.playerData.magic) - ((void)0, gSaveContext.magicToConsume)) + 26) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); @@ -3838,7 +3951,7 @@ void Magic_DrawMeter(PlayState* play) { gDPLoadTextureBlock_4b(OVERLAY_DISP++, gMagicMeterFillTex, G_IM_FMT_I, 16, 16, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, 104, (magicBarY + 3) << 2, + gSPTextureRectangle(OVERLAY_DISP++, 26 << 2, (magicBarY + 3) << 2, (((void)0, gSaveContext.save.saveInfo.playerData.magic) + 26) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } @@ -3892,11 +4005,12 @@ void Interface_DrawItemButtons(PlayState* play) { 136, // LANGUAGE_FRE 136, // LANGUAGE_SPA }; - static s16 D_801BFAF4[] = { - 0x1D, // EQUIP_SLOT_B - 0x1B, // EQUIP_SLOT_C_LEFT - 0x1B, // EQUIP_SLOT_C_DOWN - 0x1B, // EQUIP_SLOT_C_RIGHT + static s16 sBCButtonSizes[] = { + // Width and height + 29, // EQUIP_SLOT_B + 27, // EQUIP_SLOT_C_LEFT + 27, // EQUIP_SLOT_C_DOWN + 27, // EQUIP_SLOT_C_RIGHT }; InterfaceContext* interfaceCtx = &play->interfaceCtx; Player* player = GET_PLAYER(play); @@ -3912,41 +4026,43 @@ void Interface_DrawItemButtons(PlayState* play) { // B Button Color & Texture OVERLAY_DISP = Gfx_DrawTexRectIA8_DropShadow( - OVERLAY_DISP, gButtonBackgroundTex, 0x20, 0x20, D_801BF9D4[EQUIP_SLOT_B], D_801BF9DC[EQUIP_SLOT_B], - D_801BFAF4[EQUIP_SLOT_B], D_801BFAF4[EQUIP_SLOT_B], D_801BF9E4[EQUIP_SLOT_B] * 2, D_801BF9E4[EQUIP_SLOT_B] * 2, - 100, 255, 120, interfaceCtx->bAlpha); + OVERLAY_DISP, gButtonBackgroundTex, 32, 32, sBCButtonXPositions[EQUIP_SLOT_B], + sBCButtonYPositions[EQUIP_SLOT_B], sBCButtonSizes[EQUIP_SLOT_B], sBCButtonSizes[EQUIP_SLOT_B], + sBCButtonScales[EQUIP_SLOT_B] * 2, sBCButtonScales[EQUIP_SLOT_B] * 2, 100, 255, 120, interfaceCtx->bAlpha); gDPPipeSync(OVERLAY_DISP++); // C-Left Button Color & Texture - OVERLAY_DISP = Gfx_DrawRect_DropShadow(OVERLAY_DISP, D_801BF9D4[EQUIP_SLOT_C_LEFT], D_801BF9DC[EQUIP_SLOT_C_LEFT], - D_801BFAF4[EQUIP_SLOT_C_LEFT], D_801BFAF4[EQUIP_SLOT_C_LEFT], - D_801BF9E4[EQUIP_SLOT_C_LEFT] * 2, D_801BF9E4[EQUIP_SLOT_C_LEFT] * 2, 255, - 240, 0, interfaceCtx->cLeftAlpha); + OVERLAY_DISP = Gfx_DrawRect_DropShadow( + OVERLAY_DISP, sBCButtonXPositions[EQUIP_SLOT_C_LEFT], sBCButtonYPositions[EQUIP_SLOT_C_LEFT], + sBCButtonSizes[EQUIP_SLOT_C_LEFT], sBCButtonSizes[EQUIP_SLOT_C_LEFT], sBCButtonScales[EQUIP_SLOT_C_LEFT] * 2, + sBCButtonScales[EQUIP_SLOT_C_LEFT] * 2, 255, 240, 0, interfaceCtx->cLeftAlpha); // C-Down Button Color & Texture - OVERLAY_DISP = Gfx_DrawRect_DropShadow(OVERLAY_DISP, D_801BF9D4[EQUIP_SLOT_C_DOWN], D_801BF9DC[EQUIP_SLOT_C_DOWN], - D_801BFAF4[EQUIP_SLOT_C_DOWN], D_801BFAF4[EQUIP_SLOT_C_DOWN], - D_801BF9E4[EQUIP_SLOT_C_DOWN] * 2, D_801BF9E4[EQUIP_SLOT_C_DOWN] * 2, 255, - 240, 0, interfaceCtx->cDownAlpha); + OVERLAY_DISP = Gfx_DrawRect_DropShadow( + OVERLAY_DISP, sBCButtonXPositions[EQUIP_SLOT_C_DOWN], sBCButtonYPositions[EQUIP_SLOT_C_DOWN], + sBCButtonSizes[EQUIP_SLOT_C_DOWN], sBCButtonSizes[EQUIP_SLOT_C_DOWN], sBCButtonScales[EQUIP_SLOT_C_DOWN] * 2, + sBCButtonScales[EQUIP_SLOT_C_DOWN] * 2, 255, 240, 0, interfaceCtx->cDownAlpha); // C-Right Button Color & Texture - OVERLAY_DISP = Gfx_DrawRect_DropShadow(OVERLAY_DISP, D_801BF9D4[EQUIP_SLOT_C_RIGHT], D_801BF9DC[EQUIP_SLOT_C_RIGHT], - D_801BFAF4[EQUIP_SLOT_C_RIGHT], D_801BFAF4[EQUIP_SLOT_C_RIGHT], - D_801BF9E4[EQUIP_SLOT_C_RIGHT] * 2, D_801BF9E4[EQUIP_SLOT_C_RIGHT] * 2, 255, - 240, 0, interfaceCtx->cRightAlpha); + OVERLAY_DISP = Gfx_DrawRect_DropShadow( + OVERLAY_DISP, sBCButtonXPositions[EQUIP_SLOT_C_RIGHT], sBCButtonYPositions[EQUIP_SLOT_C_RIGHT], + sBCButtonSizes[EQUIP_SLOT_C_RIGHT], sBCButtonSizes[EQUIP_SLOT_C_RIGHT], sBCButtonScales[EQUIP_SLOT_C_RIGHT] * 2, + sBCButtonScales[EQUIP_SLOT_C_RIGHT] * 2, 255, 240, 0, interfaceCtx->cRightAlpha); if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { if (IS_PAUSED(&play->pauseCtx)) { - OVERLAY_DISP = Gfx_DrawRect_DropShadow(OVERLAY_DISP, 0x88, 0x11, 0x16, 0x16, 0x5B6, 0x5B6, 0xFF, 0x82, 0x3C, - interfaceCtx->startAlpha); + OVERLAY_DISP = + Gfx_DrawRect_DropShadow(OVERLAY_DISP, 136, 17, 22, 22, (s32)(1.4277344f * (1 << 10)), + (s32)(1.4277344f * (1 << 10)), 255, 130, 60, interfaceCtx->startAlpha); // Start Button Texture, Color & Label gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->startAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA, + gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_START, G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, 0x01F8, 0x0054, 0x02D4, 0x009C, G_TX_RENDERTILE, 0, 0, 0x04A6, 0x04A6); + gSPTextureRectangle(OVERLAY_DISP++, 126 << 2, 21 << 2, 181 << 2, 39 << 2, G_TX_RENDERTILE, 0, 0, + (s32)(1.16211f * (1 << 10)), (s32)(1.16211f * (1 << 10))); } } @@ -3967,8 +4083,7 @@ void Interface_DrawItemButtons(PlayState* play) { temp = interfaceCtx->aAlpha; } - OVERLAY_DISP = - Gfx_DrawRect_DropShadow(OVERLAY_DISP, 0xFE, 0x10, 0x10, 0x10, 0x800, 0x800, 0xFF, 0xF0, 0, temp); + OVERLAY_DISP = Gfx_DrawRect_DropShadow(OVERLAY_DISP, 254, 16, 16, 16, 2 << 10, 2 << 10, 255, 240, 0, temp); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, temp); @@ -3978,8 +4093,8 @@ void Interface_DrawItemButtons(PlayState* play) { gDPLoadTextureBlock_4b(OVERLAY_DISP++, sCUpLabelTextures[gSaveContext.options.language], G_IM_FMT_IA, 32, 12, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, 0x03DC, 0x0048, 0x045C, 0x0078, G_TX_RENDERTILE, 0, 0, 1 << 10, - 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, 247 << 2, 18 << 2, (247 + 32) << 2, (18 + 12) << 2, G_TX_RENDERTILE, 0, + 0, 1 << 10, 1 << 10); } sCUpTimer--; @@ -4001,9 +4116,10 @@ void Interface_DrawItemButtons(PlayState* play) { } else { // EQUIP_SLOT_C_RIGHT gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 240, 0, interfaceCtx->cRightAlpha); } - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex + ((32 * 32) * (temp + 1))), - 0x20, 0x20, D_801BF9D4[temp], D_801BF9DC[temp], D_801BFAF4[temp], - D_801BFAF4[temp], D_801BF9E4[temp] * 2, D_801BF9E4[temp] * 2); + OVERLAY_DISP = + Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex + ((32 * 32) * (temp + 1))), 32, 32, + sBCButtonXPositions[temp], sBCButtonYPositions[temp], sBCButtonSizes[temp], + sBCButtonSizes[temp], sBCButtonScales[temp] * 2, sBCButtonScales[temp] * 2); } } @@ -4011,24 +4127,30 @@ void Interface_DrawItemButtons(PlayState* play) { } void Interface_DrawItemIconTexture(PlayState* play, TexturePtr texture, s16 button) { - static s16 D_801BFAFC[] = { 30, 24, 24, 24 }; + static s16 sItemIconTextureDimensions[] = { + 30, // EQUIP_SLOT_B + 24, // EQUIP_SLOT_C_LEFT + 24, // EQUIP_SLOT_C_DOWN + 24, // EQUIP_SLOT_C_RIGHT + }; OPEN_DISPS(play->state.gfxCtx); - gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, ICON_ITEM_TEX_WIDTH, ICON_ITEM_TEX_HEIGHT, + 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, + G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, D_801BF9D4[button] << 2, D_801BF9DC[button] << 2, - (D_801BF9D4[button] + D_801BFAFC[button]) << 2, (D_801BF9DC[button] + D_801BFAFC[button]) << 2, - G_TX_RENDERTILE, 0, 0, D_801BF9BC[button] << 1, D_801BF9BC[button] << 1); + gSPTextureRectangle(OVERLAY_DISP++, sBCButtonXPositions[button] << 2, sBCButtonYPositions[button] << 2, + (sBCButtonXPositions[button] + sItemIconTextureDimensions[button]) << 2, + (sBCButtonYPositions[button] + sItemIconTextureDimensions[button]) << 2, G_TX_RENDERTILE, 0, 0, + sItemIconTextureScales[button] << 1, sItemIconTextureScales[button] << 1); CLOSE_DISPS(play->state.gfxCtx); } -s16 D_801BFB04[] = { 0xA2, 0xE4, 0xFA, 0x110 }; -s16 D_801BFB0C[] = { 0x23, 0x23, 0x33, 0x23 }; - void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { + static s16 sAmmoDigitsXPositions[] = { 162, 228, 250, 272 }; + static s16 sAmmoDigitsYPositions[] = { 35, 35, 51, 35 }; u8 i; u16 ammo; @@ -4055,16 +4177,16 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { } gDPPipeSync(OVERLAY_DISP++); - // @bug Missing a gDPSetEnvColor here, which means the ammo count will be drawn with the last env color set. - // Once you have the magic meter, this becomes a non issue, as the magic meter will set the color to black, - // but prior to that, when certain conditions are met, the color will have last been set by the wallet icon - // causing the ammo count to be drawn incorrectly. This is most obvious when you get deku nuts early on, and - // the ammo count is drawn with a shade of green. + //! @bug Missing a gDPSetEnvColor here, which means the ammo count will be drawn with the last env color set. + //! Once you have the magic meter, this becomes a non issue, as the magic meter will set the color to black, + //! but prior to that, when certain conditions are met, the color will have last been set by the wallet icon + //! causing the ammo count to be drawn incorrectly. This is most obvious when you get deku nuts early on, and + //! the ammo count is drawn with a shade of green. 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))) || @@ -4085,13 +4207,17 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { // Draw upper digit (tens) if ((u32)i != 0) { - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gAmmoDigit0Tex + ((8 * 8) * i)), 8, 8, - D_801BFB04[button], D_801BFB0C[button], 8, 8, 1 << 10, 1 << 10); + OVERLAY_DISP = + Gfx_DrawTexRectIA8(OVERLAY_DISP, (u8*)gAmmoDigit0Tex + i * AMMO_DIGIT_TEX_SIZE, AMMO_DIGIT_TEX_WIDTH, + AMMO_DIGIT_TEX_HEIGHT, sAmmoDigitsXPositions[button], sAmmoDigitsYPositions[button], + AMMO_DIGIT_TEX_WIDTH, AMMO_DIGIT_TEX_HEIGHT, 1 << 10, 1 << 10); } // Draw lower digit (ones) - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, ((u8*)gAmmoDigit0Tex + ((8 * 8) * ammo)), 8, 8, - D_801BFB04[button] + 6, D_801BFB0C[button], 8, 8, 1 << 10, 1 << 10); + OVERLAY_DISP = + Gfx_DrawTexRectIA8(OVERLAY_DISP, (u8*)gAmmoDigit0Tex + ammo * AMMO_DIGIT_TEX_SIZE, AMMO_DIGIT_TEX_WIDTH, + AMMO_DIGIT_TEX_HEIGHT, sAmmoDigitsXPositions[button] + 6, sAmmoDigitsYPositions[button], + AMMO_DIGIT_TEX_WIDTH, AMMO_DIGIT_TEX_HEIGHT, 1 << 10, 1 << 10); } CLOSE_DISPS(play->state.gfxCtx); @@ -4107,7 +4233,7 @@ void Interface_DrawBButtonIcons(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - if ((interfaceCtx->unk_222 == 0) && (player->stateFlags3 & PLAYER_STATE3_1000000)) { + if (!interfaceCtx->bButtonInterfaceDoActionActive && (player->stateFlags3 & PLAYER_STATE3_1000000)) { if (gSaveContext.buttonStatus[EQUIP_SLOT_B] != BTN_DISABLED) { Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, EQUIP_SLOT_B); gDPPipeSync(OVERLAY_DISP++); @@ -4116,8 +4242,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->bButtonPlayerDoActionActive && !interfaceCtx->bButtonInterfaceDoActionActive) || + ((interfaceCtx->bButtonPlayerDoActionActive && ((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) && @@ -4126,7 +4252,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); @@ -4136,42 +4262,46 @@ void Interface_DrawBButtonIcons(PlayState* play) { ((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))) { + (!CHECK_WEEKEVENTREG(WEEKEVENTREG_31_80) || (play->bButtonAmmoPlusOne != 100))) { Interface_DrawAmmoCount(play, EQUIP_SLOT_B, interfaceCtx->bAlpha); } } } } - } else if (interfaceCtx->unk_222 != 0) { + } else if (interfaceCtx->bButtonInterfaceDoActionActive) { gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x480, G_IM_FMT_IA, 48, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_B_PLAYER, G_IM_FMT_IA, + DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - D_801BF9B0 = 1024.0f / (D_801BF9B4[gSaveContext.options.language] / 100.0f); + sBButtonDoActionTextureScale = + 1024.0f / (sBButtonDoActionTextureScales[gSaveContext.options.language] / 100.0f); - gSPTextureRectangle( - OVERLAY_DISP++, (D_801BF9C4[gSaveContext.options.language] * 4), - (D_801BF9C8[gSaveContext.options.language] * 4), ((D_801BF9C4[gSaveContext.options.language] + 0x30) << 2), - ((D_801BF9C8[gSaveContext.options.language] + 0x10) << 2), G_TX_RENDERTILE, 0, 0, D_801BF9B0, D_801BF9B0); - } else if (interfaceCtx->bButtonDoAction != DO_ACTION_NONE) { + gSPTextureRectangle(OVERLAY_DISP++, sBButtonDoActionXPositions[gSaveContext.options.language] * 4, + sBButtonDoActionYPositions[gSaveContext.options.language] * 4, + (sBButtonDoActionXPositions[gSaveContext.options.language] + DO_ACTION_TEX_WIDTH) << 2, + (sBButtonDoActionYPositions[gSaveContext.options.language] + DO_ACTION_TEX_HEIGHT) << 2, + G_TX_RENDERTILE, 0, 0, sBButtonDoActionTextureScale, sBButtonDoActionTextureScale); + } else if (interfaceCtx->bButtonPlayerDoAction != DO_ACTION_NONE) { gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); - gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + 0x600, G_IM_FMT_IA, 48, 16, 0, - G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_B_INTERFACE, + G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - D_801BF9B0 = 1024.0f / (D_801BF9B4[gSaveContext.options.language] / 100.0f); + sBButtonDoActionTextureScale = + 1024.0f / (sBButtonDoActionTextureScales[gSaveContext.options.language] / 100.0f); - gSPTextureRectangle( - OVERLAY_DISP++, (D_801BF9C4[gSaveContext.options.language] * 4), - (D_801BF9C8[gSaveContext.options.language] * 4), ((D_801BF9C4[gSaveContext.options.language] + 0x30) << 2), - ((D_801BF9C8[gSaveContext.options.language] + 0x10) << 2), G_TX_RENDERTILE, 0, 0, D_801BF9B0, D_801BF9B0); + gSPTextureRectangle(OVERLAY_DISP++, sBButtonDoActionXPositions[gSaveContext.options.language] * 4, + sBButtonDoActionYPositions[gSaveContext.options.language] * 4, + (sBButtonDoActionXPositions[gSaveContext.options.language] + DO_ACTION_TEX_WIDTH) << 2, + (sBButtonDoActionYPositions[gSaveContext.options.language] + DO_ACTION_TEX_HEIGHT) << 2, + G_TX_RENDERTILE, 0, 0, sBButtonDoActionTextureScale, sBButtonDoActionTextureScale); } CLOSE_DISPS(play->state.gfxCtx); @@ -4191,7 +4321,8 @@ void Interface_DrawCButtonIcons(PlayState* play) { if (BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_LEFT) < ITEM_F0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x1000, EQUIP_SLOT_C_LEFT); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + EQUIP_SLOT_C_LEFT * ICON_ITEM_TEX_SIZE, + EQUIP_SLOT_C_LEFT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -4204,7 +4335,8 @@ void Interface_DrawCButtonIcons(PlayState* play) { if (BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_DOWN) < ITEM_F0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x2000, EQUIP_SLOT_C_DOWN); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + EQUIP_SLOT_C_DOWN * ICON_ITEM_TEX_SIZE, + EQUIP_SLOT_C_DOWN); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -4217,7 +4349,8 @@ void Interface_DrawCButtonIcons(PlayState* play) { if (BUTTON_ITEM_EQUIP(0, EQUIP_SLOT_C_RIGHT) < ITEM_F0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x3000, EQUIP_SLOT_C_RIGHT); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + EQUIP_SLOT_C_RIGHT * ICON_ITEM_TEX_SIZE, + EQUIP_SLOT_C_RIGHT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -4275,29 +4408,30 @@ void Interface_DrawAButton(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - Matrix_Translate(0.0f, 0.0f, D_801BF9CC[gSaveContext.options.language] / 10.0f, MTXMODE_NEW); + // In screen space with a perspective view, the z axis acts as a scale + Matrix_Translate(0.0f, 0.0f, sAButtonDoActionTexScales[gSaveContext.options.language] / 10.0f, MTXMODE_NEW); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_RotateXFApply(interfaceCtx->aButtonRoll / 10000.0f); gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[8], 4, 0); // Draw Action Label - if (((interfaceCtx->aButtonState <= A_BTN_STATE_1) || (interfaceCtx->aButtonState == A_BTN_STATE_3))) { - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment, 3, DO_ACTION_TEX_WIDTH, - DO_ACTION_TEX_HEIGHT, 0); + if ((interfaceCtx->aButtonState <= A_BTN_STATE_CHANGE_1_UNPAUSED) || + (interfaceCtx->aButtonState == A_BTN_STATE_CHANGE_1_PAUSED)) { + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_A_ACTIVE, + G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0); } else { - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE, 3, - DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0); + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_A_NEXT, + G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0); } CLOSE_DISPS(play->state.gfxCtx); } -static s16 sMagicArrowEffectsR[] = { 255, 100, 255 }; -static s16 sMagicArrowEffectsG[] = { 0, 100, 255 }; -static s16 sMagicArrowEffectsB[] = { 0, 255, 100 }; - void Interface_DrawPauseMenuEquippingIcons(PlayState* play) { + static s16 sMagicArrowEffectsR[] = { 255, 100, 255 }; + static s16 sMagicArrowEffectsG[] = { 0, 100, 255 }; + static s16 sMagicArrowEffectsB[] = { 0, 255, 100 }; InterfaceContext* interfaceCtx = &play->interfaceCtx; PauseContext* pauseCtx = &play->pauseCtx; s16 temp; @@ -4330,9 +4464,9 @@ void Interface_DrawPauseMenuEquippingIcons(PlayState* play) { // Normal Equip (icon goes from the inventory slot to the C button when equipping it) gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha); gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0); - gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, - 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b, + ICON_ITEM_TEX_WIDTH, ICON_ITEM_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); } else { // Magic Arrow Equip Effect temp = pauseCtx->equipTargetItem - 0xB5; @@ -4376,7 +4510,6 @@ void Interface_DrawClock(PlayState* play) { CLOCK_TIME(10, 0), CLOCK_TIME(11, 0), CLOCK_TIME(12, 0), CLOCK_TIME(13, 0), CLOCK_TIME(14, 0), CLOCK_TIME(15, 0), CLOCK_TIME(16, 0), CLOCK_TIME(17, 0), CLOCK_TIME(18, 0), CLOCK_TIME(19, 0), CLOCK_TIME(20, 0), CLOCK_TIME(21, 0), CLOCK_TIME(22, 0), CLOCK_TIME(23, 0), CLOCK_TIME(24, 0) - 1, - CLOCK_TIME(0, 0), }; static TexturePtr sThreeDayClockHourTextures[] = { gThreeDayClockHour12Tex, gThreeDayClockHour1Tex, gThreeDayClockHour2Tex, gThreeDayClockHour3Tex, @@ -4606,26 +4739,28 @@ void Interface_DrawClock(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 155, sThreeDayClockAlpha); - OVERLAY_DISP = Gfx_DrawTexRectIA8(OVERLAY_DISP, interfaceCtx->doActionSegment + 0x780, 48, 27, 137, 192, - 48, 27, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_DrawTexRectIA8( + OVERLAY_DISP, interfaceCtx->doActionSegment + DO_ACTION_OFFSET_DAY_NUMBER, WEEK_STATIC_TEX_WIDTH, + WEEK_STATIC_TEX_HEIGHT, 137, 192, WEEK_STATIC_TEX_WIDTH, WEEK_STATIC_TEX_HEIGHT, 1 << 10, 1 << 10); /** * Section: Draw Three-Day Clock's Star (for the Minute Tracker) */ gDPPipeSync(OVERLAY_DISP++); - if (D_801BF974 != 0) { - D_801BF980 += 0.02f; - D_801BF97C += 11; + if (sThreeDayClockStarMinuteGlowDirection != 0) { + sThreeDayClockStarMinuteScale += 0.02f; + sThreeDayClockStarMinuteGlowAlpha += 11; } else { - D_801BF980 -= 0.02f; - D_801BF97C -= 11; + sThreeDayClockStarMinuteScale -= 0.02f; + sThreeDayClockStarMinuteGlowAlpha -= 11; } - D_801BF978--; - if (D_801BF978 == 0) { - D_801BF978 = 10; - D_801BF974 ^= 1; + sThreeDayClockStarMinuteGlowTimer--; + if (sThreeDayClockStarMinuteGlowTimer == 0) { + // When the timer runs out, flip the glow/scale direction + sThreeDayClockStarMinuteGlowTimer = 10; + sThreeDayClockStarMinuteGlowDirection ^= 1; } timeInSeconds = TIME_TO_SECONDS_F(CURRENT_TIME); @@ -4638,7 +4773,7 @@ void Interface_DrawClock(PlayState* play) { if (sThreeDayClockAlpha != 255) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 110, sThreeDayClockAlpha); } else { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 110, D_801BF97C); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 110, sThreeDayClockStarMinuteGlowAlpha); } gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); @@ -4646,7 +4781,7 @@ void Interface_DrawClock(PlayState* play) { gDPSetRenderMode(OVERLAY_DISP++, G_RM_XLU_SURF, G_RM_XLU_SURF2); Matrix_Translate(0.0f, -86.0f, 0.0f, MTXMODE_NEW); - Matrix_Scale(1.0f, 1.0f, D_801BF980, MTXMODE_APPLY); + Matrix_Scale(1.0f, 1.0f, sThreeDayClockStarMinuteScale, MTXMODE_APPLY); Matrix_RotateZF(-(timeInSeconds * 0.0175f) / 10.0f, MTXMODE_APPLY); gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), @@ -4662,7 +4797,7 @@ void Interface_DrawClock(PlayState* play) { * Section: Cuts off Three-Day Clock's Sun and Moon when they dip below the clock */ gDPPipeSync(OVERLAY_DISP++); - gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 400, 620, 880, + gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 100 << 2, 155 << 2, (SCREEN_WIDTH - 100) << 2, R_THREE_DAY_CLOCK_SUN_MOON_CUTOFF * 4.0f); // determines the current hour @@ -4712,7 +4847,7 @@ void Interface_DrawClock(PlayState* play) { * Section: Cuts off Three-Day Clock's Hour Digits when they dip below the clock */ gDPPipeSync(OVERLAY_DISP++); - gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 400, 620, 880, + gDPSetScissorFrac(OVERLAY_DISP++, G_SC_NON_INTERLACE, 100 << 2, 155 << 2, (SCREEN_WIDTH - 100) << 2, R_THREE_DAY_CLOCK_HOUR_DIGIT_CUTOFF * 4.0f); /** @@ -4733,7 +4868,7 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[24], 8, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], G_IM_FMT_I, 16, 11, 0); // Colours the Three-Day Clocks's Hour Digit Above the Sun gDPPipeSync(OVERLAY_DISP++); @@ -4757,7 +4892,7 @@ void Interface_DrawClock(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, sThreeDayClockAlpha); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[32], 8, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], 4, 16, 11, 0); + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sThreeDayClockHourTextures[sp1C6], G_IM_FMT_I, 16, 11, 0); // Colours the Three-Day Clocks's Hour Digit Above the Moon gDPPipeSync(OVERLAY_DISP++); @@ -5437,7 +5572,7 @@ void Interface_DrawPerfectLetters(PlayState* play) { gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[44 + vtxOffset], 4, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sPerfectLettersTextures[i], 4, 32, 33, 0); + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sPerfectLettersTextures[i], G_IM_FMT_I, 32, 33, 0); // Draw Minigame Perfect Colored Letters gDPPipeSync(OVERLAY_DISP++); @@ -5451,7 +5586,7 @@ void Interface_DrawPerfectLetters(PlayState* play) { gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[76 + vtxOffset], 4, 0); - OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sPerfectLettersTextures[i], 4, 32, 33, 0); + OVERLAY_DISP = Gfx_DrawTexQuad4b(OVERLAY_DISP, sPerfectLettersTextures[i], G_IM_FMT_I, 32, 33, 0); } } @@ -5888,9 +6023,9 @@ void Interface_DrawTimers(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); - OVERLAY_DISP = Gfx_DrawTexRectIA8( - OVERLAY_DISP, gTimerClockIconTex, 0x10, 0x10, ((void)0, gSaveContext.timerX[sTimerId]), - ((void)0, gSaveContext.timerY[sTimerId]) + 2, 0x10, 0x10, 1 << 10, 1 << 10); + OVERLAY_DISP = + Gfx_DrawTexRectIA8(OVERLAY_DISP, gTimerClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[sTimerId]), + ((void)0, gSaveContext.timerY[sTimerId]) + 2, 16, 16, 1 << 10, 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); @@ -6053,7 +6188,7 @@ void Interface_DrawMinigameIcons(PlayState* play) { if (!IS_PAUSED(&play->pauseCtx)) { // Carrots rendering if the action corresponds to riding a horse - if (interfaceCtx->unk_212 == DO_ACTION_FASTER) { + if (interfaceCtx->aButtonDoActionDelayed == 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, @@ -6118,8 +6253,8 @@ void Interface_DrawMinigameIcons(PlayState* play) { G_TX_NOLOD, G_TX_NOLOD); } - gSPTextureRectangle(OVERLAY_DISP++, (rectX << 2), (rectY << 2), ((rectX + width) << 2), - ((rectY + height) << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, rectX << 2, rectY << 2, (rectX + width) << 2, (rectY + height) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, @@ -6138,9 +6273,9 @@ void Interface_DrawMinigameIcons(PlayState* play) { for (i = 0, numDigitsDrawn = 0; i < 4; i++) { if ((sMinigameScoreDigits[i] != 0) || (numDigitsDrawn != 0) || (i >= 3)) { - OVERLAY_DISP = - Gfx_DrawTexRectI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sMinigameScoreDigits[i])), - 8, 0x10, rectX, rectY - 2, 9, 0xFA, 0x370, 0x370); + OVERLAY_DISP = Gfx_DrawTexRectI8( + OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * sMinigameScoreDigits[i])), 8, 16, rectX, + rectY - 2, 9, 250, (s32)(0.859375f * (1 << 10)), (s32)(0.859375f * (1 << 10))); rectX += 9; numDigitsDrawn++; } @@ -6300,8 +6435,8 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - gSPTextureRectangle(OVERLAY_DISP++, 168, 760, 200, 824, G_TX_RENDERTILE, 0, 0, 1 << 10, - 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, 42 << 2, 190 << 2, 50 << 2, 206 << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); sp2CA += 8; } @@ -6314,8 +6449,8 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 760, (sp2CA * 4) + 0x20, 824, G_TX_RENDERTILE, 0, 0, - 1 << 10, 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 190 << 2, (sp2CA + 8) * 4, 206 << 2, G_TX_RENDERTILE, + 0, 0, 1 << 10, 1 << 10); } break; @@ -6329,7 +6464,8 @@ void Interface_Draw(PlayState* play) { gDPLoadTextureBlock(OVERLAY_DISP++, gGoldSkulltulaCounterIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(OVERLAY_DISP++, 80, 748, 176, 820, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, 20 << 2, 187 << 2, 44 << 2, 205 << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); // Gold Skulluta Counter gDPPipeSync(OVERLAY_DISP++); @@ -6355,7 +6491,8 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - gSPTextureRectangle(OVERLAY_DISP++, 168, 760, 200, 824, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, 42 << 2, 190 << 2, 50 << 2, 206 << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); sp2CA += 8; } @@ -6368,8 +6505,8 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 760, (sp2CA * 4) + 0x20, 824, G_TX_RENDERTILE, 0, 0, - 1 << 10, 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 190 << 2, (sp2CA + 8) * 4, 206 << 2, G_TX_RENDERTILE, 0, + 0, 1 << 10, 1 << 10); break; default: @@ -6423,8 +6560,8 @@ void Interface_Draw(PlayState* play) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->magicAlpha); } - gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 824, (sp2CA * 4) + 0x20, 888, G_TX_RENDERTILE, 0, 0, 1 << 10, - 1 << 10); + gSPTextureRectangle(OVERLAY_DISP++, sp2CA * 4, 206 << 2, (sp2CA + 8) * 4, 222 << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); } Magic_DrawMeter(play); @@ -6530,15 +6667,15 @@ void Interface_Draw(PlayState* play) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(OVERLAY_DISP++, R_PICTO_FOCUS_ICON_X << 2, R_PICTO_FOCUS_ICON_Y << 2, - (R_PICTO_FOCUS_ICON_X << 2) + 0x80, (R_PICTO_FOCUS_ICON_Y << 2) + (16 << 2), + (R_PICTO_FOCUS_ICON_X << 2) + (32 << 2), (R_PICTO_FOCUS_ICON_Y << 2) + (16 << 2), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); gDPLoadTextureBlock_4b(OVERLAY_DISP++, gPictoBoxFocusTextTex, G_IM_FMT_I, 32, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); gSPTextureRectangle(OVERLAY_DISP++, R_PICTO_FOCUS_TEXT_X << 2, R_PICTO_FOCUS_TEXT_Y << 2, - (R_PICTO_FOCUS_TEXT_X << 2) + 0x80, (R_PICTO_FOCUS_TEXT_Y << 2) + 0x20, G_TX_RENDERTILE, 0, - 0, 1 << 10, 1 << 10); + (R_PICTO_FOCUS_TEXT_X << 2) + (32 << 2), (R_PICTO_FOCUS_TEXT_Y << 2) + (8 << 2), + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } // Draw pictograph photo @@ -6547,7 +6684,7 @@ void Interface_Draw(PlayState* play) { Play_CompressI8ToI5((play->pictoPhotoI8 != NULL) ? play->pictoPhotoI8 : gWorkBuffer, (u8*)gSaveContext.pictoPhotoI5, PICTO_PHOTO_WIDTH * PICTO_PHOTO_HEIGHT); - interfaceCtx->unk_222 = interfaceCtx->unk_224 = 0; + interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0; sPictoState = PICTO_BOX_STATE_OFF; gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; @@ -6894,12 +7031,15 @@ void Interface_Update(PlayState* play) { // Update A Button switch (interfaceCtx->aButtonState) { - case A_BTN_STATE_1: - interfaceCtx->aButtonRoll += 10466.667f; - if (interfaceCtx->aButtonRoll >= 15700.0f) { + case A_BTN_STATE_CHANGE_1_UNPAUSED: + // Displaying the ACTIVE do action text, rotate until the text is orthogonal to the viewport + // (roll=15700 is pi/2 radians) + interfaceCtx->aButtonRoll += 10466.667f; // pi/3 * 10000 + if (interfaceCtx->aButtonRoll >= 15700.0f) { // pi/2 * 10000 interfaceCtx->aButtonRoll = -15700.0f; - interfaceCtx->aButtonState = A_BTN_STATE_2; + interfaceCtx->aButtonState = A_BTN_STATE_CHANGE_2_UNPAUSED; + // In the unpaused case, if there's a textbox open with a y target of 38 move the A button up the screen if ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->textboxYTarget == 38)) { R_A_BTN_Y_OFFSET = -14; } else { @@ -6908,44 +7048,50 @@ void Interface_Update(PlayState* play) { } break; - case A_BTN_STATE_2: - interfaceCtx->aButtonRoll += 10466.667f; + case A_BTN_STATE_CHANGE_2_UNPAUSED: + // Displaying the NEXT do action text, rotate until the text is parallel to the viewport (roll=0) + interfaceCtx->aButtonRoll += 10466.667f; // pi/3 * 10000 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->aButtonState = A_BTN_STATE_IDLE; + interfaceCtx->aButtonDoActionDelayed = interfaceCtx->aButtonDoAction; + aButtonDoAction = interfaceCtx->aButtonDoActionDelayed; 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, DO_ACTION_A_SLOT_ACTIVE); } break; - case A_BTN_STATE_3: - interfaceCtx->aButtonRoll += 10466.667f; - if (interfaceCtx->aButtonRoll >= 15700.0f) { + case A_BTN_STATE_CHANGE_1_PAUSED: + // Displaying the ACTIVE do action text, rotate until the text is approximately orthogonal to the viewport + // (roll=16384 would be perfectly orthogonal) + interfaceCtx->aButtonRoll += 10466.667f; // pi/3 * 10000 + if (interfaceCtx->aButtonRoll >= 15700.0f) { // pi/2 * 10000 interfaceCtx->aButtonRoll = -15700.0f; - interfaceCtx->aButtonState = A_BTN_STATE_2; + //! @bug should be A_BTN_STATE_CHANGE_2_PAUSED, but the two cases for PAUSE and UNPAUSE are the same + //! so it's harmless. + interfaceCtx->aButtonState = A_BTN_STATE_CHANGE_2_UNPAUSED; } break; - case A_BTN_STATE_4: - interfaceCtx->aButtonRoll += 10466.667f; + case A_BTN_STATE_CHANGE_2_PAUSED: + // Displaying the NEXT do action text, rotate until the text is parallel to the viewport (roll=0) + interfaceCtx->aButtonRoll += 10466.667f; // pi/3 * 10000 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->aButtonState = A_BTN_STATE_IDLE; + interfaceCtx->aButtonDoActionDelayed = interfaceCtx->aButtonDoAction; + aButtonDoAction = interfaceCtx->aButtonDoActionDelayed; 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, DO_ACTION_A_SLOT_ACTIVE); } break; - default: // A_BTN_STATE_0 + default: // A_BTN_STATE_IDLE break; } @@ -7149,13 +7295,18 @@ void Interface_Init(PlayState* play) { interfaceCtx->parameterSegment = THA_AllocTailAlign16(&play->state.tha, parameterStaticSize); DmaMgr_RequestSync(interfaceCtx->parameterSegment, SEGMENT_ROM_START(parameter_static), parameterStaticSize); - interfaceCtx->doActionSegment = THA_AllocTailAlign16(&play->state.tha, 0xC90); - DmaMgr_RequestSync(interfaceCtx->doActionSegment, SEGMENT_ROM_START(do_action_static), 0x300); - DmaMgr_RequestSync(interfaceCtx->doActionSegment + 0x300, SEGMENT_ROM_START_OFFSET(do_action_static, 0x480), 0x180); + interfaceCtx->doActionSegment = + THA_AllocTailAlign16(&play->state.tha, DO_ACTION_OFFSET_DAY_NUMBER + WEEK_STATIC_TEX_SIZE); + DmaMgr_RequestSync(interfaceCtx->doActionSegment + DO_ACTION_OFFSET_A_ACTIVE, + SEGMENT_ROM_START(do_action_static) + DO_ACTION_ATTACK * DO_ACTION_TEX_SIZE, + 2 * DO_ACTION_TEX_SIZE); + DmaMgr_RequestSync(interfaceCtx->doActionSegment + DO_ACTION_OFFSET_START, + SEGMENT_ROM_START_OFFSET(do_action_static, DO_ACTION_RETURN * DO_ACTION_TEX_SIZE), + 1 * DO_ACTION_TEX_SIZE); Interface_NewDay(play, CURRENT_DAY); - interfaceCtx->iconItemSegment = THA_AllocTailAlign16(&play->state.tha, 0x4000); + interfaceCtx->iconItemSegment = THA_AllocTailAlign16(&play->state.tha, 4 * ICON_ITEM_TEX_SIZE); if (CUR_FORM_EQUIP(EQUIP_SLOT_B) < ITEM_F0) { Interface_LoadItemIconImpl(play, EQUIP_SLOT_B); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index fb77070b4d..d69854d43a 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -581,15 +581,18 @@ ItemId Player_GetItemOnButton(PlayState* play, Player* player, EquipSlot slot) { return item; } - if ((player->currentMask == PLAYER_MASK_BLAST) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_EXPLODE)) { + if ((player->currentMask == PLAYER_MASK_BLAST) && + (play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_EXPLODE)) { return ITEM_F0; } - if ((player->currentMask == PLAYER_MASK_BREMEN) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_MARCH)) { + if ((player->currentMask == PLAYER_MASK_BREMEN) && + (play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_MARCH)) { return ITEM_F1; } - if ((player->currentMask == PLAYER_MASK_KAMARO) && (play->interfaceCtx.bButtonDoAction == DO_ACTION_DANCE)) { + if ((player->currentMask == PLAYER_MASK_KAMARO) && + (play->interfaceCtx.bButtonPlayerDoAction == DO_ACTION_DANCE)) { return ITEM_F2; } @@ -623,8 +626,8 @@ PlayerItemAction func_80123810(PlayState* play) { if (gSaveContext.save.unk_06 == 0) { if (CHECK_BTN_ANY(CONTROLLER1(&play->state)->press.button, BTN_A | BTN_B)) { - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; Interface_SetHudVisibility(play->msgCtx.hudVisibility); return PLAYER_IA_MINUS1; } @@ -637,8 +640,8 @@ PlayerItemAction func_80123810(PlayState* play) { i++; itemId = Player_GetItemOnButton(play, player, i); - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; Interface_SetHudVisibility(play->msgCtx.hudVisibility); if ((itemId >= ITEM_FD) || ((itemAction = play->unk_18794(play, player, itemId)) <= PLAYER_IA_MINUS1)) { @@ -1360,8 +1363,8 @@ bool 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 3969e782ad..c22c6cb772 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -133,7 +133,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; } @@ -145,7 +145,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_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 6e6b806a24..6138a75ee4 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -4796,7 +4796,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - play->interfaceCtx.unk_27E = 1; + play->interfaceCtx.fishingHUDControl = 1; play->startPlayerFishing(play); D_809171FC = 1; D_8090CD04 = 20; @@ -5022,7 +5022,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, PlayState* play) { D_8090CD0C = false; } D_809171FC = 0; - play->interfaceCtx.unk_27E = 0; + play->interfaceCtx.fishingHUDControl = 0; } break; 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 e36993cd4c..8728bcbc5c 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -417,8 +417,8 @@ void EnFsn_EndInteraction(EnFsn* this, PlayState* play) { this->drawCursor = 0; this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; this->actor.textId = 0; this->actionFunc = EnFsn_Idle; } @@ -826,7 +826,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 { @@ -917,7 +917,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: @@ -1101,7 +1101,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; @@ -1152,7 +1152,7 @@ void EnFsn_BrowseShelf(EnFsn* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnFsn_UpdateCursorPos(this, play); if (talkstate == TEXT_STATE_EVENT) { - 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) { @@ -1260,7 +1260,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: @@ -1393,7 +1393,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) { @@ -1401,7 +1401,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 f5e8e25a56..3512034497 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -4018,7 +4018,7 @@ 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 == DO_ACTION_FASTER) && !(this->stateFlags & ENHORSE_BOOST) && + (play->interfaceCtx.aButtonDoActionDelayed == 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_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 2c0c1d6e49..9fed452311 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -328,7 +328,7 @@ void EnOkuta_WaitToAppear(EnOkuta* this, PlayState* play) { if (EN_OKUTA_GET_TYPE(&this->actor) == EN_OKUTA_TYPE_RED_OCTOROK) { EnOkuta_SetupAppear(this, play); } else if (ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y)) < 0x4000 && - play->unk_1887C == 0) { + play->bButtonAmmoPlusOne == 0) { EnOkuta_SetupAppear(this, play); } } 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 9dc76c9e9f..bbe894f4fd 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -310,8 +310,8 @@ void EnOssan_EndInteraction(PlayState* play, EnOssan* this) { this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; player->stateFlags2 &= ~PLAYER_STATE2_20000000; - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_PLAYING) { CutsceneManager_Stop(this->csId); this->cutsceneState = ENOSSAN_CUTSCENESTATE_STOPPED; @@ -342,7 +342,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 { @@ -353,7 +353,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; } @@ -611,7 +611,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; @@ -641,7 +641,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))) { return; } @@ -655,7 +655,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); } @@ -664,7 +664,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); } @@ -867,7 +867,7 @@ void EnOssan_BrowseLeftShelf(EnOssan* this, PlayState* play) { this->stickRightPrompt.isEnabled = true; EnOssan_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_EVENT) { - 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) { @@ -925,7 +925,7 @@ void EnOssan_BrowseRightShelf(EnOssan* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnOssan_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_EVENT) { - 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) { @@ -1075,7 +1075,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: @@ -1146,7 +1146,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 52ffc00bc7..b1da3c0678 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -477,8 +477,8 @@ void EnSob1_EndInteraction(PlayState* play, EnSob1* this) { this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; player->stateFlags2 &= ~PLAYER_STATE2_20000000; - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; EnSob1_SetupAction(this, EnSob1_Idle); } @@ -504,7 +504,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 { @@ -515,7 +515,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; } @@ -524,7 +524,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; } @@ -691,7 +691,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) { @@ -699,7 +699,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); } @@ -945,7 +945,7 @@ void EnSob1_BrowseShelf(EnSob1* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnSob1_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_EVENT) { - 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; @@ -1065,7 +1065,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 95fb064c79..3978c122a2 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 @@ -422,7 +422,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); @@ -784,7 +784,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; @@ -1182,7 +1182,7 @@ void EnSyatekiMan_Swamp_EndGame(EnSyatekiMan* this, PlayState* play) { } if (this->talkWaitTimer < 5) { - play->unk_1887C = -10; + play->bButtonAmmoPlusOne = -10; } } @@ -1455,7 +1455,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_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c index 4fa51f095d..4458991eab 100644 --- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c +++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c @@ -228,8 +228,8 @@ void EnTrt_EndInteraction(PlayState* play, EnTrt* this) { this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = false; player->stateFlags2 &= ~PLAYER_STATE2_20000000; - play->interfaceCtx.unk_222 = 0; - play->interfaceCtx.unk_224 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; + play->interfaceCtx.bButtonInterfaceDoAction = 0; this->textId = 0x834; this->timer = 80; this->flags |= ENTRT_FULLY_AWAKE; @@ -257,7 +257,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 { @@ -267,7 +267,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; @@ -546,7 +546,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)) { @@ -554,7 +554,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); } @@ -648,7 +648,7 @@ void EnTrt_BrowseShelf(EnTrt* this, PlayState* play) { this->stickLeftPrompt.isEnabled = true; EnTrt_UpdateCursorPos(play, this); if (talkState == TEXT_STATE_EVENT) { - 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) { @@ -741,7 +741,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: @@ -917,7 +917,7 @@ void EnTrt_BeginInteraction(EnTrt* this, PlayState* play) { !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); + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); this->stickLeftPrompt.isEnabled = false; this->stickRightPrompt.isEnabled = true; this->actionFunc = EnTrt_Hello; @@ -927,7 +927,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; @@ -1145,7 +1145,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]; @@ -1459,7 +1459,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 74e77eee35..af0bfc28ec 100644 --- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c +++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c @@ -1722,10 +1722,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 e1c4aa12ec..6607e27a5b 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -3801,7 +3801,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); @@ -3840,8 +3840,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); @@ -4002,7 +4002,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)) && @@ -4094,13 +4094,14 @@ s32 func_80830E30(Player* this, PlayState* play) { } bool 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); } bool 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)); } bool func_80831010(Player* this, PlayState* play) { @@ -4150,15 +4151,15 @@ bool 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)); @@ -8019,7 +8020,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))) && @@ -10808,7 +10809,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); @@ -10998,10 +10999,10 @@ 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; - play->interfaceCtx.bButtonDoAction = 0; + Interface_SetBButtonPlayerDoAction(play, doActionB); + } else if (play->interfaceCtx.bButtonPlayerDoActionActive) { + play->interfaceCtx.bButtonPlayerDoActionActive = false; + play->interfaceCtx.bButtonPlayerDoAction = 0; } // Set A do action @@ -11142,19 +11143,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); } } } @@ -12831,7 +12832,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) { @@ -12911,10 +12912,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; } @@ -13311,9 +13312,9 @@ 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; @@ -15286,11 +15287,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; + play->bButtonAmmoPlusOne = 0; } } else if (!Player_ActionChange_4(this, play)) { func_8083B2E4(this, play); @@ -16882,7 +16883,7 @@ void Player_Action_63(Player* this, PlayState* play) { } } else if (this->av2.actionVar2 != 0) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_END) { - play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]); this->actor.flags &= ~ACTOR_FLAG_20000000; @@ -16919,7 +16920,7 @@ void Player_Action_63(Player* this, PlayState* play) { } else { Actor* actor; - play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]); this->actor.flags &= ~ACTOR_FLAG_20000000; @@ -16938,7 +16939,7 @@ void Player_Action_63(Player* this, PlayState* play) { } } else if ((play->msgCtx.ocarinaMode == OCARINA_MODE_EVENT) && (play->msgCtx.lastPlayedSong == OCARINA_SONG_ELEGY)) { - play->interfaceCtx.unk_222 = 0; + play->interfaceCtx.bButtonInterfaceDoActionActive = false; CutsceneManager_Stop(play->playerCsIds[PLAYER_CS_ID_ITEM_OCARINA]); this->actor.flags &= ~ACTOR_FLAG_20000000; @@ -17645,17 +17646,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) { @@ -17673,12 +17674,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); } } @@ -17691,9 +17692,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 13cfd2a9c7..a0e4ffd584 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 @@ -624,8 +624,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 == DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_INFO); + if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } return; } else { @@ -808,8 +808,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG; - if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } // Stop receiving input to play a song as mentioned above @@ -821,8 +821,8 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { Interface_SetHudVisibility(HUD_VISIBILITY_ALL); } } else { - if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } if (gSaveContext.buttonStatus[EQUIP_SLOT_A] != BTN_DISABLED) { gSaveContext.buttonStatus[EQUIP_SLOT_A] = BTN_DISABLED; @@ -832,12 +832,12 @@ void KaleidoScope_UpdateQuestCursor(PlayState* play) { } } else { if ((cursor == QUEST_BOMBERS_NOTEBOOK) && (pauseCtx->cursorItem[PAUSE_QUEST] != PAUSE_ITEM_NONE)) { - if (interfaceCtx->unk_212 != DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_DECIDE); + if (interfaceCtx->aButtonDoActionDelayed != DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_DECIDE); } pauseCtx->cursorColorSet = PAUSE_CURSOR_COLOR_SET_BLUE; - } else if (interfaceCtx->unk_212 == DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_INFO); + } else if (interfaceCtx->aButtonDoActionDelayed == 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 377db040e7..de4ec26e40 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 @@ -357,8 +357,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 == DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_INFO); + if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_RIGHT); return; @@ -366,8 +366,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 == DO_ACTION_DECIDE) { - func_8011552C(play, DO_ACTION_INFO); + if (interfaceCtx->aButtonDoActionDelayed == DO_ACTION_DECIDE) { + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); } KaleidoScope_SwitchPage(pauseCtx, SWITCH_PAGE_LEFT); return; @@ -2797,7 +2797,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_SetBButtonInterfaceDoAction(play, DO_ACTION_RETURN); } else if (pauseCtx->switchPageTimer == 64) { pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; pauseCtx->nextPageMode = (pauseCtx->pageIndex * 2) + 1; @@ -2871,7 +2871,8 @@ void KaleidoScope_Update(PlayState* play) { for (itemId = 0; itemId <= ITEM_BOW_FIRE; itemId++) { if (!gPlayerFormItemRestrictions[GET_PLAYER_FORM][(s32)itemId]) { - KaleidoScope_GrayOutTextureRGBA32(Lib_SegmentedToVirtual(gItemIcons[(s32)itemId]), 0x400); + KaleidoScope_GrayOutTextureRGBA32(Lib_SegmentedToVirtual(gItemIcons[(s32)itemId]), + ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT); } } @@ -2901,7 +2902,7 @@ void KaleidoScope_Update(PlayState* play) { DmaMgr_RequestSync(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); + Interface_SetAButtonDoAction(play, DO_ACTION_INFO); //! note: `worldMapArea` never set to a value other than 0 if (((void)0, gSaveContext.worldMapArea) < 22) { @@ -2949,7 +2950,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); @@ -2983,7 +2984,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); @@ -3019,7 +3020,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); @@ -3061,7 +3062,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); @@ -3079,13 +3080,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; } @@ -3100,7 +3101,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; @@ -3143,7 +3144,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] = @@ -3454,7 +3455,7 @@ void KaleidoScope_Update(PlayState* play) { DmaMgr_RequestSync(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); @@ -3490,7 +3491,7 @@ void KaleidoScope_Update(PlayState* play) { case PAUSE_STATE_OWL_WARP_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_OWL_WARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3510,7 +3511,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_OWL_WARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3518,7 +3519,7 @@ void KaleidoScope_Update(PlayState* play) { Audio_PlaySfx(NA_SE_SY_DECIDE); } else { pauseCtx->state = PAUSE_STATE_OWL_WARP_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)) { @@ -3529,7 +3530,7 @@ void KaleidoScope_Update(PlayState* play) { } else if (CHECK_BTN_ALL(input->press.button, BTN_START)) { msgCtx->msgLength = 0; msgCtx->msgMode = MSGMODE_NONE; - func_8011552C(play, DO_ACTION_NONE); + Interface_SetAButtonDoAction(play, DO_ACTION_NONE); pauseCtx->state = PAUSE_STATE_OWL_WARP_6; sPauseMenuVerticalOffset = -6240.0f; Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_CLOSE); @@ -3609,11 +3610,11 @@ void KaleidoScope_Update(PlayState* play) { Skybox_Reload(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); + Interface_SetBButtonInterfaceDoAction(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; + interfaceCtx->bButtonInterfaceDoActionActive = interfaceCtx->bButtonInterfaceDoAction = 0; } gSaveContext.hudVisibility = HUD_VISIBILITY_IDLE; Interface_SetHudVisibility(sUnpausedHudVisibility); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index fdc06d2f26..f0383c304f 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_ClearBuffer",), + 0x80115428:("Interface_LoadAButtonDoActionLabel",), + 0x8011552C:("Interface_SetAButtonDoAction",), + 0x801155B4:("Interface_SetBButtonPlayerDoAction",), + 0x80115764:("Interface_SetTatlCall",), + 0x80115844:("Interface_SetBButtonInterfaceDoAction",), 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 78dfb64119..0c89d7c489 100644 --- a/tools/disasm/variables.txt +++ b/tools/disasm/variables.txt @@ -1039,20 +1039,20 @@ 0x801BF968:("sIsTimerPaused","UNK_TYPE4","",0x4), 0x801BF96C:("sIsBottleTimerPaused","UNK_TYPE4","",0x4), 0x801BF970:("sTimerId","UNK_TYPE4","",0x4), - 0x801BF974:("D_801BF974","UNK_TYPE4","",0x4), - 0x801BF978:("D_801BF978","UNK_TYPE4","",0x4), - 0x801BF97C:("D_801BF97C","UNK_TYPE4","",0x4), - 0x801BF980:("D_801BF980","UNK_TYPE4","",0x4), + 0x801BF974:("sThreeDayClockStarMinuteGlowDirection","UNK_TYPE4","",0x4), + 0x801BF978:("sThreeDayClockStarMinuteGlowTimer","UNK_TYPE4","",0x4), + 0x801BF97C:("sThreeDayClockStarMinuteGlowAlpha","UNK_TYPE4","",0x4), + 0x801BF980:("sThreeDayClockStarMinuteScale","UNK_TYPE4","",0x4), 0x801BF988:("sScreenFillSetupDL","Gfx","[5]",0x28), - 0x801BF9B0:("D_801BF9B0","UNK_TYPE2","",0x2), - 0x801BF9B4:("D_801BF9B4","UNK_TYPE1","",0x1), - 0x801BF9BC:("D_801BF9BC","UNK_TYPE1","",0x1), - 0x801BF9C4:("D_801BF9C4","UNK_TYPE1","",0x1), - 0x801BF9C8:("D_801BF9C8","UNK_TYPE1","",0x1), - 0x801BF9CC:("D_801BF9CC","UNK_TYPE1","",0x1), - 0x801BF9D4:("D_801BF9D4","UNK_TYPE4","",0x8), - 0x801BF9DC:("D_801BF9DC","UNK_TYPE4","",0x8), - 0x801BF9E4:("D_801BF9E4","UNK_TYPE4","",0x8), + 0x801BF9B0:("sBButtonDoActionTextureScale","UNK_TYPE2","",0x2), + 0x801BF9B4:("sBButtonDoActionTextureScales","UNK_TYPE1","",0x1), + 0x801BF9BC:("sItemIconTextureScales","UNK_TYPE1","",0x1), + 0x801BF9C4:("sBButtonDoActionXPositions","UNK_TYPE1","",0x1), + 0x801BF9C8:("sBButtonDoActionYPositions","UNK_TYPE1","",0x1), + 0x801BF9CC:("sAButtonDoActionTexScales","UNK_TYPE1","",0x1), + 0x801BF9D4:("sBCButtonXPositions","UNK_TYPE4","",0x8), + 0x801BF9DC:("sBCButtonYPositions","UNK_TYPE4","",0x8), + 0x801BF9E4:("sBCButtonScales","UNK_TYPE4","",0x8), 0x801BF9EC:("sFinalHoursClockDigitsRed","UNK_TYPE4","",0x4), 0x801BF9F0:("sFinalHoursClockFrameEnvRed","UNK_TYPE2","",0x2), 0x801BF9F4:("sFinalHoursClockFrameEnvGreen","UNK_TYPE2","",0x2), @@ -1071,7 +1071,7 @@ 0x801BFAC4:("magicBorderIndices","UNK_TYPE1","",0x1), 0x801BFACC:("magicBorderColorTimerIndex","UNK_TYPE1","",0x1), 0x801BFAD4:("sCUpLabelTextures","UNK_TYPE1","",0x1), - 0x801BFAF4:("D_801BFAF4","UNK_TYPE4","",0x8), + 0x801BFAF4:("sBCButtonSizes","UNK_TYPE4","",0x8), 0x801BFAFC:("D_801BFAFC","UNK_TYPE4","",0x4), 0x801BFB04:("D_801BFB04","UNK_TYPE1","",0x1), 0x801BFB0C:("D_801BFB0C","UNK_TYPE1","",0x1), diff --git a/tools/namefixer.py b/tools/namefixer.py index e137a0d286..ec50b9fe8c 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -1245,7 +1245,8 @@ wordReplace = { "globalCtx->envCtx.unk_E6": "play->envCtx.screenFillColor", "globalCtx->envCtx.unk_C3": "play->envCtx.lightSettingOverride", "globalCtx->envCtx.unk_DC": "play->envCtx.lightBlend", - "globalCtx->interfaceCtx.unk_21E": "play->interfaceCtx.bButtonDoAction", + "globalCtx->interfaceCtx.unk_21E": "play->interfaceCtx.bButtonPlayerDoAction", + "globalCtx->interfaceCtx.bButtonDoAction": "play->interfaceCtx.bButtonPlayerDoAction", "play->interfaceCtx.unk_31A": "play->interfaceCtx.storyState", "play->interfaceCtx.unk_31B": "play->interfaceCtx.storyType", "play->interfaceCtx.unk_25C": "play->interfaceCtx.minigamePoints", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 398f98bde9..e5a16f2a4f 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_ClearBuffer.s,Interface_ClearBuffer,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_SetBButtonPlayerDoAction.s,Interface_SetBButtonPlayerDoAction,0x801155B4,0x6C +asm/non_matchings/code/z_parameter/Interface_SetTatlCall.s,Interface_SetTatlCall,0x80115764,0x38 +asm/non_matchings/code/z_parameter/Interface_SetBButtonInterfaceDoAction.s,Interface_SetBButtonInterfaceDoAction,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