Skip to content

Commit b7e421f

Browse files
committed
Fix scheduler breaking code entry. Disable report for user error in AutoDA. Fix the SwSh LotoFarmer.
1 parent ffa195e commit b7e421f

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace PokemonAutomation{
2525
const bool IS_BETA_VERSION = false;
2626
const int PROGRAM_VERSION_MAJOR = 0;
2727
const int PROGRAM_VERSION_MINOR = 51;
28-
const int PROGRAM_VERSION_PATCH = 3;
28+
const int PROGRAM_VERSION_PATCH = 4;
2929

3030
const std::string PROGRAM_VERSION_BASE =
3131
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/Controllers/SuperscalarScheduler.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ bool SuperscalarScheduler::iterate_schedule(const Cancellable* cancellable){
5757
}
5858

5959
if (m_state_changes.empty()){
60+
// cout << "State is empty." << endl;
6061
m_device_sent_time = m_device_issue_time;
6162
return false;
6263
}
@@ -149,7 +150,7 @@ void SuperscalarScheduler::issue_wait_for_all(const Cancellable* cancellable){
149150
process_schedule(cancellable);
150151
}
151152
void SuperscalarScheduler::issue_nop(const Cancellable* cancellable, WallDuration delay){
152-
if (delay == WallDuration::zero()){
153+
if (delay <= WallDuration::zero()){
153154
return;
154155
}
155156
if (m_pending_clear.load(std::memory_order_acquire)){
@@ -160,8 +161,9 @@ void SuperscalarScheduler::issue_nop(const Cancellable* cancellable, WallDuratio
160161
// << ", sent_time = " << std::chrono::duration_cast<Milliseconds>((m_device_sent_time - m_local_start)).count()
161162
// << ", max_free_time = " << std::chrono::duration_cast<Milliseconds>((m_max_free_time - m_local_start)).count()
162163
// << endl;
163-
m_state_changes.insert(m_device_issue_time);
164-
m_device_issue_time += delay;
164+
WallClock next_issue_time = m_device_issue_time + delay;
165+
m_state_changes.insert(next_issue_time);
166+
m_device_issue_time = next_issue_time;
165167
m_max_free_time = std::max(m_max_free_time, m_device_issue_time);
166168
m_local_last_activity = current_time();
167169
process_schedule(cancellable);
@@ -200,6 +202,10 @@ void SuperscalarScheduler::issue_to_resource(
200202
);
201203
}
202204

205+
delay = std::max(delay, WallDuration::zero());
206+
hold = std::max(hold, WallDuration::zero());
207+
cooldown = std::max(cooldown, WallDuration::zero());
208+
203209
// cout << "issue_to_resource(): delay = " << std::chrono::duration_cast<Milliseconds>(delay).count()
204210
// << ", hold = " << std::chrono::duration_cast<Milliseconds>(hold).count()
205211
// << ", cooldown = " << std::chrono::duration_cast<Milliseconds>(cooldown).count()

SerialPrograms/Source/PokemonSwSh/MaxLair/Program/PokemonSwSh_MaxLair_Run_CaughtScreen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ StateMachineAction run_caught_screen(
170170
if (state == StateMachineAction::RESET_RECOVER){
171171
throw_and_log<FatalProgramException>(
172172
stream.logger(),
173-
ErrorReport::SEND_ERROR_REPORT,
173+
ErrorReport::NO_ERROR_REPORT,
174174
"Unable to take " + Pokemon::STRING_POKEMON + ". Did you forget to disable nicknames?",
175175
stream
176176
);

SerialPrograms/Source/PokemonSwSh/Programs/DateSpamFarmers/PokemonSwSh_DateSpam-LotoFarmer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void LotoFarmer::program(SingleSwitchProgramEnvironment& env, SwitchControllerCo
6464
home_roll_date_enter_game_autorollback(env.console, context, year);
6565
pbf_mash_button(context, BUTTON_B, 90);
6666

67-
pbf_press_button(context, BUTTON_A, 10, 70);
67+
pbf_press_button(context, BUTTON_A, 10, 90);
6868
pbf_press_button(context, BUTTON_B, 10, 70);
6969
pbf_press_dpad(context, DPAD_DOWN, 10, 5);
7070
pbf_mash_button(context, BUTTON_ZL, 490);

0 commit comments

Comments
 (0)