Field ports batch 1: WRAM-only leaves (timers, object order, scroll, object frames) #32

Closed
opened 2026-10-29 20:36:26 +00:00 by Gatchan · 2 comments
Owner

First field ports from the coverage order (docs/coverage.md, re/coverage/route_library.*.md), restricted to routines that only read/write WRAM/ROM data (no PPU/DMA/APU register access; those wait for the video service issue).

Candidates (check each with tools/draft.py field <name> and the disassembly; drop any that touches hardware registers): CheckTimer, DecTimersMenuBattle, _c0714a (object sort), CalcScrollPos, UpdateObjFrame, and further WRAM-only leaves from the order.

Per routine: game-terms C in core/game/field/ (provenance comment, RAM-map accessors, new map entries with evidence), bridge in core/port/, registry entry for US and JP. Validation: shadow 0 mismatch on the three routes (US+JP), route_ports_on.* pass, counts per port in the PR.

First field ports from the coverage order (docs/coverage.md, re/coverage/route_library.*.md), restricted to routines that only read/write WRAM/ROM data (no PPU/DMA/APU register access; those wait for the video service issue). Candidates (check each with `tools/draft.py field <name>` and the disassembly; drop any that touches hardware registers): CheckTimer, DecTimersMenuBattle, _c0714a (object sort), CalcScrollPos, UpdateObjFrame, and further WRAM-only leaves from the order. Per routine: game-terms C in `core/game/field/` (provenance comment, RAM-map accessors, new map entries with evidence), bridge in `core/port/`, registry entry for US and JP. Validation: shadow 0 mismatch on the three routes (US+JP), `route_ports_on.*` pass, counts per port in the PR.
Author
Owner

Starting: branch field-batch1, delegated to a fresh agent (background).

Starting: branch `field-batch1`, delegated to a fresh agent (background).
Author
Owner

Fixed by PR #35, merged in 3a60f57: six field ports (DecTimers, DecTimersMenuBattle, CalcScrollPos, GetObjMapPtr, UpdateCtrlFlags, UpdateObjFrame), readability review applied before merge.

Evidence (release build, branch head c8868cf):

  • Shadow, all ports, routes title_to_first_battle_win, title_to_mines_save, field_menu_tour, narshe_to_world_map, narshe_to_figaro, US and JP: 0 mismatch, 0 fallback, movies match; per-port call counts as in docs/ports.md.
  • Fuzz (100 random field states, seed 1, plus a stairs session) US/JP: 0 mismatch.
  • 100% of the six originals' instructions reached (docs/ports.md).
  • release ctest 61/61 including route_ports_on 10/10 (field ports on, timing-invariant checkpoints); debug and clang ctest -LE slow 24/24; 0 warnings.
    Open follow-ups: #45 (rom.ports divergences with field ports), #46 (accessor names), #33 (CheckTimer).
Fixed by PR #35, merged in 3a60f57: six field ports (DecTimers, DecTimersMenuBattle, CalcScrollPos, GetObjMapPtr, UpdateCtrlFlags, UpdateObjFrame), readability review applied before merge. Evidence (release build, branch head c8868cf): - Shadow, all ports, routes title_to_first_battle_win, title_to_mines_save, field_menu_tour, narshe_to_world_map, narshe_to_figaro, US and JP: 0 mismatch, 0 fallback, movies match; per-port call counts as in docs/ports.md. - Fuzz (100 random field states, seed 1, plus a stairs session) US/JP: 0 mismatch. - 100% of the six originals' instructions reached (docs/ports.md). - release ctest 61/61 including route_ports_on 10/10 (field ports on, timing-invariant checkpoints); debug and clang ctest -LE slow 24/24; 0 warnings. Open follow-ups: #45 (rom.ports divergences with field ports), #46 (accessor names), #33 (CheckTimer).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Gatchan/FF6Portage#32
No description provided.