66
77
88/* Perform controller switching */
9- void switch_controller (enum switch_mode mode , enum led_state end_led_state )
9+ void switch_controller (enum switch_mode mode )
1010{
1111 if (mode == REAL_TO_VIRT ) {
12- SEND_BUTTON_SEQUENCE (KEEP_LEDS ,
12+ SEND_BUTTON_SEQUENCE (
1313 { BT_L , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Reconnect the controller */
1414 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 10 }, /* Wait for reconnection */
1515 );
1616 } else {
17- go_to_main_menu (KEEP_LEDS );
17+ go_to_main_menu ();
1818 }
1919
2020 /* In both cases, the controller is now connected, the main menu is shown, and the
2121 cursor is on the game icon */
2222
23- SEND_BUTTON_SEQUENCE (( mode == REAL_TO_VIRT ) ? KEEP_LEDS : end_led_state ,
23+ SEND_BUTTON_SEQUENCE (
2424 { BT_NONE , DP_BOTTOM , SEQ_HOLD , 1 }, /* News button */
2525 { BT_NONE , DP_RIGHT , SEQ_MASH , 3 }, /* Controllers button */
2626 { BT_A , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Enter controllers settings */
@@ -32,47 +32,47 @@ void switch_controller(enum switch_mode mode, enum led_state end_led_state)
3232 );
3333
3434 if (mode == REAL_TO_VIRT ) {
35- SEND_BUTTON_SEQUENCE (KEEP_LEDS ,
35+ SEND_BUTTON_SEQUENCE (
3636 { BT_A , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Register as controller 1 */
3737 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 15 }, /* Wait for registration */
3838
3939 { BT_H , DP_NEUTRAL , SEQ_HOLD , 2 }, /* Return to the main menu */
4040 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 25 }, /* Wait for the main menu */
4141 );
4242
43- go_to_game (end_led_state );
43+ go_to_game ();
4444 }
4545}
4646
4747
4848/* Go to the main menu, from the currently playing game or menu. */
49- void go_to_main_menu (enum led_state end_led_state )
49+ void go_to_main_menu (void )
5050{
51- SEND_BUTTON_SEQUENCE (KEEP_LEDS ,
51+ SEND_BUTTON_SEQUENCE (
5252 { BT_H , DP_NEUTRAL , SEQ_HOLD , 2 }, /* Go to main menu */
5353 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 25 }, /* Wait for the main menu */
5454 );
5555}
5656
5757
5858/* Go back to the game, from the main menu. */
59- void go_to_game (enum led_state end_led_state )
59+ void go_to_game (void )
6060{
61- SEND_BUTTON_SEQUENCE (end_led_state ,
61+ SEND_BUTTON_SEQUENCE (
6262 { BT_H , DP_NEUTRAL , SEQ_HOLD , 2 }, /* Go back to the game */
6363 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 40 }, /* Wait for the game */
6464 );
6565}
6666
6767
6868/* Configure the Switch’s clock to manual mode */
69- void set_clock_to_manual_from_any (bool in_game , enum led_state end_led_state )
69+ void set_clock_to_manual_from_any (bool in_game )
7070{
7171 if (in_game ) {
72- go_to_main_menu (KEEP_LEDS );
72+ go_to_main_menu ();
7373 }
7474
75- SEND_BUTTON_SEQUENCE (KEEP_LEDS ,
75+ SEND_BUTTON_SEQUENCE (
7676 { BT_NONE , DP_BOTTOM , SEQ_HOLD , 1 }, /* News button */
7777 { BT_NONE , DP_RIGHT , SEQ_MASH , 4 }, /* Settings button */
7878 { BT_A , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Enter settings */
@@ -90,22 +90,22 @@ void set_clock_to_manual_from_any(bool in_game, enum led_state end_led_state)
9090 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 2 }, /* Wait for menu */
9191 );
9292
93- go_to_main_menu (in_game ? KEEP_LEDS : end_led_state );
93+ go_to_main_menu ();
9494
9595 if (in_game ) {
96- go_to_game (end_led_state );
96+ go_to_game ();
9797 }
9898}
9999
100100
101101/* Configure the Switch’s clock to automatic mode */
102- void set_clock_to_auto_from_manual (bool in_game , enum led_state end_led_state )
102+ void set_clock_to_auto_from_manual (bool in_game )
103103{
104104 if (in_game ) {
105- go_to_main_menu (KEEP_LEDS );
105+ go_to_main_menu ();
106106 }
107107
108- SEND_BUTTON_SEQUENCE (NO_LEDS ,
108+ SEND_BUTTON_SEQUENCE (
109109 { BT_NONE , DP_BOTTOM , SEQ_HOLD , 1 }, /* News button */
110110 { BT_NONE , DP_RIGHT , SEQ_MASH , 4 }, /* Settings button */
111111 { BT_A , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Enter settings */
@@ -119,16 +119,16 @@ void set_clock_to_auto_from_manual(bool in_game, enum led_state end_led_state)
119119 { BT_A , DP_NEUTRAL , SEQ_MASH , 1 }, /* Set to automatic */
120120 );
121121
122- go_to_main_menu (in_game ? KEEP_LEDS : end_led_state );
122+ go_to_main_menu ();
123123
124124 if (in_game ) {
125- go_to_game (end_led_state );
125+ go_to_game ();
126126 }
127127}
128128
129129
130130/* Apply an offset to the Switch’s clock’s year. */
131- void change_clock_year (bool in_game , int8_t offset , enum led_state end_led_state )
131+ void change_clock_year (bool in_game , int8_t offset )
132132{
133133 uint8_t button ;
134134 uint8_t num ;
@@ -144,10 +144,10 @@ void change_clock_year(bool in_game, int8_t offset, enum led_state end_led_state
144144 }
145145
146146 if (in_game ) {
147- go_to_main_menu (KEEP_LEDS );
147+ go_to_main_menu ();
148148 }
149149
150- SEND_BUTTON_SEQUENCE (BOTH_LEDS ,
150+ SEND_BUTTON_SEQUENCE (
151151 { BT_NONE , DP_BOTTOM , SEQ_HOLD , 1 }, /* News button */
152152 { BT_NONE , DP_RIGHT , SEQ_MASH , 4 }, /* Settings button */
153153 { BT_A , DP_NEUTRAL , SEQ_HOLD , 1 }, /* Enter settings */
@@ -168,9 +168,9 @@ void change_clock_year(bool in_game, int8_t offset, enum led_state end_led_state
168168 { BT_NONE , DP_NEUTRAL , SEQ_HOLD , 2 }, /* Wait for menu */
169169 );
170170
171- go_to_main_menu (in_game ? KEEP_LEDS : end_led_state );
171+ go_to_main_menu ();
172172
173173 if (in_game ) {
174- go_to_game (end_led_state );
174+ go_to_game ();
175175 }
176176}
0 commit comments