Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "interact button" enums: C, BC, BCA #1228

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
39d48bb
IBTN_
Dragorn421 Oct 12, 2022
1fbd18c
format
Dragorn421 Oct 12, 2022
1ada65c
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Oct 15, 2022
204a5a9
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Oct 24, 2022
196b376
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Nov 14, 2022
7deffb6
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Nov 16, 2022
d82b8b1
format
Dragorn421 Nov 16, 2022
fdcbffb
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Nov 17, 2022
1282860
More `iconItemSegment` cleanup
Dragorn421 Nov 17, 2022
8c18464
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Nov 23, 2022
d8a2dc3
revert formatting macros.h
Dragorn421 Nov 23, 2022
a373328
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Nov 30, 2022
64f3b43
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Dec 11, 2022
d1b0a33
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Dec 13, 2022
576b045
a bit more `ibtn_bc_` usage
Dragorn421 Dec 13, 2022
88fcd61
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Dec 19, 2022
13e4df8
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Dec 30, 2022
6fe01ef
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Jan 13, 2023
e6e22ae
Merge branch 'master' (early part) into doc_button_indices_in_save_st…
Dragorn421 Aug 15, 2023
8b126a9
Merge branch 'master' (early part) into doc_button_indices_in_save_st…
Dragorn421 Aug 15, 2023
0bc99f6
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Aug 15, 2023
28bd807
format and fix whitespace
Dragorn421 Aug 15, 2023
283d654
format two macros
Dragorn421 Aug 15, 2023
729972a
Merge branch 'master' into doc_button_indices_in_save_structs
Dragorn421 Sep 19, 2023
1a037a9
format
Dragorn421 Sep 19, 2023
e9b49ef
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 27, 2023
584b1bc
IBTN_x_ -> INTERACT_x_BTN_
Dragorn421 Sep 27, 2023
269cb92
run formatter
Dragorn421 Sep 27, 2023
7310c2d
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Oct 15, 2023
e624269
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Jan 28, 2024
ffff48e
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 4, 2024
85a1751
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 5, 2024
41b4af1
bss
Dragorn421 Sep 5, 2024
658716d
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 11, 2024
acbfe3b
bss
Dragorn421 Sep 11, 2024
0314816
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 18, 2024
cc17a8f
Merge branch 'main' into doc_button_indices_in_save_structs
Dragorn421 Sep 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 45 additions & 11 deletions include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,42 @@ typedef enum MagicChangeType {
#define MAGIC_NORMAL_METER 0x30
#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER)

typedef enum {
/* 0 */ INTERACT_BC_BTN_B,
/* 1 */ INTERACT_BC_BTN_C_LEFT,
/* 2 */ INTERACT_BC_BTN_C_DOWN,
/* 3 */ INTERACT_BC_BTN_C_RIGHT,
/* 4 */ INTERACT_BC_BTN_MAX
} InteractBCButton;

#define INTERACT_BC_BTN_C_FIRST INTERACT_BC_BTN_C_LEFT
#define INTERACT_BC_BTN_C_LAST INTERACT_BC_BTN_C_RIGHT

typedef enum {
/* 0 */ INTERACT_C_BTN_C_LEFT,
/* 1 */ INTERACT_C_BTN_C_DOWN,
/* 2 */ INTERACT_C_BTN_C_RIGHT,
/* 3 */ INTERACT_C_BTN_MAX
} InteractCButton;

#define INTERACT_C_BTN_TO_BC_BTN(btnsC) ((btnsC) + 1)
#define INTERACT_BC_BTN_TO_C_BTN(btnsBC) ((btnsBC) - 1)

typedef enum {
/* 0 */ INTERACT_BCA_BTN_B,
/* 1 */ INTERACT_BCA_BTN_C_LEFT,
/* 2 */ INTERACT_BCA_BTN_C_DOWN,
/* 3 */ INTERACT_BCA_BTN_C_RIGHT,
/* 4 */ INTERACT_BCA_BTN_A,
/* 5 */ INTERACT_BCA_BTN_MAX
} InteractBCAButton;

#define INTERACT_C_BTN_TO_BCA_BTN(btnsC) ((btnsC) + 1)
#define INTERACT_BC_BTN_TO_BCA_BTN(btnsBC) (btnsBC)

typedef struct ItemEquips {
/* 0x00 */ u8 buttonItems[4];
/* 0x04 */ u8 cButtonSlots[3];
/* 0x00 */ u8 buttonItems[INTERACT_BC_BTN_MAX];
/* 0x04 */ u8 cButtonSlots[INTERACT_C_BTN_MAX];
/* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*`
} ItemEquips; // size = 0x0A

Expand Down Expand Up @@ -295,7 +328,7 @@ typedef struct SaveContext {
/* 0x13DE */ char unk_13DE[0x0002];
/* 0x13E0 */ u8 seqId;
/* 0x13E1 */ u8 natureAmbienceId;
/* 0x13E2 */ u8 buttonStatus[5];
/* 0x13E2 */ u8 buttonStatus[INTERACT_BCA_BTN_MAX];
/* 0x13E7 */ u8 forceRisingButtonAlphas; // if btn alphas are updated through Interface_DimButtonAlphas, instead update them through Interface_RaiseButtonAlphas
/* 0x13E8 */ u16 nextHudVisibilityMode; // triggers the hud to change visibility mode to the requested value. Reset to HUD_VISIBILITY_NO_CHANGE when target is reached
/* 0x13EA */ u16 hudVisibilityMode; // current hud visibility mode
Expand Down Expand Up @@ -442,15 +475,16 @@ typedef enum LinkAge {

#define HIGH_SCORE(score) (gSaveContext.save.info.highScores[score])

#define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \
? ITEM_NONE \
: (gSaveContext.save.info.equips.buttonItems[0] == ITEM_GIANTS_KNIFE) \
? ITEM_SWORD_BIGGORON \
: gSaveContext.save.info.equips.buttonItems[0])
#define B_BTN_ITEM \
((gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] == ITEM_NONE) ? ITEM_NONE \
: (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] == ITEM_GIANTS_KNIFE) \
? ITEM_SWORD_BIGGORON \
: gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B])

