Skip to content

Commit c0a9895

Browse files
committed
Rename SwitchController -> ProController.
1 parent 1f4c295 commit c0a9895

File tree

647 files changed

+2660
-2662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

647 files changed

+2660
-2662
lines changed

SerialPrograms/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,14 +818,14 @@ file(GLOB MAIN_SOURCES
818818
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Device.h
819819
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_PushButtons.h
820820
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Superscalar.h
821-
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.cpp
822-
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.h
823-
Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerWithScheduler.cpp
824-
Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerWithScheduler.h
825821
Source/NintendoSwitch/Controllers/NintendoSwitch_KeyboardMapping.cpp
826822
Source/NintendoSwitch/Controllers/NintendoSwitch_KeyboardMapping.h
827-
Source/NintendoSwitch/Controllers/NintendoSwitch_SerialPABotBase.cpp
828-
Source/NintendoSwitch/Controllers/NintendoSwitch_SerialPABotBase.h
823+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController.cpp
824+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController.h
825+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProControllerWithScheduler.cpp
826+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProControllerWithScheduler.h
827+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.cpp
828+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.h
829829
Source/NintendoSwitch/Controllers/NintendoSwitch_VirtualControllerState.cpp
830830
Source/NintendoSwitch/Controllers/NintendoSwitch_VirtualControllerState.h
831831
Source/NintendoSwitch/DevPrograms/BoxDraw.cpp
@@ -1271,6 +1271,7 @@ file(GLOB MAIN_SOURCES
12711271
Source/PokemonLA/Programs/PokemonLA_GameEntry.cpp
12721272
Source/PokemonLA/Programs/PokemonLA_GameEntry.h
12731273
Source/PokemonLA/Programs/PokemonLA_GameSave.cpp
1274+
Source/PokemonLA/Programs/PokemonLA_GameSave.h
12741275
Source/PokemonLA/Programs/PokemonLA_LeapPokemonActions.cpp
12751276
Source/PokemonLA/Programs/PokemonLA_LeapPokemonActions.h
12761277
Source/PokemonLA/Programs/PokemonLA_MountChange.cpp

SerialPrograms/SerialPrograms.pro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ SOURCES += \
406406
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.cpp \
407407
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_Routines.cpp \
408408
Source/NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.cpp \
409-
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.cpp \
410-
Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerWithScheduler.cpp \
411409
Source/NintendoSwitch/Controllers/NintendoSwitch_KeyboardMapping.cpp \
412-
Source/NintendoSwitch/Controllers/NintendoSwitch_SerialPABotBase.cpp \
410+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController.cpp \
411+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.cpp \
412+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProControllerWithScheduler.cpp \
413413
Source/NintendoSwitch/Controllers/NintendoSwitch_VirtualControllerState.cpp \
414414
Source/NintendoSwitch/DevPrograms/BoxDraw.cpp \
415415
Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp \
@@ -1557,10 +1557,10 @@ HEADERS += \
15571557
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Device.h \
15581558
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_PushButtons.h \
15591559
Source/NintendoSwitch/Commands/NintendoSwitch_Messages_Superscalar.h \
1560-
Source/NintendoSwitch/Controllers/NintendoSwitch_Controller.h \
1561-
Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerWithScheduler.h \
15621560
Source/NintendoSwitch/Controllers/NintendoSwitch_KeyboardMapping.h \
1563-
Source/NintendoSwitch/Controllers/NintendoSwitch_SerialPABotBase.h \
1561+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController.h \
1562+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.h \
1563+
Source/NintendoSwitch/Controllers/NintendoSwitch_ProControllerWithScheduler.h \
15641564
Source/NintendoSwitch/Controllers/NintendoSwitch_VirtualControllerState.h \
15651565
Source/NintendoSwitch/DevPrograms/BoxDraw.h \
15661566
Source/NintendoSwitch/DevPrograms/TestProgramComputer.h \

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_Descriptor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//#include "SerialPABotBase.h"
99
#include "SerialPABotBase_Descriptor.h"
1010

11-
#include "NintendoSwitch/Controllers/NintendoSwitch_SerialPABotBase.h"
11+
#include "NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.h"
1212

1313
//#include <iostream>
1414
//using std::cout;
@@ -89,7 +89,7 @@ std::unique_ptr<AbstractController> SerialPABotBase_Descriptor::make_controller(
8989
switch (controller_type){
9090
case ControllerType::NintendoSwitch_WiredProController:
9191
return std::unique_ptr<AbstractController>(
92-
new NintendoSwitch::SwitchController_SerialPABotBase(
92+
new NintendoSwitch::ProController_SerialPABotBase(
9393
logger,
9494
static_cast<SerialPABotBase::SerialPABotBase_Connection&>(connection),
9595
requirements

SerialPrograms/Source/Integrations/ProgramTracker.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "CommonFramework/VideoPipeline/VideoFeed.h"
1010
#include "Controllers/ControllerSession.h"
1111
#include "Controllers/SerialPABotBase/SerialPABotBase_Connection.h"
12-
#include "NintendoSwitch/Controllers/NintendoSwitch_Controller.h"
12+
#include "NintendoSwitch/Controllers/NintendoSwitch_ProController.h"
1313
#include "NintendoSwitch/Commands/NintendoSwitch_Messages_Superscalar.h"
1414
#include "ProgramTracker.h"
1515

@@ -125,8 +125,8 @@ std::string ProgramTracker::nsw_press_button(uint64_t console_id, NintendoSwitch
125125
Milliseconds duration = ticks * 8ms;
126126
std::string err;
127127
try{
128-
err = iter->second.first->controller().try_run<SwitchController>(
129-
[=](SwitchController& controller){
128+
err = iter->second.first->controller().try_run<ProController>(
129+
[=](ProController& controller){
130130
controller.issue_buttons(nullptr, button, duration, duration, 0ms);
131131
}
132132
);
@@ -155,8 +155,8 @@ std::string ProgramTracker::nsw_press_dpad(uint64_t console_id, NintendoSwitch::
155155
Milliseconds duration = ticks * 8ms;
156156
std::string err;
157157
try{
158-
err = iter->second.first->controller().try_run<SwitchController>(
159-
[=](SwitchController& controller){
158+
err = iter->second.first->controller().try_run<ProController>(
159+
[=](ProController& controller){
160160
controller.issue_dpad(nullptr, position, duration, duration, 0ms);
161161
}
162162
);
@@ -185,8 +185,8 @@ std::string ProgramTracker::nsw_press_left_joystick(uint64_t console_id, uint8_t
185185
Milliseconds duration = ticks * 8ms;
186186
std::string err;
187187
try{
188-
err = iter->second.first->controller().try_run<SwitchController>(
189-
[=](SwitchController& controller){
188+
err = iter->second.first->controller().try_run<ProController>(
189+
[=](ProController& controller){
190190
controller.issue_left_joystick(nullptr, x, y, duration, duration, 0ms);
191191
}
192192
);
@@ -215,8 +215,8 @@ std::string ProgramTracker::nsw_press_right_joystick(uint64_t console_id, uint8_
215215
Milliseconds duration = ticks * 8ms;
216216
std::string err;
217217
try{
218-
err = iter->second.first->controller().try_run<SwitchController>(
219-
[=](SwitchController& controller){
218+
err = iter->second.first->controller().try_run<ProController>(
219+
[=](ProController& controller){
220220
controller.issue_right_joystick(nullptr, x, y, duration, duration, 0ms);
221221
}
222222
);

SerialPrograms/Source/NintendoSwitch/Commands/NintendoSwitch_Commands_DigitEntry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ namespace NintendoSwitch{
3737
const uint8_t XCORD[] = {1, 0, 1, 2, 0, 1, 2, 0, 1, 2};
3838
const uint8_t YCORD[] = {3, 0, 0, 0, 1, 1, 1, 2, 2, 2};
3939

40-
void code_entry_scroll(SwitchControllerContext& context, DpadPosition direction){
40+
void code_entry_scroll(ProControllerContext& context, DpadPosition direction){
4141
pbf_wait(context, CODE_DELAY);
4242
ssf_issue_scroll(context, direction, 0);
4343
}
4444
uint16_t scroll_to(
45-
SwitchControllerContext& context,
45+
ProControllerContext& context,
4646
uint8_t start_digit, uint8_t end_digit, bool actually_scroll
4747
){
4848
// Returns the # of ticks needed to scroll from "start_digit" to "end_digit".
@@ -142,7 +142,7 @@ uint16_t scroll_to(
142142

143143

144144

145-
void enter_digits(SwitchControllerContext& context, uint8_t count, const uint8_t* digits){
145+
void enter_digits(ProControllerContext& context, uint8_t count, const uint8_t* digits){
146146
#if 0
147147
context.issue_request(DeviceRequest_enter_digits(count, digits));
148148
#else
@@ -229,7 +229,7 @@ void enter_digits(SwitchControllerContext& context, uint8_t count, const uint8_t
229229
}
230230

231231

232-
void enter_digits_str(SwitchControllerContext& context, uint8_t count, const char* digits){
232+
void enter_digits_str(ProControllerContext& context, uint8_t count, const char* digits){
233233
enter_digits(context, count, (const uint8_t*)digits);
234234
}
235235
uint8_t convert_digit(uint8_t digit){

SerialPrograms/Source/NintendoSwitch/Commands/NintendoSwitch_Commands_DigitEntry.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#ifndef PokemonAutomation_NintendoSwitch_Commands_DigitEntry_H
88
#define PokemonAutomation_NintendoSwitch_Commands_DigitEntry_H
99

10-
#include "NintendoSwitch/Controllers/NintendoSwitch_Controller.h"
10+
#include "NintendoSwitch/Controllers/NintendoSwitch_ProController.h"
1111

1212
namespace PokemonAutomation{
1313
namespace NintendoSwitch{
1414

1515

16-
void enter_digits_str (SwitchControllerContext& context, uint8_t count, const char* digits);
17-
void enter_digits (SwitchControllerContext& context, uint8_t count, const uint8_t* digits);
16+
void enter_digits_str (ProControllerContext& context, uint8_t count, const char* digits);
17+
void enter_digits (ProControllerContext& context, uint8_t count, const uint8_t* digits);
1818

1919

2020

SerialPrograms/Source/NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ namespace PokemonAutomation{
1515
namespace NintendoSwitch{
1616

1717

18-
void pbf_wait(SwitchControllerContext& context, uint16_t ticks){
18+
void pbf_wait(ProControllerContext& context, uint16_t ticks){
1919
ssf_do_nothing(context, ticks);
2020
}
21-
void pbf_wait(SwitchControllerContext& context, Milliseconds duration){
21+
void pbf_wait(ProControllerContext& context, Milliseconds duration){
2222
ssf_do_nothing(context, duration);
2323
}
24-
void pbf_press_button(SwitchControllerContext& context, Button button, uint16_t hold_ticks, uint16_t release_ticks){
24+
void pbf_press_button(ProControllerContext& context, Button button, uint16_t hold_ticks, uint16_t release_ticks){
2525
uint32_t delay = (uint32_t)hold_ticks + release_ticks;
2626
if ((uint16_t)delay == delay){
2727
ssf_press_button(context, button, (uint16_t)delay, hold_ticks, 0);
@@ -30,10 +30,10 @@ void pbf_press_button(SwitchControllerContext& context, Button button, uint16_t
3030
ssf_do_nothing(context, release_ticks);
3131
}
3232
}
33-
void pbf_press_button(SwitchControllerContext& context, Button button, Milliseconds hold, Milliseconds release){
33+
void pbf_press_button(ProControllerContext& context, Button button, Milliseconds hold, Milliseconds release){
3434
ssf_press_button(context, button, hold + release, hold, 0ms);
3535
}
36-
void pbf_press_dpad(SwitchControllerContext& context, DpadPosition position, uint16_t hold_ticks, uint16_t release_ticks){
36+
void pbf_press_dpad(ProControllerContext& context, DpadPosition position, uint16_t hold_ticks, uint16_t release_ticks){
3737
uint32_t delay = (uint32_t)hold_ticks + release_ticks;
3838
if ((uint16_t)delay == delay){
3939
ssf_press_dpad(context, position, (uint16_t)delay, hold_ticks, 0);
@@ -42,10 +42,10 @@ void pbf_press_dpad(SwitchControllerContext& context, DpadPosition position, uin
4242
ssf_do_nothing(context, release_ticks);
4343
}
4444
}
45-
void pbf_press_dpad(SwitchControllerContext& context, DpadPosition position, Milliseconds hold, Milliseconds release){
45+
void pbf_press_dpad(ProControllerContext& context, DpadPosition position, Milliseconds hold, Milliseconds release){
4646
ssf_press_dpad(context, position, hold + release, hold, 0ms);
4747
}
48-
void pbf_move_left_joystick(SwitchControllerContext& context, uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t release_ticks){
48+
void pbf_move_left_joystick(ProControllerContext& context, uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t release_ticks){
4949
uint32_t delay = (uint32_t)hold_ticks + release_ticks;
5050
if ((uint16_t)delay == delay){
5151
ssf_press_left_joystick(context, x, y, (uint16_t)delay, hold_ticks, 0);
@@ -54,10 +54,10 @@ void pbf_move_left_joystick(SwitchControllerContext& context, uint8_t x, uint8_t
5454
ssf_do_nothing(context, release_ticks);
5555
}
5656
}
57-
void pbf_move_left_joystick (SwitchControllerContext& context, uint8_t x, uint8_t y, Milliseconds hold, Milliseconds release){
57+
void pbf_move_left_joystick (ProControllerContext& context, uint8_t x, uint8_t y, Milliseconds hold, Milliseconds release){
5858
ssf_press_left_joystick(context, x, y, hold + release, hold, 0ms);
5959
}
60-
void pbf_move_right_joystick(SwitchControllerContext& context, uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t release_ticks){
60+
void pbf_move_right_joystick(ProControllerContext& context, uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t release_ticks){
6161
uint32_t delay = (uint32_t)hold_ticks + release_ticks;
6262
if ((uint16_t)delay == delay){
6363
ssf_press_right_joystick(context, x, y, (uint16_t)delay, hold_ticks, 0);
@@ -66,25 +66,25 @@ void pbf_move_right_joystick(SwitchControllerContext& context, uint8_t x, uint8_
6666
ssf_do_nothing(context, release_ticks);
6767
}
6868
}
69-
void pbf_move_right_joystick (SwitchControllerContext& context, uint8_t x, uint8_t y, Milliseconds hold, Milliseconds release){
69+
void pbf_move_right_joystick (ProControllerContext& context, uint8_t x, uint8_t y, Milliseconds hold, Milliseconds release){
7070
ssf_press_right_joystick(context, x, y, hold + release, hold, 0ms);
7171
}
72-
void pbf_mash_button(SwitchControllerContext& context, Button button, uint16_t ticks){
72+
void pbf_mash_button(ProControllerContext& context, Button button, uint16_t ticks){
7373
ssf_mash1_button(context, button, ticks);
7474
}
75-
void pbf_mash_button(SwitchControllerContext& context, Button button, Milliseconds duration){
75+
void pbf_mash_button(ProControllerContext& context, Button button, Milliseconds duration){
7676
ssf_mash1_button(context, button, duration);
7777
}
7878

79-
void grip_menu_connect_go_home(SwitchControllerContext& context){
79+
void grip_menu_connect_go_home(ProControllerContext& context){
8080
pbf_press_button(context, BUTTON_L | BUTTON_R, 10, 40);
8181
pbf_press_button(context, BUTTON_A, 10, 140);
8282
pbf_press_button(context, BUTTON_HOME, 80ms, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
8383
}
8484

8585

8686
void pbf_controller_state(
87-
SwitchControllerContext& context,
87+
ProControllerContext& context,
8888
Button button,
8989
DpadPosition position,
9090
uint8_t left_x, uint8_t left_y,
@@ -100,7 +100,7 @@ void pbf_controller_state(
100100
);
101101
}
102102
void pbf_controller_state(
103-
SwitchControllerContext& context,
103+
ProControllerContext& context,
104104
Button button,
105105
DpadPosition position,
106106
uint8_t left_x, uint8_t left_y,

0 commit comments

Comments
 (0)