Skip to content

Commit 0765611

Browse files
committed
Automation: Fix for Switch v11 firmware
The latest Switch firmware adds a “Switch Online” button on the main menu, on the right side of the “News” button. This changes the way the controllers or console settings can be accessed. To maintain compatibility with previous software versions, the automation first sends the cursor to the rightmost position, then backs a couple steps to position it on the correct button.
1 parent d58919b commit 0765611

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/lib/automation-utils.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ void switch_controller(enum switch_mode mode)
2121
cursor is on the game icon */
2222

2323
SEND_BUTTON_SEQUENCE(
24-
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* News button */
25-
{ BT_NONE, DP_RIGHT, SEQ_MASH, 3 }, /* Controllers button */
24+
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* Switch Online button or News button (< v11) */
25+
{ BT_NONE, DP_RIGHT, SEQ_MASH, 6 }, /* Sleep button */
26+
{ BT_NONE, DP_LEFT, SEQ_MASH, 2 }, /* Controllers button */
2627
{ BT_A, DP_NEUTRAL, SEQ_HOLD, 1 }, /* Enter controllers settings */
2728
{ BT_NONE, DP_NEUTRAL, SEQ_HOLD, 10 }, /* Wait for settings */
2829

@@ -73,8 +74,9 @@ void set_clock_to_manual_from_any(bool in_game)
7374
}
7475

7576
SEND_BUTTON_SEQUENCE(
76-
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* News button */
77-
{ BT_NONE, DP_RIGHT, SEQ_MASH, 4 }, /* Settings button */
77+
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* Switch Online button or News button (< v11) */
78+
{ BT_NONE, DP_RIGHT, SEQ_MASH, 6 }, /* Sleep button */
79+
{ BT_NONE, DP_LEFT, SEQ_MASH, 1 }, /* Settings button */
7880
{ BT_A, DP_NEUTRAL, SEQ_HOLD, 1 }, /* Enter settings */
7981
{ BT_NONE, DP_NEUTRAL, SEQ_HOLD, 20 }, /* Wait for settings */
8082
{ BT_NONE, DP_BOTTOM, SEQ_MASH, 14 }, /* Console settings */
@@ -106,8 +108,9 @@ void set_clock_to_auto_from_manual(bool in_game)
106108
}
107109

108110
SEND_BUTTON_SEQUENCE(
109-
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* News button */
110-
{ BT_NONE, DP_RIGHT, SEQ_MASH, 4 }, /* Settings button */
111+
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* Switch Online button or News button (< v11) */
112+
{ BT_NONE, DP_RIGHT, SEQ_MASH, 6 }, /* Sleep button */
113+
{ BT_NONE, DP_LEFT, SEQ_MASH, 1 }, /* Settings button */
111114
{ BT_A, DP_NEUTRAL, SEQ_HOLD, 1 }, /* Enter settings */
112115
{ BT_NONE, DP_NEUTRAL, SEQ_HOLD, 20 }, /* Wait for settings */
113116
{ BT_NONE, DP_BOTTOM, SEQ_MASH, 14 }, /* Console settings */
@@ -148,8 +151,9 @@ void change_clock_year(bool in_game, int8_t offset)
148151
}
149152

150153
SEND_BUTTON_SEQUENCE(
151-
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* News button */
152-
{ BT_NONE, DP_RIGHT, SEQ_MASH, 4 }, /* Settings button */
154+
{ BT_NONE, DP_BOTTOM, SEQ_HOLD, 1 }, /* Switch Online button or News button (< v11) */
155+
{ BT_NONE, DP_RIGHT, SEQ_MASH, 6 }, /* Sleep button */
156+
{ BT_NONE, DP_LEFT, SEQ_MASH, 1 }, /* Settings button */
153157
{ BT_A, DP_NEUTRAL, SEQ_HOLD, 1 }, /* Enter settings */
154158
{ BT_NONE, DP_NEUTRAL, SEQ_HOLD, 20 }, /* Wait for settings */
155159
{ BT_NONE, DP_BOTTOM, SEQ_MASH, 14 }, /* Console settings */

0 commit comments

Comments
 (0)