Skip to content

Implement native GBA Encore timing and forced move execution - #219

Closed
Roxas2712 wants to merge 55 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-encore
Closed

Roxas2712 wants to merge 55 commits into
UNDERdecoded:mainfrom
Roxas2712:codex/gen3-encore

Conversation

@Roxas2712

@Roxas2712 Roxas2712 commented Oct 25, 2026 •

Copy link
Copy Markdown

Native GBA Encore currently stores a fixed three-phase timer without its original move slot. A previously selected alternative can still run, and the forced FIGHT path returns a nested descriptor that the native move dispatcher does not recognize.

Implement native Encore validation, its 0..3 + 3 duration draw, original-slot binding, real residual expiry and PP/slot-edit cancellation. Plan using the forced move's priority while preserving the selected target; an Encore applied later also overrides the queued move and recomputes its target with native bounded RNG/redirection. Spend the actual learned slot's PP, preserve called moves and authored handlers, and retain bindings if Encore is cleared after planning. Known authored moves do not need cartridge indices.

Keep battle.turn_started on the original declared action and battle.move_used on the actual executed move. Include Encore move/slot/duration in link state components, and use native command revision 4 to refuse older battle rules before party exchange. Native party revision and older-generation policies/goldens remain unchanged. The raw fixture changes from c2a03195bc4588f9 to 8be423c61a4477a2, independently audited with the unchanged #218 hasher and only the explicit revision token.

Stacks on #218. Gen1 remains an unchanged read-only reference; no Gen1 changes or publication.

Validation at clean feature runtime 6998a429a99dcc94d3f7c8b9a337ddfbcdaea3ba (later commit documents acceptance):

  • 637 focused Encore checks pass: 480 command/lifecycle, 99 public-command/queued-turn/authored-policy/legacy, and 58 actual link/compatibility checks. Native protocol: 154 checks.
  • 92 workers / 61,356 paired observations agree with clean Gen1 535a5ec088c1ae1bf4d91dd3e35a56f64cf46d91. The new mode retains 612 complete observations per profile: all four slots and duration draws, failure guards, custom moves, actual residual expiry/slot edits, called PP semantics, late retargeting, public choices and cancellation after planning. Every bounded RNG call/value, all battler HP/PP and public move event/target are retained.
  • Full ROM-free feature run: 113/122 engine suites, SDK 3/3 and B30. The exact Counter of all 25 inherited FAIL lines across nine suites equals clean Implement native GBA Baton Pass selection and synchronized link choices #218 (110/119). Their independent repairs remain in the combined fork.
  • Unchanged Implement native GBA Baton Pass selection and synchronized link choices #218 fails the same public command's duration and original-slot assertions, retaining three phases and no slot binding. Original raw/failed reports are retained.
  • Two actual link roles complete three native turns with Encore overriding both an already-queued Encore and a later independently selected Scratch. Learned-slot PP and every paired completed turn hash/component agree.
  • Actual local FireRed/Emerald imports pass four CPU-only scenarios: canonical public enemy selector, then public FIGHT or a separately selected move through a real turn and residual processing. No ROM/cache assets or saves are distributed; no normal SAVE is issued.
  • Combined runtime ae385bae803e8a94eb4b2c73e2c1425d1a68868d passes 234/234 engine suites, SDK 3/3, B30, the same 92/61,356 comparison and imported smoke. Integration preserves the existing native AI-order preparation and preselected double-battle enemy actions.
  • Scoped StyLua, actionlint and whitespace checks pass.

Comparison boundary: the public-choice/planning cases receive the same explicitly prepared Quick Claw word. The combined fork's C-validated native order controller prepares it earlier than Gen1's standalone command; the original failed report retains that extra 0..65535 call. No compared calls are filtered. These command-entry observations do not certify complete selection/RNG orchestration, global RNG/VBlank scheduling, GPU/pixel equality, a full playthrough or every other native producer/interaction.

See docs/native-gen3-encore.md for reproducible commands, schema mappings and limits. Hosted CI is tracked separately from local acceptance.

The documented combined snapshot is pushed as bbba8c25a6c61ea104a8ce1a2d8c4ece370e842c 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; local acceptance does not claim hosted execution. The app's 100-artifact cap prevented another attachment, but the 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