diff --git a/include/core_sys.h b/include/core_sys.h index 300551cc24..5aa3de4a5a 100644 --- a/include/core_sys.h +++ b/include/core_sys.h @@ -5,6 +5,13 @@ #include "struct_decls/struct_0201CD88_decl.h" #include "overlay023/funcptr_ov23_022537D4.h" +enum ButtonMode { + BUTTON_MODE_NORMAL = 0, + BUTTON_MODE_START_IS_X = 1, + BUTTON_MODE_SWAP_XY = 2, + BUTTON_MODE_L_IS_A = 3, +}; + typedef struct CoreSys { UnkFuncPtr_02017798 unk_00; void * unk_04; @@ -19,20 +26,20 @@ typedef struct CoreSys { u32 * unk_28; u32 unk_2C; u32 unk_30; - int unk_34; - int unk_38; - int unk_3C; - int unk_40; - int unk_44; - int padInput; - int unk_4C; - int unk_50; - int unk_54; - int unk_58; - u16 unk_5C; - u16 unk_5E; - u16 touchInput; - u16 unk_62; + enum ButtonMode buttonMode; + u32 heldKeysRaw; + u32 pressedKeysRaw; + u32 pressedKeysRepeatableRaw; + u32 heldKeys; + u32 pressedKeys; + u32 pressedKeysRepeatable; + int autorepeatTimer; + int autorepeatRate; + int autorepeatDelay; + u16 touchX; + u16 touchY; + u16 touchPressed; + u16 touchHeld; u8 unk_64; u8 unk_65; u8 unk_66; diff --git a/include/party.h b/include/party.h index 1a424dd32b..0362df83ae 100644 --- a/include/party.h +++ b/include/party.h @@ -6,7 +6,7 @@ #include "struct_decls/struct_021C0794_decl.h" int Party_SaveSize(void); -Party * sub_02079FF4(u32 param0); +Party * Party_New(u32 param0); void Party_Init(Party * param0); void Party_InitWithCapacity(Party * party, int capacity); BOOL Party_AddPokemon(Party * party, Pokemon * pokemon); diff --git a/include/unk_02017728.h b/include/unk_02017728.h index 622361779d..9b55946f1c 100644 --- a/include/unk_02017728.h +++ b/include/unk_02017728.h @@ -9,15 +9,15 @@ void sub_020177A4(void); BOOL sub_020177BC(UnkFuncPtr_02017798 param0, void * param1); void sub_0201789C(void); void sub_020179E4(void); -void * sub_02017A40(int param0, const char * param1); -void sub_02017A94(const char * param0, void ** param1); +void * ReadFileToHeap(int heapID, const char * filename); +void ReadFileToBuffer(const char * filename, void ** buf); void sub_02017ACC(void); -void sub_02017AF4(void); +void InitKeypadAndTouchpad(void); void sub_02017B70(int param0); void sub_02017B7C(u8 param0); void sub_02017B8C(u8 param0); -void sub_02017B9C(void); -void sub_02017DD4(int param0, int param1); +void ReadKeypadAndTouchpad(void); +void SetAutorepeat(int rate, int delay); void sub_02017DE0(u8 param0); void sub_02017DF0(u8 param0); void sub_02017E00(int param0); diff --git a/replace.sh b/replace.sh index f4f4185f2b..08a4533c43 100755 --- a/replace.sh +++ b/replace.sh @@ -6,4 +6,4 @@ if [ "$1" = "" -o "$2" = "" ]; then exit 0 fi -sed -i 's/\<'"$1"'\>/'"$2"'/' $(git grep -Ilwr "$1") +sed -i 's/\<'"$1"'\>/'"$2"'/g' $(git grep -Ilwr "$1") diff --git a/src/error_message_reset.c b/src/error_message_reset.c index eca489696b..6519c73c00 100644 --- a/src/error_message_reset.c +++ b/src/error_message_reset.c @@ -127,7 +127,7 @@ void ErrorMessageReset_PrintErrorAndReset (void) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); diff --git a/src/main.c b/src/main.c index 68022ad75a..a0c10ba558 100644 --- a/src/main.c +++ b/src/main.c @@ -38,6 +38,8 @@ #include "unk_02039A64.h" #include "unk_0209A74C.h" +#define RESET_COMBO (PAD_BUTTON_START | PAD_BUTTON_SELECT | PAD_BUTTON_L | PAD_BUTTON_R) + FS_EXTERN_OVERLAY(overlay57); FS_EXTERN_OVERLAY(overlay77); @@ -66,7 +68,7 @@ void NitroMain (void) { sub_0201789C(); sub_020179E4(); - sub_02017AF4(); + InitKeypadAndTouchpad(); sub_02017B70(0); PM_GetBackLight(&Unk_02101D20, NULL); @@ -120,9 +122,9 @@ void NitroMain (void) while (TRUE) { sub_02000F30(); sub_0200106C(); - sub_02017B9C(); + ReadKeypadAndTouchpad(); - if ((gCoreSys.unk_38 & (PAD_BUTTON_START | PAD_BUTTON_SELECT | PAD_BUTTON_L | PAD_BUTTON_R)) == (PAD_BUTTON_START | PAD_BUTTON_SELECT | PAD_BUTTON_L | PAD_BUTTON_R)) { + if ((gCoreSys.heldKeysRaw & RESET_COMBO) == RESET_COMBO) { if (gCoreSys.unk_68 == 0) { sub_02000F60(0); } @@ -295,10 +297,10 @@ static void sub_02000F94 (int param0, int param1) while (TRUE) { sub_0200106C(); - sub_02017B9C(); + ReadKeypadAndTouchpad(); if (v0 >= 30) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { break; } } diff --git a/src/overlay005/ov5_021D0D80.c b/src/overlay005/ov5_021D0D80.c index c07b5963d3..432508c447 100644 --- a/src/overlay005/ov5_021D0D80.c +++ b/src/overlay005/ov5_021D0D80.c @@ -539,7 +539,7 @@ static void ov5_021D134C (UnkStruct_0203CDB0 * param0, u8 param1) ov5_021D15F4(param0); } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { (void)0; } } diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index 34e31622f7..7c71374653 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -50,7 +50,7 @@ void ov5_021D2F14 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_ov7_0224F2EC for (v4 = 0; v4 < param0->unk_1C4; v4++) { v0 = sub_02009F38(v1, v4); - v2 = sub_02017A40(param3, param1->val1[v4]); + v2 = ReadFileToHeap(param3, param1->val1[v4]); sub_02009F40(v2, v0, param3); Heap_FreeToHeap(v2); @@ -78,7 +78,7 @@ void ov5_021D2F14 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_ov7_0224F2EC sub_0200A41C(param0->unk_1AC[0]); sub_0200A684(param0->unk_1AC[1]); - v2 = sub_02017A40(param3, param1->val2.unk_18); + v2 = ReadFileToHeap(param3, param1->val2.unk_18); param0->unk_190 = sub_02009508(v2, param3, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); Heap_FreeToHeap(v2); diff --git a/src/overlay005/ov5_021DC018.c b/src/overlay005/ov5_021DC018.c index 1fa41e578d..f0ac40f2e8 100644 --- a/src/overlay005/ov5_021DC018.c +++ b/src/overlay005/ov5_021DC018.c @@ -560,7 +560,7 @@ static void ov5_021DC95C (SysTask * param0, void * param1) Sound_PlayEffect(1500); } - if ((gCoreSys.unk_4C & PAD_KEY_UP) || (gCoreSys.unk_4C & PAD_KEY_DOWN) || (gCoreSys.unk_4C & PAD_KEY_LEFT) || (gCoreSys.unk_4C & PAD_KEY_RIGHT)) { + if ((gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT)) { ov5_021DCAF4(v2); } diff --git a/src/overlay005/ov5_021DFB54.c b/src/overlay005/ov5_021DFB54.c index 5991009d9a..2b6140c0cb 100644 --- a/src/overlay005/ov5_021DFB54.c +++ b/src/overlay005/ov5_021DFB54.c @@ -878,7 +878,7 @@ static BOOL ov5_021E0560 (UnkStruct_020508D4 * param0) case 2: { int v2 = sub_0205EA78(v0->unk_0C); - u32 v3, v4 = gCoreSys.padInput, v5 = gCoreSys.unk_44; + u32 v3, v4 = gCoreSys.pressedKeys, v5 = gCoreSys.heldKeys; int v6 = sub_02061308(v0->unk_0C, v4, v5); if ((v6 == -1) || (v6 == v2)) { diff --git a/src/overlay005/ov5_021F08CC.c b/src/overlay005/ov5_021F08CC.c index a0e9ec3d16..6378806915 100644 --- a/src/overlay005/ov5_021F08CC.c +++ b/src/overlay005/ov5_021F08CC.c @@ -489,7 +489,7 @@ static void * ov5_021F0D1C (u32 param0) static int ov5_021F0D40 (void) { - if ((gCoreSys.padInput & PAD_BUTTON_A)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A)) { return 1; } @@ -498,7 +498,7 @@ static int ov5_021F0D40 (void) static int ov5_021F0D54 (void) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { return 1; } diff --git a/src/overlay006/ov6_0223E140.c b/src/overlay006/ov6_0223E140.c index b4f254b0da..b3663b3e4c 100644 --- a/src/overlay006/ov6_0223E140.c +++ b/src/overlay006/ov6_0223E140.c @@ -2194,12 +2194,12 @@ static BOOL ov6_02240364 (UnkStruct_ov6_022401B8 * param0, int param1, int param BOOL v1[2] = {0, 0}; UnkStruct_ov6_02240260 * v2 = ¶m0->unk_34; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v2->unk_00++; v2->unk_00 %= 32; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (v2->unk_00) { v2->unk_00--; } else { @@ -2207,12 +2207,12 @@ static BOOL ov6_02240364 (UnkStruct_ov6_022401B8 * param0, int param1, int param } } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v2->unk_04++; v2->unk_04 %= 32; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (v2->unk_04) { v2->unk_04--; } else { diff --git a/src/overlay006/ov6_02247A0C.c b/src/overlay006/ov6_02247A0C.c index ed01297635..e9395f49c5 100644 --- a/src/overlay006/ov6_02247A0C.c +++ b/src/overlay006/ov6_02247A0C.c @@ -116,7 +116,7 @@ static BOOL ov6_02247A34 (UnkStruct_020508D4 * param0) v1->unk_04++; break; case 1: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov6_02247CC8(v1->unk_00); v1->unk_04++; } diff --git a/src/overlay007/ov7_02249960.c b/src/overlay007/ov7_02249960.c index 840d63043d..3390557e18 100644 --- a/src/overlay007/ov7_02249960.c +++ b/src/overlay007/ov7_02249960.c @@ -655,7 +655,7 @@ static void ov7_0224A34C (SysTask * param0, void * param1) if (ov7_0224A244(param0, param1)) { (void)0; - } else if (( PAD_BUTTON_B )&gCoreSys.padInput) { + } else if (( PAD_BUTTON_B )&gCoreSys.pressedKeys) { ov7_02249960(3, 0); ov7_0224A530(ov7_0224A394); } @@ -1119,7 +1119,7 @@ static void ov7_0224AB64 (SysTask * param0, void * param1) UnkStruct_ov7_02249C2C * v0 = (UnkStruct_ov7_02249C2C *)param1; if (sub_0205DA04(Unk_ov7_0224F5A0->unk_94)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov7_0224AFD8(param0, v0); ov7_0224A528(); Unk_ov7_0224F5A0->unk_88 = 4; @@ -1135,7 +1135,7 @@ static void ov7_0224ABA4 (SysTask * param0, void * param1) ov7_0224A64C(v0); if (sub_0205DA04(Unk_ov7_0224F5A0->unk_94)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov7_0224A5D0(); ov7_0224A530(ov7_0224ABE0); } @@ -1307,7 +1307,7 @@ static void ov7_0224AD68 (SysTask * param0, void * param1) static void ov7_0224ADD8 (SysTask * param0, void * param1) { if (sub_0205DA04(Unk_ov7_0224F5A0->unk_94)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Unk_ov7_0224F5A0->unk_88 = 1; SysTask_Done(param0); } @@ -1587,7 +1587,7 @@ static void ov7_0224B2A0 (SysTask * param0, void * param1) UnkStruct_ov7_02249C2C * v0 = (UnkStruct_ov7_02249C2C *)param1; if (sub_0205DA04(Unk_ov7_0224F5A0->unk_94)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { SysTask_Done(param0); ov7_0224A528(); Unk_ov7_0224F5A0->unk_88 = 1; @@ -1637,7 +1637,7 @@ static void ov7_0224B370 (SysTask * param0, void * param1) UnkStruct_ov7_02249C2C * v0 = (UnkStruct_ov7_02249C2C *)param1; if (sub_0205DA04(Unk_ov7_0224F5A0->unk_94)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov7_02249E0C(v0); SysTask_Done(param0); } diff --git a/src/overlay007/ov7_0224B4E8.c b/src/overlay007/ov7_0224B4E8.c index 6037084d90..bc821c32d6 100644 --- a/src/overlay007/ov7_0224B4E8.c +++ b/src/overlay007/ov7_0224B4E8.c @@ -513,7 +513,7 @@ static BOOL ov7_0224BC74 (UnkStruct_020508D4 * param0) break; case 6: if (sub_0205DA04(v1->unk_74)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v1->unk_7C = 0; } } @@ -524,7 +524,7 @@ static BOOL ov7_0224BC74 (UnkStruct_020508D4 * param0) v1->unk_7C++; break; case 8: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov7_0224BBA0(v1); ov7_0224B4E8(v1, 106); ov7_0224B5A8(v1); diff --git a/src/overlay007/ov7_0224BE9C.c b/src/overlay007/ov7_0224BE9C.c index 01eae62446..73c68f8164 100644 --- a/src/overlay007/ov7_0224BE9C.c +++ b/src/overlay007/ov7_0224BE9C.c @@ -350,7 +350,7 @@ BOOL ov7_0224BF2C (UnkStruct_ov7_0224BEFC * param0) break; case 11: if (ov7_0224C4B8(¶m0->unk_1B8)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { param0->unk_00 = param0->unk_04; } } diff --git a/src/overlay007/ov7_0224CD28.c b/src/overlay007/ov7_0224CD28.c index 144cc882d2..99475fdb48 100644 --- a/src/overlay007/ov7_0224CD28.c +++ b/src/overlay007/ov7_0224CD28.c @@ -400,7 +400,7 @@ static u8 ov7_0224D250 (UnkStruct_0203CDB0 * param0, UnkStruct_ov7_0224D008 * pa return 0; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { void * v0; sub_0200E084(¶m1->unk_08[1], 0); @@ -971,7 +971,7 @@ static u8 ov7_0224DFB0 (UnkStruct_ov7_0224D008 * param0) return 6; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { sub_02021CAC(param0->unk_25C[0], 0); sub_02021CAC(param0->unk_25C[1], 0); Window_Clear(¶m0->unk_08[4], 1); @@ -982,7 +982,7 @@ static u8 ov7_0224DFB0 (UnkStruct_ov7_0224D008 * param0) return ov7_0224E098(param0); } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Window_Clear(¶m0->unk_08[4], 1); Window_Clear(¶m0->unk_08[3], 1); sub_0200E084(¶m0->unk_08[5], 0); @@ -1224,7 +1224,7 @@ static u8 ov7_0224E6B8 (UnkStruct_ov7_0224D008 * param0) return 10; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { if (param0->unk_28C == 1) { sub_0206B3B4(param0->unk_288); } @@ -1267,7 +1267,7 @@ static u8 ov7_0224E7C8 (UnkStruct_ov7_0224D008 * param0) return 11; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_08[5], 0); ov7_0224EB38(param0, 0); sub_02021CAC(param0->unk_25C[0], param0->unk_26C[0]); diff --git a/src/overlay008/ov8_02249960.c b/src/overlay008/ov8_02249960.c index ac9dc42f7b..cc7f6bbc16 100644 --- a/src/overlay008/ov8_02249960.c +++ b/src/overlay008/ov8_02249960.c @@ -2953,7 +2953,7 @@ static BOOL ov8_0224B3D4 (UnkStruct_020508D4 * param0) v2->unk_00++; case 12: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { int v9 = sub_0205EABC(v1->unk_3C); int v10 = sub_0205EAC8(v1->unk_3C); diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index 5b6354fd06..619f70d744 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -492,7 +492,7 @@ static void ov10_0221F930 (UnkStruct_ov10_0221FB28 * param0) break; case 2: if (param0->unk_BBC == 1) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_BB0 = 3; } } diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index 259265afb3..b21aafe84e 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -1047,9 +1047,9 @@ static void ov12_0222048C (UnkStruct_ov12_0221FCDC * param0) { param0->unk_89 = 1; - if (gCoreSys.unk_44 & PAD_BUTTON_L) { - if (gCoreSys.unk_44 & PAD_BUTTON_R) { - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.heldKeys & PAD_BUTTON_L) { + if (gCoreSys.heldKeys & PAD_BUTTON_R) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { param0->unk_18 += 1; param0->unk_89 = 0; } diff --git a/src/overlay013/ov13_0221FC20.c b/src/overlay013/ov13_0221FC20.c index a78ec5bae8..631902796f 100644 --- a/src/overlay013/ov13_0221FC20.c +++ b/src/overlay013/ov13_0221FC20.c @@ -861,7 +861,7 @@ static u8 ov13_02220848 (UnkStruct_ov13_022213F0 * param0) static u8 ov13_02220864 (UnkStruct_ov13_022213F0 * param0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || (TouchScreen_Tapped() == 1)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || (TouchScreen_Tapped() == 1)) { return param0->unk_2075; } diff --git a/src/overlay013/ov13_022264F4.c b/src/overlay013/ov13_022264F4.c index e25328bb92..72b611718c 100644 --- a/src/overlay013/ov13_022264F4.c +++ b/src/overlay013/ov13_022264F4.c @@ -526,7 +526,7 @@ static u8 ov13_02226C7C (UnkStruct_ov13_02227244 * param0) static u8 ov13_02226C94 (UnkStruct_ov13_02227244 * param0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || (TouchScreen_Tapped() == 1)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || (TouchScreen_Tapped() == 1)) { return param0->unk_114B; } diff --git a/src/overlay013/ov13_02228A38.c b/src/overlay013/ov13_02228A38.c index 15704241c8..41b8f1253f 100644 --- a/src/overlay013/ov13_02228A38.c +++ b/src/overlay013/ov13_02228A38.c @@ -93,7 +93,7 @@ static u8 ov13_02228ACC (UnkStruct_ov13_02228A50 * param0) return 1; } - if (gCoreSys.padInput & ((PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT) | PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & ((PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT) | PAD_BUTTON_B | PAD_BUTTON_A)) { param0->unk_08 = 1; ov16_0226DD7C(param0->unk_00, param0->unk_04[param0->unk_09].unk_00, param0->unk_04[param0->unk_09].unk_02, param0->unk_04[param0->unk_09].unk_01, param0->unk_04[param0->unk_09].unk_03); @@ -141,16 +141,16 @@ u32 ov13_02228B64 (UnkStruct_ov13_02228A50 * param0) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v4 = sub_0201E028(param0->unk_04, NULL, NULL, NULL, NULL, param0->unk_09, 0); v5 = 0; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v4 = sub_0201E028(param0->unk_04, NULL, NULL, NULL, NULL, param0->unk_09, 1); v5 = 1; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v4 = sub_0201E028(param0->unk_04, NULL, NULL, NULL, NULL, param0->unk_09, 2); v5 = 2; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v4 = sub_0201E028(param0->unk_04, NULL, NULL, NULL, NULL, param0->unk_09, 3); v5 = 3; } else { @@ -205,11 +205,11 @@ u32 ov13_02228B64 (UnkStruct_ov13_02228A50 * param0) return 0xffffffff; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { return param0->unk_09; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); return 0xfffffffe; } diff --git a/src/overlay016/battle_script.c b/src/overlay016/battle_script.c index 0b9bb1c868..af4e71e199 100644 --- a/src/overlay016/battle_script.c +++ b/src/overlay016/battle_script.c @@ -2065,7 +2065,7 @@ static BOOL BtlCmd_WaitButtonABTime(BattleSystem *battleSys, BattleContext *batt int frames = BattleScript_Read(battleCtx); if ((BattleSystem_BattleType(battleSys) & BATTLE_TYPE_LINK) == FALSE) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) || TouchScreen_Tapped()) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) || TouchScreen_Tapped()) { battleCtx->waitCounter = frames; } } @@ -10215,7 +10215,7 @@ static void BattleScript_GetExpTask(SysTask *task, void *inData) case SEQ_GET_EXP_LEVEL_UP_SUMMARY_PRINT_DIFF_WAIT: case SEQ_GET_EXP_LEVEL_UP_SUMMARY_PRINT_TRUE_WAIT: - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) || TouchScreen_Tapped()) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) || TouchScreen_Tapped()) { Sound_PlayEffect(SEQ_CONFIRM); data->seqNum++; } @@ -10792,7 +10792,7 @@ static void BattleScript_CatchMonTask (SysTask * param0, void * param1) break; case 13: if (ov21_021E8DEC(v2->tmpPtr[0])) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v2->seqNum = 14; } else if (TouchScreen_Tapped()) { Sound_PlayEffect(1500); diff --git a/src/overlay016/ov16_0223B140.c b/src/overlay016/ov16_0223B140.c index 276c2c3aad..91e5146057 100644 --- a/src/overlay016/ov16_0223B140.c +++ b/src/overlay016/ov16_0223B140.c @@ -1126,7 +1126,7 @@ static void ov16_0223C2C0 (BattleSystem * param0, BattleParams * param1) param0->battleCtx = BattleContext_New(param0); for (v0 = 0; v0 < 4; v0++) { - param0->parties[v0] = sub_02079FF4(5); + param0->parties[v0] = Party_New(5); } { diff --git a/src/overlay016/ov16_0225CBB8.c b/src/overlay016/ov16_0225CBB8.c index dbf4d46492..09dc6dfd08 100644 --- a/src/overlay016/ov16_0225CBB8.c +++ b/src/overlay016/ov16_0225CBB8.c @@ -839,7 +839,7 @@ void ov16_0225D794 (BattleSystem * param0, BattlerData * param1, UnkStruct_ov16_ v0->unk_08 = (UnkStruct_ov16_0225D840 *)Heap_AllocFromHeap(5, sizeof(UnkStruct_ov16_0225D840)); v0->unk_08->unk_04 = Heap_AllocFromHeap(5, sizeof(UnkStruct_ov13_0221FC20)); - v0->unk_08->unk_04->unk_00 = sub_02079FF4(5); + v0->unk_08->unk_04->unk_00 = Party_New(5); v0->unk_0E = 0; v0->unk_00 = param0; v0->unk_0C = param2->unk_00; @@ -3078,7 +3078,7 @@ static void ov16_022604C8 (SysTask * param0, void * param1) v0->unk_0A = 5; break; case 5: - if (gCoreSys.padInput & PAD_BUTTON_START) { + if (gCoreSys.pressedKeys & PAD_BUTTON_START) { BattlerData * v14; int v15; @@ -4280,7 +4280,7 @@ static void ov16_02261E8C (SysTask * param0, void * param1) ov16_0223B384(v0->unk_00); v0->unk_04 = Heap_AllocFromHeap(5, sizeof(UnkStruct_ov13_0221FC20)); - v0->unk_04->unk_00 = sub_02079FF4(5); + v0->unk_04->unk_00 = Party_New(5); if (((BattleSystem_BattleType(v0->unk_00) & (0x4 | 0x8)) == (0x4 | 0x8)) || (BattleSystem_BattleType(v0->unk_00) == (((0x2 | 0x1) | 0x8 | 0x40) | 0x80))) { if (BattleSystem_BattlerSlot(v0->unk_00, v0->unk_09) == 2) { diff --git a/src/overlay016/ov16_0226871C.c b/src/overlay016/ov16_0226871C.c index b911ed4839..46c433294a 100644 --- a/src/overlay016/ov16_0226871C.c +++ b/src/overlay016/ov16_0226871C.c @@ -3768,7 +3768,7 @@ static void ov16_0226BD74 (SysTask * param0, void * param1) v2 = sub_0200316C(v1, 1); v3 = (16 - 8) * 2; - if (gCoreSys.unk_62 && ((v4 == 1) || (v5 == 1))) { + if (gCoreSys.touchHeld && ((v4 == 1) || (v5 == 1))) { if (memcmp(&v2[8], &v0->unk_5C[8], v3) == 0) { if (BattleSystem_BattleType(v0->unk_00) & 0x80) { MI_CpuCopy16(&v0->unk_60[0], &v2[0], 0x20); @@ -3802,7 +3802,7 @@ static int ov16_0226BE48 (UnkStruct_ov16_02268A14 * param0) } if (v0->unk_00 == 0) { - if ((param0->unk_6C0 == 1) || (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y | PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN))) { + if ((param0->unk_6C0 == 1) || (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y | PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN))) { if (param0->unk_6C0 == 0) { Sound_PlayEffect(1500); } @@ -3847,18 +3847,18 @@ static int ov16_0226BEC0 (UnkStruct_ov16_02268A14 * param0, int param1) default: v4 = Unk_ov16_022701EC[v0->unk_01][v0->unk_02]; - if ((v4 == 3) && (gCoreSys.padInput & PAD_KEY_UP)) { + if ((v4 == 3) && (gCoreSys.pressedKeys & PAD_KEY_UP)) { (void)0; } else { v1 = ov16_0226CB10(v0, 3, 2, Unk_ov16_022701EC[0]); if ((v1 == 0) && (v4 == 0)) { - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v0->unk_02 = 0; v0->unk_01 = 1; Sound_PlayEffect(1500); v1 = PAD_KEY_LEFT; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v0->unk_02 = 2; v0->unk_01 = 1; Sound_PlayEffect(1500); @@ -4369,7 +4369,7 @@ static u32 ov16_0226CB10 (UnkStruct_ov16_0226CB10 * param0, int param1, int para v1 = param0->unk_02; v0 = param0->unk_01; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_01--; if (param0->unk_01 < 0) { @@ -4388,7 +4388,7 @@ static u32 ov16_0226CB10 (UnkStruct_ov16_0226CB10 * param0, int param1, int para } v2 = PAD_KEY_UP; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_01++; if (param0->unk_01 >= param2) { @@ -4407,7 +4407,7 @@ static u32 ov16_0226CB10 (UnkStruct_ov16_0226CB10 * param0, int param1, int para } v2 = PAD_KEY_DOWN; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { param0->unk_02--; if (param0->unk_02 < 0) { @@ -4426,7 +4426,7 @@ static u32 ov16_0226CB10 (UnkStruct_ov16_0226CB10 * param0, int param1, int para } v2 = PAD_KEY_LEFT; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { param0->unk_02++; if (param0->unk_02 >= param1) { @@ -4445,9 +4445,9 @@ static u32 ov16_0226CB10 (UnkStruct_ov16_0226CB10 * param0, int param1, int para } v2 = PAD_KEY_RIGHT; - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v2 = PAD_BUTTON_A; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v2 = PAD_BUTTON_B; } else { return 0; diff --git a/src/overlay017/ov17_0223B140.c b/src/overlay017/ov17_0223B140.c index 3d13940afb..ab60f5f098 100644 --- a/src/overlay017/ov17_0223B140.c +++ b/src/overlay017/ov17_0223B140.c @@ -184,7 +184,7 @@ int ov17_0223B140 (UnkStruct_020067E8 * param0, int * param1) v0->unk_0C.unk_24 = sub_02018340(21); sub_0201DBEC(64, 21); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); v0->unk_7E4 = ov17_0223F88C(v0->unk_00, &v0->unk_0C, &v0->unk_220); diff --git a/src/overlay017/ov17_0223CB1C.c b/src/overlay017/ov17_0223CB1C.c index 02d0714f20..36418210df 100644 --- a/src/overlay017/ov17_0223CB1C.c +++ b/src/overlay017/ov17_0223CB1C.c @@ -163,7 +163,7 @@ int ov17_0223CB1C (UnkStruct_020067E8 * param0, int * param1) v0->unk_0C.unk_24 = sub_02018340(22); sub_0201DBEC(64, 22); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov17_0223D1B8(v0->unk_0C.unk_24); diff --git a/src/overlay017/ov17_0223DAD0.c b/src/overlay017/ov17_0223DAD0.c index 20e9f0abd5..2d4727f535 100644 --- a/src/overlay017/ov17_0223DAD0.c +++ b/src/overlay017/ov17_0223DAD0.c @@ -265,7 +265,7 @@ int ov17_0223DAD0 (UnkStruct_020067E8 * param0, int * param1) v0->unk_14.unk_60 = sub_02018340(23); sub_0201DBEC(64, 23); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); v0->unk_1074 = ov17_02249380(v0->unk_00, &v0->unk_14); diff --git a/src/overlay017/ov17_0223F7E4.c b/src/overlay017/ov17_0223F7E4.c index 265d6f2b23..b47e079ba9 100644 --- a/src/overlay017/ov17_0223F7E4.c +++ b/src/overlay017/ov17_0223F7E4.c @@ -1541,7 +1541,7 @@ static int ov17_02240C90 (UnkStruct_ov17_0223F7E4 * param0) } if (v0->unk_00 == 0) { - if ((param0->unk_304 == 1) || (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y | PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN))) { + if ((param0->unk_304 == 1) || (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y | PAD_KEY_RIGHT | PAD_KEY_LEFT | PAD_KEY_UP | PAD_KEY_DOWN))) { if (param0->unk_304 == 0) { Sound_PlayEffect(1500); } @@ -1702,7 +1702,7 @@ static u32 ov17_02241004 (UnkStruct_ov17_02241004 * param0, int param1, int para v1 = param0->unk_02; v0 = param0->unk_01; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_01--; if (param0->unk_01 < 0) { @@ -1721,7 +1721,7 @@ static u32 ov17_02241004 (UnkStruct_ov17_02241004 * param0, int param1, int para } v2 = PAD_KEY_UP; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_01++; if (param0->unk_01 >= param2) { @@ -1740,7 +1740,7 @@ static u32 ov17_02241004 (UnkStruct_ov17_02241004 * param0, int param1, int para } v2 = PAD_KEY_DOWN; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { param0->unk_02--; if (param0->unk_02 < 0) { @@ -1759,7 +1759,7 @@ static u32 ov17_02241004 (UnkStruct_ov17_02241004 * param0, int param1, int para } v2 = PAD_KEY_LEFT; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { param0->unk_02++; if (param0->unk_02 >= param1) { @@ -1778,9 +1778,9 @@ static u32 ov17_02241004 (UnkStruct_ov17_02241004 * param0, int param1, int para } v2 = PAD_KEY_RIGHT; - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v2 = PAD_BUTTON_A; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v2 = PAD_BUTTON_B; } else { return 0; diff --git a/src/overlay017/ov17_02247A48.c b/src/overlay017/ov17_02247A48.c index 05aecf0888..e9312d66ac 100644 --- a/src/overlay017/ov17_02247A48.c +++ b/src/overlay017/ov17_02247A48.c @@ -1332,7 +1332,7 @@ static void ov17_02249014 (SysTask * param0, void * param1) v0->unk_15 = 1; } - if ((v0->unk_00->unk_00->unk_155 == 0) && (v0->unk_18 < 30) && ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.touchInput))) { + if ((v0->unk_00->unk_00->unk_155 == 0) && (v0->unk_18 < 30) && ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.touchPressed))) { v0->unk_18 = 30; v1 = 0; v0->unk_13 = 0; diff --git a/src/overlay017/ov17_022492DC.c b/src/overlay017/ov17_022492DC.c index ebdc5f08fd..2994f330b1 100644 --- a/src/overlay017/ov17_022492DC.c +++ b/src/overlay017/ov17_022492DC.c @@ -485,13 +485,13 @@ int ov17_02249760 (UnkStruct_ov17_022492DC * param0) if (v1 == 0xffffffff) { if (v3->unk_18 == Unk_ov17_02254554) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_KEY_RIGHT)) { v1 = 3; - } else if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_KEY_DOWN)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_KEY_DOWN)) { v1 = 1; - } else if (gCoreSys.padInput & (PAD_BUTTON_X | PAD_KEY_UP)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_X | PAD_KEY_UP)) { v1 = 0; - } else if (gCoreSys.padInput & (PAD_BUTTON_Y | PAD_KEY_LEFT)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_Y | PAD_KEY_LEFT)) { v1 = 2; } } diff --git a/src/overlay017/ov17_0224F4D4.c b/src/overlay017/ov17_0224F4D4.c index 2053d1c242..88034325f2 100644 --- a/src/overlay017/ov17_0224F4D4.c +++ b/src/overlay017/ov17_0224F4D4.c @@ -174,7 +174,7 @@ int ov17_0224F4D4 (UnkStruct_020067E8 * param0, int * param1) v0->unk_10.unk_20 = sub_02018340(24); sub_0201DBEC(64, 24); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov17_0224FB34(v0->unk_10.unk_20); diff --git a/src/overlay019/ov19_021D0D80.c b/src/overlay019/ov19_021D0D80.c index dcfaccb34c..8857ada0b0 100644 --- a/src/overlay019/ov19_021D0D80.c +++ b/src/overlay019/ov19_021D0D80.c @@ -309,7 +309,7 @@ int ov19_021D0DEC (UnkStruct_020067E8 * param0, int * param1) return 0; } else { if (v0->unk_1A8 != NULL) { - if (gCoreSys.padInput & PAD_BUTTON_Y) { + if (gCoreSys.pressedKeys & PAD_BUTTON_Y) { if (ov19_021D6628(v0->unk_114) == 1) { ov19_021D5DD8(&v0->unk_00); ov19_021D6594(v0->unk_114, 43); @@ -485,7 +485,7 @@ static int ov19_021D0FF0 (UnkStruct_ov19_021D5DF8 * param0) { switch (param0->unk_1B0) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov19_021D5E4C(¶m0->unk_00)) { if (ov19_021D5E08(¶m0->unk_00) != 3) { ov19_021D0EB0(param0, ov19_021D20A4); @@ -496,24 +496,24 @@ static int ov19_021D0FF0 (UnkStruct_ov19_021D5DF8 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov19_021D0EB0(param0, ov19_021D1F5C); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_L) { + if (gCoreSys.heldKeys & PAD_BUTTON_L) { ov19_021D5CE8(¶m0->unk_00); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_R) { + if (gCoreSys.heldKeys & PAD_BUTTON_R) { ov19_021D5CBC(&(param0->unk_00)); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (ov19_021D4F74(gCoreSys.unk_44, param0)) { + if (ov19_021D4F74(gCoreSys.heldKeys, param0)) { ov19_021D6594(param0->unk_114, 5); if (ov19_021D5E38(¶m0->unk_00) == 1) { @@ -562,7 +562,7 @@ static int ov19_021D1270 (UnkStruct_ov19_021D5DF8 * param0) { switch (param0->unk_1B0) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov19_021D5E2C(¶m0->unk_00) == 6) { param0->unk_1B0 = 2; break; @@ -579,12 +579,12 @@ static int ov19_021D1270 (UnkStruct_ov19_021D5DF8 * param0) break; } - if ((gCoreSys.padInput & PAD_BUTTON_B) || ((gCoreSys.padInput & PAD_KEY_RIGHT) && (ov19_021D5E2C(¶m0->unk_00) & 1)) || ((gCoreSys.padInput & PAD_KEY_RIGHT) && (ov19_021D5E2C(¶m0->unk_00) == 6))) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || ((gCoreSys.pressedKeys & PAD_KEY_RIGHT) && (ov19_021D5E2C(¶m0->unk_00) & 1)) || ((gCoreSys.pressedKeys & PAD_KEY_RIGHT) && (ov19_021D5E2C(¶m0->unk_00) == 6))) { param0->unk_1B0 = 2; break; } - if (ov19_021D4F74(gCoreSys.unk_44, param0)) { + if (ov19_021D4F74(gCoreSys.heldKeys, param0)) { ov19_021D6594(param0->unk_114, 5); if (ov19_021D5E38(¶m0->unk_00) == 1) { @@ -645,7 +645,7 @@ static int ov19_021D1270 (UnkStruct_ov19_021D5DF8 * param0) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); param0->unk_1B0 = 0; } @@ -664,29 +664,29 @@ static int ov19_021D15C0 (UnkStruct_ov19_021D5DF8 * param0) { switch (param0->unk_1B0) { case 0: - if (gCoreSys.unk_44 & (PAD_KEY_LEFT | PAD_BUTTON_L)) { + if (gCoreSys.heldKeys & (PAD_KEY_LEFT | PAD_BUTTON_L)) { ov19_021D5CE8(¶m0->unk_00); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (gCoreSys.unk_44 & (PAD_KEY_RIGHT | PAD_BUTTON_R)) { + if (gCoreSys.heldKeys & (PAD_KEY_RIGHT | PAD_BUTTON_R)) { ov19_021D5CBC(&(param0->unk_00)); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov19_021D0EB0(param0, ov19_021D2694); break; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov19_021D0EB0(param0, ov19_021D1F5C); break; } - if (ov19_021D4F74(gCoreSys.unk_44, param0)) { + if (ov19_021D4F74(gCoreSys.heldKeys, param0)) { ov19_021D6594(param0->unk_114, 5); if (ov19_021D5E38(¶m0->unk_00) == 1) { @@ -713,29 +713,29 @@ static int ov19_021D17AC (UnkStruct_ov19_021D5DF8 * param0) { switch (param0->unk_1B0) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov19_021D0EB0(param0, ov19_021D1DEC); break; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov19_021D0EB0(param0, ov19_021D1F5C); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_L) { + if (gCoreSys.heldKeys & PAD_BUTTON_L) { ov19_021D5CE8(¶m0->unk_00); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_R) { + if (gCoreSys.heldKeys & PAD_BUTTON_R) { ov19_021D5CBC(&(param0->unk_00)); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (ov19_021D4F74(gCoreSys.unk_44, param0)) { + if (ov19_021D4F74(gCoreSys.heldKeys, param0)) { ov19_021D6594(param0->unk_114, 5); if (ov19_021D5E38(¶m0->unk_00) == 1) { @@ -767,7 +767,7 @@ static int ov19_021D19B8 (UnkStruct_ov19_021D5DF8 * param0) { switch (param0->unk_1B0) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov19_021D5E08(¶m0->unk_00) != 1) { ov19_021D6594(param0->unk_114, 34); param0->unk_1B0 = 1; @@ -780,24 +780,24 @@ static int ov19_021D19B8 (UnkStruct_ov19_021D5DF8 * param0) break; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov19_021D0EB0(param0, ov19_021D1F5C); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_L) { + if (gCoreSys.heldKeys & PAD_BUTTON_L) { ov19_021D5CE8(¶m0->unk_00); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (gCoreSys.unk_44 & PAD_BUTTON_R) { + if (gCoreSys.heldKeys & PAD_BUTTON_R) { ov19_021D5CBC(&(param0->unk_00)); ov19_021D0EB0(param0, ov19_021D45A8); break; } - if (ov19_021D4F74(gCoreSys.unk_44, param0)) { + if (ov19_021D4F74(gCoreSys.heldKeys, param0)) { ov19_021D6594(param0->unk_114, 5); if (ov19_021D5E38(¶m0->unk_00) == 1) { @@ -840,7 +840,7 @@ static int ov19_021D19B8 (UnkStruct_ov19_021D5DF8 * param0) } break; case 5: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); param0->unk_1B0 = 0; } @@ -961,7 +961,7 @@ static void ov19_021D1DEC (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } (*param1) = 5; case 5: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 6; } @@ -1017,7 +1017,7 @@ static void ov19_021D1F5C (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } (*param1) = 3; case 3: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 4; } @@ -1282,7 +1282,7 @@ static void ov19_021D2308 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } break; case 7: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 6; } @@ -1872,7 +1872,7 @@ static void ov19_021D2E1C (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } break; case 2: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 3; } @@ -1969,7 +1969,7 @@ static void ov19_021D3010 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 2; } @@ -2046,7 +2046,7 @@ static void ov19_021D30D0 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 8; } @@ -2128,7 +2128,7 @@ static void ov19_021D3294 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D4458(param0); (*param1) = 1; } @@ -2138,7 +2138,7 @@ static void ov19_021D3294 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 6; } @@ -2318,7 +2318,7 @@ static void ov19_021D35F8 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D5408(¶m0->unk_00, 4); ov19_021D6594(param0->unk_114, 24); (*param1) = 6; @@ -2329,7 +2329,7 @@ static void ov19_021D35F8 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D5408(¶m0->unk_00, 33); ov19_021D6594(param0->unk_114, 24); (*param1) = 6; @@ -2340,7 +2340,7 @@ static void ov19_021D35F8 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 7; } @@ -2364,7 +2364,7 @@ static void ov19_021D35F8 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov19_021D6594(param0->unk_114, 26); (*param1) = 9; } @@ -2680,7 +2680,7 @@ static void ov19_021D3D44 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; case 5: if (ov19_021D6600(param0->unk_114, 24)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov19_021D6594(param0->unk_114, 26); (*param1)++; @@ -2757,7 +2757,7 @@ static void ov19_021D3FB0 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; case 4: if (ov19_021D6600(param0->unk_114, 24)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov19_021D6594(param0->unk_114, 26); (*param1) = 5; @@ -2846,7 +2846,7 @@ static void ov19_021D4184 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) break; case 5: if (ov19_021D6600(param0->unk_114, 24)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov19_021D6594(param0->unk_114, 26); (*param1) = 6; @@ -2880,7 +2880,7 @@ static void ov19_021D4390 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } break; case 3: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_PLUS_KEY_MASK)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_PLUS_KEY_MASK)) { ov19_021D6594(param0->unk_114, 18); (*param1)++; } @@ -2944,7 +2944,7 @@ static BOOL ov19_021D4468 (UnkStruct_ov19_021D5DF8 * param0) break; } - if (gCoreSys.padInput & (PAD_KEY_LEFT | PAD_BUTTON_L)) { + if (gCoreSys.pressedKeys & (PAD_KEY_LEFT | PAD_BUTTON_L)) { v0->unk_05--; if (v0->unk_05 < 0) { @@ -2956,7 +2956,7 @@ static BOOL ov19_021D4468 (UnkStruct_ov19_021D5DF8 * param0) break; } - if (gCoreSys.padInput & (PAD_KEY_RIGHT | PAD_BUTTON_R)) { + if (gCoreSys.pressedKeys & (PAD_KEY_RIGHT | PAD_BUTTON_R)) { if (++(v0->unk_05) >= 18) { v0->unk_05 = 0; } @@ -2966,12 +2966,12 @@ static BOOL ov19_021D4468 (UnkStruct_ov19_021D5DF8 * param0) break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1501); return 1; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); v0->unk_05 = -1; return 1; @@ -3038,7 +3038,7 @@ static void ov19_021D4640 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } } - if (gCoreSys.padInput & (PAD_PLUS_KEY_MASK | PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_PLUS_KEY_MASK | PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov19_021D5D94(&(param0->unk_00), 0); ov19_021D5D9C(&(param0->unk_00), ov19_021D5E68(¶m0->unk_00)); @@ -3184,7 +3184,7 @@ static void ov19_021D4938 (UnkStruct_ov19_021D5DF8 * param0, u32 * param1) } } - if (gCoreSys.padInput & (PAD_PLUS_KEY_MASK | PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_PLUS_KEY_MASK | PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov19_021D5D94(¶m0->unk_00, 0); ov19_021D6594(param0->unk_114, 40); diff --git a/src/overlay019/ov19_021DF964.c b/src/overlay019/ov19_021DF964.c index c9d426bbc4..f62b8f418e 100644 --- a/src/overlay019/ov19_021DF964.c +++ b/src/overlay019/ov19_021DF964.c @@ -255,7 +255,7 @@ int ov19_021DFD2C (UnkStruct_ov19_021D4DF0 * param0) { UnkStruct_ov19_021DF964 * v0 = &(param0->unk_74); - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (v0->unk_20) { v0->unk_20--; return -2; @@ -265,7 +265,7 @@ int ov19_021DFD2C (UnkStruct_ov19_021D4DF0 * param0) } } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (v0->unk_20 < (v0->unk_21 - 1)) { v0->unk_20++; return -2; @@ -275,12 +275,12 @@ int ov19_021DFD2C (UnkStruct_ov19_021D4DF0 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); return -1; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1501); return v0->unk_00[v0->unk_20]; } diff --git a/src/overlay020/ov20_021D0D80.c b/src/overlay020/ov20_021D0D80.c index 82f3c1594d..7067fca67e 100644 --- a/src/overlay020/ov20_021D0D80.c +++ b/src/overlay020/ov20_021D0D80.c @@ -155,9 +155,9 @@ int ov20_021D0DF8 (UnkStruct_020067E8 * param0, int * param1) { UnkStruct_ov20_021D16E8 * v0 = sub_0200682C(param0); - v0->unk_30 = gCoreSys.padInput; - v0->unk_32 = gCoreSys.unk_44; - v0->unk_34 = gCoreSys.unk_4C; + v0->unk_30 = gCoreSys.pressedKeys; + v0->unk_32 = gCoreSys.heldKeys; + v0->unk_34 = gCoreSys.pressedKeysRepeatable; sub_0202404C(v0->unk_40); diff --git a/src/overlay021/ov21_021D3208.c b/src/overlay021/ov21_021D3208.c index dc3ac7032b..fe2f378c87 100644 --- a/src/overlay021/ov21_021D3208.c +++ b/src/overlay021/ov21_021D3208.c @@ -584,12 +584,12 @@ BOOL ov21_021D3954 (const UnkStruct_ov21_021D3320 * param0) void ov21_021D3960 (UnkStruct_ov21_021D3320 * param0) { - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { param0->unk_1758 = 0; return; } - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { if (param0->unk_1758 == 0) { param0->unk_1758 = 1; } else { diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 66b6674ad1..4301a7eb30 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -538,7 +538,7 @@ static void ov21_021D5FC4 (UnkStruct_ov21_021D5B68 * param0) static void ov21_021D5FD4 (UnkStruct_ov21_021D5B68 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_04->unk_1740 == 0) { param0->unk_28 = 1; } else { @@ -548,17 +548,17 @@ static void ov21_021D5FD4 (UnkStruct_ov21_021D5B68 * param0) return; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_2C = 1; return; } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { param0->unk_34 = 1; return; } - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { param0->unk_30 = 1; return; } @@ -1766,7 +1766,7 @@ static void ov21_021D7590 (UnkStruct_ov21_021D7464 * param0, UnkStruct_ov21_021D static void ov21_021D75DC (UnkStruct_ov21_021D7464 * param0, UnkStruct_ov21_021D5B68 * param1) { - if (gCoreSys.unk_44 & PAD_KEY_UP) { + if (gCoreSys.heldKeys & PAD_KEY_UP) { if (ov21_021D6108(param1, -1)) { ov21_021D60FC(param1, param0, 2); param1->unk_20 = 1; @@ -1779,7 +1779,7 @@ static void ov21_021D75DC (UnkStruct_ov21_021D7464 * param0, UnkStruct_ov21_021D return; } - if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + if (gCoreSys.heldKeys & PAD_KEY_DOWN) { if (ov21_021D6108(param1, 1)) { ov21_021D60FC(param1, param0, 1); param1->unk_20 = 1; @@ -1792,7 +1792,7 @@ static void ov21_021D75DC (UnkStruct_ov21_021D7464 * param0, UnkStruct_ov21_021D return; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { param0->unk_14 = 1; param0->unk_18 = 5; param0->unk_1C = -1; @@ -1801,7 +1801,7 @@ static void ov21_021D75DC (UnkStruct_ov21_021D7464 * param0, UnkStruct_ov21_021D return; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { param0->unk_14 = 1; param0->unk_18 = 5; param0->unk_1C = 1; diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index edfdacfdfd..e85e44c441 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -459,8 +459,8 @@ static void ov21_021D7B8C (u32 param0, u32 param1, void * param2) switch (param1) { case 0: - v2->unk_14 = gCoreSys.unk_5C; - v2->unk_18 = gCoreSys.unk_5E; + v2->unk_14 = gCoreSys.touchX; + v2->unk_18 = gCoreSys.touchY; break; case 2: switch (param0) { @@ -504,8 +504,8 @@ static void ov21_021D7B8C (u32 param0, u32 param1, void * param2) } } - v2->unk_14 = gCoreSys.unk_5C; - v2->unk_18 = gCoreSys.unk_5E; + v2->unk_14 = gCoreSys.touchX; + v2->unk_18 = gCoreSys.touchY; } v2->unk_20 = 1; @@ -835,8 +835,8 @@ static void ov21_021D8324 (UnkStruct_ov21_021D7A64 * param0) v1 = param0->unk_14 - (128 + 120); v0 = param0->unk_18 - (104 + -0); - v3 = gCoreSys.unk_5C - (128 + 120); - v2 = gCoreSys.unk_5E - (104 + -0); + v3 = gCoreSys.touchX - (128 + 120); + v2 = gCoreSys.touchY - (104 + -0); param0->unk_0C = sub_0201D4CC(v1, v0, v3, v2, 524); param0->unk_0C *= 10; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 001b005b97..abfa6a70c9 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -1389,7 +1389,7 @@ static void ov21_021DA534 (UnkStruct_ov21_021D4FE4 * param0, int param1) static void ov21_021DA5A8 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 1: @@ -1427,7 +1427,7 @@ static void ov21_021DA5A8 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D param0->unk_8C = 0; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param0->unk_80 = 0; param0->unk_2C[param0->unk_80] = 2; } @@ -1508,7 +1508,7 @@ static void ov21_021DA6B0 (UnkStruct_ov21_021D9B24 * param0, int param1) static void ov21_021DA7B0 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 8: @@ -1619,7 +1619,7 @@ static void ov21_021DA888 (UnkStruct_ov21_021D9B24 * param0, int param1) static void ov21_021DA988 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 6: @@ -1766,7 +1766,7 @@ static void ov21_021DAAD4 (UnkStruct_ov21_021D9B24 * param0, int param1) static void ov21_021DAC08 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 6: @@ -1932,7 +1932,7 @@ static void ov21_021DAD74 (UnkStruct_ov21_021D9B24 * param0, int param1) static void ov21_021DAED8 (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 6: @@ -2060,7 +2060,7 @@ static void ov21_021DB02C (UnkStruct_ov21_021D9B24 * param0, int param1) static void ov21_021DB12C (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { if (param0->unk_8C == 0) { switch (ov21_021D4F7C(param0->unk_18)) { case 6: @@ -2134,22 +2134,22 @@ static void ov21_021DB12C (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D static void ov21_021DB2FC (UnkStruct_ov21_021D9B24 * param0, UnkStruct_ov21_021D95B8 * param1) { - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov21_021D4F20(param0->unk_18, 0, 1); param0->unk_8C = 1; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov21_021D4F20(param0->unk_18, 0, -1); param0->unk_8C = 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { ov21_021D4F20(param0->unk_18, 1, -1); param0->unk_8C = 1; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { ov21_021D4F20(param0->unk_18, 1, 1); param0->unk_8C = 1; } diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index db338a59e1..a427dad554 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -483,14 +483,14 @@ static void ov21_021DE358 (UnkStruct_ov21_021DDE4C * param0, UnkStruct_ov21_021D { s32 v0; - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { return; } if ((ov21_021E33BC(param1->unk_08) == 1) && (ov21_021D3998(param1->unk_04) == 2)) { v0 = ov21_021DCA28(param1->unk_00); - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v0--; if (v0 < 0) { @@ -500,7 +500,7 @@ static void ov21_021DE358 (UnkStruct_ov21_021DDE4C * param0, UnkStruct_ov21_021D ov21_021DCA30(param1->unk_00, v0); ov21_021DE5A4(param0, param1); param0->unk_24 = 1; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v0++; if (v0 >= 3) { @@ -522,9 +522,9 @@ static void ov21_021DE3D0 (UnkStruct_ov21_021DDE4C * param0, UnkStruct_ov21_021D param0->unk_24 = 0; if (param0->unk_20) { - if (gCoreSys.unk_62) { - param0->unk_00 = gCoreSys.unk_5C - param0->unk_08; - param0->unk_04 = gCoreSys.unk_5E - param0->unk_0C; + if (gCoreSys.touchHeld) { + param0->unk_00 = gCoreSys.touchX - param0->unk_08; + param0->unk_04 = gCoreSys.touchY - param0->unk_0C; if (param0->unk_00 < 24) { param0->unk_00 = 24; @@ -571,8 +571,8 @@ static void ov21_021DE44C (u32 param0, u32 param1, void * param2) Sound_PlayEffect(1501); v2->unk_20 = 1; - v2->unk_08 = gCoreSys.unk_5C - v2->unk_00; - v2->unk_0C = gCoreSys.unk_5E - v2->unk_04; + v2->unk_08 = gCoreSys.touchX - v2->unk_00; + v2->unk_0C = gCoreSys.touchY - v2->unk_04; break; default: break; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index a8eaa4a022..e8b7cf916f 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -1072,12 +1072,12 @@ static void ov21_021E2864 (UnkStruct_ov21_021E1E74 * param0, UnkStruct_ov21_021E static void ov21_021E28A8 (UnkStruct_ov21_021E1E74 * param0) { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_34 = 1; return; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_34 = 0; return; } diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index 5a66c6f633..5b765e58fc 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -1384,7 +1384,7 @@ static void ov21_021E3C34 (UnkStruct_ov21_021E342C * param0) ov21_021E3C64(param0); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov21_021E2E00(v0); param0->unk_2C = 1; Sound_PlayEffect(1501); @@ -1429,15 +1429,15 @@ static void ov21_021E3D48 (UnkStruct_ov21_021E37B4 * param0, UnkStruct_ov21_021E return; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov21_021D4F20(param0->unk_14, 0, 1); } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov21_021D4F20(param0->unk_14, 0, -1); } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { switch (ov21_021D4F7C(param0->unk_14)) { case 0: if (v0->unk_08 != 0) { @@ -1542,11 +1542,11 @@ static void ov21_021E3EEC (UnkStruct_ov21_021E37B4 * param0, UnkStruct_ov21_021E } if ((param1->unk_30 == 0)) { - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param1->unk_30 = 1; } } else { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param1->unk_30 = 0; } } diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 7cbe0a0f83..c699e877ec 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -631,7 +631,7 @@ static void ov21_021E530C (u32 param0, UnkStruct_ov21_021E4D90 * param1, UnkStru ov21_021E5E18(param2); } - param2->unk_38 = gCoreSys.unk_5C; + param2->unk_38 = gCoreSys.touchX; param2->unk_30 = 1; break; case 1: @@ -640,8 +640,8 @@ static void ov21_021E530C (u32 param0, UnkStruct_ov21_021E4D90 * param1, UnkStru } param2->unk_4C = 1; - param2->unk_54 = gCoreSys.unk_5C; - param2->unk_58 = gCoreSys.unk_5E; + param2->unk_54 = gCoreSys.touchX; + param2->unk_58 = gCoreSys.touchY; break; case 2: if (param2->unk_2C) { @@ -663,18 +663,18 @@ static void ov21_021E537C (u32 param0, UnkStruct_ov21_021E4D90 * param1, UnkStru switch (param0) { case 0: if (param2->unk_30 == 1) { - v0 = gCoreSys.unk_5C - param2->unk_38; + v0 = gCoreSys.touchX - param2->unk_38; if (param2->unk_34 == 0) { if (12 <= v0) { param2->unk_34 = 1; - param2->unk_38 = gCoreSys.unk_5C; + param2->unk_38 = gCoreSys.touchX; Sound_PlayEffect(1527); } } else { if (-12 >= v0) { param2->unk_34 = 0; - param2->unk_38 = gCoreSys.unk_5C; + param2->unk_38 = gCoreSys.touchX; Sound_PlayEffect(1527); } } @@ -686,8 +686,8 @@ static void ov21_021E537C (u32 param0, UnkStruct_ov21_021E4D90 * param1, UnkStru ov21_021E5AAC(param2); ov21_021E5AD8(param2); - param2->unk_54 = gCoreSys.unk_5C; - param2->unk_58 = gCoreSys.unk_5E; + param2->unk_54 = gCoreSys.touchX; + param2->unk_58 = gCoreSys.touchY; } break; case 2: @@ -696,11 +696,11 @@ static void ov21_021E537C (u32 param0, UnkStruct_ov21_021E4D90 * param1, UnkStru param2->unk_20 = 1; ov21_021E5ED8(param2, 0); } else { - if (gCoreSys.unk_5E < (99 - -16) + 16) { + if (gCoreSys.touchY < (99 - -16) + 16) { if (param2->unk_34 == 0) { - ov21_021E5BE4(param2, gCoreSys.unk_5C); + ov21_021E5BE4(param2, gCoreSys.touchX); } else { - ov21_021E5C18(param2, gCoreSys.unk_5C); + ov21_021E5C18(param2, gCoreSys.touchX); } param2->unk_3C = 0; @@ -1022,8 +1022,8 @@ static void ov21_021E5A44 (UnkStruct_ov21_021E51DC * param0) v1 = param0->unk_54 - 51; v0 = param0->unk_58 - 157; - v3 = gCoreSys.unk_5C - 51; - v2 = gCoreSys.unk_5E - 157; + v3 = gCoreSys.touchX - 51; + v2 = gCoreSys.touchY - 157; v4 = sub_0201D4CC(v1, v0, v3, v2, 0); if (MATH_IAbs(v4) < 1) { @@ -1383,7 +1383,7 @@ static void ov21_021E5F5C (UnkStruct_ov21_021E51DC * param0, UnkStruct_ov21_021E { int v0 = ov21_021D37BC(param1->unk_04); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_28 = 1; param0->unk_18[0] = 0; diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 996a6146ba..e24c0ef98a 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -733,7 +733,7 @@ static void ov21_021E728C (UnkStruct_ov21_021E6C60 * param0, UnkStruct_ov21_021E static void ov21_021E72E8 (UnkStruct_ov21_021E6DAC * param0, UnkStruct_ov21_021E6A20 * param1) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param1->unk_04 == 1) { param1->unk_04 = 0; *param1->unk_00 |= (1 << 0); diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index d066b627ff..0e0ebbea7d 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -690,7 +690,7 @@ static void ov21_021E8CBC (UnkStruct_ov21_021E8584 * param0, UnkStruct_ov21_021E static void ov21_021E8CF0 (UnkStruct_ov21_021E88B0 * param0, UnkStruct_ov21_021E8570 * param1) { - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { param0->unk_14 = 1; } } diff --git a/src/overlay022/ov22_02254DE0.c b/src/overlay022/ov22_02254DE0.c index e17b719d56..ef5411d580 100644 --- a/src/overlay022/ov22_02254DE0.c +++ b/src/overlay022/ov22_02254DE0.c @@ -75,8 +75,8 @@ BOOL ov22_02254E54 (UnkStruct_ov22_02255040 * param0, int * param1, int * param2 ov22_02254F00(param0, &v1, &v2); - *param1 = gCoreSys.unk_5C - v1; - *param2 = gCoreSys.unk_5E - v2; + *param1 = gCoreSys.touchX - v1; + *param2 = gCoreSys.touchY - v2; for (v3 = (*param2 - 4); v3 < (*param2 + 4); v3++) { if (v3 >= 0) { diff --git a/src/overlay022/ov22_02255D44.c b/src/overlay022/ov22_02255D44.c index 8de45e0d87..07dfbbdce1 100644 --- a/src/overlay022/ov22_02255D44.c +++ b/src/overlay022/ov22_02255D44.c @@ -277,7 +277,7 @@ int ov22_02255E50 (UnkStruct_020067E8 * param0, int * param1) } break; case 5: - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) | (gCoreSys.touchInput)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) | (gCoreSys.touchPressed)) { ov22_0225A628(&v0->unk_5C4, 26, 385, 48); sub_02002B20(0); (*param1)++; diff --git a/src/overlay022/ov22_022588F0.c b/src/overlay022/ov22_022588F0.c index 05d2b750c3..e76bf4e76b 100644 --- a/src/overlay022/ov22_022588F0.c +++ b/src/overlay022/ov22_022588F0.c @@ -20,10 +20,10 @@ void ov22_022588F0 (UnkStruct_ov22_02258A48 * param0) void ov22_0225890C (UnkStruct_ov22_02258A48 * param0) { - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { param0->unk_04(param0); } else { - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { param0->unk_0C(param0); } else { if (param0->unk_18) { @@ -32,9 +32,9 @@ void ov22_0225890C (UnkStruct_ov22_02258A48 * param0) } } - param0->unk_14 = gCoreSys.unk_5C; - param0->unk_16 = gCoreSys.unk_5E; - param0->unk_18 = gCoreSys.unk_62; + param0->unk_14 = gCoreSys.touchX; + param0->unk_16 = gCoreSys.touchY; + param0->unk_18 = gCoreSys.touchHeld; } static void ov22_02258948 (UnkStruct_ov22_02258A48 * param0) diff --git a/src/overlay022/ov22_022589E0.c b/src/overlay022/ov22_022589E0.c index 349ada401a..5ba25059f0 100644 --- a/src/overlay022/ov22_022589E0.c +++ b/src/overlay022/ov22_022589E0.c @@ -275,9 +275,9 @@ static void ov22_02258D4C (UnkStruct_ov22_02258A48 * param0) int v1, v2; if (v0->unk_10 != NULL) { - if ((gCoreSys.unk_5C != 0xffff) && (gCoreSys.unk_5C != 0xffff)) { - v1 = gCoreSys.unk_5C - v0->unk_14; - v2 = gCoreSys.unk_5E - v0->unk_18; + if ((gCoreSys.touchX != 0xffff) && (gCoreSys.touchX != 0xffff)) { + v1 = gCoreSys.touchX - v0->unk_14; + v2 = gCoreSys.touchY - v0->unk_18; ov22_022595F8(v0->unk_10, v1, v2); } @@ -312,12 +312,12 @@ static void ov22_02258DAC (UnkStruct_ov22_02258A48 * param0) int v9, v10; if (v0->unk_10 != NULL) { - if ((gCoreSys.unk_5C != 0xffff) && (gCoreSys.unk_5C != 0xffff)) { + if ((gCoreSys.touchX != 0xffff) && (gCoreSys.touchX != 0xffff)) { ov22_022596B0(v0->unk_10, &v7, &v9, &v8, &v10); ov22_02259698(v0->unk_10, &v1, &v2); - v3 = gCoreSys.unk_5C - v0->unk_14; - v4 = gCoreSys.unk_5E - v0->unk_18; + v3 = gCoreSys.touchX - v0->unk_14; + v4 = gCoreSys.touchY - v0->unk_18; v5 = v3 + v7; v6 = v4 + v8; diff --git a/src/overlay022/ov22_02259098.c b/src/overlay022/ov22_02259098.c index 2640d8ff1f..9137ebf4c6 100644 --- a/src/overlay022/ov22_02259098.c +++ b/src/overlay022/ov22_02259098.c @@ -158,8 +158,8 @@ BOOL ov22_02259278 (UnkStruct_020298D8 * param0, int * param1, int * param2, NNS v3 -= (v1 / 2); v4 -= (v2 / 2); - *param1 = gCoreSys.unk_5C - v3; - *param2 = gCoreSys.unk_5E - v4; + *param1 = gCoreSys.touchX - v3; + *param2 = gCoreSys.touchY - v4; v0 = ov22_02255420(param3, *param1, *param2, 0); diff --git a/src/overlay022/ov22_0225B660.c b/src/overlay022/ov22_0225B660.c index bf4e2707a7..06e6037413 100644 --- a/src/overlay022/ov22_0225B660.c +++ b/src/overlay022/ov22_0225B660.c @@ -143,7 +143,7 @@ int ov22_0225B738 (UnkStruct_020067E8 * param0, int * param1) } break; case 3: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { (*param1)++; } break; diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index d1a457d8c5..6915fd05b6 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1504,7 +1504,7 @@ static void ov23_0223F118 (SysTask * param0, void * param1) break; case 12: if (Message_Printing(Unk_ov23_02257740->unk_A24) == 0) { - if (gCoreSys.touchInput || (gCoreSys.padInput & PAD_BUTTON_A)) { + if (gCoreSys.touchPressed || (gCoreSys.pressedKeys & PAD_BUTTON_A)) { ov23_02254044(ov23_0224219C()); v0->unk_00++; } @@ -1535,7 +1535,7 @@ static void ov23_0223F118 (SysTask * param0, void * param1) if (Message_Printing(Unk_ov23_02257740->unk_A24) == 0) { v0->unk_4C--; - if (gCoreSys.touchInput || (gCoreSys.padInput & PAD_BUTTON_A) || (v0->unk_4C == 0)) { + if (gCoreSys.touchPressed || (gCoreSys.pressedKeys & PAD_BUTTON_A) || (v0->unk_4C == 0)) { ov23_02254044(ov23_0224219C()); v0->unk_00 = 16; } @@ -1557,7 +1557,7 @@ static void ov23_0223F118 (SysTask * param0, void * param1) if (Message_Printing(Unk_ov23_02257740->unk_A24) == 0) { v0->unk_4C--; - if (gCoreSys.touchInput || (gCoreSys.padInput & PAD_BUTTON_A) || (v0->unk_4C == 0)) { + if (gCoreSys.touchPressed || (gCoreSys.pressedKeys & PAD_BUTTON_A) || (v0->unk_4C == 0)) { if (ov23_02240A90(v0)) { v0->unk_4C = 60; v0->unk_00 = 15; @@ -1666,7 +1666,7 @@ static void ov23_0223F118 (SysTask * param0, void * param1) if (Message_Printing(Unk_ov23_02257740->unk_A24) == 0) { v0->unk_4C--; - if (gCoreSys.touchInput || (gCoreSys.padInput & PAD_BUTTON_A) || (v0->unk_4C == 0)) { + if (gCoreSys.touchPressed || (gCoreSys.pressedKeys & PAD_BUTTON_A) || (v0->unk_4C == 0)) { ov23_02254044(ov23_0224219C()); v0->unk_00 = 19; } @@ -2701,12 +2701,12 @@ static BOOL ov23_02240CFC (UnkStruct_ov23_0223EE80 * param0) Unk_ov23_02257740->unk_A29 = 0; } - if (gCoreSys.touchInput) { - if ((gCoreSys.unk_5C < 2 * 8 * 13) && (gCoreSys.unk_5E >= 4 * 8)) { - v0[0] = gCoreSys.unk_5C; - v0[1] = gCoreSys.unk_5E; + if (gCoreSys.touchPressed) { + if ((gCoreSys.touchX < 2 * 8 * 13) && (gCoreSys.touchY >= 4 * 8)) { + v0[0] = gCoreSys.touchX; + v0[1] = gCoreSys.touchY; - ov23_022402B8(gCoreSys.unk_5C, gCoreSys.unk_5E, Unk_ov23_02257740->unk_A28, param0); + ov23_022402B8(gCoreSys.touchX, gCoreSys.touchY, Unk_ov23_02257740->unk_A28, param0); if (Unk_ov23_02257740->unk_A28) { v1 = 4; @@ -2726,7 +2726,7 @@ static BOOL ov23_02240CFC (UnkStruct_ov23_0223EE80 * param0) ov23_02240688(Unk_ov23_02257740->unk_04); Unk_ov23_02257740->unk_A2C = 1; - } else if (gCoreSys.unk_5C >= (2 * 8 * 13)) { + } else if (gCoreSys.touchX >= (2 * 8 * 13)) { Unk_ov23_02257740->unk_A29 = 2; } } @@ -2739,7 +2739,7 @@ static BOOL ov23_02240CFC (UnkStruct_ov23_0223EE80 * param0) } } - ov23_022404F8(Unk_ov23_02257740->unk_04, gCoreSys.unk_5C, gCoreSys.unk_5E, Unk_ov23_02257740->unk_A29); + ov23_022404F8(Unk_ov23_02257740->unk_04, gCoreSys.touchX, gCoreSys.touchY, Unk_ov23_02257740->unk_A29); if (Unk_ov23_02257740->unk_A29 >= 2) { Unk_ov23_02257740->unk_A29++; diff --git a/src/overlay023/ov23_02241F74.c b/src/overlay023/ov23_02241F74.c index 13b0e23171..f7861f7303 100644 --- a/src/overlay023/ov23_02241F74.c +++ b/src/overlay023/ov23_02241F74.c @@ -355,7 +355,7 @@ BOOL ov23_02242458 (void) return 0; } - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { Unk_ov23_02257748->unk_134 = 30; if (!Unk_ov23_02257748->unk_14B) { @@ -368,13 +368,13 @@ BOOL ov23_02242458 (void) return 0; } - v0 = ov5_021EAFA4(gCoreSys.unk_5C, gCoreSys.unk_5E, Unk_ov23_02257748->unk_0C->unk_8C); + v0 = ov5_021EAFA4(gCoreSys.touchX, gCoreSys.touchY, Unk_ov23_02257748->unk_0C->unk_8C); ov5_021E9230(v0.x, v0.z, &v2, &v3); v4.unk_00 = v2; v4.unk_02 = v3; - Unk_ov23_02257748->unk_18.unk_00 = gCoreSys.unk_5C; - Unk_ov23_02257748->unk_18.unk_02 = gCoreSys.unk_5E; + Unk_ov23_02257748->unk_18.unk_00 = gCoreSys.touchX; + Unk_ov23_02257748->unk_18.unk_02 = gCoreSys.touchY; Unk_ov23_02257748->unk_1C.unk_00 = v2; Unk_ov23_02257748->unk_1C.unk_02 = v3; diff --git a/src/overlay023/ov23_0224340C.c b/src/overlay023/ov23_0224340C.c index 3aca80e706..c229213b4e 100644 --- a/src/overlay023/ov23_0224340C.c +++ b/src/overlay023/ov23_0224340C.c @@ -2393,11 +2393,11 @@ static void ov23_022451C8 (SysTask * param0, void * param1) } break; case 7: - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { UnkStruct_ov23_0224271C v4; - v4.unk_00 = gCoreSys.unk_5C; - v4.unk_02 = gCoreSys.unk_5E; + v4.unk_00 = gCoreSys.touchX; + v4.unk_02 = gCoreSys.touchY; if (ov23_02245064(&v4, v0->unk_10, v0)) { if (v0->unk_19) { @@ -3745,14 +3745,14 @@ static BOOL ov23_02246F20 (BGL * param0, UnkStruct_ov23_022468DC * param1) return 1; } - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { for (v0 = 0; v0 < ov23_022468C0(); v0++) { if (param1->unk_E4[v0]) { continue; } - v8 = gCoreSys.unk_5C * FX32_ONE - param1->unk_44[v0].unk_00; - v9 = gCoreSys.unk_5E * FX32_ONE - param1->unk_44[v0].unk_04; + v8 = gCoreSys.touchX * FX32_ONE - param1->unk_44[v0].unk_00; + v9 = gCoreSys.touchY * FX32_ONE - param1->unk_44[v0].unk_04; v11 = FX_Mul(v8, v8) + FX_Mul(v9, v9); v11 = FX_Sqrt(v11); @@ -3990,9 +3990,9 @@ static BOOL ov23_02247568 (BGL * param0, UnkStruct_ov23_022471D8 * param1) } break; case 3: - if (gCoreSys.touchInput) { - v7 = (gCoreSys.unk_5C - 128) * FX32_ONE; - v8 = (gCoreSys.unk_5E - param1->unk_120) * FX32_ONE; + if (gCoreSys.touchPressed) { + v7 = (gCoreSys.touchX - 128) * FX32_ONE; + v8 = (gCoreSys.touchY - param1->unk_120) * FX32_ONE; v10 = FX_Mul(v7, v7) + FX_Mul(v8, v8); v10 = FX_Sqrt(v10); diff --git a/src/overlay023/ov23_02248C08.c b/src/overlay023/ov23_02248C08.c index 313c016610..00a0599054 100644 --- a/src/overlay023/ov23_02248C08.c +++ b/src/overlay023/ov23_02248C08.c @@ -99,7 +99,7 @@ u32 ov23_02248D20 (UnkStruct_ov23_02248D20 * param0) if (param0->unk_1C) { ov23_02248CA4(v1, v2, param0); - if ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_BUTTON_SELECT)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_BUTTON_SELECT)) { Sound_PlayEffect(1500); if (v1 + v2 == v8 - 1) { @@ -163,7 +163,7 @@ u32 ov23_02248D20 (UnkStruct_ov23_02248D20 * param0) return 0xffffffff; } } else { - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { Sound_PlayEffect(1500); if (v1 + v2 == v8 - 1) { diff --git a/src/overlay023/ov23_0224B05C.c b/src/overlay023/ov23_0224B05C.c index bc52190e7b..3fa397fd38 100644 --- a/src/overlay023/ov23_0224B05C.c +++ b/src/overlay023/ov23_0224B05C.c @@ -1681,7 +1681,7 @@ static BOOL ov23_0224C790 (UnkStruct_020508D4 * param0) break; case 12: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v1->unk_0C = 13; ov23_02254044(ov23_0224219C()); sub_020593F4(0); @@ -1716,7 +1716,7 @@ static BOOL ov23_0224C790 (UnkStruct_020508D4 * param0) return 1; case 8: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v1->unk_0C = 13; ov23_02254044(ov23_0224219C()); return 0; @@ -1810,7 +1810,7 @@ static void ov23_0224CB1C (SysTask * param0, void * param1) break; case 4: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v4 = 1; } } @@ -2371,7 +2371,7 @@ static void ov23_0224D5BC (SysTask * param0, void * param1) break; case 1: if (ov23_02254238(ov23_022421AC()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { int v1 = v0->unk_05; ov23_02253F40(ov23_022421AC(), 14 + v1, 0, NULL); @@ -2381,7 +2381,7 @@ static void ov23_0224D5BC (SysTask * param0, void * param1) break; case 2: if (ov23_02254238(ov23_022421AC()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov23_0224D54C(v0); v0->unk_00 = 4; ov23_02254044(ov23_022421AC()); diff --git a/src/overlay023/ov23_0224DC40.c b/src/overlay023/ov23_0224DC40.c index 04460642bd..5f6249c909 100644 --- a/src/overlay023/ov23_0224DC40.c +++ b/src/overlay023/ov23_0224DC40.c @@ -629,7 +629,7 @@ static void ov23_0224E2D8 (SysTask * param0, void * param1) break; case 7: if (ov23_02254238(ov23_0224219C()) == 0) { - if (( PAD_BUTTON_A )&gCoreSys.padInput) { + if (( PAD_BUTTON_A )&gCoreSys.pressedKeys) { v0->unk_37 = 4; } } @@ -666,7 +666,7 @@ static void ov23_0224E2D8 (SysTask * param0, void * param1) break; case 15: if (ov23_02254238(ov23_0224219C()) == 0) { - if (( PAD_BUTTON_A )&gCoreSys.padInput) { + if (( PAD_BUTTON_A )&gCoreSys.pressedKeys) { v0->unk_37 = 14; } } @@ -815,7 +815,7 @@ static void ov23_0224E2D8 (SysTask * param0, void * param1) break; case 37: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0->unk_37 = 38; } } @@ -1093,7 +1093,7 @@ static void ov23_0224EC50 (SysTask * param0, void * param1) case 2: v0->unk_2E = 12; - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov23_0224DC40(v0, 8); v0->unk_34 = 8; } else if (v0->unk_35 == 5) { @@ -1121,7 +1121,7 @@ static void ov23_0224EC50 (SysTask * param0, void * param1) break; case 9: if (ov23_02254238(ov23_0224219C()) == 0) { - if (( PAD_BUTTON_A )&gCoreSys.padInput) { + if (( PAD_BUTTON_A )&gCoreSys.pressedKeys) { v0->unk_34 = 4; } } @@ -1179,7 +1179,7 @@ static void ov23_0224EC50 (SysTask * param0, void * param1) break; case 21: if (ov23_02254238(ov23_0224219C()) == 0) { - if (( PAD_BUTTON_A )&gCoreSys.padInput) { + if (( PAD_BUTTON_A )&gCoreSys.pressedKeys) { ov23_0224DC40(v0, 15); v0->unk_34 = 15; } diff --git a/src/overlay023/ov23_0224F294.c b/src/overlay023/ov23_0224F294.c index 5e1871471f..dba63a2f52 100644 --- a/src/overlay023/ov23_0224F294.c +++ b/src/overlay023/ov23_0224F294.c @@ -581,7 +581,7 @@ static void ov23_0224F914 (SysTask * param0, void * param1) break; case 13: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov23_02254044(ov23_0224219C()); ov23_02250B34(param0, v0, 0); ov23_02243204(); @@ -591,7 +591,7 @@ static void ov23_0224F914 (SysTask * param0, void * param1) break; case 14: if (ov23_02254238(ov23_0224219C()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { UnkFuncPtr_ov23_0224F914 v2 = (UnkFuncPtr_ov23_0224F914)v0->unk_00; v2(v0); @@ -1533,7 +1533,7 @@ static void ov23_02250B9C (SysTask * param0, void * param1) return; case 4: if (ov23_02254238(ov23_022421AC()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0->unk_2AA = 2; } } diff --git a/src/overlay023/ov23_0225128C.c b/src/overlay023/ov23_0225128C.c index bddca67f2d..eb58bef672 100644 --- a/src/overlay023/ov23_0225128C.c +++ b/src/overlay023/ov23_0225128C.c @@ -588,7 +588,7 @@ static BOOL ov23_02251960 (SysTask * param0, void * param1) static BOOL ov23_02251A58 (UnkStruct_ov23_02250CD4 * param0) { if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov23_02254044(ov23_022421BC()); return 1; } @@ -715,7 +715,7 @@ static void ov23_02251C04 (SysTask * param0, void * param1) v0->unk_2AA = 7; break; case 7: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov23_02253D10(v0->unk_270); v0->unk_270 = NULL; v0->unk_2AA = 0; @@ -770,7 +770,7 @@ static void ov23_02251C04 (SysTask * param0, void * param1) break; case 16: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { if (!sub_02033DFC()) { sub_0200AAE0(1, 0, -6, GX_BLEND_PLANEMASK_BG0, 1); } diff --git a/src/overlay023/ov23_022521F0.c b/src/overlay023/ov23_022521F0.c index cf05166441..0abd7cb613 100644 --- a/src/overlay023/ov23_022521F0.c +++ b/src/overlay023/ov23_022521F0.c @@ -717,7 +717,7 @@ static void ov23_02252E70 (SysTask * param0, void * param1) break; case 6: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0->unk_2AA = 7; } } @@ -785,7 +785,7 @@ static void ov23_02252E70 (SysTask * param0, void * param1) break; case 9: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (v0->unk_2AC == 1) { ov23_02252CF4(2, v0->unk_2A8); } else if (v0->unk_2AC == 0) { @@ -801,7 +801,7 @@ static void ov23_02252E70 (SysTask * param0, void * param1) break; case 10: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov23_02252C9C(8); v0->unk_2AA = 2; } @@ -882,7 +882,7 @@ static void ov23_02252E70 (SysTask * param0, void * param1) break; case 16: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov23_0225412C(ov23_022421BC(), v0->unk_27E[0]); ov23_02252CE0(2, v0->unk_279[0]); ov23_02252C9C(7); @@ -899,7 +899,7 @@ static void ov23_02252E70 (SysTask * param0, void * param1) break; case 18: if (ov23_02254238(ov23_022421BC()) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov23_02252CD4(); ov23_02252C78(v0); ov23_02243204(); diff --git a/src/overlay023/ov23_02253598.c b/src/overlay023/ov23_02253598.c index 9eee4765a7..4315b996ee 100644 --- a/src/overlay023/ov23_02253598.c +++ b/src/overlay023/ov23_02253598.c @@ -349,7 +349,7 @@ static void ov23_0225381C (SysTask * param0, void * param1) { UnkStruct_ov23_022537D4 * v0 = param1; - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov23_022537D4(param0, param1); } } diff --git a/src/overlay023/ov23_02253D40.c b/src/overlay023/ov23_02253D40.c index 6df50e392d..729b7158cb 100644 --- a/src/overlay023/ov23_02253D40.c +++ b/src/overlay023/ov23_02253D40.c @@ -149,7 +149,7 @@ static void ov23_02253E40 (SysTask * param0, void * param1) } } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov23_02254044(v0); } } diff --git a/src/overlay023/ov23_02254A14.c b/src/overlay023/ov23_02254A14.c index d670431c7a..d5682a31a6 100644 --- a/src/overlay023/ov23_02254A14.c +++ b/src/overlay023/ov23_02254A14.c @@ -212,7 +212,7 @@ static BOOL ov23_02254AD4 (UnkStruct_020508D4 * param0) switch (v1->unk_00) { case 0: - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); v1->unk_504 = ov23_022542CC(); ov23_022542D8(v1->unk_504, v0, &v1->unk_516, &v1->unk_51A); @@ -417,22 +417,22 @@ static BOOL ov23_02254DF8 (UnkStruct_020508D4 * param0) v12 = 1; v13 = v6->unk_3C.unk_00; - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { v0 = -(FX32_ONE * 16); v1 = 0; v13.unk_00--; v13.unk_08--; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { v0 = (FX32_ONE * 16); v1 = 0; v13.unk_00++; v13.unk_08++; - } else if (gCoreSys.unk_4C & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { v0 = 0; v1 = -(FX32_ONE * 16); v13.unk_04--; v13.unk_0C--; - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { v0 = 0; v1 = (FX32_ONE * 16); v13.unk_04++; @@ -456,9 +456,9 @@ static BOOL ov23_02254DF8 (UnkStruct_020508D4 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v4 = 1; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov23_02254A94(v5, v6->unk_3C.unk_10); v6->unk_04 = 0; return 0; @@ -572,22 +572,22 @@ static BOOL ov23_02255100 (UnkStruct_020508D4 * param0) v3 = v7->unk_4FC->unk_58.z; if (!v4) { - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { Sound_PlayEffect(1509); v2 -= (FX32_ONE * 16); v1.unk_00--; v1.unk_08--; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { Sound_PlayEffect(1509); v2 += (FX32_ONE * 16); v1.unk_00++; v1.unk_08++; - } else if (gCoreSys.unk_4C & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { Sound_PlayEffect(1509); v3 -= (FX32_ONE * 16); v1.unk_04--; v1.unk_0C--; - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { Sound_PlayEffect(1509); v3 += (FX32_ONE * 16); v1.unk_04++; @@ -596,9 +596,9 @@ static BOOL ov23_02255100 (UnkStruct_020508D4 * param0) v0 = 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v5 = 1; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov23_02255F20(v7->unk_4FC); ov23_0225628C(v6, &v7->unk_4DC); ov23_02255EBC(3, v7); @@ -807,22 +807,22 @@ static BOOL ov23_02255580 (UnkStruct_020508D4 * param0) v3 = v7->unk_4FC->unk_58.z; if (!v4) { - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { Sound_PlayEffect(1509); v2 -= (FX32_ONE * 16); v1.unk_00--; v1.unk_08--; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { Sound_PlayEffect(1509); v2 += (FX32_ONE * 16); v1.unk_00++; v1.unk_08++; - } else if (gCoreSys.unk_4C & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { Sound_PlayEffect(1509); v3 -= (FX32_ONE * 16); v1.unk_04--; v1.unk_0C--; - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { Sound_PlayEffect(1509); v3 += (FX32_ONE * 16); v1.unk_04++; @@ -831,9 +831,9 @@ static BOOL ov23_02255580 (UnkStruct_020508D4 * param0) v0 = 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v5 = 1; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov23_02255F20(v7->unk_4FC); ov23_0225628C(v6, &v7->unk_4DC); ov23_02255EBC(3, v7); @@ -945,22 +945,22 @@ static BOOL ov23_02255850 (UnkStruct_020508D4 * param0) v7 = 1; v8 = v6->unk_3C.unk_00; - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { v0 = -(FX32_ONE * 16); v1 = 0; v8.unk_00--; v8.unk_08--; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { v0 = (FX32_ONE * 16); v1 = 0; v8.unk_00++; v8.unk_08++; - } else if (gCoreSys.unk_4C & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { v0 = 0; v1 = -(FX32_ONE * 16); v8.unk_04--; v8.unk_0C--; - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { v0 = 0; v1 = (FX32_ONE * 16); v8.unk_04++; @@ -984,9 +984,9 @@ static BOOL ov23_02255850 (UnkStruct_020508D4 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v4 = 1; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov23_02255BB8(&v6->unk_0C.unk_10, v6->unk_0C.unk_00, v6->unk_5C); ov23_02255E8C(v6); ov23_0225628C(v5, &v6->unk_4DC); @@ -1367,7 +1367,7 @@ static void ov23_02255F40 (UnkStruct_0203CDB0 * param0, UnkStruct_ov23_02255A98 v6 = param0->unk_8C; - ov23_02255F28(gCoreSys.unk_5C, gCoreSys.unk_5E, param2); + ov23_02255F28(gCoreSys.touchX, gCoreSys.touchY, param2); v1 = ov5_021EAFA4(param2->unk_00, param2->unk_04, v6); v2 = v1.x / (FX32_ONE * 16); @@ -1409,7 +1409,7 @@ static void ov23_02256000 (UnkStruct_0203CDB0 * param0, UnkStruct_ov23_02256000 v4 = param0->unk_8C; - ov23_02255F28(gCoreSys.unk_5C, gCoreSys.unk_5E, param1); + ov23_02255F28(gCoreSys.touchX, gCoreSys.touchY, param1); v1 = ov5_021EAFA4(param1->unk_00, param1->unk_04, v4); v2 = v1.x / (FX32_ONE * 16); @@ -1439,14 +1439,14 @@ static BOOL ov23_02256098 (UnkStruct_ov23_02256098 * param0, UnkStruct_0203CDB0 v1 = 0; *param2 = 0; - if (gCoreSys.touchInput) { - if (!gCoreSys.unk_44) { + if (gCoreSys.touchPressed) { + if (!gCoreSys.heldKeys) { param0->unk_4F0.unk_08 = 1; ov23_02255F40(param1, &(param0->unk_3C), ¶m0->unk_4F0); } v1 = 1; - } else if (gCoreSys.unk_62) { + } else if (gCoreSys.touchHeld) { if (param0->unk_4F0.unk_08) { ov23_02255F40(param1, &(param0->unk_3C), ¶m0->unk_4F0); } @@ -1470,14 +1470,14 @@ static BOOL ov23_02256104 (UnkStruct_ov23_02256098 * param0, UnkStruct_0203CDB0 v1 = 0; *param2 = 0; - if (gCoreSys.touchInput) { - if (!gCoreSys.unk_44) { + if (gCoreSys.touchPressed) { + if (!gCoreSys.heldKeys) { param0->unk_4F0.unk_08 = 1; ov23_02256000(param1, ¶m0->unk_4F0, param0->unk_4FC); } v1 = 1; - } else if (gCoreSys.unk_62) { + } else if (gCoreSys.touchHeld) { if (param0->unk_4F0.unk_08) { ov23_02256000(param1, ¶m0->unk_4F0, param0->unk_4FC); } @@ -1501,8 +1501,8 @@ static BOOL ov23_02256174 (UnkStruct_ov23_02256098 * param0, UnkStruct_0203CDB0 v1 = 0; *param2 = 0; - if (gCoreSys.touchInput) { - if (!gCoreSys.unk_44) { + if (gCoreSys.touchPressed) { + if (!gCoreSys.heldKeys) { param0->unk_4F0.unk_08 = 1; *param2 = 1; ov23_02256000(param1, ¶m0->unk_4F0, param0->unk_4FC); @@ -1524,14 +1524,14 @@ static BOOL ov23_022561BC (UnkStruct_ov23_02256098 * param0, UnkStruct_0203CDB0 v1 = 0; *param2 = 0; - if (gCoreSys.touchInput) { - if (!gCoreSys.unk_44) { + if (gCoreSys.touchPressed) { + if (!gCoreSys.heldKeys) { param0->unk_4F0.unk_08 = 1; ov23_02255F40(param1, &(param0->unk_3C), ¶m0->unk_4F0); } v1 = 1; - } else if (gCoreSys.unk_62) { + } else if (gCoreSys.touchHeld) { if (param0->unk_4F0.unk_08) { ov23_02255F40(param1, &(param0->unk_3C), ¶m0->unk_4F0); } diff --git a/src/overlay033/ov33_02256474.c b/src/overlay033/ov33_02256474.c index d4c6d675be..1c2eb5a29c 100644 --- a/src/overlay033/ov33_02256474.c +++ b/src/overlay033/ov33_02256474.c @@ -513,7 +513,7 @@ static void ov33_02256B08 (UnkStruct_ov33_02256474 * param0, const UnkStruct_ov3 static void ov33_02256B3C (const char * param0, ...) { - if (gCoreSys.unk_44 & PAD_BUTTON_B) { + if (gCoreSys.heldKeys & PAD_BUTTON_B) { va_list v0; va_start(v0, param0); va_end(v0); diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index a3203190b7..c6d6c18468 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -157,7 +157,7 @@ static void ov56_022561C0 (SysTask * param0, void * param1) case 0: ov56_02256508(v1); ov56_02256294(v0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov56_0225710C(v0); ov56_0225717C(v0, 1); v0->unk_00++; @@ -607,7 +607,7 @@ static int ov56_02256A68 (UnkStruct_ov56_02256468 * param0) param0->unk_228 = v0 - 2; break; default: - if (gCoreSys.touchInput == 0) { + if (gCoreSys.touchPressed == 0) { break; } @@ -693,19 +693,19 @@ static int ov56_02256BC0 (UnkStruct_ov56_02256468 * param0) static void ov56_02256C84 (UnkStruct_ov56_02256468 * param0) { - if (gCoreSys.unk_44 & PAD_BUTTON_L) { + if (gCoreSys.heldKeys & PAD_BUTTON_L) { ov56_0225718C(param0, 0); - if (gCoreSys.unk_4C & PAD_BUTTON_L) { + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_L) { if (param0->unk_2D8.unk_04 != 0) { param0->unk_2D8.unk_04--; Sound_PlayEffect(1509); } } - } else if (gCoreSys.unk_44 & PAD_BUTTON_R) { + } else if (gCoreSys.heldKeys & PAD_BUTTON_R) { ov56_0225718C(param0, 1); - if (gCoreSys.unk_4C & PAD_BUTTON_R) { + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_R) { if (param0->unk_2D8.unk_04 < param0->unk_2D8.unk_00 - 3) { param0->unk_2D8.unk_04++; Sound_PlayEffect(1509); @@ -935,10 +935,10 @@ static void ov56_0225712C (UnkStruct_ov56_02256468 * param0) { param0->unk_2EC = 0; - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { param0->unk_2EC = 1; } else { - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { param0->unk_2ED--; if (param0->unk_2ED < 0) { diff --git a/src/overlay058/ov58_021D0D80.c b/src/overlay058/ov58_021D0D80.c index 39bf737b62..546f06a9b6 100644 --- a/src/overlay058/ov58_021D0D80.c +++ b/src/overlay058/ov58_021D0D80.c @@ -188,7 +188,7 @@ int ov58_021D0D80 (UnkStruct_020067E8 * param0, int * param1) v0->unk_0C = sub_0200B358(39); v0->unk_10 = MessageLoader_Init(0, 26, 425, 39); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov58_021D1184(); ov58_021D11A4(v0->unk_00); @@ -890,7 +890,7 @@ static void ov58_021D1A80 (UnkStruct_02095EAC * param0) sub_02021CAC(param0->unk_23C[sub_0203608C()], 0); if (v1 != 0xffffffff) { - ov58_021D1A10(param0->unk_23C[sub_0203608C()], gCoreSys.unk_5C, gCoreSys.unk_5E); + ov58_021D1A10(param0->unk_23C[sub_0203608C()], gCoreSys.touchX, gCoreSys.touchY); sub_02021CAC(param0->unk_23C[sub_0203608C()], 1); } diff --git a/src/overlay059/ov59_021D0D80.c b/src/overlay059/ov59_021D0D80.c index 91d016f7dc..8d40ab7da2 100644 --- a/src/overlay059/ov59_021D0D80.c +++ b/src/overlay059/ov59_021D0D80.c @@ -196,7 +196,7 @@ int ov59_021D0D80 (UnkStruct_020067E8 * param0, int * param1) v0->unk_24 = sub_0200B358(51); v0->unk_28 = MessageLoader_Init(0, 26, 533, 51); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov59_021D1128(); ov59_021D1148(v0->unk_00); @@ -759,7 +759,7 @@ static int ov59_021D1838 (UnkStruct_020961E8 * param0, int param1) static void ov59_021D1864 (UnkStruct_020961E8 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (sub_0203608C() == 0) { if ((ov59_021D2528() == param0->unk_4AAC) && (param0->unk_4AB4 == 0)) { u8 v0 = 1; @@ -774,7 +774,7 @@ static void ov59_021D1864 (UnkStruct_020961E8 * param0) Sound_PlayEffect(1522); } } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (sub_0203608C()) { if (param0->unk_4AA0 == 0) { ov59_021D2628(param0, 4, 0); @@ -876,7 +876,7 @@ static int ov59_021D1A44 (UnkStruct_020961E8 * param0, int param1) if (sub_0203608C()) { if (param0->unk_4AA0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -885,7 +885,7 @@ static int ov59_021D1A44 (UnkStruct_020961E8 * param0, int param1) } } else { if (param0->unk_4AB4 != 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -1002,7 +1002,7 @@ static int ov59_021D1C64 (UnkStruct_020961E8 * param0, int param1) u32 v1; if ((ov59_021D2528() != param0->unk_4AAC) || (param0->unk_4AB4 != 0)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -1171,7 +1171,7 @@ static int ov59_021D1F24 (UnkStruct_020961E8 * param0, int param1) int v0; if ((param0->unk_4AAC != ov59_021D2528()) || (param0->unk_4AB4 != 0)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } diff --git a/src/overlay061/ov61_0222B008.c b/src/overlay061/ov61_0222B008.c index cdaab5eac5..2267cfc046 100644 --- a/src/overlay061/ov61_0222B008.c +++ b/src/overlay061/ov61_0222B008.c @@ -156,7 +156,7 @@ static int ov61_0222B168 (UnkStruct_ov62_022349A8 * param0, UnkStruct_ov61_0222B static int ov61_0222B190 (UnkStruct_ov62_022349A8 * param0, UnkStruct_ov61_0222B138 * param1) { - if ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_BUTTON_B)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_BUTTON_B)) { ov61_0222BB54(param0, NULL); return 1; } diff --git a/src/overlay061/ov61_0222BF44.c b/src/overlay061/ov61_0222BF44.c index 9fcfc6cd8b..33219d89c6 100644 --- a/src/overlay061/ov61_0222BF44.c +++ b/src/overlay061/ov61_0222BF44.c @@ -173,7 +173,7 @@ int ov61_0222BF44 (UnkStruct_020067E8 * param0, int * param1) v0->unk_04 = sub_02018340(117); sub_0201DBEC(64, 117); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov61_0222C224(v0->unk_04); sub_0201E3D8(); sub_0201E450(4); @@ -853,7 +853,7 @@ static int ov61_0222CC40 (UnkStruct_ov61_0222C664 * param0) static int ov61_0222CC64 (UnkStruct_ov61_0222C664 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A || gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A || gCoreSys.pressedKeys & PAD_BUTTON_B) { Window_Clear(¶m0->unk_64, 0); param0->unk_90 = 0; diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index a46cb2ee8a..c7b250bf15 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -1403,7 +1403,7 @@ static int ov64_0222EA70 (UnkStruct_ov64_0222F038 * param0, UnkStruct_ov64_0222E break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov64_0222F050(param0); param1->unk_04 = 3; } @@ -1624,23 +1624,23 @@ static BOOL ov64_0222EE84 (UnkStruct_ov64_0222F038 * param0, UnkStruct_ov64_0222 { BOOL v0 = 0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1501); return 1; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); param0->unk_00 = 3; return 1; } - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { if (param0->unk_00 > 0) { param0->unk_00--; v0 = 1; } - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { if (param0->unk_00 < 3) { param0->unk_00++; v0 = 1; @@ -1934,7 +1934,7 @@ static int ov64_0222F0C4 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E break; } - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { ov64_0222EA28(param2, 1); param1->unk_04 = 2; ov64_0222FF18(param0); @@ -2250,7 +2250,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E BOOL v2; int v3; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_04 == 8) { Sound_PlayEffect(1501); return 3; @@ -2264,7 +2264,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E return 4; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); return 3; } @@ -2273,7 +2273,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E v1 = 0; v2 = 0; - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { if (param0->unk_04 == 8) { param0->unk_04 = param0->unk_06; v1 = 1; @@ -2291,7 +2291,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E } } } - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { if ((param0->unk_04 == 3) || (param0->unk_04 == 7)) { param0->unk_04 = 8; v1 = 1; @@ -2310,7 +2310,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E } } } - } else if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { if (param0->unk_04 != 8) { if (param0->unk_04 < (8 / 2)) { param0->unk_04 += (8 / 2); @@ -2322,7 +2322,7 @@ static u32 ov64_0222F798 (UnkStruct_ov64_0222F0C4 * param0, UnkStruct_ov64_0222E v1 = 1; } } - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { if (param0->unk_04 != 8) { if (param0->unk_04 < (8 / 2)) { param0->unk_04 += (8 / 2); @@ -2952,7 +2952,7 @@ static int ov64_02230628 (UnkStruct_ov64_02230620 * param0, UnkStruct_ov64_0222E param1->unk_04 = 1; break; case 1: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); ov64_0222E074(param1, 0, 2); ov64_0223087C(param0, param2); @@ -3194,30 +3194,30 @@ static int ov64_02230904 (UnkStruct_ov64_02230904 * param0, UnkStruct_ov64_0222E param1->unk_04 = 2; break; case 2: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1501); param1->unk_04 = 6; } else { - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { ov64_02232138(param0, -1); param1->unk_04 = 3; param0->unk_08 = 2; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { ov64_02232138(param0, 1); param1->unk_04 = 3; param0->unk_08 = 3; - } else if (gCoreSys.unk_44 & PAD_KEY_UP) { + } else if (gCoreSys.heldKeys & PAD_KEY_UP) { param1->unk_04 = 5; param0->unk_08 = 0; param0->unk_0C = 4; - } else if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + } else if (gCoreSys.heldKeys & PAD_KEY_DOWN) { param1->unk_04 = 5; param0->unk_08 = 1; param0->unk_0C = 4; } } - if ((gCoreSys.unk_44 & (PAD_KEY_UP | PAD_KEY_DOWN)) == 0) { + if ((gCoreSys.heldKeys & (PAD_KEY_UP | PAD_KEY_DOWN)) == 0) { param0->unk_0E = 0; } break; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index 8ce98ff8e1..fbafa4c302 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -711,7 +711,7 @@ static void ov65_0222E01C (UnkStruct_ov65_0222EBE0 * param0) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); v0 = NARC_ctor(NARC_INDEX_DATA__WIFIP2PMATCH, 54); @@ -1695,7 +1695,7 @@ static int ov65_0222F1A8 (UnkStruct_ov65_0222EBE0 * param0, int param1) static int ov65_0222F21C (UnkStruct_ov65_0222EBE0 * param0, int param1) { - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { ov65_02232CA8(param0, 21); BGL_SetPriority(3, 0); BGL_SetPriority(2, 1); @@ -1967,7 +1967,7 @@ static void ov65_0222F6EC (UnkStruct_ov65_0222EBE0 * param0) static int ov65_0222F7AC (UnkStruct_ov65_0222EBE0 * param0, int param1) { - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { if (sub_0201A7CC(¶m0->unk_360)) { sub_0200E084(¶m0->unk_360, 0); BGL_DeleteWindow(¶m0->unk_360); @@ -1998,7 +1998,7 @@ static int ov65_0222F808 (UnkStruct_ov65_0222EBE0 * param0, int param1) return param1; } - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { if (sub_0201A7CC(¶m0->unk_360)) { sub_0200E084(¶m0->unk_360, 0); BGL_DeleteWindow(¶m0->unk_360); @@ -2279,7 +2279,7 @@ static int ov65_0222FCB8 (UnkStruct_ov65_0222EBE0 * param0, int param1) static int ov65_0222FCDC (UnkStruct_ov65_0222EBE0 * param0, int param1) { - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { if (param0->unk_3B4 == 1) { param0->unk_3AC = 10; param0->unk_3A8 = 34; @@ -2608,7 +2608,7 @@ static int ov65_022302C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) if (ov65_0223537C(¶m0->unk_3EC) == 0) { if (ov4_021D2568() == -1) { - if (PAD_BUTTON_X & gCoreSys.padInput) { + if (PAD_BUTTON_X & gCoreSys.pressedKeys) { if (ov65_02232F00(param0)) { ov65_02232B58(param0, 90, 0); } else { @@ -2667,7 +2667,7 @@ static int ov65_022302C4 (UnkStruct_ov65_0222EBE0 * param0, int param1) v4 = ov65_0222DD20(param0, ¶m0->unk_04->unk_00); if (param0->unk_3D0 == -1) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (ov65_0222DDFC(v4)) { Sound_PlayEffect(1501); param0->unk_3A8 = 39; @@ -2838,7 +2838,7 @@ static int ov65_022307B0 (UnkStruct_ov65_0222EBE0 * param0, int param1) } if (Message_Printing(param0->unk_180) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { ov65_02232DFC(param0); param0->unk_3A8 = 24; } else { @@ -2884,7 +2884,7 @@ static int ov65_02230860 (UnkStruct_ov65_0222EBE0 * param0, int param1) ov65_02232DC0(param0, ov4_021D2388()); ov65_02232B58(param0, 16, 0); param0->unk_3A8 = 27; - } else if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { ov65_02232B58(param0, 20, 0); param0->unk_3A8 = 25; } else { @@ -2974,7 +2974,7 @@ static int ov65_02230AF8 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_3BC--; - if ((gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) || (param0->unk_3BC == 0)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) || (param0->unk_3BC == 0)) { ov65_02232DFC(param0); sub_02038378(); sub_02038B60(); @@ -3002,7 +3002,7 @@ static int ov65_02230BB4 (UnkStruct_ov65_0222EBE0 * param0, int param1) return param1; } - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { ov65_02232DFC(param0); ov65_02232E58(param0, 16); sub_02038378(); @@ -3027,7 +3027,7 @@ static int ov65_02230C04 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_3BC--; - if ((gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) || (param0->unk_3BC == 0)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) || (param0->unk_3BC == 0)) { ov65_02232DFC(param0); ov65_02232E58(param0, 16); @@ -3071,7 +3071,7 @@ static int ov65_02230CB8 (UnkStruct_ov65_0222EBE0 * param0, int param1) return param1; } - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { ov65_02232B58(param0, 26, 1); param0->unk_3A8 = 59; param0->unk_3BC = 1; @@ -4436,7 +4436,7 @@ static int ov65_02232564 (UnkStruct_ov65_0222EBE0 * param0, int param1) param0->unk_3A8 = 56; } - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { param0->unk_3A8 = 56; } @@ -5075,7 +5075,7 @@ static BOOL ov65_02233208 (UnkStruct_ov65_0222EBE0 * param0, u32 param1) return 0; } - if ((gCoreSys.unk_44 & (PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_KEY_UP | PAD_KEY_DOWN)) || (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X)) || (param1 == 2)) { + if ((gCoreSys.heldKeys & (PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_KEY_UP | PAD_KEY_DOWN)) || (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X)) || (param1 == 2)) { return 1; } diff --git a/src/overlay065/ov65_02235060.c b/src/overlay065/ov65_02235060.c index a7271055d8..ddbbc9d268 100644 --- a/src/overlay065/ov65_02235060.c +++ b/src/overlay065/ov65_02235060.c @@ -199,12 +199,12 @@ u32 ov65_02235198 (UnkStruct_ov65_02235130 * param0) if (v0 == 1) { ov65_02235B30(param0); - if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + if (gCoreSys.heldKeys & PAD_KEY_DOWN) { return 1; } } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov65_02235254(param0) > 0) { return 2; } else if (ov65_02235654(param0) == 1) { @@ -987,7 +987,7 @@ static BOOL ov65_02236044 (UnkStruct_ov65_02235130 * param0, UnkStruct_ov65_0223 return 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v4 = ov65_022357A8(param0, param1, v0); if (v4 != NULL) { @@ -1005,31 +1005,31 @@ static BOOL ov65_02236044 (UnkStruct_ov65_02235130 * param0, UnkStruct_ov65_0223 return 0; } - if (gCoreSys.unk_44 & PAD_BUTTON_B) { + if (gCoreSys.heldKeys & PAD_BUTTON_B) { v3 = 3; } else { v3 = 2; } - if (gCoreSys.unk_44 & PAD_KEY_UP) { + if (gCoreSys.heldKeys & PAD_KEY_UP) { if (v0 == 0) { ov65_02236230(param0, v3, v0, v1); } else { ov65_02236230(param0, 1, 0, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + } else if (gCoreSys.heldKeys & PAD_KEY_DOWN) { if (v0 == 1) { ov65_02236230(param0, v3, v0, v1); } else { ov65_02236230(param0, 1, 1, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_LEFT) { + } else if (gCoreSys.heldKeys & PAD_KEY_LEFT) { if (v0 == 2) { ov65_02236230(param0, v3, v0, v1); } else { ov65_02236230(param0, 1, 2, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_RIGHT) { + } else if (gCoreSys.heldKeys & PAD_KEY_RIGHT) { if (v0 == 3) { ov65_02236230(param0, v3, v0, v1); } else { diff --git a/src/overlay065/ov65_0223648C.c b/src/overlay065/ov65_0223648C.c index 46de73e159..b4d109c272 100644 --- a/src/overlay065/ov65_0223648C.c +++ b/src/overlay065/ov65_0223648C.c @@ -1708,7 +1708,7 @@ static BOOL ov65_02237AC0 (UnkStruct_ov65_022367A8 * param0, UnkStruct_0207DE04 } do { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1501); if (ov65_02237450(param0) == 0) { @@ -1725,7 +1725,7 @@ static BOOL ov65_02237AC0 (UnkStruct_ov65_022367A8 * param0, UnkStruct_0207DE04 } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); param0->unk_00.unk_05 = 22; break; @@ -1737,7 +1737,7 @@ static BOOL ov65_02237AC0 (UnkStruct_ov65_022367A8 * param0, UnkStruct_0207DE04 break; } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { param0->unk_00.unk_05 = 30; Sound_PlayEffect(1501); break; @@ -2443,7 +2443,7 @@ static BOOL ov65_022383D0 (UnkStruct_ov65_022367A8 * param0, UnkStruct_0207DE04 ov65_0223789C(param0); param0->unk_00.unk_05 = 11; } else { - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { ov65_022378C4(param0, param1, param2); param0->unk_00.unk_05 = 18; } diff --git a/src/overlay067/ov67_0225C700.c b/src/overlay067/ov67_0225C700.c index a75d35e5f1..46cc590ceb 100644 --- a/src/overlay067/ov67_0225C700.c +++ b/src/overlay067/ov67_0225C700.c @@ -317,7 +317,7 @@ int ov67_0225C820 (UnkStruct_020067E8 * param0, int * param1) } break; case 10: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { int v8; int v9; diff --git a/src/overlay068/ov68_0225C700.c b/src/overlay068/ov68_0225C700.c index 1ef5430d1e..cde624dc3b 100644 --- a/src/overlay068/ov68_0225C700.c +++ b/src/overlay068/ov68_0225C700.c @@ -780,18 +780,18 @@ static BOOL ov68_0225CE48 (UnkStruct_ov68_0225D0F8 * param0, UnkStruct_ov68_0225 param0->unk_28 = 5; break; case 5: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); param0->unk_28++; break; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if ((param0->unk_10 - 1) >= 0) { Sound_PlayEffect(1504); param0->unk_10--; } - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if ((param0->unk_10 + 1) < 3) { Sound_PlayEffect(1504); param0->unk_10++; @@ -1104,7 +1104,7 @@ static BOOL ov68_0225D478 (UnkStruct_ov68_0225D388 * param0, UnkStruct_ov68_0225 param0->unk_60 = 22; break; case 2: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0 = ov68_0225CBEC(param1, 0, 104); ov68_0225D1B4(param3, v0); param0->unk_62 = 3; @@ -1153,7 +1153,7 @@ static BOOL ov68_0225D478 (UnkStruct_ov68_0225D388 * param0, UnkStruct_ov68_0225 } break; case 6: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_A8.unk_00 != (PPW_LOBBY_INVALID_QUESTION_NO)) { param0->unk_60 = 7; } else { @@ -1224,7 +1224,7 @@ static BOOL ov68_0225D478 (UnkStruct_ov68_0225D388 * param0, UnkStruct_ov68_0225 param0->unk_60 = 22; break; case 15: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0 = ov68_0225CBEC(param1, 0, 114); ov68_0225D1B4(param3, v0); param0->unk_62 = 16; @@ -1272,7 +1272,7 @@ static BOOL ov68_0225D478 (UnkStruct_ov68_0225D388 * param0, UnkStruct_ov68_0225 } break; case 19: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_60 = 20; } break; diff --git a/src/overlay069/ov69_0225C700.c b/src/overlay069/ov69_0225C700.c index 16f91d86b7..e216baa403 100644 --- a/src/overlay069/ov69_0225C700.c +++ b/src/overlay069/ov69_0225C700.c @@ -926,8 +926,8 @@ static void ov69_0225CBE4 (int param0, int param1, int * param2, int * param3, i int v2 = 0; int v3 = 0; - if (gCoreSys.unk_5C != 0xffff) { - v2 = gCoreSys.unk_5C - param0; + if (gCoreSys.touchX != 0xffff) { + v2 = gCoreSys.touchX - param0; if (v2 < 0) { v2 ^= -1; @@ -944,8 +944,8 @@ static void ov69_0225CBE4 (int param0, int param1, int * param2, int * param3, i *param2 = v0; *param3 = v2; - if (gCoreSys.unk_5E != 0xffff) { - v3 = gCoreSys.unk_5E - param1; + if (gCoreSys.touchY != 0xffff) { + v3 = gCoreSys.touchY - param1; if (v3 < 0) { v3 ^= -1; @@ -1178,7 +1178,7 @@ static u32 ov69_0225CF9C (UnkStruct_ov69_0225CE64 * param0) Sound_PlayEffect(1501); return 2; } else { - if ((gCoreSys.padInput & PAD_BUTTON_X)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_X)) { { UnkStruct_ov69_0225E0C0 v2; @@ -1200,7 +1200,7 @@ static u32 ov69_0225CF9C (UnkStruct_ov69_0225CE64 * param0) } } } else { - v0 = ov69_0225CC54(param0, gCoreSys.padInput, gCoreSys.unk_44); + v0 = ov69_0225CC54(param0, gCoreSys.pressedKeys, gCoreSys.heldKeys); } } @@ -1878,8 +1878,8 @@ static void ov69_0225DC54 (UnkStruct_ov69_0225DC48 * param0) param0->unk_00 = 0; - if (gCoreSys.touchInput) { - if ((gCoreSys.unk_5C >= (25 * 8)) && (gCoreSys.unk_5C <= ((25 + 6) * 8)) && (gCoreSys.unk_5E >= (21 * 8)) && (gCoreSys.unk_5E <= ((21 + 2) * 8))) { + if (gCoreSys.touchPressed) { + if ((gCoreSys.touchX >= (25 * 8)) && (gCoreSys.touchX <= ((25 + 6) * 8)) && (gCoreSys.touchY >= (21 * 8)) && (gCoreSys.touchY <= ((21 + 2) * 8))) { param0->unk_00 = PAD_BUTTON_B; return; } else { @@ -1888,13 +1888,13 @@ static void ov69_0225DC54 (UnkStruct_ov69_0225DC48 * param0) param0->unk_14 = 0; param0->unk_18 = 0; param0->unk_00 = 0; - param0->unk_08 = gCoreSys.unk_5C; - param0->unk_0C = gCoreSys.unk_5E; + param0->unk_08 = gCoreSys.touchX; + param0->unk_0C = gCoreSys.touchY; param0->unk_18 = 4; } } - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { switch (param0->unk_04) { case 0: @@ -1908,8 +1908,8 @@ static void ov69_0225DC54 (UnkStruct_ov69_0225DC48 * param0) param0->unk_00 = v0 | v2; param0->unk_10 = v1; param0->unk_14 = v3; - param0->unk_08 = gCoreSys.unk_5C; - param0->unk_0C = gCoreSys.unk_5E; + param0->unk_08 = gCoreSys.touchX; + param0->unk_0C = gCoreSys.touchY; break; } } else { diff --git a/src/overlay070/ov70_0225C9B4.c b/src/overlay070/ov70_0225C9B4.c index 06821b17c9..b9c4ac1301 100644 --- a/src/overlay070/ov70_0225C9B4.c +++ b/src/overlay070/ov70_0225C9B4.c @@ -805,31 +805,31 @@ static void ov70_0225D310 (UnkStruct_ov70_0225CC54 * param0, UnkStruct_ov70_0225 return; } - if (gCoreSys.unk_44 & PAD_BUTTON_B) { + if (gCoreSys.heldKeys & PAD_BUTTON_B) { v3 = 3; } else { v3 = 2; } - if (gCoreSys.unk_44 & PAD_KEY_UP) { + if (gCoreSys.heldKeys & PAD_KEY_UP) { if (v0 == 0) { ov70_0225D17C(param1, v3, v0, v1); } else { ov70_0225D17C(param1, 1, 0, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + } else if (gCoreSys.heldKeys & PAD_KEY_DOWN) { if (v0 == 1) { ov70_0225D17C(param1, v3, v0, v1); } else { ov70_0225D17C(param1, 1, 1, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_LEFT) { + } else if (gCoreSys.heldKeys & PAD_KEY_LEFT) { if (v0 == 2) { ov70_0225D17C(param1, v3, v0, v1); } else { ov70_0225D17C(param1, 1, 2, v1); } - } else if (gCoreSys.unk_44 & PAD_KEY_RIGHT) { + } else if (gCoreSys.heldKeys & PAD_KEY_RIGHT) { if (v0 == 3) { ov70_0225D17C(param1, v3, v0, v1); } else { diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index 4e1db322aa..a0beee3b2e 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -742,7 +742,7 @@ int ov70_0225DB90 (UnkStruct_020067E8 * param0, int * param1) } break; case 4: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { (*param1) = 7; } break; diff --git a/src/overlay070/ov70_022630A4.c b/src/overlay070/ov70_022630A4.c index db4ed38fd5..9ff51dc707 100644 --- a/src/overlay070/ov70_022630A4.c +++ b/src/overlay070/ov70_022630A4.c @@ -465,7 +465,7 @@ static BOOL ov70_02263120 (int param0) break; } - if (gCoreSys.unk_44 & v0) { + if (gCoreSys.heldKeys & v0) { return 1; } @@ -905,7 +905,7 @@ static BOOL ov70_02263414 (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225 ov70_02262E88(param0, 21); break; case 18: - if (!((sub_020057D4(1448) == 0) && (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)))) { + if (!((sub_020057D4(1448) == 0) && (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)))) { break; } @@ -1333,7 +1333,7 @@ static BOOL ov70_02263CC8 (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225 return 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { { UnkStruct_ov70_0225CC54 * v17; u32 v18; @@ -1421,7 +1421,7 @@ static BOOL ov70_02263CC8 (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225 } } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { if (ov70_0225E3F0(param1) == 0) { ov70_0225E328(param1, ov66_0222E338(v11), 0); Sound_PlayEffect(1500); @@ -2480,7 +2480,7 @@ static BOOL ov70_02264D38 (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225 } break; case 2: - if ((gCoreSys.padInput & PAD_BUTTON_B) || (gCoreSys.padInput & PAD_KEY_DOWN)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (gCoreSys.pressedKeys & PAD_KEY_DOWN)) { ov66_0222EBC4(v4, param2); ov70_0225DFCC(param1); v0->unk_0A = 6; diff --git a/src/overlay070/ov70_02265F38.c b/src/overlay070/ov70_02265F38.c index 2a3b1d7dad..4208e3c56c 100644 --- a/src/overlay070/ov70_02265F38.c +++ b/src/overlay070/ov70_02265F38.c @@ -345,7 +345,7 @@ BOOL ov70_02265F38 (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225DEE8 * } if (v0->unk_14 == 0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); if (ov66_02233374() == 0) { @@ -831,7 +831,7 @@ BOOL ov70_022669FC (UnkStruct_ov70_02263344 * param0, UnkStruct_ov70_0225DEE8 * } break; case 1: - if ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_KEY_RIGHT) || (gCoreSys.padInput & PAD_KEY_LEFT) || (gCoreSys.padInput & PAD_KEY_DOWN)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_KEY_RIGHT) || (gCoreSys.pressedKeys & PAD_KEY_LEFT) || (gCoreSys.pressedKeys & PAD_KEY_DOWN)) { ov70_02266CB0(&v0->unk_00, param1); ov70_0225DFEC(param1); diff --git a/src/overlay070/ov70_02269190.c b/src/overlay070/ov70_02269190.c index c96e9e0c3c..04fb6b5b49 100644 --- a/src/overlay070/ov70_02269190.c +++ b/src/overlay070/ov70_02269190.c @@ -1941,19 +1941,19 @@ static BOOL ov70_0226AC24 (UnkStruct_ov70_02269204 * param0, UnkStruct_ov70_0226 if (param1->unk_08 == ov70_0225CCAC(param0->unk_04)) { u32 v4 = 4; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v4 = 0; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v4 = 1; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v4 = 3; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v4 = 2; } diff --git a/src/overlay071/ov71_0223B140.c b/src/overlay071/ov71_0223B140.c index bfbe91c90e..d122f34f4c 100644 --- a/src/overlay071/ov71_0223B140.c +++ b/src/overlay071/ov71_0223B140.c @@ -157,7 +157,7 @@ int ov71_0223B140 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, 25, 0x28000); v1 = NARC_ctor(NARC_INDEX_GRAPHIC__TRAINER_CASE, 25); @@ -939,7 +939,7 @@ static int ov71_0223BEF8 (UnkStruct_ov71_0223B620 * param0) param0->unk_30D4 = 0xffffffff; - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { param0->unk_30C4 = 1; } @@ -948,7 +948,7 @@ static int ov71_0223BEF8 (UnkStruct_ov71_0223B620 * param0) if (param0->unk_30D4 != 0xffffffff) { v1 = 1; v0 = 1; - } else if (gCoreSys.unk_62) { + } else if (gCoreSys.touchHeld) { param0->unk_30D4 = ov71_0223C654(param0->unk_00, Unk_ov71_0223D4D0[param0->unk_B4->unk_04_0].unk_00[param0->unk_337C]); if (param0->unk_30C4) { @@ -960,9 +960,9 @@ static int ov71_0223BEF8 (UnkStruct_ov71_0223B620 * param0) } if (v1 == 0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0 = 3; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v0 = 4; } } @@ -977,23 +977,23 @@ static void ov71_0223BFBC (UnkStruct_ov71_0223B620 * param0) v0 = 0; - if ((gCoreSys.unk_5C != 0xffff) && (gCoreSys.unk_5E != 0xffff) && (param0->unk_30DC != 0xffff) && (param0->unk_30E0 != 0xffff)) { + if ((gCoreSys.touchX != 0xffff) && (gCoreSys.touchY != 0xffff) && (param0->unk_30DC != 0xffff) && (param0->unk_30E0 != 0xffff)) { if ((param0->unk_30D4 != 0xffffffff) && (param0->unk_30D4 != 0)) { if (param0->unk_B4->unk_48[param0->unk_30D4 - 1].unk_00_0) { - if (param0->unk_30DC > gCoreSys.unk_5C) { - v1 = param0->unk_30DC - gCoreSys.unk_5C; + if (param0->unk_30DC > gCoreSys.touchX) { + v1 = param0->unk_30DC - gCoreSys.touchX; param0->unk_3364.unk_02 = -1; } else { - v1 = gCoreSys.unk_5C - param0->unk_30DC; + v1 = gCoreSys.touchX - param0->unk_30DC; param0->unk_3364.unk_02 = 1; } if ((v1 >= 3) && (v1 <= 40)) { - if (param0->unk_30E0 > gCoreSys.unk_5E) { - v1 = param0->unk_30E0 - gCoreSys.unk_5E; + if (param0->unk_30E0 > gCoreSys.touchY) { + v1 = param0->unk_30E0 - gCoreSys.touchY; param0->unk_3364.unk_03 = -1; } else { - v1 = gCoreSys.unk_5E - param0->unk_30E0; + v1 = gCoreSys.touchY - param0->unk_30E0; param0->unk_3364.unk_03 = 1; } @@ -1004,11 +1004,11 @@ static void ov71_0223BFBC (UnkStruct_ov71_0223B620 * param0) ov71_0223C444(¶m0->unk_3364); } } else if (v1 <= 40) { - if (param0->unk_30E0 > gCoreSys.unk_5E) { - v1 = param0->unk_30E0 - gCoreSys.unk_5E; + if (param0->unk_30E0 > gCoreSys.touchY) { + v1 = param0->unk_30E0 - gCoreSys.touchY; param0->unk_3364.unk_03 = -1; } else { - v1 = gCoreSys.unk_5E - param0->unk_30E0; + v1 = gCoreSys.touchY - param0->unk_30E0; param0->unk_3364.unk_03 = 1; } @@ -1027,8 +1027,8 @@ static void ov71_0223BFBC (UnkStruct_ov71_0223B620 * param0) } } - param0->unk_30DC = gCoreSys.unk_5C; - param0->unk_30E0 = gCoreSys.unk_5E; + param0->unk_30DC = gCoreSys.touchX; + param0->unk_30E0 = gCoreSys.touchY; } static void ov71_0223C0D8 (UnkStruct_ov71_0223B620 * param0, const u8 param1) @@ -1333,7 +1333,7 @@ static int ov71_0223C60C (BGL * param0, const UnkUnion_02022594 * param1) if (v0 != 0) { u16 v1 = 0x40; - if (sub_0201C784(param0, 2, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0, 2, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } else { @@ -1352,7 +1352,7 @@ static int ov71_0223C654 (BGL * param0, const UnkUnion_02022594 * param1) if (v0 != 0) { u16 v1 = 0x40; - if (sub_0201C784(param0, 2, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0, 2, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } else { diff --git a/src/overlay072/ov72_0223D7A0.c b/src/overlay072/ov72_0223D7A0.c index ff9785c4ff..9eec87217f 100644 --- a/src/overlay072/ov72_0223D7A0.c +++ b/src/overlay072/ov72_0223D7A0.c @@ -141,7 +141,7 @@ int ov72_0223D7A0 (UnkStruct_020067E8 * param0, int * param1) v0->unk_10 = sub_0200B358(39); v0->unk_14 = MessageLoader_Init(0, 26, 425, 39); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov72_0223DA70(); ov72_0223DA90(v0->unk_00); sub_0200F174(0, 1, 1, 0x0, 16, 1, 39); @@ -1166,21 +1166,21 @@ static void ov72_0223EA18 (UnkStruct_ov72_0223DB98 * param0) v0 = 0; - if ((gCoreSys.unk_5C != 0xffff) && (gCoreSys.unk_5E != 0xffff) && (param0->unk_5D0C != 0xffff) && (param0->unk_5D10 != 0xffff)) { - if (param0->unk_5D0C > gCoreSys.unk_5C) { - v1 = param0->unk_5D0C - gCoreSys.unk_5C; + if ((gCoreSys.touchX != 0xffff) && (gCoreSys.touchY != 0xffff) && (param0->unk_5D0C != 0xffff) && (param0->unk_5D10 != 0xffff)) { + if (param0->unk_5D0C > gCoreSys.touchX) { + v1 = param0->unk_5D0C - gCoreSys.touchX; param0->unk_5D04.unk_02 = -1; } else { - v1 = gCoreSys.unk_5C - param0->unk_5D0C; + v1 = gCoreSys.touchX - param0->unk_5D0C; param0->unk_5D04.unk_02 = 1; } if ((v1 >= 3) && (v1 <= 40)) { - if (param0->unk_5D10 > gCoreSys.unk_5E) { - v1 = param0->unk_5D10 - gCoreSys.unk_5E; + if (param0->unk_5D10 > gCoreSys.touchY) { + v1 = param0->unk_5D10 - gCoreSys.touchY; param0->unk_5D04.unk_03 = -1; } else { - v1 = gCoreSys.unk_5E - param0->unk_5D10; + v1 = gCoreSys.touchY - param0->unk_5D10; param0->unk_5D04.unk_03 = 1; } @@ -1191,11 +1191,11 @@ static void ov72_0223EA18 (UnkStruct_ov72_0223DB98 * param0) (void)0; } } else if (v1 <= 40) { - if (param0->unk_5D10 > gCoreSys.unk_5E) { - v1 = param0->unk_5D10 - gCoreSys.unk_5E; + if (param0->unk_5D10 > gCoreSys.touchY) { + v1 = param0->unk_5D10 - gCoreSys.touchY; param0->unk_5D04.unk_03 = -1; } else { - v1 = gCoreSys.unk_5E - param0->unk_5D10; + v1 = gCoreSys.touchY - param0->unk_5D10; param0->unk_5D04.unk_03 = 1; } @@ -1208,8 +1208,8 @@ static void ov72_0223EA18 (UnkStruct_ov72_0223DB98 * param0) } } - param0->unk_5D0C = gCoreSys.unk_5C; - param0->unk_5D10 = gCoreSys.unk_5E; + param0->unk_5D0C = gCoreSys.touchX; + param0->unk_5D10 = gCoreSys.touchY; } static void ov72_0223EAD8 (UnkStruct_ov72_0223EAD8 * param0) diff --git a/src/overlay073/ov73_021D0D80.c b/src/overlay073/ov73_021D0D80.c index 23e3d32089..759b966933 100644 --- a/src/overlay073/ov73_021D0D80.c +++ b/src/overlay073/ov73_021D0D80.c @@ -190,7 +190,7 @@ int ov73_021D0E20 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov73_021D1058(v0); ov73_021D12C4(v0); @@ -283,18 +283,18 @@ static BOOL ov73_021D0FFC (void) BOOL v0 = 0; u16 v1, v2; - if (gCoreSys.touchInput) { - if ((gCoreSys.unk_5C < 256) && (gCoreSys.unk_5E < 192)) { - if (gCoreSys.unk_5C < 128) { - v1 = 128 - gCoreSys.unk_5C; + if (gCoreSys.touchPressed) { + if ((gCoreSys.touchX < 256) && (gCoreSys.touchY < 192)) { + if (gCoreSys.touchX < 128) { + v1 = 128 - gCoreSys.touchX; } else { - v1 = gCoreSys.unk_5C - 128; + v1 = gCoreSys.touchX - 128; } - if (gCoreSys.unk_5E < 100) { - v2 = 100 - gCoreSys.unk_5E; + if (gCoreSys.touchY < 100) { + v2 = 100 - gCoreSys.touchY; } else { - v2 = gCoreSys.unk_5E - 100; + v2 = gCoreSys.touchY - 100; } if ((v1 * v1 + v2 * v2) <= 16 * 16) { @@ -741,7 +741,7 @@ static BOOL ov73_021D1510 (UnkStruct_ov73_021D1058 * param0, u32 param1, int par } break; case 2: - if ((param2 != 0) || ((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A)) { + if ((param2 != 0) || ((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A)) { BGL_DeleteWindow(¶m0->unk_1C); param0->unk_50 = 0; v0 = 1; @@ -895,7 +895,7 @@ static BOOL ov73_021D1784 (UnkStruct_ov73_021D1058 * param0, u32 param1, int par } break; case 3: - if (((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.padInput & PAD_BUTTON_B) == PAD_BUTTON_B)) { + if (((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.pressedKeys & PAD_BUTTON_B) == PAD_BUTTON_B)) { Sound_PlayEffect(1500); param0->unk_54 = 4; } @@ -1596,7 +1596,7 @@ static BOOL ov73_021D2318 (UnkStruct_ov73_021D1058 * param0) param0->unk_0C = 22; break; case 22: - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { param0->unk_0C = 27; break; } @@ -1762,7 +1762,7 @@ static BOOL ov73_021D2318 (UnkStruct_ov73_021D1058 * param0) param0->unk_94[1] = 0; {sub_02019EBC(param0->unk_18, 0);} param0->unk_0C = 48; - } else if (gCoreSys.padInput) { + } else if (gCoreSys.pressedKeys) { param0->unk_0C = 49; } break; @@ -1895,7 +1895,7 @@ static BOOL ov73_021D2318 (UnkStruct_ov73_021D1058 * param0) } break; case 67: - if ((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A) { param0->unk_7C = 6; param0->unk_80 = 10; param0->unk_78 = 2; @@ -1908,7 +1908,7 @@ static BOOL ov73_021D2318 (UnkStruct_ov73_021D1058 * param0) break; } - if ((gCoreSys.padInput & PAD_KEY_LEFT) == PAD_KEY_LEFT || (gCoreSys.padInput & PAD_KEY_RIGHT) == PAD_KEY_RIGHT) { + if ((gCoreSys.pressedKeys & PAD_KEY_LEFT) == PAD_KEY_LEFT || (gCoreSys.pressedKeys & PAD_KEY_RIGHT) == PAD_KEY_RIGHT) { if (param0->unk_84 == 0) { param0->unk_84 = 1; } else { diff --git a/src/overlay073/ov73_021D3250.c b/src/overlay073/ov73_021D3250.c index 4d50debe5a..ce92805713 100644 --- a/src/overlay073/ov73_021D3250.c +++ b/src/overlay073/ov73_021D3250.c @@ -85,7 +85,7 @@ int ov73_021D3280 (UnkStruct_020067E8 * param0, int * param1) GXLayers_DisableEngineBLayers(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov73_021D342C(v0); ov73_021D366C(v0); diff --git a/src/overlay074/ov74_021D0D80.c b/src/overlay074/ov74_021D0D80.c index 41d218d5cd..99de640acc 100644 --- a/src/overlay074/ov74_021D0D80.c +++ b/src/overlay074/ov74_021D0D80.c @@ -174,7 +174,7 @@ int ov74_021D0F60 (UnkStruct_020067E8 * param0, int * param1) } break; case 2: - if (((gCoreSys.padInput & PAD_BUTTON_A) && (v0->unk_10_2 == (7 - 1))) || (gCoreSys.padInput & PAD_BUTTON_B)) { + if (((gCoreSys.pressedKeys & PAD_BUTTON_A) && (v0->unk_10_2 == (7 - 1))) || (gCoreSys.pressedKeys & PAD_BUTTON_B)) { v1 = ov74_021D1B44(v0); if (v1 == 1) { @@ -711,23 +711,23 @@ static void ov74_021D1A24 (UnkStruct_ov74_021D0D80 * param0) v0 = &(param0->unk_5C[param0->unk_10_2]); if (param0->unk_10_2 != 6) { - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v0->unk_02 = (v0->unk_02 + 1) % v0->unk_00; ov74_021D17CC(param0, param0->unk_10_2); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v0->unk_02 = (v0->unk_02 + v0->unk_00 - 1) % v0->unk_00; ov74_021D17CC(param0, param0->unk_10_2); Sound_PlayEffect(1500); } } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_10_2 = (param0->unk_10_2 + 7 - 1) % 7; sub_0201C63C(param0->unk_14, 0, 3, -(param0->unk_10_2 * 16 + 24)); ov74_021D1BE4(param0, param0->unk_10_2, 1); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_10_2 = (param0->unk_10_2 + 1) % 7; sub_0201C63C(param0->unk_14, 0, 3, -(param0->unk_10_2 * 16 + 24)); ov74_021D1BE4(param0, param0->unk_10_2, 1); diff --git a/src/overlay075/ov75_021D0D80.c b/src/overlay075/ov75_021D0D80.c index e46604c892..fbf5374135 100644 --- a/src/overlay075/ov75_021D0D80.c +++ b/src/overlay075/ov75_021D0D80.c @@ -194,7 +194,7 @@ static BOOL ov75_021D0E34 (UnkStruct_ov75_021D1184 * param0) static int ov75_021D0E5C (UnkStruct_ov75_021D1184 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1507); return 1; } @@ -206,7 +206,7 @@ static int ov75_021D0E80 (UnkStruct_ov75_021D1184 * param0) { u8 v0 = 0; - if (gCoreSys.padInput & (PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A)) { if (param0->unk_11 == 3) { if (param0->unk_12 == 0) { if (ov75_021D0E34(param0)) { @@ -231,23 +231,23 @@ static int ov75_021D0E80 (UnkStruct_ov75_021D1184 * param0) } return 1; - } else if (gCoreSys.padInput & (PAD_BUTTON_B)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_B)) { Sound_PlayEffect(1501); param0->unk_0C = UnkEnum_ov75_021D0E80_03; return 0; } - if (gCoreSys.padInput & PAD_BUTTON_START) { + if (gCoreSys.pressedKeys & PAD_BUTTON_START) { param0->unk_11 = 3; param0->unk_12 = 0; v0 = 1; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_11 = (param0->unk_11 + 1) % 4; v0 = 1; - } else if (gCoreSys.padInput & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_11 = (param0->unk_11 + 4 - 1) % 4; v0 = 1; - } else if (gCoreSys.padInput & (PAD_KEY_RIGHT | PAD_KEY_LEFT)) { + } else if (gCoreSys.pressedKeys & (PAD_KEY_RIGHT | PAD_KEY_LEFT)) { if (param0->unk_11 == 3) { param0->unk_12 ^= 1; v0 = 1; @@ -288,7 +288,7 @@ static int ov75_021D0FA0 (UnkStruct_ov75_021D1184 * param0) break; case 1: - if (!(gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if (!(gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { return 0; } diff --git a/src/overlay076/ov76_0223B140.c b/src/overlay076/ov76_0223B140.c index b7eb6b4191..35e5cde45d 100644 --- a/src/overlay076/ov76_0223B140.c +++ b/src/overlay076/ov76_0223B140.c @@ -57,7 +57,7 @@ void ov76_0223B184 (UnkUnion_02022594 * param0, CellActorData * param1, BOOL par } if (param2 == 1) { - sub_0200D4C4(param1, gCoreSys.unk_5C, gCoreSys.unk_5E); + sub_0200D4C4(param1, gCoreSys.touchX, gCoreSys.touchY); sub_0200D550(param1, &v0, &v1); ov76_0223B174(param0); } else { diff --git a/src/overlay076/ov76_0223D338.c b/src/overlay076/ov76_0223D338.c index 44a9e2cfd7..3c72aaac92 100644 --- a/src/overlay076/ov76_0223D338.c +++ b/src/overlay076/ov76_0223D338.c @@ -259,23 +259,23 @@ static BOOL ov76_0223D574 (int * param0) { int * v0 = param0; - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { (*v0)++; (*v0) %= 12; - } else if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { if (*v0 > 0) { (*v0)--; } else { *v0 = 12 - 1; } - } else if (gCoreSys.unk_4C & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { if ((*v0 / 4) != 0) { (*v0) -= 4; (*v0) %= 12; } else { return 0; } - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { if ((*v0 / 4) != (3 - 1)) { (*v0) += 4; (*v0) %= 12; @@ -393,12 +393,12 @@ static BOOL ov76_0223D674 (UnkStruct_ov76_0223DE00 * param0) ov76_0223B1E0(param0); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param0->unk_3D4++; ov76_0223CA30(¶m0->unk_D4.unk_18[0], 8); ov76_0223BF74(param0->unk_D4.unk_10, ¶m0->unk_D4.unk_18[1], 1, param0, param0->unk_3C4[0]); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param0->unk_3D4 = 5; Sound_PlayEffect(1501); } @@ -1260,7 +1260,7 @@ static BOOL ov76_0223E950 (UnkStruct_ov76_0223DE00 * param0) param0->unk_3D4++; break; case 1: - if (gCoreSys.padInput & (0x1 | 0x2 | 0x400 | 0x800 | 0x40 | 0x80 | 0x20 | 0x10)) { + if (gCoreSys.pressedKeys & (0x1 | 0x2 | 0x400 | 0x800 | 0x40 | 0x80 | 0x20 | 0x10)) { param0->unk_3D4++; } break; @@ -1296,13 +1296,13 @@ static BOOL ov76_0223E9C4 (UnkStruct_ov76_0223DE00 * param0) ov76_0223D600(param0, 1, 0); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov76_0223C80C(param0, param0->unk_3C4[0], param0->unk_3C4[1]); ov76_0223D600(param0, 1, 1); ov76_0223CA30(¶m0->unk_D4.unk_18[0], 11); param0->unk_3D4 = 2; Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { sub_0200D3F4(param0->unk_2F4[1], 0); ov76_0223D600(param0, 0, 1); param0->unk_3D4 = 3; @@ -1311,7 +1311,7 @@ static BOOL ov76_0223E9C4 (UnkStruct_ov76_0223DE00 * param0) } break; case 2: - if (gCoreSys.padInput & (0x1 | 0x2 | 0x400 | 0x800 | 0x40 | 0x80 | 0x20 | 0x10)) { + if (gCoreSys.pressedKeys & (0x1 | 0x2 | 0x400 | 0x800 | 0x40 | 0x80 | 0x20 | 0x10)) { param0->unk_3D4 = 3; } break; diff --git a/src/overlay077/ov77_021D0D80.c b/src/overlay077/ov77_021D0D80.c index 597931539f..74d91b1016 100644 --- a/src/overlay077/ov77_021D0D80.c +++ b/src/overlay077/ov77_021D0D80.c @@ -192,7 +192,7 @@ static int ov77_021D0D80 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, v1, 0x40000); v0 = sub_0200681C(param0, sizeof(UnkStruct_ov77_021D17B4), v1); @@ -259,7 +259,7 @@ static int ov77_021D0E3C (UnkStruct_020067E8 * param0, int * param1) v0->unk_4F8++; - if (((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.padInput & PAD_BUTTON_START) == PAD_BUTTON_START)) { + if (((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.pressedKeys & PAD_BUTTON_START) == PAD_BUTTON_START)) { v0->unk_4E8 = 1; sub_0200564C(0, 60); sub_02005844(487, 1); @@ -268,7 +268,7 @@ static int ov77_021D0E3C (UnkStruct_020067E8 * param0, int * param1) break; } - if (((gCoreSys.unk_44 & (PAD_BUTTON_B | PAD_KEY_UP | PAD_BUTTON_SELECT)) == (PAD_BUTTON_B | PAD_KEY_UP | PAD_BUTTON_SELECT))) { + if (((gCoreSys.heldKeys & (PAD_BUTTON_B | PAD_KEY_UP | PAD_BUTTON_SELECT)) == (PAD_BUTTON_B | PAD_KEY_UP | PAD_BUTTON_SELECT))) { v0->unk_4E8 = 2; sub_0200F174(0, 0, 0, 0x0, 6, 1, v0->unk_00); *param1 = 6; @@ -386,7 +386,7 @@ static void ov77_021D1184 (void) static BOOL ov77_021D11A4 (void) { - if (((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.padInput & PAD_BUTTON_START) == PAD_BUTTON_START) || ((gCoreSys.padInput & PAD_BUTTON_SELECT) == PAD_BUTTON_SELECT)) { + if (((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A) || ((gCoreSys.pressedKeys & PAD_BUTTON_START) == PAD_BUTTON_START) || ((gCoreSys.pressedKeys & PAD_BUTTON_SELECT) == PAD_BUTTON_SELECT)) { return 1; } diff --git a/src/overlay077/ov77_021D25B0.c b/src/overlay077/ov77_021D25B0.c index fc3fa2fb8f..68439c58b6 100644 --- a/src/overlay077/ov77_021D25B0.c +++ b/src/overlay077/ov77_021D25B0.c @@ -947,7 +947,7 @@ static int ov77_021D2D08 (UnkStruct_020067E8 * param0, int * param1) sub_020177BC(NULL, NULL); GXLayers_DisableEngineALayers(); GXLayers_DisableEngineBLayers(); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, v1, 0xa0000); v0 = sub_0200681C(param0, sizeof(UnkStruct_ov77_021D2E9C), v1); @@ -970,7 +970,7 @@ static int ov77_021D2D94 (UnkStruct_020067E8 * param0, int * param1) { UnkStruct_ov77_021D2E9C * v0 = sub_0200682C(param0); - if ((v0->unk_2A8) && ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_BUTTON_START))) { + if ((v0->unk_2A8) && ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_BUTTON_START))) { v0->unk_08 = 1; gCoreSys.unk_6C = 0; sub_0200F344(0, 0x0); diff --git a/src/overlay078/ov78_021D0D80.c b/src/overlay078/ov78_021D0D80.c index 4aed809f8a..f54d8e2f62 100644 --- a/src/overlay078/ov78_021D0D80.c +++ b/src/overlay078/ov78_021D0D80.c @@ -911,7 +911,7 @@ static BOOL ov78_021D1978 (UnkStruct_ov78_021D107C * param0, int param1) case 3: ov78_021D1C58(param0); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov78_021D1C98(param0, 1); Sound_PlayEffect(1500); @@ -1085,14 +1085,14 @@ static void ov78_021D1C28 (UnkStruct_ov78_021D107C * param0) static void ov78_021D1C58 (UnkStruct_ov78_021D107C * param0) { - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_54 - 1 >= 0) { param0->unk_54 -= 1; Sound_PlayEffect(1500); } } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_54 + 1 < 3) { param0->unk_54 += 1; Sound_PlayEffect(1500); diff --git a/src/overlay079/ov79_021D0D80.c b/src/overlay079/ov79_021D0D80.c index 5a455c3b49..72cb9160f0 100644 --- a/src/overlay079/ov79_021D0D80.c +++ b/src/overlay079/ov79_021D0D80.c @@ -254,7 +254,7 @@ static int ov79_021D0FEC (UnkStruct_ov79_021D0E1C * param0) v1 = ov79_021D0FB0(param0); - if (gCoreSys.unk_44 != 0) { + if (gCoreSys.heldKeys != 0) { if (param0->unk_14 == 0) { v0 = sub_02001288(param0->unk_C4); } @@ -269,14 +269,14 @@ static int ov79_021D0FEC (UnkStruct_ov79_021D0E1C * param0) return 0; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); param0->unk_1A = 0xFF; param0->unk_10 = 0; return 1; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); switch (v0) { @@ -314,7 +314,7 @@ static int ov79_021D10B8 (UnkStruct_ov79_021D0E1C * param0) v0 = sub_02001288(param0->unk_C8); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); ov79_021D1F60(param0); ov79_021D2214(param0, 0); @@ -322,7 +322,7 @@ static int ov79_021D10B8 (UnkStruct_ov79_021D0E1C * param0) return 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); switch (v0) { @@ -382,7 +382,7 @@ static int ov79_021D11C0 (UnkStruct_ov79_021D0E1C * param0) return 0; } - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) == 0) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) == 0) { return 0; } diff --git a/src/overlay079/ov79_021D2268.c b/src/overlay079/ov79_021D2268.c index e7d40a6eae..23ecde7eb3 100644 --- a/src/overlay079/ov79_021D2268.c +++ b/src/overlay079/ov79_021D2268.c @@ -752,7 +752,7 @@ static int ov79_021D2C08 (UnkStruct_ov79_021D2928 * param0) return 7; } - if (((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) == 0) && (param0->unk_0E++ < 90)) { + if (((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) == 0) && (param0->unk_0E++ < 90)) { return 7; } diff --git a/src/overlay080/ov80_021D1458.c b/src/overlay080/ov80_021D1458.c index 3c7594a184..2b34211385 100644 --- a/src/overlay080/ov80_021D1458.c +++ b/src/overlay080/ov80_021D1458.c @@ -247,7 +247,7 @@ int ov80_021D163C (UnkStruct_ov80_021D2A08 * param0) { UnkStruct_ov80_021D1478 * v0 = param0->unk_34; - if ((v0->unk_14 <= 1) && gCoreSys.padInput & PAD_BUTTON_B) { + if ((v0->unk_14 <= 1) && gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); return 1; } @@ -256,7 +256,7 @@ int ov80_021D163C (UnkStruct_ov80_021D2A08 * param0) return 0; } - ov80_021D18F8(param0, gCoreSys.unk_44); + ov80_021D18F8(param0, gCoreSys.heldKeys); return 0; } @@ -266,14 +266,14 @@ int ov80_021D1678 (UnkStruct_ov80_021D2A08 * param0) UnkStruct_ov80_021D1478 * v0 = param0->unk_34; if (v0->unk_14 <= 1) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov80_021D29BC(param0)) { Sound_PlayEffect(1501); return 1; } return 0; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); return 1; } @@ -283,7 +283,7 @@ int ov80_021D1678 (UnkStruct_ov80_021D2A08 * param0) return 0; } - ov80_021D18F8(param0, gCoreSys.unk_44); + ov80_021D18F8(param0, gCoreSys.heldKeys); return 0; } @@ -291,12 +291,12 @@ int ov80_021D16D0 (UnkStruct_ov80_021D2A08 * param0) { UnkStruct_ov80_021D1478 * v0 = param0->unk_34; - if (gCoreSys.padInput & (PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B)) { Sound_PlayEffect(1501); return 1; } - ov80_021D18F8(param0, gCoreSys.unk_44); + ov80_021D18F8(param0, gCoreSys.heldKeys); return 0; } @@ -396,7 +396,7 @@ static int ov80_021D1848 (UnkStruct_ov80_021D2A08 * param0, int param1) v1 = 0x12; - if (sub_0201C784(param0->unk_28, 5, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_28, 5, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return v0; } diff --git a/src/overlay081/ov81_021D0D80.c b/src/overlay081/ov81_021D0D80.c index cde413bb64..e25619adaf 100644 --- a/src/overlay081/ov81_021D0D80.c +++ b/src/overlay081/ov81_021D0D80.c @@ -82,7 +82,7 @@ int ov81_021D0D80 (UnkStruct_020067E8 * param0, int * param1) G2_BlendNone(); G2S_BlendNone(); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, 42, 0x20000); v1 = sub_02006840(param0); @@ -341,7 +341,7 @@ static int ov81_021D1174 (UnkStruct_ov81_021D1610 * param0) static int ov81_021D1188 (UnkStruct_ov81_021D1610 * param0) { - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (ov81_021D13CC(param0, -1) == 1) { return 2; } @@ -349,7 +349,7 @@ static int ov81_021D1188 (UnkStruct_ov81_021D1610 * param0) return 1; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_KEY_RIGHT)) { if (ov81_021D13CC(param0, 1) == 1) { return 3; } @@ -357,7 +357,7 @@ static int ov81_021D1188 (UnkStruct_ov81_021D1610 * param0) return 1; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_105C != 0) { if (ov81_021D13CC(param0, -1) == 1) { return 2; @@ -368,7 +368,7 @@ static int ov81_021D1188 (UnkStruct_ov81_021D1610 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_START) { + if (gCoreSys.pressedKeys & PAD_BUTTON_START) { sub_0208C120(1, 42); return 4; } diff --git a/src/overlay083/ov83_0223B5A0.c b/src/overlay083/ov83_0223B5A0.c index be8fdc041c..39c2046270 100644 --- a/src/overlay083/ov83_0223B5A0.c +++ b/src/overlay083/ov83_0223B5A0.c @@ -682,7 +682,7 @@ static int ov83_0223BF74 (UnkStruct_ov83_0223C344 * param0, UnkStruct_ov83_0223B case 4: param1->unk_1C--; - if ((param1->unk_1C < 0) || (gCoreSys.touchInput) || (gCoreSys.padInput & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { + if ((param1->unk_1C < 0) || (gCoreSys.touchPressed) || (gCoreSys.pressedKeys & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { (*param2)++; break; } @@ -700,7 +700,7 @@ static int ov83_0223BF74 (UnkStruct_ov83_0223C344 * param0, UnkStruct_ov83_0223B case 6: param1->unk_1C--; - if ((gCoreSys.touchInput) || (param1->unk_1C < 0) || (gCoreSys.padInput & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { + if ((gCoreSys.touchPressed) || (param1->unk_1C < 0) || (gCoreSys.pressedKeys & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { (*param2)++; } break; @@ -750,7 +750,7 @@ static int ov83_0223BF74 (UnkStruct_ov83_0223C344 * param0, UnkStruct_ov83_0223B case 10: param1->unk_1C--; - if ((gCoreSys.touchInput) || (param1->unk_1C < 0) || (gCoreSys.padInput & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { + if ((gCoreSys.touchPressed) || (param1->unk_1C < 0) || (gCoreSys.pressedKeys & ((PAD_BUTTON_A | PAD_BUTTON_B)))) { if (param1->unk_1488 > 1) { ov83_0223EC8C(¶m1->unk_6A0, 6); ov83_0223E9BC(¶m1->unk_6A0); diff --git a/src/overlay083/ov83_0223F7F4.c b/src/overlay083/ov83_0223F7F4.c index 76890aedb4..ff920a358b 100644 --- a/src/overlay083/ov83_0223F7F4.c +++ b/src/overlay083/ov83_0223F7F4.c @@ -58,9 +58,9 @@ void ov83_0223F83C (UnkStruct_ov83_0223F820 * param0) { s32 v0; - if (gCoreSys.unk_62) { - param0->unk_00 = gCoreSys.unk_5C; - param0->unk_04 = gCoreSys.unk_5E; + if (gCoreSys.touchHeld) { + param0->unk_00 = gCoreSys.touchX; + param0->unk_04 = gCoreSys.touchY; if (param0->unk_14 == 0) { param0->unk_08 = param0->unk_00; @@ -71,7 +71,7 @@ void ov83_0223F83C (UnkStruct_ov83_0223F820 * param0) param0->unk_10 = ov83_0223F7F4(param0->unk_00, param0->unk_04, param0->unk_08, param0->unk_0C, 128, 96); param0->unk_08 = param0->unk_00; param0->unk_0C = param0->unk_04; - param0->unk_14 = gCoreSys.unk_62; + param0->unk_14 = gCoreSys.touchHeld; } void ov83_0223F88C (UnkStruct_ov83_0223F88C * param0, UnkStruct_ov83_0223F820 * param1) diff --git a/src/overlay084/ov84_0223B5A0.c b/src/overlay084/ov84_0223B5A0.c index 7a7f5feec6..2de13cfa90 100644 --- a/src/overlay084/ov84_0223B5A0.c +++ b/src/overlay084/ov84_0223B5A0.c @@ -418,7 +418,7 @@ int ov84_0223B5A0 (UnkStruct_020067E8 * param0, int * param1) v0->unk_425 = TrainerInfo_Gender(v0->unk_CC); sub_0200F174(1, 3, 3, 0x0, 6, 1, 6); - sub_02017DD4(3, 8); + SetAutorepeat(3, 8); ov84_0223BEAC(v0); ov84_0223BDB4(v0); @@ -599,7 +599,7 @@ int ov84_0223B900 (UnkStruct_020067E8 * param0, int * param1) sub_02006830(param0); sub_02017798(NULL, NULL); Heap_Destroy(6); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); return 1; } @@ -1238,7 +1238,7 @@ static u8 ov84_0223C5B8 (UnkStruct_ov84_0223B5A0 * param0) v0 = ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64]; sub_020014DC(param0->unk_15C, &v0->unk_06, &v0->unk_04); - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { if (ov84_0223D244(param0) == 1) { Sound_PlayEffect(1500); return 2; @@ -1303,7 +1303,7 @@ static void ov84_0223C720 (UnkStruct_ov84_0223B5A0 * param0) static u8 ov84_0223C750 (UnkStruct_ov84_0223B5A0 * param0) { - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { if (param0->unk_424 == 1) { return 0; } @@ -1325,7 +1325,7 @@ static u8 ov84_0223C750 (UnkStruct_ov84_0223B5A0 * param0) return 1; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { if (param0->unk_424 == 1) { return 0; } @@ -1460,7 +1460,7 @@ static u8 ov84_0223CA5C (UnkStruct_ov84_0223B5A0 * param0) { UnkStruct_ov84_0223C920 * v0 = ¶m0->unk_429; - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_424 == 1) { return 1; } @@ -1493,7 +1493,7 @@ static u8 ov84_0223CA5C (UnkStruct_ov84_0223B5A0 * param0) ov84_02240B68(param0); return 1; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_424 == 1) { return 1; } @@ -1609,7 +1609,7 @@ static int ov84_0223CDB0 (UnkStruct_ov84_0223B5A0 * param0) if (v0 != 0xffffffff) { u16 v1 = 0xfffe; - if (sub_0201C784(param0->unk_00, 4, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_00, 4, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } @@ -1624,7 +1624,7 @@ static int ov84_0223CE08 (UnkStruct_ov84_0223B5A0 * param0) if (v0 != 0xffffffff) { u16 v1 = 0xfffe; - if (sub_0201C784(param0->unk_00, 4, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_00, 4, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } @@ -1806,7 +1806,7 @@ static BOOL ov84_0223D1F4 (UnkStruct_ov84_0223B5A0 * param0) if (v0 != 0xffffffff) { u16 v1 = 0xfffe; - if (sub_0201C784(param0->unk_00, 4, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_00, 4, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0; } @@ -1869,7 +1869,7 @@ static u8 ov84_0223D2F8 (UnkStruct_ov84_0223B5A0 * param0) return 1; } - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { Sound_PlayEffect(1500); ov84_0223D42C(param0); return 1; @@ -1900,7 +1900,7 @@ static u8 ov84_0223D2F8 (UnkStruct_ov84_0223B5A0 * param0) case 0xfffffffe: Sound_PlayEffect(1500); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov84_0223D42C(param0); } else { ov84_0223D484(param0); @@ -2139,7 +2139,7 @@ static int ov84_0223D858 (UnkStruct_ov84_0223B5A0 * param0) static int ov84_0223D8EC (UnkStruct_ov84_0223B5A0 * param0) { if (Message_Printing(param0->unk_426) == 0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { sub_0200E084(¶m0->unk_04[6], 0); sub_0201A9A4(¶m0->unk_04[1]); ov84_02240B34(param0, 1); @@ -2216,7 +2216,7 @@ static int ov84_0223DA14 (UnkStruct_ov84_0223B5A0 * param0) break; } - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { Strbuf* v1 = MessageLoader_GetNewStrbuf(param0->unk_114, 60); BGL_FillWindow(¶m0->unk_04[6], 15); @@ -2351,7 +2351,7 @@ static int ov84_0223DDD0 (UnkStruct_ov84_0223B5A0 * param0) break; } - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { sub_0200E084(¶m0->unk_04[6], 0); param0->unk_483 = 2; } @@ -2433,13 +2433,13 @@ static int ov84_0223DF0C (UnkStruct_ov84_0223B5A0 * param0) Sound_PlayEffect(1592); return 7; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov84_0223FFF0(param0); ov84_02240D3C(param0, 0); Sound_PlayEffect(1500); return 8; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov84_0223FFC0(param0); ov84_02240D3C(param0, 0); ov84_02240B34(param0, 1); @@ -2531,7 +2531,7 @@ static int ov84_0223E158 (UnkStruct_ov84_0223B5A0 * param0) static int ov84_0223E18C (UnkStruct_ov84_0223B5A0 * param0) { if (Message_Printing(param0->unk_426) == 0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { param0->unk_479 = 0; sub_0200E084(¶m0->unk_04[6], 0); sub_0201A9A4(¶m0->unk_04[1]); @@ -2627,7 +2627,7 @@ static int ov84_0223E27C (UnkStruct_ov84_0223B5A0 * param0) static int ov84_0223E36C (UnkStruct_ov84_0223B5A0 * param0) { if (Message_Printing(param0->unk_426) == 0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { sub_0200E084(¶m0->unk_04[6], 0); sub_0201A9A4(¶m0->unk_04[1]); ov84_02240B34(param0, 1); @@ -2755,7 +2755,7 @@ static int ov84_0223E5C4 (UnkStruct_ov84_0223B5A0 * param0) Sound_PlayEffect(1592); return 18; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Strbuf* v1; ov84_02240D3C(param0, 0); @@ -2772,7 +2772,7 @@ static int ov84_0223E5C4 (UnkStruct_ov84_0223B5A0 * param0) return 19; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param0->unk_48C = 0; ov84_02240D3C(param0, 0); @@ -2885,7 +2885,7 @@ static int ov84_0223E920 (UnkStruct_ov84_0223B5A0 * param0) static int ov84_0223E9B0 (UnkStruct_ov84_0223B5A0 * param0) { if (Message_Printing(param0->unk_426) == 0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchInput) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || gCoreSys.touchPressed) { param0->unk_479 = 0; param0->unk_48C = 0; @@ -2987,15 +2987,15 @@ static BOOL ov84_0223EB84 (UnkStruct_ov84_0223B5A0 * param0, u16 param1) param0->unk_492 = 1; param0->unk_498 = 0; param0->unk_494 = 0; - param0->unk_49E = gCoreSys.unk_5C; - param0->unk_4A0 = gCoreSys.unk_5E; + param0->unk_49E = gCoreSys.touchX; + param0->unk_4A0 = gCoreSys.touchY; } if (param0->unk_492 == 1) { if (ov84_0223EB6C() == 1) { s32 v0, v1; - v0 = sub_0201D4CC(128 - param0->unk_49E, 80 - param0->unk_4A0, 128 - gCoreSys.unk_5C, 80 - gCoreSys.unk_5E, 80); + v0 = sub_0201D4CC(128 - param0->unk_49E, 80 - param0->unk_4A0, 128 - gCoreSys.touchX, 80 - gCoreSys.touchY, 80); v1 = sub_0201D580(80, v0 * 2); v1 = ((v1 << 8) / 182) >> 8; param0->unk_49A += v1; @@ -3031,8 +3031,8 @@ static BOOL ov84_0223EB84 (UnkStruct_ov84_0223B5A0 * param0, u16 param1) } } } - param0->unk_49E = gCoreSys.unk_5C; - param0->unk_4A0 = gCoreSys.unk_5E; + param0->unk_49E = gCoreSys.touchX; + param0->unk_4A0 = gCoreSys.touchY; } else { param0->unk_492 = 0; param0->unk_498 = 0; diff --git a/src/overlay085/ov85_02241440.c b/src/overlay085/ov85_02241440.c index 80ec40d8ea..ce516b9469 100644 --- a/src/overlay085/ov85_02241440.c +++ b/src/overlay085/ov85_02241440.c @@ -246,7 +246,7 @@ int ov85_02241440 (UnkStruct_020067E8 * param0, int * param1) ov85_022417CC(); ov85_022417E4(v0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); sub_0201E3D8(); sub_0201E450(4); @@ -717,7 +717,7 @@ static int ov85_02241D10 (UnkStruct_ov85_022417E4 * param0) { u32 v0; - if (gCoreSys.unk_44 & PAD_KEY_UP) { + if (gCoreSys.heldKeys & PAD_KEY_UP) { v0 = ov85_02241EB8(param0->unk_1F8->unk_00, param0->unk_1F8->unk_08, -1); if (param0->unk_1F8->unk_08 != v0) { @@ -737,7 +737,7 @@ static int ov85_02241D10 (UnkStruct_ov85_022417E4 * param0) return 1; } - if (gCoreSys.unk_44 & PAD_KEY_DOWN) { + if (gCoreSys.heldKeys & PAD_KEY_DOWN) { v0 = ov85_02241EB8(param0->unk_1F8->unk_00, param0->unk_1F8->unk_08, 1); if (param0->unk_1F8->unk_08 != v0) { @@ -757,7 +757,7 @@ static int ov85_02241D10 (UnkStruct_ov85_022417E4 * param0) return 1; } - if ((gCoreSys.padInput & PAD_BUTTON_B) || (gCoreSys.touchInput)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (gCoreSys.touchPressed)) { sub_0208C120(1, 36); return 3; } diff --git a/src/overlay086/ov86_0223B140.c b/src/overlay086/ov86_0223B140.c index cf510e8438..35a94bcac2 100644 --- a/src/overlay086/ov86_0223B140.c +++ b/src/overlay086/ov86_0223B140.c @@ -556,7 +556,7 @@ static BOOL ov86_0223B574 (UnkStruct_ov86_0223B3C8 * param0) param0->unk_00++; break; case 8: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } break; diff --git a/src/overlay087/ov87_021D0D80.c b/src/overlay087/ov87_021D0D80.c index bf1f74c6a5..f07f1932d0 100644 --- a/src/overlay087/ov87_021D0D80.c +++ b/src/overlay087/ov87_021D0D80.c @@ -82,33 +82,33 @@ int ov87_021D0E2C (UnkStruct_020067E8 * param0, int * param1) switch (*param1) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov87_021D0F38(v0, 1); (*param1)++; break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v0->unk_00.unk_1C ^= 1; ov87_021D0F38(v0, 4); break; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (ov87_021D0F4C(v0)) { ov87_021D0F38(v0, 3); } break; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (ov87_021D0F88(v0)) { ov87_021D0F38(v0, 3); } break; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (--(v0->unk_00.unk_18) < 0) { if (ov87_021D0F4C(v0)) { v0->unk_00.unk_18 = v0->unk_00.unk_14 - 1; @@ -120,7 +120,7 @@ int ov87_021D0E2C (UnkStruct_020067E8 * param0, int * param1) break; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (++(v0->unk_00.unk_18) >= v0->unk_00.unk_14) { if (ov87_021D0F88(v0)) { ov87_021D0F38(v0, 3); diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index a037ebf9fc..0184803ad4 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -315,7 +315,7 @@ int ov88_0223B140 (UnkStruct_020067E8 * param0, int * param1) v0->unk_40 = NULL; ov88_0223C370(v0, param0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov88_0223C15C(); ov88_0223C17C(v0->unk_174); sub_0200F174(0, 1, 1, 0x0, 16, 1, 26); @@ -1488,22 +1488,22 @@ static void ov88_0223CE34 (u32 * param0) int v0 = 0; int v1 = 0; - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { v1 = 1; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { v1 = 2; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { v1 = 3; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { v1 = 4; v0++; } @@ -1704,7 +1704,7 @@ static void ov88_0223D140 (UnkStruct_0202CC84 * param0) static int ov88_0223D150 (UnkStruct_02095E80 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); param0->unk_88[0] = 12; ov88_0223BE28(param0); @@ -1712,7 +1712,7 @@ static int ov88_0223D150 (UnkStruct_02095E80 * param0) } else { ov88_0223CE34(¶m0->unk_14C[0]); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_14C[0] == 0) { if (param0->unk_88[0] == 12) { param0->unk_226C = ov88_0223D2C4; @@ -1813,7 +1813,7 @@ static int ov88_0223D3E0 (UnkStruct_02095E80 * param0) static int ov88_0223D434 (UnkStruct_02095E80 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { sub_02019CB8(param0->unk_174, 0, 0, 0, 0, 32, 24, 0); ov88_0223ECBC(¶m0->unk_49C[21], 15, 1, param0->unk_184, param0->unk_178); param0->unk_226C = ov88_0223D150; diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 7a00c62b8a..a160842500 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -152,7 +152,7 @@ int ov90_021D0D80 (UnkStruct_020067E8 * param0, int * param1) v0->unk_24 = sub_0202D764(v1->unk_00); v0->unk_00 = 74; - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); return 1; } @@ -331,7 +331,7 @@ static void ov90_021D1034 (void * param0) static int ov90_021D105C (UnkStruct_ov90_021D0ECC * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); return 1; } @@ -377,12 +377,12 @@ static int ov90_021D1080 (UnkStruct_ov90_021D0ECC * param0) { int v0 = 0; - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); return 1; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (param0->unk_0B >= 10) { @@ -392,26 +392,26 @@ static int ov90_021D1080 (UnkStruct_ov90_021D0ECC * param0) param0->unk_0D = (param0->unk_0D + 1) % 2; v0 = 1; } else { - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { v0 = inline_ov90_021D1080(param0); if (v0) { Sound_PlayEffect(1500); } - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { v0 = inline_ov90_021D1080_1(param0); if (v0) { Sound_PlayEffect(1500); } - } else if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { param0->unk_0C = (param0->unk_0C + 2) % 3; v0 = 1; if (param0->unk_0B != 10) { Sound_PlayEffect(1500); } - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { param0->unk_0C = (param0->unk_0C + 1) % 3; v0 = 1; diff --git a/src/overlay091/ov91_021D0D80.c b/src/overlay091/ov91_021D0D80.c index ed66961246..2ed260aea0 100644 --- a/src/overlay091/ov91_021D0D80.c +++ b/src/overlay091/ov91_021D0D80.c @@ -674,7 +674,7 @@ static int ov91_021D122C (UnkStruct_ov91_021D0ED8 * param0) u32 v0; u16 v1, v2; - if (gCoreSys.padInput & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { Sound_PlayEffect(1501); param0->unk_00->unk_14 ^= 1; ov91_021D1498(param0); diff --git a/src/overlay092/ov92_021D0D80.c b/src/overlay092/ov92_021D0D80.c index 98dc62061e..11d133532c 100644 --- a/src/overlay092/ov92_021D0D80.c +++ b/src/overlay092/ov92_021D0D80.c @@ -367,7 +367,7 @@ int ov92_021D0D80 (UnkStruct_020067E8 * param0, int * param1) gCoreSys.unk_65 = 1; GXLayers_SwapDisplay(); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); sub_02002AC8(1); sub_02002AE4(0); sub_02002B20(0); @@ -616,7 +616,7 @@ int ov92_021D0EB8 (UnkStruct_020067E8 * param0, int * param1) u16 v10 = v0->unk_BAD8; ov92_021D1700(v0); - if ((gCoreSys.padInput & PAD_BUTTON_B) || (v0->unk_BAF8 & PAD_BUTTON_B)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (v0->unk_BAF8 & PAD_BUTTON_B)) { Window_Clear(&v0->unk_B834, 0); Sound_PlayEffect(1501); BGL_WindowColor(&v0->unk_B814, 15, 0, 0, 27 * 8, 4 * 8); @@ -629,7 +629,7 @@ int ov92_021D0EB8 (UnkStruct_020067E8 * param0, int * param1) *param1 = 17; } } else { - if ((gCoreSys.padInput & PAD_BUTTON_X) && (v0->unk_BB28 == 0)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_X) && (v0->unk_BB28 == 0)) { v0->unk_BB28 = 1; ov92_021D1F90(v0); @@ -639,7 +639,7 @@ int ov92_021D0EB8 (UnkStruct_020067E8 * param0, int * param1) break; } - if ((gCoreSys.padInput & (PAD_BUTTON_X | PAD_BUTTON_A | PAD_BUTTON_B)) && (v0->unk_BB28 == 1)) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_X | PAD_BUTTON_A | PAD_BUTTON_B)) && (v0->unk_BB28 == 1)) { v0->unk_BB28 = 0; ov92_021D1F90(v0); break; @@ -648,7 +648,7 @@ int ov92_021D0EB8 (UnkStruct_020067E8 * param0, int * param1) { BOOL v11; - v11 = ov92_021D2460(v0, gCoreSys.padInput, gCoreSys.unk_44); + v11 = ov92_021D2460(v0, gCoreSys.pressedKeys, gCoreSys.heldKeys); if ((v11 == 1) && (v0->unk_BB28 == 1)) { v0->unk_BB28 = 0; @@ -856,8 +856,8 @@ static void ov92_021D1700 (UnkStruct_ov92_021D1B24 * param0) param0->unk_BAF8 = 0; - if (gCoreSys.touchInput) { - if ((gCoreSys.unk_5C >= (25 * 8)) && (gCoreSys.unk_5C <= ((25 + 6) * 8)) && (gCoreSys.unk_5E >= (21 * 8)) && (gCoreSys.unk_5E <= ((21 + 2) * 8))) { + if (gCoreSys.touchPressed) { + if ((gCoreSys.touchX >= (25 * 8)) && (gCoreSys.touchX <= ((25 + 6) * 8)) && (gCoreSys.touchY >= (21 * 8)) && (gCoreSys.touchY <= ((21 + 2) * 8))) { param0->unk_BAF8 = PAD_BUTTON_B; return; } else { @@ -866,13 +866,13 @@ static void ov92_021D1700 (UnkStruct_ov92_021D1B24 * param0) param0->unk_BB0C = 0; param0->unk_BB10 = 0; param0->unk_BAF8 = 0; - param0->unk_BB00 = gCoreSys.unk_5C; - param0->unk_BB04 = gCoreSys.unk_5E; + param0->unk_BB00 = gCoreSys.touchX; + param0->unk_BB04 = gCoreSys.touchY; param0->unk_BB10 = 4; } } - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { switch (param0->unk_BAFC) { case 0: if (!param0->unk_BB10) { @@ -885,8 +885,8 @@ static void ov92_021D1700 (UnkStruct_ov92_021D1B24 * param0) param0->unk_BAF8 = v0 | v2; param0->unk_BB08 = v1; param0->unk_BB0C = v3; - param0->unk_BB00 = gCoreSys.unk_5C; - param0->unk_BB04 = gCoreSys.unk_5E; + param0->unk_BB00 = gCoreSys.touchX; + param0->unk_BB04 = gCoreSys.touchY; break; } } else { @@ -908,8 +908,8 @@ static void ov92_021D1818 (int param0, int param1, int * param2, int * param3, i int v2 = 0; int v3 = 0; - if (gCoreSys.unk_5C != 0xffff) { - v2 = gCoreSys.unk_5C - param0; + if (gCoreSys.touchX != 0xffff) { + v2 = gCoreSys.touchX - param0; if (v2 < 0) { v2 ^= -1; @@ -925,8 +925,8 @@ static void ov92_021D1818 (int param0, int param1, int * param2, int * param3, i *param2 = v0; *param3 = v2; - if (gCoreSys.unk_5E != 0xffff) { - v3 = gCoreSys.unk_5E - param1; + if (gCoreSys.touchY != 0xffff) { + v3 = gCoreSys.touchY - param1; if (v3 < 0) { v3 ^= -1; @@ -1034,7 +1034,7 @@ static BOOL ov92_021D1B70 (UnkStruct_ov92_021D1B24 * param0, u32 param1, int par } break; case 2: - if ((param2 != 0) || (gCoreSys.padInput & PAD_BUTTON_A)) { + if ((param2 != 0) || (gCoreSys.pressedKeys & PAD_BUTTON_A)) { param0->unk_B864 = 0; v0 = 1; } diff --git a/src/overlay094/ov94_0223BCB0.c b/src/overlay094/ov94_0223BCB0.c index 427cb3c189..3bf5f56033 100644 --- a/src/overlay094/ov94_0223BCB0.c +++ b/src/overlay094/ov94_0223BCB0.c @@ -130,7 +130,7 @@ int ov94_0223BCB0 (UnkStruct_020067E8 * param0, int * param1) v0->unk_B94 = MessageLoader_Init(0, 26, 412, 62); v0->unk_BA0 = MessageLoader_Init(0, 26, 694, 62); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov94_0223C03C(v0, param0); ov94_0223C4E0(v0); diff --git a/src/overlay094/ov94_0223C610.c b/src/overlay094/ov94_0223C610.c index 47f3258364..5bab314c7e 100644 --- a/src/overlay094/ov94_0223C610.c +++ b/src/overlay094/ov94_0223C610.c @@ -431,11 +431,11 @@ static int ov94_0223CBEC (UnkStruct_ov94_0223FD4C * param0) static int ov94_0223CC28 (UnkStruct_ov94_0223FD4C * param0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov94_0223CFD8(param0, 7, ov94_0223C4D4(param0), 0, 0xf0f); ov94_0223C3F4(param0, 10, 12); sub_02021CC8(param0->unk_E20, 0); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { switch (param0->unk_10C) { case 0: if (param0->unk_36 == 0) { @@ -470,13 +470,13 @@ static int ov94_0223CC28 (UnkStruct_ov94_0223FD4C * param0) Sound_PlayEffect(1500); break; } - } else if (gCoreSys.padInput & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_10C != 0) { param0->unk_10C--; Sound_PlayEffect(1500); ov94_0223C3FC(param0->unk_E20, Unk_ov94_02245A48[param0->unk_10C][0], Unk_ov94_02245A48[param0->unk_10C][1]); } - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_10C < 2) { param0->unk_10C++; Sound_PlayEffect(1500); diff --git a/src/overlay094/ov94_0223D0C4.c b/src/overlay094/ov94_0223D0C4.c index bbcb654c6f..a85411b0b8 100644 --- a/src/overlay094/ov94_0223D0C4.c +++ b/src/overlay094/ov94_0223D0C4.c @@ -361,11 +361,11 @@ static int ov94_0223D5B0 (UnkStruct_ov94_0223FD4C * param0) static int ov94_0223D5B8 (UnkStruct_ov94_0223FD4C * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov94_0223D88C(param0, 5, 1, 0, 0xf0f, (Pokemon *)param0->unk_12C.unk_00.unk_00); ov94_0223C3F4(param0, 3, 7); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param0->unk_2C = 2; ov94_0223C4C0(param0, 1, 0); Sound_PlayEffect(1500); diff --git a/src/overlay094/ov94_0223DC04.c b/src/overlay094/ov94_0223DC04.c index 03724c21d6..47d6ad2f22 100644 --- a/src/overlay094/ov94_0223DC04.c +++ b/src/overlay094/ov94_0223DC04.c @@ -330,22 +330,22 @@ static int ov94_0223E09C (UnkStruct_ov94_0223FD4C * param0) static int ov94_0223E0A4 (UnkStruct_ov94_0223FD4C * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov94_0223E300(param0, 16, 1, 0, 0xf0f); ov94_0223C3F4(param0, 3, 4); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param0->unk_2C = 2; ov94_0223C4C0(param0, 4, 0); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_10E == 0) { param0->unk_10E = 1; param0->unk_2C = 6; Sound_PlayEffect(1500); } - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_10E != 0) { param0->unk_10E = 0; param0->unk_2C = 6; diff --git a/src/overlay094/ov94_0223E46C.c b/src/overlay094/ov94_0223E46C.c index 77d4eb92fd..1fad2d470b 100644 --- a/src/overlay094/ov94_0223E46C.c +++ b/src/overlay094/ov94_0223E46C.c @@ -418,7 +418,7 @@ static int ov94_0223EA84 (UnkStruct_ov94_0223FD4C * param0) { ov94_0223EFAC(param0); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { int v0 = ov94_0223EF94(param0); switch (v0) { @@ -455,7 +455,7 @@ static int ov94_0223EA84 (UnkStruct_ov94_0223FD4C * param0) Sound_PlayEffect(1500); break; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov94_0223F9A4(param0, 15, 1, 0, 0xf0f); ov94_0223C3F4(param0, 23, 25); Sound_PlayEffect(1500); @@ -690,7 +690,7 @@ static void ov94_0223EFAC (UnkStruct_ov94_0223FD4C * param0) { int v0; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_10E4->unk_24 == 0) { if (param0->unk_10E4->unk_28 > 0) { param0->unk_10E4->unk_28--; @@ -703,7 +703,7 @@ static void ov94_0223EFAC (UnkStruct_ov94_0223FD4C * param0) param0->unk_10E4->unk_2C = 0; } - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_10E4->unk_24 == 0) { if (param0->unk_10E4->unk_28 < 3) { param0->unk_10E4->unk_28++; @@ -716,13 +716,13 @@ static void ov94_0223EFAC (UnkStruct_ov94_0223FD4C * param0) param0->unk_10E4->unk_2C = 1; } - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_10E4->unk_24 != 1) { Sound_PlayEffect(1500); } param0->unk_10E4->unk_24 = 1; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_10E4->unk_24 != 0) { Sound_PlayEffect(1500); } diff --git a/src/overlay094/ov94_0223FB48.c b/src/overlay094/ov94_0223FB48.c index 0305714e1e..ce8f71b29c 100644 --- a/src/overlay094/ov94_0223FB48.c +++ b/src/overlay094/ov94_0223FB48.c @@ -551,11 +551,11 @@ static int ov94_022402BC (UnkStruct_ov94_0223FD4C * param0) ov94_022404F0(param0); if (param0->unk_24 == 5) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov94_0223C4C0(param0, 1, 0); param0->unk_2C = 2; Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_112 == 30) { ov94_0223C4C0(param0, 1, 0); param0->unk_2C = 2; @@ -584,11 +584,11 @@ static int ov94_022402BC (UnkStruct_ov94_0223FD4C * param0) } } } else if (param0->unk_24 == 6) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov94_0223C4C0(param0, 3, 0); param0->unk_2C = 2; Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_112 == 30) { ov94_0223C4C0(param0, 3, 0); param0->unk_2C = 2; @@ -632,13 +632,13 @@ static void ov94_022404F0 (UnkStruct_ov94_0223FD4C * param0) { int v0 = 0, v1 = 0, v2 = 0; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v1 = 1; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v1 = 2; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v1 = 3; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v1 = 4; } diff --git a/src/overlay094/ov94_022414B8.c b/src/overlay094/ov94_022414B8.c index 7f7379decf..e59773d731 100644 --- a/src/overlay094/ov94_022414B8.c +++ b/src/overlay094/ov94_022414B8.c @@ -535,7 +535,7 @@ static int ov94_0224195C (UnkStruct_ov94_0223FD4C * param0) static int ov94_02241990 (UnkStruct_ov94_0223FD4C * param0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov94_0223C4C0(param0, 5, 5); param0->unk_2C = 2; } diff --git a/src/overlay094/ov94_02244950.c b/src/overlay094/ov94_02244950.c index 5189fdd102..8983ceb624 100644 --- a/src/overlay094/ov94_02244950.c +++ b/src/overlay094/ov94_02244950.c @@ -756,7 +756,7 @@ static int ov94_02245540 (UnkStruct_ov94_0223FD4C * param0) static int ov94_02245564 (UnkStruct_ov94_0223FD4C * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A || gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A || gCoreSys.pressedKeys & PAD_BUTTON_B) { Window_Clear(¶m0->unk_F8C, 0); param0->unk_2C = 0; } diff --git a/src/overlay096/ov96_0223B6A0.c b/src/overlay096/ov96_0223B6A0.c index 023ae842f9..5b9ac2a119 100644 --- a/src/overlay096/ov96_0223B6A0.c +++ b/src/overlay096/ov96_0223B6A0.c @@ -99,7 +99,7 @@ int ov96_0223B6A0 (UnkStruct_020067E8 * param0, int * param1) v0->unk_BD4 = MessageLoader_Init(0, 26, 674, 68); v0->unk_BD8 = MessageLoader_Init(0, 26, 695, 68); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov96_0223B980(v0, param0); ov96_0223BC64(v0); sub_02004550(52, 0, 0); diff --git a/src/overlay096/ov96_0223BCE0.c b/src/overlay096/ov96_0223BCE0.c index b57f233855..44de893531 100644 --- a/src/overlay096/ov96_0223BCE0.c +++ b/src/overlay096/ov96_0223BCE0.c @@ -891,7 +891,7 @@ static int ov96_0223CA28 (UnkStruct_ov96_0223BF40 * param0) static int ov96_0223CA70 (UnkStruct_ov96_0223BF40 * param0) { - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { param0->unk_98++; if (param0->unk_98 > param0->unk_94) { @@ -900,7 +900,7 @@ static int ov96_0223CA70 (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E58, param0->unk_BE4, param0->unk_98, 3); Sound_PlayEffect(1500); - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { param0->unk_98--; if (param0->unk_98 < 1) { @@ -909,7 +909,7 @@ static int ov96_0223CA70 (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E58, param0->unk_BE4, param0->unk_98, 3); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { { RTCTime v0; RTCDate v1; @@ -925,7 +925,7 @@ static int ov96_0223CA70 (UnkStruct_ov96_0223BF40 * param0) ov96_0223D950(param0, 0, 0); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov96_0223D950(param0, 0, 0); param0->unk_1C = 21; Sound_PlayEffect(1500); @@ -1156,7 +1156,7 @@ static int ov96_0223CF5C (UnkStruct_ov96_0223BF40 * param0) static int ov96_0223CFAC (UnkStruct_ov96_0223BF40 * param0) { - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { param0->unk_90++; if (param0->unk_90 > 10) { @@ -1165,7 +1165,7 @@ static int ov96_0223CFAC (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E48, param0->unk_BE8, param0->unk_90, 2); Sound_PlayEffect(1500); - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { param0->unk_90--; if (param0->unk_90 < 1) { @@ -1174,11 +1174,11 @@ static int ov96_0223CFAC (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E48, param0->unk_BE8, param0->unk_90, 2); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov96_0223D950(param0, 0, 0); ov96_0223BBFC(param0, 11, 32); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov96_0223D950(param0, 0, 0); param0->unk_1C = 23; Sound_PlayEffect(1500); @@ -1211,7 +1211,7 @@ static int ov96_0223D0B0 (UnkStruct_ov96_0223BF40 * param0) static int ov96_0223D100 (UnkStruct_ov96_0223BF40 * param0) { - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { param0->unk_98++; if (param0->unk_98 == param0->unk_94 + 1) { @@ -1220,7 +1220,7 @@ static int ov96_0223D100 (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E58, param0->unk_BE4, param0->unk_98, 3); Sound_PlayEffect(1500); - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { param0->unk_98--; if (param0->unk_98 < 1) { @@ -1229,11 +1229,11 @@ static int ov96_0223D100 (UnkStruct_ov96_0223BF40 * param0) ov96_0223D90C(¶m0->unk_E58, param0->unk_BE4, param0->unk_98, 3); Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov96_0223D950(param0, 0, 0); param0->unk_1C = 35; Sound_PlayEffect(1500); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov96_0223D950(param0, 0, 0); param0->unk_1C = 29; Sound_PlayEffect(1500); @@ -1590,7 +1590,7 @@ static int ov96_0223D7B8 (UnkStruct_ov96_0223BF40 * param0) static int ov96_0223D7E4 (UnkStruct_ov96_0223BF40 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A || gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A || gCoreSys.pressedKeys & PAD_BUTTON_B) { Window_Clear(¶m0->unk_E78, 0); param0->unk_1C = 0; } diff --git a/src/overlay097/ov97_0222AE60.c b/src/overlay097/ov97_0222AE60.c index d5f6d2bc8f..ef9420a806 100644 --- a/src/overlay097/ov97_0222AE60.c +++ b/src/overlay097/ov97_0222AE60.c @@ -206,7 +206,7 @@ static BOOL ov97_0222AE64 (UnkStruct_0222AE60 * param0) } } } else { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); Window_Clear(¶m0->unk_158, 0); BGL_DeleteWindow(¶m0->unk_158); @@ -391,10 +391,10 @@ static BOOL ov97_0222B07C (UnkStruct_0222AE60 * param0) if (param0->unk_134) { param0->unk_134--; } else { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { BGL_DeleteWindow(¶m0->unk_13C); param0->unk_12C = 19; - param0->unk_138 = gCoreSys.padInput; + param0->unk_138 = gCoreSys.pressedKeys; Sound_PlayEffect(1500); } } @@ -1075,8 +1075,8 @@ static int ov97_0222BE24 (UnkStruct_020067E8 * param0, int * param1) v1->unk_124 = 10; break; case 5: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); v1->unk_58 = v1->unk_DC[v1->unk_54]; @@ -1119,11 +1119,11 @@ static int ov97_0222BE24 (UnkStruct_020067E8 * param0, int * param1) break; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { ov97_0222BB88(v1, -1); } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { ov97_0222BB88(v1, 1); } diff --git a/src/overlay097/ov97_0222C174.c b/src/overlay097/ov97_0222C174.c index 38c6e12357..f7d67a27fd 100644 --- a/src/overlay097/ov97_0222C174.c +++ b/src/overlay097/ov97_0222C174.c @@ -589,7 +589,7 @@ static BOOL ov97_0222C404 (UnkStruct_ov97_0222C388 * param0) ov97_0223795C(param0->unk_04, &v0, 5, 4, 2); return 1; } else { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Window_Clear(¶m0->unk_18, 0); BGL_DeleteWindow(¶m0->unk_18); return 0; @@ -744,7 +744,7 @@ static int ov97_0222C78C (UnkStruct_020067E8 * param0, int * param1) } break; case UnkEnum_ov97_0222C78C_03: - if ((Message_Printing(v0->unk_317C) == 0) && gCoreSys.padInput & PAD_BUTTON_A) { + if ((Message_Printing(v0->unk_317C) == 0) && gCoreSys.pressedKeys & PAD_BUTTON_A) { ov97_02237784(1); ov97_02237790(0, UnkEnum_ov97_0222C78C_12, param1, UnkEnum_ov97_0222C78C_13); } @@ -771,7 +771,7 @@ static int ov97_0222C78C (UnkStruct_020067E8 * param0, int * param1) v0->unk_3180.unk_104.unk_4E_2 = 0; break; case UnkEnum_ov97_0222C78C_06: - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { ov97_02237790(0, UnkEnum_ov97_0222C78C_11, param1, UnkEnum_ov97_0222C78C_13); } break; @@ -872,7 +872,7 @@ static int ov97_0222CAB4 (UnkStruct_ov97_0222C388 * param0, int * param1, int pa } } - if (param3 && gCoreSys.padInput & param3) { + if (param3 && gCoreSys.pressedKeys & param3) { ov97_022333BC(); *param1 = UnkEnum_ov97_0222C6F8_26; return 1; @@ -952,7 +952,7 @@ int ov97_0222CB10 (UnkStruct_ov97_0222C388 * param0) *v3 = UnkEnum_ov97_0222C6F8_30; break; case UnkEnum_ov97_0222C6F8_30: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { *v3 = UnkEnum_ov97_0222C6F8_08; } @@ -1090,7 +1090,7 @@ int ov97_0222CB10 (UnkStruct_ov97_0222C388 * param0) param0->unk_148 = 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { *v3 = UnkEnum_ov97_0222C6F8_27; return 4; } @@ -1117,7 +1117,7 @@ int ov97_0222CB10 (UnkStruct_ov97_0222C388 * param0) param0->unk_148 = 0; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { OS_ResetSystem(0); } } diff --git a/src/overlay097/ov97_0222D30C.c b/src/overlay097/ov97_0222D30C.c index 6570588e48..31dc13aeaf 100644 --- a/src/overlay097/ov97_0222D30C.c +++ b/src/overlay097/ov97_0222D30C.c @@ -2178,7 +2178,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) *param1 = 8; } - if ((gCoreSys.padInput & PAD_BUTTON_B) || (--v3->unk_434 == 0)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (--v3->unk_434 == 0)) { ov97_0222D30C(v3, 0); ov97_0222D2DC(); sub_02039794(); @@ -2210,7 +2210,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) break; } - if ((gCoreSys.padInput & PAD_BUTTON_B) || (--v3->unk_434 == 0)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (--v3->unk_434 == 0)) { ov97_0222D2DC(); sub_02039794(); ov97_0222D40C(v3, -1); @@ -2225,7 +2225,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) v1 = sub_0203608C(); - if ((gCoreSys.padInput & PAD_BUTTON_B) || (--v3->unk_434 == 0) || ((v1 != 0) && (sub_02035D78(v1) == 0))) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (--v3->unk_434 == 0) || ((v1 != 0) && (sub_02035D78(v1) == 0))) { ov97_0222D30C(v3, 0); ov97_0222D2DC(); sub_02039794(); @@ -2310,7 +2310,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) *param1 = 18; break; case 18: - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { Sound_PlayEffect(1500); ov97_0222DDD0(param0, (((1 + (18 + 12)) + 9) + 26 * 6), 0); *param1 = 3; @@ -2399,7 +2399,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) *param1 = ov97_0222E228(param0, NULL, NULL, *param1); break; case 51: - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { ov97_0222D444(&v3->unk_58, 0); *param1 = ov97_0222DA64(param0); } @@ -2420,7 +2420,7 @@ static int ov97_0222F75C (UnkStruct_020067E8 * param0, int * param1) return 1; break; case 55: - if (gCoreSys.padInput) { + if (gCoreSys.pressedKeys) { Sound_PlayEffect(1500); if (v3->unk_8C.unk_00.unk_4E_2 == 1) { @@ -2603,7 +2603,7 @@ static void ov97_022302F4 (UnkStruct_ov97_0222D04C * param0) break; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { switch (Unk_ov97_0223F1A8) { case 40: case 41: diff --git a/src/overlay097/ov97_02230410.c b/src/overlay097/ov97_02230410.c index 6caa5fadd4..aaf9640f13 100644 --- a/src/overlay097/ov97_02230410.c +++ b/src/overlay097/ov97_02230410.c @@ -993,11 +993,11 @@ static void ov97_022314FC (UnkStruct_ov97_02230868 * param0, int param1, int * p int v0; int v1 = param0->unk_3E10; - if (gCoreSys.padInput & PAD_KEY_RIGHT && (param0->unk_3E10 != 1)) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT && (param0->unk_3E10 != 1)) { param0->unk_3E10 = 1; } - if (gCoreSys.padInput & PAD_KEY_LEFT && (param0->unk_3E10 != 0)) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT && (param0->unk_3E10 != 0)) { param0->unk_3E10 = 0; } @@ -1008,13 +1008,13 @@ static void ov97_022314FC (UnkStruct_ov97_02230868 * param0, int param1, int * p v0 = 0; - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v0 = 2; - } else if ((gCoreSys.padInput & PAD_BUTTON_A) && param1 && (param0->unk_3E10 == 0)) { + } else if ((gCoreSys.pressedKeys & PAD_BUTTON_A) && param1 && (param0->unk_3E10 == 0)) { v0 = 1; - } else if ((gCoreSys.padInput & PAD_BUTTON_A) && (param0->unk_3E10 == 1)) { + } else if ((gCoreSys.pressedKeys & PAD_BUTTON_A) && (param0->unk_3E10 == 1)) { v0 = 2; - } else if ((gCoreSys.padInput & PAD_BUTTON_A) && (param1 == 0)) { + } else if ((gCoreSys.pressedKeys & PAD_BUTTON_A) && (param1 == 0)) { v0 = 3; } @@ -1076,14 +1076,14 @@ static int ov97_0223161C (UnkStruct_020067E8 * param0, int * param1) case 3: v0 = v4->unk_2C20; - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v0 = ov97_02230F20(v4, v4->unk_2C20, -1); - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v0 = ov97_02230F20(v4, v4->unk_2C20, 1); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); ov97_02230C10(v4, 0, 28, param1); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); *param1 = 4; } @@ -1102,7 +1102,7 @@ static int ov97_0223161C (UnkStruct_020067E8 * param0, int * param1) case 5: ov97_02231088(param0, param1, NULL); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); *param1 = 11; } @@ -1125,7 +1125,7 @@ static int ov97_0223161C (UnkStruct_020067E8 * param0, int * param1) case 8: ov97_02231354(v4); - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1536); ov97_022312B4(v4, 1, 1 * FX32_ONE, 0.025 * FX32_ONE); *param1 = 9; @@ -1241,7 +1241,7 @@ static int ov97_0223161C (UnkStruct_020067E8 * param0, int * param1) } break; case 25: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { *param1 = 19; } break; diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index 51a3f4ef4f..4a7bdb5b91 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -1774,7 +1774,7 @@ static BOOL ov97_02235590 (UnkStruct_ov97_02234A2C * param0, int param1) return 1; } } else { - if (gCoreSys.touchInput || gCoreSys.padInput) { + if (gCoreSys.touchPressed || gCoreSys.pressedKeys) { sub_02002B20(0); Sound_PlayEffect(1500); return 1; @@ -1935,7 +1935,7 @@ static int ov97_022356E8 (UnkStruct_020067E8 * param0, int * param1) } break; case 7: - if (gCoreSys.touchInput || gCoreSys.padInput) { + if (gCoreSys.touchPressed || gCoreSys.pressedKeys) { ov97_02234CC4(v3, 0, 12, param1); } break; @@ -2129,7 +2129,7 @@ static int ov97_022356E8 (UnkStruct_020067E8 * param0, int * param1) } break; case 22: - if (gCoreSys.touchInput || gCoreSys.padInput) { + if (gCoreSys.touchPressed || gCoreSys.pressedKeys) { ov97_02234CF4(v3, 0, 24, param1); Sound_PlayEffect(1500); } diff --git a/src/overlay097/ov97_02238D74.c b/src/overlay097/ov97_02238D74.c index 1e81d08a1f..d639f795b3 100644 --- a/src/overlay097/ov97_02238D74.c +++ b/src/overlay097/ov97_02238D74.c @@ -237,7 +237,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v2->unk_26D8 = 1; } break; @@ -262,7 +262,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) *param1 = 4109; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { DWC_NASLoginAbort(); } break; @@ -318,7 +318,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) break; case 4107: if (Unk_ov97_02240400 == 0) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { ov97_02238E44(v2, 3, param1, 4108, 4108); } else { if (DWC_NdGetProgress(&v2->unk_26BC, &v2->unk_26C0) == 1) { @@ -369,7 +369,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) *param1 = 4112; break; case 4112: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { v2->unk_26DC = NULL; DWC_ClearError(); ov97_02238E94(); @@ -386,7 +386,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) } else { *param1 = v2->unk_16B0; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v2->unk_26D8 = 1; } break; @@ -394,7 +394,7 @@ int ov97_02238EAC (UnkStruct_020067E8 * param0, int * param1) if (Unk_ov97_02240404 == 1) { Unk_ov97_02240404 = 0; *param1 = v2->unk_16B0; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v2->unk_26D8 = 1; } diff --git a/src/overlay098/ov98_022471C8.c b/src/overlay098/ov98_022471C8.c index d281a74c03..8d46eaa950 100644 --- a/src/overlay098/ov98_022471C8.c +++ b/src/overlay098/ov98_022471C8.c @@ -320,7 +320,7 @@ int ov98_022471C8 (UnkStruct_020067E8 * param0, int * param1) v0->unk_04 = sub_02018340(109); sub_0201DBEC(64, 109); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov98_02247510(v0->unk_04); sub_0201E3D8(); sub_0201E450(4); @@ -2219,7 +2219,7 @@ static int ov98_02249414 (UnkStruct_ov98_02247704 * param0) static int ov98_02249438 (UnkStruct_ov98_02247704 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A || gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A || gCoreSys.pressedKeys & PAD_BUTTON_B) { Window_Clear(¶m0->unk_68, 0); param0->unk_08 = 0; } diff --git a/src/overlay099/ov99_021D0D80.c b/src/overlay099/ov99_021D0D80.c index bb6f252af2..437209f1e3 100644 --- a/src/overlay099/ov99_021D0D80.c +++ b/src/overlay099/ov99_021D0D80.c @@ -125,7 +125,7 @@ int ov99_021D0D80 (UnkStruct_020067E8 * param0, int * param1) v0->unk_08 = sub_02018340(75); sub_0201DBEC(64, 75); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov99_021D1380(v0->unk_08); @@ -194,7 +194,7 @@ int ov99_021D1028 (UnkStruct_020067E8 * param0, int * param1) v0->unk_1110 = ov99_021D3F6C(v0->unk_110C, 1); } - if (v0->unk_00->unk_04 && (gCoreSys.padInput & PAD_BUTTON_START)) { + if (v0->unk_00->unk_04 && (gCoreSys.pressedKeys & PAD_BUTTON_START)) { if ((v0->unk_1100 == 0) && (v0->unk_1101 < 6)) { sub_0200F174(0, 0, 0, 0x0, 6, 1, 75); v0->unk_1100 = 1; diff --git a/src/overlay099/ov99_021D3DE0.c b/src/overlay099/ov99_021D3DE0.c index 5275fdf98e..1c8abe3aba 100644 --- a/src/overlay099/ov99_021D3DE0.c +++ b/src/overlay099/ov99_021D3DE0.c @@ -21,7 +21,7 @@ BOOL ov99_021D3DE0 (UnkStruct_ov99_021D2CB0 * param0, UnkStruct_ov99_021D3A40 * break; case 1: if (ScreenWipe_Done() == 1) { - if ((param0->unk_10FC > 10080) || (gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_BUTTON_START)) { + if ((param0->unk_10FC > 10080) || (gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_BUTTON_START)) { sub_0200F174(0, 0, 0, 0x0, 45, 1, 75); param1->unk_00++; } diff --git a/src/overlay101/ov101_021D1A28.c b/src/overlay101/ov101_021D1A28.c index 151e8562c7..66db5b68a0 100644 --- a/src/overlay101/ov101_021D1A28.c +++ b/src/overlay101/ov101_021D1A28.c @@ -380,7 +380,7 @@ static int ov101_021D1C9C (UnkStruct_ov101_021D13C8 * param0) static int ov101_021D1CBC (UnkStruct_ov101_021D13C8 * param0) { - u32 v0 = gCoreSys.padInput; + u32 v0 = gCoreSys.pressedKeys; if ((param0->unk_7C[0] == 1) && (v0 & PAD_BUTTON_Y)) { param0->unk_7C[0] = 2; @@ -817,7 +817,7 @@ static int ov101_021D22D0 (UnkStruct_ov101_021D13C8 * param0) static int ov101_021D22F0 (UnkStruct_ov101_021D13C8 * param0) { - u32 v0 = gCoreSys.padInput; + u32 v0 = gCoreSys.pressedKeys; if ((param0->unk_7C[0] == 1) && (v0 & PAD_BUTTON_Y)) { param0->unk_7C[0] = 2; @@ -1184,7 +1184,7 @@ static int ov101_021D2828 (UnkStruct_ov101_021D13C8 * param0) static int ov101_021D2850 (UnkStruct_ov101_021D13C8 * param0) { - u32 v0 = gCoreSys.padInput; + u32 v0 = gCoreSys.pressedKeys; if ((param0->unk_7C[0] == 1) && (v0 & PAD_BUTTON_Y)) { param0->unk_7C[0] = 2; @@ -3145,7 +3145,7 @@ static void ov101_021D4614 (SysTask * param0, void * param1) v0 = 0x3; - if (gCoreSys.unk_44 & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) { + if (gCoreSys.heldKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_BUTTON_X | PAD_BUTTON_Y)) { v0 = 0x1; } @@ -4293,7 +4293,7 @@ UnkEnum_ov101_021D9688 ov101_021D55D4 (UnkStruct_ov101_021D13C8 * param0, UnkEnu static int ov101_021D55F8 (u32 param0) { - u32 v0 = gCoreSys.padInput & param0; + u32 v0 = gCoreSys.pressedKeys & param0; if (v0 == param0) { return 2; diff --git a/src/overlay102/ov102_021D0D80.c b/src/overlay102/ov102_021D0D80.c index 4a6830d40b..ac6b79c11f 100644 --- a/src/overlay102/ov102_021D0D80.c +++ b/src/overlay102/ov102_021D0D80.c @@ -92,7 +92,7 @@ int ov102_021D0D80 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov102_021D0F8C(v0); ov102_021D1174(v0); @@ -147,7 +147,7 @@ int ov102_021D0E2C (UnkStruct_020067E8 * param0, int * param1) } break; case 4: - if ((((gCoreSys.padInput & PAD_BUTTON_A) == PAD_BUTTON_A)) || (((gCoreSys.padInput & PAD_BUTTON_B) == PAD_BUTTON_B)) || (gCoreSys.touchInput)) { + if ((((gCoreSys.pressedKeys & PAD_BUTTON_A) == PAD_BUTTON_A)) || (((gCoreSys.pressedKeys & PAD_BUTTON_B) == PAD_BUTTON_B)) || (gCoreSys.touchPressed)) { sub_0200F174(0, 0, 0, 0x0, 6, 1, v0->unk_00); *param1 = 5; } diff --git a/src/overlay104/ov104_0222FBE4.c b/src/overlay104/ov104_0222FBE4.c index 0e3f8b9eae..3be665ec96 100644 --- a/src/overlay104/ov104_0222FBE4.c +++ b/src/overlay104/ov104_0222FBE4.c @@ -2017,7 +2017,7 @@ static BOOL ov104_02231068 (UnkStruct_ov104_0222E930 * param0) static BOOL ov104_02231078 (UnkStruct_ov104_0222E930 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } @@ -2033,7 +2033,7 @@ static BOOL ov104_02231090 (UnkStruct_ov104_0222E930 * param0) static BOOL ov104_022310B0 (UnkStruct_ov104_0222E930 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index bc33efac10..172994f552 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -416,7 +416,7 @@ static void ov104_022324C8 (SysTask * param0, void * param1) v0 = sub_02001BE0(v1->unk_B0); - if ((gCoreSys.unk_4C & PAD_KEY_UP) || (gCoreSys.unk_4C & PAD_KEY_DOWN) || (gCoreSys.unk_4C & PAD_KEY_LEFT) || (gCoreSys.unk_4C & PAD_KEY_RIGHT)) { + if ((gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT)) { ov104_022325D8(v1); } @@ -645,7 +645,7 @@ static void ov104_0223296C (SysTask * param0, void * param1) Sound_PlayEffect(1500); } - if ((gCoreSys.unk_4C & PAD_KEY_UP) || (gCoreSys.unk_4C & PAD_KEY_DOWN) || (gCoreSys.unk_4C & PAD_KEY_LEFT) || (gCoreSys.unk_4C & PAD_KEY_RIGHT)) { + if ((gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) || (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT)) { ov104_02232B2C(v2); } diff --git a/src/overlay104/ov104_022339B4.c b/src/overlay104/ov104_022339B4.c index a00c20349e..692598a31a 100644 --- a/src/overlay104/ov104_022339B4.c +++ b/src/overlay104/ov104_022339B4.c @@ -67,8 +67,8 @@ UnkStruct_ov104_0223ADA0 * ov104_022339B4 (SaveData * param0, u16 param1, u8 par v7->unk_4F4 = sub_0202FF58(param0); v7->unk_4F8 = param0; v7->unk_00 = 11; - v7->unk_4D4 = sub_02079FF4(11); - v7->unk_4D8 = sub_02079FF4(11); + v7->unk_4D4 = Party_New(11); + v7->unk_4D8 = Party_New(11); v0 = v7->unk_4F4; v1 = sub_020300F4(param0); diff --git a/src/overlay104/ov104_02234DB4.c b/src/overlay104/ov104_02234DB4.c index 5b8f5792cb..fe0c1dc96d 100644 --- a/src/overlay104/ov104_02234DB4.c +++ b/src/overlay104/ov104_02234DB4.c @@ -62,7 +62,7 @@ UnkStruct_ov104_0223B5C0 * ov104_02234DB4 (SaveData * param0, u16 param1, u8 par v10->unk_6F8 = sub_02030114(param0); v10->unk_6FC = param0; v10->unk_00 = 11; - v10->unk_264 = sub_02079FF4(11); + v10->unk_264 = Party_New(11); v10->unk_D8C = Pokemon_New(11); v0 = v10->unk_6F8; diff --git a/src/overlay104/ov104_022361B4.c b/src/overlay104/ov104_022361B4.c index 5c9e0cf041..848c72f718 100644 --- a/src/overlay104/ov104_022361B4.c +++ b/src/overlay104/ov104_022361B4.c @@ -83,8 +83,8 @@ UnkStruct_ov104_0223BA10 * ov104_022361B4 (SaveData * param0, u16 param1, u8 par v9->unk_08 = sub_020302DC(param0); v9->unk_04 = param0; v9->unk_00 = 11; - v9->unk_28 = sub_02079FF4(11); - v9->unk_2C = sub_02079FF4(11); + v9->unk_28 = Party_New(11); + v9->unk_2C = Party_New(11); v9->unk_A20 = param6; v4 = v9->unk_08; diff --git a/src/overlay104/ov104_02237DD8.c b/src/overlay104/ov104_02237DD8.c index 26b0d7596c..2b98a6f69b 100644 --- a/src/overlay104/ov104_02237DD8.c +++ b/src/overlay104/ov104_02237DD8.c @@ -157,8 +157,8 @@ UnkStruct_ov104_0223BFFC * ov104_02237DD8 (SaveData * param0, u16 param1, u8 par v9->unk_08 = sub_020304A0(param0); v9->unk_04 = param0; v9->unk_00 = 11; - v9->unk_70 = sub_02079FF4(11); - v9->unk_74 = sub_02079FF4(11); + v9->unk_70 = Party_New(11); + v9->unk_74 = Party_New(11); v9->unk_A80 = param6; v9->unk_13 = 32; diff --git a/src/overlay104/ov104_0223C2D4.c b/src/overlay104/ov104_0223C2D4.c index a1afb5d3a1..30b4e8fa83 100644 --- a/src/overlay104/ov104_0223C2D4.c +++ b/src/overlay104/ov104_0223C2D4.c @@ -167,7 +167,7 @@ UnkStruct_ov104_0223C4CC * ov104_0223C2D4 (UnkStruct_0209B75C * param0) v0->unk_00 = sub_02018340(94); sub_0201DBEC(64, 94); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov104_0223C948(v0->unk_00, v2); ov104_0223CB80(v0); diff --git a/src/overlay105/ov105_02241AE0.c b/src/overlay105/ov105_02241AE0.c index 90b145498c..478aa4513e 100644 --- a/src/overlay105/ov105_02241AE0.c +++ b/src/overlay105/ov105_02241AE0.c @@ -907,19 +907,19 @@ static BOOL ov105_022426E0 (UnkStruct_ov105_02241FF4 * param0) case 1: ov105_02246080(param0->unk_30C); - if (gCoreSys.padInput & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { Sound_PlayEffect(1500); ov105_022453F8(param0, param0->unk_11, ov105_022461A0(param0->unk_30C), 0, param0->unk_31C); } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); ov105_022461A4(param0->unk_30C, 1); ov105_02244DF0(param0); param0->unk_310 = ov105_02245FB8(¶m0->unk_144, (NELEMS(Unk_ov105_02246308)), (NELEMS(Unk_ov105_02246308)), 1, 0, Unk_ov105_02246308, NULL); param0->unk_08++; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_11 > 0) { Sound_PlayEffect(1500); ov105_0224296C(param0); @@ -1438,12 +1438,12 @@ static BOOL ov105_022434BC (UnkStruct_ov105_02241FF4 * param0) case 1: ov105_02246080(param0->unk_30C); - if (gCoreSys.padInput & (PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1500); ov105_022453F8(param0, param0->unk_11, ov105_022461A0(param0->unk_30C), 1, param0->unk_31C); } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (ov105_022461A0(param0->unk_30C) == (param0->unk_1A - 1)) { @@ -1456,7 +1456,7 @@ static BOOL ov105_022434BC (UnkStruct_ov105_02241FF4 * param0) param0->unk_310 = ov105_02245FB8(¶m0->unk_144, (NELEMS(Unk_ov105_02246308)), (NELEMS(Unk_ov105_02246308)), 1, 0, Unk_ov105_02246308, NULL); param0->unk_08++; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); ov105_02245528(param0, 1); return 1; @@ -1654,17 +1654,17 @@ static BOOL ov105_02243A3C (UnkStruct_ov105_02241FF4 * param0) case 1: ov105_02246080(param0->unk_30C); - if (gCoreSys.padInput & (PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1500); ov105_022453F8(param0, 0, ov105_022461A0(param0->unk_30C), 0, param0->unk_320); } - if (gCoreSys.padInput & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_KEY_LEFT | PAD_KEY_RIGHT)) { Sound_PlayEffect(1500); ov105_022453F8(param0, 0, ov105_022461A0(param0->unk_30C), 0, param0->unk_320); } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (ov105_022461A0(param0->unk_30C) == (param0->unk_1B - 1)) { @@ -1681,7 +1681,7 @@ static BOOL ov105_02243A3C (UnkStruct_ov105_02241FF4 * param0) param0->unk_10 = ov105_02244D14(param0, 14); param0->unk_08++; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); ov105_02245528(param0, 1); return 1; diff --git a/src/overlay105/ov105_02245FB8.c b/src/overlay105/ov105_02245FB8.c index 1846a10926..a5d4b18d02 100644 --- a/src/overlay105/ov105_02245FB8.c +++ b/src/overlay105/ov105_02245FB8.c @@ -88,24 +88,24 @@ void ov105_02246080 (UnkStruct_ov105_02246060 * param0) return; } - if (gCoreSys.padInput == 0) { + if (gCoreSys.pressedKeys == 0) { return; } if (param0->unk_01 == 2) { - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_02 == 0) { param0->unk_02 = (param0->unk_00 - 1); } else { param0->unk_02--; } - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_02 == (param0->unk_00 - 1)) { param0->unk_02 = 0; } else { param0->unk_02++; } - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_02 < (param0->unk_10)) { param0->unk_02 = param0->unk_10; } else if (param0->unk_02 == (param0->unk_00 - 1)) { @@ -113,7 +113,7 @@ void ov105_02246080 (UnkStruct_ov105_02246060 * param0) } else { param0->unk_02++; } - } else if (gCoreSys.padInput & PAD_KEY_UP) { + } else if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_02 < (param0->unk_10)) { param0->unk_02 = (param0->unk_00 - 1); } else { @@ -129,13 +129,13 @@ void ov105_02246080 (UnkStruct_ov105_02246060 * param0) v2 = PAD_KEY_UP; } - if (gCoreSys.padInput & v1) { + if (gCoreSys.pressedKeys & v1) { param0->unk_02++; if (param0->unk_02 >= param0->unk_00) { param0->unk_02 = 0; } - } else if (gCoreSys.padInput & v2) { + } else if (gCoreSys.pressedKeys & v2) { if (param0->unk_02 == 0) { param0->unk_02 = param0->unk_00; } diff --git a/src/overlay106/ov106_02241AE0.c b/src/overlay106/ov106_02241AE0.c index 80dccf806b..8996424a91 100644 --- a/src/overlay106/ov106_02241AE0.c +++ b/src/overlay106/ov106_02241AE0.c @@ -418,9 +418,9 @@ static BOOL ov106_02241E5C (UnkStruct_ov106_02243118 * param0) param0->unk_08 = 1; break; case 1: - ov106_02242D64(param0, gCoreSys.padInput); + ov106_02242D64(param0, gCoreSys.pressedKeys); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (ov104_0223B5A4(param0->unk_0D) == 0xfe) { Sound_PlayEffect(1501); sub_0200F174(0, 0, 0, 0x0, 6, 1, 98); @@ -1253,7 +1253,7 @@ static void ov106_02242D64 (UnkStruct_ov106_02243118 * param0, int param1) v0 = 0; - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (ov104_0223B5A4(param0->unk_0D) != 0xfe) { param0->unk_0C = param0->unk_0D; } else { @@ -1271,7 +1271,7 @@ static void ov106_02242D64 (UnkStruct_ov106_02243118 * param0, int param1) v0 = 1; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (ov104_0223B5A4(param0->unk_0D) != 0xfe) { param0->unk_0C = param0->unk_0D; } else { @@ -1289,7 +1289,7 @@ static void ov106_02242D64 (UnkStruct_ov106_02243118 * param0, int param1) v0 = 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (ov104_0223B5A4(param0->unk_0D) != 0xfe) { param0->unk_0C = param0->unk_0D; } else { @@ -1315,7 +1315,7 @@ static void ov106_02242D64 (UnkStruct_ov106_02243118 * param0, int param1) v0 = 1; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (ov104_0223B5A4(param0->unk_0D) != 0xfe) { param0->unk_0C = param0->unk_0D; } else { diff --git a/src/overlay107/ov107_02241AE0.c b/src/overlay107/ov107_02241AE0.c index fc36d57416..f3bae312f2 100644 --- a/src/overlay107/ov107_02241AE0.c +++ b/src/overlay107/ov107_02241AE0.c @@ -711,9 +711,9 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) return 0; } - ov107_02244BD8(param0, gCoreSys.padInput); + ov107_02244BD8(param0, gCoreSys.pressedKeys); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (param0->unk_0D >= param0->unk_15) { @@ -724,7 +724,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) param0->unk_08 = 1; break; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_0D != param0->unk_15) { Sound_PlayEffect(1500); param0->unk_0D = param0->unk_15; @@ -775,7 +775,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) case 2: sub_020014D0(param0->unk_198, ¶m0->unk_16); - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_16 == 0) { sub_02001408(param0->unk_198, (UnkStruct_ov84_02240FA8 *)¶m0->unk_1A0, 0, ((NELEMS(Unk_ov107_02249FF0)) - 1), 1, PAD_KEY_DOWN, NULL, NULL); sub_020013AC(param0->unk_198); @@ -783,7 +783,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) ov107_0224379C(param0, ¶m0->unk_50[6], 28, 1, 1, 0xff, 1, 2, 15, 1); return 0; } - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_16 == ((NELEMS(Unk_ov107_02249FF0)) - 1)) { sub_02001408(param0->unk_198, (UnkStruct_ov84_02240FA8 *)¶m0->unk_1A0, 0, 0, 1, PAD_KEY_UP, NULL, NULL); sub_020013AC(param0->unk_198); @@ -956,7 +956,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 6: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245618(param0); ov107_02244064(param0); @@ -965,7 +965,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 7: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245288(¶m0->unk_50[6]); ov107_02244064(param0); @@ -1151,7 +1151,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 13: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245618(param0); ov107_0224409C(param0); @@ -1160,7 +1160,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 14: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245288(¶m0->unk_50[6]); ov107_0224409C(param0); @@ -1168,14 +1168,14 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 15: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_022456E4(param0); param0->unk_08 = 9; } break; case 16: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); param0->unk_0A = ov107_02243918(param0, 61, 1); ov107_022441DC(param0); @@ -1222,7 +1222,7 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 19: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245288(¶m0->unk_50[6]); ov107_02243FA4(param0); @@ -1230,11 +1230,11 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 20: - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov107_02245140(param0, -1); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov107_02245140(param0, 1); - } else if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245BE0(param0); ov107_02244018(param0); @@ -1242,11 +1242,11 @@ static BOOL ov107_02241EC8 (UnkStruct_ov107_02241D6C * param0) } break; case 21: - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov107_0224518C(param0, -1); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov107_0224518C(param0, 1); - } else if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02245BE0(param0); ov107_02244018(param0); @@ -2946,7 +2946,7 @@ static void ov107_02244BD8 (UnkStruct_ov107_02241D6C * param0, int param1) v1 = 0; v0 = ov107_02249C98(param0->unk_14, param0->unk_0D); - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_0D == param0->unk_15) { return; } @@ -2960,7 +2960,7 @@ static void ov107_02244BD8 (UnkStruct_ov107_02241D6C * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_0D == param0->unk_15) { return; } @@ -2974,7 +2974,7 @@ static void ov107_02244BD8 (UnkStruct_ov107_02241D6C * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_0D < param0->unk_14) { return; } @@ -2983,7 +2983,7 @@ static void ov107_02244BD8 (UnkStruct_ov107_02241D6C * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_0D >= param0->unk_15) { return; } diff --git a/src/overlay107/ov107_02245EB0.c b/src/overlay107/ov107_02245EB0.c index 13dbe6bb85..625043938d 100644 --- a/src/overlay107/ov107_02245EB0.c +++ b/src/overlay107/ov107_02245EB0.c @@ -511,9 +511,9 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) param0->unk_0F_3 = 0; break; case 1: - ov107_02248358(param0, gCoreSys.padInput); + ov107_02248358(param0, gCoreSys.pressedKeys); - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (param0->unk_0D >= param0->unk_15) { @@ -524,7 +524,7 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) param0->unk_08 = 2; break; } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_0D != param0->unk_15) { Sound_PlayEffect(1500); param0->unk_0D = param0->unk_15; @@ -869,7 +869,7 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) } break; case 10: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { ov107_02248BB4(param0); ov107_022482FC(param0); ov107_02249C60(param0->unk_3C4, 211, 105); @@ -894,14 +894,14 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) } break; case 14: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_022482FC(param0); param0->unk_08 = 6; } break; case 15: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02248860(¶m0->unk_50[7]); ov107_02248240(param0); @@ -909,11 +909,11 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) } break; case 16: - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov107_0224877C(param0, -1); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov107_0224877C(param0, 1); - } else if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02249238(param0); ov107_022482B0(param0); @@ -921,11 +921,11 @@ static BOOL ov107_022462CC (UnkStruct_ov107_02246170 * param0) } break; case 17: - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { ov107_022487DC(param0, -1); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { ov107_022487DC(param0, 1); - } else if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + } else if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02249238(param0); ov107_022482B0(param0); @@ -2274,7 +2274,7 @@ static void ov107_02248358 (UnkStruct_ov107_02246170 * param0, int param1) v1 = 0; v0 = ov107_02249C98(param0->unk_14, param0->unk_0D); - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (param0->unk_0D == param0->unk_15) { return; } @@ -2288,7 +2288,7 @@ static void ov107_02248358 (UnkStruct_ov107_02246170 * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (param0->unk_0D == param0->unk_15) { return; } @@ -2302,7 +2302,7 @@ static void ov107_02248358 (UnkStruct_ov107_02246170 * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_0D < param0->unk_14) { return; } @@ -2311,7 +2311,7 @@ static void ov107_02248358 (UnkStruct_ov107_02246170 * param0, int param1) v1 = 1; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_0D >= param0->unk_15) { return; } @@ -2454,7 +2454,7 @@ static BOOL ov107_0224850C (UnkStruct_ov107_02246170 * param0, u8 param1, u8 par break; case 3: if (ov104_0223BA14(param0->unk_09) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02248A2C(param0, param1); param0->unk_0F_0 = 0; @@ -2467,7 +2467,7 @@ static BOOL ov107_0224850C (UnkStruct_ov107_02246170 * param0, u8 param1, u8 par break; case 4: if (ov104_0223BA14(param0->unk_09) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); ov107_02248AF0(param0, param1); param0->unk_0F_0 = 0; diff --git a/src/overlay108/ov108_02241AE0.c b/src/overlay108/ov108_02241AE0.c index ad25ce9cc6..a79c5a3f33 100644 --- a/src/overlay108/ov108_02241AE0.c +++ b/src/overlay108/ov108_02241AE0.c @@ -609,7 +609,7 @@ static BOOL ov108_02241F28 (UnkStruct_ov108_02241DB0 * param0) param0->unk_08 = 6; break; case 6: - ov108_02242964(param0, gCoreSys.padInput); + ov108_02242964(param0, gCoreSys.pressedKeys); if (sub_0203608C() == 0) { if (param0->unk_18 > 0) { diff --git a/src/overlay109/ov109_021D3D50.c b/src/overlay109/ov109_021D3D50.c index f412a6c0b8..f050ba55fc 100644 --- a/src/overlay109/ov109_021D3D50.c +++ b/src/overlay109/ov109_021D3D50.c @@ -202,7 +202,7 @@ int ov109_021D3D50 (UnkStruct_020067E8 * param0, int * param1) v0->unk_34 = sub_0200B358(95); v0->unk_38 = MessageLoader_Init(0, 26, 377, 95); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov109_021D40D0(); ov109_021D40F0(v0->unk_14); sub_0200F174(0, 17, 17, 0x0, 16, 1, 95); @@ -747,7 +747,7 @@ static int ov109_021D478C (UnkStruct_ov109_021D5140 * param0, int param1) static void ov109_021D47B8 (UnkStruct_ov109_021D5140 * param0) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (sub_0203608C() == 0) { if ((ov109_021D548C() == param0->unk_10->unk_2C) && (param0->unk_10->unk_30 == 0)) { u8 v0 = 1; @@ -760,7 +760,7 @@ static void ov109_021D47B8 (UnkStruct_ov109_021D5140 * param0) Sound_PlayEffect(1522); } } - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (sub_0203608C()) { if (param0->unk_10->unk_28 == 0) { ov109_021D55A8(param0, 4, 0); @@ -861,7 +861,7 @@ static int ov109_021D4980 (UnkStruct_ov109_021D5140 * param0, int param1) if (sub_0203608C()) { if (param0->unk_10->unk_28) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -870,7 +870,7 @@ static int ov109_021D4980 (UnkStruct_ov109_021D5140 * param0, int param1) } } else { if (param0->unk_10->unk_30 != 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -985,7 +985,7 @@ static int ov109_021D4B94 (UnkStruct_ov109_021D5140 * param0, int param1) u32 v1; if ((ov109_021D548C() != param0->unk_10->unk_2C) || (param0->unk_10->unk_30 != 0)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } @@ -1143,7 +1143,7 @@ static int ov109_021D4E28 (UnkStruct_ov109_021D5140 * param0, int param1) int v0; if ((param0->unk_10->unk_2C != ov109_021D548C()) || (param0->unk_10->unk_30 != 0)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_KEY_UP | PAD_KEY_DOWN)) { Sound_PlayEffect(1522); } diff --git a/src/overlay110/ov110_021D0D80.c b/src/overlay110/ov110_021D0D80.c index 114d193d19..b4789b2783 100644 --- a/src/overlay110/ov110_021D0D80.c +++ b/src/overlay110/ov110_021D0D80.c @@ -228,7 +228,7 @@ static BOOL ov110_021D0FD0 (UnkStruct_ov110_021D0F78 * param0) break; case 1: - if ((gCoreSys.unk_44 & PAD_BUTTON_A) || (gCoreSys.unk_44 & PAD_BUTTON_B)) { + if ((gCoreSys.heldKeys & PAD_BUTTON_A) || (gCoreSys.heldKeys & PAD_BUTTON_B)) { return 1; } break; diff --git a/src/overlay112/ov112_0225C700.c b/src/overlay112/ov112_0225C700.c index abba608b2f..2cd2f6b41f 100644 --- a/src/overlay112/ov112_0225C700.c +++ b/src/overlay112/ov112_0225C700.c @@ -393,7 +393,7 @@ int ov112_0225C7C4 (UnkStruct_020067E8 * param0, int * param1) } break; case 2: - if ((gCoreSys.padInput & PAD_BUTTON_B) || (ov66_0222E12C(v1->unk_08) == 1) || (ov66_02231760() == 1)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_B) || (ov66_0222E12C(v1->unk_08) == 1) || (ov66_02231760() == 1)) { if ((ov66_0222E12C(v1->unk_08) == 1)) { ov66_0222E2A4(v1->unk_08); } diff --git a/src/overlay113/ov113_0225C700.c b/src/overlay113/ov113_0225C700.c index a0810bb067..6df4af976e 100644 --- a/src/overlay113/ov113_0225C700.c +++ b/src/overlay113/ov113_0225C700.c @@ -393,7 +393,7 @@ int ov113_0225C700 (UnkStruct_020067E8 * param0, int * param1) v0->unk_08 = sub_02018340(118); sub_0201DBEC(64, 118); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov113_0225CF58(v0->unk_08); @@ -489,10 +489,10 @@ int ov113_0225CA04 (UnkStruct_020067E8 * param0, int * param1) } break; case 2: - if (gCoreSys.touchInput && (gCoreSys.unk_5E < 160)) { + if (gCoreSys.touchPressed && (gCoreSys.touchY < 160)) { if (ov113_0225E318(v0, ((32 << 8) / 6)) == 1) { - v0->unk_8D8[v0->unk_920].unk_09 = gCoreSys.unk_5C; - v0->unk_8D8[v0->unk_920].unk_0A = gCoreSys.unk_5E; + v0->unk_8D8[v0->unk_920].unk_09 = gCoreSys.touchX; + v0->unk_8D8[v0->unk_920].unk_0A = gCoreSys.touchY; ov113_0225DDC0(v0, &v0->unk_8D8[v0->unk_920], v0->unk_168.unk_04); ov113_02260818(&v0->unk_8D8[v0->unk_920]); diff --git a/src/overlay115/ov115_02260440.c b/src/overlay115/ov115_02260440.c index 5fb7cf2234..850956de1c 100644 --- a/src/overlay115/ov115_02260440.c +++ b/src/overlay115/ov115_02260440.c @@ -132,7 +132,7 @@ int ov115_0226048C (UnkStruct_020067E8 * param0, int * param1) } break; case 2: - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { break; } diff --git a/src/overlay115/ov115_02260CEC.c b/src/overlay115/ov115_02260CEC.c index e8c4fc4707..7fbafefc8c 100644 --- a/src/overlay115/ov115_02260CEC.c +++ b/src/overlay115/ov115_02260CEC.c @@ -2345,7 +2345,7 @@ static void ov115_0226294C (UnkStruct_ov115_022622F8 * param0, const VecFx32 * p static void ov115_02262974 (UnkStruct_ov115_02260D78 * param0) { - if (gCoreSys.unk_62 == 0) { + if (gCoreSys.touchHeld == 0) { ov115_02262990(param0); } else { ov115_02262B70(param0); @@ -2461,8 +2461,8 @@ static void ov115_02262B70 (UnkStruct_ov115_02260D78 * param0) v0.y = param0->unk_8690.unk_02[param0->unk_8690.unk_00 - 1].y; ov115_02262CBC(¶m0->unk_20, v0); } else { - v0.x = gCoreSys.unk_5C; - v0.y = gCoreSys.unk_5E; + v0.x = gCoreSys.touchX; + v0.y = gCoreSys.touchY; ov115_02262CBC(¶m0->unk_20, v0); } } @@ -2478,8 +2478,8 @@ static BOOL ov115_02262C60 (UnkStruct_ov115_02260D78 * param0) return 0; } - v0 = 128 - gCoreSys.unk_5C; - v1 = -96 - gCoreSys.unk_5E; + v0 = 128 - gCoreSys.touchX; + v1 = -96 - gCoreSys.touchY; v2 = FX_Sqrt(((v0 * v0) + (v1 * v1)) << FX32_SHIFT) >> FX32_SHIFT; if (v2 <= (190 - -96)) { @@ -3970,7 +3970,7 @@ static void ov115_02264BC0 (UnkStruct_ov115_02264BA0 * param0) return; } - ov115_02264BD8(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + ov115_02264BD8(param0, gCoreSys.touchX, gCoreSys.touchY); } static void ov115_02264BD8 (UnkStruct_ov115_02264BA0 * param0, s32 param1, s32 param2) diff --git a/src/overlay117/ov117_02260668.c b/src/overlay117/ov117_02260668.c index f88a8bab6e..0919d626aa 100644 --- a/src/overlay117/ov117_02260668.c +++ b/src/overlay117/ov117_02260668.c @@ -217,7 +217,7 @@ int ov117_02260668 (UnkStruct_020067E8 * param0, int * param1) v0->unk_2C = sub_02018340(110); sub_0201DBEC(64, 110); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov117_022610D8(v0->unk_2C); sub_0201E3D8(); sub_0201E450(4); diff --git a/src/overlay117/ov117_022626B0.c b/src/overlay117/ov117_022626B0.c index cee92cae61..8f4b9eae1d 100644 --- a/src/overlay117/ov117_022626B0.c +++ b/src/overlay117/ov117_022626B0.c @@ -225,10 +225,10 @@ void ov117_02262798 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_022626B0 param1->unk_214 = 0; param1->unk_218 = 0; } else { - param1->unk_20C = gCoreSys.unk_5C; - param1->unk_210 = gCoreSys.unk_5E; - param1->unk_214 = gCoreSys.unk_62; - param1->unk_218 = gCoreSys.touchInput; + param1->unk_20C = gCoreSys.touchX; + param1->unk_210 = gCoreSys.touchY; + param1->unk_214 = gCoreSys.touchHeld; + param1->unk_218 = gCoreSys.touchPressed; } ov117_02263270(param1); diff --git a/src/overlay120/ov120_021D0D80.c b/src/overlay120/ov120_021D0D80.c index a5d0b16e91..79cc0e95b0 100644 --- a/src/overlay120/ov120_021D0D80.c +++ b/src/overlay120/ov120_021D0D80.c @@ -78,7 +78,7 @@ int ov120_021D0DB0 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov120_021D0F24(v0); ov120_021D114C(v0); diff --git a/src/overlay121/ov121_021D0D80.c b/src/overlay121/ov121_021D0D80.c index 27a23b03eb..cb557d7f1a 100644 --- a/src/overlay121/ov121_021D0D80.c +++ b/src/overlay121/ov121_021D0D80.c @@ -84,7 +84,7 @@ int ov121_021D0D80 (UnkStruct_020067E8 * param0, int * param1) MI_CpuClear8(v0, sizeof(UnkStruct_ov121_021D0FF4)); v0->unk_00 = ov121_021D1270(30); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); ov121_021D0F94(); sub_0201E3D8(); sub_0201E450(4); diff --git a/src/party.c b/src/party.c index cad799abc6..a9ddce374f 100644 --- a/src/party.c +++ b/src/party.c @@ -22,7 +22,7 @@ int Party_SaveSize (void) return sizeof(Party); } -Party * sub_02079FF4 (u32 param0) +Party * Party_New (u32 param0) { Party * v0; diff --git a/src/unk_0200112C.c b/src/unk_0200112C.c index a1a96db26d..669777c83d 100644 --- a/src/unk_0200112C.c +++ b/src/unk_0200112C.c @@ -90,15 +90,15 @@ u32 sub_02001288 (UnkStruct_0200112C * param0) param0->unk_2F = 0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { return param0->unk_00.unk_00[param0->unk_28 + param0->unk_2A].unk_04; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { return 0xfffffffe; } - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { if (sub_02001A18(param0, 1, 1, 0) == 0) { param0->unk_2F = 1; } @@ -106,7 +106,7 @@ u32 sub_02001288 (UnkStruct_0200112C * param0) return 0xffffffff; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { if (sub_02001A18(param0, 1, 1, 1) == 0) { param0->unk_2F = 2; } @@ -121,12 +121,12 @@ u32 sub_02001288 (UnkStruct_0200112C * param0) v1 = 0; break; case 1: - v0 = (gCoreSys.unk_4C & PAD_KEY_LEFT); - v1 = (gCoreSys.unk_4C & PAD_KEY_RIGHT); + v0 = (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT); + v1 = (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT); break; case 2: - v0 = (gCoreSys.unk_4C & PAD_BUTTON_L); - v1 = (gCoreSys.unk_4C & PAD_BUTTON_R); + v0 = (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_L); + v1 = (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_R); break; } diff --git a/src/unk_02001AF4.c b/src/unk_02001AF4.c index 49c3e16be7..d0944b1efd 100644 --- a/src/unk_02001AF4.c +++ b/src/unk_02001AF4.c @@ -96,17 +96,17 @@ u32 sub_02001BE0 (UnkStruct_02001AF4 * param0) { param0->unk_1B = 0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); return param0->unk_00.unk_00[param0->unk_15].unk_04; } - if (gCoreSys.padInput & param0->unk_10) { + if (gCoreSys.pressedKeys & param0->unk_10) { Sound_PlayEffect(1500); return 0xfffffffe; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (sub_02001DCC(param0, 0, 1500) == 1) { param0->unk_1B = 1; } @@ -114,7 +114,7 @@ u32 sub_02001BE0 (UnkStruct_02001AF4 * param0) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (sub_02001DCC(param0, 1, 1500) == 1) { param0->unk_1B = 2; } @@ -122,7 +122,7 @@ u32 sub_02001BE0 (UnkStruct_02001AF4 * param0) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (sub_02001DCC(param0, 2, 1500) == 1) { param0->unk_1B = 3; } @@ -130,7 +130,7 @@ u32 sub_02001BE0 (UnkStruct_02001AF4 * param0) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (sub_02001DCC(param0, 3, 1500) == 1) { param0->unk_1B = 4; } @@ -145,17 +145,17 @@ u32 sub_02001C94 (UnkStruct_02001AF4 * param0, u16 param1) { param0->unk_1B = 0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); return param0->unk_00.unk_00[param0->unk_15].unk_04; } - if (gCoreSys.padInput & param0->unk_10) { + if (gCoreSys.pressedKeys & param0->unk_10) { Sound_PlayEffect(1500); return 0xfffffffe; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (sub_02001DCC(param0, 0, param1) == 1) { param0->unk_1B = 1; } @@ -163,7 +163,7 @@ u32 sub_02001C94 (UnkStruct_02001AF4 * param0, u16 param1) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (sub_02001DCC(param0, 1, param1) == 1) { param0->unk_1B = 2; } @@ -171,7 +171,7 @@ u32 sub_02001C94 (UnkStruct_02001AF4 * param0, u16 param1) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { if (sub_02001DCC(param0, 2, param1) == 1) { param0->unk_1B = 3; } @@ -179,7 +179,7 @@ u32 sub_02001C94 (UnkStruct_02001AF4 * param0, u16 param1) return 0xffffffff; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { if (sub_02001DCC(param0, 3, param1) == 1) { param0->unk_1B = 4; } diff --git a/src/unk_02002328.c b/src/unk_02002328.c index ce2ef69a4b..7322492a8b 100644 --- a/src/unk_02002328.c +++ b/src/unk_02002328.c @@ -29,7 +29,7 @@ int sub_02002328 (UnkStruct_0201D834 * param0) switch (param0->unk_28) { case 0: - if (((gCoreSys.unk_44 & (PAD_BUTTON_A | PAD_BUTTON_B)) && (v1->unk_00_4)) || ((gCoreSys.unk_62) && (Unk_02101D44.unk_00_4))) { + if (((gCoreSys.heldKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) && (v1->unk_00_4)) || ((gCoreSys.touchHeld) && (Unk_02101D44.unk_00_4))) { param0->unk_2A = 0; if (param0->unk_29_0 != 0) { @@ -41,7 +41,7 @@ int sub_02002328 (UnkStruct_0201D834 * param0) (param0->unk_2A)--; if (Unk_02101D44.unk_00_0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || ((gCoreSys.touchInput) && (Unk_02101D44.unk_00_4))) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || ((gCoreSys.touchPressed) && (Unk_02101D44.unk_00_4))) { v1->unk_00_4 = 1; param0->unk_2A = 0; } @@ -323,7 +323,7 @@ void sub_02002968 (UnkStruct_0201D834 * param0) static BOOL sub_020029FC (UnkStruct_0201D834 * param0) { - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) || ((gCoreSys.touchInput) && (Unk_02101D44.unk_00_4))) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) || ((gCoreSys.touchPressed) && (Unk_02101D44.unk_00_4))) { Sound_PlayEffect(1500); Unk_02101D44.unk_00_7 = 1; return 1; diff --git a/src/unk_0200C6E4.c b/src/unk_0200C6E4.c index 2933beff92..4497d669b9 100644 --- a/src/unk_0200C6E4.c +++ b/src/unk_0200C6E4.c @@ -259,7 +259,7 @@ BOOL sub_0200C8F0 (UnkStruct_0200C6E4 * param0, UnkStruct_0200C704 * param1, con for (v0 = 0; v0 < v1; v0++) { v3 = sub_02009F38(param1->unk_08, v0); - v4 = sub_02017A40(param0->unk_00, param2->val1[v0]); + v4 = ReadFileToHeap(param0->unk_00, param2->val1[v0]); sub_02009F40(v4, v3, param0->unk_00); Heap_FreeToHeap(v4); @@ -283,7 +283,7 @@ BOOL sub_0200C8F0 (UnkStruct_0200C6E4 * param0, UnkStruct_0200C704 * param1, con sub_0200A368(param1->unk_24[0]); sub_0200A60C(param1->unk_24[1]); - v4 = sub_02017A40(param0->unk_00, param2->val2.unk_18); + v4 = ReadFileToHeap(param0->unk_00, param2->val2.unk_18); param1->unk_04 = sub_02009508(v4, param0->unk_00, param1->unk_0C[0], param1->unk_0C[1], param1->unk_0C[2], param1->unk_0C[3], param1->unk_0C[4], param1->unk_0C[5]); Heap_FreeToHeap(v4); diff --git a/src/unk_02017728.c b/src/unk_02017728.c index cd68189d8a..90c194df29 100644 --- a/src/unk_02017728.c +++ b/src/unk_02017728.c @@ -19,7 +19,7 @@ typedef struct { static void sub_02017808(BOOL param0); void sub_0201777C(void); -static void sub_02017CA0(void); +static void ApplyButtonModeToInput(void); CoreSys gCoreSys; @@ -202,55 +202,49 @@ void sub_020179E4 (void) MI_CpuClearFast((void *)HW_DB_PLTT, HW_DB_PLTT_SIZE); } -void * sub_02017A40 (int param0, const char * param1) +void * ReadFileToHeap (int heapID, const char * filename) { - FSFile v0; - void * v1; + FSFile file; + void * buf; - FS_InitFile(&v0); + FS_InitFile(&file); - if (FS_OpenFile(&v0, param1)) { - u32 v2 = FS_GetLength(&v0); + if (FS_OpenFile(&file, filename)) { + u32 length = FS_GetLength(&file); - v1 = Heap_AllocFromHeap(param0, v2); + buf = Heap_AllocFromHeap(heapID, length); - if (v1 == NULL) { - (void)0; - } else { - if (FS_ReadFile(&v0, v1, v2) != v2) { - Heap_FreeToHeapExplicit(param0, v1); - v1 = NULL; + if (buf != NULL) { + if (FS_ReadFile(&file, buf, length) != length) { + Heap_FreeToHeapExplicit(heapID, buf); + buf = NULL; } } - (void)FS_CloseFile(&v0); + FS_CloseFile(&file); } else { - v1 = NULL; + buf = NULL; } - return v1; + return buf; } -void sub_02017A94 (const char * param0, void ** param1) +void ReadFileToBuffer (const char * filename, void ** buf) { - FSFile v0; + FSFile file; - FS_InitFile(&v0); + FS_InitFile(&file); - if (FS_OpenFile(&v0, param0)) { - u32 v1 = FS_GetLength(&v0); + if (FS_OpenFile(&file, filename)) { + u32 length = FS_GetLength(&file); - if (*param1 == NULL) { - (void)0; - } else { - if (FS_ReadFile(&v0, *param1, v1) != v1) { - (void)0; + if (*buf != NULL) { + if (FS_ReadFile(&file, *buf, length) != length) { + /* error not handled */ } } - (void)FS_CloseFile(&v0); - } else { - (void)0; + FS_CloseFile(&file); } } @@ -270,24 +264,24 @@ void sub_02017ACC (void) } } -void sub_02017AF4 (void) +void InitKeypadAndTouchpad (void) { TPCalibrateParam v0; - gCoreSys.unk_34 = 0; - gCoreSys.unk_38 = 0; - gCoreSys.unk_3C = 0; - gCoreSys.unk_40 = 0; - gCoreSys.unk_44 = 0; - gCoreSys.padInput = 0; - gCoreSys.unk_4C = 0; - gCoreSys.unk_50 = 0; - gCoreSys.unk_54 = 4; - gCoreSys.unk_58 = 8; - gCoreSys.unk_5C = 0; - gCoreSys.unk_5E = 0; - gCoreSys.touchInput = 0; - gCoreSys.unk_62 = 0; + gCoreSys.buttonMode = 0; + gCoreSys.heldKeysRaw = 0; + gCoreSys.pressedKeysRaw = 0; + gCoreSys.pressedKeysRepeatableRaw = 0; + gCoreSys.heldKeys = 0; + gCoreSys.pressedKeys = 0; + gCoreSys.pressedKeysRepeatable = 0; + gCoreSys.autorepeatTimer = 0; + gCoreSys.autorepeatRate = 4; + gCoreSys.autorepeatDelay = 8; + gCoreSys.touchX = 0; + gCoreSys.touchY = 0; + gCoreSys.touchPressed = 0; + gCoreSys.touchHeld = 0; gCoreSys.unk_64 = 0; TP_Init(); @@ -319,63 +313,63 @@ void sub_02017B8C (u8 param0) gCoreSys.unk_67 &= ~(param0); } -void sub_02017B9C (void) +void ReadKeypadAndTouchpad (void) { - TPData v0; - TPData v1; - int v2; + TPData tpRaw; + TPData tp; + u32 padRead; if (PAD_DetectFold()) { - gCoreSys.padInput = 0; - gCoreSys.unk_44 = 0; - gCoreSys.unk_4C = 0; - gCoreSys.touchInput = 0; - gCoreSys.unk_62 = 0; + // Can't press any buttons while the lid is closed. + gCoreSys.pressedKeys = 0; + gCoreSys.heldKeys = 0; + gCoreSys.pressedKeysRepeatable = 0; + gCoreSys.touchPressed = 0; + gCoreSys.touchHeld = 0; return; } - v2 = PAD_Read(); + padRead = PAD_Read(); - gCoreSys.unk_3C = v2 & (v2 ^ gCoreSys.unk_38); - gCoreSys.unk_40 = v2 & (v2 ^ gCoreSys.unk_38); + gCoreSys.pressedKeysRaw = padRead & (padRead ^ gCoreSys.heldKeysRaw); + gCoreSys.pressedKeysRepeatableRaw = gCoreSys.pressedKeysRaw; - if ((v2 != 0) && (gCoreSys.unk_38 == v2)) { - if (--gCoreSys.unk_50 == 0) { - gCoreSys.unk_40 = v2; - gCoreSys.unk_50 = gCoreSys.unk_54; + if ((padRead != 0) && (gCoreSys.heldKeysRaw == padRead)) { + if (--gCoreSys.autorepeatTimer == 0) { + gCoreSys.pressedKeysRepeatableRaw = padRead; + gCoreSys.autorepeatTimer = gCoreSys.autorepeatRate; } } else { - gCoreSys.unk_50 = gCoreSys.unk_58; + gCoreSys.autorepeatTimer = gCoreSys.autorepeatDelay; } - gCoreSys.unk_38 = v2; - gCoreSys.padInput = gCoreSys.unk_3C; - gCoreSys.unk_44 = gCoreSys.unk_38; - gCoreSys.unk_4C = gCoreSys.unk_40; + gCoreSys.heldKeysRaw = padRead; + + gCoreSys.pressedKeys = gCoreSys.pressedKeysRaw; + gCoreSys.heldKeys = gCoreSys.heldKeysRaw; + gCoreSys.pressedKeysRepeatable = gCoreSys.pressedKeysRepeatableRaw; - sub_02017CA0(); + ApplyButtonModeToInput(); if (gCoreSys.unk_64 == 0) { - while (TP_RequestRawSampling(&v0) != 0) { - (void)0; - } + while (TP_RequestRawSampling(&tpRaw) != 0); } else { - TP_GetLatestRawPointInAuto(&v0); + TP_GetLatestRawPointInAuto(&tpRaw); } - TP_GetCalibratedPoint(&v1, &v0); + TP_GetCalibratedPoint(&tp, &tpRaw); - if (v1.validity == TP_VALIDITY_VALID) { - gCoreSys.unk_5C = v1.x; - gCoreSys.unk_5E = v1.y; + if (tp.validity == TP_VALIDITY_VALID) { + gCoreSys.touchX = tp.x; + gCoreSys.touchY = tp.y; } else { - if (gCoreSys.unk_62) { - switch (v1.validity) { + if (gCoreSys.touchHeld) { + switch (tp.validity) { case TP_VALIDITY_INVALID_X: - gCoreSys.unk_5E = v1.y; + gCoreSys.touchY = tp.y; break; case TP_VALIDITY_INVALID_Y: - gCoreSys.unk_5C = v1.x; + gCoreSys.touchX = tp.x; break; case TP_VALIDITY_INVALID_XY: break; @@ -383,98 +377,101 @@ void sub_02017B9C (void) break; } } else { - v1.touch = 0; + tp.touch = 0; } } - gCoreSys.touchInput = (u16)(v1.touch & (v1.touch ^ gCoreSys.unk_62)); - gCoreSys.unk_62 = v1.touch; + gCoreSys.touchPressed = (u16)(tp.touch & (tp.touch ^ gCoreSys.touchHeld)); + gCoreSys.touchHeld = tp.touch; } -static void sub_02017CA0 (void) +static void ApplyButtonModeToInput (void) { - switch (gCoreSys.unk_34) { + switch (gCoreSys.buttonMode) { default: - case 0: + case BUTTON_MODE_NORMAL: break; - case 1: - if (gCoreSys.padInput & 0x8) { - gCoreSys.padInput |= 0x400; + case BUTTON_MODE_START_IS_X: + if (gCoreSys.pressedKeys & PAD_BUTTON_START) { + gCoreSys.pressedKeys |= PAD_BUTTON_X; } - if (gCoreSys.unk_44 & 0x8) { - gCoreSys.unk_44 |= 0x400; + if (gCoreSys.heldKeys & PAD_BUTTON_START) { + gCoreSys.heldKeys |= PAD_BUTTON_X; } - if (gCoreSys.unk_4C & 0x8) { - gCoreSys.unk_4C |= 0x400; + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_START) { + gCoreSys.pressedKeysRepeatable |= PAD_BUTTON_X; } break; - case 2: - { - int v0 = 0; + case BUTTON_MODE_SWAP_XY: + { + u32 tmp = 0; - if (gCoreSys.padInput & 0x400) { - v0 |= 0x800; - } + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { + tmp |= PAD_BUTTON_Y; + } - if (gCoreSys.padInput & 0x800) { - v0 |= 0x400; - } + if (gCoreSys.pressedKeys & PAD_BUTTON_Y) { + tmp |= PAD_BUTTON_X; + } - gCoreSys.padInput &= ((0x400 | 0x800) ^ 0xffff); gCoreSys.padInput |= v0; - } + gCoreSys.pressedKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xffff); + gCoreSys.pressedKeys |= tmp; + } { - int v0 = 0; + u32 tmp = 0; - if (gCoreSys.unk_44 & 0x400) { - v0 |= 0x800; + if (gCoreSys.heldKeys & PAD_BUTTON_X) { + tmp |= PAD_BUTTON_Y; } - if (gCoreSys.unk_44 & 0x800) { - v0 |= 0x400; + if (gCoreSys.heldKeys & PAD_BUTTON_Y) { + tmp |= PAD_BUTTON_X; } - gCoreSys.unk_44 &= ((0x400 | 0x800) ^ 0xffff); gCoreSys.unk_44 |= v0; + gCoreSys.heldKeys &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xffff); + gCoreSys.heldKeys |= tmp; } { - int v0 = 0; + u32 tmp = 0; - if (gCoreSys.unk_4C & 0x400) { - v0 |= 0x800; + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_X) { + tmp |= PAD_BUTTON_Y; } - if (gCoreSys.unk_4C & 0x800) { - v0 |= 0x400; + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_Y) { + tmp |= PAD_BUTTON_X; } - gCoreSys.unk_4C &= ((0x400 | 0x800) ^ 0xffff); gCoreSys.unk_4C |= v0; + gCoreSys.pressedKeysRepeatable &= ((PAD_BUTTON_X | PAD_BUTTON_Y) ^ 0xffff); + gCoreSys.pressedKeysRepeatable |= tmp; } break; - case 3: - if (gCoreSys.padInput & 0x200) { - gCoreSys.padInput |= 0x1; + case BUTTON_MODE_L_IS_A: + if (gCoreSys.pressedKeys & PAD_BUTTON_L) { + gCoreSys.pressedKeys |= PAD_BUTTON_A; } - if (gCoreSys.unk_44 & 0x200) { - gCoreSys.unk_44 |= 0x1; + if (gCoreSys.heldKeys & PAD_BUTTON_L) { + gCoreSys.heldKeys |= PAD_BUTTON_A; } - if (gCoreSys.unk_4C & 0x200) { - gCoreSys.unk_4C |= 0x1; + if (gCoreSys.pressedKeysRepeatable & PAD_BUTTON_L) { + gCoreSys.pressedKeysRepeatable |= PAD_BUTTON_A; } - gCoreSys.padInput &= ((0x200 | 0x100) ^ 0xffff); - gCoreSys.unk_44 &= ((0x200 | 0x100) ^ 0xffff); - gCoreSys.unk_4C &= ((0x200 | 0x100) ^ 0xffff); + gCoreSys.pressedKeys &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xffff); + gCoreSys.heldKeys &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xffff); + gCoreSys.pressedKeysRepeatable &= ((PAD_BUTTON_L | PAD_BUTTON_R) ^ 0xffff); break; } } -void sub_02017DD4 (int param0, int param1) +void SetAutorepeat (int rate, int delay) { - gCoreSys.unk_54 = param0; - gCoreSys.unk_58 = param1; + gCoreSys.autorepeatRate = rate; + gCoreSys.autorepeatDelay = delay; } void sub_02017DE0 (u8 param0) diff --git a/src/unk_0201C970.c b/src/unk_0201C970.c index 3dea6ce752..b49b77f634 100644 --- a/src/unk_0201C970.c +++ b/src/unk_0201C970.c @@ -17,7 +17,7 @@ void sub_0201C970 (const u8 param0, const char * param1, NNSG3dResMdl ** param2, NNSG3dResTex * v0 = NULL; BOOL v1; - *param3 = sub_02017A40(param0, param1); + *param3 = ReadFileToHeap(param0, param1); NNS_G3D_NULL_ASSERT(*param3); v0 = NNS_G3dGetTex(*param3); diff --git a/src/unk_020218BC.c b/src/unk_020218BC.c index 47fd17ec52..9384e9d2e8 100644 --- a/src/unk_020218BC.c +++ b/src/unk_020218BC.c @@ -123,7 +123,7 @@ UnkStruct_020218BC * sub_020218BC (const UnkStruct_020095C4 * param0) v0->unk_10.unk_FC = &v0->unk_10; v0->unk_10.unk_100 = &v0->unk_10; v0->unk_110 = param0->unk_04; - v0->unk_114 = sub_02017A40(param0->unk_08, "data/clact_default.NANR"); + v0->unk_114 = ReadFileToHeap(param0->unk_08, "data/clact_default.NANR"); NNS_G2dGetUnpackedAnimBank(v0->unk_114, &v0->unk_118); v0->unk_11C = 1; diff --git a/src/unk_02022594.c b/src/unk_02022594.c index 112085652f..07bbaaecfc 100644 --- a/src/unk_02022594.c +++ b/src/unk_02022594.c @@ -47,8 +47,8 @@ static BOOL sub_0202260C (const UnkUnion_020225E0 * param0, u32 param1, u32 para int sub_02022644 (const UnkUnion_02022594 * param0) { - if (gCoreSys.unk_62) { - return sub_02022594(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + if (gCoreSys.touchHeld) { + return sub_02022594(param0, gCoreSys.touchX, gCoreSys.touchY); } return 0xffffffff; @@ -56,8 +56,8 @@ int sub_02022644 (const UnkUnion_02022594 * param0) int sub_02022664 (const UnkUnion_02022594 * param0) { - if (gCoreSys.touchInput) { - return sub_02022594(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + if (gCoreSys.touchPressed) { + return sub_02022594(param0, gCoreSys.touchX, gCoreSys.touchY); } return 0xffffffff; @@ -65,16 +65,16 @@ int sub_02022664 (const UnkUnion_02022594 * param0) int sub_02022684 (const UnkUnion_020225E0 * param0) { - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { int v0; for (v0 = 0; param0[v0].val2.unk_00 != 0xff; v0++) { if (param0[v0].val2.unk_00 == 0xfe) { - if (sub_020225E0(¶m0[v0], gCoreSys.unk_5C, gCoreSys.unk_5E)) { + if (sub_020225E0(¶m0[v0], gCoreSys.touchX, gCoreSys.touchY)) { return v0; } } else { - if (sub_0202260C(¶m0[v0], gCoreSys.unk_5C, gCoreSys.unk_5E)) { + if (sub_0202260C(¶m0[v0], gCoreSys.touchX, gCoreSys.touchY)) { return v0; } } @@ -86,16 +86,16 @@ int sub_02022684 (const UnkUnion_020225E0 * param0) int sub_020226DC (const UnkUnion_020225E0 * param0) { - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { int v0; for (v0 = 0; param0[v0].val2.unk_00 != 0xff; v0++) { if (param0[v0].val2.unk_00 == 0xfe) { - if (sub_020225E0(¶m0[v0], gCoreSys.unk_5C, gCoreSys.unk_5E)) { + if (sub_020225E0(¶m0[v0], gCoreSys.touchX, gCoreSys.touchY)) { return v0; } } else { - if (sub_0202260C(¶m0[v0], gCoreSys.unk_5C, gCoreSys.unk_5E)) { + if (sub_0202260C(¶m0[v0], gCoreSys.touchX, gCoreSys.touchY)) { return v0; } } @@ -107,11 +107,11 @@ int sub_020226DC (const UnkUnion_020225E0 * param0) BOOL sub_02022734 (const UnkUnion_020225E0 * param0) { - if (gCoreSys.unk_62) { + if (gCoreSys.touchHeld) { if (param0->val2.unk_00 == 0xfe) { - return sub_020225E0(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + return sub_020225E0(param0, gCoreSys.touchX, gCoreSys.touchY); } else { - return sub_0202260C(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + return sub_0202260C(param0, gCoreSys.touchX, gCoreSys.touchY); } } @@ -120,11 +120,11 @@ BOOL sub_02022734 (const UnkUnion_020225E0 * param0) BOOL sub_02022760 (const UnkUnion_020225E0 * param0) { - if (gCoreSys.touchInput) { + if (gCoreSys.touchPressed) { if (param0->val2.unk_00 == 0xfe) { - return sub_020225E0(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + return sub_020225E0(param0, gCoreSys.touchX, gCoreSys.touchY); } else { - return sub_0202260C(param0, gCoreSys.unk_5C, gCoreSys.unk_5E); + return sub_0202260C(param0, gCoreSys.touchX, gCoreSys.touchY); } } @@ -133,19 +133,19 @@ BOOL sub_02022760 (const UnkUnion_020225E0 * param0) BOOL sub_0202278C (void) { - return gCoreSys.unk_62; + return gCoreSys.touchHeld; } BOOL TouchScreen_Tapped(void) { - return gCoreSys.touchInput; + return gCoreSys.touchPressed; } BOOL sub_020227A4 (u32 * param0, u32 * param1) { - if (gCoreSys.unk_62) { - *param0 = gCoreSys.unk_5C; - *param1 = gCoreSys.unk_5E; + if (gCoreSys.touchHeld) { + *param0 = gCoreSys.touchX; + *param1 = gCoreSys.touchY; return 1; } @@ -154,9 +154,9 @@ BOOL sub_020227A4 (u32 * param0, u32 * param1) BOOL sub_020227C0 (u32 * param0, u32 * param1) { - if (gCoreSys.touchInput) { - *param0 = gCoreSys.unk_5C; - *param1 = gCoreSys.unk_5E; + if (gCoreSys.touchPressed) { + *param0 = gCoreSys.touchX; + *param1 = gCoreSys.touchY; return 1; } diff --git a/src/unk_0202298C.c b/src/unk_0202298C.c index a224974dfe..53418bea2d 100644 --- a/src/unk_0202298C.c +++ b/src/unk_0202298C.c @@ -119,7 +119,7 @@ UnkStruct_02022BC0 * sub_02022A58 (UnkStruct_0202298C * param0, const char * par GF_ASSERT(v0); GF_ASSERT((sub_020229F8(param0, param2) == 1)); - v0->unk_04 = sub_02017A40(param3, param1); + v0->unk_04 = ReadFileToHeap(param3, param1); GF_ASSERT(v0->unk_04); v0->unk_00 = param2; diff --git a/src/unk_020279FC.c b/src/unk_020279FC.c index 63e487cb24..8449ac65f6 100644 --- a/src/unk_020279FC.c +++ b/src/unk_020279FC.c @@ -48,14 +48,14 @@ void sub_02027A68 (SaveData * param0, int param1) switch (param1) { case 1: - gCoreSys.unk_34 = 1; + gCoreSys.buttonMode = 1; break; case 2: - gCoreSys.unk_34 = 3; + gCoreSys.buttonMode = 3; break; case 0: default: - gCoreSys.unk_34 = 0; + gCoreSys.buttonMode = 0; break; } } diff --git a/src/unk_02034198.c b/src/unk_02034198.c index f14c114596..b38c38a95b 100644 --- a/src/unk_02034198.c +++ b/src/unk_02034198.c @@ -513,7 +513,7 @@ BOOL sub_020349EC (void) Unk_021C07CC->unk_6B5++; Unk_021C07C5 = 0; sub_020347EC(); - Unk_021C07CC->unk_654 |= (gCoreSys.unk_44 & 0x7fff); + Unk_021C07CC->unk_654 |= (gCoreSys.heldKeys & 0x7fff); sub_02035534(); sub_02034B50(); Unk_021C07CC->unk_654 &= 0x8000; diff --git a/src/unk_020393C8.c b/src/unk_020393C8.c index fa429aeb39..2b6ccbaf88 100644 --- a/src/unk_020393C8.c +++ b/src/unk_020393C8.c @@ -148,7 +148,7 @@ void * sub_020394A8 (u32 param0) { void * v0 = Heap_AllocFromHeapAtEnd(param0, 600); - sub_02017A94("data/pl_wm.NCLR", &v0); + ReadFileToBuffer("data/pl_wm.NCLR", &v0); DC_FlushRange(v0, 600); return v0; @@ -161,7 +161,7 @@ static void sub_020394D0 (int param0, BOOL param1, u32 param2, u32 param3) if (v0) { NNSG2dPaletteData * v1; - sub_02017A94("data/pl_wm.NCLR", &v0); + ReadFileToBuffer("data/pl_wm.NCLR", &v0); DC_FlushRange(v0, 600); NNS_G2dGetUnpackedPaletteData(v0, &v1); @@ -184,9 +184,9 @@ static void sub_02039530 (int param0, BOOL param1, u32 param2) int v2, v3, v4; if (param1) { - sub_02017A94("data/pl_wifi.NCGR", &v0); + ReadFileToBuffer("data/pl_wifi.NCGR", &v0); } else { - sub_02017A94("data/pl_wm.NCGR", &v0); + ReadFileToBuffer("data/pl_wm.NCGR", &v0); } DC_FlushRange(v0, 600); diff --git a/src/unk_02039814.c b/src/unk_02039814.c index b5eb098414..ac56e2cf0d 100644 --- a/src/unk_02039814.c +++ b/src/unk_02039814.c @@ -132,7 +132,7 @@ void sub_02039834 (int param0, int param1, int param2) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); diff --git a/src/unk_02039A64.c b/src/unk_02039A64.c index ca61830927..7b3b6fd135 100644 --- a/src/unk_02039A64.c +++ b/src/unk_02039A64.c @@ -95,7 +95,7 @@ void sub_02039A64 (int param0, int param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); diff --git a/src/unk_0203CC84.c b/src/unk_0203CC84.c index 267bab0e17..eda0ab8770 100644 --- a/src/unk_0203CC84.c +++ b/src/unk_0203CC84.c @@ -262,7 +262,7 @@ void sub_0203CF5C (UnkStruct_0203CDB0 * param0) if (v2) { sub_0205F490(param0->unk_3C); - ov5_021D1CAC(&v1, param0, gCoreSys.padInput, gCoreSys.unk_44); + ov5_021D1CAC(&v1, param0, gCoreSys.pressedKeys, gCoreSys.heldKeys); } v0 = param0->unk_70; @@ -313,7 +313,7 @@ void sub_0203CF5C (UnkStruct_0203CDB0 * param0) ov5_021E0EEC(param0->unk_3C); ov5_021EA714(param0, 0, 1); } else { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov5_021DDA78(param0->unk_04->unk_08); } @@ -339,7 +339,7 @@ void sub_0203CF5C (UnkStruct_0203CDB0 * param0) ov5_021E0EEC(param0->unk_3C); ov5_021EA714(param0, 0, 1); } else { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { ov5_021DDA78(param0->unk_04->unk_08); } diff --git a/src/unk_0203F6C4.c b/src/unk_0203F6C4.c index 04219ef90d..e963bd8616 100644 --- a/src/unk_0203F6C4.c +++ b/src/unk_0203F6C4.c @@ -2351,7 +2351,7 @@ static BOOL sub_02040180 (UnkStruct_0203E724 * param0) static BOOL sub_02040190 (UnkStruct_0203E724 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } @@ -2367,7 +2367,7 @@ static BOOL sub_020401A8 (UnkStruct_0203E724 * param0) static BOOL sub_020401D0 (UnkStruct_0203E724 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } @@ -2388,19 +2388,19 @@ static BOOL sub_020401F4 (UnkStruct_0203E724 * param0) static BOOL sub_02040204 (UnkStruct_0203E724 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { sub_0205EA84(param0->unk_34->unk_3C, 0); - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { sub_0205EA84(param0->unk_34->unk_3C, 1); - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { sub_0205EA84(param0->unk_34->unk_3C, 2); - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { sub_0205EA84(param0->unk_34->unk_3C, 3); - } else if (gCoreSys.padInput & PAD_BUTTON_X) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_X) { sub_0203F0C0(param0->unk_34); } else { return 0; @@ -2417,11 +2417,11 @@ static BOOL sub_02040284 (UnkStruct_0203E724 * param0) static BOOL sub_02040294 (UnkStruct_0203E724 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 1; } - if (gCoreSys.padInput & (PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT)) { + if (gCoreSys.pressedKeys & (PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT)) { return 1; } @@ -2651,13 +2651,13 @@ static BOOL sub_02040670 (UnkStruct_0203E724 * param0) return 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v4 = 0; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v4 = 1; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v4 = 2; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v4 = 3; } @@ -2668,7 +2668,7 @@ static BOOL sub_02040670 (UnkStruct_0203E724 * param0) return 1; } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { sub_0201D730(*v1); *v2 = 1; return 1; @@ -2693,18 +2693,18 @@ static BOOL sub_02040730 (UnkStruct_0203E724 * param0) u16 * v1 = sub_0203F118(v0, param0->unk_18[0]); int v2 = 0xffff; - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { *v1 = 0; return 1; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { v2 = 0; - } else if (gCoreSys.padInput & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { v2 = 1; - } else if (gCoreSys.padInput & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { v2 = 2; - } else if (gCoreSys.padInput & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { v2 = 3; } @@ -2714,7 +2714,7 @@ static BOOL sub_02040730 (UnkStruct_0203E724 * param0) return 1; } - if (gCoreSys.padInput & PAD_BUTTON_X) { + if (gCoreSys.pressedKeys & PAD_BUTTON_X) { *v1 = 1; return 1; } @@ -5588,7 +5588,7 @@ static BOOL sub_02043A4C (UnkStruct_0203E724 * param0) u16 * v0 = sub_0203F118(param0->unk_34, param0->unk_18[0]); u32 v1 = sub_0205B91C(param0->unk_34->unk_7C); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v1 = sub_0205B9EC(param0->unk_34->unk_7C, 8); if (v1) { @@ -8225,11 +8225,11 @@ static BOOL sub_0204666C (UnkStruct_0203E724 * param0) *v0 = 0; - if (gCoreSys.unk_44 & PAD_BUTTON_A) { + if (gCoreSys.heldKeys & PAD_BUTTON_A) { *v0 = 1; } - if (gCoreSys.unk_44 & PAD_BUTTON_B) { + if (gCoreSys.heldKeys & PAD_BUTTON_B) { *v0 = 1; } diff --git a/src/unk_020482D4.c b/src/unk_020482D4.c index 55894354a9..31ea8d7d8f 100644 --- a/src/unk_020482D4.c +++ b/src/unk_020482D4.c @@ -274,7 +274,7 @@ BOOL sub_0204858C (UnkStruct_0203E724 * param0) BOOL sub_020485C0 (UnkStruct_0203E724 * param0) { - if (gCoreSys.unk_44 & PAD_KEY_UP) { + if (gCoreSys.heldKeys & PAD_KEY_UP) { sub_02004550(22, 1218, 1); } else { sub_02004550(22, 1218, 1); diff --git a/src/unk_02050568.c b/src/unk_02050568.c index 695530eec9..3cf59e0a36 100644 --- a/src/unk_02050568.c +++ b/src/unk_02050568.c @@ -89,7 +89,7 @@ static BOOL sub_020505A0 (UnkStruct_020508D4 * param0) v1->unk_08++; break; case 5: - if ((gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if ((gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { v1->unk_08++; } break; diff --git a/src/unk_02051D8C.c b/src/unk_02051D8C.c index 779c46bb7a..d906dee323 100644 --- a/src/unk_02051D8C.c +++ b/src/unk_02051D8C.c @@ -92,7 +92,7 @@ BattleParams * sub_02051D8C (int param0, u32 param1) v1->unk_14C = 0; for (v0 = 0; v0 < 4; v0++) { - v1->parties[v0] = sub_02079FF4(param0); + v1->parties[v0] = Party_New(param0); } for (v0 = 0; v0 < 4; v0++) { diff --git a/src/unk_020528D0.c b/src/unk_020528D0.c index faf22044ff..501ce1cb03 100644 --- a/src/unk_020528D0.c +++ b/src/unk_020528D0.c @@ -161,7 +161,7 @@ static BOOL sub_020529C4 (UnkStruct_020508D4 * param0) } break; case 2: - if ((gCoreSys.padInput & PAD_BUTTON_A) || (gCoreSys.padInput & PAD_BUTTON_B)) { + if ((gCoreSys.pressedKeys & PAD_BUTTON_A) || (gCoreSys.pressedKeys & PAD_BUTTON_B)) { sub_0200F174(0, 0, 0, 0x0, 8, 1, 32); v0->unk_00++; } diff --git a/src/unk_02055C50.c b/src/unk_02055C50.c index 706c40654c..85575ea6eb 100644 --- a/src/unk_02055C50.c +++ b/src/unk_02055C50.c @@ -401,7 +401,7 @@ static BOOL sub_02056124 (UnkStruct_020508D4 * param0) v1->unk_08 = 0; v1->unk_00 = 2; case 2: - if (gCoreSys.unk_44 & PAD_KEY_LEFT) { + if (gCoreSys.heldKeys & PAD_KEY_LEFT) { UnkStruct_02061AB4 * v2 = sub_02056074(v0, 2); if ((v2 == NULL) || !sub_020560E4(v2)) { @@ -412,7 +412,7 @@ static BOOL sub_02056124 (UnkStruct_020508D4 * param0) v1->unk_00 = 3; break; } - } else if (gCoreSys.unk_44 & PAD_KEY_RIGHT) { + } else if (gCoreSys.heldKeys & PAD_KEY_RIGHT) { UnkStruct_02061AB4 * v2 = sub_02056074(v0, 3); if ((v2 == NULL) || !sub_020560E4(v2)) { @@ -423,11 +423,11 @@ static BOOL sub_02056124 (UnkStruct_020508D4 * param0) v1->unk_00 = 3; break; } - } else if ((gCoreSys.unk_44 & PAD_KEY_UP) && (v1->unk_04 == 1)) { + } else if ((gCoreSys.heldKeys & PAD_KEY_UP) && (v1->unk_04 == 1)) { sub_0205EA84(v0->unk_3C, 0); v1->unk_00 = 4; break; - } else if ((gCoreSys.unk_44 & PAD_KEY_DOWN) && (v1->unk_04 == 0)) { + } else if ((gCoreSys.heldKeys & PAD_KEY_DOWN) && (v1->unk_04 == 0)) { v1->unk_00 = 4; break; } diff --git a/src/unk_02057518.c b/src/unk_02057518.c index 2d8b578cda..6b3372b6dd 100644 --- a/src/unk_02057518.c +++ b/src/unk_02057518.c @@ -498,7 +498,7 @@ static void sub_02057E68 () { u8 v0 = 2; - if (PAD_BUTTON_B & gCoreSys.unk_44) { + if (PAD_BUTTON_B & gCoreSys.heldKeys) { v0 = 1; } diff --git a/src/unk_0205964C.c b/src/unk_0205964C.c index d897edc9d8..03f984bca5 100644 --- a/src/unk_0205964C.c +++ b/src/unk_0205964C.c @@ -439,7 +439,7 @@ static void sub_02059BF4 (void) static void sub_02059C2C (BOOL param0, const Party * param1) { if (param1) { - Unk_021C084C->unk_44 = sub_02079FF4(11); + Unk_021C084C->unk_44 = Party_New(11); Party_cpy(param1, Unk_021C084C->unk_44); } diff --git a/src/unk_0205A0D8.c b/src/unk_0205A0D8.c index e12962186e..8a3a6de007 100644 --- a/src/unk_0205A0D8.c +++ b/src/unk_0205A0D8.c @@ -288,7 +288,7 @@ static BOOL sub_0205A324 (UnkStruct_020508D4 * param0) v0->unk_34 = 7; sub_02062C30(v0->unk_24->unk_38); v0->unk_08(1, v0->unk_50); - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { v0->unk_34 = 4; sub_020364F0(92); v0->unk_43 = 5; @@ -698,7 +698,7 @@ void sub_0205AB10 (UnkStruct_0203CDB0 * param0, UnkFuncPtr_0205AB10 * param1) v0->unk_4C = Heap_AllocFromHeapAtEnd(11, v2); v0->unk_48 = Heap_AllocFromHeapAtEnd(11, v2); - v0->unk_50 = sub_02079FF4(11); + v0->unk_50 = Party_New(11); Party_InitWithCapacity(v0->unk_50, 3); @@ -936,17 +936,17 @@ static void sub_0205AF18 (UnkStruct_0205A0D8 * param0, int param1) static int sub_0205AFE4 (UnkStruct_0205A0D8 * param0) { do { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_81 = ((param0->unk_81 == 0) ? (param0->unk_80 - 1) : (param0->unk_81 - 1)); break; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_81 = (param0->unk_81 == (param0->unk_80 - 1)) ? 0 : (param0->unk_81 + 1); break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if (param0->unk_81 < (param0->unk_80 - 1)) { @@ -956,7 +956,7 @@ static int sub_0205AFE4 (UnkStruct_0205A0D8 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); return 2; } @@ -1036,7 +1036,7 @@ static BOOL sub_0205B140 (UnkStruct_020508D4 * param0) break; case 1: if (sub_0205DA04(v1->unk_20)) { - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { MessageLoader_Free(v1->unk_1C); sub_0200B3F0(v1->unk_18); Strbuf_Free(v1->unk_00); diff --git a/src/unk_020683F4.c b/src/unk_020683F4.c index 18d208497a..938f9f37f2 100644 --- a/src/unk_020683F4.c +++ b/src/unk_020683F4.c @@ -965,7 +965,7 @@ static BOOL sub_02068F48 (UnkStruct_020508D4 * param0) break; case 1: if (sub_0205DA04(v1->unk_14) == 1) { - if (gCoreSys.padInput & (PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_KEY_UP | PAD_KEY_DOWN | PAD_KEY_LEFT | PAD_KEY_RIGHT | PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(&v1->unk_00, 0); v1->unk_16++; } diff --git a/src/unk_0206C0E8.c b/src/unk_0206C0E8.c index 3744946626..163c1acb5d 100644 --- a/src/unk_0206C0E8.c +++ b/src/unk_0206C0E8.c @@ -113,7 +113,7 @@ static BOOL sub_0206C120 (UnkStruct_020508D4 * param0) case 5: v1->unk_0E++; - if ((v1->unk_0E >= 60) || (gCoreSys.padInput & PAD_BUTTON_A)) { + if ((v1->unk_0E >= 60) || (gCoreSys.pressedKeys & PAD_BUTTON_A)) { ov6_02242A94(v1->unk_0D, v1->unk_04); v1->unk_08 = ov6_02242AEC(v1->unk_04); Sound_PlayEffect(1657); diff --git a/src/unk_0206F314.c b/src/unk_0206F314.c index 3b82259197..6c67702410 100644 --- a/src/unk_0206F314.c +++ b/src/unk_0206F314.c @@ -284,13 +284,13 @@ static int sub_0206F498 (UnkStruct_0206F7F8 * param0) v0 = sub_02001288(param0->unk_C0); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); sub_0206FF10(param0); return 10; } - if (!(gCoreSys.padInput & PAD_BUTTON_A)) { + if (!(gCoreSys.pressedKeys & PAD_BUTTON_A)) { return 3; } @@ -320,13 +320,13 @@ static int sub_0206F508 (UnkStruct_0206F7F8 * param0) static int sub_0206F514 (UnkStruct_0206F7F8 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { Sound_PlayEffect(1500); sub_02070288(param0); return 2; } - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { Sound_PlayEffect(1500); sub_0206FFE4(param0); return 6; @@ -339,13 +339,13 @@ static int sub_0206F554 (UnkStruct_0206F7F8 * param0) { UnkStruct_0206F3A0 * v0; - if (gCoreSys.padInput & (PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_02070010(param0); return 5; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); param0->unk_0C = 0; param0->unk_328 = &(param0->unk_324[param0->unk_1F].unk_04[param0->unk_32C[param0->unk_28]]); @@ -357,7 +357,7 @@ static int sub_0206F554 (UnkStruct_0206F7F8 * param0) return 7; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (param0->unk_28 > 0) { Sound_PlayEffect(1500); --param0->unk_28; @@ -365,7 +365,7 @@ static int sub_0206F554 (UnkStruct_0206F7F8 * param0) } } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (param0->unk_28 < (param0->unk_21 - 1)) { Sound_PlayEffect(1500); ++param0->unk_28; @@ -456,7 +456,7 @@ static int sub_0206F748 (UnkStruct_0206F7F8 * param0) param0->unk_0C++; break; case 2: - if (!(gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if (!(gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { break; } @@ -895,7 +895,7 @@ static BOOL sub_020702D0 (UnkStruct_020508D4 * param0) sub_020219F8(v1->unk_08->unk_134.unk_00); break; case 9: - if (!(gCoreSys.padInput & PAD_BUTTON_A)) { + if (!(gCoreSys.pressedKeys & PAD_BUTTON_A)) { return 0; } diff --git a/src/unk_020722AC.c b/src/unk_020722AC.c index a1a39b13f2..278a63b384 100644 --- a/src/unk_020722AC.c +++ b/src/unk_020722AC.c @@ -270,13 +270,13 @@ static void sub_02072390 (SysTask * param0, void * param1) sub_0206A870(v0->unk_1A4); } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { sub_02072EA4(v0, sub_02072518, sub_02072364); Sound_PlayEffect(1500); return; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); switch (v1) { @@ -326,13 +326,13 @@ static void sub_02072470 (SysTask * param0, void * param1) v1 = sub_02001288(v0->unk_160); - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { sub_02072EA4(v0, sub_02072534, sub_02072370); Sound_PlayEffect(1500); return; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); switch (v1) { @@ -504,7 +504,7 @@ static void sub_020726B4 (SysTask * param0, void * param1) } break; case 2: - if (!(gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if (!(gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { return; } @@ -584,7 +584,7 @@ static void sub_020727F8 (SysTask * param0, void * param1) } break; case 2: - if (!(gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B))) { + if (!(gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B))) { return; } diff --git a/src/unk_0207AE68.c b/src/unk_0207AE68.c index 0baeae8ec0..3f567d1ed5 100644 --- a/src/unk_0207AE68.c +++ b/src/unk_0207AE68.c @@ -250,7 +250,7 @@ static void sub_0207B180 (UnkStruct_0207AE68 * param0) } } - if ((param0->unk_7C & 0x1) && (param0->unk_64 == 8) && (gCoreSys.padInput & PAD_BUTTON_B)) { + if ((param0->unk_7C & 0x1) && (param0->unk_64 == 8) && (gCoreSys.pressedKeys & PAD_BUTTON_B)) { sub_02003178(param0->unk_14, ((0x1 | 0x2 | 0x4 | 0x8)), (0xc00 ^ 0xffff), 0, 0, 16, 0x7fff); param0->unk_64 = 41; } diff --git a/src/unk_0207E0B8.c b/src/unk_0207E0B8.c index dc176bedce..f1332890ae 100644 --- a/src/unk_0207E0B8.c +++ b/src/unk_0207E0B8.c @@ -265,7 +265,7 @@ static int sub_0207E0B8 (UnkStruct_020067E8 * param0, int * param1) G2_BlendNone(); G2S_BlendNone(); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, 12, 0x30000); v1 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, 12); @@ -600,7 +600,7 @@ static int sub_0207E6C0 (UnkStruct_0207F248 * param0) static int sub_0207E6E4 (UnkStruct_0207F248 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); return 32; } @@ -1434,13 +1434,13 @@ static u8 sub_0207FA24 (UnkStruct_0207F248 * param0) v1 = 4; - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { v1 = 0; - } else if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { v1 = 1; - } else if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { v1 = 2; - } else if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + } else if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { v1 = 3; } @@ -1635,7 +1635,7 @@ static u8 sub_0207FE98 (UnkStruct_0207F248 * param0) { u8 v0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_B11 == 6) { return 4; } else if (param0->unk_B11 == 7) { @@ -1675,7 +1675,7 @@ static u8 sub_0207FE98 (UnkStruct_0207F248 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_B0F_7 == 0) { Sound_PlayEffect(1500); param0->unk_B11 = 7; @@ -2044,7 +2044,7 @@ static u8 sub_020805E4 (UnkStruct_0207F248 * param0) { u8 v0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); if ((param0->unk_B11 >= 6) || (param0->unk_B11 == param0->unk_B0F_0)) { @@ -2056,7 +2056,7 @@ static u8 sub_020805E4 (UnkStruct_0207F248 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); sub_02083B88(param0); return 3; @@ -2320,7 +2320,7 @@ static int sub_02080AD8 (UnkStruct_0207F248 * param0) if (v0 != 0xffffffff) { u16 v1 = 0xfffe; - if (sub_0201C784(param0->unk_00, 4, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_00, 4, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } @@ -2376,7 +2376,7 @@ static int sub_02080BF4 (UnkStruct_0207F248 * param0) { switch (param0->unk_B14[1]) { case 0: - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_B11 >= 6) { Sound_PlayEffect(1500); sub_02083B88(param0); @@ -2405,7 +2405,7 @@ static int sub_02080BF4 (UnkStruct_0207F248 * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); sub_02083B88(param0); return 1; @@ -2439,7 +2439,7 @@ static int sub_02080BF4 (UnkStruct_0207F248 * param0) } break; case 1: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_0200E084(¶m0->unk_04[34], 1); sub_0200D414(param0->unk_5B0[6], 0); @@ -2479,7 +2479,7 @@ static int sub_02080BF4 (UnkStruct_0207F248 * param0) } break; case 4: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_0200E084(¶m0->unk_04[34], 1); sub_0200D414(param0->unk_5B0[6], 0); @@ -2538,7 +2538,7 @@ static u8 sub_02080FD0 (UnkStruct_0207F248 * param0) { u8 v0; - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_B11 == 7) { if (param0->unk_B0F_7 == 0) { Sound_PlayEffect(1500); @@ -2556,7 +2556,7 @@ static u8 sub_02080FD0 (UnkStruct_0207F248 * param0) return 5; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { if (param0->unk_B0F_7 == 0) { Sound_PlayEffect(1500); param0->unk_B11 = 7; @@ -2746,7 +2746,7 @@ static void sub_020814A8 (UnkStruct_0207F248 * param0, Pokemon * param1, u32 par static int sub_0208150C (UnkStruct_0207F248 * param0) { if (Message_Printing(param0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return sub_0208170C(param0); } } @@ -2757,7 +2757,7 @@ static int sub_0208150C (UnkStruct_0207F248 * param0) static int sub_0208153C (UnkStruct_0207F248 * param0) { if (Message_Printing(param0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020819B4(param0); return 13; diff --git a/src/unk_02083370.c b/src/unk_02083370.c index d6c4d3657a..82182ee865 100644 --- a/src/unk_02083370.c +++ b/src/unk_02083370.c @@ -218,7 +218,7 @@ static void sub_020834B0 (UnkStruct_0207F248 * param0, int * param1) int sub_02083658 (UnkStruct_0207F248 * param0) { if (Message_Printing(param0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); sub_0200D414(param0->unk_5B0[6], 0); @@ -232,7 +232,7 @@ int sub_02083658 (UnkStruct_0207F248 * param0) int sub_020836A8 (UnkStruct_0207F248 * param0) { if (Message_Printing(param0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020819B4(param0); return 19; @@ -377,7 +377,7 @@ static int sub_02083990 (void * param0) int sub_020839BC (UnkStruct_0207F248 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); sub_0200D414(param0->unk_5B0[6], 0); @@ -761,7 +761,7 @@ static void sub_020844B0 (UnkStruct_0207F248 * param0, int * param1) int sub_020845A8 (UnkStruct_0207F248 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020826E0(param0, 34, 1); sub_0200D414(param0->unk_5B0[6], 0); @@ -1032,7 +1032,7 @@ static int sub_02084A18 (UnkStruct_0207F248 * param0) int sub_02084B34 (UnkStruct_0207F248 * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0200E084(¶m0->unk_04[34], 1); sub_020826E0(param0, 29, 1); sub_0200D414(param0->unk_5B0[6], 0); diff --git a/src/unk_02084B70.c b/src/unk_02084B70.c index c3044f5a30..30477838db 100644 --- a/src/unk_02084B70.c +++ b/src/unk_02084B70.c @@ -407,7 +407,7 @@ int sub_02085348 (void * param0) return 5; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v0->unk_5A4->unk_23 = 0; return 32; } @@ -634,7 +634,7 @@ int sub_02085804 (UnkStruct_0207F248 * param0) break; } - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); v3 = param0->unk_B11; param0->unk_B11 = sub_020857C0(param0, param0->unk_B11 + 1); @@ -720,7 +720,7 @@ static int sub_02085C50 (void * param0) switch (v0->unk_B13) { case 0: if (Message_Printing(v0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_020829DC(v0); v0->unk_B13 = 1; @@ -728,14 +728,14 @@ static int sub_02085C50 (void * param0) } break; case 1: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_02082B58(v0); v0->unk_B13 = 2; } break; case 2: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); sub_02082C10(v0); v0->unk_B13 = 3; @@ -781,14 +781,14 @@ static int sub_02085C50 (void * param0) break; case 4: if (Message_Printing(v0->unk_B10) == 0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { Sound_PlayEffect(1500); v0->unk_B13 = 3; } } break; case 5: - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v1 = Party_GetPokemonBySlotIndex(v0->unk_5A4->unk_00, v0->unk_B11); sub_02086590(v0, v1, v0->unk_5A4->unk_28); v2 = MessageLoader_GetNewStrbuf(v0->unk_69C, 61); @@ -1039,7 +1039,7 @@ int sub_020863A0 (UnkStruct_0207F248 * param0) Pokemon * v0; Strbuf* v1; - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { v0 = Party_GetPokemonBySlotIndex(param0->unk_5A4->unk_00, param0->unk_B11); sub_02086590(param0, v0, param0->unk_5A4->unk_28); diff --git a/src/unk_0208694C.c b/src/unk_0208694C.c index 60849f45f5..48a74a4d60 100644 --- a/src/unk_0208694C.c +++ b/src/unk_0208694C.c @@ -916,7 +916,7 @@ static int sub_0208694C (UnkStruct_020067E8 * param0, int * param1) v0->unk_170 = MessageLoader_Init(1, 26, 427, 18); v0->unk_174 = MessageLoader_Init(1, 26, 368, 18); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); sub_020871CC(); sub_020871EC(v0->unk_160); sub_020871B0(v0, (UnkStruct_0208737C *)sub_02006840(param0)); @@ -1043,7 +1043,7 @@ static int sub_02086D38 (UnkStruct_02087A10 * param0, int param1) { sub_02088350(param0); - if (gCoreSys.padInput & PAD_BUTTON_SELECT) { + if (gCoreSys.pressedKeys & PAD_BUTTON_SELECT) { if (sub_02021D34(param0->unk_390[8]) == 0) { sub_02021CAC(param0->unk_390[8], 1); return param1; @@ -1069,15 +1069,15 @@ static int sub_02086D38 (UnkStruct_02087A10 * param0, int param1) sub_02088844(param0->unk_3A, param0->unk_4C4); Sound_PlayEffect(1694); - } else if (gCoreSys.padInput & PAD_BUTTON_A) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_A) { param1 = sub_02088898(param0, param0->unk_3A[param0->unk_1C.unk_04][param0->unk_1C.unk_00], 1); param0->unk_1C.unk_14 = 1; } else if (param0->unk_62C == 1) { param1 = sub_02088898(param0, param0->unk_3A[param0->unk_1C.unk_04][param0->unk_1C.unk_00], 0); param0->unk_1C.unk_14 = 0; - } else if (gCoreSys.padInput & PAD_BUTTON_B) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_B) { param1 = sub_02088898(param0, (0xe001 + 6), 1); - } else if (gCoreSys.padInput & PAD_BUTTON_R) { + } else if (gCoreSys.pressedKeys & PAD_BUTTON_R) { param1 = sub_02088898(param0, (0xe001 + 5), 1); } @@ -1976,35 +1976,35 @@ static void sub_02088350 (UnkStruct_02087A10 * param0) v2 = 1; } - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { Sound_PlayEffect(1500); sub_02021CAC(param0->unk_390[8], 1); v1 = 1; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { Sound_PlayEffect(1500); sub_02021CAC(param0->unk_390[8], 1); v1 = 2; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { Sound_PlayEffect(1500); sub_02021CAC(param0->unk_390[8], 1); v1 = 3; v0++; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { Sound_PlayEffect(1500); sub_02021CAC(param0->unk_390[8], 1); v1 = 4; v0++; } - if (gCoreSys.padInput & PAD_BUTTON_START) { + if (gCoreSys.pressedKeys & PAD_BUTTON_START) { Sound_PlayEffect(1500); sub_02021CAC(param0->unk_390[8], 1); param0->unk_1C.unk_00 = 12; @@ -2247,7 +2247,7 @@ static int sub_02088898 (UnkStruct_02087A10 * param0, u16 param1, int param2) } } - if ((sub_02021D34(param0->unk_390[8]) == 0) && (gCoreSys.touchInput == 0)) { + if ((sub_02021D34(param0->unk_390[8]) == 0) && (gCoreSys.touchPressed == 0)) { sub_02021CAC(param0->unk_390[8], 1); return 2; } @@ -2620,9 +2620,9 @@ static BOOL sub_0208903C (UnkStruct_02087A10 * param0) v1 = 4; } - if (gCoreSys.touchInput) { - v2 = gCoreSys.unk_5C; - v3 = gCoreSys.unk_5E; + if (gCoreSys.touchPressed) { + v2 = gCoreSys.touchX; + v3 = gCoreSys.touchY; for (v0 = v1; v0 < (NELEMS(Unk_020F2A14)); v0++) { v4 = Unk_020F2A14[v0].unk_00; diff --git a/src/unk_0208C098.c b/src/unk_0208C098.c index ec49ead2c8..df279872a3 100644 --- a/src/unk_0208C098.c +++ b/src/unk_0208C098.c @@ -97,7 +97,7 @@ u8 sub_0208C15C (s16 * param0, u16 param1) v0 = *param0; - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { *param0 += 1; if (*param0 > param1) { @@ -111,7 +111,7 @@ u8 sub_0208C15C (s16 * param0, u16 param1) return 1; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { *param0 -= 1; if (*param0 <= 0) { @@ -125,7 +125,7 @@ u8 sub_0208C15C (s16 * param0, u16 param1) return 2; } - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { *param0 -= 10; if (*param0 <= 0) { @@ -139,7 +139,7 @@ u8 sub_0208C15C (s16 * param0, u16 param1) return 2; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { *param0 += 10; if (*param0 > param1) { diff --git a/src/unk_0208C324.c b/src/unk_0208C324.c index 65314c2a51..c5f5364886 100644 --- a/src/unk_0208C324.c +++ b/src/unk_0208C324.c @@ -156,7 +156,7 @@ static int sub_0208C330 (UnkStruct_020067E8 * param0, int * param1) G2_BlendNone(); G2S_BlendNone(); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); Heap_Create(3, 19, 0x40000); v1 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PST_GRA, 19); @@ -540,33 +540,33 @@ static int sub_0208CA00 (UnkStruct_0208D7BC * param0) return 18; } - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { sub_0208D898(param0, -1); return 2; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { sub_0208D898(param0, 1); return 2; } - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { sub_0208DB10(param0, -1); return 2; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { sub_0208DB10(param0, 1); return 2; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); param0->unk_24C->unk_17 = 1; return 18; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if ((param0->unk_24C->unk_12 == 3) && (param0->unk_6A4 == 4)) { Sound_PlayEffect(1501); return sub_0208E958(param0); @@ -639,7 +639,7 @@ static int sub_0208CB74 (UnkStruct_0208D7BC * param0) static int sub_0208CB88 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (sub_0208DF94(param0, -1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -648,7 +648,7 @@ static int sub_0208CB88 (UnkStruct_0208D7BC * param0) return 7; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (sub_0208DF94(param0, 1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -657,7 +657,7 @@ static int sub_0208CB88 (UnkStruct_0208D7BC * param0) return 7; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { if (param0->unk_6A5_0 == 4) { Sound_PlayEffect(1692); param0->unk_6A6 = 0; @@ -675,7 +675,7 @@ static int sub_0208CB88 (UnkStruct_0208D7BC * param0) } } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1692); param0->unk_6A6 = 0; @@ -691,7 +691,7 @@ static int sub_0208CB88 (UnkStruct_0208D7BC * param0) static int sub_0208CC6C (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (sub_0208DF94(param0, -1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -700,7 +700,7 @@ static int sub_0208CC6C (UnkStruct_0208D7BC * param0) return 8; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (sub_0208DF94(param0, 1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -709,7 +709,7 @@ static int sub_0208CC6C (UnkStruct_0208D7BC * param0) return 8; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { sub_02021CAC(param0->unk_41C[10], 0); if ((param0->unk_6A5_0 != 4) && (param0->unk_6A5_0 != param0->unk_6A5_4)) { @@ -725,7 +725,7 @@ static int sub_0208CC6C (UnkStruct_0208D7BC * param0) return 7; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); sub_02021CAC(param0->unk_41C[10], 0); return 7; @@ -736,17 +736,17 @@ static int sub_0208CC6C (UnkStruct_0208D7BC * param0) static int sub_0208CD44 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeys & PAD_KEY_LEFT) { sub_0208D898(param0, -1); return 9; } - if (gCoreSys.padInput & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeys & PAD_KEY_RIGHT) { sub_0208D898(param0, 1); return 9; } - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { if (sub_0208DF94(param0, -1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -755,7 +755,7 @@ static int sub_0208CD44 (UnkStruct_0208D7BC * param0) return 9; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { if (sub_0208DF94(param0, 1) == 1) { Sound_PlayEffect(1500); sub_0208DFF4(param0); @@ -764,7 +764,7 @@ static int sub_0208CD44 (UnkStruct_0208D7BC * param0) return 9; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1501); if (param0->unk_6A5_0 != 4) { @@ -781,7 +781,7 @@ static int sub_0208CD44 (UnkStruct_0208D7BC * param0) return 18; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1501); param0->unk_24C->unk_16 = 4; param0->unk_24C->unk_17 = 1; @@ -793,7 +793,7 @@ static int sub_0208CD44 (UnkStruct_0208D7BC * param0) static int sub_0208CE54 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { sub_0208DFF4(param0); return 9; } @@ -821,27 +821,27 @@ static int sub_0208CE84 (UnkStruct_0208D7BC * param0) static int sub_0208CE98 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.unk_4C & PAD_KEY_LEFT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_LEFT) { sub_0208E794(param0, -1); return 13; } - if (gCoreSys.unk_4C & PAD_KEY_RIGHT) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_RIGHT) { sub_0208E794(param0, 1); return 13; } - if (gCoreSys.unk_4C & PAD_KEY_UP) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_UP) { sub_0208E794(param0, -4); return 13; } - if (gCoreSys.unk_4C & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeysRepeatable & PAD_KEY_DOWN) { sub_0208E794(param0, 4); return 13; } - if (gCoreSys.padInput & (PAD_BUTTON_B | PAD_BUTTON_A)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_B | PAD_BUTTON_A)) { Sound_PlayEffect(1501); param0->unk_6A6 = 0; return 12; @@ -877,7 +877,7 @@ static int sub_0208CF0C (UnkStruct_0208D7BC * param0) static int sub_0208CF78 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { BoxPokemon * v0; Pokemon * v1; u8 v2; @@ -955,7 +955,7 @@ static int sub_0208D114 (UnkStruct_0208D7BC * param0) { u8 v0; - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { for (v0 = 0; v0 < 5; v0++) { if ((param0->unk_6A6 & (1 << v0))) { sub_02091610(param0, v0); @@ -974,7 +974,7 @@ static int sub_0208D114 (UnkStruct_0208D7BC * param0) static int sub_0208D164 (UnkStruct_0208D7BC * param0) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { return 18; } diff --git a/src/unk_020920C0.c b/src/unk_020920C0.c index 5a6c51f5f6..4d1c06e014 100644 --- a/src/unk_020920C0.c +++ b/src/unk_020920C0.c @@ -189,7 +189,7 @@ static int sub_02092224 (UnkStruct_0208D7BC * param0) if (v0 != 0xffffffff) { u16 v1 = 0xfffe; - if (sub_0201C784(param0->unk_00, 4, gCoreSys.unk_5C, gCoreSys.unk_5E, &v1) == 0) { + if (sub_0201C784(param0->unk_00, 4, gCoreSys.touchX, gCoreSys.touchY, &v1) == 0) { return 0xffffffff; } } diff --git a/src/unk_020933F8.c b/src/unk_020933F8.c index 967eb02014..69b1f8623a 100644 --- a/src/unk_020933F8.c +++ b/src/unk_020933F8.c @@ -438,7 +438,7 @@ UnkStruct_02095C48 * sub_02093800 (const UnkStruct_02093800 * param0) } sub_020954F0(v0, 11, v0->unk_00.unk_10E, v0->unk_00.unk_10F, v0->unk_00.unk_110); - v0->unk_148 = sub_02079FF4(20); + v0->unk_148 = Party_New(20); for (v2 = 0; v2 < 4; v2++) { v0->unk_00.unk_00[v2] = Pokemon_New(20); diff --git a/src/unk_02099DFC.c b/src/unk_02099DFC.c index 0caf7ed82a..c6e165d250 100644 --- a/src/unk_02099DFC.c +++ b/src/unk_02099DFC.c @@ -129,7 +129,7 @@ int sub_02099E38 (UnkStruct_020067E8 * param0, int * param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); sub_02099F80(v0); sub_0209A098(v0); sub_02017798(sub_02099F74, (void *)v0); @@ -356,7 +356,7 @@ static BOOL sub_0209A200 (UnkStruct_02099DFC * param0, u32 param1, int param2, i } break; case 2: - if ((param2 != 0) || (gCoreSys.padInput & 1)) { + if ((param2 != 0) || (gCoreSys.pressedKeys & 1)) { param0->unk_08 = 0; v0 = 1; } diff --git a/src/unk_0209A2C4.c b/src/unk_0209A2C4.c index bb71bfe338..88f6214e7f 100644 --- a/src/unk_0209A2C4.c +++ b/src/unk_0209A2C4.c @@ -112,7 +112,7 @@ int sub_0209A300 (UnkStruct_020067E8 * param0, int * param1) GXLayers_DisableEngineBLayers(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); sub_0209A3D0(v0); sub_0209A4E4(v0); GXLayers_TurnBothDispOn(); @@ -332,7 +332,7 @@ static BOOL sub_0209A688 (UnkStruct_0209A3D0 * param0, u32 param1, int param2, i } break; case 2: - if ((param2 != 0) || (gCoreSys.padInput & PAD_BUTTON_A)) { + if ((param2 != 0) || (gCoreSys.pressedKeys & PAD_BUTTON_A)) { param0->unk_0C = 0; v0 = 1; } diff --git a/src/unk_0209A74C.c b/src/unk_0209A74C.c index c7110fe542..81b960170a 100644 --- a/src/unk_0209A74C.c +++ b/src/unk_0209A74C.c @@ -91,7 +91,7 @@ void sub_0209A74C (int param0) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); @@ -164,7 +164,7 @@ void sub_0209A8E0 (int param0) GXLayers_DisableEngineBLayers(); GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); diff --git a/src/unk_0209AA74.c b/src/unk_0209AA74.c index 3a2ebca956..85b234cb22 100644 --- a/src/unk_0209AA74.c +++ b/src/unk_0209AA74.c @@ -100,7 +100,7 @@ void sub_0209AA74 (int param0, int param1) GX_SetVisiblePlane(0); GXS_SetVisiblePlane(0); - sub_02017DD4(4, 8); + SetAutorepeat(4, 8); gCoreSys.unk_65 = 0; GXLayers_SwapDisplay(); diff --git a/src/unk_0209ACF4.c b/src/unk_0209ACF4.c index 18deae9616..1fc2993cc0 100644 --- a/src/unk_0209ACF4.c +++ b/src/unk_0209ACF4.c @@ -246,7 +246,7 @@ static BOOL sub_0209AE14 (UnkStruct_020508D4 * param0) break; case 12: if (sub_0209B100(v0)) { - if (gCoreSys.padInput & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_PLUS_KEY_MASK)) { + if (gCoreSys.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B | PAD_PLUS_KEY_MASK)) { sub_0209B110(v0); v0->unk_54 = 13; } @@ -363,7 +363,7 @@ static void sub_0209B27C (UnkStruct_0209AD84 * param0) static int sub_0209B288 (UnkStruct_0209AD84 * param0) { do { - if (gCoreSys.padInput & PAD_KEY_UP) { + if (gCoreSys.pressedKeys & PAD_KEY_UP) { param0->unk_5C--; if (param0->unk_5C < 0) { @@ -376,7 +376,7 @@ static int sub_0209B288 (UnkStruct_0209AD84 * param0) break; } - if (gCoreSys.padInput & PAD_KEY_DOWN) { + if (gCoreSys.pressedKeys & PAD_KEY_DOWN) { param0->unk_5C++; if (param0->unk_5C >= param0->unk_60) { @@ -389,12 +389,12 @@ static int sub_0209B288 (UnkStruct_0209AD84 * param0) break; } - if (gCoreSys.padInput & PAD_BUTTON_A) { + if (gCoreSys.pressedKeys & PAD_BUTTON_A) { Sound_PlayEffect(1500); return param0->unk_5C; } - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { Sound_PlayEffect(1500); return param0->unk_60 - 1; } diff --git a/src/unk_0209B6F8.c b/src/unk_0209B6F8.c index 83488a5986..f5c283bbfc 100644 --- a/src/unk_0209B6F8.c +++ b/src/unk_0209B6F8.c @@ -115,7 +115,7 @@ int sub_0209B75C (UnkStruct_020067E8 * param0, int * param1) } if (ov104_0222E6A8(v0->unk_14) == 1) { - if (gCoreSys.padInput & PAD_BUTTON_B) { + if (gCoreSys.pressedKeys & PAD_BUTTON_B) { *param1 = 2; } }