Skip to content

Commit f28c3aa

Browse files
committed
migration
1 parent be88c5c commit f28c3aa

File tree

41 files changed

+85
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+85
-81
lines changed

SerialPrograms/Source/NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ void pbf_move_left_joystick (ProControllerContext& context, uint8_t x, uint8_t y
4646
void pbf_move_left_joystick(ProControllerContext& context, const JoystickPosition& position, Milliseconds hold, Milliseconds release){
4747
ssf_press_left_joystick(context, position, hold + release, hold, 0ms);
4848
}
49+
#if 0
4950
void pbf_move_right_joystick(ProControllerContext& context, uint8_t x, uint8_t y, uint16_t hold_ticks, uint16_t release_ticks){
5051
uint32_t delay = (uint32_t)hold_ticks + release_ticks;
5152
if ((uint16_t)delay == delay){
@@ -55,6 +56,7 @@ void pbf_move_right_joystick(ProControllerContext& context, uint8_t x, uint8_t y
5556
ssf_do_nothing(context, release_ticks);
5657
}
5758
}
59+
#endif
5860
void pbf_move_right_joystick (ProControllerContext& context, uint8_t x, uint8_t y, Milliseconds hold, Milliseconds release){
5961
ssf_press_right_joystick(context, x, y, hold + release, hold, 0ms);
6062
}

SerialPrograms/Source/NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ void ssf_press_left_joystick(
5656
const JoystickPosition& position,
5757
Milliseconds delay, Milliseconds hold, Milliseconds cool = 0ms
5858
);
59+
#if 0
5960
void ssf_press_right_joystick(
6061
ProControllerContext& context,
6162
uint8_t x, uint8_t y,
6263
uint16_t delay, uint16_t hold, uint8_t cool = 0
6364
);
65+
#endif
6466
void ssf_press_right_joystick(
6567
ProControllerContext& context,
6668
uint8_t x, uint8_t y,

SerialPrograms/Source/PokemonBDSP/Programs/Farming/PokemonBDSP_MoneyFarmerRoute212.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void MoneyFarmerRoute212::program(SingleSwitchProgramEnvironment& env, ProContro
321321
heal_by_global_room(env.console, context);
322322
}
323323
// Reset position to right most on the row above the rich couple
324-
pbf_move_left_joystick(context, 255, 128, 180, 0);
324+
pbf_move_left_joystick(context, 255, 128, 1440ms, 0ms);
325325
}
326326

327327
while (true){
@@ -434,7 +434,7 @@ void MoneyFarmerRoute212::program(SingleSwitchProgramEnvironment& env, ProContro
434434
continue;
435435
}
436436
}
437-
pbf_move_left_joystick(context, 255, 128, 180, 0);
437+
pbf_move_left_joystick(context, 255, 128, 1440ms, 0ms);
438438

439439
}
440440
}

SerialPrograms/Source/PokemonLA/Programs/Farming/PokemonLA_IngoBattleGrinder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ bool IngoBattleGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCo
284284
env.console.log("Switch pokemon");
285285

286286
// Go to the switching pokemon screen:
287-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
287+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
288288

289289
switch_cur_pokemon();
290290
}else{
@@ -321,7 +321,7 @@ bool IngoBattleGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCo
321321
}
322322