#define C_BTN_ITEM(button) ((gSaveContext.buttonStatus[(button) + 1] != BTN_DISABLED) \
? gSaveContext.save.info.equips.buttonItems[(button) + 1] \
: ITEM_NONE)
#define C_BTN_ITEM(button) \
((gSaveContext.buttonStatus[INTERACT_C_BTN_TO_BCA_BTN(button)] != BTN_DISABLED) \
? gSaveContext.save.info.equips.buttonItems[INTERACT_C_BTN_TO_BC_BTN(button)] \
: ITEM_NONE)


/*
Expand Down
2 changes: 1 addition & 1 deletion src/boot/z_std_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:106"
"ntsc-1.2:98"

StackEntry sDmaMgrStackInfo;
OSMesgQueue sDmaMgrMsgQueue;
Expand Down
2 changes: 1 addition & 1 deletion src/code/code_80097A00.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) {
}

if (equipment == EQUIP_TYPE_SWORD) {
gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE;
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE;
gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ extern struct IrqMgr gIrqMgr;
#include "n64dd.h"
#endif

#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
"ntsc-1.2:164"
#pragma increment_block_number "gc-eu:160 gc-eu-mq:160 gc-jp:160 gc-jp-ce:160 gc-jp-mq:160 gc-us:160 gc-us-mq:160" \
"ntsc-1.2:155"

extern u8 _buffersSegmentEnd[];

Expand Down
2 changes: 1 addition & 1 deletion src/code/z_bgcheck.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "global.h"
#include "terminal.h"

#pragma increment_block_number "ntsc-1.2:152"
#pragma increment_block_number "ntsc-1.2:144"

u16 DynaSSNodeList_GetNextNodeIdx(DynaSSNodeList* nodeList);
void BgCheck_GetStaticLookupIndicesFromPos(CollisionContext* colCtx, Vec3f* pos, Vec3i* sector);
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,7 @@ s32 Camera_KeepOn3(Camera* camera) {
}

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:108"
"ntsc-1.2:99"

s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_collision_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"

#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:224"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:208"

typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_common_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "versions.h"

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:224"
"ntsc-1.2:208"

ALIGNED(16) SaveContext gSaveContext;
u32 D_8015FA88;
Expand Down
115 changes: 58 additions & 57 deletions src/code/z_construct.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ void Interface_Destroy(PlayState* play) {
Map_Destroy(play);
}

#define ICON_ITEM_SEGMENT_SIZE (4 * ITEM_ICON_SIZE)
#define ICON_ITEM_SEGMENT_SIZE (INTERACT_BC_BTN_MAX * ITEM_ICON_SIZE)

void Interface_Init(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
Expand Down Expand Up @@ -97,38 +97,39 @@ void Interface_Init(PlayState* play) {

ASSERT(interfaceCtx->iconItemSegment != NULL, "parameter->icon_itemSegment != NULL", "../z_construct.c", 193);

PRINTF("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[0],
gSaveContext.save.info.equips.buttonItems[1], gSaveContext.save.info.equips.buttonItems[2],
gSaveContext.save.info.equips.buttonItems[3]);
PRINTF("Register_Item[%x, %x, %x, %x]\n", gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B],
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT],
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN],
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]);

if (gSaveContext.save.info.equips.buttonItems[0] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE),
if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE),

GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE,
"../z_construct.c", 198);
} else if (gSaveContext.save.info.equips.buttonItems[0] != 0xFF) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (0 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]),
ITEM_ICON_SIZE, "../z_construct.c", 198);
} else if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != 0xFF) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_B * ITEM_ICON_SIZE),

GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[0]), ITEM_ICON_SIZE,
"../z_construct.c", 203);
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B]),
ITEM_ICON_SIZE, "../z_construct.c", 203);
}

if (gSaveContext.save.info.equips.buttonItems[1] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (1 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[1]), ITEM_ICON_SIZE,
"../z_construct.c", 209);
if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_LEFT * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_LEFT]),
ITEM_ICON_SIZE, "../z_construct.c", 209);
}

if (gSaveContext.save.info.equips.buttonItems[2] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (2 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[2]), ITEM_ICON_SIZE,
"../z_construct.c", 214);
if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_DOWN * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_DOWN]),
ITEM_ICON_SIZE, "../z_construct.c", 214);
}

if (gSaveContext.save.info.equips.buttonItems[3] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (3 * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[3]), ITEM_ICON_SIZE,
"../z_construct.c", 219);
if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT] < 0xF0) {
DMA_REQUEST_SYNC(interfaceCtx->iconItemSegment + (INTERACT_BC_BTN_C_RIGHT * ITEM_ICON_SIZE),
GET_ITEM_ICON_VROM(gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_C_RIGHT]),
ITEM_ICON_SIZE, "../z_construct.c", 219);
}

PRINTF("EVENT=%d\n", ((void)0, gSaveContext.timerState));
Expand Down Expand Up @@ -177,14 +178,14 @@ void Interface_Init(PlayState* play) {

interfaceCtx->unk_23C = interfaceCtx->unk_242 = 0;

R_ITEM_BTN_X(0) = B_BUTTON_X;
R_ITEM_BTN_X(INTERACT_BC_BTN_B) = B_BUTTON_X;

R_B_BTN_COLOR(0) = B_BUTTON_R;
R_B_BTN_COLOR(1) = B_BUTTON_G;
R_B_BTN_COLOR(2) = B_BUTTON_B;

R_ITEM_ICON_X(0) = B_BUTTON_X;
R_ITEM_AMMO_X(0) = B_BUTTON_X + 2;
R_ITEM_ICON_X(INTERACT_BC_BTN_B) = B_BUTTON_X;
R_ITEM_AMMO_X(INTERACT_BC_BTN_B) = B_BUTTON_X + 2;

R_A_BTN_X = A_BUTTON_X;
R_A_ICON_X = A_BUTTON_X;
Expand Down Expand Up @@ -381,28 +382,28 @@ void Regs_InitDataImpl(void) {

ZREG(65) = 21;
ZREG(66) = 122;
R_ITEM_BTN_X(1) = C_LEFT_BUTTON_X;
R_ITEM_BTN_X(2) = C_DOWN_BUTTON_X;
R_ITEM_BTN_X(3) = C_RIGHT_BUTTON_X;
R_ITEM_BTN_Y(0) = B_BUTTON_Y;
R_ITEM_BTN_Y(1) = C_LEFT_BUTTON_Y;
R_ITEM_BTN_Y(2) = C_DOWN_BUTTON_Y;
R_ITEM_BTN_Y(3) = C_RIGHT_BUTTON_Y;
R_ITEM_BTN_DD(0) = 575;
R_ITEM_BTN_DD(1) = 620;
R_ITEM_BTN_DD(2) = 620;
R_ITEM_BTN_DD(3) = 620;
R_ITEM_ICON_X(1) = C_LEFT_BUTTON_X;
R_ITEM_ICON_X(2) = C_DOWN_BUTTON_X;
R_ITEM_ICON_X(3) = C_RIGHT_BUTTON_X;
R_ITEM_ICON_Y(0) = B_BUTTON_Y;
R_ITEM_ICON_Y(1) = C_LEFT_BUTTON_Y;
R_ITEM_ICON_Y(2) = C_DOWN_BUTTON_Y;
R_ITEM_ICON_Y(3) = C_RIGHT_BUTTON_Y;
R_ITEM_ICON_DD(0) = 550;
R_ITEM_ICON_DD(1) = 680;
R_ITEM_ICON_DD(2) = 680;
R_ITEM_ICON_DD(3) = 680;
R_ITEM_BTN_X(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_X;
R_ITEM_BTN_X(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_X;
R_ITEM_BTN_X(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_X;
R_ITEM_BTN_Y(INTERACT_BC_BTN_B) = B_BUTTON_Y;
R_ITEM_BTN_Y(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_Y;
R_ITEM_BTN_Y(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_Y;
R_ITEM_BTN_Y(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_Y;
R_ITEM_BTN_DD(INTERACT_BC_BTN_B) = 575;
R_ITEM_BTN_DD(INTERACT_BC_BTN_C_LEFT) = 620;
R_ITEM_BTN_DD(INTERACT_BC_BTN_C_DOWN) = 620;
R_ITEM_BTN_DD(INTERACT_BC_BTN_C_RIGHT) = 620;
R_ITEM_ICON_X(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_X;
R_ITEM_ICON_X(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_X;
R_ITEM_ICON_X(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_X;
R_ITEM_ICON_Y(INTERACT_BC_BTN_B) = B_BUTTON_Y;
R_ITEM_ICON_Y(INTERACT_BC_BTN_C_LEFT) = C_LEFT_BUTTON_Y;
R_ITEM_ICON_Y(INTERACT_BC_BTN_C_DOWN) = C_DOWN_BUTTON_Y;
R_ITEM_ICON_Y(INTERACT_BC_BTN_C_RIGHT) = C_RIGHT_BUTTON_Y;
R_ITEM_ICON_DD(INTERACT_BC_BTN_B) = 550;
R_ITEM_ICON_DD(INTERACT_BC_BTN_C_LEFT) = 680;
R_ITEM_ICON_DD(INTERACT_BC_BTN_C_DOWN) = 680;
R_ITEM_ICON_DD(INTERACT_BC_BTN_C_RIGHT) = 680;
ZREG(94) = 1;
ZREG(95) = 0;
XREG(0) = 26;
Expand Down Expand Up @@ -665,14 +666,14 @@ void Regs_InitDataImpl(void) {
VREG(73) = 0;
VREG(74) = 0;
VREG(75) = 0;
R_ITEM_ICON_WIDTH(0) = 30;
R_ITEM_ICON_WIDTH(1) = 24;
R_ITEM_ICON_WIDTH(2) = 24;
R_ITEM_ICON_WIDTH(3) = 24;
R_ITEM_BTN_WIDTH(0) = 29;
R_ITEM_BTN_WIDTH(1) = 27;
R_ITEM_BTN_WIDTH(2) = 27;
R_ITEM_BTN_WIDTH(3) = 27;
R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_B) = 30;
R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_LEFT) = 24;
R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_DOWN) = 24;
R_ITEM_ICON_WIDTH(INTERACT_BC_BTN_C_RIGHT) = 24;
R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_B) = 29;
R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_LEFT) = 27;
R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_DOWN) = 27;
R_ITEM_BTN_WIDTH(INTERACT_BC_BTN_C_RIGHT) = 27;
VREG(84) = 0;
VREG(85) = 50;
VREG(86) = 0;
Expand Down
25 changes: 14 additions & 11 deletions src/code/z_game_over.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void GameOver_Update(PlayState* play) {
INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i];

// search c buttons for the found spoiling item and revert if necessary
for (j = 1; j < ARRAY_COUNT(gSaveContext.save.info.equips.buttonItems); j++) {
for (j = INTERACT_BC_BTN_C_FIRST; j <= INTERACT_BC_BTN_C_LAST; j++) {
if (gSaveContext.save.info.equips.buttonItems[j] == gSpoilingItems[i]) {
gSaveContext.save.info.equips.buttonItems[j] = gSpoilingItemReverts[i];
Interface_LoadItemIcon1(play, j);
Expand All @@ -50,15 +50,16 @@ void GameOver_Update(PlayState* play) {
}

// restore "temporary B" to the B Button if not a sword item
if (gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_KOKIRI &&
gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_MASTER &&
gSaveContext.save.info.equips.buttonItems[0] != ITEM_SWORD_BIGGORON &&
gSaveContext.save.info.equips.buttonItems[0] != ITEM_GIANTS_KNIFE) {

if (gSaveContext.buttonStatus[0] != BTN_ENABLED) {
gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0];
if (gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_KOKIRI &&
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_MASTER &&
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_SWORD_BIGGORON &&
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] != ITEM_GIANTS_KNIFE) {

if (gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] != BTN_ENABLED) {
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] =
gSaveContext.buttonStatus[INTERACT_BCA_BTN_B];
} else {
gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE;
gSaveContext.save.info.equips.buttonItems[INTERACT_BC_BTN_B] = ITEM_NONE;
}
}

Expand All @@ -75,8 +76,10 @@ void GameOver_Update(PlayState* play) {
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;
gSaveContext.eventInf[3] = 0;
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.buttonStatus[INTERACT_BCA_BTN_B] = gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_LEFT] =
gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_DOWN] =
gSaveContext.buttonStatus[INTERACT_BCA_BTN_C_RIGHT] =
gSaveContext.buttonStatus[INTERACT_BCA_BTN_A] = BTN_ENABLED;
gSaveContext.forceRisingButtonAlphas = gSaveContext.nextHudVisibilityMode = gSaveContext.hudVisibilityMode =
gSaveContext.hudVisibilityModeTimer = 0; // false, HUD_VISIBILITY_NO_CHANGE

Expand Down
6 changes: 3 additions & 3 deletions src/code/z_kaleido_scope_call.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma increment_block_number "gc-eu:224 gc-eu-mq:224 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
"ntsc-1.2:0"

#include "global.h"
#include "terminal.h"

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:128"

void (*sKaleidoScopeUpdateFunc)(PlayState* play);
void (*sKaleidoScopeDrawFunc)(PlayState* play);
f32 gBossMarkScale;
Expand Down
9 changes: 5 additions & 4 deletions src/code/z_kankyo.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#pragma increment_block_number "gc-eu:248 gc-eu-mq:248 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
"ntsc-1.2:0"

#include "global.h"
#include "ultra64.h"
#include "terminal.h"
Expand All @@ -7,8 +10,6 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"

typedef enum LightningBoltState {
/* 0x00 */ LIGHTNING_BOLT_START,
/* 0x01 */ LIGHTNING_BOLT_WAIT,
Expand Down Expand Up @@ -212,8 +213,8 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;

#pragma increment_block_number "gc-eu:112 gc-eu-mq:112 gc-jp:216 gc-jp-ce:216 gc-jp-mq:216 gc-us:216 gc-us-mq:216" \
"ntsc-1.2:224"
#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:224 gc-jp-ce:224 gc-jp-mq:224 gc-us:224 gc-us-mq:224" \
"ntsc-1.2:216"

LightNode* sNGameOverLightNode;
LightInfo sNGameOverLightInfo;
Expand Down
Loading