Porting tools (e): structured drafts, jump tables, groundtruth, style checks (fixes #50) #53

Merged
Gatchan merged 5 commits from structure into main 2026-11-04 10:18:36 +00:00
Owner

Structured drafts (tools/draft_structure.py: if/else, loops, switch; goto kept only where irreducible, with the reason), jump tables as switch (x), tools/groundtruth.py (port vs draft: RAM variables and call-outs), tools/portstyle.py (10 mechanical style checks, report only), no-goto rule in CLAUDE.md rule 2. Reuses the user's CT tools.

Evidence: 9 field drafts US+JP gotos 170 -> 6 (all in UpdateObjFrame, commented), 65 jump-table routines draft and compile with -Werror (gotos 3 369 -> 885); draft_check title_to_mines_save + field_menu_tour US+JP 291 836 calls, 0 mismatch, 0 fallback; groundtruth 9/9 field ports match (battle/Rand: draft reads one extra byte, to check); portstyle 0 findings; debug and clang -LE slow 27/27.

Fixes #50

🤖 Generated with Claude Code

Structured drafts (`tools/draft_structure.py`: if/else, loops, switch; goto kept only where irreducible, with the reason), jump tables as `switch (x)`, `tools/groundtruth.py` (port vs draft: RAM variables and call-outs), `tools/portstyle.py` (10 mechanical style checks, report only), no-goto rule in CLAUDE.md rule 2. Reuses the user's CT tools. Evidence: 9 field drafts US+JP gotos 170 -> 6 (all in UpdateObjFrame, commented), 65 jump-table routines draft and compile with -Werror (gotos 3 369 -> 885); draft_check title_to_mines_save + field_menu_tour US+JP 291 836 calls, 0 mismatch, 0 fallback; groundtruth 9/9 field ports match (battle/Rand: draft reads one extra byte, to check); portstyle 0 findings; debug and clang `-LE slow` 27/27. Fixes #50 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No milestone
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!53
No description provided.