Skip to content

Commit 172539e

Browse files
committed
Fix stability issue with SwSh Home presses.
1 parent 253b9ec commit 172539e

16 files changed

+26
-26
lines changed

SerialPrograms/Source/PokemonSwSh/Commands/PokemonSwSh_Commands_GameEntry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ void settings_to_enter_game(ProControllerContext& context, bool fast){
8686
// 100 ticks for the first press isn't enough to finish the animation.
8787
// But since the HOME button has delayed effect, we start pressing the 2nd
8888
// press before the animation finishes.
89-
ssf_press_button_ptv(context, BUTTON_HOME, 800ms, 160ms);
90-
ssf_press_button_ptv(context, BUTTON_HOME, 160ms, 160ms);
89+
ssf_press_button(context, BUTTON_HOME, 800ms, 160ms);
90+
ssf_press_button(context, BUTTON_HOME, 160ms, 160ms);
9191
}else{
92-
ssf_press_button_ptv(context, BUTTON_HOME, 1600ms, 160ms);
93-
ssf_press_button_ptv(context, BUTTON_HOME, 160ms, 160ms);
92+
ssf_press_button(context, BUTTON_HOME, 1600ms, 160ms);
93+
ssf_press_button(context, BUTTON_HOME, 160ms, 160ms);
9494
}
9595
}
9696
void settings_to_enter_game_den_lobby(

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-BerryFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void BerryFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerCont
6060
grip_menu_connect_go_home(context);
6161
}else{
6262
pbf_press_button(context, BUTTON_B, 5, 5);
63-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
63+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
6464
}
6565

6666
uint8_t year = MAX_YEAR;
@@ -88,7 +88,7 @@ void BerryFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerCont
8888

8989
// Tap HOME and quickly spam B. The B spamming ensures that we don't
9090
// accidentally update the system if the system update window pops up.
91-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
91+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
9292
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
9393
}
9494

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-BerryFarmer2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void BerryFarmer2::program(SingleSwitchProgramEnvironment& env, ProControllerCon
288288
grip_menu_connect_go_home(context);
289289
}else{
290290
pbf_press_button(context, BUTTON_B, 5, 5);
291-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
291+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
292292
}
293293

294294
BerryFarmer2_Descriptor::Stats& stats = env.current_stats<BerryFarmer2_Descriptor::Stats>();
@@ -344,7 +344,7 @@ void BerryFarmer2::program(SingleSwitchProgramEnvironment& env, ProControllerCon
344344

345345
// Tap HOME and quickly spam B. The B spamming ensures that we don't
346346
// accidentally update the system if the system update window pops up.
347-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
347+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
348348
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
349349
}
350350
VideoSnapshot screen = env.console.video().snapshot();

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-DailyHighlightFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void DailyHighlightFarmer::program(SingleSwitchProgramEnvironment& env, ProContr
6060
grip_menu_connect_go_home(context);
6161
}else{
6262
pbf_press_button(context, BUTTON_B, 5, 5);
63-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
63+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
6464
}
6565

6666
uint8_t year = MAX_YEAR;
@@ -89,7 +89,7 @@ void DailyHighlightFarmer::program(SingleSwitchProgramEnvironment& env, ProContr
8989

9090
// Tap HOME and quickly spam B. The B spamming ensures that we don't
9191
// accidentally update the system if the system update window pops up.
92-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
92+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
9393
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
9494
}
9595

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void LotoFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerConte
6161
grip_menu_connect_go_home(context);
6262
}else{
6363
pbf_press_button(context, BUTTON_B, 5, 5);
64-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
64+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
6565
}
6666

6767
uint8_t year = MAX_YEAR;
@@ -78,7 +78,7 @@ void LotoFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerConte
7878

7979
// Tap HOME and quickly spam B. The B spamming ensures that we don't
8080
// accidentally update the system if the system update window pops up.
81-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
81+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
8282
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
8383
}
8484

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-PokeJobsFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void PokeJobsFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerC
9393
// Roll back to 2001
9494
env.log("Rolling back!");
9595
ssf_press_button_ptv(context, BUTTON_B, 80ms);
96-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
96+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
9797
home_roll_date_enter_game_autorollback(env.console, context, year);
9898
pbf_mash_button(context, BUTTON_B, MASH_B_DURATION0);
9999

@@ -133,7 +133,7 @@ void PokeJobsFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerC
133133

134134
// Go to home menu
135135
env.log("#### Go to Switch home menu");
136-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
136+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
137137

138138
// Skip frame
139139
env.log("#### Skip frame");

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-StowOnSideFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void StowOnSideFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
6060
grip_menu_connect_go_home(context);
6161
}else{
6262
pbf_press_button(context, BUTTON_B, 5, 5);
63-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
63+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
6464
}
6565

6666
uint8_t year = MAX_YEAR;
@@ -87,7 +87,7 @@ void StowOnSideFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
8787

8888
// Tap HOME and quickly spam B. The B spamming ensures that we don't
8989
// accidentally update the system if the system update window pops up.
90-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
90+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
9191
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
9292
}
9393

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-WattFarmer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void WattFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerConte
7575
pbf_wait(context, GRIP_MENU_WAIT0);
7676
}else{
7777
pbf_press_button(context, BUTTON_B, 5, 5);
78-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
78+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
7979
}
8080

8181
uint8_t year = MAX_YEAR;
@@ -102,7 +102,7 @@ void WattFarmer::program(SingleSwitchProgramEnvironment& env, ProControllerConte
102102

103103
// Tap HOME and quickly spam B. The B spamming ensures that we don't
104104
// accidentally update the system if the system update window pops up.
105-
ssf_press_button_ptv(context, BUTTON_HOME, 120ms);
105+
ssf_press_button(context, BUTTON_HOME, 120ms, 160ms);
106106
pbf_mash_button(context, BUTTON_B, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0.get() - 120ms);
107107
}
108108

SerialPrograms/Source/PokemonSwSh/Programs/DenHunting/PokemonSwSh_BeamReset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void BeamReset::program(SingleSwitchProgramEnvironment& env, ProControllerContex
6767

6868
// Drop wishing piece.
6969
pbf_press_button(context, BUTTON_A, 10, 70);
70-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
70+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
7171

7272
for (uint16_t c = 0; c < 4; c++){
7373
pbf_press_button(context, BUTTON_HOME, 10, 10);

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_AutoHost-MultiGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void AutoHostMultiGame::program(SingleSwitchProgramEnvironment& env, ProControll
142142
grip_menu_connect_go_home(context);
143143
}else{
144144
pbf_press_button(context, BUTTON_B, 5, 5);
145-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
145+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
146146
}
147147

148148
if (enable_touch){

0 commit comments

Comments
 (0)