From 3746efb9c243f2c7df2ff5f0f420218fd6e4396e Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Thu, 3 Sep 2020 11:52:17 -0400 Subject: [PATCH] Use PokeNav macros --- src/pokenav_main_menu.c | 7 ++++--- src/pokenav_ribbons_2.c | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index cdaa0b3d68..f2b9b0dcca 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -436,9 +436,10 @@ static u32 LoopedTask_ScrollMenuHeaderUp(s32 a0) if (ChangeBgY(0, 384, 2) <= 0) { ChangeBgY(0, 0, 0); - return 4; + return LT_FINISH; } - return 2; + + return LT_PAUSE; } void CopyPaletteIntoBufferUnfaded(const u16 *palette, u32 bufferOffset, u32 size) @@ -494,7 +495,7 @@ void sub_81C79BC(const u16 *a0, const u16 *a1, int a2, int a3, int a4, u16 *pale g1 = ((((GET_G(*a1) << 8) - (g << 8)) / a3) * a4) >> 8; b1 = ((((GET_B(*a1) << 8) - (b << 8)) / a3) * a4) >> 8; - r = (r + r1) & 0x1F; //_RGB(r + r1, g + g1, b + b1); doesn't match; I have to assign the value of (r + r1 & 0x1F) + r = (r + r1) & 0x1F; //_RGB(r + r1, g + g1, b + b1); doesn't match; I have to assign the value of ((r + r1) & 0x1F) to r1 g = (g + g1) & 0x1F; //See above b = (b + b1) & 0x1F; //See above diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c index e5a89acad3..9717acbac1 100644 --- a/src/pokenav_ribbons_2.c +++ b/src/pokenav_ribbons_2.c @@ -195,19 +195,19 @@ u32 sub_81D04C4(struct PokenavSub13 *structPtr) sub_81D0814(structPtr); return 1; } - else if (gMain.newAndRepeatedKeys & DPAD_DOWN && structPtr->field_8->unk2 < structPtr->field_8->unk0 - 1) + if (gMain.newAndRepeatedKeys & DPAD_DOWN && structPtr->field_8->unk2 < structPtr->field_8->unk0 - 1) { structPtr->field_8->unk2++; structPtr->field_C = 0; sub_81D0814(structPtr); return 1; } - else if (gMain.newKeys & A_BUTTON) + if (gMain.newKeys & A_BUTTON) { structPtr->field_98 = sub_81D0548; return 2; } - else if (gMain.newKeys & B_BUTTON) + if (gMain.newKeys & B_BUTTON) { structPtr->field_98 = sub_81D05D4; return 5; @@ -219,13 +219,13 @@ u32 sub_81D0548(struct PokenavSub13 *structPtr) { if (gMain.newAndRepeatedKeys & DPAD_UP && sub_81D05DC(structPtr)) return 3; - else if (gMain.newAndRepeatedKeys & DPAD_DOWN && sub_81D061C(structPtr)) + if (gMain.newAndRepeatedKeys & DPAD_DOWN && sub_81D061C(structPtr)) return 3; - else if (gMain.newAndRepeatedKeys & DPAD_LEFT && sub_81D0664(structPtr)) + if (gMain.newAndRepeatedKeys & DPAD_LEFT && sub_81D0664(structPtr)) return 3; - else if (gMain.newAndRepeatedKeys & DPAD_RIGHT && sub_81D0688(structPtr)) + if (gMain.newAndRepeatedKeys & DPAD_RIGHT && sub_81D0688(structPtr)) return 3; - else if (gMain.newKeys & B_BUTTON) + if (gMain.newKeys & B_BUTTON) { structPtr->field_98 = sub_81D04C4; return 4;