Skip to content

Commit 5b6fd8a

Browse files
committed
Drop references to NintendoSwitch_Commands_Device.h
1 parent 7c8bb8f commit 5b6fd8a

13 files changed

+1
-73
lines changed

SerialPrograms/Source/PokemonSwSh/Programs/General/PokemonSwSh_BallThrower.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*
55
*/
66

7-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
87
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
98
#include "Pokemon/Pokemon_Strings.h"
109
#include "PokemonSwSh/PokemonSwSh_Settings.h"

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_AutoHost.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "CommonFramework/Tools/ProgramEnvironment.h"
99
#include "CommonTools/VisualDetectors/BlackScreenDetector.h"
1010
#include "CommonTools/Async/InferenceRoutines.h"
11-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
1211
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1312
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_DigitEntry.h"
1413
#include "Pokemon/Pokemon_Strings.h"
@@ -219,10 +218,6 @@ void run_autohost(
219218

220219
// Mash A until it's time to close the game.
221220
if (stream.video().snapshot()){
222-
// WallDuration raid_start_to_exit_delay0 = std::chrono::duration_cast<WallDuration>(
223-
// std::chrono::milliseconds((uint64_t)raid_start_to_exit_delay * 1000 / TICKS_PER_SECOND)
224-
// );
225-
226221
BlackScreenOverWatcher black_screen;
227222
int ret = run_until<SwitchControllerContext>(
228223
stream, context,
@@ -238,32 +233,6 @@ void run_autohost(
238233
env.log("Timed out waiting for raid to start.", COLOR_RED);
239234
stats.add_timeout();
240235
}
241-
242-
#if 0
243-
context.wait_for_all_requests();
244-
WallClock start = current_time();
245-
// uint32_t start = system_clock(context);
246-
pbf_mash_button(context, BUTTON_A, 3 * TICKS_PER_SECOND);
247-
context.wait_for_all_requests();
248-
249-
WallClock now = start;
250-
// uint32_t now = start;
251-
while (true){
252-
if (black_screen.black_is_over(stream.video().snapshot())){
253-
env.log("Raid has Started!", COLOR_BLUE);
254-
stats.add_raid(raid_state.raiders());
255-
break;
256-
}
257-
if (now - start >= raid_start_to_exit_delay0){
258-
stats.add_timeout();
259-
break;
260-
}
261-
pbf_mash_button(context, BUTTON_A, TICKS_PER_SECOND);
262-
context.wait_for_all_requests();
263-
now = current_time();
264-
// now = system_clock(context);
265-
}
266-
#endif
267236
}else{
268237
pbf_mash_button(context, BUTTON_A, raid_start_to_exit_delay);
269238
}

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_LobbyWait.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "CommonFramework/Tools/VideoStream.h"
1212
#include "NintendoSwitch/Controllers/NintendoSwitch_Controller.h"
1313
#include "NintendoSwitch/NintendoSwitch_Settings.h"
14-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
1514
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1615
#include "PokemonSwSh/PokemonSwSh_Settings.h"
1716
#include "PokemonSwSh/Commands/PokemonSwSh_Commands_AutoHosts.h"
@@ -37,7 +36,6 @@ static RaidLobbyState raid_lobby_wait(
3736
WallClock start = current_time();
3837
WallClock deadline_start_time = start + lobby_wait_delay;
3938
WallClock deadline_lobby_limit = start + FULL_LOBBY_TIMER;
40-
// uint32_t start = system_clock(context);
4139
RaidLobbyReader inference(stream.logger(), stream.overlay());
4240
RaidLobbyState state;
4341

@@ -51,9 +49,7 @@ static RaidLobbyState raid_lobby_wait(
5149
);
5250
context.wait_for_all_requests();
5351
WallDuration time_elapsed = current_time() - start;
54-
// uint32_t time_elapsed = system_clock(context) - start;
5552
WallDuration delay = time_elapsed;
56-
// uint32_t delay = time_elapsed;
5753

5854
while (true){
5955
state = inference.read(stream.video().snapshot());

SerialPrograms/Source/PokemonSwSh/Programs/OverworldBot/PokemonSwSh_ShinyHuntAutonomous-Overworld.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "Common/Cpp/PrettyPrint.h"
99
#include "CommonFramework/Notifications/ProgramNotifications.h"
1010
#include "CommonTools/Async/InferenceRoutines.h"
11-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
1211
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1312
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1413
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -381,9 +380,6 @@ void ShinyHuntAutonomousOverworld::program(SingleSwitchProgramEnvironment& env,
381380
WallDuration TIMEOUT = WATCHDOG_TIMER0;
382381
WallDuration PERIOD = std::chrono::hours(TIME_ROLLBACK_HOURS);
383382
WallClock last_touch = current_time();
384-
// const std::chrono::milliseconds TIMEOUT((uint64_t)WATCHDOG_TIMER * 1000 / TICKS_PER_SECOND);
385-
// const uint32_t PERIOD = (uint32_t)TIME_ROLLBACK_HOURS * 3600 * TICKS_PER_SECOND;
386-
// uint32_t last_touch = system_clock(context);
387383

388384
ShinyHuntAutonomousOverworld_Descriptor::Stats& stats = env.current_stats<ShinyHuntAutonomousOverworld_Descriptor::Stats>();
389385
env.update_stats();
@@ -400,15 +396,12 @@ void ShinyHuntAutonomousOverworld::program(SingleSwitchProgramEnvironment& env,
400396
while (true){
401397
// Touch the date.
402398
if (TIME_ROLLBACK_HOURS > 0 && current_time() - last_touch >= PERIOD){
403-
// if (TIME_ROLLBACK_HOURS > 0 && system_clock(context) - last_touch >= PERIOD){
404399
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
405400
rollback_hours_from_home(context, TIME_ROLLBACK_HOURS, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
406401
resume_game_no_interact(env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST);
407402
last_touch += PERIOD;
408403
}
409404

410-
// cout << "TOLERATE_SYSTEM_UPDATE_MENU_FAST = " << TOLERATE_SYSTEM_UPDATE_MENU_FAST << endl;
411-
412405
auto now = current_time();
413406
if (now - last > TIMEOUT){
414407
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);

SerialPrograms/Source/PokemonSwSh/Programs/PokemonSwSh_RaidItemFarmerOKHO.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ void RaidItemFarmerOHKO::program(MultiSwitchProgramEnvironment& env, Cancellable
110110
);
111111

112112
WallClock last_touch = current_time();
113-
// uint32_t last_touch = 0;
114113
if (TOUCH_DATE_INTERVAL > 0ms){
115114
touch_date_from_home(host, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
116115
last_touch = current_time();
117-
// last_touch = system_clock(host);
118116
}
119117
env.run_in_parallel(
120118
scope,

SerialPrograms/Source/PokemonSwSh/Programs/QoLMacros/PokemonSwSh_FastCodeEntry.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
#include "Common/NintendoSwitch/NintendoSwitch_ControllerDefs.h"
8-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
98
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
109
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_DigitEntry.h"
1110
#include "Pokemon/Pokemon_Strings.h"

SerialPrograms/Source/PokemonSwSh/Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-Fishing.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "CommonFramework/Notifications/ProgramNotifications.h"
88
#include "CommonFramework/VideoPipeline/VideoFeed.h"
99
#include "CommonTools/Async/InferenceRoutines.h"
10-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
1110
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1211
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1312
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -102,8 +101,6 @@ void ShinyHuntAutonomousFishing::program(SingleSwitchProgramEnvironment& env, Sw
102101

103102
WallDuration PERIOD = std::chrono::hours(TIME_ROLLBACK_HOURS);
104103
WallClock last_touch = current_time();
105-
// const uint32_t PERIOD = (uint32_t)TIME_ROLLBACK_HOURS * 3600 * TICKS_PER_SECOND;
106-
// uint32_t last_touch = system_clock(context);
107104

108105
ShinyHuntAutonomousFishing_Descriptor::Stats& stats = env.current_stats<ShinyHuntAutonomousFishing_Descriptor::Stats>();
109106
env.update_stats();
@@ -118,7 +115,6 @@ void ShinyHuntAutonomousFishing::program(SingleSwitchProgramEnvironment& env, Sw
118115
while (true){
119116
// Touch the date.
120117
if (TIME_ROLLBACK_HOURS > 0 && current_time() - last_touch >= PERIOD){
121-
// if (TIME_ROLLBACK_HOURS > 0 && system_clock(context) - last_touch >= PERIOD){
122118
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
123119
rollback_hours_from_home(context, TIME_ROLLBACK_HOURS, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
124120
resume_game_no_interact(env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST);

SerialPrograms/Source/PokemonSwSh/Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-StrongSpawn.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
#include "Common/Cpp/PrettyPrint.h"
88
#include "CommonFramework/Notifications/ProgramNotifications.h"
9-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
109
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1110
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1211
#include "PokemonSwSh/PokemonSwSh_Settings.h"
1312
#include "PokemonSwSh/Commands/PokemonSwSh_Commands_DateSpam.h"
14-
#include "PokemonSwSh/Inference/Battles/PokemonSwSh_StartBattleDetector.h"
13+
//#include "PokemonSwSh/Inference/Battles/PokemonSwSh_StartBattleDetector.h"
1514
#include "PokemonSwSh/Inference/ShinyDetection/PokemonSwSh_ShinyEncounterDetector.h"
1615
#include "PokemonSwSh/Programs/PokemonSwSh_GameEntry.h"
1716
#include "PokemonSwSh/Programs/PokemonSwSh_EncounterHandler.h"
@@ -83,8 +82,6 @@ void ShinyHuntAutonomousStrongSpawn::program(SingleSwitchProgramEnvironment& env
8382

8483
WallDuration PERIOD = std::chrono::hours(TIME_ROLLBACK_HOURS);
8584
WallClock last_touch = current_time();
86-
// const uint32_t PERIOD = (uint32_t)TIME_ROLLBACK_HOURS * 3600 * TICKS_PER_SECOND;
87-
// uint32_t last_touch = system_clock(context);
8885

8986
ShinyHuntTracker& stats = env.current_stats<ShinyHuntTracker>();
9087
env.update_stats();
@@ -98,7 +95,6 @@ void ShinyHuntAutonomousStrongSpawn::program(SingleSwitchProgramEnvironment& env
9895

9996
while (true){
10097
WallClock now = current_time();
101-
// uint32_t now = system_clock(context);
10298
if (TIME_ROLLBACK_HOURS > 0 && now - last_touch >= PERIOD){
10399
rollback_hours_from_home(context, TIME_ROLLBACK_HOURS, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
104100
last_touch += PERIOD;

SerialPrograms/Source/PokemonSwSh/Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-SwordsOfJustice.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "Common/Cpp/PrettyPrint.h"
88
#include "CommonFramework/Notifications/ProgramNotifications.h"
99
#include "CommonTools/Async/InferenceRoutines.h"
10-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
1110
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1211
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1312
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -106,8 +105,6 @@ void ShinyHuntAutonomousSwordsOfJustice::program(SingleSwitchProgramEnvironment&
106105

107106
WallDuration PERIOD = std::chrono::hours(TIME_ROLLBACK_HOURS);
108107
WallClock last_touch = current_time();
109-
// const uint32_t PERIOD = (uint32_t)TIME_ROLLBACK_HOURS * 3600 * TICKS_PER_SECOND;
110-
// uint32_t last_touch = system_clock(context);
111108

112109
ShinyHuntTracker& stats = env.current_stats<ShinyHuntTracker>();
113110
env.update_stats();
@@ -122,7 +119,6 @@ void ShinyHuntAutonomousSwordsOfJustice::program(SingleSwitchProgramEnvironment&
122119
while (true){
123120
// Touch the date.
124121
if (TIME_ROLLBACK_HOURS > 0 && current_time() - last_touch >= PERIOD){
125-
// if (TIME_ROLLBACK_HOURS > 0 && system_clock(context) - last_touch >= PERIOD){
126122
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
127123
rollback_hours_from_home(context, TIME_ROLLBACK_HOURS, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
128124
resume_game_no_interact(env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST);

SerialPrograms/Source/PokemonSwSh/Programs/ShinyHuntAutonomous/PokemonSwSh_ShinyHuntAutonomous-Whistling.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "CommonFramework/Notifications/ProgramNotifications.h"
88
#include "CommonTools/Async/InferenceRoutines.h"
9-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_Device.h"
109
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1110
#include "NintendoSwitch/NintendoSwitch_Settings.h"
1211
#include "PokemonSwSh/PokemonSwSh_Settings.h"
@@ -94,8 +93,6 @@ void ShinyHuntAutonomousWhistling::program(SingleSwitchProgramEnvironment& env,
9493

9594
WallDuration PERIOD = std::chrono::hours(TIME_ROLLBACK_HOURS);
9695
WallClock last_touch = current_time();
97-
// const uint32_t PERIOD = (uint32_t)TIME_ROLLBACK_HOURS * 3600 * TICKS_PER_SECOND;
98-
// uint32_t last_touch = system_clock(context);
9996

10097
ShinyHuntAutonomousWhistling_Descriptor::Stats& stats = env.current_stats<ShinyHuntAutonomousWhistling_Descriptor::Stats>();
10198
env.update_stats();
@@ -110,7 +107,6 @@ void ShinyHuntAutonomousWhistling::program(SingleSwitchProgramEnvironment& env,
110107
while (true){
111108
// Touch the date.
112109
if (TIME_ROLLBACK_HOURS > 0 && current_time() - last_touch >= PERIOD){
113-
// if (TIME_ROLLBACK_HOURS > 0 && system_clock(context) - last_touch >= PERIOD){
114110
pbf_press_button(context, BUTTON_HOME, 80ms, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0);
115111
rollback_hours_from_home(context, TIME_ROLLBACK_HOURS, ConsoleSettings::instance().SETTINGS_TO_HOME_DELAY0);
116112
resume_game_no_interact(env.console, context, ConsoleSettings::instance().TOLERATE_SYSTEM_UPDATE_MENU_FAST);

0 commit comments

Comments
 (0)