From a5dd8cf2ffb216e546db317f6552cf946b08a615 Mon Sep 17 00:00:00 2001 From: theAstrogoth Date: Mon, 4 May 2026 08:05:11 -0500 Subject: [PATCH 1/2] add extra button press for German in SID sequence --- .../RngManipulation/PokemonFRLG_SidHelper.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp b/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp index 33b725ab76..93cb4670bc 100644 --- a/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp +++ b/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp @@ -101,7 +101,8 @@ namespace{ void set_sid_from_name_screen( SingleSwitchProgramEnvironment& env, ProControllerContext& context, - const uint64_t& SID_DELAY + const uint64_t& SID_DELAY, + bool extra_press_at_end ){ // this is performed blind to try to maximize consistency of timing // ensure the OK button is selected @@ -122,6 +123,12 @@ void set_sid_from_name_screen( ? SID_DELAY - 13700 : 0 ); + + if (extra_press_at_end){ + pbf_press_button(context, BUTTON_A, 200ms, 800ms); + delay -= 1000ms; + } + pbf_press_button(context, BUTTON_A, 200ms, delay); // finish dialogue and lock in SID @@ -292,10 +299,12 @@ void SidHelper::program(SingleSwitchProgramEnvironment& env, ProControllerContex const double& FIXED_ADVANCES_OFFSET = 7; // determined empirically. Probably not console/setup dependent + bool extra_press_at_end = (LANGUAGE == Language::German); + const uint64_t SID_DELAY = uint64_t((TARGET_ADVANCES - 2*FINAL_TEXT_FRAMES + FIXED_ADVANCES_OFFSET) * FRAME_DURATION / 2); // advances pass 2 by 2 env.log("Delay: " + std::to_string(SID_DELAY) + "ms"); - set_sid_from_name_screen(env, context, SID_DELAY); + set_sid_from_name_screen(env, context, SID_DELAY, extra_press_at_end); finish_intro_animations(env, context); navigate_to_trainer_card(env, context); From 87ddf2f2c835c04eda5ddb138f87c9767c253a3a Mon Sep 17 00:00:00 2001 From: theAstrogoth Date: Mon, 4 May 2026 11:01:57 -0500 Subject: [PATCH 2/2] safely subtract --- .../Programs/RngManipulation/PokemonFRLG_SidHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp b/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp index 93cb4670bc..9f4a8863a9 100644 --- a/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp +++ b/SerialPrograms/Source/PokemonFRLG/Programs/RngManipulation/PokemonFRLG_SidHelper.cpp @@ -126,7 +126,7 @@ void set_sid_from_name_screen( if (extra_press_at_end){ pbf_press_button(context, BUTTON_A, 200ms, 800ms); - delay -= 1000ms; + delay = delay > 1000ms ? delay - 1000ms : 0ms; } pbf_press_button(context, BUTTON_A, 200ms, delay);