Re-apply joypad macros (minus merge conflicts)

This commit is contained in:
aaaaaa123456789
2020-11-02 22:02:39 -03:00
parent 6545745e59
commit bacc831aa9
71 changed files with 651 additions and 648 deletions

View File

@@ -981,23 +981,23 @@ u8 Menu_GetCursorPos(void)
s8 Menu_ProcessInput(void)
{
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
else if (JOY_NEW(DPAD_UP))
{
PlaySE(SE_SELECT);
Menu_MoveCursor(-1);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
else if (JOY_NEW(DPAD_DOWN))
{
PlaySE(SE_SELECT);
Menu_MoveCursor(1);
@@ -1011,23 +1011,23 @@ s8 Menu_ProcessInputNoWrap(void)
{
u8 oldPos = sMenu.cursorPos;
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
else if (JOY_NEW(DPAD_UP))
{
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
else if (JOY_NEW(DPAD_DOWN))
{
if (oldPos != Menu_MoveCursorNoWrapAround(1))
PlaySE(SE_SELECT);
@@ -1039,23 +1039,23 @@ s8 Menu_ProcessInputNoWrap(void)
s8 ProcessMenuInput_other(void)
{
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(-1);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(1);
@@ -1407,34 +1407,34 @@ u8 ChangeGridMenuCursorPosition(s8 deltaX, s8 deltaY)
s8 sub_8199284(void)
{
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
else if (JOY_NEW(DPAD_UP))
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
else if (JOY_NEW(DPAD_DOWN))
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
@@ -1448,34 +1448,34 @@ s8 Menu_ProcessInputGridLayout(void)
{
u8 oldPos = sMenu.cursorPos;
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if (gMain.newKeys & DPAD_UP)
else if (JOY_NEW(DPAD_UP))
{
if (oldPos != ChangeGridMenuCursorPosition(0, -1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_DOWN)
else if (JOY_NEW(DPAD_DOWN))
{
if (oldPos != ChangeGridMenuCursorPosition(0, 1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(-1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(1, 0))
PlaySE(SE_SELECT);
@@ -1487,34 +1487,34 @@ s8 Menu_ProcessInputGridLayout(void)
s8 sub_81993D8(void)
{
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
@@ -1529,34 +1529,34 @@ s8 sub_8199484(void)
{
u8 oldPos = sMenu.cursorPos;
if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
else if (gMain.newKeys & B_BUTTON)
else if (JOY_NEW(B_BUTTON))
{
return MENU_B_PRESSED;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_UP)
{
if (oldPos != ChangeGridMenuCursorPosition(0, -1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_DOWN)
{
if (oldPos != ChangeGridMenuCursorPosition(0, 1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(-1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
else if ((JOY_REPEAT(DPAD_ANY)) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(1, 0))
PlaySE(SE_SELECT);