Skip to content

Commit 7a8ef0b

Browse files
committed
remove more video checks
1 parent d9d3574 commit 7a8ef0b

File tree

5 files changed

+7
-72
lines changed

5 files changed

+7
-72
lines changed

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -416,66 +416,6 @@ void start_game_from_home_with_inference(
416416
}
417417
}
418418

419-
void start_game_from_home(
420-
VideoStream& stream, JoyconContext& context,
421-
bool tolerate_update_menu,
422-
uint8_t game_slot,
423-
uint8_t user_slot,
424-
Milliseconds start_game_mash
425-
){
426-
context.wait_for_all_requests();
427-
if (stream.video().snapshot()){
428-
stream.log("start_game_from_home(): Video capture available. Using inference...");
429-
start_game_from_home_with_inference(stream, context, game_slot, user_slot, start_game_mash);
430-
return;
431-
}else{
432-
stream.log("start_game_from_home(): Video capture not available.", COLOR_RED);
433-
}
434-
435-
if (game_slot != 0){
436-
ssf_press_button(context, BUTTON_HOME, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0, 160ms);
437-
for (uint8_t c = 1; c < game_slot; c++){
438-
pbf_move_joystick(context, 255, 128, 80ms, 0ms);
439-
}
440-
}
441-
442-
if (tolerate_update_menu){
443-
if (ConsoleSettings::instance().START_GAME_REQUIRES_INTERNET){
444-
throw UserSetupError(
445-
stream.logger(),
446-
"Cannot have both \"Tolerate Update Menu\" and \"Start Game Requires Internet\" enabled at the same time without video feedback."
447-
);
448-
}
449-
450-
// If the update menu isn't there, these will get swallowed by the opening
451-
// animation for the select user menu.
452-
pbf_press_button(context, BUTTON_A, 80ms, 1400ms); // Choose game
453-
pbf_move_joystick(context, 128, 255, 100ms, 0ms); // Skip the update window.
454-
move_to_user(context, user_slot);
455-
}
456-
457-
// cout << "START_GAME_REQUIRES_INTERNET = " << ConsoleSettings::instance().START_GAME_REQUIRES_INTERNET << endl;
458-
if (!ConsoleSettings::instance().START_GAME_REQUIRES_INTERNET && user_slot == 0){
459-
// Mash your way into the game.
460-
pbf_mash_button(context, BUTTON_A, start_game_mash);
461-
}else{
462-
pbf_press_button(context, BUTTON_A, 80ms, 1400ms); // Enter select user menu.
463-
move_to_user(context, user_slot);
464-
ssf_press_button(context, BUTTON_A, 160ms); // Enter game
465-
466-
// Switch to mashing ZL instead of A to get into the game.
467-
// Mash your way into the game.
468-
Milliseconds duration = start_game_mash;
469-
if (ConsoleSettings::instance().START_GAME_REQUIRES_INTERNET){
470-
// Need to wait a bit longer for the internet check.
471-
duration += ConsoleSettings::instance().START_GAME_INTERNET_CHECK_DELAY0;
472-
}
473-
// pbf_mash_button(context, BUTTON_ZL, duration);
474-
pbf_wait(context, duration);
475-
}
476-
context.wait_for_all_requests();
477-
}
478-
479419
bool openedgame_to_gamemenu(
480420
VideoStream& stream, JoyconContext& context,
481421
Milliseconds timeout

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ bool openedgame_to_gamemenu(
3636

3737

3838

39-
void start_game_from_home(
39+
void start_game_from_home_with_inference(
4040
VideoStream& stream, JoyconContext& context,
41-
bool tolerate_update_menu,
4241
uint8_t game_slot,
4342
uint8_t user_slot,
4443
Milliseconds start_game_mash

SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ namespace PokemonLGPE{
2727

2828

2929
bool reset_game_to_gamemenu(
30-
VideoStream& stream, JoyconContext& context,
31-
bool tolerate_update_menu
30+
VideoStream& stream, JoyconContext& context
3231
){
3332
close_game(stream, context);
34-
start_game_from_home(
33+
start_game_from_home_with_inference(
3534
stream,
3635
context,
37-
tolerate_update_menu,
3836
0, 0,
3937
GameSettings::instance().START_GAME_MASH0
4038
);
@@ -98,11 +96,11 @@ bool gamemenu_to_ingame(
9896

9997
bool reset_game_from_home(
10098
ProgramEnvironment& env, VideoStream& stream, JoyconContext& context,
101-
bool tolerate_update_menu,
10299
Milliseconds post_wait_time
103100
){
101+
104102
bool ok = true;
105-
ok &= reset_game_to_gamemenu(stream, context, tolerate_update_menu);
103+
ok &= reset_game_to_gamemenu(stream, context);
106104
ok &= gamemenu_to_ingame(
107105
stream, context,
108106
GameSettings::instance().ENTER_GAME_MASH0,

SerialPrograms/Source/PokemonLGPE/Programs/PokemonLGPE_GameEntry.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace PokemonLGPE{
2121
// From Switch Home menu, reset game and wait until the game menu screen (where
2222
// "Press A" is displayed to enter the game) is shown.
2323
bool reset_game_to_gamemenu(
24-
VideoStream& stream, JoyconContext& context,
25-
bool tolerate_update_menu
24+
VideoStream& stream, JoyconContext& context
2625
);
2726

2827
// From the game menu screen (where "Press A" is displayed to enter the game),
@@ -36,7 +35,6 @@ bool gamemenu_to_ingame(
3635
// post_wait_time: how many ticks to wait after the black screen (shown when loading the map) is over.
3736
bool reset_game_from_home(
3837
ProgramEnvironment& env, VideoStream& stream, JoyconContext& context,
39-
bool tolerate_update_menu,
4038
Milliseconds post_wait_time = 125ms
4139
);
4240

SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_AlolanTrade.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void AlolanTrade::program(SingleSwitchProgramEnvironment& env, CancellableScope&
250250

251251
//Reset game
252252
pbf_press_button(context, BUTTON_HOME, 200ms, 2000ms);
253-
reset_game_from_home(env, env.console, context, true, 3000ms);
253+
reset_game_from_home(env, env.console, context, 3000ms);
254254
context.wait_for_all_requests();
255255

256256
stats.resets++;

0 commit comments

Comments
 (0)