323323
// Go to the next move.
324-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
324+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
325325
// env.console.context().wait_for_all_requests();
326326
cur_move++;
327327
env.console.log("No PP. Use next move, " + std::to_string(cur_move), COLOR_RED);
@@ -345,12 +345,12 @@ bool IngoBattleGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCo
345345
}else if (ret == 1){
346346
env.console.log("Transparent dialogue box.");
347347

348-
pbf_press_button(context, BUTTON_B, 20, 100);
348+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
349349
context.wait_for_all_requests();
350350
}else if(ret == 2){
351351
env.console.log("Normal dialogue box.");
352352

353-
pbf_press_button(context, BUTTON_B, 20, 100);
353+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
354354
context.wait_for_all_requests();
355355
}else if (ret == 3){
356356
env.console.log("Pokemon fainted.", COLOR_RED);

SerialPrograms/Source/PokemonLA/Programs/Farming/PokemonLA_IngoMoveGrinder.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bool IngoMoveGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCont
266266
env.console.log("No PP left for pokemon " + std::to_string(cur_pokemon) + " and move " + std::to_string(cur_move));
267267
if (get_next_move_to_switch_to() == 4){
268268
// Press down to select pokemons
269-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
269+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
270270
go_to_next_pokemon(env, context);
271271

272272
}else
@@ -278,7 +278,7 @@ bool IngoMoveGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCont
278278
env.console.log("Done grinding for pokemon " + std::to_string(cur_pokemon) + " and move " + std::to_string(cur_move));
279279
if (get_next_move_to_switch_to() == 4){
280280
// Press down to select pokemons
281-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
281+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
282282
go_to_next_pokemon(env, context);
283283

284284
}else{
@@ -290,12 +290,12 @@ bool IngoMoveGrinder::run_iteration(SingleSwitchProgramEnvironment& env, ProCont
290290
}else if (ret == 1){
291291
env.console.log("Transparent dialogue box.");
292292

293-
pbf_press_button(context, BUTTON_B, 20, 100);
293+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
294294
context.wait_for_all_requests();
295295
}else if(ret == 2){
296296
env.console.log("Normal dialogue box.");
297297

298-
pbf_press_button(context, BUTTON_B, 20, 100);
298+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
299299
context.wait_for_all_requests();
300300
}else if (ret == 3){
301301
env.console.log("Pokemon fainted.", COLOR_RED);
@@ -365,7 +365,7 @@ void IngoMoveGrinder::go_to_next_move(SingleSwitchProgramEnvironment& env, ProCo
365365
size_t next_move = get_next_move_to_switch_to();
366366
for (size_t i = 0; i < next_move - cur_move; ++i)
367367
{
368-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
368+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
369369
}
370370
pbf_press_button(context, BUTTON_B, 10, 125);
371371
cur_move = next_move;

SerialPrograms/Source/PokemonLA/Programs/Farming/PokemonLA_MagikarpMoveGrinder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void MagikarpMoveGrinder::grind_mimic(SingleSwitchProgramEnvironment& env, ProCo
121121
env.console.log("Switch Pokemon after Mimic used.", COLOR_RED);;
122122

123123
// Go to the switching pokemon screen:
124-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
124+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
125125

126126
cur_pokemon = switch_pokemon(env.console, context, cur_pokemon);
127127

@@ -207,7 +207,7 @@ void MagikarpMoveGrinder::battle_magikarp(SingleSwitchProgramEnvironment& env, P
207207
pbf_press_button(context, BUTTON_B, 10, 125);
208208

209209
// Go to the switching pokemon screen:
210-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
210+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
211211

212212
cur_pokemon = switch_pokemon(env.console, context, cur_pokemon, POKEMON_ACTIONS.num_pokemon());
213213
}else{

SerialPrograms/Source/PokemonLA/Programs/Farming/PokemonLA_TenacityCandyFarmer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bool TenacityCandyFarmer::run_iteration(SingleSwitchProgramEnvironment& env, Pro
101101

102102
// Talk to Ingo to start conversation and select Path of Tenacity:
103103
// Press A to start talking
104-
pbf_press_button(context, BUTTON_A, 20, 100);
104+
pbf_press_button(context, BUTTON_A, 160ms, 800ms);
105105
// Press A to show battle type selection menu box
106106
pbf_press_button(context, BUTTON_A, 160ms, 400ms);
107107
// Move down the menu box to select Path of Tenacity
@@ -191,7 +191,7 @@ bool TenacityCandyFarmer::run_iteration(SingleSwitchProgramEnvironment& env, Pro
191191
num_turns = 0;
192192
}
193193
clearing_dialogues = true;
194-
pbf_press_button(context, BUTTON_B, 20, 100);
194+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
195195
context.wait_for_all_requests();
196196

197197
if (cur_battle >= 3){
@@ -284,12 +284,12 @@ bool TenacityCandyFarmer::run_iteration(SingleSwitchProgramEnvironment& env, Pro
284284
if (cur_move < target_move){
285285
// Move move selection down
286286
for(size_t i = 0; i < target_move - cur_move; i++){
287-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
287+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
288288
}
289289
}else if (cur_move > target_move){
290290
// Move move selection up
291291
for(size_t i = 0; i < cur_move - target_move; i++){
292-
pbf_press_dpad(context, DPAD_UP, 20, 100);
292+
pbf_press_dpad(context, DPAD_UP, 160ms, 800ms);
293293
}
294294
}
295295
cur_move = target_move;
@@ -300,7 +300,7 @@ bool TenacityCandyFarmer::run_iteration(SingleSwitchProgramEnvironment& env, Pro
300300
while (use_move(env.console, context, cur_pokemon, cur_move, no_style, check_move_success) == false){
301301
// We are still on the move selection screen. No PP.
302302
// Go to the next move.
303-
pbf_press_dpad(context, DPAD_DOWN, 20, 100);
303+
pbf_press_dpad(context, DPAD_DOWN, 160ms, 800ms);
304304
// env.console.context().wait_for_all_requests();
305305
cur_move = (cur_move + 1) % 4;
306306
env.console.log("No PP. Use next move, " + std::to_string(cur_move), COLOR_RED);

SerialPrograms/Source/PokemonLA/Programs/General/PokemonLA_ApplyGrits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ void ApplyGrits::ApplyGritsOnOnePokemon(SingleSwitchProgramEnvironment& env, Pro
9393
}
9494
for(size_t i = 0; i < grit_level_increase[grit_index]; i++){
9595
// One press to apply the Grit item
96-
pbf_press_button(context, BUTTON_A, 20, 100);
96+
pbf_press_button(context, BUTTON_A, 160ms, 800ms);
9797
// Second press to clear the message box, whether it is applied successfully or not.
98-
pbf_press_button(context, BUTTON_A, 20, 100);
98+
pbf_press_button(context, BUTTON_A, 160ms, 800ms);
9999
}
100100
}
101101

SerialPrograms/Source/PokemonLA/Programs/General/PokemonLA_SkipToFullMoon.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ void SkipToFullMoon::program(SingleSwitchProgramEnvironment& env, ProControllerC
7272
// Do another time skip:
7373

7474
// Close menu
75-
pbf_press_button(context, BUTTON_B, 20, 100);
75+
pbf_press_button(context, BUTTON_B, 160ms, 800ms);
7676
// Character turn around to face the tent
77-
pbf_move_left_joystick(context, 128, 0, 20, 100);
77+
pbf_move_left_joystick(context, 128, 0, 160ms, 800ms);
7878
// Press A to show the "how long do you rest" dialogue
7979
pbf_press_button(context, BUTTON_A, 10, 100);
8080
// Press A to show the time menu
@@ -101,7 +101,7 @@ void SkipToFullMoon::program(SingleSwitchProgramEnvironment& env, ProControllerC
101101
// std::cout << "ERROR! Cannot detect the dialogue ellipse" << std::endl;
102102
// }
103103
// Press B to clear the "You Pokemon happy and healthy" dialogue.
104-
// pbf_press_button(context, BUTTON_B, 20, 100);
104+
// pbf_press_button(context, BUTTON_B, 160ms, 800ms);
105105

106106

107107
ArcPhoneDetector arc_phone_detector(env.console, env.console, std::chrono::milliseconds(100), stop_on_detected);

SerialPrograms/Source/PokemonLA/Programs/ML/PokemonLA_GeneratePokemonImageTrainingData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ void GeneratePokemonImageTrainingData::select_starting_location(SingleSwitchProg
157157
pbf_move_left_joystick(context, {0, -1}, 1920ms, 240ms); // move backwards
158158
pbf_move_left_joystick(context, 255, 150, 960ms, 480ms); // move to right
159159
pbf_press_button(context, BUTTON_ZL, 30, 125); // rotate camera to point to where the character is facing
160-
pbf_move_left_joystick(context, 128, 0, 700, 30); // move forward
161-
pbf_move_left_joystick(context, 255, 125, 30, 60); // move to right
160+
pbf_move_left_joystick(context, 128, 0, 5600ms, 240ms); // move forward
161+
pbf_move_left_joystick(context, 255, 125, 240ms, 480ms); // move to right
162162
break;
163163
case StartingLocation::FIELDLANDS_FIELDLANDS:
164164
env.log("Starting at Fieldlands - Fieldlands Camp");

0 commit comments

Comments
 (0)