Skip to content

Commit

Permalink
Merge pull request zeldaret#627 from Reinmmar/Inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
hytopoulos committed Aug 23, 2023
2 parents e57f2f3 + 03eacc3 commit 968c0ba
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/beanstalkSubtask.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void sub_08019764(void) {
UpdateEntities();
DrawEntities();
CopyOAM();
if ((--gUnk_02018EB0.unk_4 == 0) || ((gInput.newKeys & 10) != 0)) {
if ((--gUnk_02018EB0.unk_4 == 0) || ((gInput.newKeys & (B_BUTTON | START_BUTTON)) != 0)) {
gUnk_02018EB0.unk_0++;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/fileselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,16 +1146,16 @@ void sub_080610B8(void) {
uVar6 = 0;
tmp4 = 0;
switch (gInput.unk4) {
case 0x40:
case DPAD_UP:
tmp4 = -1;
break;
case 0x80:
case DPAD_DOWN:
tmp4 = 1;
break;
case 0x20:
case DPAD_LEFT:
uVar6 = -1;
break;
case 0x10:
case DPAD_RIGHT:
uVar6 = 1;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/manager/miscManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,6 @@ void MiscManager_TypeF(MiscManager* this) {
if (gPlayerEntity.action == PLAYER_TALKEZLO) {
DeleteThisEntity();
}
gInput.heldKeys |= 0x4;
gInput.heldKeys |= SELECT_BUTTON;
}
#endif
8 changes: 4 additions & 4 deletions src/manager/vaatiAppearingManager.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ void VaatiAppearingManager_Action2(VaatiAppearingManager* this) {
}

void VaatiAppearingManager_Action3(VaatiAppearingManager* this) {
if ((gInput.heldKeys & 0x40) != 0) {
if ((gInput.heldKeys & DPAD_UP) != 0) {
this->field_0x20--;
}
if ((gInput.heldKeys & 0x80) != 0) {
if ((gInput.heldKeys & DPAD_DOWN) != 0) {
this->field_0x20++;
}
if ((gInput.heldKeys & 0x20) != 0) {
if ((gInput.heldKeys & DPAD_LEFT) != 0) {
this->field_0x28--;
}
if ((gInput.heldKeys & 0x10) != 0) {
if ((gInput.heldKeys & DPAD_RIGHT) != 0) {
this->field_0x28++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/menu/pauseMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ void PauseMenu_ItemMenu_Update(void) {
}
case B_BUTTON:
if (gPauseMenu.items[menuSlot] != 0) {
u32 slot = !!(gInput.newKeys ^ 1);
u32 slot = !!(gInput.newKeys ^ A_BUTTON);
ForceEquipItem(gPauseMenu.items[menuSlot], slot);
SoundReq(SFX_TEXTBOX_SELECT);
}
Expand Down
12 changes: 6 additions & 6 deletions src/npc/phonograph.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ void sub_0806E964(PhonographEntity* this, ScriptExecutionContext* context) {
sub_0806EABC(this);
}

if (gInput.unk4 & 0xc0) {
if (gInput.unk4 & (DPAD_UP | DPAD_DOWN)) {
s32 val2, val3;
s32 val = this->unk_68;
if (gInput.unk4 & 0x40) {
if (gInput.unk4 & DPAD_UP) {
val++;
} else {
val--;
Expand Down Expand Up @@ -134,8 +134,8 @@ void sub_0806E964(PhonographEntity* this, ScriptExecutionContext* context) {
val2 = 0x34;
}
val = this->unk_68;
if (gInput.newKeys & 0xc0) {
if (gInput.newKeys & 0x40) {
if (gInput.newKeys & (DPAD_UP | DPAD_DOWN)) {
if (gInput.newKeys & DPAD_UP) {
val++;
} else {
val--;
Expand All @@ -148,8 +148,8 @@ void sub_0806E964(PhonographEntity* this, ScriptExecutionContext* context) {
if (val > val2) {
val = 1;
}
} else if (gInput.unk4 & 0xc0) {
if (gInput.unk4 & 0x40) {
} else if (gInput.unk4 & (DPAD_UP | DPAD_DOWN)) {
if (gInput.unk4 & DPAD_UP) {
val++;
} else {
val--;
Expand Down
2 changes: 1 addition & 1 deletion src/playerItem/playerItemCellOverwriteSet.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void PlayerItemCellOverwriteSet(PlayerItemCellOverwriteSetEntity* this) {
gPlayerState.mobility |= 0x80;
tmp = gInput.heldKeys & R_BUTTON;
if ((gInput.heldKeys & A_BUTTON) != 0) {
if ((R_BUTTON & gInput.newKeys) != 0) {
if ((gInput.newKeys & R_BUTTON) != 0) {
this->tileType = GetTileType(TILE(player->x.HALF.HI + gUnk_080B7B6C[player->animationState & 0xe],
player->y.HALF.HI + gUnk_080B7B6C[(player->animationState & 0xe) + 1]),
super->collisionLayer);
Expand Down
8 changes: 4 additions & 4 deletions src/staffroll.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ void StaffrollTask_State2(void) {
} else {
choice = gStaffrollMenu.base.field_0x3;
switch (gInput.newKeys) {
case 0x40:
case DPAD_UP:
choice = 0;
break;
case 0x80:
case DPAD_DOWN:
choice = 1;
break;
case 1:
case A_BUTTON:
if (choice != 0) {
tmp = 4;
} else {
Expand Down Expand Up @@ -313,7 +313,7 @@ void StaffrollTask_State2(void) {
if (gStaffrollMenu.base.transitionTimer != 0) {
gStaffrollMenu.base.transitionTimer--;
} else {
if ((gInput.newKeys & 0xb) != 0) {
if ((gInput.newKeys & (A_BUTTON | B_BUTTON | START_BUTTON)) != 0) {
gStaffrollMenu.base.overlayType = 1;
}
}
Expand Down

0 comments on commit 968c0ba

Please sign in to comment.