diff --git a/SerialPrograms/Source/CommonFramework/Globals.cpp b/SerialPrograms/Source/CommonFramework/Globals.cpp index 498060967..ea5f63deb 100644 --- a/SerialPrograms/Source/CommonFramework/Globals.cpp +++ b/SerialPrograms/Source/CommonFramework/Globals.cpp @@ -25,7 +25,7 @@ namespace PokemonAutomation{ const bool IS_BETA_VERSION = false; const int PROGRAM_VERSION_MAJOR = 0; const int PROGRAM_VERSION_MINOR = 51; -const int PROGRAM_VERSION_PATCH = 3; +const int PROGRAM_VERSION_PATCH = 4; const std::string PROGRAM_VERSION_BASE = "v" + std::to_string(PROGRAM_VERSION_MAJOR) + diff --git a/SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp b/SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp index d04e5d3f7..5a8b2b9f3 100644 --- a/SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp +++ b/SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp @@ -57,6 +57,7 @@ bool SuperscalarScheduler::iterate_schedule(const Cancellable* cancellable){ } if (m_state_changes.empty()){ +// cout << "State is empty." << endl; m_device_sent_time = m_device_issue_time; return false; } @@ -149,7 +150,7 @@ void SuperscalarScheduler::issue_wait_for_all(const Cancellable* cancellable){ process_schedule(cancellable); } void SuperscalarScheduler::issue_nop(const Cancellable* cancellable, WallDuration delay){ - if (delay == WallDuration::zero()){ + if (delay <= WallDuration::zero()){ return; } if (m_pending_clear.load(std::memory_order_acquire)){ @@ -160,8 +161,9 @@ void SuperscalarScheduler::issue_nop(const Cancellable* cancellable, WallDuratio // << ", sent_time = " << std::chrono::duration_cast((m_device_sent_time - m_local_start)).count() // << ", max_free_time = " << std::chrono::duration_cast((m_max_free_time - m_local_start)).count() // << endl; - m_state_changes.insert(m_device_issue_time); - m_device_issue_time += delay; + WallClock next_issue_time = m_device_issue_time + delay; + m_state_changes.insert(next_issue_time); + m_device_issue_time = next_issue_time; m_max_free_time = std::max(m_max_free_time, m_device_issue_time); m_local_last_activity = current_time(); process_schedule(cancellable); @@ -200,6 +202,10 @@ void SuperscalarScheduler::issue_to_resource( ); } + delay = std::max(delay, WallDuration::zero()); + hold = std::max(hold, WallDuration::zero()); + cooldown = std::max(cooldown, WallDuration::zero()); + // cout << "issue_to_resource(): delay = " << std::chrono::duration_cast(delay).count() // << ", hold = " << std::chrono::duration_cast(hold).count() // << ", cooldown = " << std::chrono::duration_cast(cooldown).count() diff --git a/SerialPrograms/Source/PokemonSwSh/MaxLair/Program/PokemonSwSh_MaxLair_Run_CaughtScreen.cpp b/SerialPrograms/Source/PokemonSwSh/MaxLair/Program/PokemonSwSh_MaxLair_Run_CaughtScreen.cpp index 0e9fbc1a5..fc111eef4 100644 --- a/SerialPrograms/Source/PokemonSwSh/MaxLair/Program/PokemonSwSh_MaxLair_Run_CaughtScreen.cpp +++ b/SerialPrograms/Source/PokemonSwSh/MaxLair/Program/PokemonSwSh_MaxLair_Run_CaughtScreen.cpp @@ -170,7 +170,7 @@ StateMachineAction run_caught_screen( if (state == StateMachineAction::RESET_RECOVER){ throw_and_log( stream.logger(), - ErrorReport::SEND_ERROR_REPORT, + ErrorReport::NO_ERROR_REPORT, "Unable to take " + Pokemon::STRING_POKEMON + ". Did you forget to disable nicknames?", stream ); diff --git a/SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp b/SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp index 3ab985f2c..a4cb6dd72 100644 --- a/SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp +++ b/SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp @@ -64,7 +64,7 @@ void LotoFarmer::program(SingleSwitchProgramEnvironment& env, SwitchControllerCo home_roll_date_enter_game_autorollback(env.console, context, year); pbf_mash_button(context, BUTTON_B, 90); - pbf_press_button(context, BUTTON_A, 10, 70); + pbf_press_button(context, BUTTON_A, 10, 90); pbf_press_button(context, BUTTON_B, 10, 70); pbf_press_dpad(context, DPAD_DOWN, 10, 5); pbf_mash_button(context, BUTTON_ZL, 490);