Skip to content

Commit 27001fc

Browse files
committed
Fix SV date skip on Switch 2.
1 parent a62d6f4 commit 27001fc

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

SerialPrograms/Source/NintendoSwitch/Programs/DateSpam/NintendoSwitch2_HomeToDateTime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ ConsoleType settings_detect_console_type(
139139
context.wait_for_all_requests();
140140

141141
auto snapshot = console.video().snapshot();
142+
// snapshot->save("screenshot.png");
142143
size_t sliders = detector.detect(snapshot).size();
143144
switch (sliders){
144145
case 2:

SerialPrograms/Source/NintendoSwitch/Programs/DateSpam/NintendoSwitch_HomeToDateTime.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ void home_to_date_time_Switch2_wired_feedback(
4949
);
5050

5151

52+
ConsoleType settings_detect_console_type(
53+
ConsoleHandle& console, ProControllerContext& context
54+
);
55+
56+
5257

5358
void home_to_date_time(ConsoleHandle& console, ProControllerContext& context, bool to_date_change);
5459

SerialPrograms/Source/PokemonSV/Programs/PokemonSV_MenuNavigation.cpp

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ void set_time_to_12am_from_home(const ProgramInfo& info, ConsoleHandle& console,
4949
// resume_game_from_home(console, context);
5050
}
5151

52-
void day_skip_from_overworld(ConsoleHandle& console, ProControllerContext& context){
53-
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY1);
54-
home_to_date_time(console, context, true);
52+
void neutral_day_skip_switch1(ConsoleHandle& console, ProControllerContext& context){
53+
console.log("PokemonSV::neutral_day_skip_switch1()");
5554

5655
Milliseconds tv = context->timing_variation();
5756
if (tv == 0ms){
@@ -87,6 +86,35 @@ void day_skip_from_overworld(ConsoleHandle& console, ProControllerContext& conte
8786
ssf_issue_scroll_ptv(context, DPAD_RIGHT);
8887
ssf_press_button_ptv(context, BUTTON_A, 160ms);
8988
}
89+
}
90+
void neutral_day_skip_switch2(ConsoleHandle& console, ProControllerContext& context){
91+
console.log("PokemonSV::neutral_day_skip_switch2()");
92+
93+
ssf_press_button(context, BUTTON_A, 216ms, 80ms);
94+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
95+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
96+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
97+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
98+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
99+
ssf_issue_scroll_ptv(context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
100+
ssf_press_button(context, BUTTON_A, 264ms, 80ms);
101+
}
102+
103+
void day_skip_from_overworld(ConsoleHandle& console, ProControllerContext& context){
104+
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY1);
105+
home_to_date_time(console, context, true);
106+
107+
ConsoleType console_type = console.state().console_type();
108+
if (is_switch1(console_type)){
109+
neutral_day_skip_switch1(console, context);
110+
}else if (is_switch2(console_type)){
111+
neutral_day_skip_switch2(console, context);
112+
}else{
113+
throw UserSetupError(
114+
console,
115+
"Please select a valid Switch console type."
116+
);
117+
}
90118

91119
pbf_press_button(context, BUTTON_HOME, 160ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
92120
resume_game_from_home(console, context);

0 commit comments

Comments
 (0)