From 1345efc2512b11175c92625d386444023f1ddfec Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 19:37:42 -0800 Subject: [PATCH 1/6] Pokemon Navigation: one movement mechanics table per game Tap lengths, tile times per gait and axis, start delay and how open legs are pressed (BDSP taps, FRLG timed holds on foot), with an entry for BDSP and one for FRLG and a check of each. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../ComputerPrograms_UnitTestRunner.cpp | 2 + .../Navigation/Pokemon_MoveMechanics.h | 92 +++++++++++++++++++ .../Pokemon_MoveMechanics_Tests.cpp | 76 +++++++++++++++ .../Navigation/Pokemon_MoveMechanics_Tests.h | 22 +++++ SerialPrograms/cmake/SourceFiles.cmake | 3 + 5 files changed, 195 insertions(+) create mode 100644 SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h create mode 100644 SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp create mode 100644 SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h diff --git a/SerialPrograms/Source/ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp b/SerialPrograms/Source/ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp index 5eec7c80d7..4920e76717 100644 --- a/SerialPrograms/Source/ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp +++ b/SerialPrograms/Source/ComputerPrograms/ComputerPrograms_UnitTestRunner.cpp @@ -35,6 +35,7 @@ #include "Pokemon/Navigation/Pokemon_LegPlanner_Tests.h" #include "Pokemon/Navigation/Pokemon_LegWalker_Tests.h" #include "Pokemon/Navigation/Pokemon_MapData_Tests.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h" #include "Pokemon/Navigation/Pokemon_RouteLog_Tests.h" #include "Pokemon/Navigation/Pokemon_RuntimeMap_Tests.h" #include "Pokemon/Navigation/Pokemon_WallRecovery_Tests.h" @@ -78,6 +79,7 @@ UnitTestDatabase make_UNIT_TESTS_ALL(){ Pokemon::add_tests_LegWalker(ret); Pokemon::add_tests_WallRecovery(ret); Pokemon::add_tests_MapData(ret); + Pokemon::add_tests_MoveMechanics(ret); Pokemon::add_tests_RuntimeMap(ret); Pokemon::add_tests_RouteLog(ret); Pokemon::add_tests_AutoStory(ret); diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h new file mode 100644 index 0000000000..4aab5f79eb --- /dev/null +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h @@ -0,0 +1,92 @@ +/* Move Mechanics + * + * From: https://github.com/PokemonAutomation/ + * + * How each game moves the player for a press, as measured on the console: + * one entry per game, read by that game's walker and by its sim. + * + */ + +#ifndef PokemonAutomation_Pokemon_MoveMechanics_H +#define PokemonAutomation_Pokemon_MoveMechanics_H + +#include +#include "Common/Cpp/Time.h" +#include "Pokemon_Grid.h" + +namespace PokemonAutomation{ +namespace Pokemon{ + + +// How the walker presses an open leg, one that ends short of a wall. +enum class OpenLegPress{ + STEP_TAPS, // a step tap a tile: the count is exact + TIMED_HOLD, // one hold, timed by the tile time +}; + +// Time per tile along each axis of the screen. +struct TileTime{ + Milliseconds across; // east or west + Milliseconds up_down; // north or south + + constexpr Milliseconds along(Direction direction) const{ + return direction == Direction::EAST || direction == Direction::WEST ? across : up_down; + } +}; + +// One way of moving: walking, running or riding. +struct Gait{ + TileTime tile; + OpenLegPress open_legs; +}; + +struct MoveMechanics{ + // A tap that turns a player facing another way, without a step. + Milliseconds turn_tap; + // A tap that takes one step, and the release before the next press. + Milliseconds step_tap; + Milliseconds step_tap_release; + // From pressing, standing still, to the first step under way. + Milliseconds start_delay; + Gait walk; + // B held, once the player has the Running Shoes. + Gait run; + // None where the walker does not ride yet. + std::optional bike; +}; + + +// Brilliant Diamond and Shining Pearl, measured on console B. The camera +// tilts, so a row takes longer than a column. D-pad taps move exactly a +// tile each, while a held run overshoots about 3 tiles in 10 (2026-11-09, +// Jubilife), so open legs are tapped. Taps: PokemonBDSP_AutoStory_RouteInput.h; +// tile times: PokemonBDSP_AutoStory_RouteTiming.h. +inline constexpr MoveMechanics BDSP_MOVE_MECHANICS{ + .turn_tap = Milliseconds(50), + .step_tap = Milliseconds(160), + .step_tap_release = Milliseconds(640), + .start_delay = Milliseconds(250), + .walk = {.tile = {.across = Milliseconds(160), .up_down = Milliseconds(240)}, .open_legs = OpenLegPress::STEP_TAPS}, + .run = {.tile = {.across = Milliseconds(100), .up_down = Milliseconds(150)}, .open_legs = OpenLegPress::STEP_TAPS}, + .bike = std::nullopt, +}; + +// FireRed and LeafGreen, measured on console B: a walking tile is 16 +// frames, running 8, and a held leg stops where its time says, so open +// legs on foot are timed holds; on the Bicycle they are counted in taps. +// The walker's holds count no start delay. Measurements: +// PokemonFRLG_MovementMechanics.h and PokemonFRLG_BikeSpinMechanics.h. +inline constexpr MoveMechanics FRLG_MOVE_MECHANICS{ + .turn_tap = Milliseconds(40), + .step_tap = Milliseconds(66), + .step_tap_release = Milliseconds(700), + .start_delay = Milliseconds(0), + .walk = {.tile = {.across = Milliseconds(267), .up_down = Milliseconds(267)}, .open_legs = OpenLegPress::TIMED_HOLD}, + .run = {.tile = {.across = Milliseconds(133), .up_down = Milliseconds(133)}, .open_legs = OpenLegPress::TIMED_HOLD}, + .bike = Gait{.tile = {.across = Milliseconds(100), .up_down = Milliseconds(100)}, .open_legs = OpenLegPress::STEP_TAPS}, +}; + + +} // namespace Pokemon +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp new file mode 100644 index 0000000000..d9ab5bcdb4 --- /dev/null +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp @@ -0,0 +1,76 @@ +/* Move Mechanics Tests + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#include +#include +#include +#include +#include "Common/Cpp/TestRunners/UnitTest.h" +#include "Pokemon_MoveMechanics.h" +#include "Pokemon_MoveMechanics_Tests.h" + +namespace PokemonAutomation{ +namespace Pokemon{ +namespace{ + + +struct MoveMechanicsCase{ + std::string game; + MoveMechanics mechanics; + // How the walker presses an open leg on foot (the user's pick, + // 2026-11-11: BDSP taps, FRLG timed holds). + OpenLegPress open_legs_on_foot; +}; + +// Why `faster` is not faster than `slower` on both axes, if it is not. +std::optional not_faster(const char* faster_name, const Gait& faster, const char* slower_name, const Gait& slower){ + if (faster.tile.across >= slower.tile.across || faster.tile.up_down >= slower.tile.up_down){ + return std::format("{} ({}/{} ms) is not faster than {} ({}/{} ms).", + faster_name, faster.tile.across.count(), faster.tile.up_down.count(), + slower_name, slower.tile.across.count(), slower.tile.up_down.count()); + } + return std::nullopt; +} + +class Test_MoveMechanics : public UnitTest{ +public: + explicit Test_MoveMechanics(MoveMechanicsCase scenario) + : UnitTest("Pokemon::MoveMechanics - " + scenario.game), m_scenario(std::move(scenario)) + {} + virtual UnitTestResult run(Logger&, CancellableScope&) const override{ + const MoveMechanics& game = m_scenario.mechanics; + if (game.turn_tap >= game.step_tap){ + return std::format("The turn tap ({} ms) is not shorter than the step tap ({} ms).", + game.turn_tap.count(), game.step_tap.count()); + } + if (std::optional slower = not_faster("running", game.run, "walking", game.walk)){ + return *slower; + } + if (game.bike){ + if (std::optional slower = not_faster("the bike", *game.bike, "running", game.run)){ + return *slower; + } + } + if (game.walk.open_legs != m_scenario.open_legs_on_foot || game.run.open_legs != m_scenario.open_legs_on_foot){ + return "Open legs on foot are not pressed the way the game's walker presses them."; + } + return true; + } +private: + MoveMechanicsCase m_scenario; +}; + + +} // namespace + +void add_tests_MoveMechanics(UnitTestDatabase& database){ + database.add(MoveMechanicsCase{"BDSP", BDSP_MOVE_MECHANICS, OpenLegPress::STEP_TAPS}); + database.add(MoveMechanicsCase{"FRLG", FRLG_MOVE_MECHANICS, OpenLegPress::TIMED_HOLD}); +} + + +} // namespace Pokemon +} // namespace PokemonAutomation diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h new file mode 100644 index 0000000000..a545eae699 --- /dev/null +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h @@ -0,0 +1,22 @@ +/* Move Mechanics Tests + * + * From: https://github.com/PokemonAutomation/ + * + */ + +#ifndef PokemonAutomation_Pokemon_MoveMechanics_Tests_H +#define PokemonAutomation_Pokemon_MoveMechanics_Tests_H + +#include "Common/Cpp/TestRunners/UnitTestDatabase.h" + +namespace PokemonAutomation{ +namespace Pokemon{ + + +// Registers the checks on each game's movement table. +void add_tests_MoveMechanics(UnitTestDatabase& database); + + +} // namespace Pokemon +} // namespace PokemonAutomation +#endif diff --git a/SerialPrograms/cmake/SourceFiles.cmake b/SerialPrograms/cmake/SourceFiles.cmake index cd4fc4c225..bd96a5cd27 100644 --- a/SerialPrograms/cmake/SourceFiles.cmake +++ b/SerialPrograms/cmake/SourceFiles.cmake @@ -1480,6 +1480,9 @@ file(GLOB LIBRARY_SOURCES Source/Pokemon/Navigation/Pokemon_MapData.h Source/Pokemon/Navigation/Pokemon_MapData_Tests.cpp Source/Pokemon/Navigation/Pokemon_MapData_Tests.h + Source/Pokemon/Navigation/Pokemon_MoveMechanics.h + Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp + Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.h Source/Pokemon/Navigation/Pokemon_RuntimeMap.cpp Source/Pokemon/Navigation/Pokemon_RuntimeMap.h Source/Pokemon/Navigation/Pokemon_RuntimeMap_Tests.cpp From d1359c743442a8aa8db9271dc3328f795c511533 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 19:40:38 -0800 Subject: [PATCH 2/6] Pokemon Navigation: MoveMechanics tests from a table of cases Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Navigation/Pokemon_MoveMechanics.h | 1 + .../Pokemon_MoveMechanics_Tests.cpp | 36 ++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h index 4aab5f79eb..c96e424cd1 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h @@ -40,6 +40,7 @@ struct Gait{ OpenLegPress open_legs; }; +// How one game moves the player: its taps, and a tile time per gait. struct MoveMechanics{ // A tap that turns a player facing another way, without a step. Milliseconds turn_tap; diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp index d9ab5bcdb4..bdb39073ab 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "Common/Cpp/TestRunners/UnitTest.h" #include "Pokemon_MoveMechanics.h" @@ -17,16 +18,22 @@ namespace Pokemon{ namespace{ -struct MoveMechanicsCase{ - std::string game; +struct MoveMechanicsInput{ + std::string_view game; MoveMechanics mechanics; +}; +struct MoveMechanicsExpectation{ // How the walker presses an open leg on foot (the user's pick, // 2026-11-11: BDSP taps, FRLG timed holds). OpenLegPress open_legs_on_foot; }; +struct MoveMechanicsCase{ + MoveMechanicsInput input; + MoveMechanicsExpectation expectation; +}; // Why `faster` is not faster than `slower` on both axes, if it is not. -std::optional not_faster(const char* faster_name, const Gait& faster, const char* slower_name, const Gait& slower){ +std::optional not_faster(std::string_view faster_name, const Gait& faster, std::string_view slower_name, const Gait& slower){ if (faster.tile.across >= slower.tile.across || faster.tile.up_down >= slower.tile.up_down){ return std::format("{} ({}/{} ms) is not faster than {} ({}/{} ms).", faster_name, faster.tile.across.count(), faster.tile.up_down.count(), @@ -38,10 +45,10 @@ std::optional not_faster(const char* faster_name, const Gait& faste class Test_MoveMechanics : public UnitTest{ public: explicit Test_MoveMechanics(MoveMechanicsCase scenario) - : UnitTest("Pokemon::MoveMechanics - " + scenario.game), m_scenario(std::move(scenario)) + : UnitTest(std::format("Pokemon::MoveMechanics - {}", scenario.input.game)), m_scenario(std::move(scenario)) {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ - const MoveMechanics& game = m_scenario.mechanics; + const MoveMechanics& game = m_scenario.input.mechanics; if (game.turn_tap >= game.step_tap){ return std::format("The turn tap ({} ms) is not shorter than the step tap ({} ms).", game.turn_tap.count(), game.step_tap.count()); @@ -54,7 +61,8 @@ class Test_MoveMechanics : public UnitTest{ return *slower; } } - if (game.walk.open_legs != m_scenario.open_legs_on_foot || game.run.open_legs != m_scenario.open_legs_on_foot){ + const OpenLegPress expected = m_scenario.expectation.open_legs_on_foot; + if (game.walk.open_legs != expected || game.run.open_legs != expected){ return "Open legs on foot are not pressed the way the game's walker presses them."; } return true; @@ -63,12 +71,24 @@ class Test_MoveMechanics : public UnitTest{ MoveMechanicsCase m_scenario; }; +const MoveMechanicsCase MOVE_MECHANICS_CASES[] = { + { + .input = {.game = "BDSP", .mechanics = BDSP_MOVE_MECHANICS}, + .expectation = {.open_legs_on_foot = OpenLegPress::STEP_TAPS}, + }, + { + .input = {.game = "FRLG", .mechanics = FRLG_MOVE_MECHANICS}, + .expectation = {.open_legs_on_foot = OpenLegPress::TIMED_HOLD}, + }, +}; + } // namespace void add_tests_MoveMechanics(UnitTestDatabase& database){ - database.add(MoveMechanicsCase{"BDSP", BDSP_MOVE_MECHANICS, OpenLegPress::STEP_TAPS}); - database.add(MoveMechanicsCase{"FRLG", FRLG_MOVE_MECHANICS, OpenLegPress::TIMED_HOLD}); + for (const MoveMechanicsCase& scenario : MOVE_MECHANICS_CASES){ + database.add(scenario); + } } From 7f95d49d91180bad53b949d83b9eed57fa098ab9 Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 19:44:26 -0800 Subject: [PATCH 3/6] PokemonBDSP AutoStory: read taps and tile times from the shared table route_ms_per_tile(), the walker's step taps and the route timing and turn tap constants now come from Pokemon::BDSP_MOVE_MECHANICS; values unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp | 4 +++- .../Utils/PokemonBDSP_AutoStory_RouteInput.h | 3 ++- .../Utils/PokemonBDSP_AutoStory_RouteTiming.h | 11 ++++++----- .../Utils/PokemonBDSP_AutoStory_RouteWalk.cpp | 15 +++------------ .../Utils/PokemonBDSP_AutoStory_Walk.cpp | 8 +++++--- 5 files changed, 19 insertions(+), 22 deletions(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp index 2bbc5c993e..c3be3c8ed8 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp @@ -12,6 +12,7 @@ #include "Common/Cpp/Filesystem/Filesystem.h" #include "CommonFramework/GlobalAutoPaths.h" #include "Pokemon/Navigation/Pokemon_RouteLog.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_WalkRules.h" #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_WallRecovery.h" #include "PokemonBDSP_AutoStory_LegBattle.h" @@ -476,7 +477,8 @@ size_t RouteWalker::unstick_wall_leg(LegWalk& walk, size_t walked_tiles, size_t if (walk.result.stop == WalkStop::BLOCKED && walked_tiles + 2 < nearest){ m_io.note("[Route] " + walk.label + ": stopped after about " + std::to_string(walked_tiles) + " tiles, short of the wall; two D-pad taps, then on to the wall.", RouteNote::WARNING); - m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = 160ms, .release = 640ms, + const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; + m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = game.step_tap, .release = game.step_tap_release, .count = 2, .end = RouteInputEnd::DONE}); walk.result = m_io.walk_to_wall({.direction = walk.planned.leg.direction, .limit = limit, .label = walk.label, .options = run_watching(walk)}); walked_tiles += tiles_moved(walk.result, per_tile); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteInput.h b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteInput.h index 1148e00e5d..bd7df720e0 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteInput.h +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteInput.h @@ -14,6 +14,7 @@ #include "CommonFramework/Tools/VideoStream.h" #include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h" #include "Pokemon/Navigation/Pokemon_Grid.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -25,7 +26,7 @@ namespace PokemonBDSP{ // stick tap stepped about 0.6 tile, off the tile grid, and a 160 ms D-pad // tap steps a whole tile (r49: a stick "turn" put us a tile west of // Sandgem's Center door; r248a). -constexpr Milliseconds ROUTE_TURN_TAP = Milliseconds(50); +constexpr Milliseconds ROUTE_TURN_TAP = Pokemon::BDSP_MOVE_MECHANICS.turn_tap; // What a RouteInput presses. enum class RouteInputKind{ diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteTiming.h b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteTiming.h index 0648fe7547..3ccbc4125d 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteTiming.h +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteTiming.h @@ -14,6 +14,7 @@ #include "Common/Cpp/Time.h" #include "Controllers/Joystick.h" #include "Pokemon/Navigation/Pokemon_Grid.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" namespace PokemonAutomation{ namespace NintendoSwitch{ @@ -22,11 +23,11 @@ namespace PokemonBDSP{ // Walking time per tile, measured on the console from the post-catch save: // a row is deeper than a column is wide under the tilted camera. -constexpr Milliseconds ROUTE_MS_PER_TILE_ACROSS = Milliseconds(160); // east or west +constexpr Milliseconds ROUTE_MS_PER_TILE_ACROSS = Pokemon::BDSP_MOVE_MECHANICS.walk.tile.across; // Walking time per vertical tile (north or south). -constexpr Milliseconds ROUTE_MS_PER_TILE_UP_DOWN = Milliseconds(240); // north or south +constexpr Milliseconds ROUTE_MS_PER_TILE_UP_DOWN = Pokemon::BDSP_MOVE_MECHANICS.walk.tile.up_down; // From pressing the stick to the first step, when standing still. -constexpr Milliseconds ROUTE_START_DELAY = Milliseconds(250); +constexpr Milliseconds ROUTE_START_DELAY = Pokemon::BDSP_MOVE_MECHANICS.start_delay; // How fast the player moves on a leg to a wall (B held with the D-pad). // B only runs once Mom has given the Running Shoes (00.03); before that // it walks. The bike comes later, with its own measured times. @@ -40,9 +41,9 @@ enum class MoveSpeed{ // tile) where walking took 240. Across is scaled the same until measured. // Rounded down: a count from too fast a pace runs over, which a wall leg // forgives, where one from too slow a pace stops short of the wall. -constexpr Milliseconds ROUTE_RUN_MS_PER_TILE_ACROSS = Milliseconds(100); +constexpr Milliseconds ROUTE_RUN_MS_PER_TILE_ACROSS = Pokemon::BDSP_MOVE_MECHANICS.run.tile.across; // Running time per vertical tile (north or south). -constexpr Milliseconds ROUTE_RUN_MS_PER_TILE_UP_DOWN = Milliseconds(150); +constexpr Milliseconds ROUTE_RUN_MS_PER_TILE_UP_DOWN = Pokemon::BDSP_MOVE_MECHANICS.run.tile.up_down; // Time per tile in `direction` at `speed`. Milliseconds route_ms_per_tile(Pokemon::Direction direction, MoveSpeed speed = MoveSpeed::WALK); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp index d42cfd12e7..4abaf90d50 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp @@ -17,6 +17,7 @@ #include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "Pokemon/Navigation/Pokemon_RouteLog.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonBDSP/Inference/PokemonBDSP_DialogDetector.h" #include "PokemonBDSP/Programs/AutoStory/Detect/PokemonBDSP_AutoStory_OverworldDetector.h" #include "PokemonBDSP_AutoStory_Location.h" @@ -34,19 +35,9 @@ using namespace std::chrono_literals; using namespace Pokemon; -namespace{ - -bool across(Direction direction){ - return direction == Direction::EAST || direction == Direction::WEST; -} - -} // namespace - Milliseconds route_ms_per_tile(Direction direction, MoveSpeed speed){ - if (speed == MoveSpeed::RUN){ - return across(direction) ? ROUTE_RUN_MS_PER_TILE_ACROSS : ROUTE_RUN_MS_PER_TILE_UP_DOWN; - } - return across(direction) ? ROUTE_MS_PER_TILE_ACROSS : ROUTE_MS_PER_TILE_UP_DOWN; + const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; + return (speed == MoveSpeed::RUN ? game.run : game.walk).tile.along(direction); } JoystickPosition route_stick(Direction direction){ diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp index ee57909017..6116898666 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp @@ -19,6 +19,7 @@ #include "CommonTools/VisualDetectors/BlackScreenDetector.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_Superscalar.h" +#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonBDSP/Inference/PokemonBDSP_DialogDetector.h" #include "PokemonBDSP/Inference/PokemonBDSP_TransitionWatchers.h" #include "PokemonBDSP/Inference/Battles/PokemonBDSP_BattleMenuDetector.h" @@ -323,8 +324,9 @@ class WalkUntil{ {} WalkResult run(){ - // A tile a tap: 160 ms held, the rest released, so each chunk is one tile. - const Milliseconds CHUNK = m_spec.input == WalkInput::TAPS ? 800ms : 400ms; + // A tile a tap: the step tap held, the rest released, so each chunk is one tile. + const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; + const Milliseconds CHUNK = m_spec.input == WalkInput::TAPS ? game.step_tap + game.step_tap_release : 400ms; m_context.wait_for_all_requests(); m_result.started = current_time(); m_result.events.record({}, m_result.started); @@ -374,7 +376,7 @@ class WalkUntil{ void press(ProControllerContext& context, Milliseconds chunk) const{ switch (m_spec.input){ case WalkInput::TAPS: - pbf_press_dpad(context, m_dpad, 160ms, chunk - 160ms); + pbf_press_dpad(context, m_dpad, Pokemon::BDSP_MOVE_MECHANICS.step_tap, chunk - Pokemon::BDSP_MOVE_MECHANICS.step_tap); return; case WalkInput::DPAD_RUN: ssf_press_button(context, BUTTON_B, 0ms, chunk, 0ms); From ea0280b0852f21cdf1c882db80c85bc6b55f13fa Mon Sep 17 00:00:00 2001 From: dayfine Date: Wed, 11 Nov 2026 19:44:44 -0800 Subject: [PATCH 4/6] PokemonBDSP AutoStory: keep PlannedRoute.cpp within its line limit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp index c3be3c8ed8..ad5e549bac 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp @@ -12,7 +12,6 @@ #include "Common/Cpp/Filesystem/Filesystem.h" #include "CommonFramework/GlobalAutoPaths.h" #include "Pokemon/Navigation/Pokemon_RouteLog.h" -#include "Pokemon/Navigation/Pokemon_MoveMechanics.h" #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_WalkRules.h" #include "PokemonBDSP/Programs/AutoStory/Data/PokemonBDSP_AutoStory_WallRecovery.h" #include "PokemonBDSP_AutoStory_LegBattle.h" @@ -477,8 +476,7 @@ size_t RouteWalker::unstick_wall_leg(LegWalk& walk, size_t walked_tiles, size_t if (walk.result.stop == WalkStop::BLOCKED && walked_tiles + 2 < nearest){ m_io.note("[Route] " + walk.label + ": stopped after about " + std::to_string(walked_tiles) + " tiles, short of the wall; two D-pad taps, then on to the wall.", RouteNote::WARNING); - const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; - m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = game.step_tap, .release = game.step_tap_release, + m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = BDSP_MOVE_MECHANICS.step_tap, .release = BDSP_MOVE_MECHANICS.step_tap_release, .count = 2, .end = RouteInputEnd::DONE}); walk.result = m_io.walk_to_wall({.direction = walk.planned.leg.direction, .limit = limit, .label = walk.label, .options = run_watching(walk)}); walked_tiles += tiles_moved(walk.result, per_tile); From 78abee2da385d40de0af6aa1feda93dc95af7038 Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 00:13:54 -0800 Subject: [PATCH 5/6] Pokemon Navigation: step taps per gait; default member values; failure messages name expected and actual (#402 review) FRLG's Bicycle taps 40 ms at one per 100 ms, its walk 66 ms with a 700 ms release, so the step tap moves from MoveMechanics onto Gait. Every scalar gets a default, and the test reports which gait and which value failed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Navigation/Pokemon_MoveMechanics.h | 68 +++++++++++++------ .../Pokemon_MoveMechanics_Tests.cpp | 62 +++++++++++++---- 2 files changed, 95 insertions(+), 35 deletions(-) diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h index c96e424cd1..2b7d734b88 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics.h @@ -26,29 +26,37 @@ enum class OpenLegPress{ // Time per tile along each axis of the screen. struct TileTime{ - Milliseconds across; // east or west - Milliseconds up_down; // north or south + Milliseconds across{}; // east or west + Milliseconds up_down{}; // north or south constexpr Milliseconds along(Direction direction) const{ return direction == Direction::EAST || direction == Direction::WEST ? across : up_down; } }; +// A tap that takes one step: the press, and the release before the next +// press. Their sum is the time per tapped tile. +struct StepTap{ + Milliseconds hold{}; + Milliseconds release{}; +}; + // One way of moving: walking, running or riding. struct Gait{ TileTime tile; - OpenLegPress open_legs; + // The step tap in this gait; a game's taps differ by gait (FRLG's + // Bicycle taps far faster than its walk). + StepTap tap; + OpenLegPress open_legs = OpenLegPress::STEP_TAPS; }; -// How one game moves the player: its taps, and a tile time per gait. +// How one game moves the player: its turn tap, and a tile time and step +// tap per gait. struct MoveMechanics{ // A tap that turns a player facing another way, without a step. - Milliseconds turn_tap; - // A tap that takes one step, and the release before the next press. - Milliseconds step_tap; - Milliseconds step_tap_release; + Milliseconds turn_tap{}; // From pressing, standing still, to the first step under way. - Milliseconds start_delay; + Milliseconds start_delay{}; Gait walk; // B held, once the player has the Running Shoes. Gait run; @@ -64,27 +72,45 @@ struct MoveMechanics{ // tile times: PokemonBDSP_AutoStory_RouteTiming.h. inline constexpr MoveMechanics BDSP_MOVE_MECHANICS{ .turn_tap = Milliseconds(50), - .step_tap = Milliseconds(160), - .step_tap_release = Milliseconds(640), .start_delay = Milliseconds(250), - .walk = {.tile = {.across = Milliseconds(160), .up_down = Milliseconds(240)}, .open_legs = OpenLegPress::STEP_TAPS}, - .run = {.tile = {.across = Milliseconds(100), .up_down = Milliseconds(150)}, .open_legs = OpenLegPress::STEP_TAPS}, + .walk = { + .tile = {.across = Milliseconds(160), .up_down = Milliseconds(240)}, + .tap = {.hold = Milliseconds(160), .release = Milliseconds(640)}, + .open_legs = OpenLegPress::STEP_TAPS, + }, + .run = { + .tile = {.across = Milliseconds(100), .up_down = Milliseconds(150)}, + .tap = {.hold = Milliseconds(160), .release = Milliseconds(640)}, + .open_legs = OpenLegPress::STEP_TAPS, + }, .bike = std::nullopt, }; // FireRed and LeafGreen, measured on console B: a walking tile is 16 // frames, running 8, and a held leg stops where its time says, so open -// legs on foot are timed holds; on the Bicycle they are counted in taps. -// The walker's holds count no start delay. Measurements: -// PokemonFRLG_MovementMechanics.h and PokemonFRLG_BikeSpinMechanics.h. +// legs on foot are timed holds; on the Bicycle they are counted in taps, +// 40 ms at one per 100 ms (BIKE_TAP_PERIOD_WORKED; at a 60 ms period one +// tap in 12 drops). The walker's holds count no start delay. +// Measurements: PokemonFRLG_MovementMechanics.h and +// PokemonFRLG_BikeSpinMechanics.h. inline constexpr MoveMechanics FRLG_MOVE_MECHANICS{ .turn_tap = Milliseconds(40), - .step_tap = Milliseconds(66), - .step_tap_release = Milliseconds(700), .start_delay = Milliseconds(0), - .walk = {.tile = {.across = Milliseconds(267), .up_down = Milliseconds(267)}, .open_legs = OpenLegPress::TIMED_HOLD}, - .run = {.tile = {.across = Milliseconds(133), .up_down = Milliseconds(133)}, .open_legs = OpenLegPress::TIMED_HOLD}, - .bike = Gait{.tile = {.across = Milliseconds(100), .up_down = Milliseconds(100)}, .open_legs = OpenLegPress::STEP_TAPS}, + .walk = { + .tile = {.across = Milliseconds(267), .up_down = Milliseconds(267)}, + .tap = {.hold = Milliseconds(66), .release = Milliseconds(700)}, + .open_legs = OpenLegPress::TIMED_HOLD, + }, + .run = { + .tile = {.across = Milliseconds(133), .up_down = Milliseconds(133)}, + .tap = {.hold = Milliseconds(66), .release = Milliseconds(700)}, + .open_legs = OpenLegPress::TIMED_HOLD, + }, + .bike = Gait{ + .tile = {.across = Milliseconds(100), .up_down = Milliseconds(100)}, + .tap = {.hold = Milliseconds(40), .release = Milliseconds(60)}, + .open_legs = OpenLegPress::STEP_TAPS, + }, }; diff --git a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp index bdb39073ab..c0de39e0f5 100644 --- a/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp +++ b/SerialPrograms/Source/Pokemon/Navigation/Pokemon_MoveMechanics_Tests.cpp @@ -42,6 +42,39 @@ std::optional not_faster(std::string_view faster_name, const Gait& return std::nullopt; } +// Why the turn tap would step on foot in `gait`, if it would: a turn tap +// must be shorter than the gait's step tap. +std::optional turn_steps(std::string_view gait_name, const Gait& gait, Milliseconds turn_tap){ + if (turn_tap >= gait.tap.hold){ + return std::format("The turn tap ({} ms) is not shorter than the {} step tap ({} ms).", + turn_tap.count(), gait_name, gait.tap.hold.count()); + } + return std::nullopt; +} + +// Why a gait's step tap is unusable, if it is: both its press and its +// release must take time. +std::optional empty_tap(std::string_view gait_name, const Gait& gait){ + if (gait.tap.hold <= Milliseconds(0) || gait.tap.release <= Milliseconds(0)){ + return std::format("The {} step tap is {} ms pressed, {} ms released; both must be over 0.", + gait_name, gait.tap.hold.count(), gait.tap.release.count()); + } + return std::nullopt; +} + +std::string_view open_leg_press_name(OpenLegPress press){ + return press == OpenLegPress::STEP_TAPS ? "step taps" : "a timed hold"; +} + +// Why `gait` presses its open legs other than `expected`, if it does. +std::optional wrong_open_legs(std::string_view gait_name, const Gait& gait, OpenLegPress expected){ + if (gait.open_legs != expected){ + return std::format("Open legs {} are pressed as {}, expected {}.", + gait_name, open_leg_press_name(gait.open_legs), open_leg_press_name(expected)); + } + return std::nullopt; +} + class Test_MoveMechanics : public UnitTest{ public: explicit Test_MoveMechanics(MoveMechanicsCase scenario) @@ -49,21 +82,22 @@ class Test_MoveMechanics : public UnitTest{ {} virtual UnitTestResult run(Logger&, CancellableScope&) const override{ const MoveMechanics& game = m_scenario.input.mechanics; - if (game.turn_tap >= game.step_tap){ - return std::format("The turn tap ({} ms) is not shorter than the step tap ({} ms).", - game.turn_tap.count(), game.step_tap.count()); - } - if (std::optional slower = not_faster("running", game.run, "walking", game.walk)){ - return *slower; - } - if (game.bike){ - if (std::optional slower = not_faster("the bike", *game.bike, "running", game.run)){ - return *slower; - } - } const OpenLegPress expected = m_scenario.expectation.open_legs_on_foot; - if (game.walk.open_legs != expected || game.run.open_legs != expected){ - return "Open legs on foot are not pressed the way the game's walker presses them."; + const std::optional failures[] = { + empty_tap("walking", game.walk), + empty_tap("running", game.run), + game.bike ? empty_tap("bike", *game.bike) : std::nullopt, + turn_steps("walking", game.walk, game.turn_tap), + turn_steps("running", game.run, game.turn_tap), + not_faster("running", game.run, "walking", game.walk), + game.bike ? not_faster("the bike", *game.bike, "running", game.run) : std::nullopt, + wrong_open_legs("walking", game.walk, expected), + wrong_open_legs("running", game.run, expected), + }; + for (const std::optional& failure : failures){ + if (failure){ + return *failure; + } } return true; } From 8c66bc8f8e21b8d3e3a3f236be4826f6ca68120d Mon Sep 17 00:00:00 2001 From: dayfine Date: Thu, 12 Nov 2026 00:19:44 -0800 Subject: [PATCH 6/6] BDSP AutoStory: read the walking step tap from its gait (#404 review) Follows #402 moving the step tap onto Gait; same 160/640 ms, so presses are unchanged. Also sorts the MoveMechanics include and drops prefixes the file's using-declaration covers. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss --- .../Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp | 2 +- .../Utils/PokemonBDSP_AutoStory_RouteWalk.cpp | 4 ++-- .../AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp index ad5e549bac..e2b54c7a79 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_PlannedRoute.cpp @@ -476,7 +476,7 @@ size_t RouteWalker::unstick_wall_leg(LegWalk& walk, size_t walked_tiles, size_t if (walk.result.stop == WalkStop::BLOCKED && walked_tiles + 2 < nearest){ m_io.note("[Route] " + walk.label + ": stopped after about " + std::to_string(walked_tiles) + " tiles, short of the wall; two D-pad taps, then on to the wall.", RouteNote::WARNING); - m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = BDSP_MOVE_MECHANICS.step_tap, .release = BDSP_MOVE_MECHANICS.step_tap_release, + m_io.press({.kind = RouteInputKind::DPAD, .direction = walk.planned.leg.direction, .hold = BDSP_MOVE_MECHANICS.walk.tap.hold, .release = BDSP_MOVE_MECHANICS.walk.tap.release, .count = 2, .end = RouteInputEnd::DONE}); walk.result = m_io.walk_to_wall({.direction = walk.planned.leg.direction, .limit = limit, .label = walk.label, .options = run_watching(walk)}); walked_tiles += tiles_moved(walk.result, per_tile); diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp index 4abaf90d50..5461f08337 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_RouteWalk.cpp @@ -16,8 +16,8 @@ #include "CommonFramework/VideoPipeline/VideoFeed.h" #include "CommonTools/Async/InferenceRoutines.h" #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" -#include "Pokemon/Navigation/Pokemon_RouteLog.h" #include "Pokemon/Navigation/Pokemon_MoveMechanics.h" +#include "Pokemon/Navigation/Pokemon_RouteLog.h" #include "PokemonBDSP/Inference/PokemonBDSP_DialogDetector.h" #include "PokemonBDSP/Programs/AutoStory/Detect/PokemonBDSP_AutoStory_OverworldDetector.h" #include "PokemonBDSP_AutoStory_Location.h" @@ -36,7 +36,7 @@ using namespace Pokemon; Milliseconds route_ms_per_tile(Direction direction, MoveSpeed speed){ - const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; + const MoveMechanics& game = BDSP_MOVE_MECHANICS; return (speed == MoveSpeed::RUN ? game.run : game.walk).tile.along(direction); } diff --git a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp index 6116898666..e69c7ec902 100644 --- a/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp +++ b/SerialPrograms/Source/PokemonBDSP/Programs/AutoStory/Utils/PokemonBDSP_AutoStory_Walk.cpp @@ -325,8 +325,8 @@ class WalkUntil{ WalkResult run(){ // A tile a tap: the step tap held, the rest released, so each chunk is one tile. - const Pokemon::MoveMechanics& game = Pokemon::BDSP_MOVE_MECHANICS; - const Milliseconds CHUNK = m_spec.input == WalkInput::TAPS ? game.step_tap + game.step_tap_release : 400ms; + const Pokemon::StepTap& tap = Pokemon::BDSP_MOVE_MECHANICS.walk.tap; + const Milliseconds CHUNK = m_spec.input == WalkInput::TAPS ? tap.hold + tap.release : 400ms; m_context.wait_for_all_requests(); m_result.started = current_time(); m_result.events.record({}, m_result.started); @@ -375,9 +375,11 @@ class WalkUntil{ void press(ProControllerContext& context, Milliseconds chunk) const{ switch (m_spec.input){ - case WalkInput::TAPS: - pbf_press_dpad(context, m_dpad, Pokemon::BDSP_MOVE_MECHANICS.step_tap, chunk - Pokemon::BDSP_MOVE_MECHANICS.step_tap); + case WalkInput::TAPS:{ + const Pokemon::StepTap& tap = Pokemon::BDSP_MOVE_MECHANICS.walk.tap; + pbf_press_dpad(context, m_dpad, tap.hold, chunk - tap.hold); return; + } case WalkInput::DPAD_RUN: ssf_press_button(context, BUTTON_B, 0ms, chunk, 0ms); ssf_press_dpad(context, m_dpad, chunk, chunk, 0ms);