From 39d48bb5a041c2dc0c59b0fab93123b5624ac79b Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 12 Oct 2022 07:08:18 +0200 Subject: [PATCH 01/13] IBTN_ --- include/macros.h | 10 +- include/z64save.h | 39 +- src/code/code_80097A00.c | 2 +- src/code/z_construct.c | 78 +-- src/code/z_game_over.c | 20 +- src/code/z_parameter.c | 514 +++++++++--------- src/code/z_player_lib.c | 4 +- src/code/z_sram.c | 12 +- .../actors/ovl_player_actor/z_player.c | 34 +- .../ovl_file_choose/z_file_choose.c | 18 +- src/overlays/gamestates/ovl_select/z_select.c | 4 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 14 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 252 ++++----- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 74 +-- 14 files changed, 557 insertions(+), 518 deletions(-) diff --git a/include/macros.h b/include/macros.h index 37d326c5293..04ea5e4765a 100644 --- a/include/macros.h +++ b/include/macros.h @@ -92,14 +92,14 @@ #define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) #define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) -#define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \ +#define B_BTN_ITEM ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) \ ? ITEM_NONE \ - : (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) \ + : (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_KNIFE) \ ? ITEM_SWORD_BGS \ - : gSaveContext.equips.buttonItems[0]) + : gSaveContext.equips.buttonItems[IBTN_BC_B]) -#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \ - ? gSaveContext.equips.buttonItems[(button) + 1] \ +#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ + ? gSaveContext.equips.buttonItems[IBTN_C_TO_BC(button)] \ : ITEM_NONE) #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) diff --git a/include/z64save.h b/include/z64save.h index ffa2232100d..38ad0eba992 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -30,9 +30,42 @@ typedef enum { #define MAGIC_NORMAL_METER 0x30 #define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) +typedef enum { + /* 0 */ IBTN_BC_B, + /* 1 */ IBTN_BC_C_LEFT, + /* 2 */ IBTN_BC_C_DOWN, + /* 3 */ IBTN_BC_C_RIGHT, + /* 4 */ IBTN_BC_MAX +} InteractButtonBC; + +#define IBTN_BC_C_FIRST IBTN_BC_C_LEFT +#define IBTN_BC_C_LAST IBTN_BC_C_RIGHT + +typedef enum { + /* 0 */ IBTN_C_C_LEFT, + /* 1 */ IBTN_C_C_DOWN, + /* 2 */ IBTN_C_C_RIGHT, + /* 3 */ IBTN_C_MAX +} InteractButtonC; + +#define IBTN_C_TO_BC(btnsC) ((btnsC) + 1) +#define IBTN_BC_TO_C(btnsBC) ((btnsBC) - 1) + +typedef enum { + /* 0 */ IBTN_BCA_B, + /* 1 */ IBTN_BCA_C_LEFT, + /* 2 */ IBTN_BCA_C_DOWN, + /* 3 */ IBTN_BCA_C_RIGHT, + /* 4 */ IBTN_BCA_A, + /* 5 */ IBTN_BCA_MAX +} InteractButtonBCA; + +#define IBTN_C_TO_BCA(btnsC) ((btnsC) + 1) +#define IBTN_BC_TO_BCA(btnsBC) (btnsBC) + typedef struct { - /* 0x00 */ u8 buttonItems[4]; - /* 0x04 */ u8 cButtonSlots[3]; + /* 0x00 */ u8 buttonItems[IBTN_BC_MAX]; + /* 0x04 */ u8 cButtonSlots[IBTN_C_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 @@ -176,7 +209,7 @@ typedef struct { /* 0x13DE */ char unk_13DE[0x0002]; /* 0x13E0 */ u8 seqId; /* 0x13E1 */ u8 natureAmbienceId; - /* 0x13E2 */ u8 buttonStatus[5]; + /* 0x13E2 */ u8 buttonStatus[IBTN_BCA_MAX]; /* 0x13E7 */ u8 unk_13E7; // alpha related /* 0x13E8 */ u16 unk_13E8; // alpha type? /* 0x13EA */ u16 unk_13EA; // also alpha type? diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index 4acd8b4b8b2..a71877ba36e 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -248,7 +248,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { } if (equipment == EQUIP_TYPE_SWORD) { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; gSaveContext.infTable[INFTABLE_1DX_INDEX] = 1; } diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 9a40a339142..f5d165ab366 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -77,35 +77,35 @@ void Interface_Init(PlayState* play) { ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); - osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0], - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[IBTN_BC_B], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); - if (gSaveContext.equips.buttonItems[0] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_B] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, 0x1000, "../z_construct.c", 198); - } else if (gSaveContext.equips.buttonItems[0] != 0xFF) { + } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] != 0xFF) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, 0x1000, "../z_construct.c", 203); } - if (gSaveContext.equips.buttonItems[1] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] * 0x1000, 0x1000, "../z_construct.c", 209); } - if (gSaveContext.equips.buttonItems[2] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] * 0x1000, 0x1000, "../z_construct.c", 214); } - if (gSaveContext.equips.buttonItems[3] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] * 0x1000, 0x1000, "../z_construct.c", 219); } @@ -151,12 +151,12 @@ void Interface_Init(PlayState* play) { interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0; - R_ITEM_BTN_X(0) = B_BUTTON_X; + R_ITEM_BTN_X(IBTN_BC_B) = B_BUTTON_X; R_B_BTN_COLOR(0) = 255; R_B_BTN_COLOR(1) = 30; R_B_BTN_COLOR(2) = 30; - R_ITEM_ICON_X(0) = B_BUTTON_X; - R_ITEM_AMMO_X(0) = B_BUTTON_X + 2; + R_ITEM_ICON_X(IBTN_BC_B) = B_BUTTON_X; + R_ITEM_AMMO_X(IBTN_BC_B) = B_BUTTON_X + 2; R_A_BTN_X = A_BUTTON_X; R_A_ICON_X = A_BUTTON_X; R_A_BTN_COLOR(0) = 0; @@ -315,28 +315,28 @@ void func_80111070(void) { ZREG(64) = 20; 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(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_X; + R_ITEM_BTN_X(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_X; + R_ITEM_BTN_X(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_X; + R_ITEM_BTN_Y(IBTN_BC_B) = B_BUTTON_Y; + R_ITEM_BTN_Y(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_Y; + R_ITEM_BTN_Y(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_Y; + R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_Y; + R_ITEM_BTN_DD(IBTN_BC_B) = 575; + R_ITEM_BTN_DD(IBTN_BC_C_LEFT) = 620; + R_ITEM_BTN_DD(IBTN_BC_C_DOWN) = 620; + R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) = 620; + R_ITEM_ICON_X(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_X; + R_ITEM_ICON_X(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_X; + R_ITEM_ICON_X(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_X; + R_ITEM_ICON_Y(IBTN_BC_B) = B_BUTTON_Y; + R_ITEM_ICON_Y(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_Y; + R_ITEM_ICON_Y(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_Y; + R_ITEM_ICON_Y(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_Y; + R_ITEM_ICON_DD(IBTN_BC_B) = 550; + R_ITEM_ICON_DD(IBTN_BC_C_LEFT) = 680; + R_ITEM_ICON_DD(IBTN_BC_C_DOWN) = 680; + R_ITEM_ICON_DD(IBTN_BC_C_RIGHT) = 680; ZREG(94) = 1; ZREG(95) = 0; XREG(0) = 26; @@ -585,7 +585,7 @@ void func_80111070(void) { 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(IBTN_BC_B) = 29; R_ITEM_BTN_WIDTH(1) = 27; R_ITEM_BTN_WIDTH(2) = 27; R_ITEM_BTN_WIDTH(3) = 27; diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index 5f72a5aa871..95d2b98b47b 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -38,7 +38,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.equips.buttonItems); j++) { + for (j = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; j++) { if (gSaveContext.equips.buttonItems[j] == gSpoilingItems[i]) { gSaveContext.equips.buttonItems[j] = gSpoilingItemReverts[i]; Interface_LoadItemIcon1(play, j); @@ -48,15 +48,15 @@ void GameOver_Update(PlayState* play) { } // restore "temporary B" to the B Button if not a sword item - if (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI && - gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER && - gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS && - gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE) { + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI && + gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER && + gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BGS && + gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KNIFE) { - if (gSaveContext.buttonStatus[0] != BTN_ENABLED) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if (gSaveContext.buttonStatus[IBTN_BCA_B] != BTN_ENABLED) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; } else { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; } } @@ -68,8 +68,8 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; Environment_InitGameOverLights(play); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 416ff89cdba..5e07daefdaf 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -180,7 +180,7 @@ void Interface_ChangeAlpha(u16 alphaType) { void func_80082644(PlayState* play, s16 alpha) { InterfaceContext* interfaceCtx = &play->interfaceCtx; - if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED) { if (interfaceCtx->bAlpha != 70) { interfaceCtx->bAlpha = 70; } @@ -190,7 +190,7 @@ void func_80082644(PlayState* play, s16 alpha) { } } - if (gSaveContext.buttonStatus[1] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] == BTN_DISABLED) { if (interfaceCtx->cLeftAlpha != 70) { interfaceCtx->cLeftAlpha = 70; } @@ -200,7 +200,7 @@ void func_80082644(PlayState* play, s16 alpha) { } } - if (gSaveContext.buttonStatus[2] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] == BTN_DISABLED) { if (interfaceCtx->cDownAlpha != 70) { interfaceCtx->cDownAlpha = 70; } @@ -210,7 +210,7 @@ void func_80082644(PlayState* play, s16 alpha) { } } - if (gSaveContext.buttonStatus[3] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] == BTN_DISABLED) { if (interfaceCtx->cRightAlpha != 70) { interfaceCtx->cRightAlpha = 70; } @@ -220,7 +220,7 @@ void func_80082644(PlayState* play, s16 alpha) { } } - if (gSaveContext.buttonStatus[4] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_A] == BTN_DISABLED) { if (interfaceCtx->aAlpha != 70) { interfaceCtx->aAlpha = 70; } @@ -630,41 +630,41 @@ void func_80083108(PlayState* play) { if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { - if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { gSaveContext.unk_13E7 = 1; - if (gSaveContext.buttonStatus[0] == BTN_DISABLED) { - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED) { + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; } - if ((gSaveContext.equips.buttonItems[0] != ITEM_SLINGSHOT) && - (gSaveContext.equips.buttonItems[0] != ITEM_BOW) && - (gSaveContext.equips.buttonItems[0] != ITEM_BOMBCHU) && - (gSaveContext.equips.buttonItems[0] != ITEM_NONE)) { - gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SLINGSHOT) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_BOW) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_BOMBCHU) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE)) { + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.equips.buttonItems[IBTN_BC_B]; if ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { - gSaveContext.equips.buttonItems[0] = ITEM_BOMBCHU; - Interface_LoadItemIcon1(play, 0); + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_BOMBCHU; + Interface_LoadItemIcon1(play, IBTN_BC_B); } else { - gSaveContext.equips.buttonItems[0] = ITEM_BOW; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_BOW; if (play->shootingGalleryStatus > 1) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.equips.buttonItems[0] = ITEM_SLINGSHOT; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SLINGSHOT; } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); } else { if (gSaveContext.inventory.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; } else { - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); } } } - gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; Interface_ChangeAlpha(6); } @@ -690,67 +690,67 @@ void func_80083108(PlayState* play) { } else if (play->sceneId == SCENE_TURIBORI) { gSaveContext.unk_13E7 = 2; if (play->interfaceCtx.unk_260 != 0) { - if (gSaveContext.equips.buttonItems[0] != ITEM_FISHING_POLE) { - gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; - gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE; + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_FISHING_POLE) { + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.equips.buttonItems[IBTN_BC_B]; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_FISHING_POLE; gSaveContext.unk_13EA = 0; - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); Interface_ChangeAlpha(12); } if (gSaveContext.unk_13EA != 12) { Interface_ChangeAlpha(12); } - } else if (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; gSaveContext.unk_13EA = 0; - if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, IBTN_BC_B); } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; Interface_ChangeAlpha(50); } else { - if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_ENABLED) { gSaveContext.unk_13EA = 0; } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; Interface_ChangeAlpha(50); } } else if (msgCtx->msgMode == MSGMODE_NONE) { if ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) { - if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_B] != BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[0] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (func_8008F2F8(play) == 2) { if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } else { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } @@ -760,60 +760,60 @@ void func_80083108(PlayState* play) { Interface_ChangeAlpha(50); } else if ((player->stateFlags1 & PLAYER_STATE1_21) || (player->stateFlags2 & PLAYER_STATE2_18)) { - 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[IBTN_BCA_B] != BTN_DISABLED) { + gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); } } else if (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_1) { if (player->stateFlags1 & PLAYER_STATE1_23) { - if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) && - (gSaveContext.equips.buttonItems[0] != ITEM_BOW)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_BOW)) { if (gSaveContext.inventory.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; } else { - gSaveContext.equips.buttonItems[0] = ITEM_BOW; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_BOW; sp28 = true; } } } else { - if ((gSaveContext.equips.buttonItems[0] == ITEM_NONE) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOW)) { - - if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW)) { + + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BGS) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KNIFE)) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; } else { - gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.equips.buttonItems[IBTN_BC_B]; } } sp28 = true; } if (sp28) { - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); sp28 = false; } - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } @@ -824,197 +824,197 @@ void func_80083108(PlayState* play) { Interface_ChangeAlpha(50); } else { if (interfaceCtx->restrictions.bButton == 0) { - if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { - if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; sp28 = true; - if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, IBTN_BC_B); } } - } else if ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) { + } else if ((gSaveContext.buttonStatus[IBTN_BCA_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[IBTN_BCA_B] & 0xFF) == BTN_DISABLED) || + ((gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF) == BTN_ENABLED)) { + gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_ENABLED; } else { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0] & 0xFF; + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF; } } } else if (interfaceCtx->restrictions.bButton == 1) { - if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { - if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; sp28 = true; - if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, IBTN_BC_B); } } } else { - if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[0] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; } } if (interfaceCtx->restrictions.bottles != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.bottles == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.tradeItems != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.tradeItems == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.hookshot != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.hookshot == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.ocarina != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.ocarina == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.farores != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; osSyncPrintf("***(i=%d)*** ", i); } } } else if (interfaceCtx->restrictions.farores == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.dinsNayrus != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.dinsNayrus == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.all != 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME) && !((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && @@ -1023,22 +1023,22 @@ void func_80083108(PlayState* play) { (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { if ((play->sceneId != SCENE_TAKARAYA) || (gSaveContext.equips.buttonItems[i] != ITEM_LENS)) { - if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } } else if (interfaceCtx->restrictions.all == 0) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if ((gSaveContext.equips.buttonItems[i] != ITEM_DINS_FIRE) && (gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT) && @@ -1050,11 +1050,11 @@ void func_80083108(PlayState* play) { (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) && !((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[i] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; } } } @@ -1154,84 +1154,84 @@ 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 < IBTN_BC_MAX; i++) { + if (i != IBTN_BC_B) { gSaveContext.childEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; } else { gSaveContext.childEquips.buttonItems[i] = ITEM_SWORD_KOKIRI; } - if (i != 0) { - gSaveContext.childEquips.cButtonSlots[i - 1] = gSaveContext.equips.cButtonSlots[i - 1]; + if (i != IBTN_BC_B) { + gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } gSaveContext.childEquips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.adultEquips.buttonItems[0] == ITEM_NONE) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + if (gSaveContext.adultEquips.buttonItems[IBTN_BC_B] == ITEM_NONE) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_MASTER; if (gSaveContext.inventory.items[SLOT_NUT] != ITEM_NONE) { - gSaveContext.equips.buttonItems[1] = ITEM_NUT; - gSaveContext.equips.cButtonSlots[0] = SLOT_NUT; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_NUT; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_NUT; } else { - gSaveContext.equips.buttonItems[1] = gSaveContext.equips.cButtonSlots[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = ITEM_NONE; } - gSaveContext.equips.buttonItems[2] = ITEM_BOMB; - gSaveContext.equips.buttonItems[3] = gSaveContext.inventory.items[SLOT_OCARINA]; - gSaveContext.equips.cButtonSlots[1] = SLOT_BOMB; - gSaveContext.equips.cButtonSlots[2] = SLOT_OCARINA; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = ITEM_BOMB; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.inventory.items[SLOT_OCARINA]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = SLOT_BOMB; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = SLOT_OCARINA; gSaveContext.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 < IBTN_BC_MAX; i++) { gSaveContext.equips.buttonItems[i] = gSaveContext.adultEquips.buttonItems[i]; - if (i != 0) { - gSaveContext.equips.cButtonSlots[i - 1] = gSaveContext.adultEquips.cButtonSlots[i - 1]; + if (i != IBTN_BC_B) { + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) || ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[i - 1]); + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]); gSaveContext.equips.buttonItems[i] = - gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]]; + gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; } } gSaveContext.equips.equipment = gSaveContext.adultEquips.equipment; } } else { - for (i = 0; i < 4; i++) { + for (i = 0; i < IBTN_BC_MAX; i++) { gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; - if (i != 0) { - gSaveContext.adultEquips.cButtonSlots[i - 1] = gSaveContext.equips.cButtonSlots[i - 1]; + if (i != IBTN_BC_B) { + gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } gSaveContext.adultEquips.equipment = gSaveContext.equips.equipment; - if (gSaveContext.childEquips.buttonItems[0] != ITEM_NONE) { - for (i = 0; i < 4; i++) { + if (gSaveContext.childEquips.buttonItems[IBTN_BC_B] != ITEM_NONE) { + for (i = 0; i < IBTN_BC_MAX; i++) { gSaveContext.equips.buttonItems[i] = gSaveContext.childEquips.buttonItems[i]; - if (i != 0) { - gSaveContext.equips.cButtonSlots[i - 1] = gSaveContext.childEquips.cButtonSlots[i - 1]; + if (i != IBTN_BC_B) { + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) || ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[i - 1]); + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]); gSaveContext.equips.buttonItems[i] = - gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[i - 1]]; + gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; } } @@ -1264,12 +1264,12 @@ void func_800849EC(PlayState* play) { gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); if (CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_KNIFE; } else { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BGS; } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); } void Interface_LoadItemIcon1(PlayState* play, u16 button) { @@ -1296,30 +1296,30 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) { void func_80084BF4(PlayState* play, u16 flag) { if (flag) { - if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE) || - (gSaveContext.buttonStatus[0] == BTN_DISABLED)) { - if ((gSaveContext.equips.buttonItems[0] == ITEM_SLINGSHOT) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOW) || - (gSaveContext.equips.buttonItems[0] == ITEM_BOMBCHU) || - (gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE)) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - Interface_LoadItemIcon1(play, 0); - } - } else if (gSaveContext.equips.buttonItems[0] == ITEM_NONE) { - if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - Interface_LoadItemIcon1(play, 0); + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE) || + (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE)) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + Interface_LoadItemIcon1(play, IBTN_BC_B); + } + } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + Interface_LoadItemIcon1(play, IBTN_BC_B); } } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; Interface_ChangeAlpha(7); } else { - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; func_80083108(play); } } @@ -1403,16 +1403,16 @@ u8 Item_Give(PlayState* play, u8 item) { (1 << EQUIP_INV_SWORD_BROKENGIANTKNIFE))) { gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE); - if (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; - Interface_LoadItemIcon1(play, 0); + if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_KNIFE) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BGS; + Interface_LoadItemIcon1(play, IBTN_BC_B); } } } else if (item == ITEM_SWORD_MASTER) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= (u16) ~(0xF << (EQUIP_TYPE_SWORD * 4)); gSaveContext.equips.equipment |= EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4); - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_B); } return ITEM_NONE; @@ -1535,7 +1535,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 = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) { gSaveContext.equips.buttonItems[i] = ITEM_LONGSHOT; Interface_LoadItemIcon1(play, i); @@ -1669,7 +1669,7 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if (item == ITEM_OCARINA_TIME) { INV_CONTENT(ITEM_OCARINA_TIME) = ITEM_OCARINA_TIME; - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) { gSaveContext.equips.buttonItems[i] = ITEM_OCARINA_TIME; Interface_LoadItemIcon1(play, i); @@ -1754,21 +1754,21 @@ u8 Item_Give(PlayState* play, u8 item) { if (gSaveContext.inventory.items[temp + i] == ITEM_BOTTLE) { // "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2], temp + i, item); - - if ((temp + i) == gSaveContext.equips.cButtonSlots[0]) { - gSaveContext.equips.buttonItems[1] = item; - Interface_LoadItemIcon2(play, 1); - gSaveContext.buttonStatus[1] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.equips.cButtonSlots[1]) { - gSaveContext.equips.buttonItems[2] = item; - Interface_LoadItemIcon2(play, 2); - gSaveContext.buttonStatus[2] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.equips.cButtonSlots[2]) { - gSaveContext.equips.buttonItems[3] = item; - Interface_LoadItemIcon1(play, 3); - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT], temp + i, item); + + if ((temp + i) == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = item; + Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = BTN_ENABLED; + } else if ((temp + i) == gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]) { + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = item; + Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = BTN_ENABLED; + } else if ((temp + i) == gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]) { + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = item; + Interface_LoadItemIcon1(play, IBTN_BC_C_RIGHT); + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; } gSaveContext.inventory.items[temp + i] = item; @@ -1792,7 +1792,7 @@ u8 Item_Give(PlayState* play, u8 item) { INV_CONTENT(item) = item; if (temp != ITEM_NONE) { - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (temp == gSaveContext.equips.buttonItems[i]) { if (item != ITEM_SOLD_OUT) { gSaveContext.equips.buttonItems[i] = item; @@ -1953,10 +1953,10 @@ void Inventory_DeleteItem(u16 item, u16 invSlot) { osSyncPrintf("\nItem_Register(%d)\n", invSlot, gSaveContext.inventory.items[invSlot]); - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == item) { gSaveContext.equips.buttonItems[i] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[i - 1] = SLOT_NONE; + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = SLOT_NONE; } } } @@ -1968,7 +1968,7 @@ s32 Inventory_ReplaceItem(PlayState* play, u16 oldItem, u16 newItem) { if (gSaveContext.inventory.items[i] == oldItem) { gSaveContext.inventory.items[i] = newItem; osSyncPrintf("アイテム消去(%d)\n", i); // "Item Purge (%d)" - for (i = 1; i < 4; i++) { + for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; i++) { if (gSaveContext.equips.buttonItems[i] == oldItem) { gSaveContext.equips.buttonItems[i] = newItem; Interface_LoadItemIcon1(play, i); @@ -2016,22 +2016,22 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, - gSaveContext.equips.cButtonSlots[button - 1], - gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]]); + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)], + gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]]); // Special case to only empty half of a Lon Lon Milk Bottle - if ((gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] == ITEM_MILK_BOTTLE) && + if ((gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]] == ITEM_MILK_BOTTLE) && (item == ITEM_BOTTLE)) { item = ITEM_MILK_HALF; } - gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[button - 1]] = item; + gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]] = item; gSaveContext.equips.buttonItems[button] = item; Interface_LoadItemIcon1(play, button); play->pauseCtx.cursorItem[PAUSE_ITEM] = item; - gSaveContext.buttonStatus[button] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BC_TO_BCA(button)] = BTN_ENABLED; } s32 Inventory_ConsumeFairy(PlayState* play) { @@ -2041,12 +2041,12 @@ s32 Inventory_ConsumeFairy(PlayState* play) { for (i = 0; i < 4; i++) { if (gSaveContext.inventory.items[bottleSlot + i] == ITEM_FAIRY) { - for (j = 1; j < 4; j++) { + for (j = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; j++) { if (gSaveContext.equips.buttonItems[j] == ITEM_FAIRY) { gSaveContext.equips.buttonItems[j] = ITEM_BOTTLE; Interface_LoadItemIcon1(play, j); i = 0; - bottleSlot = gSaveContext.equips.cButtonSlots[j - 1]; + bottleSlot = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(j)]; break; } } @@ -2524,9 +2524,9 @@ 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.magic == 0) || ((func_8008F2F8(play) >= 2) && (func_8008F2F8(play) < 5)) || - ((gSaveContext.equips.buttonItems[1] != ITEM_LENS) && - (gSaveContext.equips.buttonItems[2] != ITEM_LENS) && - (gSaveContext.equips.buttonItems[3] != ITEM_LENS)) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] != ITEM_LENS) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] != ITEM_LENS) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] != ITEM_LENS)) || !play->actorCtx.lensActive) { // Force lens off and set magic meter state to idle play->actorCtx.lensActive = false; @@ -2740,30 +2740,30 @@ void Interface_DrawItemButtons(PlayState* play) { 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); + Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, R_ITEM_BTN_X(IBTN_BC_B), R_ITEM_BTN_Y(IBTN_BC_B), + R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_DD(IBTN_BC_B) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_LEFT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_LEFT) << 2, + (R_ITEM_BTN_X(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_DOWN) << 2, R_ITEM_BTN_Y(IBTN_BC_C_DOWN) << 2, + (R_ITEM_BTN_X(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_RIGHT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) << 2, + (R_ITEM_BTN_X(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, + G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1); if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) { if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) { @@ -2837,12 +2837,12 @@ void Interface_DrawItemButtons(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // Empty C Button Arrows - for (temp = 1; temp < 4; temp++) { + for (temp = IBTN_BC_C_FIRST; temp <= IBTN_BC_C_LAST; temp++) { if (gSaveContext.equips.buttonItems[temp] > 0xF0) { - if (temp == 1) { + if (temp == IBTN_BC_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 == IBTN_BC_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 { @@ -2893,11 +2893,11 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { gDPPipeSync(OVERLAY_DISP++); - if ((button == 0) && (gSaveContext.minigameState == 1)) { + if ((button == IBTN_BC_B) && (gSaveContext.minigameState == 1)) { ammo = play->interfaceCtx.hbaAmmo; - } else if ((button == 0) && (play->shootingGalleryStatus > 1)) { + } else if ((button == IBTN_BC_B) && (play->shootingGalleryStatus > 1)) { ammo = play->shootingGalleryStatus - 1; - } else if ((button == 0) && (play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { + } else if ((button == IBTN_BC_B) && (play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38)) { ammo = play->bombchuBowlingStatus; if (ammo < 0) { ammo = 0; @@ -3219,15 +3219,15 @@ void Interface_Draw(PlayState* play) { if (!(interfaceCtx->unk_1FA)) { // B Button Icon & Ammo Count - if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, 0); + if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, IBTN_BC_B); if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || ((play->sceneId == SCENE_BOWLING) && 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, IBTN_BC_B, interfaceCtx->bAlpha); } } } else { @@ -3252,40 +3252,40 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // C-Left Button Icon & Ammo Count - if (gSaveContext.equips.buttonItems[1] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_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 + 0x1000, IBTN_BC_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, IBTN_BC_C_LEFT, interfaceCtx->cLeftAlpha); } gDPPipeSync(OVERLAY_DISP++); // C-Down Button Icon & Ammo Count - if (gSaveContext.equips.buttonItems[2] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_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 + 0x2000, IBTN_BC_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, IBTN_BC_C_DOWN, interfaceCtx->cDownAlpha); } gDPPipeSync(OVERLAY_DISP++); // C-Right Button Icon & Ammo Count - if (gSaveContext.equips.buttonItems[3] < 0xF0) { + if (gSaveContext.equips.buttonItems[IBTN_BC_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 + 0x3000, IBTN_BC_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, IBTN_BC_C_RIGHT, interfaceCtx->cRightAlpha); } // A Button @@ -3436,14 +3436,14 @@ void Interface_Draw(PlayState* play) { play->transitionType = TRANS_TYPE_FADE_WHITE; gSaveContext.timer2State = 0; - if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { - if (gSaveContext.buttonStatus[0] != BTN_ENABLED) { - gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BGS) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KNIFE)) { + if (gSaveContext.buttonStatus[IBTN_BCA_B] != BTN_ENABLED) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; } else { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; } } @@ -3457,7 +3457,7 @@ void Interface_Draw(PlayState* play) { play->nextEntranceIndex = spoilingItemEntrances[svar1]; INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1]; - for (svar2 = 1; svar2 < 4; svar2++) { + for (svar2 = IBTN_BC_C_FIRST; svar2 <= IBTN_BC_C_LAST; svar2++) { if (gSaveContext.equips.buttonItems[svar2] == gSpoilingItems[svar1]) { gSaveContext.equips.buttonItems[svar2] = gSpoilingItemReverts[svar1]; Interface_LoadItemIcon1(play, svar2); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 1dd2a13bc45..fc8ced42f88 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1156,13 +1156,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.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { + (gSaveContext.equips.buttonItems[IBTN_BC_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.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { + (gSaveContext.equips.buttonItems[IBTN_BC_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 4ce0b5d3a27..6bd82d74670 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -285,11 +285,11 @@ void Sram_InitDebugSave(void) { SET_EVENTCHKINF(EVENTCHKINF_C4); if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_KOKIRI; Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_KOKIRI); if (gSaveContext.fileNum == 0xFF) { - gSaveContext.equips.buttonItems[1] = ITEM_SLINGSHOT; - gSaveContext.equips.cButtonSlots[0] = SLOT_SLINGSHOT; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_SLINGSHOT; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_SLINGSHOT; Inventory_ChangeEquipment(EQUIP_TYPE_SHIELD, EQUIP_VALUE_SHIELD_DEKU); } } @@ -441,7 +441,7 @@ void Sram_OpenSave(SramContext* sramCtx) { INV_CONTENT(ITEM_LETTER_ZELDA) = ITEM_CHICKEN; - for (j = 1; j < 4; j++) { + for (j = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; j++) { if (gSaveContext.equips.buttonItems[j] == ITEM_LETTER_ZELDA) { gSaveContext.equips.buttonItems[j] = ITEM_CHICKEN; } @@ -450,7 +450,7 @@ void Sram_OpenSave(SramContext* sramCtx) { if (LINK_AGE_IN_YEARS == YEARS_ADULT && !CHECK_OWNED_EQUIP(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER)) { gSaveContext.inventory.equipment |= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_MASTER); - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_MASTER; gSaveContext.equips.equipment &= ~(0xF << (EQUIP_TYPE_SWORD * 4)); gSaveContext.equips.equipment |= EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4); } @@ -459,7 +459,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 = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; j++) { if (gSaveContext.equips.buttonItems[j] == gSpoilingItems[i]) { gSaveContext.equips.buttonItems[j] = gSpoilingItemReverts[i]; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 5905d18a170..e1c8cb7c156 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1289,7 +1289,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 D_80854388[] = { BTN_B, BTN_CLEFT, BTN_CDOWN, BTN_CRIGHT }; +static u16 D_80854388[] = { + BTN_B, // IBTN_BC_B + BTN_CLEFT, // IBTN_BC_C_LEFT + BTN_CDOWN, // IBTN_BC_C_DOWN + BTN_CRIGHT, // IBTN_BC_C_RIGHT +}; static u8 sMagicSpellCosts[] = { 12, 24, 24, 12, 24, 12 }; @@ -2055,18 +2060,18 @@ s32 func_80833C98(s32 item1, s32 itemAction) { } s32 func_80833CDC(PlayState* play, s32 index) { - if (index >= 4) { + if (index >= IBTN_BC_MAX) { return ITEM_NONE; } else if (play->bombchuBowlingStatus != 0) { return (play->bombchuBowlingStatus > 0) ? ITEM_BOMBCHU : ITEM_NONE; - } else if (index == 0) { + } else if (index == IBTN_BC_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 == IBTN_BC_C_LEFT) { + return C_BTN_ITEM(IBTN_C_C_LEFT); + } else if (index == IBTN_BC_C_DOWN) { + return C_BTN_ITEM(IBTN_C_C_DOWN); } else { - return C_BTN_ITEM(2); + return C_BTN_ITEM(IBTN_C_C_RIGHT); } } @@ -2077,16 +2082,17 @@ void func_80833DF8(Player* this, PlayState* play) { if (this->currentMask != PLAYER_MASK_NONE) { maskItemAction = this->currentMask - 1 + PLAYER_IA_MASK_KEATON; - if (!func_80833C98(C_BTN_ITEM(0), maskItemAction) && !func_80833C98(C_BTN_ITEM(1), maskItemAction) && - !func_80833C98(C_BTN_ITEM(2), maskItemAction)) { + if (!func_80833C98(C_BTN_ITEM(IBTN_C_C_LEFT), maskItemAction) && + !func_80833C98(C_BTN_ITEM(IBTN_C_C_DOWN), maskItemAction) && + !func_80833C98(C_BTN_ITEM(IBTN_C_C_RIGHT), maskItemAction)) { this->currentMask = PLAYER_MASK_NONE; } } if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { if (this->itemAction >= PLAYER_IA_FISHING_POLE) { - if (!func_80833C50(this, B_BTN_ITEM) && !func_80833C50(this, C_BTN_ITEM(0)) && - !func_80833C50(this, C_BTN_ITEM(1)) && !func_80833C50(this, C_BTN_ITEM(2))) { + if (!func_80833C50(this, B_BTN_ITEM) && !func_80833C50(this, C_BTN_ITEM(IBTN_C_C_LEFT)) && + !func_80833C50(this, C_BTN_ITEM(IBTN_C_C_DOWN)) && !func_80833C50(this, C_BTN_ITEM(IBTN_C_C_RIGHT))) { func_80835F44(play, this, ITEM_NONE); return; } @@ -2100,7 +2106,7 @@ void func_80833DF8(Player* this, PlayState* play) { item = func_80833CDC(play, i); if (item >= ITEM_NONE_FE) { - for (i = 0; i < ARRAY_COUNT(D_80854388); i++) { + for (i = 0; i < IBTN_BC_MAX; i++) { if (CHECK_BTN_ALL(sControlInput->cur.button, D_80854388[i])) { break; } @@ -14191,7 +14197,7 @@ void func_80852648(PlayState* play, Player* this, CsCmdActorAction* arg2) { this->modelGroup = this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_IA_NONE); this->leftHandDLists = gPlayerLeftHandOpenDLs; Inventory_ChangeEquipment(EQUIP_TYPE_SWORD, EQUIP_VALUE_SWORD_MASTER); - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + gSaveContext.equips.buttonItems[IBTN_BC_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 c9be4f9ff31..4bd78a9aff8 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1484,8 +1484,8 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = gSaveContext.magicCapacity = 0; @@ -1502,12 +1502,12 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.naviTimer = 0; - if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && - (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BGS) && + (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KNIFE)) { - gSaveContext.equips.buttonItems[0] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; swordEquipValue = (gEquipMasks[EQUIP_TYPE_SWORD] & gSaveContext.equips.equipment) >> (EQUIP_TYPE_SWORD * 4); gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_TYPE_SWORD]; gSaveContext.inventory.equipment ^= OWNED_EQUIP_FLAG(EQUIP_TYPE_SWORD, swordEquipValue - 1); @@ -1852,8 +1852,8 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_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 2a7aee5eec1..5cbb7a394fc 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -27,8 +27,8 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) { gSaveContext.magicCapacity = 0; gSaveContext.magicLevel = gSaveContext.magic = 0; } - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0); gSaveContext.entranceIndex = entranceIndex; 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 7506b9bfd76..8acd12bc289 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -476,22 +476,22 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { gSaveContext.infTable[INFTABLE_1DX_INDEX] = 0; - gSaveContext.equips.buttonItems[0] = cursorItem; + gSaveContext.equips.buttonItems[IBTN_BC_B] = cursorItem; if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.bgsFlag != 0)) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BGS; gSaveContext.swordHealth = 8; } else { - if (gSaveContext.equips.buttonItems[0] == ITEM_HEART_PIECE_2) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; + if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_HEART_PIECE_2) { + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BGS; } - if ((gSaveContext.equips.buttonItems[0] == ITEM_SWORD_BGS) && (gSaveContext.bgsFlag == 0) && + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_BGS) && (gSaveContext.bgsFlag == 0) && CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { - gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; + gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_KNIFE; } } - Interface_LoadItemIcon1(play, 0); + Interface_LoadItemIcon1(play, IBTN_BC_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 0b098404e2d..652c8a5c8a6 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -418,8 +418,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.equips.buttonItems[i + 1] != ITEM_NONE) { + for (i = 0, j = 24 * 4; i < IBTN_C_MAX; i++, j += 4) { + if (gSaveContext.equips.buttonItems[IBTN_C_TO_BC(i)] != ITEM_NONE) { gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0); POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0); } @@ -586,219 +586,219 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (pauseCtx->equipTargetCBtn == 0) { - if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[1]) { - if (gSaveContext.equips.buttonItems[1] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[1] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[1]; - gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 2); + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } else { - gSaveContext.equips.buttonItems[2] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[1] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[2]) { - if (gSaveContext.equips.buttonItems[1] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[1] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[1]; - gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 3); + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } else { - gSaveContext.equips.buttonItems[3] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[2] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.equips.buttonItems[1] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[1] <= ITEM_BOW_ARROW_LIGHT))) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[2] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[1]; - gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 2); - } else if ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[3] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[1]; - gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[0]; - Interface_LoadItemIcon2(play, 3); + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); + } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } - gSaveContext.equips.buttonItems[1] = pauseCtx->equipTargetItem; - gSaveContext.equips.cButtonSlots[0] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 1); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = pauseCtx->equipTargetItem; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, IBTN_BC_C_LEFT); osSyncPrintf("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2]); + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else if (pauseCtx->equipTargetCBtn == 1) { osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2]); + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); - if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[0]) { - if (gSaveContext.equips.buttonItems[2] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[2] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[2]; - gSaveContext.equips.cButtonSlots[0] = gSaveContext.equips.cButtonSlots[1]; - Interface_LoadItemIcon2(play, 1); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; + Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } } else { - gSaveContext.equips.buttonItems[1] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[0] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[2]) { - if (gSaveContext.equips.buttonItems[2] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[2] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[2]; - gSaveContext.equips.cButtonSlots[2] = gSaveContext.equips.cButtonSlots[1]; - Interface_LoadItemIcon2(play, 3); + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; + Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } else { - gSaveContext.equips.buttonItems[3] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[2] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.equips.buttonItems[2] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[2] <= ITEM_BOW_ARROW_LIGHT))) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[1] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[2]; - Interface_LoadItemIcon2(play, 1); - } else if ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[3] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[3] = gSaveContext.equips.buttonItems[2]; - Interface_LoadItemIcon2(play, 3); + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); + } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } - gSaveContext.equips.buttonItems[2] = pauseCtx->equipTargetItem; - gSaveContext.equips.cButtonSlots[1] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 2); + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = pauseCtx->equipTargetItem; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, IBTN_BC_C_DOWN); osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2]); + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else { osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2]); + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); - if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[0]) { - if (gSaveContext.equips.buttonItems[3] != ITEM_NONE) { + if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[3] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[3]; - gSaveContext.equips.cButtonSlots[0] = gSaveContext.equips.cButtonSlots[2]; - Interface_LoadItemIcon2(play, 1); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } } else { - gSaveContext.equips.buttonItems[1] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[0] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_NONE; } - } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[1]) { - if (gSaveContext.equips.buttonItems[3] != ITEM_NONE) { + } else if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]) { + if (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] != ITEM_NONE) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && - ((gSaveContext.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[3] <= ITEM_BOW_ARROW_LIGHT)))) { + ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[3]; - gSaveContext.equips.cButtonSlots[1] = gSaveContext.equips.cButtonSlots[2]; - Interface_LoadItemIcon2(play, 2); + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } else { - gSaveContext.equips.buttonItems[2] = ITEM_NONE; - gSaveContext.equips.cButtonSlots[1] = SLOT_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = ITEM_NONE; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = SLOT_NONE; } } if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1)) { - if ((gSaveContext.equips.buttonItems[3] == ITEM_BOW) || - ((gSaveContext.equips.buttonItems[3] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[3] <= ITEM_BOW_ARROW_LIGHT))) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] == ITEM_BOW) || + ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } } else if (pauseCtx->equipTargetItem == ITEM_BOW) { - if ((gSaveContext.equips.buttonItems[1] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[1] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[1] = gSaveContext.equips.buttonItems[3]; - Interface_LoadItemIcon2(play, 1); - } else if ((gSaveContext.equips.buttonItems[2] >= ITEM_BOW_ARROW_FIRE) && - (gSaveContext.equips.buttonItems[2] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[2] = gSaveContext.equips.buttonItems[3]; - Interface_LoadItemIcon2(play, 2); + if ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); + } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && + (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)) { + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } - gSaveContext.equips.buttonItems[3] = pauseCtx->equipTargetItem; - gSaveContext.equips.cButtonSlots[2] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, 3); + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = pauseCtx->equipTargetItem; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = pauseCtx->equipTargetSlot; + Interface_LoadItemIcon1(play, IBTN_BC_C_RIGHT); osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2], - gSaveContext.equips.buttonItems[3]); + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[0], gSaveContext.equips.cButtonSlots[1], - gSaveContext.equips.cButtonSlots[2]); + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } pauseCtx->unk_1E4 = 0; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index cfdb53cf85b..3ed921398da 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -380,10 +380,10 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT; } - gSaveContext.buttonStatus[1] = D_8082AB6C[pauseCtx->pageIndex + pt][1]; - gSaveContext.buttonStatus[2] = D_8082AB6C[pauseCtx->pageIndex + pt][2]; - gSaveContext.buttonStatus[3] = D_8082AB6C[pauseCtx->pageIndex + pt][3]; - gSaveContext.buttonStatus[4] = D_8082AB6C[pauseCtx->pageIndex + pt][4]; + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex + pt][1]; + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex + pt][2]; + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex + pt][3]; + gSaveContext.buttonStatus[IBTN_BCA_A] = D_8082AB6C[pauseCtx->pageIndex + pt][4]; osSyncPrintf("kscope->kscp_pos+pt = %d\n", pauseCtx->pageIndex + pt); @@ -1909,9 +1909,9 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - for (phi_t3 = 1; phi_t3 < 4; phi_t3++, phi_t2 += 4) { - if (gSaveContext.equips.cButtonSlots[phi_t3 - 1] != ITEM_NONE) { - phi_t4 = gSaveContext.equips.cButtonSlots[phi_t3 - 1] * 4; + for (phi_t3 = IBTN_BC_C_FIRST; phi_t3 <= IBTN_BC_C_LAST; phi_t3++, phi_t2 += 4) { + if (gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(phi_t3)] != ITEM_NONE) { + phi_t4 = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(phi_t3)] * 4; pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = pauseCtx->itemVtx[phi_t4].v.ob[0] - 2; @@ -2336,11 +2336,11 @@ void func_808265BC(PlayState* play) { if (pauseCtx->unk_1EA == (64 * ZREG(47))) { func_80084BF4(play, 1); - gSaveContext.buttonStatus[0] = D_8082AB6C[pauseCtx->pageIndex][0]; - gSaveContext.buttonStatus[1] = D_8082AB6C[pauseCtx->pageIndex][1]; - gSaveContext.buttonStatus[2] = D_8082AB6C[pauseCtx->pageIndex][2]; - gSaveContext.buttonStatus[3] = D_8082AB6C[pauseCtx->pageIndex][3]; - gSaveContext.buttonStatus[4] = D_8082AB6C[pauseCtx->pageIndex][4]; + gSaveContext.buttonStatus[IBTN_BCA_B] = D_8082AB6C[pauseCtx->pageIndex][0]; + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex][2]; + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex][3]; + gSaveContext.buttonStatus[IBTN_BCA_A] = D_8082AB6C[pauseCtx->pageIndex][4]; pauseCtx->pageIndex = D_8082ABEC[pauseCtx->mode]; pauseCtx->unk_1E4 = 0; pauseCtx->state++; @@ -2511,11 +2511,11 @@ void KaleidoScope_Update(PlayState* play) { switch (pauseCtx->state) { case 3: - 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[IBTN_BCA_B]; + D_808321A8[1] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT]; + D_808321A8[2] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN]; + D_808321A8[3] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT]; + D_808321A8[4] = gSaveContext.buttonStatus[IBTN_BCA_A]; pauseCtx->cursorX[PAUSE_MAP] = 0; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot = @@ -2920,9 +2920,9 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 0; @@ -2967,9 +2967,9 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 0; @@ -3017,9 +3017,9 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 0; @@ -3052,8 +3052,8 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 2; @@ -3077,8 +3077,8 @@ void KaleidoScope_Update(PlayState* play) { WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; func_800F64E0(0); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); } @@ -3088,8 +3088,8 @@ 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) || (--D_8082B25C == 0)) { Interface_SetDoAction(play, DO_ACTION_NONE); - gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = - gSaveContext.buttonStatus[3] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 5; @@ -3488,11 +3488,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[IBTN_BCA_B] = D_808321A8[0]; + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_808321A8[1]; + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_808321A8[2]; + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_808321A8[3]; + gSaveContext.buttonStatus[IBTN_BCA_A] = D_808321A8[4]; interfaceCtx->unk_1FA = interfaceCtx->unk_1FC = 0; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.unk_13EE); From 1fbd18c8d3383f4cb053da6debaa6baba98f2f8a Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 12 Oct 2022 07:08:29 +0200 Subject: [PATCH 02/13] format --- include/macros.h | 18 ++-- src/code/z_construct.c | 15 ++-- src/code/z_game_over.c | 5 +- src/code/z_parameter.c | 72 +++++++++------ .../ovl_file_choose/z_file_choose.c | 10 ++- src/overlays/gamestates/ovl_select/z_select.c | 5 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 3 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 90 ++++++++++++------- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 30 ++++--- 9 files changed, 154 insertions(+), 94 deletions(-) diff --git a/include/macros.h b/include/macros.h index 04ea5e4765a..a950205bc37 100644 --- a/include/macros.h +++ b/include/macros.h @@ -92,15 +92,15 @@ #define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) #define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) -#define B_BTN_ITEM ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) \ - ? ITEM_NONE \ - : (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_KNIFE) \ - ? ITEM_SWORD_BGS \ - : gSaveContext.equips.buttonItems[IBTN_BC_B]) - -#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ - ? gSaveContext.equips.buttonItems[IBTN_C_TO_BC(button)] \ - : ITEM_NONE) +#define B_BTN_ITEM \ + ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) ? ITEM_NONE \ + : (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_KNIFE) ? ITEM_SWORD_BGS \ + : gSaveContext.equips.buttonItems[IBTN_BC_B]) + +#define C_BTN_ITEM(button) \ + ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ + ? gSaveContext.equips.buttonItems[IBTN_C_TO_BC(button)] \ + : ITEM_NONE) #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) #define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) diff --git a/src/code/z_construct.c b/src/code/z_construct.c index f5d165ab366..572172d3d73 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -83,29 +83,34 @@ void Interface_Init(PlayState* play) { if (gSaveContext.equips.buttonItems[IBTN_BC_B] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, 0x1000, "../z_construct.c", 198); } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] != 0xFF) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + + gSaveContext.equips.buttonItems[IBTN_BC_B] * 0x1000, 0x1000, "../z_construct.c", 203); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x1000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] * 0x1000, 0x1000, "../z_construct.c", 209); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x2000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] * 0x1000, 0x1000, "../z_construct.c", 214); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] < 0xF0) { DmaMgr_SendRequest1(interfaceCtx->iconItemSegment + 0x3000, - (uintptr_t)_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] * 0x1000, + (uintptr_t)_icon_item_staticSegmentRomStart + + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] * 0x1000, 0x1000, "../z_construct.c", 219); } diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index 95d2b98b47b..82740cbb9c7 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -68,8 +68,9 @@ void GameOver_Update(PlayState* play) { gSaveContext.eventInf[1] = 0; gSaveContext.eventInf[2] = 0; gSaveContext.eventInf[3] = 0; - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; Environment_InitGameOverLights(play); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 5e07daefdaf..a0dc7ea79d4 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -634,8 +634,9 @@ void func_80083108(PlayState* play) { gSaveContext.unk_13E7 = 1; if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED) { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_ENABLED; } if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_SLINGSHOT) && @@ -664,8 +665,8 @@ void func_80083108(PlayState* play) { } } - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = - BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; Interface_ChangeAlpha(6); } @@ -709,16 +710,18 @@ void func_80083108(PlayState* play) { Interface_LoadItemIcon1(play, IBTN_BC_B); } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_DISABLED; Interface_ChangeAlpha(50); } else { if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_ENABLED) { gSaveContext.unk_13EA = 0; } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_DISABLED; Interface_ChangeAlpha(50); } } else if (msgCtx->msgMode == MSGMODE_NONE) { @@ -1162,7 +1165,8 @@ void Inventory_SwapAgeEquipment(void) { } if (i != IBTN_BC_B) { - gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; + gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)] = + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } @@ -1175,7 +1179,8 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_NUT; gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_NUT; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = ITEM_NONE; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = + ITEM_NONE; } gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = ITEM_BOMB; @@ -1191,7 +1196,8 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.buttonItems[i] = gSaveContext.adultEquips.buttonItems[i]; if (i != IBTN_BC_B) { - gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)]; + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = + gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && @@ -1211,7 +1217,8 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.adultEquips.buttonItems[i] = gSaveContext.equips.buttonItems[i]; if (i != IBTN_BC_B) { - gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; + gSaveContext.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)] = + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } @@ -1222,7 +1229,8 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.buttonItems[i] = gSaveContext.childEquips.buttonItems[i]; if (i != IBTN_BC_B) { - gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)]; + gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(i)] = + gSaveContext.childEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } if (((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && @@ -1297,7 +1305,8 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) { void func_80084BF4(PlayState* play, u16 flag) { if (flag) { if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || - (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || + (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE) || (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED)) { if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || @@ -1308,18 +1317,19 @@ void func_80084BF4(PlayState* play, u16 flag) { Interface_LoadItemIcon1(play, IBTN_BC_B); } } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) { - if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || + (gSaveContext.infTable[INFTABLE_1DX_INDEX] == 0)) { gSaveContext.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; Interface_LoadItemIcon1(play, IBTN_BC_B); } } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; Interface_ChangeAlpha(7); } else { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; func_80083108(play); } } @@ -1754,7 +1764,8 @@ u8 Item_Give(PlayState* play, u8 item) { if (gSaveContext.inventory.items[temp + i] == ITEM_BOTTLE) { // "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT], temp + i, item); if ((temp + i) == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { @@ -2739,31 +2750,34 @@ 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(IBTN_BC_B), R_ITEM_BTN_Y(IBTN_BC_B), - R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_DD(IBTN_BC_B) << 1, R_ITEM_BTN_DD(IBTN_BC_B) << 1); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, R_ITEM_BTN_X(IBTN_BC_B), + R_ITEM_BTN_Y(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), + R_ITEM_BTN_DD(IBTN_BC_B) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_LEFT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_LEFT) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 1); + (R_ITEM_BTN_X(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, + (R_ITEM_BTN_Y(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_DOWN) << 2, R_ITEM_BTN_Y(IBTN_BC_C_DOWN) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 1, R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 1); + (R_ITEM_BTN_X(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, + (R_ITEM_BTN_Y(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 1, R_ITEM_BTN_DD(IBTN_BC_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(IBTN_BC_C_RIGHT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, (R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, - G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1); + (R_ITEM_BTN_X(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, + (R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, G_TX_RENDERTILE, 0, 0, + R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1); if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) { if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugState != 0)) { 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 4bd78a9aff8..168d7d7e93b 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1484,8 +1484,9 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.nextDayTime = NEXT_TIME_NONE; gSaveContext.retainWeatherMode = false; - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = gSaveContext.magicCapacity = 0; @@ -1852,8 +1853,9 @@ void FileSelect_InitContext(GameState* thisx) { Environment_UpdateSkybox(SKYBOX_NORMAL_SKY, &this->envCtx, &this->skyboxCtx); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + gSaveContext.buttonStatus[IBTN_BCA_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 5cbb7a394fc..bfb53277799 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -27,8 +27,9 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) { gSaveContext.magicCapacity = 0; gSaveContext.magicLevel = gSaveContext.magic = 0; } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = 0; SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0); gSaveContext.entranceIndex = entranceIndex; 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 8acd12bc289..23bb9d9cac7 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -485,7 +485,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) { if (gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_HEART_PIECE_2) { gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BGS; } - if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_BGS) && (gSaveContext.bgsFlag == 0) && + if ((gSaveContext.equips.buttonItems[IBTN_BC_B] == ITEM_SWORD_BGS) && + (gSaveContext.bgsFlag == 0) && CHECK_OWNED_EQUIP_ALT(EQUIP_TYPE_SWORD, EQUIP_INV_SWORD_BROKENGIANTKNIFE)) { gSaveContext.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_KNIFE; } 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 652c8a5c8a6..9f0cad9c296 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -595,8 +595,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } else { @@ -612,8 +614,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } else { @@ -632,13 +636,17 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } else if (pauseCtx->equipTargetItem == ITEM_BOW) { if ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } @@ -648,17 +656,21 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { Interface_LoadItemIcon1(play, IBTN_BC_C_LEFT); osSyncPrintf("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else if (pauseCtx->equipTargetCBtn == 1) { osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { @@ -670,8 +682,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } } else { @@ -687,8 +701,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } else { @@ -707,11 +723,13 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } else if (pauseCtx->equipTargetItem == ITEM_BOW) { if ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } } @@ -721,17 +739,21 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { Interface_LoadItemIcon1(play, IBTN_BC_C_DOWN); osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else { osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); if (pauseCtx->equipTargetSlot == gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT]) { @@ -743,8 +765,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } } else { @@ -760,8 +784,10 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_ARROW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { - gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; - gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN] = + gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } else { @@ -780,11 +806,13 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { } else if (pauseCtx->equipTargetItem == ITEM_BOW) { if ((gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] = + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } else if ((gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_ARROW_FIRE) && (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_ARROW_LIGHT)) { - gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] = + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } } @@ -794,10 +822,12 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { Interface_LoadItemIcon1(play, IBTN_BC_C_RIGHT); osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], + gSaveContext.equips.cButtonSlots[IBTN_C_C_LEFT], + gSaveContext.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.equips.cButtonSlots[IBTN_C_C_RIGHT]); } diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 3ed921398da..4bd03cc2a79 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -2920,8 +2920,9 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_DISABLED; gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); @@ -2967,8 +2968,9 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_DISABLED; gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); @@ -3017,8 +3019,9 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_DISABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_DISABLED; gSaveContext.buttonStatus[IBTN_BCA_A] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); @@ -3052,8 +3055,9 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = + gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 2; @@ -3077,8 +3081,9 @@ void KaleidoScope_Update(PlayState* play) { WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; func_800F64E0(0); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); } @@ -3088,8 +3093,9 @@ 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) || (--D_8082B25C == 0)) { Interface_SetDoAction(play, DO_ACTION_NONE); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = BTN_ENABLED; + gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = + gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + BTN_ENABLED; gSaveContext.unk_13EA = 0; Interface_ChangeAlpha(50); pauseCtx->unk_1EC = 5; From d82b8b176597b790fa627dc2c39c0595acdf2b1f Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 16 Nov 2022 20:45:02 +0100 Subject: [PATCH 03/13] format --- src/code/z_parameter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 9054bf9b456..10170095f6b 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -2032,7 +2032,8 @@ void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]]); // Special case to only empty half of a Lon Lon Milk Bottle - if ((gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]] == ITEM_BOTTLE_MILK_FULL) && + if ((gSaveContext.inventory.items[gSaveContext.equips.cButtonSlots[IBTN_BC_TO_C(button)]] == + ITEM_BOTTLE_MILK_FULL) && (item == ITEM_BOTTLE_EMPTY)) { item = ITEM_BOTTLE_MILK_HALF; } From 1282860ce04e75d82472611cb8b430522e3c48f5 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Thu, 17 Nov 2022 12:39:54 +0100 Subject: [PATCH 04/13] More `iconItemSegment` cleanup --- src/code/z_construct.c | 28 ++++++++++++---------------- src/code/z_parameter.c | 12 ++++++++---- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 6a65a9065ce..b1e9f343b7d 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -70,10 +70,11 @@ void Interface_Init(PlayState* play) { (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, DO_ACTION_TEX_SIZE, "../z_construct.c", 178); - interfaceCtx->iconItemSegment = GameState_Alloc(&play->state, 4 * ICON_ITEM_TEX_SIZE, "../z_construct.c", 190); + interfaceCtx->iconItemSegment = + GameState_Alloc(&play->state, IBTN_BC_MAX * ICON_ITEM_TEX_SIZE, "../z_construct.c", 190); // "Icon Item Texture Initialization = %x" - osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", 4 * ICON_ITEM_TEX_SIZE); + osSyncPrintf("アイコンアイテム テクスチャ初期=%x\n", IBTN_BC_MAX * ICON_ITEM_TEX_SIZE); osSyncPrintf("parameter->icon_itemSegment=%x\n", interfaceCtx->iconItemSegment); ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); @@ -83,40 +84,35 @@ void Interface_Init(PlayState* play) { gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT]); if (gSaveContext.equips.buttonItems[IBTN_BC_B] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment, + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + IBTN_BC_B * ICON_ITEM_TEX_SIZE, (uintptr_t)_icon_item_staticSegmentRomStart + - - gSaveContext.equips.buttonItems[IBTN_BC_B] * ICON_ITEM_TEX_SIZE, + gSaveContext.equips.buttonItems[IBTN_BC_B] * ICON_ITEM_TEX_SIZE, ICON_ITEM_TEX_SIZE, "../z_construct.c", 198); } else if (gSaveContext.equips.buttonItems[IBTN_BC_B] != 0xFF) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment, (uintptr_t)_icon_item_staticSegmentRomStart + - - gSaveContext.equips.buttonItems[IBTN_BC_B] * ICON_ITEM_TEX_SIZE, + gSaveContext.equips.buttonItems[IBTN_BC_B] * ICON_ITEM_TEX_SIZE, ICON_ITEM_TEX_SIZE, "../z_construct.c", 203); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + ICON_ITEM_TEX_SIZE, + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + IBTN_BC_C_LEFT * ICON_ITEM_TEX_SIZE, (uintptr_t)_icon_item_staticSegmentRomStart + - - gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] * ICON_ITEM_TEX_SIZE, + gSaveContext.equips.buttonItems[IBTN_BC_C_LEFT] * ICON_ITEM_TEX_SIZE, ICON_ITEM_TEX_SIZE, "../z_construct.c", 209); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + 2 * ICON_ITEM_TEX_SIZE, + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + IBTN_BC_C_DOWN * ICON_ITEM_TEX_SIZE, (uintptr_t)_icon_item_staticSegmentRomStart + - - gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] * ICON_ITEM_TEX_SIZE, + gSaveContext.equips.buttonItems[IBTN_BC_C_DOWN] * ICON_ITEM_TEX_SIZE, ICON_ITEM_TEX_SIZE, "../z_construct.c", 214); } if (gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + 3 * ICON_ITEM_TEX_SIZE, + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + IBTN_BC_C_RIGHT * ICON_ITEM_TEX_SIZE, (uintptr_t)_icon_item_staticSegmentRomStart + - - gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] * ICON_ITEM_TEX_SIZE, + gSaveContext.equips.buttonItems[IBTN_BC_C_RIGHT] * ICON_ITEM_TEX_SIZE, ICON_ITEM_TEX_SIZE, "../z_construct.c", 219); } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index ef6590cc268..bdea53789f7 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -3242,7 +3242,8 @@ void Interface_Draw(PlayState* play) { if (!(interfaceCtx->unk_1FA)) { // B Button Icon & Ammo Count if (gSaveContext.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment, IBTN_BC_B); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + IBTN_BC_B * ICON_ITEM_TEX_SIZE, + IBTN_BC_B); if ((player->stateFlags1 & PLAYER_STATE1_23) || (play->shootingGalleryStatus > 1) || ((play->sceneId == SCENE_BOWLING) && Flags_GetSwitch(play, 0x38))) { @@ -3277,7 +3278,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[IBTN_BC_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, IBTN_BC_C_LEFT); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + IBTN_BC_C_LEFT * ICON_ITEM_TEX_SIZE, + IBTN_BC_C_LEFT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -3290,7 +3292,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[IBTN_BC_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, IBTN_BC_C_DOWN); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + IBTN_BC_C_DOWN * ICON_ITEM_TEX_SIZE, + IBTN_BC_C_DOWN); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -3303,7 +3306,8 @@ void Interface_Draw(PlayState* play) { if (gSaveContext.equips.buttonItems[IBTN_BC_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, IBTN_BC_C_RIGHT); + Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + IBTN_BC_C_RIGHT * ICON_ITEM_TEX_SIZE, + IBTN_BC_C_RIGHT); gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); From d8a2dc344b155fd0c9467107249265e339c9d1b1 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 23 Nov 2022 16:49:58 +0100 Subject: [PATCH 05/13] revert formatting macros.h --- include/macros.h | 74 +++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/include/macros.h b/include/macros.h index 2a594c6ae14..6c944ce4f70 100644 --- a/include/macros.h +++ b/include/macros.h @@ -18,17 +18,17 @@ #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) #define PHYSICAL_TO_VIRTUAL(addr) (void*)((uintptr_t)(addr) + 0x80000000) -#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr)-0x80000000) +#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000) #define SEGMENTED_TO_VIRTUAL(addr) PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr)) -#define SQ(x) ((x) * (x)) +#define SQ(x) ((x)*(x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define DECR(x) ((x) == 0 ? 0 : --(x)) #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) -#define RGBA8(r, g, b, a) ((((r)&0xFF) << 24) | (((g)&0xFF) << 16) | (((b)&0xFF) << 8) | (((a)&0xFF) << 0)) +#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) #define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].head) @@ -41,7 +41,7 @@ #define YEARS_ADULT 17 #define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT) -#define CLOCK_TIME(hr, min) ((s32)(((hr)*60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f)) +#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f)) #define IS_DAY (gSaveContext.nightFlag == 0) #define IS_NIGHT (gSaveContext.nightFlag == 1) @@ -56,12 +56,12 @@ #define OWNED_EQUIP_FLAG(equip, value) (gBitFlags[value] << gEquipShifts[equip]) #define OWNED_EQUIP_FLAG_ALT(equip, value) ((1 << (value)) << gEquipShifts[equip]) #define CHECK_OWNED_EQUIP(equip, value) (OWNED_EQUIP_FLAG(equip, value) & gSaveContext.inventory.equipment) -#define CHECK_OWNED_EQUIP_ALT(equip, value) (gBitFlags[(value) + (equip)*4] & gSaveContext.inventory.equipment) +#define CHECK_OWNED_EQUIP_ALT(equip, value) (gBitFlags[(value) + (equip) * 4] & gSaveContext.inventory.equipment) #define SWORD_EQUIP_TO_PLAYER(swordEquip) (swordEquip) #define SHIELD_EQUIP_TO_PLAYER(shieldEquip) (shieldEquip) -#define TUNIC_EQUIP_TO_PLAYER(tunicEquip) ((tunicEquip)-1) -#define BOOTS_EQUIP_TO_PLAYER(bootsEquip) ((bootsEquip)-1) +#define TUNIC_EQUIP_TO_PLAYER(tunicEquip) ((tunicEquip) - 1) +#define BOOTS_EQUIP_TO_PLAYER(bootsEquip) ((bootsEquip) - 1) #define CUR_UPG_VALUE(upg) ((s32)(gSaveContext.inventory.upgrades & gUpgradeMasks[upg]) >> gUpgradeShifts[upg]) #define CAPACITY(upg, value) gUpgradeCapacities[upg][value] @@ -71,25 +71,26 @@ #define CHECK_DUNGEON_ITEM(item, dungeonIndex) (gSaveContext.inventory.dungeonItems[dungeonIndex] & gBitFlags[item]) #define GET_GS_FLAGS(index) \ - ((gSaveContext.gsFlags[(index) >> 2] & gGsFlagsMasks[(index)&3]) >> gGsFlagsShifts[(index)&3]) -#define SET_GS_FLAGS(index, value) (gSaveContext.gsFlags[(index) >> 2] |= (value) << gGsFlagsShifts[(index)&3]) + ((gSaveContext.gsFlags[(index) >> 2] & gGsFlagsMasks[(index) & 3]) >> gGsFlagsShifts[(index) & 3]) +#define SET_GS_FLAGS(index, value) \ + (gSaveContext.gsFlags[(index) >> 2] |= (value) << gGsFlagsShifts[(index) & 3]) #define HIGH_SCORE(score) (gSaveContext.highScores[score]) -#define GET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] & (1 << ((flag)&0xF))) -#define SET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] |= (1 << ((flag)&0xF))) -#define CLEAR_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] &= ~(1 << ((flag)&0xF))) +#define GET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) -#define GET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] & (1 << ((flag)&0xF))) -#define SET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] |= (1 << ((flag)&0xF))) +#define GET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define GET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] & (1 << ((flag)&0xF))) -#define SET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] |= (1 << ((flag)&0xF))) -#define CLEAR_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] &= ~(1 << ((flag)&0xF))) +#define GET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) -#define GET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag)&0xF))) -#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag)&0xF))) -#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag)&0xF))) +#define GET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) #define B_BTN_ITEM \ ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) ? ITEM_NONE \ @@ -106,6 +107,7 @@ #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) + #define LOG(exp, value, format, file, line) \ do { \ LogUtils_LogThreadId(file, line); \ @@ -139,10 +141,10 @@ extern GraphicsContext* __gfxCtx; -#define WORK_DISP __gfxCtx->work.p -#define POLY_OPA_DISP __gfxCtx->polyOpa.p -#define POLY_XLU_DISP __gfxCtx->polyXlu.p -#define OVERLAY_DISP __gfxCtx->overlay.p +#define WORK_DISP __gfxCtx->work.p +#define POLY_OPA_DISP __gfxCtx->polyOpa.p +#define POLY_XLU_DISP __gfxCtx->polyXlu.p +#define OVERLAY_DISP __gfxCtx->overlay.p // __gfxCtx shouldn't be used directly. // Use the DISP macros defined above when writing to display buffers. @@ -154,9 +156,9 @@ extern GraphicsContext* __gfxCtx; (void)__gfxCtx; \ Graph_OpenDisps(dispRefs, gfxCtx, file, line) -#define CLOSE_DISPS(gfxCtx, file, line) \ - Graph_CloseDisps(dispRefs, gfxCtx, file, line); \ - } \ +#define CLOSE_DISPS(gfxCtx, file, line) \ + Graph_CloseDisps(dispRefs, gfxCtx, file, line); \ + } \ (void)0 /** @@ -170,21 +172,9 @@ extern GraphicsContext* __gfxCtx; * `cbnz` blue component of color vertex, or z component of normal vertex * `a` alpha */ -#define VTX(x, y, z, s, t, crnx, cgny, cbnz, a) \ - { \ - { \ - { x, y, z }, 0, { s, t }, { \ - crnx, cgny, cbnz, a \ - } \ - } \ - } - -#define VTX_T(x, y, z, s, t, cr, cg, cb, a) \ - { \ - { x, y, z }, 0, { s, t }, { \ - cr, cg, cb, a \ - } \ - } +#define VTX(x,y,z,s,t,crnx,cgny,cbnz,a) { { { x, y, z }, 0, { s, t }, { crnx, cgny, cbnz, a } } } + +#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } } #ifdef NDEBUG #define ASSERT(cond, msg, file, line) ((void)0) From 576b0458648aff1581a40f6888440b367a6225ba Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 13 Dec 2022 13:26:40 +0100 Subject: [PATCH 06/13] a bit more `ibtn_bc_` usage --- src/code/z_construct.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 313da93f87e..d5034175a38 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -590,14 +590,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_ICON_WIDTH(IBTN_BC_B) = 30; + R_ITEM_ICON_WIDTH(IBTN_BC_C_LEFT) = 24; + R_ITEM_ICON_WIDTH(IBTN_BC_C_DOWN) = 24; + R_ITEM_ICON_WIDTH(IBTN_BC_C_RIGHT) = 24; R_ITEM_BTN_WIDTH(IBTN_BC_B) = 29; - R_ITEM_BTN_WIDTH(1) = 27; - R_ITEM_BTN_WIDTH(2) = 27; - R_ITEM_BTN_WIDTH(3) = 27; + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT) = 27; + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN) = 27; + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT) = 27; VREG(84) = 0; VREG(85) = 50; VREG(86) = 0; From 28bd807faafe519ae75ac32d32ff6265d8b9b023 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 15 Aug 2023 14:49:34 +0200 Subject: [PATCH 07/13] format and fix whitespace --- src/code/z_construct.c | 23 ++++---- src/code/z_parameter.c | 52 +++++++++---------- .../ovl_kaleido_scope/z_kaleido_equipment.c | 1 - .../misc/ovl_kaleido_scope/z_kaleido_item.c | 11 ---- 4 files changed, 38 insertions(+), 49 deletions(-) diff --git a/src/code/z_construct.c b/src/code/z_construct.c index 0b7338a9110..da6d6abae34 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -81,37 +81,38 @@ void Interface_Init(PlayState* play) { ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[IBTN_BC_B], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], + gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], + gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] < 0xF0) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), ITEM_ICON_SIZE, - "../z_construct.c", 198); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), + ITEM_ICON_SIZE, "../z_construct.c", 198); } else if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 0xFF) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), ITEM_ICON_SIZE, - "../z_construct.c", 203); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), + ITEM_ICON_SIZE, "../z_construct.c", 203); } if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] < 0xF0) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_LEFT * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]), ITEM_ICON_SIZE, - "../z_construct.c", 209); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]), + ITEM_ICON_SIZE, "../z_construct.c", 209); } if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] < 0xF0) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_DOWN * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]), ITEM_ICON_SIZE, - "../z_construct.c", 214); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]), + ITEM_ICON_SIZE, "../z_construct.c", 214); } if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] < 0xF0) { DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_RIGHT * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]), ITEM_ICON_SIZE, - "../z_construct.c", 219); + GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]), + ITEM_ICON_SIZE, "../z_construct.c", 219); } osSyncPrintf("EVENT=%d\n", ((void)0, gSaveContext.timerState)); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 665e60dbecd..5b6388f4a0f 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -812,9 +812,11 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BIGGORON) && (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_GIANTS_KNIFE)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = + gSaveContext.buttonStatus[IBTN_BCA_B]; } else { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]; + gSaveContext.buttonStatus[IBTN_BCA_B] = + gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]; } } sp28 = true; @@ -855,7 +857,8 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = + gSaveContext.buttonStatus[IBTN_BCA_B]; sp28 = true; if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { @@ -869,7 +872,8 @@ void func_80083108(PlayState* play) { ((gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF) == BTN_ENABLED)) { gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_ENABLED; } else { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = + gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF; } } } else if (interfaceCtx->restrictions.bButton == 1) { @@ -879,7 +883,8 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = + gSaveContext.buttonStatus[IBTN_BCA_B]; sp28 = true; if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { @@ -1189,7 +1194,6 @@ void Inventory_SwapAgeEquipment(void) { if (i != IBTN_BC_B) { gSaveContext.save.info.playerData.childEquips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } @@ -1203,13 +1207,13 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = ITEM_DEKU_NUT; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = SLOT_DEKU_NUT; } else { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = - - ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = + gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = ITEM_NONE; } gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = ITEM_BOMB; - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.save.info.inventory.items[SLOT_OCARINA]; + gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = + gSaveContext.save.info.inventory.items[SLOT_OCARINA]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = SLOT_BOMB; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = SLOT_OCARINA; gSaveContext.save.info.equips.equipment = (EQUIP_VALUE_SWORD_MASTER << (EQUIP_TYPE_SWORD * 4)) | @@ -1223,7 +1227,6 @@ void Inventory_SwapAgeEquipment(void) { if (i != IBTN_BC_B) { gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.playerData.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } @@ -1231,9 +1234,11 @@ void Inventory_SwapAgeEquipment(void) { (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))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]); + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, + gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]); gSaveContext.save.info.equips.buttonItems[i] = - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; } } @@ -1245,7 +1250,6 @@ void Inventory_SwapAgeEquipment(void) { if (i != IBTN_BC_B) { gSaveContext.save.info.playerData.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]; } } @@ -1259,7 +1263,6 @@ void Inventory_SwapAgeEquipment(void) { if (i != IBTN_BC_B) { gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.playerData.childEquips.cButtonSlots[IBTN_BC_TO_C(i)]; } @@ -1267,9 +1270,11 @@ void Inventory_SwapAgeEquipment(void) { (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))) { - osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]); + osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, + gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]); gSaveContext.save.info.equips.buttonItems[i] = - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; + gSaveContext.save.info.inventory + .items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]]; } } @@ -1335,7 +1340,6 @@ void func_80084BF4(PlayState* play, u16 flag) { if (flag) { if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE) || (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED)) { @@ -1348,7 +1352,6 @@ void func_80084BF4(PlayState* play, u16 flag) { } } else if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) { if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) || - (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; Interface_LoadItemIcon1(play, IBTN_BC_B); @@ -1797,7 +1800,6 @@ u8 Item_Give(PlayState* play, u8 item) { // "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT], temp + i, item); @@ -2059,13 +2061,13 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { } void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { - osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)], - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)]]); + osSyncPrintf( + "item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, + gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)], + gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)]]); // Special case to only empty half of a Lon Lon Milk Bottle if ((gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)]] == - ITEM_BOTTLE_MILK_FULL) && (item == ITEM_BOTTLE_EMPTY)) { item = ITEM_BOTTLE_MILK_HALF; @@ -2572,7 +2574,6 @@ 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[IBTN_BC_C_LEFT] != ITEM_LENS_OF_TRUTH) && @@ -4258,7 +4259,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/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 4f3ccef8157..69ecffbce5f 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -490,7 +490,6 @@ void KaleidoScope_DrawEquipment(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BIGGORON; } if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_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[IBTN_BC_B] = ITEM_GIANTS_KNIFE; 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 c90d013eabd..f5d4927aa94 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -604,7 +604,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } @@ -624,7 +623,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } @@ -669,7 +667,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else if (pauseCtx->equipTargetCBtn == 1) { @@ -679,7 +676,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); @@ -695,7 +691,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } @@ -715,7 +710,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]; Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); } @@ -756,7 +750,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); } else { @@ -766,7 +759,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); @@ -782,7 +774,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); } @@ -802,7 +793,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]; Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); } @@ -843,7 +833,6 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); } From 283d654225095bbd37330a03d6e9bc7f31547856 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 15 Aug 2023 14:57:34 +0200 Subject: [PATCH 08/13] format two macros --- include/macros.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/macros.h b/include/macros.h index b7a08e9cb45..37ee5499e01 100644 --- a/include/macros.h +++ b/include/macros.h @@ -92,14 +92,15 @@ #define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) #define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) -#define B_BTN_ITEM \ - ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) ? ITEM_NONE \ - : (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_GIANTS_KNIFE) ? ITEM_SWORD_BIGGORON \ - : gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]) - -#define C_BTN_ITEM(button) \ - ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ - ? gSaveContext.save.info.equips.buttonItems[IBTN_C_TO_BC(button)] \ +#define B_BTN_ITEM \ + ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) ? ITEM_NONE \ + : (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_GIANTS_KNIFE) \ + ? ITEM_SWORD_BIGGORON \ + : gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]) + +#define C_BTN_ITEM(button) \ + ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ + ? gSaveContext.save.info.equips.buttonItems[IBTN_C_TO_BC(button)] \ : ITEM_NONE) #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) From 1a037a9dd9d00f1b1108ae6e26ec379a2ab363b6 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Tue, 19 Sep 2023 20:39:12 +0200 Subject: [PATCH 09/13] format --- src/overlays/actors/ovl_player_actor/z_player.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 6ea3919abee..18e8a005779 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -2373,7 +2373,8 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { if (!(this->stateFlags1 & (PLAYER_STATE1_11 | 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(IBTN_C_C_LEFT)) && - !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_DOWN)) && !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_RIGHT))) { + !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_DOWN)) && + !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_RIGHT))) { Player_UseItem(play, this, ITEM_NONE); return; } From 584b1bc27ec87a676dbd7d81190839ea9149de95 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 27 Sep 2023 16:56:04 +0200 Subject: [PATCH 10/13] IBTN_x_ -> INTERACT_x_BTN_ --- include/macros.h | 10 +- include/z64save.h | 54 +- src/code/code_80097A00.c | 2 +- src/code/z_construct.c | 106 ++-- src/code/z_game_over.c | 22 +- src/code/z_parameter.c | 556 +++++++++--------- src/code/z_player_lib.c | 4 +- src/code/z_sram.c | 12 +- .../actors/ovl_player_actor/z_player.c | 38 +- .../ovl_file_choose/z_file_choose.c | 22 +- src/overlays/gamestates/ovl_select/z_select.c | 6 +- .../ovl_kaleido_scope/z_kaleido_equipment.c | 14 +- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 312 +++++----- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 76 +-- 14 files changed, 617 insertions(+), 617 deletions(-) diff --git a/include/macros.h b/include/macros.h index f5a2836a089..e21e4a144d9 100644 --- a/include/macros.h +++ b/include/macros.h @@ -86,14 +86,14 @@ #define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) #define B_BTN_ITEM \ - ((gSaveContext.buttonStatus[IBTN_BCA_B] == ITEM_NONE) ? ITEM_NONE \ - : (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_GIANTS_KNIFE) \ + ((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[IBTN_BC_B]) + : gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]) #define C_BTN_ITEM(button) \ - ((gSaveContext.buttonStatus[IBTN_C_TO_BCA(button)] != BTN_DISABLED) \ - ? gSaveContext.save.info.equips.buttonItems[IBTN_C_TO_BC(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) #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) diff --git a/include/z64save.h b/include/z64save.h index 932f6a86c7b..f82fc0bb6e0 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -60,41 +60,41 @@ typedef enum { #define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) typedef enum { - /* 0 */ IBTN_BC_B, - /* 1 */ IBTN_BC_C_LEFT, - /* 2 */ IBTN_BC_C_DOWN, - /* 3 */ IBTN_BC_C_RIGHT, - /* 4 */ IBTN_BC_MAX -} InteractButtonBC; + /* 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 IBTN_BC_C_FIRST IBTN_BC_C_LEFT -#define IBTN_BC_C_LAST IBTN_BC_C_RIGHT +#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 */ IBTN_C_C_LEFT, - /* 1 */ IBTN_C_C_DOWN, - /* 2 */ IBTN_C_C_RIGHT, - /* 3 */ IBTN_C_MAX -} InteractButtonC; + /* 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 IBTN_C_TO_BC(btnsC) ((btnsC) + 1) -#define IBTN_BC_TO_C(btnsBC) ((btnsBC) - 1) +#define INTERACT_C_BTN_TO_BC_BTN(btnsC) ((btnsC) + 1) +#define INTERACT_BC_BTN_TO_C_BTN(btnsBC) ((btnsBC) - 1) typedef enum { - /* 0 */ IBTN_BCA_B, - /* 1 */ IBTN_BCA_C_LEFT, - /* 2 */ IBTN_BCA_C_DOWN, - /* 3 */ IBTN_BCA_C_RIGHT, - /* 4 */ IBTN_BCA_A, - /* 5 */ IBTN_BCA_MAX -} InteractButtonBCA; + /* 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 IBTN_C_TO_BCA(btnsC) ((btnsC) + 1) -#define IBTN_BC_TO_BCA(btnsBC) (btnsBC) +#define INTERACT_C_BTN_TO_BCA_BTN(btnsC) ((btnsC) + 1) +#define INTERACT_BC_BTN_TO_BCA_BTN(btnsBC) (btnsBC) typedef struct { - /* 0x00 */ u8 buttonItems[IBTN_BC_MAX]; - /* 0x04 */ u8 cButtonSlots[IBTN_C_MAX]; + /* 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 +295,7 @@ typedef struct { /* 0x13DE */ char unk_13DE[0x0002]; /* 0x13E0 */ u8 seqId; /* 0x13E1 */ u8 natureAmbienceId; - /* 0x13E2 */ u8 buttonStatus[IBTN_BCA_MAX]; + /* 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 diff --git a/src/code/code_80097A00.c b/src/code/code_80097A00.c index 4d0f7b71e5b..f64441464cf 100644 --- a/src/code/code_80097A00.c +++ b/src/code/code_80097A00.c @@ -299,7 +299,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { } if (equipment == EQUIP_TYPE_SWORD) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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/z_construct.c b/src/code/z_construct.c index da6d6abae34..d2d543a17b7 100644 --- a/src/code/z_construct.c +++ b/src/code/z_construct.c @@ -4,7 +4,7 @@ void Interface_Destroy(PlayState* play) { Map_Destroy(play); } -#define ICON_ITEM_SEGMENT_SIZE (IBTN_BC_MAX * ITEM_ICON_SIZE) +#define ICON_ITEM_SEGMENT_SIZE (INTERACT_BC_BTN_MAX * ITEM_ICON_SIZE) void Interface_Init(PlayState* play) { InterfaceContext* interfaceCtx = &play->interfaceCtx; @@ -80,38 +80,38 @@ void Interface_Init(PlayState* play) { ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193); - osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[IBTN_BC_B], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + osSyncPrintf("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[IBTN_BC_B] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_B * ITEM_ICON_SIZE), + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] < 0xF0) { + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), + 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[IBTN_BC_B] != 0xFF) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_B * ITEM_ICON_SIZE), + } else if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != 0xFF) { + DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]), + 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[IBTN_BC_C_LEFT] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_LEFT * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]), + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] < 0xF0) { + DmaMgr_RequestSyncDebug(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[IBTN_BC_C_DOWN] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_DOWN * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]), + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] < 0xF0) { + DmaMgr_RequestSyncDebug(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[IBTN_BC_C_RIGHT] < 0xF0) { - DmaMgr_RequestSyncDebug(interfaceCtx->iconItemSegment + (IBTN_BC_C_RIGHT * ITEM_ICON_SIZE), - GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]), + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] < 0xF0) { + DmaMgr_RequestSyncDebug(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); } @@ -160,12 +160,12 @@ void Interface_Init(PlayState* play) { interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0; - R_ITEM_BTN_X(IBTN_BC_B) = B_BUTTON_X; + R_ITEM_BTN_X(INTERACT_BC_BTN_B) = B_BUTTON_X; R_B_BTN_COLOR(0) = 255; R_B_BTN_COLOR(1) = 30; R_B_BTN_COLOR(2) = 30; - R_ITEM_ICON_X(IBTN_BC_B) = B_BUTTON_X; - R_ITEM_AMMO_X(IBTN_BC_B) = 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; R_A_BTN_COLOR(0) = 0; @@ -327,28 +327,28 @@ void Regs_InitDataImpl(void) { ZREG(64) = 20; ZREG(65) = 21; ZREG(66) = 122; - R_ITEM_BTN_X(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_X; - R_ITEM_BTN_X(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_X; - R_ITEM_BTN_X(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_X; - R_ITEM_BTN_Y(IBTN_BC_B) = B_BUTTON_Y; - R_ITEM_BTN_Y(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_Y; - R_ITEM_BTN_Y(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_Y; - R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_Y; - R_ITEM_BTN_DD(IBTN_BC_B) = 575; - R_ITEM_BTN_DD(IBTN_BC_C_LEFT) = 620; - R_ITEM_BTN_DD(IBTN_BC_C_DOWN) = 620; - R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) = 620; - R_ITEM_ICON_X(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_X; - R_ITEM_ICON_X(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_X; - R_ITEM_ICON_X(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_X; - R_ITEM_ICON_Y(IBTN_BC_B) = B_BUTTON_Y; - R_ITEM_ICON_Y(IBTN_BC_C_LEFT) = C_LEFT_BUTTON_Y; - R_ITEM_ICON_Y(IBTN_BC_C_DOWN) = C_DOWN_BUTTON_Y; - R_ITEM_ICON_Y(IBTN_BC_C_RIGHT) = C_RIGHT_BUTTON_Y; - R_ITEM_ICON_DD(IBTN_BC_B) = 550; - R_ITEM_ICON_DD(IBTN_BC_C_LEFT) = 680; - R_ITEM_ICON_DD(IBTN_BC_C_DOWN) = 680; - R_ITEM_ICON_DD(IBTN_BC_C_RIGHT) = 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; @@ -593,14 +593,14 @@ void Regs_InitDataImpl(void) { VREG(73) = 0; VREG(74) = 0; VREG(75) = 0; - R_ITEM_ICON_WIDTH(IBTN_BC_B) = 30; - R_ITEM_ICON_WIDTH(IBTN_BC_C_LEFT) = 24; - R_ITEM_ICON_WIDTH(IBTN_BC_C_DOWN) = 24; - R_ITEM_ICON_WIDTH(IBTN_BC_C_RIGHT) = 24; - R_ITEM_BTN_WIDTH(IBTN_BC_B) = 29; - R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT) = 27; - R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN) = 27; - R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT) = 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 271d575606f..a85f618ec02 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -38,7 +38,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 = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; 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); @@ -48,15 +48,15 @@ void GameOver_Update(PlayState* play) { } // restore "temporary B" to the B Button if not a sword item - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI && - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER && - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BIGGORON && - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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) { - if (gSaveContext.buttonStatus[IBTN_BCA_B] != BTN_ENABLED) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + 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[IBTN_BC_B] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } } @@ -68,9 +68,9 @@ void GameOver_Update(PlayState* play) { gSaveContext.eventInf[1] = 0; gSaveContext.eventInf[2] = 0; gSaveContext.eventInf[3] = 0; - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = - gSaveContext.buttonStatus[IBTN_BCA_A] = 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_parameter.c b/src/code/z_parameter.c index 3aefb481109..3ab6e7efdc0 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[IBTN_BCA_B] == 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[IBTN_BCA_C_LEFT] == 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[IBTN_BCA_C_DOWN] == 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[IBTN_BCA_C_RIGHT] == 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[IBTN_BCA_A] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] == BTN_DISABLED) { if (interfaceCtx->aAlpha != 70) { interfaceCtx->aAlpha = 70; } @@ -650,43 +650,43 @@ 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[IBTN_BC_B] != ITEM_NONE) { + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { gSaveContext.forceRisingButtonAlphas = true; - if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED) { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BC_B] != ITEM_SLINGSHOT) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_BOW) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_BOMBCHU) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE)) { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]; + 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[IBTN_BC_B] = ITEM_BOMBCHU; - Interface_LoadItemIcon1(play, IBTN_BC_B); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_BOMBCHU; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } else { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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[IBTN_BC_B] = ITEM_SLINGSHOT; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SLINGSHOT; } - Interface_LoadItemIcon1(play, IBTN_BC_B); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } else { if (gSaveContext.save.info.inventory.items[SLOT_BOW] == ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } else { - Interface_LoadItemIcon1(play, IBTN_BC_B); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } } - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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); } @@ -712,70 +712,70 @@ 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[IBTN_BC_B] != ITEM_FISHING_POLE) { - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]; - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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, IBTN_BC_B); + 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[IBTN_BC_B] == ITEM_FISHING_POLE) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + } 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[IBTN_BC_B] != ITEM_NONE) { - Interface_LoadItemIcon1(play, IBTN_BC_B); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BCA_B] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_ENABLED) { gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BCA_B] != BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_DISABLED; - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } else { - if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } @@ -785,62 +785,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[IBTN_BCA_B] != BTN_DISABLED) { - gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = BTN_DISABLED; - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = BTN_DISABLED; - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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[IBTN_BC_B] != ITEM_NONE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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[IBTN_BC_B] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } else { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = ITEM_BOW; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_BOW; sp28 = true; } } } else { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW)) { - - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_GIANTS_KNIFE)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = - gSaveContext.buttonStatus[IBTN_BCA_B]; + 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[IBTN_BCA_B] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]; } } sp28 = true; } if (sp28) { - Interface_LoadItemIcon1(play, IBTN_BC_B); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); sp28 = false; } - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } @@ -851,200 +851,200 @@ void func_80083108(PlayState* play) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } else { if (interfaceCtx->restrictions.bButton == 0) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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[IBTN_BC_B] = - gSaveContext.buttonStatus[IBTN_BCA_B]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; sp28 = true; - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { - Interface_LoadItemIcon1(play, IBTN_BC_B); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } - } else if ((gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF) == BTN_DISABLED) { + } else if ((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] & 0xFF) == BTN_DISABLED) { sp28 = true; - if (((gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF) == BTN_DISABLED) || - ((gSaveContext.buttonStatus[IBTN_BCA_B] & 0xFF) == BTN_ENABLED)) { - gSaveContext.buttonStatus[IBTN_BCA_B] = 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[IBTN_BC_B] = - gSaveContext.buttonStatus[IBTN_BCA_B] & 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[IBTN_BC_B] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE)) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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[IBTN_BC_B] = - gSaveContext.buttonStatus[IBTN_BCA_B]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; sp28 = true; - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { - Interface_LoadItemIcon1(play, IBTN_BC_B); + if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_NONE) { + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } } else { - if (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BCA_B] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = BTN_DISABLED; } } if (interfaceCtx->restrictions.bottles != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.bottles == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.tradeItems != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.tradeItems == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.hookshot != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.hookshot == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.ocarina != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.ocarina == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.farores != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; osSyncPrintf("***(i=%d)*** ", i); } } } else if (interfaceCtx->restrictions.farores == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.dinsNayrus != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } } } else if (interfaceCtx->restrictions.dinsNayrus == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } if (interfaceCtx->restrictions.all != 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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) && @@ -1053,22 +1053,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[IBTN_BC_TO_BCA(i)] == BTN_ENABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_ENABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_DISABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_DISABLED; } else { - if (gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } } else if (interfaceCtx->restrictions.all == 0) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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) && @@ -1080,11 +1080,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[IBTN_BC_TO_BCA(i)] == BTN_DISABLED) { + if (gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] == BTN_DISABLED) { sp28 = true; } - gSaveContext.buttonStatus[IBTN_BC_TO_BCA(i)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(i)] = BTN_ENABLED; } } } @@ -1184,50 +1184,50 @@ void Inventory_SwapAgeEquipment(void) { u16 shieldEquipValue; if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - for (i = 0; i < IBTN_BC_MAX; i++) { - if (i != IBTN_BC_B) { + 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 != IBTN_BC_B) { - gSaveContext.save.info.playerData.childEquips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]; + 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[IBTN_BC_B] == ITEM_NONE) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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[IBTN_BC_C_LEFT] = ITEM_DEKU_NUT; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = 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[IBTN_BC_C_LEFT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = 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[IBTN_BC_C_DOWN] = ITEM_BOMB; - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = + 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[IBTN_C_C_DOWN] = SLOT_BOMB; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = 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 < IBTN_BC_MAX; 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 != IBTN_BC_B) { - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.playerData.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)]; + 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) && @@ -1235,35 +1235,35 @@ void Inventory_SwapAgeEquipment(void) { ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(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[IBTN_BC_TO_C(i)]]; + .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 < IBTN_BC_MAX; 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 != IBTN_BC_B) { - gSaveContext.save.info.playerData.adultEquips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)]; + 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[IBTN_BC_B] != ITEM_NONE) { - for (i = 0; i < IBTN_BC_MAX; 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 != IBTN_BC_B) { - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(i)] = - gSaveContext.save.info.playerData.childEquips.cButtonSlots[IBTN_BC_TO_C(i)]; + 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) && @@ -1271,10 +1271,10 @@ void Inventory_SwapAgeEquipment(void) { ((gSaveContext.save.info.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.save.info.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { osSyncPrintf("Register_Item_Pt(%d)=%d\n", i, - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(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[IBTN_BC_TO_C(i)]]; + .items[gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)]]; } } @@ -1308,12 +1308,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[IBTN_BC_B] = ITEM_GIANTS_KNIFE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_GIANTS_KNIFE; } else { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BIGGORON; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_SWORD_BIGGORON; } - Interface_LoadItemIcon1(play, IBTN_BC_B); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } void Interface_LoadItemIcon1(PlayState* play, u16 button) { @@ -1338,32 +1338,32 @@ void Interface_LoadItemIcon2(PlayState* play, u16 button) { void func_80084BF4(PlayState* play, u16 flag) { if (flag) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE) || - (gSaveContext.buttonStatus[IBTN_BCA_B] == BTN_DISABLED)) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_SLINGSHOT) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOW) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_BOMBCHU) || - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_FISHING_POLE)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; - Interface_LoadItemIcon1(play, IBTN_BC_B); - } - } else if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] == ITEM_NONE) { - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; - Interface_LoadItemIcon1(play, IBTN_BC_B); + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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); } } @@ -1448,16 +1448,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[IBTN_BC_B] == ITEM_GIANTS_KNIFE) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = ITEM_SWORD_BIGGORON; - Interface_LoadItemIcon1(play, IBTN_BC_B); + 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[IBTN_BC_B] = 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, IBTN_BC_B); + Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } return ITEM_NONE; @@ -1580,7 +1580,7 @@ u8 Item_Give(PlayState* play, u8 item) { return ITEM_NONE; } else if (item == ITEM_LONGSHOT) { INV_CONTENT(item) = item; - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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); @@ -1714,7 +1714,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 = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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); @@ -1799,22 +1799,22 @@ u8 Item_Give(PlayState* play, u8 item) { if (gSaveContext.save.info.inventory.items[temp + i] == ITEM_BOTTLE_EMPTY) { // "Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d Empty Bottle=%d Content=%d" osSyncPrintf("Item_Pt(1)=%d Item_Pt(2)=%d Item_Pt(3)=%d 空瓶=%d 中味=%d\n", - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT], temp + i, item); - - if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = item; - Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = item; - Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = BTN_ENABLED; - } else if ((temp + i) == gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = item; - Interface_LoadItemIcon1(play, IBTN_BC_C_RIGHT); - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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; @@ -1838,7 +1838,7 @@ u8 Item_Give(PlayState* play, u8 item) { INV_CONTENT(item) = item; if (temp != ITEM_NONE) { - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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; @@ -1999,10 +1999,10 @@ void Inventory_DeleteItem(u16 item, u16 invSlot) { osSyncPrintf("\nItem_Register(%d)\n", invSlot, gSaveContext.save.info.inventory.items[invSlot]); - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_C(i)] = SLOT_NONE; + gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(i)] = SLOT_NONE; } } } @@ -2014,7 +2014,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; osSyncPrintf("アイテム消去(%d)\n", i); // "Item Purge (%d)" - for (i = IBTN_BC_C_FIRST; i <= IBTN_BC_C_LAST; 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); @@ -2063,23 +2063,23 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { osSyncPrintf( "item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, - gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)], - gSaveContext.save.info.inventory.items[gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(button)]]); + 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[IBTN_BC_TO_C(button)]] == + 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[IBTN_BC_TO_C(button)]] = 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[IBTN_BC_TO_BCA(button)] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BC_BTN_TO_BCA_BTN(button)] = BTN_ENABLED; } s32 Inventory_ConsumeFairy(PlayState* play) { @@ -2089,12 +2089,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 = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; 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[IBTN_BC_TO_C(j)]; + bottleSlot = gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(j)]; break; } } @@ -2576,9 +2576,9 @@ void Magic_Update(PlayState* 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[IBTN_BC_C_LEFT] != ITEM_LENS_OF_TRUTH) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] != ITEM_LENS_OF_TRUTH) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] != 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; @@ -2799,34 +2799,34 @@ 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(IBTN_BC_B), - R_ITEM_BTN_Y(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), R_ITEM_BTN_WIDTH(IBTN_BC_B), - R_ITEM_BTN_DD(IBTN_BC_B) << 1, R_ITEM_BTN_DD(IBTN_BC_B) << 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(IBTN_BC_C_LEFT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_LEFT) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, - (R_ITEM_BTN_Y(IBTN_BC_C_LEFT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_LEFT)) << 2, G_TX_RENDERTILE, 0, 0, - R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_LEFT) << 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(IBTN_BC_C_DOWN) << 2, R_ITEM_BTN_Y(IBTN_BC_C_DOWN) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, - (R_ITEM_BTN_Y(IBTN_BC_C_DOWN) + R_ITEM_BTN_WIDTH(IBTN_BC_C_DOWN)) << 2, G_TX_RENDERTILE, 0, 0, - R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 1, R_ITEM_BTN_DD(IBTN_BC_C_DOWN) << 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(IBTN_BC_C_RIGHT) << 2, R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) << 2, - (R_ITEM_BTN_X(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, - (R_ITEM_BTN_Y(IBTN_BC_C_RIGHT) + R_ITEM_BTN_WIDTH(IBTN_BC_C_RIGHT)) << 2, G_TX_RENDERTILE, 0, 0, - R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 1, R_ITEM_BTN_DD(IBTN_BC_C_RIGHT) << 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)) { @@ -2902,12 +2902,12 @@ void Interface_DrawItemButtons(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // Empty C Button Arrows - for (temp = IBTN_BC_C_FIRST; temp <= IBTN_BC_C_LAST; 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 == IBTN_BC_C_LEFT) { + 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 == IBTN_BC_C_DOWN) { + } 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 { @@ -2958,11 +2958,11 @@ void Interface_DrawAmmoCount(PlayState* play, s16 button, s16 alpha) { gDPPipeSync(OVERLAY_DISP++); - if ((button == IBTN_BC_B) && (gSaveContext.minigameState == 1)) { + if ((button == INTERACT_BC_BTN_B) && (gSaveContext.minigameState == 1)) { ammo = play->interfaceCtx.hbaAmmo; - } else if ((button == IBTN_BC_B) && (play->shootingGalleryStatus > 1)) { + } else if ((button == INTERACT_BC_BTN_B) && (play->shootingGalleryStatus > 1)) { ammo = play->shootingGalleryStatus - 1; - } else if ((button == IBTN_BC_B) && (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && + } else if ((button == INTERACT_BC_BTN_B) && (play->sceneId == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38)) { ammo = play->bombchuBowlingStatus; if (ammo < 0) { @@ -3287,16 +3287,16 @@ void Interface_Draw(PlayState* play) { if (!(interfaceCtx->unk_1FA)) { // B Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_NONE) { - Interface_DrawItemIconTexture(play, interfaceCtx->iconItemSegment + IBTN_BC_B * ITEM_ICON_SIZE, - IBTN_BC_B); + 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, IBTN_BC_B, interfaceCtx->bAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_B, interfaceCtx->bAlpha); } } } else { @@ -3321,43 +3321,43 @@ void Interface_Draw(PlayState* play) { gDPPipeSync(OVERLAY_DISP++); // C-Left Button Icon & Ammo Count - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] < 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 + IBTN_BC_C_LEFT * ITEM_ICON_SIZE, - IBTN_BC_C_LEFT); + 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, IBTN_BC_C_LEFT, 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[IBTN_BC_C_DOWN] < 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 + IBTN_BC_C_DOWN * ITEM_ICON_SIZE, - IBTN_BC_C_DOWN); + 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, IBTN_BC_C_DOWN, 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[IBTN_BC_C_RIGHT] < 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 + IBTN_BC_C_RIGHT * ITEM_ICON_SIZE, - IBTN_BC_C_RIGHT); + 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, IBTN_BC_C_RIGHT, interfaceCtx->cRightAlpha); + Interface_DrawAmmoCount(play, INTERACT_BC_BTN_C_RIGHT, interfaceCtx->cRightAlpha); } // A Button @@ -3509,14 +3509,14 @@ void Interface_Draw(PlayState* play) { play->transitionType = TRANS_TYPE_FADE_WHITE; gSaveContext.subTimerState = SUBTIMER_STATE_OFF; - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_GIANTS_KNIFE)) { - if (gSaveContext.buttonStatus[IBTN_BCA_B] != BTN_ENABLED) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = gSaveContext.buttonStatus[IBTN_BCA_B]; + 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[IBTN_BC_B] = ITEM_NONE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } } @@ -3530,7 +3530,7 @@ void Interface_Draw(PlayState* play) { play->nextEntranceIndex = spoilingItemEntrances[svar1]; INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1]; - for (svar2 = IBTN_BC_C_FIRST; svar2 <= IBTN_BC_C_LAST; 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); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 380f9f5fa70..33bf28b1341 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1158,13 +1158,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[IBTN_BC_B] != 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[IBTN_BC_B] != 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 43baeb27bd7..e02bad0496f 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -297,11 +297,11 @@ void Sram_InitDebugSave(void) { SET_EVENTCHKINF(EVENTCHKINF_C4); if (LINK_AGE_IN_YEARS == YEARS_CHILD) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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[IBTN_BC_C_LEFT] = ITEM_SLINGSHOT; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = 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); } } @@ -469,7 +469,7 @@ void Sram_OpenSave(SramContext* sramCtx) { INV_CONTENT(ITEM_ZELDAS_LETTER) = ITEM_CHICKEN; - for (j = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; 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; } @@ -478,7 +478,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[IBTN_BC_B] = 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); } @@ -487,7 +487,7 @@ void Sram_OpenSave(SramContext* sramCtx) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[i]) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; - for (j = IBTN_BC_C_FIRST; j <= IBTN_BC_C_LAST; 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_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index dacefc06b90..77417319942 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1552,10 +1552,10 @@ 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, // IBTN_BC_B - BTN_CLEFT, // IBTN_BC_C_LEFT - BTN_CDOWN, // IBTN_BC_C_DOWN - BTN_CRIGHT, // IBTN_BC_C_RIGHT + 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 }; @@ -2332,18 +2332,18 @@ s32 Player_ItemIsItemAction(s32 item1, s32 itemAction) { } s32 Player_GetItemOnButton(PlayState* play, s32 index) { - if (index >= IBTN_BC_MAX) { + 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 == IBTN_BC_B) { + } else if (index == INTERACT_BC_BTN_B) { return B_BTN_ITEM; - } else if (index == IBTN_BC_C_LEFT) { - return C_BTN_ITEM(IBTN_C_C_LEFT); - } else if (index == IBTN_BC_C_DOWN) { - return C_BTN_ITEM(IBTN_C_C_DOWN); + } 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(IBTN_C_C_RIGHT); + return C_BTN_ITEM(INTERACT_C_BTN_C_RIGHT); } } @@ -2364,18 +2364,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(IBTN_C_C_LEFT), maskItemAction) && - !Player_ItemIsItemAction(C_BTN_ITEM(IBTN_C_C_DOWN), maskItemAction) && - !Player_ItemIsItemAction(C_BTN_ITEM(IBTN_C_C_RIGHT), 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_11 | 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(IBTN_C_C_LEFT)) && - !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_DOWN)) && - !Player_ItemIsInUse(this, C_BTN_ITEM(IBTN_C_C_RIGHT))) { + 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; } @@ -2390,7 +2390,7 @@ void Player_ProcessItemButtons(Player* this, PlayState* play) { item = Player_GetItemOnButton(play, i); if (item >= ITEM_NONE_FE) { - for (i = 0; i < IBTN_BC_MAX; i++) { + for (i = 0; i < INTERACT_BC_BTN_MAX; i++) { if (CHECK_BTN_ALL(sControlInput->cur.button, sItemButtons[i])) { break; } @@ -14772,7 +14772,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[IBTN_BC_B] = 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 a108b43eb1d..cc4d802091d 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1483,9 +1483,9 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.nextDayTime = NEXT_TIME_NONE; gSaveContext.retainWeatherMode = false; - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = - gSaveContext.buttonStatus[IBTN_BCA_A] = 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 @@ -1503,12 +1503,12 @@ void FileSelect_LoadGame(GameState* thisx) { gSaveContext.save.info.playerData.naviTimer = 0; - if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_KOKIRI) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_MASTER) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != ITEM_SWORD_BIGGORON) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] != 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)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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]; @@ -1854,9 +1854,9 @@ void FileSelect_InitContext(GameState* thisx) { Environment_UpdateSkybox(SKYBOX_NORMAL_SKY, &this->envCtx, &this->skyboxCtx); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = - gSaveContext.buttonStatus[IBTN_BCA_A] = 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 3967f12d537..2ce5e0d9b34 100644 --- a/src/overlays/gamestates/ovl_select/z_select.c +++ b/src/overlays/gamestates/ovl_select/z_select.c @@ -27,9 +27,9 @@ void MapSelect_LoadGame(MapSelectState* this, s32 entranceIndex) { gSaveContext.magicCapacity = 0; gSaveContext.save.info.playerData.magicLevel = gSaveContext.save.info.playerData.magic = 0; } - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = - gSaveContext.buttonStatus[IBTN_BCA_A] = 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 1cded033e2b..9a894f4c1bc 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -477,23 +477,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[IBTN_BC_B] = 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[IBTN_BC_B] = 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[IBTN_BC_B] == ITEM_HEART_PIECE_2) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_B] = 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[IBTN_BC_B] == 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[IBTN_BC_B] = ITEM_GIANTS_KNIFE; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_GIANTS_KNIFE; } } - Interface_LoadItemIcon1(play, IBTN_BC_B); + 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 102b9af8d19..14af62f884a 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -422,8 +422,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 < IBTN_C_MAX; i++, j += 4) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_C_TO_BC(i)] != 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); } @@ -592,249 +592,249 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if (pauseCtx->equipTargetCBtn == 0) { - if (pauseCtx->equipTargetSlot == gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] != 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[IBTN_BC_C_LEFT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] <= 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[IBTN_BC_C_DOWN] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); + 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[IBTN_BC_C_DOWN] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = 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[IBTN_C_C_RIGHT]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] != 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[IBTN_BC_C_LEFT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] <= 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[IBTN_BC_C_RIGHT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); + 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[IBTN_BC_C_RIGHT] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = 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[IBTN_BC_C_LEFT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] <= 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[IBTN_BC_C_DOWN] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); - } else if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); + 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[IBTN_BC_C_LEFT] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, IBTN_BC_C_LEFT); + 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); osSyncPrintf("C左sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + 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]); osSyncPrintf("C左sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); + 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) { osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + 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]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); + 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[IBTN_C_C_LEFT]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] != 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[IBTN_BC_C_DOWN] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] <= 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[IBTN_BC_C_LEFT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]; - Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); + 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[IBTN_BC_C_LEFT] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = 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[IBTN_C_C_RIGHT]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] != 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[IBTN_BC_C_DOWN] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] <= 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[IBTN_BC_C_RIGHT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN]; - Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); + 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[IBTN_BC_C_RIGHT] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = 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[IBTN_BC_C_DOWN] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] <= 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[IBTN_BC_C_LEFT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; - Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); - } else if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN]; - Interface_LoadItemIcon2(play, IBTN_BC_C_RIGHT); + 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[IBTN_BC_C_DOWN] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, IBTN_BC_C_DOWN); + 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); osSyncPrintf("C下sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + 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]); osSyncPrintf("C下sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); + 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 { osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + 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]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); + 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[IBTN_C_C_LEFT]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] != 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[IBTN_BC_C_RIGHT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] <= 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[IBTN_BC_C_LEFT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); + 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[IBTN_BC_C_LEFT] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT] = 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[IBTN_C_C_DOWN]) { - if (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] != 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[IBTN_BC_C_RIGHT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] <= 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[IBTN_BC_C_DOWN] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); + 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[IBTN_BC_C_DOWN] = ITEM_NONE; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN] = 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[IBTN_BC_C_RIGHT] == ITEM_BOW) || - ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT] <= 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[IBTN_BC_C_LEFT] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_LEFT); - } else if ((gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] >= ITEM_BOW_FIRE) && - (gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] <= ITEM_BOW_LIGHT)) { - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN] = - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]; - Interface_LoadItemIcon2(play, IBTN_BC_C_DOWN); + 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[IBTN_BC_C_RIGHT] = pauseCtx->equipTargetItem; - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT] = pauseCtx->equipTargetSlot; - Interface_LoadItemIcon1(play, IBTN_BC_C_RIGHT); + 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); osSyncPrintf("C右sl_item_no=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetItem, - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_LEFT], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_DOWN], - gSaveContext.save.info.equips.buttonItems[IBTN_BC_C_RIGHT]); + 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]); osSyncPrintf("C右sl_number=%d (1)=%d (2)=%d (3)=%d\n", pauseCtx->equipTargetSlot, - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_LEFT], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_DOWN], - gSaveContext.save.info.equips.cButtonSlots[IBTN_C_C_RIGHT]); + 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_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 91014a877e8..bad4d46cc99 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -506,10 +506,10 @@ void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { pauseCtx->cursorSpecialPos = PAUSE_CURSOR_PAGE_LEFT; } - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex + pt][1]; - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex + pt][2]; - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex + pt][3]; - gSaveContext.buttonStatus[IBTN_BCA_A] = D_8082AB6C[pauseCtx->pageIndex + pt][4]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex + pt][1]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex + pt][2]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex + pt][3]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = D_8082AB6C[pauseCtx->pageIndex + pt][4]; osSyncPrintf("kscope->kscp_pos+pt = %d\n", pauseCtx->pageIndex + pt); @@ -2049,9 +2049,9 @@ void KaleidoScope_InitVertices(PlayState* play, GraphicsContext* gfxCtx) { } } - for (phi_t3 = IBTN_BC_C_FIRST; phi_t3 <= IBTN_BC_C_LAST; phi_t3++, phi_t2 += 4) { - if (gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(phi_t3)] != ITEM_NONE) { - phi_t4 = gSaveContext.save.info.equips.cButtonSlots[IBTN_BC_TO_C(phi_t3)] * 4; + for (phi_t3 = INTERACT_BC_BTN_C_FIRST; phi_t3 <= INTERACT_BC_BTN_C_LAST; phi_t3++, phi_t2 += 4) { + if (gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(phi_t3)] != ITEM_NONE) { + phi_t4 = gSaveContext.save.info.equips.cButtonSlots[INTERACT_BC_BTN_TO_C_BTN(phi_t3)] * 4; pauseCtx->itemVtx[phi_t2 + 0].v.ob[0] = pauseCtx->itemVtx[phi_t2 + 2].v.ob[0] = pauseCtx->itemVtx[phi_t4].v.ob[0] - 2; @@ -2478,11 +2478,11 @@ void KaleidoScope_UpdateOpening(PlayState* play) { // Finished opening func_80084BF4(play, 1); - gSaveContext.buttonStatus[IBTN_BCA_B] = D_8082AB6C[pauseCtx->pageIndex][0]; - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex][1]; - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex][2]; - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex][3]; - gSaveContext.buttonStatus[IBTN_BCA_A] = D_8082AB6C[pauseCtx->pageIndex][4]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = D_8082AB6C[pauseCtx->pageIndex][0]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] = D_8082AB6C[pauseCtx->pageIndex][1]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = D_8082AB6C[pauseCtx->pageIndex][2]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = D_8082AB6C[pauseCtx->pageIndex][3]; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = D_8082AB6C[pauseCtx->pageIndex][4]; pauseCtx->pageIndex = D_8082ABEC[pauseCtx->mode]; pauseCtx->mainState = PAUSE_MAIN_STATE_IDLE; pauseCtx->state++; // PAUSE_STATE_MAIN @@ -2659,11 +2659,11 @@ void KaleidoScope_Update(PlayState* play) { switch (pauseCtx->state) { case PAUSE_STATE_INIT: - D_808321A8[0] = gSaveContext.buttonStatus[IBTN_BCA_B]; - D_808321A8[1] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT]; - D_808321A8[2] = gSaveContext.buttonStatus[IBTN_BCA_C_DOWN]; - D_808321A8[3] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT]; - D_808321A8[4] = gSaveContext.buttonStatus[IBTN_BCA_A]; + 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 = @@ -3077,10 +3077,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->unk_1EC = 0; @@ -3125,10 +3125,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->unk_1EC = 0; @@ -3176,10 +3176,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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[IBTN_BCA_A] = BTN_ENABLED; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED; gSaveContext.hudVisibilityMode = HUD_VISIBILITY_NO_CHANGE; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); pauseCtx->unk_1EC = 0; @@ -3212,9 +3212,9 @@ 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[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = 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->unk_1EC = 2; @@ -3238,8 +3238,8 @@ void KaleidoScope_Update(PlayState* play) { WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; func_800F64E0(0); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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); @@ -3250,8 +3250,8 @@ 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) || (--D_8082B25C == 0)) { Interface_SetDoAction(play, DO_ACTION_NONE); - gSaveContext.buttonStatus[IBTN_BCA_B] = gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = + 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); @@ -3652,11 +3652,11 @@ void KaleidoScope_Update(PlayState* play) { break; } - gSaveContext.buttonStatus[IBTN_BCA_B] = D_808321A8[0]; - gSaveContext.buttonStatus[IBTN_BCA_C_LEFT] = D_808321A8[1]; - gSaveContext.buttonStatus[IBTN_BCA_C_DOWN] = D_808321A8[2]; - gSaveContext.buttonStatus[IBTN_BCA_C_RIGHT] = D_808321A8[3]; - gSaveContext.buttonStatus[IBTN_BCA_A] = 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; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("i=%d LAST_TIME_TYPE=%d\n", i, gSaveContext.prevHudVisibilityMode); From 269cb924057e60813d63cce51acddfd85af27a2b Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 27 Sep 2023 16:56:34 +0200 Subject: [PATCH 11/13] run formatter --- src/code/z_game_over.c | 8 +- src/code/z_parameter.c | 90 +++++++++++-------- .../misc/ovl_kaleido_scope/z_kaleido_item.c | 15 ++-- .../ovl_kaleido_scope/z_kaleido_scope_PAL.c | 42 +++++---- 4 files changed, 92 insertions(+), 63 deletions(-) diff --git a/src/code/z_game_over.c b/src/code/z_game_over.c index a85f618ec02..c69e11300ce 100644 --- a/src/code/z_game_over.c +++ b/src/code/z_game_over.c @@ -54,7 +54,8 @@ void GameOver_Update(PlayState* play) { 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]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; } else { gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } @@ -69,8 +70,9 @@ void GameOver_Update(PlayState* play) { gSaveContext.eventInf[2] = 0; gSaveContext.eventInf[3] = 0; 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.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_parameter.c b/src/code/z_parameter.c index 3ab6e7efdc0..6a3dafbee95 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -655,15 +655,16 @@ void func_80083108(PlayState* play) { 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; + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_ENABLED; } 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]; + 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[INTERACT_BC_BTN_B] = ITEM_BOMBCHU; @@ -685,8 +686,9 @@ void func_80083108(PlayState* play) { } } - 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_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); } @@ -713,7 +715,8 @@ void func_80083108(PlayState* play) { gSaveContext.forceRisingButtonAlphas = 2; if (play->interfaceCtx.unk_260 != 0) { 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.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, INTERACT_BC_BTN_B); @@ -724,7 +727,8 @@ void func_80083108(PlayState* play) { Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_A_B_MINIMAP); } } 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.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[INTERACT_BC_BTN_B] != ITEM_NONE) { @@ -732,8 +736,8 @@ void func_80083108(PlayState* play) { } 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_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } else { if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == BTN_ENABLED) { @@ -741,8 +745,8 @@ void func_80083108(PlayState* play) { } 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_C_DOWN] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = BTN_DISABLED; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_ALL); } } else if (msgCtx->msgMode == MSGMODE_NONE) { @@ -1347,23 +1351,27 @@ void func_80084BF4(PlayState* play, u16 flag) { (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]; + 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[INTERACT_BC_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; Interface_LoadItemIcon1(play, INTERACT_BC_BTN_B); } } 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.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[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.buttonStatus[INTERACT_BCA_BTN_C_DOWN] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] = + BTN_ENABLED; func_80083108(play); } } @@ -2061,19 +2069,21 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { } void Inventory_UpdateBottleItem(PlayState* play, u8 item, u8 button) { - osSyncPrintf( - "item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, - 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)]]); + osSyncPrintf("item_no=%x, c_no=%x, Pt=%x Item_Register=%x\n", item, button, + 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[INTERACT_BC_BTN_TO_C_BTN(button)]] == + 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[INTERACT_BC_BTN_TO_C_BTN(button)]] = 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); @@ -2800,33 +2810,37 @@ void Interface_DrawItemButtons(PlayState* play) { 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(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); + 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(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); + 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(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); + 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(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); + 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)) { @@ -3352,7 +3366,8 @@ void Interface_Draw(PlayState* play) { 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 + INTERACT_BC_BTN_C_RIGHT * ITEM_ICON_SIZE, + 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, @@ -3514,7 +3529,8 @@ void Interface_Draw(PlayState* play) { (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]; + gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = + gSaveContext.buttonStatus[INTERACT_BCA_BTN_B]; } else { gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE; } 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 14af62f884a..b48904089f8 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -611,7 +611,8 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { 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[INTERACT_C_BTN_C_RIGHT]) { + } 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[INTERACT_BC_BTN_C_LEFT] == ITEM_BOW) || @@ -698,7 +699,8 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { 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[INTERACT_C_BTN_C_RIGHT]) { + } 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[INTERACT_BC_BTN_C_DOWN] == ITEM_BOW) || @@ -767,7 +769,8 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { if ((pauseCtx->equipTargetItem >= 0xBF) && (pauseCtx->equipTargetItem <= 0xC1) && ((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)))) { + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= + ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { @@ -781,12 +784,14 @@ void KaleidoScope_UpdateItemEquip(PlayState* play) { 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[INTERACT_C_BTN_C_DOWN]) { + } 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[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)))) { + (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] <= + ITEM_BOW_LIGHT)))) { pauseCtx->equipTargetItem -= 0xBF - ITEM_BOW_FIRE; pauseCtx->equipTargetSlot = SLOT_BOW; } else { diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index bad4d46cc99..e31114863c6 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -3077,9 +3077,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - 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_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); @@ -3125,9 +3126,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - 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_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); @@ -3176,9 +3178,10 @@ void KaleidoScope_Update(PlayState* play) { pauseCtx->promptChoice = 0; Audio_PlaySfxGeneral(NA_SE_SY_DECIDE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); - 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_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); @@ -3212,9 +3215,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[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.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->unk_1EC = 2; @@ -3238,9 +3242,10 @@ void KaleidoScope_Update(PlayState* play) { WREG(2) = -6240; YREG(8) = pauseCtx->unk_204; func_800F64E0(0); - 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.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); } @@ -3250,9 +3255,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) || (--D_8082B25C == 0)) { Interface_SetDoAction(play, DO_ACTION_NONE); - 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.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->unk_1EC = 5; From 41b4af11349071d9e9b6534302eda094eaace6f1 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Thu, 5 Sep 2024 12:17:43 +0200 Subject: [PATCH 12/13] bss --- src/code/fault_gc.c | 4 ++-- src/code/main.c | 2 +- src/code/z_camera.c | 2 +- src/code/z_message.c | 2 +- src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c | 4 ++-- src/overlays/actors/ovl_Fishing/z_fishing.c | 2 +- src/overlays/actors/ovl_player_actor/z_player.c | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index 0402573ad3c..d3e16ac59cd 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -42,8 +42,8 @@ */ #if PLATFORM_GC -#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-eu-mq-dbg:224 gc-jp:240 gc-jp-ce:240 gc-jp-mq:240 gc-us:240" \ - "gc-us-mq:240" +#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-eu-mq-dbg:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224" \ + "gc-us-mq:224" #include "global.h" #include "alloca.h" diff --git a/src/code/main.c b/src/code/main.c index 24877256358..ab274c40ea3 100644 --- a/src/code/main.c +++ b/src/code/main.c @@ -14,7 +14,7 @@ s32 gScreenWidth = SCREEN_WIDTH; s32 gScreenHeight = SCREEN_HEIGHT; u32 gSystemHeapSize = 0; -#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" +#pragma increment_block_number "gc-eu:208 gc-eu-mq:208 gc-jp:208 gc-jp-ce:208 gc-jp-mq:208 gc-us:208 gc-us-mq:208" PreNmiBuff* gAppNmiBufferPtr; Scheduler gScheduler; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index f368e964dea..41210ff4e4d 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -4,7 +4,7 @@ #include "terminal.h" #include "overlays/actors/ovl_En_Horse/z_en_horse.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" +#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" s16 Camera_RequestSettingImpl(Camera* camera, s16 requestedSetting, s16 flags); s32 Camera_RequestModeImpl(Camera* camera, s16 requestedMode, u8 forceModeChange); diff --git a/src/code/z_message.c b/src/code/z_message.c index 0f42e5e82f7..eff41c44c27 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -8,7 +8,7 @@ #include "n64dd.h" #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" +#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" #if PLATFORM_N64 #define OCARINA_BUTTON_A_PRIM_R 80 diff --git a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 17cb04f1749..9798fe510b9 100644 --- a/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -100,13 +100,13 @@ static ColliderCylinderInit sLightBallCylinderInit = { static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 }; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -#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" +#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" static EnGanonMant* sCape; // TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving // data around. It would be easier if we had more options for controlling BSS ordering in debug. -#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" +#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" static s32 sSeed1; static s32 sSeed2; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 63dc29fc144..2ce2676138e 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -14,7 +14,7 @@ #include "cic6105.h" #endif -#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:162 gc-jp-ce:162 gc-jp-mq:162 gc-us:162 gc-us-mq:162" +#pragma increment_block_number "gc-eu:151 gc-eu-mq:151 gc-jp:153 gc-jp-ce:153 gc-jp-mq:153 gc-us:153 gc-us-mq:153" #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 2fa265d54ba..c7bd00297bf 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -354,19 +354,19 @@ void Player_Action_CsAction(Player* this, PlayState* play); // .bss part 1 -#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq: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" static s32 D_80858AA0; // TODO: There's probably a way to match BSS ordering with less padding by spreading the variables out and moving // data around. It would be easier if we had more options for controlling BSS ordering in debug. -#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" +#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" static s32 D_80858AA4; static Vec3f sInteractWallCheckResult; static Input* sControlInput; -#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" +#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" // .data From acbfe3b2400fb809242ec36cfa0af362eb0197e0 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 11 Sep 2024 11:23:25 +0200 Subject: [PATCH 13/13] bss --- src/code/fault_gc.c | 4 ++-- src/code/z_kankyo.c | 4 ++-- src/overlays/actors/ovl_En_Xc/z_en_xc.c | 2 +- src/overlays/actors/ovl_Fishing/z_fishing.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/code/fault_gc.c b/src/code/fault_gc.c index ffed05048c7..12152f17a8c 100644 --- a/src/code/fault_gc.c +++ b/src/code/fault_gc.c @@ -42,8 +42,8 @@ */ #if PLATFORM_GC -#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-eu-mq-dbg:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224" \ - "gc-us-mq:224" +#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-eu-mq-dbg:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192" \ + "gc-us-mq:192" #include "global.h" #include "alloca.h" diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c index ea5bf967224..0f877ef7074 100644 --- a/src/code/z_kankyo.c +++ b/src/code/z_kankyo.c @@ -7,7 +7,7 @@ #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:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" +#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" typedef enum LightningBoltState { /* 0x00 */ LIGHTNING_BOLT_START, @@ -212,7 +212,7 @@ s16 sLightningFlashAlpha; s16 sSunDepthTestX; s16 sSunDepthTestY; -#pragma increment_block_number "gc-eu:112 gc-eu-mq:112 gc-jp:96 gc-jp-ce:96 gc-jp-mq:96 gc-us:96 gc-us-mq:96" +#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" LightNode* sNGameOverLightNode; LightInfo sNGameOverLightInfo; diff --git a/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 0671dfc6fac..89907ee1c63 100644 --- a/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -1395,7 +1395,7 @@ void func_80B3F3D8(void) { Sfx_PlaySfxCentered2(NA_SE_PL_SKIP); } -#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:128 gc-jp-ce:128 gc-jp-mq:64 gc-us:128 gc-us-mq:64" +#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64" void EnXc_PlayDiveSFX(Vec3f* src, PlayState* play) { static Vec3f D_80B42DA0; diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index 087e9dfc2ff..b0d71bd4683 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -15,7 +15,7 @@ #include "cic6105.h" #endif -#pragma increment_block_number "gc-eu:136 gc-eu-mq:136 gc-jp:138 gc-jp-ce:138 gc-jp-mq:138 gc-us:138 gc-us-mq:138" +#pragma increment_block_number "gc-eu:127 gc-eu-mq:127 gc-jp:129 gc-jp-ce:129 gc-jp-mq:129 gc-us:129 gc-us-mq:129" #define FLAGS ACTOR_FLAG_4