@@ -147,7 +147,6 @@ void touch_date_from_home(
147147 touch_date_from_home_switch1 (console, context, settings_to_home_delay);
148148 return ;
149149 }
150-
151150 if (is_switch2 (type)){
152151 touch_date_from_home_switch2 (console, context, settings_to_home_delay);
153152 return ;
@@ -161,7 +160,8 @@ void touch_date_from_home(
161160
162161
163162
164- void rollback_hours_from_home (
163+
164+ void rollback_hours_from_home_switch1 (
165165 ConsoleHandle& console, ProControllerContext& context,
166166 uint8_t hours,
167167 Milliseconds settings_to_home_delay
@@ -182,6 +182,50 @@ void rollback_hours_from_home(
182182 ssf_press_button_ptv (context, BUTTON_A, 160ms, 80ms);
183183 ssf_press_button (context, BUTTON_HOME, settings_to_home_delay, 80ms);
184184}
185+ void rollback_hours_from_home_switch2 (
186+ ConsoleHandle& console, ProControllerContext& context,
187+ uint8_t hours,
188+ Milliseconds settings_to_home_delay
189+ ){
190+ home_to_date_time (console, context, true );
191+
192+ ssf_press_button (context, BUTTON_A, 240ms, 80ms);
193+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
194+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
195+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
196+ for (uint8_t c = 0 ; c < hours; c++){
197+ ssf_issue_scroll (context, SSF_SCROLL_DOWN, 112ms, 48ms, 24ms);
198+ }
199+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
200+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
201+ ssf_issue_scroll (context, SSF_SCROLL_RIGHT, 24ms, 48ms, 24ms);
202+ ssf_press_button (context, BUTTON_A, 280ms, 80ms);
203+
204+ ssf_press_button (context, BUTTON_HOME, settings_to_home_delay, 80ms);
205+ }
206+
207+
208+ void rollback_hours_from_home (
209+ ConsoleHandle& console, ProControllerContext& context,
210+ uint8_t hours,
211+ Milliseconds settings_to_home_delay
212+ ){
213+ ConsoleType type = console.state ().console_type ();
214+
215+ if (type == ConsoleType::Switch1){
216+ rollback_hours_from_home_switch1 (console, context, hours, settings_to_home_delay);
217+ return ;
218+ }
219+ if (is_switch2 (type)){
220+ rollback_hours_from_home_switch2 (console, context, hours, settings_to_home_delay);
221+ return ;
222+ }
223+
224+ throw UserSetupError (
225+ console.logger (),
226+ " Please select a valid Switch console type."
227+ );
228+ }
185229
186230
187231
0 commit comments