Skip to content

NintendoSwitch: read which game tile HOME has selected - #544

Closed
dayfine wants to merge 11 commits into
plza/upstream/s2-09from
plza/upstream/s2-10
Closed

dayfine wants to merge 11 commits into
plza/upstream/s2-09from
plza/upstream/s2-10

Conversation

@dayfine

@dayfine dayfine commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Depends on #543

Adds HomeTileReader, which reads which game tile HOME has selected from its cyan frame and the game name above the row, so a launch does not depend on the row's order. Its tests use HOME frames that come from the separate CommandLineTests PR (C1); this PR does not change CI's fixture checkout, so the HomeTileReader suite fails with a missing-file error until C1 lands. Fork Draft CI builds it and runs the suite. Part of the re-split of #522/#524/#525 into reviewable steps; review fixes are new commits on the PR that owns each problem, merged up the chain.

@dayfine dayfine left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed SHA: 1d8d026

Verdict

NEEDS_REWORK

First-pass review of this PR's own diff against plza/upstream/s2-09 (#543), held to the infra bar. The reader is small, readable and correct as far as I can trace it: two full-width strips, the longest run of columns that cross both frame lines, a width gate, then OCR of the name band. It returns std::optional, guards an empty frame, has a negative case (user select over HOME), and its tests follow the CheckOnlineDetector pattern. Code health: 0 failures. CRLF kept, files listed in SourceFiles.cmake. Fork Draft CI (ubuntu / build) was still pending when I looked.

High

  1. The CI change cannot go upstream and swaps every test's fixtures. .github/workflows/cpp-ci-serial-programs-base.yml:248-250 now checks out dayfine/CommandLineTests at a pinned commit for all six platforms and every suite, not only HomeTileReader. Upstream fixture updates stop reaching this branch's CI, and the PR can't be handed over with this hunk. Land the frames in PokemonAutomation/CommandLineTests first (or keep the workflow hunk in a fork-only commit that the handoff drops), and say in the description which one applies.

Medium

  1. Lab talk in code. NintendoSwitch_HomeTileReader.cpp test section: "The names HOME shows for the two games on console B's frames." and "Console B, 2026-11-14: HOME after the order changed ...". Describe the screens ("HOME after the last-played game moved to the first tile"), not our console or date (user theme T3).
  2. Comment and constants disagree. NAME_MINS = 0xff000096, NAME_MAXS = 0xff96ffff keep red <= 150 and blue >= 150, with green anything (0-255). The comment says "red low, green and blue high". Either constrain green or fix the comment. Also say why 150 (0x96).

Low

  1. This PR doesn't depend on the AutoStory chain. It includes only CommonFramework/CommonTools/Tests headers. Basing it on main instead of #543 would let it go upstream on its own, ahead of the engine.
  2. read_selected_home_tile_name(): to_blackwhite_rgb32_range(band, true, NAME_MINS, NAME_MAXS) has a bare true for an existing API. Write /*in_range_black=*/true.
  3. HOME_TILE_CASES is a namespace-scope const std::vector (non-trivial destructor). Use a const HomeTileCase[] array as the AutoStory tables do, or a function-local static.
  4. HomeTileCase::Expectation::game uses {} (empty) to mean "no game". Make it std::optional<std::string_view> to match tile.
  5. MIN_LINE_PIXELS = 3 and the 0.18-0.25 width gate need a one-line why (strip height is about 15 px at 1080p; the frame is 0.214 wide, so the gate allows how much scroll or scale?).

…creens

The workflow change that pointed every suite at a fork of CommandLineTests is
dropped; the HomeTileReader frames come from the separate CommandLineTests
change. The colour filter's comment says what it keeps, and the test comments
describe the HOME screens instead of our console and date.
@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Review fixes, tip 33bdfb5d4:

Fixed: 1 (the CI hunk is dropped; the description says the frames come from the separate CommandLineTests PR C1, so the suite fails on a missing file until it lands), 2 (console and date out of the test comments), 3 (the filter comment says red at most 150, blue at least 150, any green).
Not changed: 4 (rebasing onto main is a base change for the user to decide; this chain merges, never rebases), 5-8.

@dayfine

dayfine commented Nov 15, 2026

Copy link
Copy Markdown
Owner Author

Empty after the PLZA-minimal S2 cut (HomeTileReader / shared launch stay on the BDSP/FRLG branches). Branch kept as the base of the next PR.

@dayfine dayfine closed this Nov 15, 2026
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