diff --git a/include/z64save.h b/include/z64save.h index 2c10d76bc61..f81c0781c19 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -66,9 +66,42 @@ typedef enum MagicChangeType { #define MAGIC_NORMAL_METER 0x30 #define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) +typedef enum { + /* 0 */ INTERACT_BC_BTN_B, + /* 1 */ INTERACT_BC_BTN_C_LEFT, + /* 2 */ INTERACT_BC_BTN_C_DOWN, + /* 3 */ INTERACT_BC_BTN_C_RIGHT, + /* 4 */ INTERACT_BC_BTN_MAX +} InteractBCButton; + +#define INTERACT_BC_BTN_C_FIRST INTERACT_BC_BTN_C_LEFT +#define INTERACT_BC_BTN_C_LAST INTERACT_BC_BTN_C_RIGHT + +typedef enum { + /* 0 */ INTERACT_C_BTN_C_LEFT, + /* 1 */ INTERACT_C_BTN_C_DOWN, + /* 2 */ INTERACT_C_BTN_C_RIGHT, + /* 3 */ INTERACT_C_BTN_MAX +} InteractCButton; + +#define INTERACT_C_BTN_TO_BC_BTN(btnsC) ((btnsC) + 1) +#define INTERACT_BC_BTN_TO_C_BTN(btnsBC) ((btnsBC) - 1) + +typedef enum { + /* 0 */ INTERACT_BCA_BTN_B, + /* 1 */ INTERACT_BCA_BTN_C_LEFT, + /* 2 */ INTERACT_BCA_BTN_C_DOWN, + /* 3 */ INTERACT_BCA_BTN_C_RIGHT, + /* 4 */ INTERACT_BCA_BTN_A, + /* 5 */ INTERACT_BCA_BTN_MAX +} InteractBCAButton; + +#define INTERACT_C_BTN_TO_BCA_BTN(btnsC) ((btnsC) + 1) +#define INTERACT_BC_BTN_TO_BCA_BTN(btnsBC) (btnsBC) + typedef struct ItemEquips { - /* 0x00 */ u8 buttonItems[4]; - /* 0x04 */ u8 cButtonSlots[3]; + /* 0x00 */ u8 buttonItems[INTERACT_BC_BTN_MAX]; + /* 0x04 */ u8 cButtonSlots[INTERACT_C_BTN_MAX]; /* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*` } ItemEquips; // size = 0x0A @@ -295,7 +328,7 @@ typedef struct SaveContext { /* 0x13DE */ char unk_13DE[0x0002]; /* 0x13E0 */ u8 seqId; /* 0x13E1 */ u8 natureAmbienceId; - /* 0x13E2 */ u8 buttonStatus[5]; + /* 0x13E2 */ u8 buttonStatus[INTERACT_BCA_BTN_MAX]; /* 0x13E7 */ u8 forceRisingButtonAlphas; // if btn alphas are updated through Interface_DimButtonAlphas, instead update them through Interface_RaiseButtonAlphas /* 0x13E8 */ u16 nextHudVisibilityMode; // triggers the hud to change visibility mode to the requested value. Reset to HUD_VISIBILITY_NO_CHANGE when target is reached /* 0x13EA */ u16 hudVisibilityMode; // current hud visibility mode @@ -442,15 +475,16 @@ typedef enum LinkAge { #define HIGH_SCORE(score) (gSaveContext.save.info.highScores[score]) -#define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \ - ? ITEM_NONE \ - : (gSaveContext.save.info.equips.buttonItems[0] == ITEM_GIANTS_KNIFE) \ - ? ITEM_SWORD_BIGGORON \ - : gSaveContext.save.info.equips.buttonItems[0]) +#define B_BTN_ITEM \ + ((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == ITEM_NONE) ? ITEM_NONE \ + : (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_GIANTS_KNIFE) \ + ? ITEM_SWORD_BIGGORON \ + : gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]) -#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \ - ? gSaveContext.save.info.equips.buttonItems[(button) + 1] \ - : ITEM_NONE) +#define C_BTN_ITEM(button) \ + ((gSaveContext.buttonStatus[INTERACT_C_BTN_TO_BCA_BTN(button)] != BTN_DISABLED) \ + ? gSaveContext.save.info.equips.buttonItems[INTERACT_C_BTN_TO_BC_BTN(button)] \ + : ITEM_NONE) /* diff --git a/src/boot/z_std_dma.c b/src/boot/z_std_dma.c index 5491e4ca92d..9e533b4262f 100644 --- a/src/boot/z_std_dma.c +++ b/src/boot/z_std_dma.c @@ -27,7 +27,7 @@ #endif #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:106" + "ntsc-1.2:98" StackEntry sDmaMgrStackInfo; OSMesgQueue sDmaMgrMsgQueue; diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index b452a92e16d..b294e738dd7 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -298,7 +298,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { } if (equipment == EQUIP_TYPE_SWORD) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 1; } diff --git a/src/code/main.c b/src/code/main.c index 2adf795176a..9c595b85a7e 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -22,8 +22,8 @@ extern struct IrqMgr gIrqMgr; #include "n64dd.h" #endif -#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \ - "ntsc-1.2:164" +#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \ + "ntsc-1.2:155" extern u8 _buffersSegmentEnd[]; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index dcc2a0df337..7a5a8dc63d9 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1,7 +1,7 @@ #include "global.h" #include "terminal.h" -#pragma increment_block_number "ntsc-1.2:152" +#pragma increment_block_number "ntsc-1.2:144" u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList); void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector); diff --git a/src/code/z_camera.c b/src/code/z_camera.c index eeba153abc5..97807df1741 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -3638,7 +3638,7 @@ s32 Camera_KeepOn3(Camera* camera) { } #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:108" + "ntsc-1.2:99" s32 Camera_KeepOn4(Camera* camera) { static Vec3f D_8015BD50; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 1f6bb36cd20..21286d447b9 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -5,7 +5,7 @@ #include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h" -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:224" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:208" typedef s32 (*ColChkResetFunc)(PlayState*, Collider*); typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*); diff --git a/src/code/z_common_data.c b/src/code/z_common_data.c index 1c70bfb0f4f..afa46ef484d 100644 --- a/src/code/z_common_data.c +++ b/src/code/z_common_data.c @@ -3,7 +3,7 @@ #include "versions.h" #pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:224" + "ntsc-1.2:208" ALIGNED(16) SaveContext gSaveContext; u32 D_8015FA88; diff --git a/src/code/z_construct.c b/src/code/z_construct.c index e190e19d209..830eabc1aab 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -5,7 +5,7 @@ void Interface_Destroy(PlayState* play) { Map_Destroy(play); } -#define ICON_ITEM_SEGMENT_SIZE (4 * ITEM_ICON_SIZE) +#define ICON_ITEM_SEGMENT_SIZE (INTERACT_BC_BTN_MAX * ITEM_ICON_SIZE) void Interface_Init(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -97,38 +97,39 @@ void Interface_Init(PlayState* play) { ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); - PRINTF("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[0], - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + PRINTF("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); - if (gSaveContext.save.info.equips.buttonItems[0] < 0xF0) { - DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] < 0xF0) { + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, - "../z_construct.c", 198); - } else if (gSaveContext.save.info.equips.buttonItems[0] != 0xFF) { - DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]), + ITEM_ICON_SIZE, "../z_construct.c", 198); + } else if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != 0xFF) { + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE, - "../z_construct.c", 203); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]), + ITEM_ICON_SIZE, "../z_construct.c", 203); } - if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) { - DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE, - "../z_construct.c", 209); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] < 0xF0) { + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_LEFT * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]), + ITEM_ICON_SIZE, "../z_construct.c", 209); } - if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) { - DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE, - "../z_construct.c", 214); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] < 0xF0) { + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_DOWN * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]), + ITEM_ICON_SIZE, "../z_construct.c", 214); } - if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) { - DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE, - "../z_construct.c", 219); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] < 0xF0) { + DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_RIGHT * ITEM_ICON_SIZE), + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]), + ITEM_ICON_SIZE, "../z_construct.c", 219); } PRINTF("EVENT=%d\n", ((void)0, gSaveContext.timerState)); @@ -177,14 +178,14 @@ void Interface_Init(PlayState* play) { interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0; - R_ITEM_BTN_X(0) = B_BUTTON_X; + R_ITEM_BTN_X(INTERACT_BC_BTN_B) = B_BUTTON_X; R_B_BTN_COLOR(0) = B_BUTTON_R; R_B_BTN_COLOR(1) = B_BUTTON_G; R_B_BTN_COLOR(2) = B_BUTTON_B; - R_ITEM_ICON_X(0) = B_BUTTON_X; - R_ITEM_AMMO_X(0) = B_BUTTON_X + 2; + R_ITEM_ICON_X(INTERACT_BC_BTN_B) = B_BUTTON_X; + R_ITEM_AMMO_X(INTERACT_BC_BTN_B) = B_BUTTON_X + 2; R_A_BTN_X = A_BUTTON_X; R_A_ICON_X = A_BUTTON_X; @@ -381,28 +382,28 @@ void Regs_InitDataImpl(void) { ZREG(65) = 21; ZREG(66) = 122; - R_ITEM_BTN_X(1) = C_LEFT_BUTTON_X; - R_ITEM_BTN_X(2) = C_DOWN_BUTTON_X; - R_ITEM_BTN_X(3) = C_RIGHT_BUTTON_X; - R_ITEM_BTN_Y(0) = B_BUTTON_Y; - R_ITEM_BTN_Y(1) = C_LEFT_BUTTON_Y; - R_ITEM_BTN_Y(2) = C_DOWN_BUTTON_Y; - R_ITEM_BTN_Y(3) = C_RIGHT_BUTTON_Y; - R_ITEM_BTN_DD(0) = 575; - R_ITEM_BTN_DD(1) = 620; - R_ITEM_BTN_DD(2) = 620; - R_ITEM_BTN_DD(3) = 620; - R_ITEM_ICON_X(1) = C_LEFT_BUTTON_X; - R_ITEM_ICON_X(2) = C_DOWN_BUTTON_X; - R_ITEM_ICON_X(3) = C_RIGHT_BUTTON_X; - R_ITEM_ICON_Y(0) = B_BUTTON_Y; - R_ITEM_ICON_Y(1) = C_LEFT_BUTTON_Y; - R_ITEM_ICON_Y(2) = C_DOWN_BUTTON_Y; - R_ITEM_ICON_Y(3) = C_RIGHT_BUTTON_Y; - R_ITEM_ICON_DD(0) = 550; - R_ITEM_ICON_DD(1) = 680; - R_ITEM_ICON_DD(2) = 680; - R_ITEM_ICON_DD(3) = 680; + R_ITEM_BTN_X(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_X; + R_ITEM_BTN_X(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_X; + R_ITEM_BTN_X(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_X; + R_ITEM_BTN_Y(INTERACT_BC_BTN_B) = B_BUTTON_Y; + R_ITEM_BTN_Y(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_Y; + R_ITEM_BTN_Y(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_Y; + R_ITEM_BTN_Y(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_Y; + R_ITEM_BTN_DD(INTERACT_BC_BTN_B) = 575; + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_LEFT) = 620; + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_DOWN) = 620; + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_RIGHT) = 620; + R_ITEM_ICON_X(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_X; + R_ITEM_ICON_X(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_X; + R_ITEM_ICON_X(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_X; + R_ITEM_ICON_Y(INTERACT_BC_BTN_B) = B_BUTTON_Y; + R_ITEM_ICON_Y(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_Y; + R_ITEM_ICON_Y(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_Y; + R_ITEM_ICON_Y(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_Y; + R_ITEM_ICON_DD(INTERACT_BC_BTN_B) = 550; + R_ITEM_ICON_DD(INTERACT_BC_BTN_C_LEFT) = 680; + R_ITEM_ICON_DD(INTERACT_BC_BTN_C_DOWN) = 680; + R_ITEM_ICON_DD(INTERACT_BC_BTN_C_RIGHT) = 680; ZREG(94) = 1; ZREG(95) = 0; XREG(0) = 26; @@ -665,14 +666,14 @@ void Regs_InitDataImpl(void) { VREG(73) = 0; VREG(74) = 0; VREG(75) = 0; - R_ITEM_ICON_WIDTH(0) = 30; - R_ITEM_ICON_WIDTH(1) = 24; - R_ITEM_ICON_WIDTH(2) = 24; - R_ITEM_ICON_WIDTH(3) = 24; - R_ITEM_BTN_WIDTH(0) = 29; - R_ITEM_BTN_WIDTH(1) = 27; - R_ITEM_BTN_WIDTH(2) = 27; - R_ITEM_BTN_WIDTH(3) = 27; + R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_B) = 30; + R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_LEFT) = 24; + R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_DOWN) = 24; + R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_RIGHT) = 24; + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_B) = 29; + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_LEFT) = 27; + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_DOWN) = 27; + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_RIGHT) = 27; VREG(84) = 0; VREG(85) = 50; VREG(86) = 0; diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index e6335307da8..90dc863be95 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -40,7 +40,7 @@ void GameOver_Update(PlayState* play) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; // search c buttons for the found spoiling item and revert if necessary - for (j = 1; j < ARRAY_COUNT(gSaveContext.save.info.equips.buttonItems); j++) { + for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++) { if (gSaveContext.save.info.equips.buttonItems[j] == gSpoilingItems[i]) { gSaveContext.save.info.equips.buttonItems[j] = gSpoilingItemReverts[i]; Interface_LoadItemIcon1(play, j); @@ -50,15 +50,16 @@ void GameOver_Update(PlayState* play) { } // restore "temporary B" to the B Button if not a sword item - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI && - gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER && - gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON && - gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE) { - - if (gSaveContext.buttonStatus[0] != BTN_ENABLED) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI && + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_MASTER && + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_BIGGORON && + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_GIANTS_KNIFE) { + + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_ENABLED) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; } else { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } } @@ -75,8 +76,10 @@ void GameOver_Update(PlayState* play) { gSaveContext.eventInf[1] = 0; gSaveContext.eventInf[2] = 0; gSaveContext.eventInf[3] = 0; - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c index e97c8a8cf02..985b6c3b70d 100644 --- a/src/code/z_kaleido_scope_call.c +++ b/src/code/z_kaleido_scope_call.c @@ -1,9 +1,9 @@ +#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:0" + #include "global.h" #include "terminal.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ - "ntsc-1.2:128" - void (*sKaleidoScopeUpdateFunc)(PlayState* play); void (*sKaleidoScopeDrawFunc)(PlayState* play); f32 gBossMarkScale; diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index 402840aca12..98bd6e6cea4 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -1,3 +1,6 @@ +#pragma increment_block_number "gc-eu:248 gc-eu-mq:248 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:0" + #include "global.h" #include "ultra64.h" #include "terminal.h" @@ -7,8 +10,6 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/gameplay_field_keep/gameplay_field_keep.h" -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0" - typedef enum LightningBoltState { /* 0x00 */ LIGHTNING_BOLT_START, /* 0x01 */ LIGHTNING_BOLT_WAIT, @@ -212,8 +213,8 @@ s16 sLightningFlashAlpha; s16 sSunDepthTestX; s16 sSunDepthTestY; -#pragma increment_block_number "gc-eu:112 gc-eu-mq:112 gc-jp:216 gc-jp-ce:216 gc-jp-mq:216 gc-us:216 gc-us-mq:216" \ - "ntsc-1.2:224" +#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \ + "ntsc-1.2:216" LightNode* sNGameOverLightNode; LightInfo sNGameOverLightInfo; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index b1bbf7c8a3e..77e34de37c9 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -180,7 +180,7 @@ void Interface_ChangeHudVisibilityMode(u16 hudVisibilityMode) { void Interface_RaiseButtonAlphas(PlayState* play, s16 risingAlpha) { InterfaceContext* interfaceCtx = &play->interfaceCtx; - if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_DISABLED) { if (interfaceCtx->bAlpha != 70) { interfaceCtx->bAlpha = 70; } @@ -190,7 +190,7 @@ void Interface_RaiseButtonAlphas(PlayState* play, s16 risingAlpha) { } } - if (gSaveContext.buttonStatus[1] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] == BTN_DISABLED) { if (interfaceCtx->cLeftAlpha != 70) { interfaceCtx->cLeftAlpha = 70; } @@ -200,7 +200,7 @@ void Interface_RaiseButtonAlphas(PlayState* play, s16 risingAlpha) { } } - if (gSaveContext.buttonStatus[2] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] == BTN_DISABLED) { if (interfaceCtx->cDownAlpha != 70) { interfaceCtx->cDownAlpha = 70; } @@ -210,7 +210,7 @@ void Interface_RaiseButtonAlphas(PlayState* play, s16 risingAlpha) { } } - if (gSaveContext.buttonStatus[3] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] == BTN_DISABLED) { if (interfaceCtx->cRightAlpha != 70) { interfaceCtx->cRightAlpha = 70; } @@ -220,7 +220,7 @@ void Interface_RaiseButtonAlphas(PlayState* play, s16 risingAlpha) { } } - if (gSaveContext.buttonStatus[4] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] == BTN_DISABLED) { if (interfaceCtx->aAlpha != 70) { interfaceCtx->aAlpha = 70; } @@ -650,42 +650,45 @@ void func_80083108(PlayState* play) { if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || ((play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38))) { - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { gSaveContext.forceRisingButtonAlphas = true; - if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_DISABLED) { + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; } - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_SLINGSHOT) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_BOW) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_BOMBCHU) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE)) { - gSaveContext.buttonStatus[0] = gSaveContext.save.info.equips.buttonItems[0]; + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SLINGSHOT) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_BOW) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_BOMBCHU) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE)) { + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]; if ((play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38)) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_BOMBCHU; - Interface_LoadItemIcon1(play, 0); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_BOMBCHU; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } else { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_BOW; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_BOW; if (play->shootingGalleryStatus > 1) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SLINGSHOT; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SLINGSHOT; } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } else { if (gSaveContext.save.info.inventory.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } else { - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } } - gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = - BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_HEARTS_MAGIC_MINIMAP_FORCE); } @@ -711,68 +714,72 @@ void func_80083108(PlayState* play) { // should likely be set to true gSaveContext.forceRisingButtonAlphas = 2; if (play->interfaceCtx.unk_260 != 0) { - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_FISHING_POLE) { - gSaveContext.buttonStatus[0] = gSaveContext.save.info.equips.buttonItems[0]; - gSaveContext.save.info.equips.buttonItems[0] = ITEM_FISHING_POLE; + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_FISHING_POLE) { + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_FISHING_POLE; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_B_MINIMAP); } if (gSaveContext.hudVisibilityMode != HUD_VISIBILITY_A_B_MINIMAP) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_B_MINIMAP); } - } else if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_FISHING_POLE) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + } else if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_FISHING_POLE) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } else { - if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_ENABLED) { gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } } else if (msgCtx->msgMode == MSGMODE_NONE) { if ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) && (Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) { - if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[0] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_DISABLED; - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (Player_GetEnvironmentalHazard(play) == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) { if ((gSaveContext.save.info.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.save.info.equips.buttonItems[i] != ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } else { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } @@ -782,60 +789,62 @@ void func_80083108(PlayState* play) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } else if ((player->stateFlags1 & PLAYER_STATE1_21) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) { - if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { - gSaveContext.buttonStatus[0] = BTN_DISABLED; - gSaveContext.buttonStatus[1] = BTN_DISABLED; - gSaveContext.buttonStatus[2] = BTN_DISABLED; - gSaveContext.buttonStatus[3] = BTN_DISABLED; + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_DISABLED) { + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } } else if (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_1) { if (player->stateFlags1 & PLAYER_STATE1_23) { - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_BOW)) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_BOW)) { if (gSaveContext.save.info.inventory.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } else { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_BOW; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_BOW; sp28 = true; } } } else { - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOW)) { - - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE)) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_NONE) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOW)) { + + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_MASTER) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_BIGGORON) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_GIANTS_KNIFE)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; } else { - gSaveContext.buttonStatus[0] = gSaveContext.save.info.equips.buttonItems[0]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]; } } sp28 = true; } if (sp28) { - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); sp28 = false; } - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.save.info.equips.buttonItems[i] != ITEM_OCARINA_OF_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } @@ -846,197 +855,200 @@ void func_80083108(PlayState* play) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } else { if (interfaceCtx->restrictions.bButton == 0) { - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE)) { - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_SLINGSHOT) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOW) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOMBCHU) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_NONE)) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) || (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; sp28 = true; - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } - } else if ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) { + } else if ((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] & 0xFF) == BTN_DISABLED) { sp28 = true; - if (((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) || - ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_ENABLED)) { - gSaveContext.buttonStatus[0] = BTN_ENABLED; + if (((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] & 0xFF) == BTN_DISABLED) || + ((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] & 0xFF) == BTN_ENABLED)) { + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_ENABLED; } else { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0] & 0xFF; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] & 0xFF; } } } else if (interfaceCtx->restrictions.bButton == 1) { - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE)) { - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_SLINGSHOT) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOW) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOMBCHU) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_NONE)) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) || (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; sp28 = true; - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } } else { - if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[0] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_DISABLED; } } if (interfaceCtx->restrictions.bottles != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_BOTTLE_EMPTY) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_BOTTLE_POE)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.bottles == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_BOTTLE_EMPTY) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_BOTTLE_POE)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.tradeItems != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.tradeItems == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.hookshot != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.hookshot == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.ocarina != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_OCARINA_OF_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.ocarina == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_OCARINA_OF_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.farores != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == ITEM_FARORES_WIND) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; PRINTF("***(i=%d)*** ", i); } } } else if (interfaceCtx->restrictions.farores == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == ITEM_FARORES_WIND) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.dinsNayrus != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.dinsNayrus == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.save.info.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.all != 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.save.info.equips.buttonItems[i] != ITEM_OCARINA_OF_TIME) && !((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_BOTTLE_EMPTY) && @@ -1045,22 +1057,22 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { if ((play->sceneId != SCENE_TREASURE_BOX_SHOP) || (gSaveContext.save.info.equips.buttonItems[i] != ITEM_LENS_OF_TRUTH)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } } else if (interfaceCtx->restrictions.all == 0) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if ((gSaveContext.save.info.equips.buttonItems[i] != ITEM_DINS_FIRE) && (gSaveContext.save.info.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.save.info.equips.buttonItems[i] != ITEM_LONGSHOT) && @@ -1072,11 +1084,11 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_BOTTLE_POE)) && !((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } @@ -1182,92 +1194,97 @@ void Inventory_SwapAgeEquipment(void) { u16 shieldEquipValue; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - for (i = 0; i < 4; i++) { - if (i != 0) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { + if (i != INTERACT_BC_BTN_B) { gSaveContext.save.info.playerData.childEquips.buttonItems[i] = gSaveContext.save.info.equips.buttonItems[i]; } else { gSaveContext.save.info.playerData.childEquips.buttonItems[i] = ITEM_SWORD_KOKIRI; } - if (i != 0) { - gSaveContext.save.info.playerData.childEquips.cButtonSlots[i - 1] = - gSaveContext.save.info.equips.cButtonSlots[i - 1]; + if (i != INTERACT_BC_BTN_B) { + gSaveContext.save.info.playerData.childEquips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]; } } gSaveContext.save.info.playerData.childEquips.equipment = gSaveContext.save.info.equips.equipment; - if (gSaveContext.save.info.playerData.adultEquips.buttonItems[0] == ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER; + if (gSaveContext.save.info.playerData.adultEquips.buttonItems[INTERACT_BC_BTN_B] == ITEM_NONE) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_MASTER; if (gSaveContext.save.info.inventory.items[SLOT_DEKU_NUT] != ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[1] = ITEM_DEKU_NUT; - gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_DEKU_NUT; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = ITEM_DEKU_NUT; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = SLOT_DEKU_NUT; } else { - gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.cButtonSlots[0] = - ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = ITEM_NONE; } - gSaveContext.save.info.equips.buttonItems[2] = ITEM_BOMB; - gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.inventory.items[SLOT_OCARINA]; - gSaveContext.save.info.equips.cButtonSlots[1] = SLOT_BOMB; - gSaveContext.save.info.equips.cButtonSlots[2] = SLOT_OCARINA; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = ITEM_BOMB; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = + gSaveContext.save.info.inventory.items[SLOT_OCARINA]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = SLOT_BOMB; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = SLOT_OCARINA; gSaveContext.save.info.equips.equipment = (EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4)) | (EQUIP_VALUE_SHIELD_HYLIAN << (EQUIP_TYPE_SHIELD * 4)) | (EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4)) | (EQUIP_VALUE_BOOTS_KOKIRI << (EQUIP_TYPE_BOOTS * 4)); } else { - for (i = 0; i < 4; i++) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { gSaveContext.save.info.equips.buttonItems[i] = gSaveContext.save.info.playerData.adultEquips.buttonItems[i]; - if (i != 0) { - gSaveContext.save.info.equips.cButtonSlots[i - 1] = - gSaveContext.save.info.playerData.adultEquips.cButtonSlots[i - 1]; + if (i != INTERACT_BC_BTN_B) { + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = + gSaveContext.save.info.playerData.adultEquips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]; } if (((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_BOTTLE_EMPTY) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_BOTTLE_POE)) || ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - PRINTF("Register_Item_Pt(%d)=%d\n", i, gSaveContext.save.info.equips.cButtonSlots[i - 1]); + PRINTF("Register_Item_Pt(%d)=%d\n", i, + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]); gSaveContext.save.info.equips.buttonItems[i] = - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[i - 1]]; + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]]; } } gSaveContext.save.info.equips.equipment = gSaveContext.save.info.playerData.adultEquips.equipment; } } else { - for (i = 0; i < 4; i++) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { gSaveContext.save.info.playerData.adultEquips.buttonItems[i] = gSaveContext.save.info.equips.buttonItems[i]; - if (i != 0) { - gSaveContext.save.info.playerData.adultEquips.cButtonSlots[i - 1] = - gSaveContext.save.info.equips.cButtonSlots[i - 1]; + if (i != INTERACT_BC_BTN_B) { + gSaveContext.save.info.playerData.adultEquips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]; } } gSaveContext.save.info.playerData.adultEquips.equipment = gSaveContext.save.info.equips.equipment; - if (gSaveContext.save.info.playerData.childEquips.buttonItems[0] != ITEM_NONE) { - for (i = 0; i < 4; i++) { + if (gSaveContext.save.info.playerData.childEquips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { gSaveContext.save.info.equips.buttonItems[i] = gSaveContext.save.info.playerData.childEquips.buttonItems[i]; - if (i != 0) { - gSaveContext.save.info.equips.cButtonSlots[i - 1] = - gSaveContext.save.info.playerData.childEquips.cButtonSlots[i - 1]; + if (i != INTERACT_BC_BTN_B) { + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = + gSaveContext.save.info.playerData.childEquips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]; } if (((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_BOTTLE_EMPTY) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_BOTTLE_POE)) || ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - PRINTF("Register_Item_Pt(%d)=%d\n", i, gSaveContext.save.info.equips.cButtonSlots[i - 1]); + PRINTF("Register_Item_Pt(%d)=%d\n", i, + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]); gSaveContext.save.info.equips.buttonItems[i] = - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[i - 1]]; + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]]; } } @@ -1301,12 +1318,12 @@ void func_800849EC(PlayState* play) { OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_GIANTS_KNIFE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_GIANTS_KNIFE; } else { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_BIGGORON; } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } void Interface_LoadItemIcon1(PlayState* play, u16 button) { @@ -1331,32 +1348,36 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) { void func_80084BF4(PlayState* play, u16 flag) { if (flag) { - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_FISHING_POLE) || - (gSaveContext.buttonStatus[0] == BTN_DISABLED)) { - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[0] == ITEM_FISHING_POLE)) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - Interface_LoadItemIcon1(play, 0); - } - } else if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE) { - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_SLINGSHOT) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOW) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOMBCHU) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_FISHING_POLE) || + (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_DISABLED)) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_SLINGSHOT) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOW) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_BOMBCHU) || + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_FISHING_POLE)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); + } + } else if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_NONE) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) || (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - Interface_LoadItemIcon1(play, 0); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + BTN_ENABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL_NO_MINIMAP_BY_BTN_STATUS); } else { - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + BTN_ENABLED; func_80083108(play); } } @@ -1440,16 +1461,16 @@ u8 Item_Give(PlayState* play, u8 item) { (1 << EQUIP_INV_SWORD_BROKENGIANTKNIFE))) { gSaveContext.save.info.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); - if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_GIANTS_KNIFE) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_GIANTS_KNIFE) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_BIGGORON; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } } else if (item == ITEM_SWORD_MASTER) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_MASTER; gSaveContext.save.info.equips.equipment &= (u16) ~(0xF << (EQUIP_TYPE_SWORD * 4)); gSaveContext.save.info.equips.equipment |= EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4); - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } return ITEM_NONE; @@ -1572,7 +1593,7 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if (item == ITEM_LONGSHOT) { INV_CONTENT(item) = item; - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == ITEM_HOOKSHOT) { gSaveContext.save.info.equips.buttonItems[i] = ITEM_LONGSHOT; Interface_LoadItemIcon1(play, i); @@ -1704,7 +1725,7 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if (item == ITEM_OCARINA_OF_TIME) { INV_CONTENT(ITEM_OCARINA_OF_TIME) = ITEM_OCARINA_OF_TIME; - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) { gSaveContext.save.info.equips.buttonItems[i] = ITEM_OCARINA_OF_TIME; Interface_LoadItemIcon1(play, i); @@ -1789,21 +1810,22 @@ u8 Item_Give(PlayState* play, u8 item) { if (gSaveContext.save.info.inventory.items[temp + i] == ITEM_BOTTLE_EMPTY) { PRINTF(T("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d\n"), - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2], temp + i, item); - - if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[0]) { - gSaveContext.save.info.equips.buttonItems[1] = item; - Interface_LoadItemIcon2(play, 1); - gSaveContext.buttonStatus[1] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[1]) { - gSaveContext.save.info.equips.buttonItems[2] = item; - Interface_LoadItemIcon2(play, 2); - gSaveContext.buttonStatus[2] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[2]) { - gSaveContext.save.info.equips.buttonItems[3] = item; - Interface_LoadItemIcon1(play, 3); - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT], temp + i, item); + + if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = item; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_LEFT); + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = BTN_ENABLED; + } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN]) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = item; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_DOWN); + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = BTN_ENABLED; + } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = item; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_C_RIGHT); + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; } gSaveContext.save.info.inventory.items[temp + i] = item; @@ -1827,7 +1849,7 @@ u8 Item_Give(PlayState* play, u8 item) { INV_CONTENT(item) = item; if (temp != ITEM_NONE) { - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (temp == gSaveContext.save.info.equips.buttonItems[i]) { if (item != ITEM_SOLD_OUT) { gSaveContext.save.info.equips.buttonItems[i] = item; @@ -1988,10 +2010,10 @@ void Inventory_DeleteItem(u16 item, u16 invSlot) { PRINTF("\nItem_Register(%d)\n", invSlot, gSaveContext.save.info.inventory.items[invSlot]); - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == item) { gSaveContext.save.info.equips.buttonItems[i] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[i - 1] = SLOT_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = SLOT_NONE; } } } @@ -2003,7 +2025,7 @@ s32 Inventory_ReplaceItem(PlayState* play, u16 oldItem, u16 newItem) { if (gSaveContext.save.info.inventory.items[i] == oldItem) { gSaveContext.save.info.inventory.items[i] = newItem; PRINTF(T("アイテム消去(%d)\n", "Item Purge (%d)\n"), i); - for (i = 1; i < 4; i++) { + for (i = INTERACT_BC_BTN_C_FIRST; i <= INTERACT_BC_BTN_C_LAST; i++) { if (gSaveContext.save.info.equips.buttonItems[i] == oldItem) { gSaveContext.save.info.equips.buttonItems[i] = newItem; Interface_LoadItemIcon1(play, i); @@ -2043,23 +2065,26 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { PRINTF("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, - gSaveContext.save.info.equips.cButtonSlots[button - 1], - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[button - 1]]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(button)], + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(button)]]); // Special case to only empty half of a Lon Lon Milk Bottle - if ((gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[button - 1]] == + if ((gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(button)]] == ITEM_BOTTLE_MILK_FULL) && (item == ITEM_BOTTLE_EMPTY)) { item = ITEM_BOTTLE_MILK_HALF; } - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[button - 1]] = item; + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(button)]] = item; gSaveContext.save.info.equips.buttonItems[button] = item; Interface_LoadItemIcon1(play, button); play->pauseCtx.cursorItem[PAUSE_ITEM] = item; - gSaveContext.buttonStatus[button] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(button)] = BTN_ENABLED; } s32 Inventory_ConsumeFairy(PlayState* play) { @@ -2069,12 +2094,12 @@ s32 Inventory_ConsumeFairy(PlayState* play) { for (i = 0; i < 4; i++) { if (gSaveContext.save.info.inventory.items[bottleSlot + i] == ITEM_BOTTLE_FAIRY) { - for (j = 1; j < 4; j++) { + for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++) { if (gSaveContext.save.info.equips.buttonItems[j] == ITEM_BOTTLE_FAIRY) { gSaveContext.save.info.equips.buttonItems[j] = ITEM_BOTTLE_EMPTY; Interface_LoadItemIcon1(play, j); i = 0; - bottleSlot = gSaveContext.save.info.equips.cButtonSlots[j - 1]; + bottleSlot = gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(j)]; break; } } @@ -2556,12 +2581,11 @@ void Magic_Update(PlayState* play) { (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play)) { if ((gSaveContext.save.info.playerData.magic == 0) || - ((Player_GetEnvironmentalHazard(play) >= PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) && (Player_GetEnvironmentalHazard(play) <= PLAYER_ENV_HAZARD_UNDERWATER_FREE)) || - ((gSaveContext.save.info.equips.buttonItems[1] != ITEM_LENS_OF_TRUTH) && - (gSaveContext.save.info.equips.buttonItems[2] != ITEM_LENS_OF_TRUTH) && - (gSaveContext.save.info.equips.buttonItems[3] != ITEM_LENS_OF_TRUTH)) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] != ITEM_LENS_OF_TRUTH) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] != ITEM_LENS_OF_TRUTH) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] != ITEM_LENS_OF_TRUTH)) || !play->actorCtx.lensActive) { // Force lens off and set magic meter state to idle play->actorCtx.lensActive = false; @@ -2784,31 +2808,38 @@ void Interface_DrawItemButtons(PlayState* play) { gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), interfaceCtx->bAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); - OVERLAY_DISP = - Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, R_ITEM_BTN_X(0), R_ITEM_BTN_Y(0), - R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) << 1, R_ITEM_BTN_DD(0) << 1); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, R_ITEM_BTN_X(INTERACT_BC_BTN_B), + R_ITEM_BTN_Y(INTERACT_BC_BTN_B), R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_B), + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_B), R_ITEM_BTN_DD(INTERACT_BC_BTN_B) << 1, + R_ITEM_BTN_DD(INTERACT_BC_BTN_B) << 1); // C-Left Button Color & Texture gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - gSPTextureRectangle(OVERLAY_DISP++, R_ITEM_BTN_X(1) << 2, R_ITEM_BTN_Y(1) << 2, - (R_ITEM_BTN_X(1) + R_ITEM_BTN_WIDTH(1)) << 2, (R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) << 1, R_ITEM_BTN_DD(1) << 1); + gSPTextureRectangle( + OVERLAY_DISP++, R_ITEM_BTN_X(INTERACT_BC_BTN_C_LEFT) << 2, R_ITEM_BTN_Y(INTERACT_BC_BTN_C_LEFT) << 2, + (R_ITEM_BTN_X(INTERACT_BC_BTN_C_LEFT) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_LEFT)) << 2, + (R_ITEM_BTN_Y(INTERACT_BC_BTN_C_LEFT) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_LEFT)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_LEFT) << 1, R_ITEM_BTN_DD(INTERACT_BC_BTN_C_LEFT) << 1); // C-Down Button Color & Texture gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); - gSPTextureRectangle(OVERLAY_DISP++, R_ITEM_BTN_X(2) << 2, R_ITEM_BTN_Y(2) << 2, - (R_ITEM_BTN_X(2) + R_ITEM_BTN_WIDTH(2)) << 2, (R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) << 1, R_ITEM_BTN_DD(2) << 1); + gSPTextureRectangle( + OVERLAY_DISP++, R_ITEM_BTN_X(INTERACT_BC_BTN_C_DOWN) << 2, R_ITEM_BTN_Y(INTERACT_BC_BTN_C_DOWN) << 2, + (R_ITEM_BTN_X(INTERACT_BC_BTN_C_DOWN) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_DOWN)) << 2, + (R_ITEM_BTN_Y(INTERACT_BC_BTN_C_DOWN) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_DOWN)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_DOWN) << 1, R_ITEM_BTN_DD(INTERACT_BC_BTN_C_DOWN) << 1); // C-Right Button Color & Texture gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha); - gSPTextureRectangle(OVERLAY_DISP++, R_ITEM_BTN_X(3) << 2, R_ITEM_BTN_Y(3) << 2, - (R_ITEM_BTN_X(3) + R_ITEM_BTN_WIDTH(3)) << 2, (R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1); + gSPTextureRectangle( + OVERLAY_DISP++, R_ITEM_BTN_X(INTERACT_BC_BTN_C_RIGHT) << 2, R_ITEM_BTN_Y(INTERACT_BC_BTN_C_RIGHT) << 2, + (R_ITEM_BTN_X(INTERACT_BC_BTN_C_RIGHT) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_RIGHT)) << 2, + (R_ITEM_BTN_Y(INTERACT_BC_BTN_C_RIGHT) + R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_RIGHT)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(INTERACT_BC_BTN_C_RIGHT) << 1, R_ITEM_BTN_DD(INTERACT_BC_BTN_C_RIGHT) << 1); if (!IS_PAUSE_STATE_GAMEOVER(pauseCtx)) { if (IS_PAUSED(&play->pauseCtx)) { @@ -2903,12 +2934,12 @@ void Interface_DrawItemButtons(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // Empty C Button Arrows - for (temp = 1; temp < 4; temp++) { + for (temp = INTERACT_BC_BTN_C_FIRST; temp <= INTERACT_BC_BTN_C_LAST; temp++) { if (gSaveContext.save.info.equips.buttonItems[temp] > 0xF0) { - if (temp == 1) { + if (temp == INTERACT_BC_BTN_C_LEFT) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha); - } else if (temp == 2) { + } else if (temp == INTERACT_BC_BTN_C_DOWN) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha); } else { @@ -2959,11 +2990,12 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { gDPPipeSync(OVERLAY_DISP++); - if ((button == 0) && (gSaveContext.minigameState == 1)) { + if ((button == INTERACT_BC_BTN_B) && (gSaveContext.minigameState == 1)) { ammo = play->interfaceCtx.hbaAmmo; - } else if ((button == 0) && (play->shootingGalleryStatus > 1)) { + } else if ((button == INTERACT_BC_BTN_B) && (play->shootingGalleryStatus > 1)) { ammo = play->shootingGalleryStatus - 1; - } else if ((button == 0) && (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38)) { + } else if ((button == INTERACT_BC_BTN_B) && (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && + Flags_GetSwitch(play, 0x38)) { ammo = play->bombchuBowlingStatus; if (ammo < 0) { ammo = 0; @@ -3286,15 +3318,16 @@ void Interface_Draw(PlayState* play) { if (!(interfaceCtx->unk_1FA)) { // B Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) { - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, 0); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + INTERACT_BC_BTN_B * ITEM_ICON_SIZE, + INTERACT_BC_BTN_B); if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || ((play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38))) { gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - Interface_DrawAmmoCount(play, 0, interfaceCtx->bAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_B, interfaceCtx->bAlpha); } } } else { @@ -3319,40 +3352,44 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // C-Left Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x1000, 1); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + INTERACT_BC_BTN_C_LEFT * ITEM_ICON_SIZE, + INTERACT_BC_BTN_C_LEFT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - Interface_DrawAmmoCount(play, 1, interfaceCtx->cLeftAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_C_LEFT, interfaceCtx->cLeftAlpha); } gDPPipeSync(OVERLAY_DISP++); // C-Down Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x2000, 2); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + INTERACT_BC_BTN_C_DOWN * ITEM_ICON_SIZE, + INTERACT_BC_BTN_C_DOWN); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - Interface_DrawAmmoCount(play, 2, interfaceCtx->cDownAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_C_DOWN, interfaceCtx->cDownAlpha); } gDPPipeSync(OVERLAY_DISP++); // C-Right Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] < 0xF0) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM); - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + 0x3000, 3); + Interface_DrawItemIconTexture(play, + interfaceCtx->iconItemSegment + INTERACT_BC_BTN_C_RIGHT * ITEM_ICON_SIZE, + INTERACT_BC_BTN_C_RIGHT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - Interface_DrawAmmoCount(play, 3, interfaceCtx->cRightAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_C_RIGHT, interfaceCtx->cRightAlpha); } // A Button @@ -3505,14 +3542,15 @@ void Interface_Draw(PlayState* play) { play->transitionType = TRANS_TYPE_FADE_WHITE; gSaveContext.subTimerState = SUBTIMER_STATE_OFF; - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE)) { - if (gSaveContext.buttonStatus[0] != BTN_ENABLED) { - gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_MASTER) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_BIGGORON) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_GIANTS_KNIFE)) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_ENABLED) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; } else { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } } @@ -3526,7 +3564,7 @@ void Interface_Draw(PlayState* play) { play->nextEntranceIndex = spoilingItemEntrances[svar1]; INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1]; - for (svar2 = 1; svar2 < 4; svar2++) { + for (svar2 = INTERACT_BC_BTN_C_FIRST; svar2 <= INTERACT_BC_BTN_C_LAST; svar2++) { if (gSaveContext.save.info.equips.buttonItems[svar2] == gSpoilingItems[svar1]) { gSaveContext.save.info.equips.buttonItems[svar2] = gSpoilingItemReverts[svar1]; Interface_LoadItemIcon1(play, svar2); @@ -4259,7 +4297,6 @@ void Interface_Update(PlayState* play) { if (gSaveContext.timerState == TIMER_STATE_OFF) { if (((sEnvHazard == PLAYER_ENV_HAZARD_HOTROOM) || (sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FLOOR) || (sEnvHazard == PLAYER_ENV_HAZARD_UNDERWATER_FREE)) && - ((gSaveContext.save.info.playerData.health >> 1) != 0)) { gSaveContext.timerState = TIMER_STATE_ENV_HAZARD_INIT; gSaveContext.timerX[TIMER_ID_MAIN] = 140; diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index ca4952c57fd..ee0c771aa0c 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1369,13 +1369,13 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** if ((this->sheathType == PLAYER_MODELTYPE_SHEATH_18) || (this->sheathType == PLAYER_MODELTYPE_SHEATH_19)) { dLists += this->currentShield * 4; if (!LINK_IS_ADULT && (this->currentShield < PLAYER_SHIELD_HYLIAN) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI)) { dLists += PLAYER_SHIELD_MAX * 4; } } else if (!LINK_IS_ADULT && ((this->sheathType == PLAYER_MODELTYPE_SHEATH_16) || (this->sheathType == PLAYER_MODELTYPE_SHEATH_17)) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI)) { dLists = D_80125D28 + PLAYER_SHIELD_MAX * 4; } diff --git a/src/code/z_sram.c b/src/code/z_sram.c index b5d93f9902a..8ae37e14cba 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -318,11 +318,11 @@ void Sram_InitDebugSave(void) { SET_EVENTCHKINF(EVENTCHKINF_C4); if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_KOKIRI; Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_KOKIRI); if (gSaveContext.fileNum == 0xFF) { - gSaveContext.save.info.equips.buttonItems[1] = ITEM_SLINGSHOT; - gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_SLINGSHOT; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = ITEM_SLINGSHOT; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = SLOT_SLINGSHOT; Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_DEKU); } } @@ -490,7 +490,7 @@ void Sram_OpenSave(SramContext* sramCtx) { INV_CONTENT(ITEM_ZELDAS_LETTER) = ITEM_CHICKEN; - for (j = 1; j < 4; j++) { + for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++) { if (gSaveContext.save.info.equips.buttonItems[j] == ITEM_ZELDAS_LETTER) { gSaveContext.save.info.equips.buttonItems[j] = ITEM_CHICKEN; } @@ -499,7 +499,7 @@ void Sram_OpenSave(SramContext* sramCtx) { if (LINK_AGE_IN_YEARS == YEARS_ADULT && !CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER)) { gSaveContext.save.info.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER); - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_MASTER; gSaveContext.save.info.equips.equipment &= ~(0xF << (EQUIP_TYPE_SWORD * 4)); gSaveContext.save.info.equips.equipment |= EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4); } @@ -508,7 +508,7 @@ void Sram_OpenSave(SramContext* sramCtx) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[i]) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; - for (j = 1; j < 4; j++) { + for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++) { if (gSaveContext.save.info.equips.buttonItems[j] == gSpoilingItems[i]) { gSaveContext.save.info.equips.buttonItems[j] = gSpoilingItemReverts[i]; } diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index c073b212127..5fc0865c516 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -9,7 +9,8 @@ #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" -#pragma increment_block_number "gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128 ntsc-1.2:128" +#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \ + "ntsc-1.2:128" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5) diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 8018015ea4b..fba6274c6b9 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -8,6 +8,8 @@ #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_po_field/object_po_field.h" +#pragma increment_block_number "ntsc-1.2:128" + #define FLAGS \ (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_IGNORE_QUAKE) diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 91ba0690bd8..57b809d879d 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -16,7 +16,7 @@ #include "cic6105.h" #endif -#pragma increment_block_number "gc-eu:129 gc-eu-mq:129 gc-jp:131 gc-jp-ce:131 gc-jp-mq:131 gc-us:131 gc-us-mq:131" +#pragma increment_block_number "gc-eu:120 gc-eu-mq:120 gc-jp:122 gc-jp-ce:122 gc-jp-mq:122 gc-us:122 gc-us-mq:122" #define FLAGS ACTOR_FLAG_4 diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index d297308365f..5a4800de1ed 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1616,7 +1616,12 @@ static LinkAnimationHeader* D_80854378[] = { static u8 D_80854380[2] = { PLAYER_MWA_SPIN_ATTACK_1H, PLAYER_MWA_SPIN_ATTACK_2H }; static u8 D_80854384[2] = { PLAYER_MWA_BIG_SPIN_1H, PLAYER_MWA_BIG_SPIN_2H }; -static u16 sItemButtons[] = { BTN_B, BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; +static u16 sItemButtons[] = { + BTN_B, // INTERACT_BC_BTN_B + BTN_CLEFT, // INTERACT_BC_BTN_C_LEFT + BTN_CDOWN, // INTERACT_BC_BTN_C_DOWN + BTN_CRIGHT, // INTERACT_BC_BTN_C_RIGHT +}; static u8 sMagicSpellCosts[] = { 12, 24, 24, 12, 24, 12 }; @@ -2457,18 +2462,18 @@ s32 Player_ItemIsItemAction(s32 item1, s32 itemAction) { } s32 Player_GetItemOnButton(PlayState* play, s32 index) { - if (index >= 4) { + if (index >= INTERACT_BC_BTN_MAX) { return ITEM_NONE; } else if (play->bombchuBowlingStatus != 0) { return (play->bombchuBowlingStatus > 0) ? ITEM_BOMBCHU : ITEM_NONE; - } else if (index == 0) { + } else if (index == INTERACT_BC_BTN_B) { return B_BTN_ITEM; - } else if (index == 1) { - return C_BTN_ITEM(0); - } else if (index == 2) { - return C_BTN_ITEM(1); + } else if (index == INTERACT_BC_BTN_C_LEFT) { + return C_BTN_ITEM(INTERACT_C_BTN_C_LEFT); + } else if (index == INTERACT_BC_BTN_C_DOWN) { + return C_BTN_ITEM(INTERACT_C_BTN_C_DOWN); } else { - return C_BTN_ITEM(2); + return C_BTN_ITEM(INTERACT_C_BTN_C_RIGHT); } } @@ -2489,17 +2494,18 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { if (this->currentMask != PLAYER_MASK_NONE) { maskItemAction = this->currentMask - 1 + PLAYER_IA_MASK_KEATON; - if (!Player_ItemIsItemAction(C_BTN_ITEM(0), maskItemAction) && - !Player_ItemIsItemAction(C_BTN_ITEM(1), maskItemAction) && - !Player_ItemIsItemAction(C_BTN_ITEM(2), maskItemAction)) { + if (!Player_ItemIsItemAction(C_BTN_ITEM(INTERACT_C_BTN_C_LEFT), maskItemAction) && + !Player_ItemIsItemAction(C_BTN_ITEM(INTERACT_C_BTN_C_DOWN), maskItemAction) && + !Player_ItemIsItemAction(C_BTN_ITEM(INTERACT_C_BTN_C_RIGHT), maskItemAction)) { this->currentMask = PLAYER_MASK_NONE; } } if (!(this->stateFlags1 & (PLAYER_STATE1_CARRYING_ACTOR | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemAction >= PLAYER_IA_FISHING_POLE) { - if (!Player_ItemIsInUse(this, B_BTN_ITEM) && !Player_ItemIsInUse(this, C_BTN_ITEM(0)) && - !Player_ItemIsInUse(this, C_BTN_ITEM(1)) && !Player_ItemIsInUse(this, C_BTN_ITEM(2))) { + if (!Player_ItemIsInUse(this, B_BTN_ITEM) && !Player_ItemIsInUse(this, C_BTN_ITEM(INTERACT_C_BTN_C_LEFT)) && + !Player_ItemIsInUse(this, C_BTN_ITEM(INTERACT_C_BTN_C_DOWN)) && + !Player_ItemIsInUse(this, C_BTN_ITEM(INTERACT_C_BTN_C_RIGHT))) { Player_UseItem(play, this, ITEM_NONE); return; } @@ -2514,7 +2520,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { item = Player_GetItemOnButton(play, i); if (item >= ITEM_NONE_FE) { - for (i = 0; i < ARRAY_COUNT(sItemButtons); i++) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { if (CHECK_BTN_ALL(sControlInput->cur.button, sItemButtons[i])) { break; } @@ -15381,7 +15387,7 @@ void func_80852648(PlayState* play, Player* this, CsCmdActorCue* cue) { this->modelGroup = this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_IA_NONE); this->leftHandDLists = gPlayerLeftHandOpenDLs; Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER); - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_MASTER; Inventory_DeleteEquipment(play, EQUIP_TYPE_SWORD); } } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index ac727a2970c..d1408af52d8 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1536,8 +1536,9 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.nextDayTime = NEXT_TIME_NONE; gSaveContext.retainWeatherMode = false; - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = gSaveContext.hudVisibilityModeTimer = gSaveContext.magicCapacity = 0; // false, HUD_VISIBILITY_NO_CHANGE @@ -1555,13 +1556,13 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.save.info.playerData.naviTimer = 0; - if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE)) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_MASTER) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_BIGGORON) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_GIANTS_KNIFE)) { u16 swordEquipValue; - gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; swordEquipValue = (gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.save.info.equips.equipment) >> (EQUIP_TYPE_SWORD * 4); gSaveContext.save.info.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD]; @@ -1921,8 +1922,9 @@ void FileSelect_InitContext(GameState* thisx) { Environment_UpdateSkybox(SKYBOX_NORMAL_SKY, &this->envCtx, &this->skyboxCtx); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = this->defense[0] = this->defense[1] = this->defense[2] = 0; diff --git a/src/overlays/gamestates/ovl_select/z_select.c b/src/overlays/gamestates/ovl_select/z_select.c index 6ccf547b913..35c688a5667 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -32,8 +32,9 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) { gSaveContext.magicCapacity = 0; gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.magic = 0; } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode = gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 33c98159c95..58aa3dccae0 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -467,24 +467,23 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 0; - gSaveContext.save.info.equips.buttonItems[0] = cursorItem; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = cursorItem; if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.save.info.playerData.bgsFlag != 0)) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_BIGGORON; gSaveContext.save.info.playerData.swordHealth = 8; } else { - if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_HEART_PIECE_2) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_SWORD_BIGGORON; + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_HEART_PIECE_2) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_BIGGORON; } - if ((gSaveContext.save.info.equips.buttonItems[0] == ITEM_SWORD_BIGGORON) && - + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_SWORD_BIGGORON) && (gSaveContext.save.info.playerData.bgsFlag == 0) && CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { - gSaveContext.save.info.equips.buttonItems[0] = ITEM_GIANTS_KNIFE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_GIANTS_KNIFE; } } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 9b62bf51dbc..db26eb9c0d0 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -410,8 +410,8 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0); - for (i = 0, j = 24 * 4; i < 3; i++, j += 4) { - if (gSaveContext.save.info.equips.buttonItems[i + 1] != ITEM_NONE) { + for (i = 0, j = 24 * 4; i < INTERACT_C_BTN_MAX; i++, j += 4) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_C_BTN_TO_BC_BTN(i)] != ITEM_NONE) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0); POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0); } @@ -580,225 +580,254 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (pauseCtx->equipTargetCBtn == 0) { - if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[1]) { - if (gSaveContext.save.info.equips.buttonItems[1] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] <= ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[1]; - gSaveContext.save.info.equips.cButtonSlots[1] = - gSaveContext.save.info.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 2); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_DOWN); } } else { - gSaveContext.save.info.equips.buttonItems[2] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[1] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[2]) { - if (gSaveContext.save.info.equips.buttonItems[1] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] <= ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[1]; - gSaveContext.save.info.equips.cButtonSlots[2] = - gSaveContext.save.info.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 3); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_RIGHT); } } else { - gSaveContext.save.info.equips.buttonItems[3] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[2] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.save.info.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT))) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] <= ITEM_BOW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[1]; - gSaveContext.save.info.equips.cButtonSlots[1] = gSaveContext.save.info.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 2); - } else if ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[1]; - gSaveContext.save.info.equips.cButtonSlots[2] = gSaveContext.save.info.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 3); + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_DOWN); + } else if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_RIGHT); } } - gSaveContext.save.info.equips.buttonItems[1] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[0] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 1); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = pauseCtx->equipTargetItem; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_C_LEFT); PRINTF("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); PRINTF("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]); } else if (pauseCtx->equipTargetCBtn == 1) { PRINTF("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); PRINTF("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]); - if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) { - if (gSaveContext.save.info.equips.buttonItems[2] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] <= ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[2]; - gSaveContext.save.info.equips.cButtonSlots[0] = - gSaveContext.save.info.equips.cButtonSlots[1]; - Interface_LoadItemIcon2(play, 1); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_LEFT); } } else { - gSaveContext.save.info.equips.buttonItems[1] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[2]) { - if (gSaveContext.save.info.equips.buttonItems[2] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] <= ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[2]; - gSaveContext.save.info.equips.cButtonSlots[2] = - gSaveContext.save.info.equips.cButtonSlots[1]; - Interface_LoadItemIcon2(play, 3); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_RIGHT); } } else { - gSaveContext.save.info.equips.buttonItems[3] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[2] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.save.info.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT))) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] <= ITEM_BOW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[2]; - Interface_LoadItemIcon2(play, 1); - } else if ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[3] = gSaveContext.save.info.equips.buttonItems[2]; - Interface_LoadItemIcon2(play, 3); + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_LEFT); + } else if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_RIGHT); } } - gSaveContext.save.info.equips.buttonItems[2] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[1] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 2); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = pauseCtx->equipTargetItem; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_C_DOWN); PRINTF("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); PRINTF("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]); } else { PRINTF("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); PRINTF("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]); - if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[0]) { - if (gSaveContext.save.info.equips.buttonItems[3] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= + ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[3]; - gSaveContext.save.info.equips.cButtonSlots[0] = - gSaveContext.save.info.equips.cButtonSlots[2]; - Interface_LoadItemIcon2(play, 1); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_LEFT); } } else { - gSaveContext.save.info.equips.buttonItems[1] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[0] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[1]) { - if (gSaveContext.save.info.equips.buttonItems[3] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN]) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT)))) { + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= + ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[3]; - gSaveContext.save.info.equips.cButtonSlots[1] = - gSaveContext.save.info.equips.cButtonSlots[2]; - Interface_LoadItemIcon2(play, 2); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_DOWN); } } else { - gSaveContext.save.info.equips.buttonItems[2] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[1] = SLOT_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = ITEM_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.save.info.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[3] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[3] <= ITEM_BOW_LIGHT))) { + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= ITEM_BOW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.save.info.equips.buttonItems[1] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[1] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[1] = gSaveContext.save.info.equips.buttonItems[3]; - Interface_LoadItemIcon2(play, 1); - } else if ((gSaveContext.save.info.equips.buttonItems[2] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[2] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[2] = gSaveContext.save.info.equips.buttonItems[3]; - Interface_LoadItemIcon2(play, 2); + if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_LEFT); + } else if ((gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] >= ITEM_BOW_FIRE) && + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] <= ITEM_BOW_LIGHT)) { + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]; + Interface_LoadItemIcon2(play, INTERACT_BC_BTN_C_DOWN); } } - gSaveContext.save.info.equips.buttonItems[3] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[2] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 3); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] = pauseCtx->equipTargetItem; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_C_RIGHT); PRINTF("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2], - gSaveContext.save.info.equips.buttonItems[3]); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN], + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]); PRINTF("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[0], gSaveContext.save.info.equips.cButtonSlots[1], - gSaveContext.save.info.equips.cButtonSlots[2]); + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_LEFT], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_DOWN], + gSaveContext.save.info.equips.cButtonSlots[INTERACT_C_BTN_C_RIGHT]); } pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c index 55f7f3b3bd0..c4b9b79ca78 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.c @@ -1059,12 +1059,12 @@ void KaleidoScope_SetupPageSwitch(PauseContext* pauseCtx, u8 pt) { } #if PLATFORM_N64 || OOT_NTSC - gSaveContext.buttonStatus[0] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][0]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][0]; #endif - gSaveContext.buttonStatus[1] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][1]; - gSaveContext.buttonStatus[2] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][2]; - gSaveContext.buttonStatus[3] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][3]; - gSaveContext.buttonStatus[4] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][4]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][1]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][2]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][3]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex + pt][4]; PRINTF("kscope->kscp_pos+pt = %d\n", pauseCtx->pageIndex + pt); @@ -2817,9 +2817,9 @@ void KaleidoScope_SetVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - for (j = 1; j < 4; j++, i += 4) { - if (gSaveContext.save.info.equips.cButtonSlots[j - 1] != ITEM_NONE) { - k = gSaveContext.save.info.equips.cButtonSlots[j - 1] * 4; + for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++, i += 4) { + if (gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(j)] != ITEM_NONE) { + k = gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(j)] * 4; pauseCtx->itemVtx[i + 0].v.ob[0] = pauseCtx->itemVtx[i + 2].v.ob[0] = pauseCtx->itemVtx[k].v.ob[0] - 2; @@ -3224,11 +3224,11 @@ void KaleidoScope_UpdateOpening(PlayState* play) { func_80084BF4(play, 1); - gSaveContext.buttonStatus[0] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][0]; - gSaveContext.buttonStatus[1] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][1]; - gSaveContext.buttonStatus[2] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][2]; - gSaveContext.buttonStatus[3] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][3]; - gSaveContext.buttonStatus[4] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][4]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][0]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][2]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][3]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = gPageSwitchNextButtonStatus[pauseCtx->pageIndex][4]; pauseCtx->pageIndex = sPageSwitchNextPageIndex[pauseCtx->nextPageMode]; @@ -3427,11 +3427,11 @@ void KaleidoScope_Update(PlayState* play) { switch (pauseCtx->state) { case PAUSE_STATE_INIT: - D_808321A8[0] = gSaveContext.buttonStatus[0]; - D_808321A8[1] = gSaveContext.buttonStatus[1]; - D_808321A8[2] = gSaveContext.buttonStatus[2]; - D_808321A8[3] = gSaveContext.buttonStatus[3]; - D_808321A8[4] = gSaveContext.buttonStatus[4]; + D_808321A8[0] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; + D_808321A8[1] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT]; + D_808321A8[2] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN]; + D_808321A8[3] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT]; + D_808321A8[4] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_A]; pauseCtx->cursorX[PAUSE_MAP] = 0; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot = @@ -3845,9 +3845,11 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; - gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; @@ -3893,9 +3895,11 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; - gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; @@ -3947,9 +3951,11 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; - gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_APPEARING; @@ -3982,8 +3988,10 @@ void KaleidoScope_Update(PlayState* play) { if (CHECK_BTN_ALL(input->press.button, BTN_A)) { if (pauseCtx->promptChoice != 0) { Interface_SetDoAction(play, DO_ACTION_NONE); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_CLOSING; @@ -4014,8 +4022,10 @@ void KaleidoScope_Update(PlayState* play) { R_PAUSE_PAGES_Y_ORIGIN_2 = PAUSE_PAGES_Y_ORIGIN_2_LOWER; YREG(8) = pauseCtx->promptPitch; func_800F64E0(0); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); #if !PLATFORM_N64 && OOT_NTSC @@ -4028,8 +4038,10 @@ void KaleidoScope_Update(PlayState* play) { 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)) { Interface_SetDoAction(play, DO_ACTION_NONE); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->savePromptState = PAUSE_SAVE_PROMPT_STATE_CLOSING_AFTER_SAVED; @@ -4451,11 +4463,11 @@ void KaleidoScope_Update(PlayState* play) { break; } - gSaveContext.buttonStatus[0] = D_808321A8[0]; - gSaveContext.buttonStatus[1] = D_808321A8[1]; - gSaveContext.buttonStatus[2] = D_808321A8[2]; - gSaveContext.buttonStatus[3] = D_808321A8[3]; - gSaveContext.buttonStatus[4] = D_808321A8[4]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = D_808321A8[0]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = D_808321A8[1]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = D_808321A8[2]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = D_808321A8[3]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = D_808321A8[4]; interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; PRINTF(VT_FGCOL(YELLOW)); PRINTF("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode);