Skip to content

Commit 3a40a59

Browse files
committed
right joycon checks where home press needed
1 parent 7a8ef0b commit 3a40a59

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "CommonTools/InferenceCallbacks/VisualInferenceCallback.h"
1313
#include "CommonTools/Async/InferenceRoutines.h"
1414
#include "CommonTools/VisualDetectors/BlackScreenDetector.h"
15+
#include "Controllers/ControllerTypes.h"
1516
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1617
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1718
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h"
@@ -331,6 +332,16 @@ void start_game_from_home_with_inference(
331332
Milliseconds start_game_wait
332333
){
333334
context.wait_for_all_requests();
335+
336+
if (!(context.controller().controller_type() == ControllerType::NintendoSwitch_RightJoycon)) {
337+
stream.log("Right Joycon required!", COLOR_RED);
338+
OperationFailedException::fire(
339+
ErrorReport::SEND_ERROR_REPORT,
340+
"start_game_from_home_with_inference(): Right Joycon required.",
341+
stream
342+
);
343+
}
344+
334345
{
335346
HomeWatcher detector;
336347
int ret = run_until<JoyconContext>(

SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
#include "CommonFramework/VideoPipeline/VideoFeed.h"
88
#include "CommonFramework/Tools/ErrorDumper.h"
99
#include "CommonFramework/Tools/ProgramEnvironment.h"
10+
#include "CommonFramework/Exceptions/OperationFailedException.h"
1011
#include "CommonTools/Async/InferenceRoutines.h"
1112
#include "CommonTools/VisualDetectors/BlackScreenDetector.h"
13+
#include "Controllers/ControllerCapability.h"
1214
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1315
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1416
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Routines.h"
@@ -98,7 +100,15 @@ bool reset_game_from_home(
98100
ProgramEnvironment& env, VideoStream& stream, JoyconContext& context,
99101
Milliseconds post_wait_time
100102
){
101-
103+
if (!(context.controller().controller_type() == ControllerType::NintendoSwitch_RightJoycon)) {
104+
stream.log("Right Joycon required!", COLOR_RED);
105+
OperationFailedException::fire(
106+
ErrorReport::SEND_ERROR_REPORT,
107+
"reset_game_from_home(): Right Joycon required.",
108+
stream
109+
);
110+
return false;
111+
}
102112
bool ok = true;
103113
ok &= reset_game_to_gamemenu(stream, context);
104114
ok &= gamemenu_to_ingame(

0 commit comments

Comments
 (0)