Skip to content

Commit aa9cfbb

Browse files
committed
Fix the SwSh DenRoller and auto-hosts for SBB.
1 parent 0ed4593 commit aa9cfbb

File tree

9 files changed

+33
-16
lines changed

9 files changed

+33
-16
lines changed

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void resume_game_from_home(
8080
void move_to_user(ProControllerContext& context, uint8_t user_slot){
8181
if (user_slot != 0){
8282
// Move to correct user.
83-
for (uint8_t c = 0; c < 8; c++){
83+
for (uint8_t c = 0; c < 9; c++){ // Extra iteration in case one gets dropped.
8484
ssf_issue_scroll_ptv(context, DPAD_LEFT, 160ms, 160ms);
8585
}
8686
for (uint8_t c = 1; c < user_slot; c++){
@@ -119,9 +119,9 @@ void start_game_from_home_with_inference(
119119
}
120120

121121
if (game_slot != 0){
122-
ssf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
122+
ssf_press_button(context, BUTTON_HOME, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0, 160ms);
123123
for (uint8_t c = 1; c < game_slot; c++){
124-
pbf_press_dpad(context, DPAD_RIGHT, 5, 5);
124+
ssf_press_dpad_ptv(context, DPAD_RIGHT, 160ms);
125125
}
126126
context.wait_for_all_requests();
127127
}
@@ -200,7 +200,7 @@ void start_game_from_home(
200200
}
201201

202202
if (game_slot != 0){
203-
ssf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
203+
ssf_press_button(context, BUTTON_HOME, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0, 160ms);
204204
for (uint8_t c = 1; c < game_slot; c++){
205205
ssf_press_dpad_ptv(context, DPAD_RIGHT, 80ms);
206206
}

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_Navigation.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ void home_to_date_time(ProControllerContext& context, bool to_date_change, bool
8585

8686
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
8787
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
88-
ssf_issue_scroll(context, SSF_SCROLL_DOWN, 1000ms, tv, tv);
89-
ssf_issue_scroll(context, SSF_SCROLL_DOWN, 1000ms, 250ms, tv); // Scroll down
88+
ssf_issue_scroll(context, SSF_SCROLL_DOWN, 500ms, tv, tv);
89+
ssf_press_right_joystick(context, 128, 224, 1000ms, 300ms, tv);
90+
// ssf_issue_scroll(context, SSF_SCROLL_DOWN, 1000ms, 250ms, tv); // Scroll down
9091
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
9192
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
9293

SerialPrograms/Source/PokemonSwSh/Commands/PokemonSwSh_Commands_DateSpam.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,23 @@ void roll_date_backward_N(ProControllerContext& context, uint8_t skips, bool fas
123123
ssf_press_button(context, BUTTON_A, 20, 10);
124124
}else{
125125
ssf_press_button_ptv(context, BUTTON_A, 160ms, 80ms);
126-
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN, 6000ms, 6000ms);
126+
if (skips >= 60){
127+
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN, 6000ms, 6000ms);
128+
}else{
129+
for (uint8_t c = 0; c < skips; c++){
130+
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
131+
}
132+
}
127133
ssf_press_button_ptv(context, BUTTON_A);
128134
// ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT);
129135
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT);
130-
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN, 6000ms, 6000ms);
136+
if (skips >= 60){
137+
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN, 6000ms, 6000ms);
138+
}else{
139+
for (uint8_t c = 0; c < skips; c++){
140+
ssf_issue_scroll_ptv(context, SSF_SCROLL_DOWN);
141+
}
142+
}
131143
ssf_press_button_ptv(context, BUTTON_A);
132144
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT);
133145
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT);

SerialPrograms/Source/PokemonSwSh/Commands/PokemonSwSh_Commands_GameEntry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void start_game_from_home(
135135
// If "user_slot" is zero, it uses whatever the cursor is on.
136136

137137
if (game_slot != 0){
138-
ssf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
138+
ssf_press_button(context, BUTTON_HOME, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0, 160ms);
139139
for (uint8_t c = 1; c < game_slot; c++){
140140
ssf_press_dpad_ptv(context, DPAD_RIGHT, 80ms);
141141
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ AutoHostMultiGame_Descriptor::AutoHostMultiGame_Descriptor()
3434
"Run AutoHost-Rolling across multiple game saves. (Up to 16 dens!)",
3535
FeedbackType::OPTIONAL_,
3636
AllowCommandsWhenRunning::DISABLE_COMMANDS,
37-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
37+
{ControllerFeature::NintendoSwitch_ProController},
38+
FasterIfTickPrecise::FASTER
3839
)
3940
{}
4041
std::unique_ptr<StatsTracker> AutoHostMultiGame_Descriptor::make_stats() const{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ AutoHostRolling_Descriptor::AutoHostRolling_Descriptor()
3535
"Roll N days, host, SR and repeat. Also supports hard-locks and soft-locks.",
3636
FeedbackType::OPTIONAL_,
3737
AllowCommandsWhenRunning::DISABLE_COMMANDS,
38-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
38+
{ControllerFeature::NintendoSwitch_ProController},
39+
FasterIfTickPrecise::FASTER
3940
)
4041
{}
4142
std::unique_ptr<StatsTracker> AutoHostRolling_Descriptor::make_stats() const{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
namespace PokemonAutomation{
2424
namespace NintendoSwitch{
2525
namespace PokemonSwSh{
26-
using namespace Pokemon;
26+
27+
using namespace Pokemon;
2728

2829

2930
bool connect_to_internet(

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_DenRoller.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ DenRoller_Descriptor::DenRoller_Descriptor()
3333
"Roll den to the N'th day, SR and repeat.",
3434
FeedbackType::OPTIONAL_,
3535
AllowCommandsWhenRunning::DISABLE_COMMANDS,
36-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
36+
{ControllerFeature::NintendoSwitch_ProController},
37+
FasterIfTickPrecise::MUCH_FASTER
3738
)
3839
{}
3940
struct DenRoller_Descriptor::Stats : public StatsTracker{
@@ -179,7 +180,7 @@ void DenRoller::program(SingleSwitchProgramEnvironment& env, ProControllerContex
179180
env.update_stats();
180181

181182
// Add a little extra wait time since correctness matters here.
182-
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 80ms);
183+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
183184

184185
rollback_date_from_home(context, SKIPS);
185186
// reset_game_from_home(TOLERATE_SYSTEM_UPDATE_MENU_SLOW);

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_DenTools.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void enter_den(
2727
){
2828
if (!online){
2929
if (!watts){
30-
ssf_press_button(context, BUTTON_A, GameSettings::instance().ENTER_OFFLINE_DEN_DELAY0, 80ms);
30+
ssf_press_button(context, BUTTON_A, GameSettings::instance().ENTER_OFFLINE_DEN_DELAY0, 160ms);
3131
}else{
3232
// This is the critical den-rolling path. It needs to be fast.
3333
ssf_mash_AZs(context, GameSettings::instance().COLLECT_WATTS_OFFLINE_DELAY0);
@@ -145,7 +145,7 @@ void rollback_date_from_home(ProControllerContext& context, uint8_t skips){
145145
// Note that it is possible for this return animation to run longer than
146146
// "SETTINGS_TO_HOME_DELAY" and swallow a subsequent button press.
147147
// Therefore the caller needs to be able to tolerate this.
148-
ssf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
148+
ssf_press_button(context, BUTTON_HOME, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0, 160ms);
149149
}
150150

151151

0 commit comments

Comments
 (0)