From 28ef2fb774bf596a3e7f81055453304e0d2ce066 Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Fri, 4 Sep 2020 21:11:55 -0400 Subject: Switch to button macros --- src/easy_chat.c | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/easy_chat.c') diff --git a/src/easy_chat.c b/src/easy_chat.c index 8e1044591..0ec4d32fd 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1523,7 +1523,7 @@ static u16 sub_811AB68(void) { do { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { sub_811BF78(); sEasyChatScreen->state = 2; @@ -1532,30 +1532,30 @@ static u16 sub_811AB68(void) sEasyChatScreen->unk_0c = 0; return 9; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { return sub_811B150(); } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { return sub_811B1B4(); } - else if (gMain.newKeys & DPAD_UP) + else if (JOY_NEW(DPAD_UP)) { sEasyChatScreen->mainCursorRow--; break; } - else if (gMain.newKeys & DPAD_LEFT) + else if (JOY_NEW(DPAD_LEFT)) { sEasyChatScreen->mainCursorColumn--; break; } - else if (gMain.newKeys & DPAD_DOWN) + else if (JOY_NEW(DPAD_DOWN)) { sEasyChatScreen->mainCursorRow++; break; } - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { sEasyChatScreen->mainCursorColumn++; break; @@ -1595,7 +1595,7 @@ static u16 sub_811ACDC(void) { do { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { switch (sEasyChatScreen->mainCursorColumn) { @@ -1610,30 +1610,30 @@ static u16 sub_811ACDC(void) } } - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) { return sub_811B150(); } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { return sub_811B1B4(); } - else if (gMain.newKeys & DPAD_UP) + else if (JOY_NEW(DPAD_UP)) { sEasyChatScreen->mainCursorRow--; break; } - else if (gMain.newKeys & DPAD_LEFT) + else if (JOY_NEW(DPAD_LEFT)) { sEasyChatScreen->mainCursorColumn--; break; } - else if (gMain.newKeys & DPAD_DOWN) + else if (JOY_NEW(DPAD_DOWN)) { sEasyChatScreen->mainCursorRow = 0; break; } - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { sEasyChatScreen->mainCursorColumn++; break; @@ -1666,10 +1666,10 @@ static u16 sub_811ACDC(void) static u16 sub_811AE44(void) { - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) return sub_811B32C(); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { if (sEasyChatScreen->unk_0a != -1) return sub_811B2B0(); @@ -1685,19 +1685,19 @@ static u16 sub_811AE44(void) } } - if (gMain.newKeys & SELECT_BUTTON) + if (JOY_NEW(SELECT_BUTTON)) return sub_811B33C(); - if (gMain.newAndRepeatedKeys & DPAD_UP) + if (JOY_REPEAT(DPAD_UP)) return sub_811B528(2); - if (gMain.newAndRepeatedKeys & DPAD_DOWN) + if (JOY_REPEAT(DPAD_DOWN)) return sub_811B528(3); - if (gMain.newAndRepeatedKeys & DPAD_LEFT) + if (JOY_REPEAT(DPAD_LEFT)) return sub_811B528(1); - if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + if (JOY_REPEAT(DPAD_RIGHT)) return sub_811B528(0); return 0; @@ -1705,31 +1705,31 @@ static u16 sub_811AE44(void) static u16 sub_811AF00(void) { - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) { sEasyChatScreen->state = 2; return 14; } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) return sub_811B394(); - if (gMain.newKeys & START_BUTTON) + if (JOY_NEW(START_BUTTON)) return sub_811B794(4); - if (gMain.newKeys & SELECT_BUTTON) + if (JOY_NEW(SELECT_BUTTON)) return sub_811B794(5); - if (gMain.newAndRepeatedKeys & DPAD_UP) + if (JOY_REPEAT(DPAD_UP)) return sub_811B794(2); - if (gMain.newAndRepeatedKeys & DPAD_DOWN) + if (JOY_REPEAT(DPAD_DOWN)) return sub_811B794(3); - if (gMain.newAndRepeatedKeys & DPAD_LEFT) + if (JOY_REPEAT(DPAD_LEFT)) return sub_811B794(1); - if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + if (JOY_REPEAT(DPAD_RIGHT)) return sub_811B794(0); return 0; @@ -1794,10 +1794,10 @@ static u16 sub_811B040(void) static u16 sub_811B08C(void) { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) return 26; - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) return sub_811B150(); return 0; @@ -1805,7 +1805,7 @@ static u16 sub_811B08C(void) static u16 sub_811B0BC(void) { - if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + if (JOY_NEW(A_BUTTON | B_BUTTON)) { sEasyChatScreen->state = sub_811B2A4(); return 7; -- cgit v1.2.3 From 3e25d9e5a2e0346a53b1bfdf9e14f98e14cceb21 Mon Sep 17 00:00:00 2001 From: PokeCodec <67983839+PokeCodec@users.noreply.github.com> Date: Sat, 5 Sep 2020 10:01:21 -0400 Subject: Removed unused parentheses --- src/easy_chat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/easy_chat.c') diff --git a/src/easy_chat.c b/src/easy_chat.c index 0ec4d32fd..e08f0bb75 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1614,26 +1614,26 @@ static u16 sub_811ACDC(void) { return sub_811B150(); } - else if (JOY_NEW(START_BUTTON)) + if (JOY_NEW(START_BUTTON)) { return sub_811B1B4(); } - else if (JOY_NEW(DPAD_UP)) + if (JOY_NEW(DPAD_UP)) { sEasyChatScreen->mainCursorRow--; break; } - else if (JOY_NEW(DPAD_LEFT)) + if (JOY_NEW(DPAD_LEFT)) { sEasyChatScreen->mainCursorColumn--; break; } - else if (JOY_NEW(DPAD_DOWN)) + if (JOY_NEW(DPAD_DOWN)) { sEasyChatScreen->mainCursorRow = 0; break; } - else if (JOY_NEW(DPAD_RIGHT)) + if (JOY_NEW(DPAD_RIGHT)) { sEasyChatScreen->mainCursorColumn++; break; -- cgit v1.2.3 From 7dc95a0103af08c95c9093b6efa6c77af77a2538 Mon Sep 17 00:00:00 2001 From: aaaaaa123456789 Date: Sun, 13 Sep 2020 04:22:50 -0300 Subject: Undo PokeCodec's PRs This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183. --- src/easy_chat.c | 82 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'src/easy_chat.c') diff --git a/src/easy_chat.c b/src/easy_chat.c index e08f0bb75..534215ecd 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1523,7 +1523,7 @@ static u16 sub_811AB68(void) { do { - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) { sub_811BF78(); sEasyChatScreen->state = 2; @@ -1532,30 +1532,30 @@ static u16 sub_811AB68(void) sEasyChatScreen->unk_0c = 0; return 9; } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { return sub_811B150(); } - else if (JOY_NEW(START_BUTTON)) + else if (gMain.newKeys & START_BUTTON) { return sub_811B1B4(); } - else if (JOY_NEW(DPAD_UP)) + else if (gMain.newKeys & DPAD_UP) { sEasyChatScreen->mainCursorRow--; break; } - else if (JOY_NEW(DPAD_LEFT)) + else if (gMain.newKeys & DPAD_LEFT) { sEasyChatScreen->mainCursorColumn--; break; } - else if (JOY_NEW(DPAD_DOWN)) + else if (gMain.newKeys & DPAD_DOWN) { sEasyChatScreen->mainCursorRow++; break; } - else if (JOY_NEW(DPAD_RIGHT)) + else if (gMain.newKeys & DPAD_RIGHT) { sEasyChatScreen->mainCursorColumn++; break; @@ -1595,7 +1595,7 @@ static u16 sub_811ACDC(void) { do { - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) { switch (sEasyChatScreen->mainCursorColumn) { @@ -1610,30 +1610,30 @@ static u16 sub_811ACDC(void) } } - if (JOY_NEW(B_BUTTON)) + if (gMain.newKeys & B_BUTTON) { return sub_811B150(); } - if (JOY_NEW(START_BUTTON)) + else if (gMain.newKeys & START_BUTTON) { return sub_811B1B4(); } - if (JOY_NEW(DPAD_UP)) + else if (gMain.newKeys & DPAD_UP) { sEasyChatScreen->mainCursorRow--; break; } - if (JOY_NEW(DPAD_LEFT)) + else if (gMain.newKeys & DPAD_LEFT) { sEasyChatScreen->mainCursorColumn--; break; } - if (JOY_NEW(DPAD_DOWN)) + else if (gMain.newKeys & DPAD_DOWN) { sEasyChatScreen->mainCursorRow = 0; break; } - if (JOY_NEW(DPAD_RIGHT)) + else if (gMain.newKeys & DPAD_RIGHT) { sEasyChatScreen->mainCursorColumn++; break; @@ -1666,10 +1666,10 @@ static u16 sub_811ACDC(void) static u16 sub_811AE44(void) { - if (JOY_NEW(B_BUTTON)) + if (gMain.newKeys & B_BUTTON) return sub_811B32C(); - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) { if (sEasyChatScreen->unk_0a != -1) return sub_811B2B0(); @@ -1685,19 +1685,19 @@ static u16 sub_811AE44(void) } } - if (JOY_NEW(SELECT_BUTTON)) + if (gMain.newKeys & SELECT_BUTTON) return sub_811B33C(); - if (JOY_REPEAT(DPAD_UP)) + if (gMain.newAndRepeatedKeys & DPAD_UP) return sub_811B528(2); - if (JOY_REPEAT(DPAD_DOWN)) + if (gMain.newAndRepeatedKeys & DPAD_DOWN) return sub_811B528(3); - if (JOY_REPEAT(DPAD_LEFT)) + if (gMain.newAndRepeatedKeys & DPAD_LEFT) return sub_811B528(1); - if (JOY_REPEAT(DPAD_RIGHT)) + if (gMain.newAndRepeatedKeys & DPAD_RIGHT) return sub_811B528(0); return 0; @@ -1705,31 +1705,31 @@ static u16 sub_811AE44(void) static u16 sub_811AF00(void) { - if (JOY_NEW(B_BUTTON)) + if (gMain.newKeys & B_BUTTON) { sEasyChatScreen->state = 2; return 14; } - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) return sub_811B394(); - if (JOY_NEW(START_BUTTON)) + if (gMain.newKeys & START_BUTTON) return sub_811B794(4); - if (JOY_NEW(SELECT_BUTTON)) + if (gMain.newKeys & SELECT_BUTTON) return sub_811B794(5); - if (JOY_REPEAT(DPAD_UP)) + if (gMain.newAndRepeatedKeys & DPAD_UP) return sub_811B794(2); - if (JOY_REPEAT(DPAD_DOWN)) + if (gMain.newAndRepeatedKeys & DPAD_DOWN) return sub_811B794(3); - if (JOY_REPEAT(DPAD_LEFT)) + if (gMain.newAndRepeatedKeys & DPAD_LEFT) return sub_811B794(1); - if (JOY_REPEAT(DPAD_RIGHT)) + if (gMain.newAndRepeatedKeys & DPAD_RIGHT) return sub_811B794(0); return 0; @@ -1794,10 +1794,10 @@ static u16 sub_811B040(void) static u16 sub_811B08C(void) { - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) return 26; - if (JOY_NEW(B_BUTTON)) + if (gMain.newKeys & B_BUTTON) return sub_811B150(); return 0; @@ -1805,7 +1805,7 @@ static u16 sub_811B08C(void) static u16 sub_811B0BC(void) { - if (JOY_NEW(A_BUTTON | B_BUTTON)) + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { sEasyChatScreen->state = sub_811B2A4(); return 7; @@ -2537,7 +2537,7 @@ u8 sub_811BBBC(void) return sEasyChatScreen->unk_0c; } -static void sub_811BBC8(s8 *arg0, s8 *arg1) +void sub_811BBC8(u8 *arg0, u8 *arg1) { *arg0 = sEasyChatScreen->unk_10; *arg1 = sEasyChatScreen->unk_11; @@ -4529,18 +4529,18 @@ static void sub_811E30C(void) x = var0 * 13; x = x * 8 + 28; y = var1 * 16 + 96; - sub_811E34C((u8)x, (u8)y); + sub_811E34C(x, y); } static void sub_811E34C(u8 x, u8 y) { - if (!sUnknown_0203A11C->unk2E4) - return; - - sUnknown_0203A11C->unk2E4->pos1.x = (s16)x; - sUnknown_0203A11C->unk2E4->pos1.y = (s16)y; - sUnknown_0203A11C->unk2E4->pos2.x = 0; - sUnknown_0203A11C->unk2E4->data[0] = 0; + if (sUnknown_0203A11C->unk2E4) + { + sUnknown_0203A11C->unk2E4->pos1.x = x; + sUnknown_0203A11C->unk2E4->pos1.y = y; + sUnknown_0203A11C->unk2E4->pos2.x = 0; + sUnknown_0203A11C->unk2E4->data[0] = 0; + } } static void sub_811E380(void) -- cgit v1.2.3 From 52598983250fd8ad7b66ff2b9d77046859f169c8 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 Oct 2020 17:20:38 -0400 Subject: Replace POKEMON_SLOTS_NUMBER --- src/easy_chat.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/easy_chat.c') diff --git a/src/easy_chat.c b/src/easy_chat.c index e08f0bb75..2e58dec0d 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -32,7 +32,6 @@ #include "constants/lilycove_lady.h" #include "constants/mauville_old_man.h" #include "constants/songs.h" -#include "constants/species.h" #include "constants/rgb.h" #define EZCHAT_TASK_STATE 0 -- cgit v1.2.3 From bacc831aa91d059936bd7c852bf0a0fb44d8f27a Mon Sep 17 00:00:00 2001 From: aaaaaa123456789 Date: Mon, 2 Nov 2020 22:02:39 -0300 Subject: Re-apply joypad macros (minus merge conflicts) --- src/easy_chat.c | 64 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/easy_chat.c') diff --git a/src/easy_chat.c b/src/easy_chat.c index 6dca3f56a..2590eea1a 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -1522,7 +1522,7 @@ static u16 sub_811AB68(void) { do { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { sub_811BF78(); sEasyChatScreen->state = 2; @@ -1531,30 +1531,30 @@ static u16 sub_811AB68(void) sEasyChatScreen->unk_0c = 0; return 9; } - else if (gMain.newKeys & B_BUTTON) + else if (JOY_NEW(B_BUTTON)) { return sub_811B150(); } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { return sub_811B1B4(); } - else if (gMain.newKeys & DPAD_UP) + else if (JOY_NEW(DPAD_UP)) { sEasyChatScreen->mainCursorRow--; break; } - else if (gMain.newKeys & DPAD_LEFT) + else if (JOY_NEW(DPAD_LEFT)) { sEasyChatScreen->mainCursorColumn--; break; } - else if (gMain.newKeys & DPAD_DOWN) + else if (JOY_NEW(DPAD_DOWN)) { sEasyChatScreen->mainCursorRow++; break; } - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { sEasyChatScreen->mainCursorColumn++; break; @@ -1594,7 +1594,7 @@ static u16 sub_811ACDC(void) { do { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { switch (sEasyChatScreen->mainCursorColumn) { @@ -1609,30 +1609,30 @@ static u16 sub_811ACDC(void) } } - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) { return sub_811B150(); } - else if (gMain.newKeys & START_BUTTON) + else if (JOY_NEW(START_BUTTON)) { return sub_811B1B4(); } - else if (gMain.newKeys & DPAD_UP) + else if (JOY_NEW(DPAD_UP)) { sEasyChatScreen->mainCursorRow--; break; } - else if (gMain.newKeys & DPAD_LEFT) + else if (JOY_NEW(DPAD_LEFT)) { sEasyChatScreen->mainCursorColumn--; break; } - else if (gMain.newKeys & DPAD_DOWN) + else if (JOY_NEW(DPAD_DOWN)) { sEasyChatScreen->mainCursorRow = 0; break; } - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { sEasyChatScreen->mainCursorColumn++; break; @@ -1665,10 +1665,10 @@ static u16 sub_811ACDC(void) static u16 sub_811AE44(void) { - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) return sub_811B32C(); - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) { if (sEasyChatScreen->unk_0a != -1) return sub_811B2B0(); @@ -1684,19 +1684,19 @@ static u16 sub_811AE44(void) } } - if (gMain.newKeys & SELECT_BUTTON) + if (JOY_NEW(SELECT_BUTTON)) return sub_811B33C(); - if (gMain.newAndRepeatedKeys & DPAD_UP) + if (JOY_REPEAT(DPAD_UP)) return sub_811B528(2); - if (gMain.newAndRepeatedKeys & DPAD_DOWN) + if (JOY_REPEAT(DPAD_DOWN)) return sub_811B528(3); - if (gMain.newAndRepeatedKeys & DPAD_LEFT) + if (JOY_REPEAT(DPAD_LEFT)) return sub_811B528(1); - if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + if (JOY_REPEAT(DPAD_RIGHT)) return sub_811B528(0); return 0; @@ -1704,31 +1704,31 @@ static u16 sub_811AE44(void) static u16 sub_811AF00(void) { - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) { sEasyChatScreen->state = 2; return 14; } - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) return sub_811B394(); - if (gMain.newKeys & START_BUTTON) + if (JOY_NEW(START_BUTTON)) return sub_811B794(4); - if (gMain.newKeys & SELECT_BUTTON) + if (JOY_NEW(SELECT_BUTTON)) return sub_811B794(5); - if (gMain.newAndRepeatedKeys & DPAD_UP) + if (JOY_REPEAT(DPAD_UP)) return sub_811B794(2); - if (gMain.newAndRepeatedKeys & DPAD_DOWN) + if (JOY_REPEAT(DPAD_DOWN)) return sub_811B794(3); - if (gMain.newAndRepeatedKeys & DPAD_LEFT) + if (JOY_REPEAT(DPAD_LEFT)) return sub_811B794(1); - if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + if (JOY_REPEAT(DPAD_RIGHT)) return sub_811B794(0); return 0; @@ -1793,10 +1793,10 @@ static u16 sub_811B040(void) static u16 sub_811B08C(void) { - if (gMain.newKeys & A_BUTTON) + if (JOY_NEW(A_BUTTON)) return 26; - if (gMain.newKeys & B_BUTTON) + if (JOY_NEW(B_BUTTON)) return sub_811B150(); return 0; @@ -1804,7 +1804,7 @@ static u16 sub_811B08C(void) static u16 sub_811B0BC(void) { - if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + if (JOY_NEW(A_BUTTON | B_BUTTON)) { sEasyChatScreen->state = sub_811B2A4(); return 7; -- cgit v1.2.3