Switch to button macros

This commit is contained in:
PokeCodec
2020-09-04 21:11:55 -04:00
parent da582d5258
commit 28ef2fb774
75 changed files with 689 additions and 688 deletions

View File

@@ -2454,20 +2454,19 @@ static void UpdateHeldKeyCode(u16 key)
static u16 KeyInterCB_ReadButtons(u32 key)
{
if (gMain.heldKeys & DPAD_UP)
if (JOY_HELD(DPAD_UP))
return LINK_KEY_CODE_DPAD_UP;
else if (gMain.heldKeys & DPAD_DOWN)
if (JOY_HELD(DPAD_DOWN))
return LINK_KEY_CODE_DPAD_DOWN;
else if (gMain.heldKeys & DPAD_LEFT)
if (JOY_HELD(DPAD_LEFT))
return LINK_KEY_CODE_DPAD_LEFT;
else if (gMain.heldKeys & DPAD_RIGHT)
if (JOY_HELD(DPAD_RIGHT))
return LINK_KEY_CODE_DPAD_RIGHT;
else if (gMain.newKeys & START_BUTTON)
if (JOY_NEW(START_BUTTON))
return LINK_KEY_CODE_START_BUTTON;
else if (gMain.newKeys & A_BUTTON)
if (JOY_NEW(A_BUTTON))
return LINK_KEY_CODE_A_BUTTON;
else
return LINK_KEY_CODE_EMPTY;
return LINK_KEY_CODE_EMPTY;
}
static u16 GetDirectionForDpadKey(u16 a1)
@@ -2574,7 +2573,7 @@ static u16 sub_8087170(u32 keyOrPlayerId)
{
if (sPlayerTradingStates[keyOrPlayerId] == PLAYER_TRADING_STATE_UNK_2)
{
if (gMain.newKeys & B_BUTTON)
if (JOY_NEW(B_BUTTON))
{
SetKeyInterceptCallback(KeyInterCB_DoNothingAndKeepAlive);
return LINK_KEY_CODE_UNK_7;