diff options
author | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-04 21:11:55 -0400 |
---|---|---|
committer | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-04 21:11:55 -0400 |
commit | 28ef2fb774bf596a3e7f81055453304e0d2ce066 (patch) | |
tree | 4a67ad17888cac15c7cb33fa8aced60a2e3bf6dc /src/overworld.c | |
parent | da582d5258703eb52d8cadb4cbaef4ee7031b833 (diff) |
Switch to button macros
Diffstat (limited to 'src/overworld.c')
-rw-r--r-- | src/overworld.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/overworld.c b/src/overworld.c index d18e3d3bc..2d798f2ec 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -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; |