ff6sym: segment-scoped labels; RAM trace lists $1500 -> CutsceneNMI jumps #28
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-ff6sym-ram"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #25
Finding
ff6sym.py 7E:7233with the US.dbgalready printsCutsceneNMI+$0(src/cutscene/cutscene_main.asm:195); the bad output in the issue is exactly what the JP.dbggives for that address: JPUpdatePPUis at$7E:71F1, and$7233 - $71F1 = $42. The cutscene program is assembled per version (CutsceneNMI US$7E:7233, JP$7E:71BF), so a US address resolved with--version jp_v10(or a JP trace read without it) gives a JP neighbour. Only one segment runs from WRAM (cutscene_wram, start$7E:5000, both versions), and its labels carry run addresses: the RAM label choice itself was right.A real defect did exist in the label search: it walked back across segment boundaries, so an address past the end of a segment got the last label of the previous one (e.g.
7E:7C70, pastcutscene_wramend$7E:7C63, printedTownPal1+$2D; data tables got a local label of the code before them, e.g.C0:E031DTETbl+ localDrawSwitches).Changes
tools/ff6sym.py: a label names an address only inside its own segment (labels carry their segment end); docstring explains the version pitfall.draft.pyfollows the new label tuple.core/port/ram_trace.c,core/api/ff6_debug.h,hosts/cli/main.c): new edge kindFF6_RAM_EDGE_JUMP(TSVjump): RAM to RAM transfer that changes RAM region (low RAM /$7E/$7F, mirrors normalised), i.e. trampoline00:1500->CutsceneNMI. Debug only, no effect on emulation.tools/ram_trace_report.py: lists "RAM->RAM jumps between banks"; accepts-(stdin) for the trace.tools/tests/test_disasm_tools.py(tools.disasm, skips without the disassembly): US7E:7233and JP7E:71BF->CutsceneNMI+$0; JP7E:7233->UpdatePPU+$42(documents the mixup);7E:7C70-> no label; report lists00:1500 -> CutsceneNMIas a jump, US and JP.docs/ram_trace.mdupdated.Evidence
ff6cli --frames 800 --trace-ram: USjump 00:1500 7E:7233 433 368 800, JPjump 00:1500 7E:71BF 434 367 800; report:00:1500 ? -> 7E:7233 CutsceneNMI+$0 (@7233+$0)(JP7E:71BF CutsceneNMI+$0).python3 tools/draft.py field Resetworks; tools.disasm: 12/12 OK.release --fast20/20,debug --fast20/20.🤖 Generated with Claude Code