Skip to content

Implement native GBA Baton Pass selection and synchronized link choices - #218

Closed
Roxas2712 wants to merge 51 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-baton-pass
Closed

Roxas2712 wants to merge 51 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-baton-pass

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 25, 2026 •

Copy link
Copy Markdown

Native GBA Baton Pass currently spends PP and sets wantsSwitch, but leaves its donor active. This also leaves later queued attacks targeting the outgoing Pokémon.

Implement a resumable native replacement choice, stage/volatile transfer, public switch event and native switch-in effects. Players use the real forced party screen; NPCs use the native type heuristic. Linked players transmit their actual mid-turn choice, spectators replay it, and disconnects remain serviced while the picker owns input. Validate buffered/replayed choices, preserve owner-specific/clamped parties, refresh queued targets and defer item phases across nested called moves. Ordinary link screens still follow live or late-installed battle rosters.

Native command revision 3 guards changed battle semantics and hashes transferred special stages/seed ownership. The audited raw fixture changes from cf73a8e083fb8a54 to c2a03195bc4588f9; native party revision and older-generation goldens remain unchanged.

Stacks on #217 and the existing held-item prerequisites #165/#166. Gen1 is an unchanged read-only reference; no Gen1 changes or publication.

Validation on clean feature runtime d5ad56afccca21d107f21b5b561b908fa650e59e (later commits only document acceptance):

  • 915 focused Baton Pass checks pass: 654 command, 52 actual party UI, 72 link/spectator/disconnect, 95 packets/signatures/compatibility and 42 authored-effect/called-move checks. Native protocol 154 and existing public UI 3,002 checks also pass.
  • 88 workers / 60,132 paired observations agree with clean Gen1 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91. The new mode retains 156 complete observations per profile: actual resolvers/resumption, all four slots, empty/fainted/egg/reserved members, transferred volatiles and seed identities, one/two/three Spikes layers, called PP semantics, and the actual NPC selector including raw bounded RNG calls and empty PP.
  • Full feature run: 110/119 engine suites, SDK 3/3 and B30. The exact Counter of all 25 inherited FAIL lines across nine suites equals clean prerequisite c27c37a667e8a40613c22506448ab4886fc9b431 (105/114). Their independent repairs remain in the combined fork.
  • The same public selector on the clean prerequisite fails the actual replacement assertion, leaving the donor active. The initial Baton implementation also fails nested-choice item-phase checks. Original failing/raw reports are retained.
  • Actual local FireRed/Emerald imports select canonical BATON_PASS through the public mod and exercise the real party screen/queued turn choosing the third member, retaining stages and spending native PP once. CPU-only; no ROM/cache assets or saves are distributed.
  • Combined runtime 86b12d7b7a816a2782ba5cfba804b103630eda5b passes 231/231 engine suites, SDK 3/3, B30, the same 88/60,132 clean-reference comparison and imported smoke. Existing 4,849 party-navigation checks pass.
  • Scoped StyLua, actionlint and whitespace checks pass.

See docs/native-gen3-baton-pass.md for commands and schema mappings. These tests do not certify GPU animation, pixel equality, a full playthrough, global RNG/VBlank scheduling or complete native ability/item/side-state parity. Hosted CI status is tracked separately from local acceptance.

The documented combined snapshot is pushed as 907d500d56608a25d2f56d16be9f6563cd9c7fb0 to Roxas2712/Gen2Recomped:codex/portability-testing. Changes after the tested combined runtime only record validation. Fork main remains 13af468b.

All eight hosted workflows currently require maintainer approval (action_required). The dedicated contract run has zero jobs, so local acceptance does not claim hosted execution. The app's 100-artifact cap prevented another attachment; this regular PR remains published and linked.

# Conflicts:
#	src/mods/Loader.lua
# Conflicts:
#	docs/modding.md
#	src/mods/Loader.lua
#	src/world/WorldAPI.lua
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