Skip to content

Command File Runner: BDSP detectors, measured D-pad taps and bdsp_load_save - #102

Merged
dayfine merged 2 commits into
lab/lab-consolefrom
lab/cfr-bdsp
Nov 1, 2026
Merged

dayfine merged 2 commits into
lab/lab-consolefrom
lab/cfr-bdsp

Conversation

@dayfine

@dayfine dayfine commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Depends on #58 (base lab/lab-console; the diff shows only this change).

The Command File Runner had no game detectors and nothing for a game to hook into, so from a command file I couldn't ask whether BDSP was showing a dialog box or a battle menu, and reloading the save was a hand-typed button sequence. This registers BDSP's cheap box detectors (bdsp_dialog, bdsp_battle_text, bdsp_battle_menu, bdsp_exp_gain, bdsp_menu, bdsp_map) and a bdsp_load_save command from BDSP's PanelListFactory constructor, adds a generic taps DIR N [all] [hold] [release] [still] that reports per tap whether the screen moved (same RMSD at 192x108 as walk), and a run_command_file_line() hook so a game command can reuse close_game and state. The README documents the new tables, how a game registers commands, and that bdsp_load_save launches whatever HOME has highlighted (check the tile with shot and dpad first). Tested with the CommandFileRunner unit tests (new taps arguments case) in --command-line-test-mode after an incremental macOS build; the fork CI (Ubuntu Default, Windows Clang, Mac) passed on this branch, and nothing has run on the console yet. The "first tap only turns" note in the taps docs was wrong: measured on 2026-10-31 in Floaroma, a tap toward a new direction turns and steps in one go, so the second commit says every tap is a step unless something blocks it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 2 commits October 31, 2026 20:12
…d_save

The runner had no game detectors and no way for a game to hook in, so a lab
operator could not ask "is this a dialog box?" or reload the BDSP save from a
command file.

- BDSP registers bdsp_dialog, bdsp_battle_text, bdsp_battle_menu,
  bdsp_exp_gain, bdsp_menu and bdsp_map, plus bdsp_load_save, from its
  PanelListFactory constructor (a static registrar in the static library
  would be dropped by the linker).
- "taps DIR N [all] [hold] [release] [still]" taps the D-pad and reports,
  per tap, whether the screen moved (RMSD at 192x108, shared with walk).
- run_command_file_line() lets a game command run built-ins such as
  close_game and state.
- README: new commands, detectors and how a game registers them.
- Tests: parsing of taps arguments.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
The taps README and code comment said the first tap of a new direction only
turns the player. Measured 2026-10-31 in Floaroma: a 160 ms left tap from
facing north moved one tile, with a screen change of about 37 at 192x108, the
same as a plain step. Say every tap is a step unless something blocks it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine marked this pull request as ready for review November 1, 2026 03:36
@dayfine
dayfine merged commit c4f4dfe into lab/lab-console Nov 1, 2026
17 checks passed
dayfine added a commit that referenced this pull request Nov 14, 2026
Console B, 2026-11-14 12:44, 14.04b onto_column_2: from the wall (1, 10)
facing south, the tree below hid the player's sprite, so the taps leg read
no facing before its one tap east; the tap only turned the player, the
screen check read it as a step, and the leg took the player as on (2, 10).
The hold south after it met the tree and "moved nothing twice".

A taps leg now turns first, with turn_to()'s checked turn tap, wherever a
held leg does (turns_first()); the rows' sim does the same, and its taps
read no facing when the sprite never shows (hidden_facing_reads SIZE_MAX).
The red sim test is that case: 14.04b from (1, 10), facing hidden and the
turn read as a step.

The re-check after that hold logged "found again at (2, 10)": a leg from
the route's given start that moved nothing leaves the player on that
start, which nothing confirmed. It now logs it as taken, unconfirmed,
not as found.

Maps: a gate may open by a quiz answer (opens_by quiz_answer, Cinnabar
Gym's doors, PokemonSimulation #102), opened only by the story, never by
a press on it as a Card Key door is. No map uses it until the map lock
moves past that PR.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013VUubhHeYSMGSSDXZkKZss
dayfine added a commit that referenced this pull request Nov 14, 2026
Pins PokemonSimulation c1962ff (#102): Cinnabar Gym's six quiz doors
(opens_by quiz_answer) and every cut tree's tile (opens_by cut, the tree's
FLAG_TEMP hide flag) are gates.

A cut tree is a new gate kind, CUT. Its gate opens when the tree is cut
(the cut_tree step on the console and both sims, tree_cut()) and closes
again on any step that leaves the map (regrow_on_warp()), as a warp
clears the temporary flag; an open gate's tile carries no object, so the
tree's object no longer blocks a plan. LEGS steps are laid out on the maps
with the opened gates, and the row sim applies a step's gates_after.

Plans: each door_N_opens opens door N, 14.02b starts with all six open,
and 14.04b starts with Celadon Gym's inner tree cut, so its row 5 is one
run west to the wall. The replay fixture re-pins ViridianCity, which
gained a cut tree gate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant