Porting tools (a): value draft generator and scratch shadow check (fixes #49) #51

Merged
Gatchan merged 3 commits from draft-tool into main 2026-11-04 10:18:04 +00:00
Owner

Value drafts from the ROM (tools/draftc.py), scratch shadow check (tools/draft_check.py), unit test tools.draftc, docs/drafts.md. Reuses the user's chrono-trigger-reimplemented draft tool (credited in headers).

Evidence: the 9 ported field routines drafted and checked on title_to_mines_save + field_menu_tour, US+JP: 291 836 calls, 0 mismatch, 0 fallback, 2 457 skipped (frame boundary). A deliberately broken TfrPal draft is caught on all 77 calls. debug and clang -LE slow 25/25, 0 warnings.

Fixes #49

🤖 Generated with Claude Code

Value drafts from the ROM (`tools/draftc.py`), scratch shadow check (`tools/draft_check.py`), unit test `tools.draftc`, `docs/drafts.md`. Reuses the user's chrono-trigger-reimplemented draft tool (credited in headers). Evidence: the 9 ported field routines drafted and checked on title_to_mines_save + field_menu_tour, US+JP: 291 836 calls, 0 mismatch, 0 fallback, 2 457 skipped (frame boundary). A deliberately broken TfrPal draft is caught on all 77 calls. debug and clang `-LE slow` 25/25, 0 warnings. Fixes #49 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Compilable C per routine with its bridge: values lifted per instruction from the ROM,
widths through SEP/REP and PHP/PLP, flag liveness, callees as functions, RAM-map and
hardware register names. Adapted from the user's chrono-trigger-reimplemented draft tool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 field drafts: title_to_mines_save + field_menu_tour, US+JP, 291836 calls, 0 mismatch,
0 fallback. Usage in docs/drafts.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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!51
No description provided.